diff --git a/public/build/admin/main.f0cc2182428bc8ac608f.css b/public/build/admin/main.71664cebfa3a198e0e91.css similarity index 99% rename from public/build/admin/main.f0cc2182428bc8ac608f.css rename to public/build/admin/main.71664cebfa3a198e0e91.css index ebf3aae8..8b71e9aa 100644 --- a/public/build/admin/main.f0cc2182428bc8ac608f.css +++ b/public/build/admin/main.71664cebfa3a198e0e91.css @@ -1,7 +1,7 @@ /*! * Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) - */@font-face{font-family:FontAwesome;src:url(/build/admin/fonts/fontawesome-webfont.8b43027f47b20503057dfbbaa9401fef.eot);src:url(/build/admin/fonts/fontawesome-webfont.8b43027f47b20503057dfbbaa9401fef.eot?#iefix&v=4.7.0) format("embedded-opentype"),url(/build/admin/fonts/fontawesome-webfont.20fd1704ea223900efa9fd4e869efb08.woff2) format("woff2"),url(/build/admin/fonts/fontawesome-webfont.f691f37e57f04c152e2315ab7dbad881.woff) format("woff"),url(/build/admin/fonts/fontawesome-webfont.1e59d2330b4c6deb84b340635ed36249.ttf) format("truetype"),url(/build/admin/fonts/fontawesome-webfont.c1e38fd9e0e74ba58f7a2b77ef29fdd3.svg#fontawesomeregular) format("svg");font-weight:400;font-style:normal}.fa{display:inline-block;font:normal normal normal 14px/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-lg{font-size:1.33333333em;line-height:.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.28571429em;text-align:center}.fa-ul{padding-left:0;margin-left:2.14285714em;list-style-type:none}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.14285714em;width:2.14285714em;top:.14285714em;text-align:center}.fa-li.fa-lg{left:-1.85714286em}.fa-border{padding:.2em .25em .15em;border:.08em solid #eee;border-radius:.1em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa.fa-pull-left{margin-right:.3em}.fa.fa-pull-right{margin-left:.3em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left{margin-right:.3em}.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(359deg);transform:rotate(359deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";-webkit-transform:scaleX(-1);-ms-transform:scaleX(-1);transform:scaleX(-1)}.fa-flip-vertical{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";-webkit-transform:scaleY(-1);-ms-transform:scaleY(-1);transform:scaleY(-1)}:root .fa-flip-horizontal,:root .fa-flip-vertical,:root .fa-rotate-90,:root .fa-rotate-180,:root .fa-rotate-270{filter:none}.fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:"\f000"}.fa-music:before{content:"\f001"}.fa-search:before{content:"\f002"}.fa-envelope-o:before{content:"\f003"}.fa-heart:before{content:"\f004"}.fa-star:before{content:"\f005"}.fa-star-o:before{content:"\f006"}.fa-user:before{content:"\f007"}.fa-film:before{content:"\f008"}.fa-th-large:before{content:"\f009"}.fa-th:before{content:"\f00a"}.fa-th-list:before{content:"\f00b"}.fa-check:before{content:"\f00c"}.fa-close:before,.fa-remove:before,.fa-times:before{content:"\f00d"}.fa-search-plus:before{content:"\f00e"}.fa-search-minus:before{content:"\f010"}.fa-power-off:before{content:"\f011"}.fa-signal:before{content:"\f012"}.fa-cog:before,.fa-gear:before{content:"\f013"}.fa-trash-o:before{content:"\f014"}.fa-home:before{content:"\f015"}.fa-file-o:before{content:"\f016"}.fa-clock-o:before{content:"\f017"}.fa-road:before{content:"\f018"}.fa-download:before{content:"\f019"}.fa-arrow-circle-o-down:before{content:"\f01a"}.fa-arrow-circle-o-up:before{content:"\f01b"}.fa-inbox:before{content:"\f01c"}.fa-play-circle-o:before{content:"\f01d"}.fa-repeat:before,.fa-rotate-right:before{content:"\f01e"}.fa-refresh:before{content:"\f021"}.fa-list-alt:before{content:"\f022"}.fa-lock:before{content:"\f023"}.fa-flag:before{content:"\f024"}.fa-headphones:before{content:"\f025"}.fa-volume-off:before{content:"\f026"}.fa-volume-down:before{content:"\f027"}.fa-volume-up:before{content:"\f028"}.fa-qrcode:before{content:"\f029"}.fa-barcode:before{content:"\f02a"}.fa-tag:before{content:"\f02b"}.fa-tags:before{content:"\f02c"}.fa-book:before{content:"\f02d"}.fa-bookmark:before{content:"\f02e"}.fa-print:before{content:"\f02f"}.fa-camera:before{content:"\f030"}.fa-font:before{content:"\f031"}.fa-bold:before{content:"\f032"}.fa-italic:before{content:"\f033"}.fa-text-height:before{content:"\f034"}.fa-text-width:before{content:"\f035"}.fa-align-left:before{content:"\f036"}.fa-align-center:before{content:"\f037"}.fa-align-right:before{content:"\f038"}.fa-align-justify:before{content:"\f039"}.fa-list:before{content:"\f03a"}.fa-dedent:before,.fa-outdent:before{content:"\f03b"}.fa-indent:before{content:"\f03c"}.fa-video-camera:before{content:"\f03d"}.fa-image:before,.fa-photo:before,.fa-picture-o:before{content:"\f03e"}.fa-pencil:before{content:"\f040"}.fa-map-marker:before{content:"\f041"}.fa-adjust:before{content:"\f042"}.fa-tint:before{content:"\f043"}.fa-edit:before,.fa-pencil-square-o:before{content:"\f044"}.fa-share-square-o:before{content:"\f045"}.fa-check-square-o:before{content:"\f046"}.fa-arrows:before{content:"\f047"}.fa-step-backward:before{content:"\f048"}.fa-fast-backward:before{content:"\f049"}.fa-backward:before{content:"\f04a"}.fa-play:before{content:"\f04b"}.fa-pause:before{content:"\f04c"}.fa-stop:before{content:"\f04d"}.fa-forward:before{content:"\f04e"}.fa-fast-forward:before{content:"\f050"}.fa-step-forward:before{content:"\f051"}.fa-eject:before{content:"\f052"}.fa-chevron-left:before{content:"\f053"}.fa-chevron-right:before{content:"\f054"}.fa-plus-circle:before{content:"\f055"}.fa-minus-circle:before{content:"\f056"}.fa-times-circle:before{content:"\f057"}.fa-check-circle:before{content:"\f058"}.fa-question-circle:before{content:"\f059"}.fa-info-circle:before{content:"\f05a"}.fa-crosshairs:before{content:"\f05b"}.fa-times-circle-o:before{content:"\f05c"}.fa-check-circle-o:before{content:"\f05d"}.fa-ban:before{content:"\f05e"}.fa-arrow-left:before{content:"\f060"}.fa-arrow-right:before{content:"\f061"}.fa-arrow-up:before{content:"\f062"}.fa-arrow-down:before{content:"\f063"}.fa-mail-forward:before,.fa-share:before{content:"\f064"}.fa-expand:before{content:"\f065"}.fa-compress:before{content:"\f066"}.fa-plus:before{content:"\f067"}.fa-minus:before{content:"\f068"}.fa-asterisk:before{content:"\f069"}.fa-exclamation-circle:before{content:"\f06a"}.fa-gift:before{content:"\f06b"}.fa-leaf:before{content:"\f06c"}.fa-fire:before{content:"\f06d"}.fa-eye:before{content:"\f06e"}.fa-eye-slash:before{content:"\f070"}.fa-exclamation-triangle:before,.fa-warning:before{content:"\f071"}.fa-plane:before{content:"\f072"}.fa-calendar:before{content:"\f073"}.fa-random:before{content:"\f074"}.fa-comment:before{content:"\f075"}.fa-magnet:before{content:"\f076"}.fa-chevron-up:before{content:"\f077"}.fa-chevron-down:before{content:"\f078"}.fa-retweet:before{content:"\f079"}.fa-shopping-cart:before{content:"\f07a"}.fa-folder:before{content:"\f07b"}.fa-folder-open:before{content:"\f07c"}.fa-arrows-v:before{content:"\f07d"}.fa-arrows-h:before{content:"\f07e"}.fa-bar-chart-o:before,.fa-bar-chart:before{content:"\f080"}.fa-twitter-square:before{content:"\f081"}.fa-facebook-square:before{content:"\f082"}.fa-camera-retro:before{content:"\f083"}.fa-key:before{content:"\f084"}.fa-cogs:before,.fa-gears:before{content:"\f085"}.fa-comments:before{content:"\f086"}.fa-thumbs-o-up:before{content:"\f087"}.fa-thumbs-o-down:before{content:"\f088"}.fa-star-half:before{content:"\f089"}.fa-heart-o:before{content:"\f08a"}.fa-sign-out:before{content:"\f08b"}.fa-linkedin-square:before{content:"\f08c"}.fa-thumb-tack:before{content:"\f08d"}.fa-external-link:before{content:"\f08e"}.fa-sign-in:before{content:"\f090"}.fa-trophy:before{content:"\f091"}.fa-github-square:before{content:"\f092"}.fa-upload:before{content:"\f093"}.fa-lemon-o:before{content:"\f094"}.fa-phone:before{content:"\f095"}.fa-square-o:before{content:"\f096"}.fa-bookmark-o:before{content:"\f097"}.fa-phone-square:before{content:"\f098"}.fa-twitter:before{content:"\f099"}.fa-facebook-f:before,.fa-facebook:before{content:"\f09a"}.fa-github:before{content:"\f09b"}.fa-unlock:before{content:"\f09c"}.fa-credit-card:before{content:"\f09d"}.fa-feed:before,.fa-rss:before{content:"\f09e"}.fa-hdd-o:before{content:"\f0a0"}.fa-bullhorn:before{content:"\f0a1"}.fa-bell:before{content:"\f0f3"}.fa-certificate:before{content:"\f0a3"}.fa-hand-o-right:before{content:"\f0a4"}.fa-hand-o-left:before{content:"\f0a5"}.fa-hand-o-up:before{content:"\f0a6"}.fa-hand-o-down:before{content:"\f0a7"}.fa-arrow-circle-left:before{content:"\f0a8"}.fa-arrow-circle-right:before{content:"\f0a9"}.fa-arrow-circle-up:before{content:"\f0aa"}.fa-arrow-circle-down:before{content:"\f0ab"}.fa-globe:before{content:"\f0ac"}.fa-wrench:before{content:"\f0ad"}.fa-tasks:before{content:"\f0ae"}.fa-filter:before{content:"\f0b0"}.fa-briefcase:before{content:"\f0b1"}.fa-arrows-alt:before{content:"\f0b2"}.fa-group:before,.fa-users:before{content:"\f0c0"}.fa-chain:before,.fa-link:before{content:"\f0c1"}.fa-cloud:before{content:"\f0c2"}.fa-flask:before{content:"\f0c3"}.fa-cut:before,.fa-scissors:before{content:"\f0c4"}.fa-copy:before,.fa-files-o:before{content:"\f0c5"}.fa-paperclip:before{content:"\f0c6"}.fa-floppy-o:before,.fa-save:before{content:"\f0c7"}.fa-square:before{content:"\f0c8"}.fa-bars:before,.fa-navicon:before,.fa-reorder:before{content:"\f0c9"}.fa-list-ul:before{content:"\f0ca"}.fa-list-ol:before{content:"\f0cb"}.fa-strikethrough:before{content:"\f0cc"}.fa-underline:before{content:"\f0cd"}.fa-table:before{content:"\f0ce"}.fa-magic:before{content:"\f0d0"}.fa-truck:before{content:"\f0d1"}.fa-pinterest:before{content:"\f0d2"}.fa-pinterest-square:before{content:"\f0d3"}.fa-google-plus-square:before{content:"\f0d4"}.fa-google-plus:before{content:"\f0d5"}.fa-money:before{content:"\f0d6"}.fa-caret-down:before{content:"\f0d7"}.fa-caret-up:before{content:"\f0d8"}.fa-caret-left:before{content:"\f0d9"}.fa-caret-right:before{content:"\f0da"}.fa-columns:before{content:"\f0db"}.fa-sort:before,.fa-unsorted:before{content:"\f0dc"}.fa-sort-desc:before,.fa-sort-down:before{content:"\f0dd"}.fa-sort-asc:before,.fa-sort-up:before{content:"\f0de"}.fa-envelope:before{content:"\f0e0"}.fa-linkedin:before{content:"\f0e1"}.fa-rotate-left:before,.fa-undo:before{content:"\f0e2"}.fa-gavel:before,.fa-legal:before{content:"\f0e3"}.fa-dashboard:before,.fa-tachometer:before{content:"\f0e4"}.fa-comment-o:before{content:"\f0e5"}.fa-comments-o:before{content:"\f0e6"}.fa-bolt:before,.fa-flash:before{content:"\f0e7"}.fa-sitemap:before{content:"\f0e8"}.fa-umbrella:before{content:"\f0e9"}.fa-clipboard:before,.fa-paste:before{content:"\f0ea"}.fa-lightbulb-o:before{content:"\f0eb"}.fa-exchange:before{content:"\f0ec"}.fa-cloud-download:before{content:"\f0ed"}.fa-cloud-upload:before{content:"\f0ee"}.fa-user-md:before{content:"\f0f0"}.fa-stethoscope:before{content:"\f0f1"}.fa-suitcase:before{content:"\f0f2"}.fa-bell-o:before{content:"\f0a2"}.fa-coffee:before{content:"\f0f4"}.fa-cutlery:before{content:"\f0f5"}.fa-file-text-o:before{content:"\f0f6"}.fa-building-o:before{content:"\f0f7"}.fa-hospital-o:before{content:"\f0f8"}.fa-ambulance:before{content:"\f0f9"}.fa-medkit:before{content:"\f0fa"}.fa-fighter-jet:before{content:"\f0fb"}.fa-beer:before{content:"\f0fc"}.fa-h-square:before{content:"\f0fd"}.fa-plus-square:before{content:"\f0fe"}.fa-angle-double-left:before{content:"\f100"}.fa-angle-double-right:before{content:"\f101"}.fa-angle-double-up:before{content:"\f102"}.fa-angle-double-down:before{content:"\f103"}.fa-angle-left:before{content:"\f104"}.fa-angle-right:before{content:"\f105"}.fa-angle-up:before{content:"\f106"}.fa-angle-down:before{content:"\f107"}.fa-desktop:before{content:"\f108"}.fa-laptop:before{content:"\f109"}.fa-tablet:before{content:"\f10a"}.fa-mobile-phone:before,.fa-mobile:before{content:"\f10b"}.fa-circle-o:before{content:"\f10c"}.fa-quote-left:before{content:"\f10d"}.fa-quote-right:before{content:"\f10e"}.fa-spinner:before{content:"\f110"}.fa-circle:before{content:"\f111"}.fa-mail-reply:before,.fa-reply:before{content:"\f112"}.fa-github-alt:before{content:"\f113"}.fa-folder-o:before{content:"\f114"}.fa-folder-open-o:before{content:"\f115"}.fa-smile-o:before{content:"\f118"}.fa-frown-o:before{content:"\f119"}.fa-meh-o:before{content:"\f11a"}.fa-gamepad:before{content:"\f11b"}.fa-keyboard-o:before{content:"\f11c"}.fa-flag-o:before{content:"\f11d"}.fa-flag-checkered:before{content:"\f11e"}.fa-terminal:before{content:"\f120"}.fa-code:before{content:"\f121"}.fa-mail-reply-all:before,.fa-reply-all:before{content:"\f122"}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:"\f123"}.fa-location-arrow:before{content:"\f124"}.fa-crop:before{content:"\f125"}.fa-code-fork:before{content:"\f126"}.fa-chain-broken:before,.fa-unlink:before{content:"\f127"}.fa-question:before{content:"\f128"}.fa-info:before{content:"\f129"}.fa-exclamation:before{content:"\f12a"}.fa-superscript:before{content:"\f12b"}.fa-subscript:before{content:"\f12c"}.fa-eraser:before{content:"\f12d"}.fa-puzzle-piece:before{content:"\f12e"}.fa-microphone:before{content:"\f130"}.fa-microphone-slash:before{content:"\f131"}.fa-shield:before{content:"\f132"}.fa-calendar-o:before{content:"\f133"}.fa-fire-extinguisher:before{content:"\f134"}.fa-rocket:before{content:"\f135"}.fa-maxcdn:before{content:"\f136"}.fa-chevron-circle-left:before{content:"\f137"}.fa-chevron-circle-right:before{content:"\f138"}.fa-chevron-circle-up:before{content:"\f139"}.fa-chevron-circle-down:before{content:"\f13a"}.fa-html5:before{content:"\f13b"}.fa-css3:before{content:"\f13c"}.fa-anchor:before{content:"\f13d"}.fa-unlock-alt:before{content:"\f13e"}.fa-bullseye:before{content:"\f140"}.fa-ellipsis-h:before{content:"\f141"}.fa-ellipsis-v:before{content:"\f142"}.fa-rss-square:before{content:"\f143"}.fa-play-circle:before{content:"\f144"}.fa-ticket:before{content:"\f145"}.fa-minus-square:before{content:"\f146"}.fa-minus-square-o:before{content:"\f147"}.fa-level-up:before{content:"\f148"}.fa-level-down:before{content:"\f149"}.fa-check-square:before{content:"\f14a"}.fa-pencil-square:before{content:"\f14b"}.fa-external-link-square:before{content:"\f14c"}.fa-share-square:before{content:"\f14d"}.fa-compass:before{content:"\f14e"}.fa-caret-square-o-down:before,.fa-toggle-down:before{content:"\f150"}.fa-caret-square-o-up:before,.fa-toggle-up:before{content:"\f151"}.fa-caret-square-o-right:before,.fa-toggle-right:before{content:"\f152"}.fa-eur:before,.fa-euro:before{content:"\f153"}.fa-gbp:before{content:"\f154"}.fa-dollar:before,.fa-usd:before{content:"\f155"}.fa-inr:before,.fa-rupee:before{content:"\f156"}.fa-cny:before,.fa-jpy:before,.fa-rmb:before,.fa-yen:before{content:"\f157"}.fa-rouble:before,.fa-rub:before,.fa-ruble:before{content:"\f158"}.fa-krw:before,.fa-won:before{content:"\f159"}.fa-bitcoin:before,.fa-btc:before{content:"\f15a"}.fa-file:before{content:"\f15b"}.fa-file-text:before{content:"\f15c"}.fa-sort-alpha-asc:before{content:"\f15d"}.fa-sort-alpha-desc:before{content:"\f15e"}.fa-sort-amount-asc:before{content:"\f160"}.fa-sort-amount-desc:before{content:"\f161"}.fa-sort-numeric-asc:before{content:"\f162"}.fa-sort-numeric-desc:before{content:"\f163"}.fa-thumbs-up:before{content:"\f164"}.fa-thumbs-down:before{content:"\f165"}.fa-youtube-square:before{content:"\f166"}.fa-youtube:before{content:"\f167"}.fa-xing:before{content:"\f168"}.fa-xing-square:before{content:"\f169"}.fa-youtube-play:before{content:"\f16a"}.fa-dropbox:before{content:"\f16b"}.fa-stack-overflow:before{content:"\f16c"}.fa-instagram:before{content:"\f16d"}.fa-flickr:before{content:"\f16e"}.fa-adn:before{content:"\f170"}.fa-bitbucket:before{content:"\f171"}.fa-bitbucket-square:before{content:"\f172"}.fa-tumblr:before{content:"\f173"}.fa-tumblr-square:before{content:"\f174"}.fa-long-arrow-down:before{content:"\f175"}.fa-long-arrow-up:before{content:"\f176"}.fa-long-arrow-left:before{content:"\f177"}.fa-long-arrow-right:before{content:"\f178"}.fa-apple:before{content:"\f179"}.fa-windows:before{content:"\f17a"}.fa-android:before{content:"\f17b"}.fa-linux:before{content:"\f17c"}.fa-dribbble:before{content:"\f17d"}.fa-skype:before{content:"\f17e"}.fa-foursquare:before{content:"\f180"}.fa-trello:before{content:"\f181"}.fa-female:before{content:"\f182"}.fa-male:before{content:"\f183"}.fa-gittip:before,.fa-gratipay:before{content:"\f184"}.fa-sun-o:before{content:"\f185"}.fa-moon-o:before{content:"\f186"}.fa-archive:before{content:"\f187"}.fa-bug:before{content:"\f188"}.fa-vk:before{content:"\f189"}.fa-weibo:before{content:"\f18a"}.fa-renren:before{content:"\f18b"}.fa-pagelines:before{content:"\f18c"}.fa-stack-exchange:before{content:"\f18d"}.fa-arrow-circle-o-right:before{content:"\f18e"}.fa-arrow-circle-o-left:before{content:"\f190"}.fa-caret-square-o-left:before,.fa-toggle-left:before{content:"\f191"}.fa-dot-circle-o:before{content:"\f192"}.fa-wheelchair:before{content:"\f193"}.fa-vimeo-square:before{content:"\f194"}.fa-try:before,.fa-turkish-lira:before{content:"\f195"}.fa-plus-square-o:before{content:"\f196"}.fa-space-shuttle:before{content:"\f197"}.fa-slack:before{content:"\f198"}.fa-envelope-square:before{content:"\f199"}.fa-wordpress:before{content:"\f19a"}.fa-openid:before{content:"\f19b"}.fa-bank:before,.fa-institution:before,.fa-university:before{content:"\f19c"}.fa-graduation-cap:before,.fa-mortar-board:before{content:"\f19d"}.fa-yahoo:before{content:"\f19e"}.fa-google:before{content:"\f1a0"}.fa-reddit:before{content:"\f1a1"}.fa-reddit-square:before{content:"\f1a2"}.fa-stumbleupon-circle:before{content:"\f1a3"}.fa-stumbleupon:before{content:"\f1a4"}.fa-delicious:before{content:"\f1a5"}.fa-digg:before{content:"\f1a6"}.fa-pied-piper-pp:before{content:"\f1a7"}.fa-pied-piper-alt:before{content:"\f1a8"}.fa-drupal:before{content:"\f1a9"}.fa-joomla:before{content:"\f1aa"}.fa-language:before{content:"\f1ab"}.fa-fax:before{content:"\f1ac"}.fa-building:before{content:"\f1ad"}.fa-child:before{content:"\f1ae"}.fa-paw:before{content:"\f1b0"}.fa-spoon:before{content:"\f1b1"}.fa-cube:before{content:"\f1b2"}.fa-cubes:before{content:"\f1b3"}.fa-behance:before{content:"\f1b4"}.fa-behance-square:before{content:"\f1b5"}.fa-steam:before{content:"\f1b6"}.fa-steam-square:before{content:"\f1b7"}.fa-recycle:before{content:"\f1b8"}.fa-automobile:before,.fa-car:before{content:"\f1b9"}.fa-cab:before,.fa-taxi:before{content:"\f1ba"}.fa-tree:before{content:"\f1bb"}.fa-spotify:before{content:"\f1bc"}.fa-deviantart:before{content:"\f1bd"}.fa-soundcloud:before{content:"\f1be"}.fa-database:before{content:"\f1c0"}.fa-file-pdf-o:before{content:"\f1c1"}.fa-file-word-o:before{content:"\f1c2"}.fa-file-excel-o:before{content:"\f1c3"}.fa-file-powerpoint-o:before{content:"\f1c4"}.fa-file-image-o:before,.fa-file-photo-o:before,.fa-file-picture-o:before{content:"\f1c5"}.fa-file-archive-o:before,.fa-file-zip-o:before{content:"\f1c6"}.fa-file-audio-o:before,.fa-file-sound-o:before{content:"\f1c7"}.fa-file-movie-o:before,.fa-file-video-o:before{content:"\f1c8"}.fa-file-code-o:before{content:"\f1c9"}.fa-vine:before{content:"\f1ca"}.fa-codepen:before{content:"\f1cb"}.fa-jsfiddle:before{content:"\f1cc"}.fa-life-bouy:before,.fa-life-buoy:before,.fa-life-ring:before,.fa-life-saver:before,.fa-support:before{content:"\f1cd"}.fa-circle-o-notch:before{content:"\f1ce"}.fa-ra:before,.fa-rebel:before,.fa-resistance:before{content:"\f1d0"}.fa-empire:before,.fa-ge:before{content:"\f1d1"}.fa-git-square:before{content:"\f1d2"}.fa-git:before{content:"\f1d3"}.fa-hacker-news:before,.fa-y-combinator-square:before,.fa-yc-square:before{content:"\f1d4"}.fa-tencent-weibo:before{content:"\f1d5"}.fa-qq:before{content:"\f1d6"}.fa-wechat:before,.fa-weixin:before{content:"\f1d7"}.fa-paper-plane:before,.fa-send:before{content:"\f1d8"}.fa-paper-plane-o:before,.fa-send-o:before{content:"\f1d9"}.fa-history:before{content:"\f1da"}.fa-circle-thin:before{content:"\f1db"}.fa-header:before{content:"\f1dc"}.fa-paragraph:before{content:"\f1dd"}.fa-sliders:before{content:"\f1de"}.fa-share-alt:before{content:"\f1e0"}.fa-share-alt-square:before{content:"\f1e1"}.fa-bomb:before{content:"\f1e2"}.fa-futbol-o:before,.fa-soccer-ball-o:before{content:"\f1e3"}.fa-tty:before{content:"\f1e4"}.fa-binoculars:before{content:"\f1e5"}.fa-plug:before{content:"\f1e6"}.fa-slideshare:before{content:"\f1e7"}.fa-twitch:before{content:"\f1e8"}.fa-yelp:before{content:"\f1e9"}.fa-newspaper-o:before{content:"\f1ea"}.fa-wifi:before{content:"\f1eb"}.fa-calculator:before{content:"\f1ec"}.fa-paypal:before{content:"\f1ed"}.fa-google-wallet:before{content:"\f1ee"}.fa-cc-visa:before{content:"\f1f0"}.fa-cc-mastercard:before{content:"\f1f1"}.fa-cc-discover:before{content:"\f1f2"}.fa-cc-amex:before{content:"\f1f3"}.fa-cc-paypal:before{content:"\f1f4"}.fa-cc-stripe:before{content:"\f1f5"}.fa-bell-slash:before{content:"\f1f6"}.fa-bell-slash-o:before{content:"\f1f7"}.fa-trash:before{content:"\f1f8"}.fa-copyright:before{content:"\f1f9"}.fa-at:before{content:"\f1fa"}.fa-eyedropper:before{content:"\f1fb"}.fa-paint-brush:before{content:"\f1fc"}.fa-birthday-cake:before{content:"\f1fd"}.fa-area-chart:before{content:"\f1fe"}.fa-pie-chart:before{content:"\f200"}.fa-line-chart:before{content:"\f201"}.fa-lastfm:before{content:"\f202"}.fa-lastfm-square:before{content:"\f203"}.fa-toggle-off:before{content:"\f204"}.fa-toggle-on:before{content:"\f205"}.fa-bicycle:before{content:"\f206"}.fa-bus:before{content:"\f207"}.fa-ioxhost:before{content:"\f208"}.fa-angellist:before{content:"\f209"}.fa-cc:before{content:"\f20a"}.fa-ils:before,.fa-shekel:before,.fa-sheqel:before{content:"\f20b"}.fa-meanpath:before{content:"\f20c"}.fa-buysellads:before{content:"\f20d"}.fa-connectdevelop:before{content:"\f20e"}.fa-dashcube:before{content:"\f210"}.fa-forumbee:before{content:"\f211"}.fa-leanpub:before{content:"\f212"}.fa-sellsy:before{content:"\f213"}.fa-shirtsinbulk:before{content:"\f214"}.fa-simplybuilt:before{content:"\f215"}.fa-skyatlas:before{content:"\f216"}.fa-cart-plus:before{content:"\f217"}.fa-cart-arrow-down:before{content:"\f218"}.fa-diamond:before{content:"\f219"}.fa-ship:before{content:"\f21a"}.fa-user-secret:before{content:"\f21b"}.fa-motorcycle:before{content:"\f21c"}.fa-street-view:before{content:"\f21d"}.fa-heartbeat:before{content:"\f21e"}.fa-venus:before{content:"\f221"}.fa-mars:before{content:"\f222"}.fa-mercury:before{content:"\f223"}.fa-intersex:before,.fa-transgender:before{content:"\f224"}.fa-transgender-alt:before{content:"\f225"}.fa-venus-double:before{content:"\f226"}.fa-mars-double:before{content:"\f227"}.fa-venus-mars:before{content:"\f228"}.fa-mars-stroke:before{content:"\f229"}.fa-mars-stroke-v:before{content:"\f22a"}.fa-mars-stroke-h:before{content:"\f22b"}.fa-neuter:before{content:"\f22c"}.fa-genderless:before{content:"\f22d"}.fa-facebook-official:before{content:"\f230"}.fa-pinterest-p:before{content:"\f231"}.fa-whatsapp:before{content:"\f232"}.fa-server:before{content:"\f233"}.fa-user-plus:before{content:"\f234"}.fa-user-times:before{content:"\f235"}.fa-bed:before,.fa-hotel:before{content:"\f236"}.fa-viacoin:before{content:"\f237"}.fa-train:before{content:"\f238"}.fa-subway:before{content:"\f239"}.fa-medium:before{content:"\f23a"}.fa-y-combinator:before,.fa-yc:before{content:"\f23b"}.fa-optin-monster:before{content:"\f23c"}.fa-opencart:before{content:"\f23d"}.fa-expeditedssl:before{content:"\f23e"}.fa-battery-4:before,.fa-battery-full:before,.fa-battery:before{content:"\f240"}.fa-battery-3:before,.fa-battery-three-quarters:before{content:"\f241"}.fa-battery-2:before,.fa-battery-half:before{content:"\f242"}.fa-battery-1:before,.fa-battery-quarter:before{content:"\f243"}.fa-battery-0:before,.fa-battery-empty:before{content:"\f244"}.fa-mouse-pointer:before{content:"\f245"}.fa-i-cursor:before{content:"\f246"}.fa-object-group:before{content:"\f247"}.fa-object-ungroup:before{content:"\f248"}.fa-sticky-note:before{content:"\f249"}.fa-sticky-note-o:before{content:"\f24a"}.fa-cc-jcb:before{content:"\f24b"}.fa-cc-diners-club:before{content:"\f24c"}.fa-clone:before{content:"\f24d"}.fa-balance-scale:before{content:"\f24e"}.fa-hourglass-o:before{content:"\f250"}.fa-hourglass-1:before,.fa-hourglass-start:before{content:"\f251"}.fa-hourglass-2:before,.fa-hourglass-half:before{content:"\f252"}.fa-hourglass-3:before,.fa-hourglass-end:before{content:"\f253"}.fa-hourglass:before{content:"\f254"}.fa-hand-grab-o:before,.fa-hand-rock-o:before{content:"\f255"}.fa-hand-paper-o:before,.fa-hand-stop-o:before{content:"\f256"}.fa-hand-scissors-o:before{content:"\f257"}.fa-hand-lizard-o:before{content:"\f258"}.fa-hand-spock-o:before{content:"\f259"}.fa-hand-pointer-o:before{content:"\f25a"}.fa-hand-peace-o:before{content:"\f25b"}.fa-trademark:before{content:"\f25c"}.fa-registered:before{content:"\f25d"}.fa-creative-commons:before{content:"\f25e"}.fa-gg:before{content:"\f260"}.fa-gg-circle:before{content:"\f261"}.fa-tripadvisor:before{content:"\f262"}.fa-odnoklassniki:before{content:"\f263"}.fa-odnoklassniki-square:before{content:"\f264"}.fa-get-pocket:before{content:"\f265"}.fa-wikipedia-w:before{content:"\f266"}.fa-safari:before{content:"\f267"}.fa-chrome:before{content:"\f268"}.fa-firefox:before{content:"\f269"}.fa-opera:before{content:"\f26a"}.fa-internet-explorer:before{content:"\f26b"}.fa-television:before,.fa-tv:before{content:"\f26c"}.fa-contao:before{content:"\f26d"}.fa-500px:before{content:"\f26e"}.fa-amazon:before{content:"\f270"}.fa-calendar-plus-o:before{content:"\f271"}.fa-calendar-minus-o:before{content:"\f272"}.fa-calendar-times-o:before{content:"\f273"}.fa-calendar-check-o:before{content:"\f274"}.fa-industry:before{content:"\f275"}.fa-map-pin:before{content:"\f276"}.fa-map-signs:before{content:"\f277"}.fa-map-o:before{content:"\f278"}.fa-map:before{content:"\f279"}.fa-commenting:before{content:"\f27a"}.fa-commenting-o:before{content:"\f27b"}.fa-houzz:before{content:"\f27c"}.fa-vimeo:before{content:"\f27d"}.fa-black-tie:before{content:"\f27e"}.fa-fonticons:before{content:"\f280"}.fa-reddit-alien:before{content:"\f281"}.fa-edge:before{content:"\f282"}.fa-credit-card-alt:before{content:"\f283"}.fa-codiepie:before{content:"\f284"}.fa-modx:before{content:"\f285"}.fa-fort-awesome:before{content:"\f286"}.fa-usb:before{content:"\f287"}.fa-product-hunt:before{content:"\f288"}.fa-mixcloud:before{content:"\f289"}.fa-scribd:before{content:"\f28a"}.fa-pause-circle:before{content:"\f28b"}.fa-pause-circle-o:before{content:"\f28c"}.fa-stop-circle:before{content:"\f28d"}.fa-stop-circle-o:before{content:"\f28e"}.fa-shopping-bag:before{content:"\f290"}.fa-shopping-basket:before{content:"\f291"}.fa-hashtag:before{content:"\f292"}.fa-bluetooth:before{content:"\f293"}.fa-bluetooth-b:before{content:"\f294"}.fa-percent:before{content:"\f295"}.fa-gitlab:before{content:"\f296"}.fa-wpbeginner:before{content:"\f297"}.fa-wpforms:before{content:"\f298"}.fa-envira:before{content:"\f299"}.fa-universal-access:before{content:"\f29a"}.fa-wheelchair-alt:before{content:"\f29b"}.fa-question-circle-o:before{content:"\f29c"}.fa-blind:before{content:"\f29d"}.fa-audio-description:before{content:"\f29e"}.fa-volume-control-phone:before{content:"\f2a0"}.fa-braille:before{content:"\f2a1"}.fa-assistive-listening-systems:before{content:"\f2a2"}.fa-american-sign-language-interpreting:before,.fa-asl-interpreting:before{content:"\f2a3"}.fa-deaf:before,.fa-deafness:before,.fa-hard-of-hearing:before{content:"\f2a4"}.fa-glide:before{content:"\f2a5"}.fa-glide-g:before{content:"\f2a6"}.fa-sign-language:before,.fa-signing:before{content:"\f2a7"}.fa-low-vision:before{content:"\f2a8"}.fa-viadeo:before{content:"\f2a9"}.fa-viadeo-square:before{content:"\f2aa"}.fa-snapchat:before{content:"\f2ab"}.fa-snapchat-ghost:before{content:"\f2ac"}.fa-snapchat-square:before{content:"\f2ad"}.fa-pied-piper:before{content:"\f2ae"}.fa-first-order:before{content:"\f2b0"}.fa-yoast:before{content:"\f2b1"}.fa-themeisle:before{content:"\f2b2"}.fa-google-plus-circle:before,.fa-google-plus-official:before{content:"\f2b3"}.fa-fa:before,.fa-font-awesome:before{content:"\f2b4"}.fa-handshake-o:before{content:"\f2b5"}.fa-envelope-open:before{content:"\f2b6"}.fa-envelope-open-o:before{content:"\f2b7"}.fa-linode:before{content:"\f2b8"}.fa-address-book:before{content:"\f2b9"}.fa-address-book-o:before{content:"\f2ba"}.fa-address-card:before,.fa-vcard:before{content:"\f2bb"}.fa-address-card-o:before,.fa-vcard-o:before{content:"\f2bc"}.fa-user-circle:before{content:"\f2bd"}.fa-user-circle-o:before{content:"\f2be"}.fa-user-o:before{content:"\f2c0"}.fa-id-badge:before{content:"\f2c1"}.fa-drivers-license:before,.fa-id-card:before{content:"\f2c2"}.fa-drivers-license-o:before,.fa-id-card-o:before{content:"\f2c3"}.fa-quora:before{content:"\f2c4"}.fa-free-code-camp:before{content:"\f2c5"}.fa-telegram:before{content:"\f2c6"}.fa-thermometer-4:before,.fa-thermometer-full:before,.fa-thermometer:before{content:"\f2c7"}.fa-thermometer-3:before,.fa-thermometer-three-quarters:before{content:"\f2c8"}.fa-thermometer-2:before,.fa-thermometer-half:before{content:"\f2c9"}.fa-thermometer-1:before,.fa-thermometer-quarter:before{content:"\f2ca"}.fa-thermometer-0:before,.fa-thermometer-empty:before{content:"\f2cb"}.fa-shower:before{content:"\f2cc"}.fa-bath:before,.fa-bathtub:before,.fa-s15:before{content:"\f2cd"}.fa-podcast:before{content:"\f2ce"}.fa-window-maximize:before{content:"\f2d0"}.fa-window-minimize:before{content:"\f2d1"}.fa-window-restore:before{content:"\f2d2"}.fa-times-rectangle:before,.fa-window-close:before{content:"\f2d3"}.fa-times-rectangle-o:before,.fa-window-close-o:before{content:"\f2d4"}.fa-bandcamp:before{content:"\f2d5"}.fa-grav:before{content:"\f2d6"}.fa-etsy:before{content:"\f2d7"}.fa-imdb:before{content:"\f2d8"}.fa-ravelry:before{content:"\f2d9"}.fa-eercast:before{content:"\f2da"}.fa-microchip:before{content:"\f2db"}.fa-snowflake-o:before{content:"\f2dc"}.fa-superpowers:before{content:"\f2dd"}.fa-wpexplorer:before{content:"\f2de"}.fa-meetup:before{content:"\f2e0"}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}@font-face{font-family:sulu;src:url(/build/admin/fonts/sulu.7918956d252a916c3102478369c134b8.ttf) format("truetype"),url(/build/admin/fonts/sulu.49769d2d0234e781d6202cc11f34f163.woff) format("woff"),url(/build/admin/fonts/sulu.5904240a3998e593f23b852a3cd9d721.svg#sulu) format("svg");font-weight:400;font-style:normal;font-display:block}[class*=" su-"],[class^=su-]{font-family:sulu!important;speak:never;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.su-folder-permission:before{content:"\e9a0"}.su-exclamation-circle:before{content:"\e99a"}.su-permissions:before{content:"\e99e"}.su-more-horizontal:before{content:"\e995"}.su-file-audio:before{content:"\e98c"}.su-audio:before{content:"\e991"}.su-video:before{content:"\e992"}.su-filter:before{content:"\e977"}.su-enter:before{content:"\e974"}.su-display-bottom-center:before{content:"\e91d";color:#585858}.su-display-bottom-left:before{content:"\e923";color:#585858}.su-display-bottom-right:before{content:"\e95c";color:#585858}.su-display-center-center:before{content:"\e95d";color:#585858}.su-display-center-left:before{content:"\e95e";color:#585858}.su-display-center-right:before{content:"\e95f";color:#585858}.su-display-default:before{content:"\e964";color:#585858}.su-display-top-center:before{content:"\e966";color:#585858}.su-display-top-left:before{content:"\e970";color:#585858}.su-display-top-right:before{content:"\e972";color:#585858}.su-shadow-page:before{content:"\e95b"}.su-tree-list:before{content:"\e947"}.su-subscript2:before{content:"\e948"}.su-superscript:before{content:"\e950"}.su-square:before{content:"\e945"}.su-expand:before{content:"\e918"}.su-sync:before{content:"\e919"}.su-columns:before{content:"\e934"}.su-user:before{content:"\e91a"}.su-arrow-alt-v:before{content:"\e93b"}.su-arrow-alt-h:before{content:"\e93d"}.su-arrows-alt:before{content:"\e941"}.su-more:before{content:"\e94f"}.su-list-ol:before{content:"\e951"}.su-save:before{content:"\e952"}.su-clean:before{content:"\e953"}.su-language:before{content:"\e954"}.su-dollar:before{content:"\e955"}.su-list-ul:before{content:"\e956"}.su-list-check:before{content:"\e957"}.su-envelope:before{content:"\e958"}.su-snippet:before{content:"\e959"}.su-exclamation-triangle:before{content:"\e95a"}.su-magic:before{content:"\e983"}.su-map:before{content:"\e987"}.su-ban:before{content:"\e988"}.su-bold:before{content:"\e98a"}.su-fire:before{content:"\e96b"}.su-globe:before{content:"\e98b"}.su-inbox:before{content:"\e99f"}.su-italic:before{content:"\e960"}.su-underline:before{content:"\e961"}.su-subscript:before{content:"\e962"}.su-strikethrough:before{content:"\e963"}.su-file-word:before{content:"\e965"}.su-copyright:before{content:"\e967"}.su-at:before{content:"\e968"}.su-unlink:before{content:"\e969"}.su-brush:before{content:"\e96a"}.su-explose:before{content:"\e96c"}.su-pen:before{content:"\e96d"}.su-tag:before{content:"\e96e"}.su-percent:before{content:"\e96f"}.su-bluetooth:before{content:"\e971"}.su-check-circle:before{content:"\e973"}.su-location-arrow:before{content:"\e975"}.su-microphone:before{content:"\e976"}.su-camera:before{content:"\e978"}.su-ticket:before{content:"\e979"}.su-eye:before{content:"\e97a"}.su-earth:before{content:"\e97b"}.su-heart:before{content:"\e97c"}.su-graduation-cap:before{content:"\e97d"}.su-house:before{content:"\e97e"}.su-trophy:before{content:"\e980"}.su-redirect:before{content:"\e981"}.su-euro:before{content:"\e982"}.su-umbrella:before{content:"\e984"}.su-industry:before{content:"\e985"}.su-information:before{content:"\e986"}.su-paint:before{content:"\e989"}.su-diagramm:before{content:"\e98d"}.su-chart:before{content:"\e98e"}.su-archive:before{content:"\e98f"}.su-phone:before{content:"\e990"}.su-webspace:before{content:"\e944"}.su-download:before{content:"\e993"}.su-upload:before{content:"\e994"}.su-align-center:before{content:"\e996"}.su-wifi:before{content:"\e997"}.su-th-large:before{content:"\e998"}.su-sort:before{content:"\e999"}.su-align-left:before{content:"\e99b"}.su-align-right:before{content:"\e99c"}.su-link2:before{content:"\e99d"}.su-cog:before{content:"\e900"}.su-times:before{content:"\e901"}.su-arrow-up:before{content:"\e902"}.su-arrow-down:before{content:"\e903"}.su-arrow-right:before{content:"\e904"}.su-arrow-left:before{content:"\e905"}.su-document:before{content:"\e949"}.su-focus:before{content:"\e91b"}.su-folder:before{content:"\e91c"}.su-circle:before{content:"\e906"}.su-exchange-alt:before{content:"\e907"}.su-exchange-up:before{content:"\e908"}.su-caret-left:before{content:"\e909"}.su-caret-right:before{content:"\e90a"}.su-caret-up:before{content:"\e90b"}.su-caret-down:before{content:"\e90c"}.su-image:before{content:"\e90d"}.su-minus:before{content:"\e90e"}.su-plus:before{content:"\e92e"}.su-plus-circle:before{content:"\e926"}.su-align:before{content:"\e925"}.su-angle-down:before{content:"\e90f"}.su-caret-down-fill:before{content:"\e910"}.su-caret-left-fill:before{content:"\e911"}.su-caret-right-fill:before{content:"\e912"}.su-caret-up-fill:before{content:"\e913"}.su-angle-left:before{content:"\e914"}.su-angle-right:before{content:"\e915"}.su-angle-up:before{content:"\e916"}.su-newspaper:before{content:"\e917"}.su-battery-empty:before{content:"\e931"}.su-battery-full:before{content:"\e930"}.su-battery-low:before{content:"\e92f"}.su-calendar:before{content:"\e92d"}.su-check:before{content:"\e92a"}.su-circle-full:before{content:"\e92c"}.su-bell:before{content:"\e929"}.su-sign-out-alt:before{content:"\e92b"}.su-cloud:before{content:"\e928"}.su-code:before{content:"\e91e"}.su-comment:before{content:"\e91f"}.su-copy:before{content:"\e920"}.su-credit-card:before{content:"\e921"}.su-cut:before{content:"\e922"}.su-desktop:before{content:"\e924"}.su-exit:before{content:"\e927"}.su-flag:before{content:"\e932"}.su-flash:before{content:"\e933"}.su-mobile:before{content:"\e935"}.su-link:before{content:"\e936"}.su-th-list:before{content:"\e937"}.su-lock:before{content:"\e938"}.su-file-media-alt:before{content:"\e939"}.su-bars:before{content:"\e93a"}.su-news:before{content:"\e93c"}.su-pen2:before{content:"\e93e"}.su-map-pin:before{content:"\e93f"}.su-process:before{content:"\e940"}.su-search:before{content:"\e942"}.su-size:before{content:"\e94e"}.su-small:before{content:"\e94d"}.su-storage:before{content:"\e94c"}.su-sulu:before{content:"\e94b"}.su-clock:before{content:"\e94a"}.su-trash-alt:before{content:"\e943"}.su-align-justify:before{content:"\e946"}.su-hide:before{content:"\e97f"}.clickable--2-TzL1jn1k{cursor:pointer}.item--2MP4_Vp3Oe{color:#ccc;font-size:14px;line-height:16px;cursor:pointer;background:#232e44;box-sizing:border-box;padding-left:4px;position:relative}.item--2MP4_Vp3Oe:hover{color:#52b6ca}.item--2MP4_Vp3Oe.active--2cQkrWKevT{border-left:4px solid #52b6ca;background:#232739;font-weight:700;padding-left:0}.item--2MP4_Vp3Oe .title--QVStj55_lI{padding:20px 40px 20px 36px}.item--2MP4_Vp3Oe .title--QVStj55_lI span{margin-right:20px;width:15px}.item--2MP4_Vp3Oe .children-indicator--1u36bqdpDU{position:absolute;right:20px;top:20px}.item--2MP4_Vp3Oe .item--2MP4_Vp3Oe{font-size:12px;background:inherit;font-weight:400;margin-left:30px;padding-left:0}.item--2MP4_Vp3Oe .item--2MP4_Vp3Oe .title--QVStj55_lI{padding-top:0;padding-bottom:15px;padding-left:41px}.item--2MP4_Vp3Oe .item--2MP4_Vp3Oe.active--2cQkrWKevT{border-left:none;font-weight:700;background:inherit}.navigation--1TPKGVcdtJ{width:260px;background-color:#1c2945;color:#fff;min-height:100%;opacity:.94;position:relative;display:flex;flex-direction:column}.header--1yYASq55gP{height:60px;background-color:rgba(0,0,0,.15)}.header-content--3q2ACaykun{padding:20px 40px}.header-icon--3slb78kEn1{font-size:20px;line-height:20px;padding-right:20px;vertical-align:middle;height:100%}.header-title--3llLneBogU{font-size:16px;line-height:20px;vertical-align:middle;height:100%}.user--1yh8_EoOW4{min-height:130px;background-color:#293650}.user-content--1HWDvaZ5qI{padding:40px;display:flex;font-size:14px;line-height:16px;align-items:center}.user-content--1HWDvaZ5qI .no-user-image--2r0uxVSaEY,.user-content--1HWDvaZ5qI img{width:50px;height:50px;flex-grow:0;flex-shrink:0;border-radius:25px;cursor:pointer}.user-content--1HWDvaZ5qI .no-user-image--2r0uxVSaEY{background-color:#ccc;color:#fff;border:0}.user-content--1HWDvaZ5qI .no-user-image--2r0uxVSaEY span{font-size:30px;height:100%;width:100%;text-align:center;display:block;line-height:50px}.user-profile--3h8wK9aFMr{margin-left:20px}.user-profile--3h8wK9aFMr .username--1iD-BWgeXO{color:#fff;font-size:14px;text-align:left;cursor:pointer}.user-profile--3h8wK9aFMr .logout--3rYtUBtY-s{font-size:12px;color:#ccc;line-height:16px;margin-top:10px}.user-profile--3h8wK9aFMr button{background:none;border:none;padding:0;cursor:pointer}.user-profile--3h8wK9aFMr button span{padding-right:10px}.items--23JrT1L7Qn{flex-grow:1}.footer--3d3KVHirl9{display:flex;justify-content:center;align-items:center;padding:20px}.pin--1EfeTj0EjG{position:relative;flex:0 0 auto;align-self:flex-end;min-width:25px;height:25px;border-radius:5px;border:1px solid #52b6ca;margin-right:20px;background-color:#1c2945;color:#52b6ca;cursor:pointer}.pin--1EfeTj0EjG.pin-active--2xYrKut_aI,.pin--1EfeTj0EjG:hover{background-color:#52b6ca;color:#1c2945}.pin--1EfeTj0EjG .pin-icon--2Bs7SKVMJD{line-height:23px;font-size:14px;margin-left:auto}.versions--1zEVIvOm77{flex:1 1 auto;font-size:10px;line-height:14px;text-align:center;color:#ccc;word-break:break-word}.versions--1zEVIvOm77 a{color:#ccc;text-decoration:none}.versions--1zEVIvOm77 a:hover{text-decoration:underline}.backdrop--1NPZgaTLwy{width:100%;height:100%;background:transparent;position:absolute}.backdrop--1NPZgaTLwy.visible--2Ns3EfQy8A{background:hsla(0,0%,60%,.9)}.backdrop--1NPZgaTLwy.fixed--2GqQpeyTUu{position:fixed;top:0;left:0}.spinner--1SR7qONWz4{position:relative;margin:auto}.double-bounce1--25UAQah_f8,.double-bounce2--hAKcsQjiAL{width:100%;height:100%;border-radius:50%;background-color:#585858;opacity:.6;position:absolute;top:0;left:0;will-change:transform;-webkit-animation:bounce--1esEi9hF2d 2s ease-in-out infinite;animation:bounce--1esEi9hF2d 2s ease-in-out infinite}.double-bounce2--hAKcsQjiAL{-webkit-animation-delay:-1s;animation-delay:-1s}@-webkit-keyframes bounce--1esEi9hF2d{0%,to{transform:scale(0)}50%{transform:scale(1)}}@keyframes bounce--1esEi9hF2d{0%,to{transform:scale(0)}50%{transform:scale(1)}}.button--319u6U1AIl{position:relative;white-space:nowrap;display:inline-flex;justify-content:center}.button--319u6U1AIl:disabled{cursor:default}.primary--1wekDI7P-q,.secondary--1n10BKfoP3{font-size:12px;border:1px solid;border-radius:3px;line-height:28px;cursor:pointer;text-align:center;min-width:140px;padding:0 40px}.primary--1wekDI7P-q .button-icon--2zwDFL5-yo,.primary--1wekDI7P-q .dropdown-icon--1IfR6jDzfv,.secondary--1n10BKfoP3 .button-icon--2zwDFL5-yo,.secondary--1n10BKfoP3 .dropdown-icon--1IfR6jDzfv{display:inline-flex;align-items:center;position:absolute;top:0;bottom:0}.primary--1wekDI7P-q .button-icon--2zwDFL5-yo,.secondary--1n10BKfoP3 .button-icon--2zwDFL5-yo{left:10px}.primary--1wekDI7P-q .dropdown-icon--1IfR6jDzfv,.secondary--1n10BKfoP3 .dropdown-icon--1IfR6jDzfv{left:auto;right:10px;font-size:10px}.primary--1wekDI7P-q{border-color:#52b6ca;background:#52b6ca;color:#fff}.primary--1wekDI7P-q:disabled{border-color:#ccc;background-color:#ccc}.secondary--1n10BKfoP3{border-color:#ccc;background:#f5f5f5;color:#000}.secondary--1n10BKfoP3:disabled{color:#ccc}.link--p45eB9JWbh{padding:0;border:0;background:transparent;cursor:pointer;font-size:12px;color:#000}.link--p45eB9JWbh .button-text--1S_k29yuHf{text-decoration:underline}.link--p45eB9JWbh .button-icon--2zwDFL5-yo+.button-text--1S_k29yuHf{margin-left:10px}.link--p45eB9JWbh .dropdown-icon--1IfR6jDzfv{margin-left:10px;font-size:10px}.link--p45eB9JWbh:disabled{color:#a2a2a2}.text--3HNWf-tIc7{padding:0;border:0;background:transparent;cursor:pointer;font-size:12px;color:#000}.text--3HNWf-tIc7 .button-icon--2zwDFL5-yo+.button-text--1S_k29yuHf{margin-left:10px}.text--3HNWf-tIc7 .dropdown-icon--1IfR6jDzfv{margin-left:10px;font-size:10px}.text--3HNWf-tIc7:disabled{color:#a2a2a2}.icon--2SWnwI7jSC{background:none;min-width:30px;height:30px;line-height:28px;border-radius:4px;border:1px solid #6e6e6e;color:#6e6e6e;cursor:pointer;font-size:14px;padding:0 5px}.icon--2SWnwI7jSC:hover:not(:disabled){background-color:#ccc}.icon--2SWnwI7jSC:disabled{color:#ccc}.icon--2SWnwI7jSC.active--2PPd5kFWvV{background-color:#6e6e6e;color:#fff}.icon--2SWnwI7jSC .button-icon--2zwDFL5-yo,.icon--2SWnwI7jSC .dropdown-icon--1IfR6jDzfv{line-height:28px}.icon--2SWnwI7jSC .dropdown-icon--1IfR6jDzfv{margin-left:5px;font-size:10px}.loader--2SXOeEeNqC{display:none;position:absolute;top:0;left:0;width:100%;height:100%}.loading--NeW6CHK6qx{background-color:transparent;border-color:transparent}.loading--NeW6CHK6qx .button-text--1S_k29yuHf{opacity:0}.loading--NeW6CHK6qx .loader--2SXOeEeNqC{display:flex}.character-counter--14nxaTtyFd{color:#585858;font-size:10px;margin-top:5px}.exceeded--2d6cnYNavZ{color:#cf3939}.segment-counter--2NXlSNVovg{color:#585858;font-size:10px;margin-top:5px}.exceeded--v2ggIaitw-{color:#cf3939}.input--YrRPhYPmPT{border:1px solid #ccc;border-radius:3px;display:inline-flex;font-size:12px;align-items:center;height:30px;width:100%;background-color:#fff;position:relative}.input--YrRPhYPmPT input{width:calc(100% - 32px);flex-grow:1;border:none;border-radius:3px;height:28px;color:#000;will-change:width,padding-left;transition:width .3s,padding-left .1s linear}.input--YrRPhYPmPT input::-moz-placeholder{color:#999}.input--YrRPhYPmPT input::placeholder{color:#999}.input--YrRPhYPmPT input:invalid{box-shadow:none}.input--YrRPhYPmPT input:disabled{color:#878787;background-color:#f5f5f5}.input--YrRPhYPmPT.left--3McDXiCrys input{text-align:left;padding-left:10px;padding-right:1px}.input--YrRPhYPmPT.center--JXk60IDjWJ input{text-align:center;padding-left:1px;padding-right:1px}.input--YrRPhYPmPT.right--pX9XMNaOG9 input{text-align:right;padding-left:1px;padding-right:10px}.input--YrRPhYPmPT.collapsed--3cKiJ1rgll input{padding:0;width:0}.input--YrRPhYPmPT.has-append-icon--pQms0sSnCj input{will-change:margin-right;transition:margin-right .1s;margin-right:34px}.input--YrRPhYPmPT.has-append-icon--pQms0sSnCj.collapsed--3cKiJ1rgll input{margin-right:0;visibility:hidden}.input--YrRPhYPmPT.dark--tc2vktcDJ7{background-color:#fff;color:#000;border-radius:4px;border-color:#6e6e6e}.input--YrRPhYPmPT.dark--tc2vktcDJ7.collapsed--3cKiJ1rgll{background-color:#f5f5f5}.input--YrRPhYPmPT.error--1YjDkE4VYd{border-color:#cf3939}.input--YrRPhYPmPT.disabled--1cFjjKATa0{background-color:#f5f5f5}.input--YrRPhYPmPT .prepended-container--1HLUlo-uAQ{flex:0 0 32px;height:20px;width:32px}.input--YrRPhYPmPT .prepended-container--1HLUlo-uAQ.collapsed--3cKiJ1rgll{height:100%}.input--YrRPhYPmPT .icon--ytM2BXHUpA{display:flex;align-items:center;justify-content:center;height:100%;width:100%;font-size:14px;text-align:center}.input--YrRPhYPmPT.headline--2ofmFMh3Td{font-size:18px;line-height:28px;height:40px}.input--YrRPhYPmPT.headline--2ofmFMh3Td input{font-weight:700}.input--YrRPhYPmPT.headline--2ofmFMh3Td .prepended-container--1HLUlo-uAQ{flex:0 0 42px;height:30px;width:42px}.input--YrRPhYPmPT.headline--2ofmFMh3Td .icon--ytM2BXHUpA{font-size:20px}.prepended-container--1HLUlo-uAQ{position:relative;box-shadow:1px 0 0 #ccc;display:flex;justify-content:center;align-items:center}.prepended-container--1HLUlo-uAQ.dark--tc2vktcDJ7{box-shadow:1px 0 0 #6e6e6e}.prepended-container--1HLUlo-uAQ.collapsed--3cKiJ1rgll{box-shadow:none}.append-container--260F-W2kJw{position:absolute;height:20px;right:0}.append-container--260F-W2kJw .icon--ytM2BXHUpA{margin-right:10px}.icon--ytM2BXHUpA{display:block;flex-grow:0;color:#999;line-height:20px}.icon--ytM2BXHUpA.dark--tc2vktcDJ7{color:#6e6e6e}.icon-clickable--2i8CXxR-rS{cursor:pointer}.header--2ygAfnPWFk{font-size:22px;font-weight:700;line-height:32px;margin:10px 0 80px;text-align:center;width:100%;min-height:50px}.header--2ygAfnPWFk.small--2AqcGA84hV{font-size:14px;line-height:20px;font-weight:400}.form--1pNyeHZ_J6{width:100%}.form--1pNyeHZ_J6 fieldset{padding:0;border:0}.buttons--2B7RG6G7uu{display:flex;justify-content:space-between;margin-top:30px;width:100%}.input-field--31TEuk-dv0{display:block;margin-bottom:10px}.input-field--31TEuk-dv0.error--1E_rPAurFD{color:#d96161}.label-text--2dcgberBAk{margin-bottom:10px}.login--1dPKvzoqvx{height:100vh;width:100vw;display:flex;justify-content:center;align-items:center;color:#000;border-radius:3px;font-size:14px}.login-container--3KCmvHyz7g{background-color:#fff;box-shadow:0 2px 18px 0 rgba(0,0,0,.22);width:480px;min-height:615px}.logo-container--3Rnp2jIalL{font-size:70px;text-align:center}.loader-container--2zvDPfXw7t{flex-grow:1;display:flex;height:100%;width:100%}.form-container--1a48M_vk4X{display:flex;flex-direction:column;min-height:550px;padding:70px 60px 60px}.back-link-container--2ymktxCyG7{border-top:1px solid #e6e6e6;text-decoration:none;display:flex;width:100%;height:80px;align-items:center;justify-content:center}.back-link--3p99EI_qQY{color:#000;text-decoration:none}.back-link-icon--3Ala6w-5jt{margin-right:10px}.actions--3fKNmIlaGZ{line-height:90px}.container--1Af_ukQ1Tq{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;justify-content:center}.container--1Af_ukQ1Tq>*{opacity:0;will-change:opacity;transition:opacity .3s}.overlay--1i69zMOzmm{position:relative;top:-100%;opacity:0;will-change:top,opacity;transition:top .3s,opacity .3s;pointer-events:none;max-height:calc(100vh - 100px)}.overlay--1i69zMOzmm>*{pointer-events:auto}.overlay--1i69zMOzmm.small--3LzryW5Wgh{width:50vw}.overlay--1i69zMOzmm.large--1vOJ_O2MxG{width:80vw}.is-down--1GrBJwFYKD>*{opacity:1}.is-down--1GrBJwFYKD .overlay--1i69zMOzmm{top:0}.content--uDzbc_yR5N{border-radius:0 0 3px 3px;overflow:hidden;box-shadow:0 10px 18px 0 rgba(53,53,53,.5)}.content--uDzbc_yR5N header{background:#f2f2f2;border-bottom:1px solid #ccc;height:82px;text-align:center;line-height:82px}.content--uDzbc_yR5N header h2{display:inline-block;margin:0}.content--uDzbc_yR5N article{max-height:calc(100vh - 272px);overflow:auto;background:#f2f2f2}.content--uDzbc_yR5N footer{background:#fff;border-top:1px solid #ccc;height:90px;padding:0 60px;display:flex;justify-content:space-between;align-items:center}.content--uDzbc_yR5N footer button:only-child{margin-left:auto}.content--uDzbc_yR5N .icon--3x5ECMVMng{position:absolute;right:60px;font-size:14px;font-weight:700;line-height:82px;text-align:center;cursor:pointer}.permission-hint--1-xu7E7ALV{font-size:18px;font-weight:700;color:#878787;width:100%;text-align:center}.permission-icon--3QNsTvSUZN{font-size:32px}.colSpan--1-dAvrr6Hs{width:100%}@media (min-width:520px){.colSpan-1--2FbmDHOf05{width:8.33333%}.colSpan-2--32mWE8xnNT{width:16.66667%}.colSpan-3--YWgZb8jzq2{width:25%}.colSpan-4--3PrZt6EqIQ{width:33.33333%}.colSpan-5--1rBEJVQGbT{width:41.66667%}.colSpan-6--1dEtnH0fLF{width:50%}.colSpan-7--2HCkJEVswE{width:58.33333%}.colSpan-8--34cDQl2pms{width:66.66667%}.colSpan-9--3wPTGWSNKn{width:75%}.colSpan-10--2EG5Y65M5i{width:83.33333%}.colSpan-11--15lXSff09p{width:91.66667%}.colSpan-12--auvwGOVazL{width:100%}.space-before-1--1esoCSFR-u{margin-left:8.33333%}.space-before-2--f1wHMt4Rmd{margin-left:16.66667%}.space-before-3--3HDe8T3Pje{margin-left:25%}.space-before-4--2RKyHLb2uI{margin-left:33.33333%}.space-before-5--1nxb2II90k{margin-left:41.66667%}.space-before-6--1K3F-ulqg4{margin-left:50%}.space-before-7--3uja_9LjlA{margin-left:58.33333%}.space-before-8--3cWhs0mPIQ{margin-left:66.66667%}.space-before-9--pzFcGgnpnX{margin-left:75%}.space-before-10--1ho3Bf-DtI{margin-left:83.33333%}.space-before-11--PwsJFZP62-{margin-left:91.66667%}.space-before-12--7njTyjsxdY{margin-left:100%}.space-after-1--3iF2QSAogD{margin-right:8.33333%}.space-after-2--2jBiGc2Um2{margin-right:16.66667%}.space-after-3--2pLVKlWYlr{margin-right:25%}.space-after-4--1t1ydT_lzZ{margin-right:33.33333%}.space-after-5---k4J3z7IEv{margin-right:41.66667%}.space-after-6--3DsSEzIWpw{margin-right:50%}.space-after-7--1Mv6x0Wauv{margin-right:58.33333%}.space-after-8--3PQwlQSKI0{margin-right:66.66667%}.space-after-9--1g84Il2fiV{margin-right:75%}.space-after-10--3XDTUmY_Ry{margin-right:83.33333%}.space-after-11--176XwWyHT6{margin-right:91.66667%}.space-after-12--gbs-Ox5bvw{margin-right:100%}}.item--3RIViIi05o{float:left;padding-right:20px}.section--2Uk6NDvPTv{float:left}.grid--370cPalb_8{margin-right:-20px}.grid--370cPalb_8:after{content:"";clear:both;display:block}.container--23xz7h0-xz{position:fixed;top:0;left:0;width:100%;height:100%;pointer-events:none}.item--15AVvF2Hj1{background:none;border:none;display:block;height:22px;color:#000;font-size:12px;line-height:22px;margin-bottom:6px;cursor:pointer;text-align:start}.item--15AVvF2Hj1:last-child{margin-bottom:0}.item--15AVvF2Hj1.active--3RZWM1Ykmv,.item--15AVvF2Hj1:hover:not([disabled]){font-weight:700;color:#112a46}.item--15AVvF2Hj1:disabled{color:#ccc;cursor:default}.icon--2p2c6gIM2J{display:inline-block;width:20px}.section--1n3lbbqXnr{padding-left:30px;padding-right:30px;padding-bottom:10px}.section--1n3lbbqXnr:first-child{padding-top:10px}.section--1n3lbbqXnr:last-child{padding-bottom:10px}.section--1n3lbbqXnr:not(:first-child){border-top:1px solid #ccc;padding-top:10px}.children--1ea8Qy5gQh{padding:10px 0}.title--3d8U3BmPFR{color:#000;font-size:14px;line-height:24px;font-weight:700}.title--3d8U3BmPFR:last-child{margin-bottom:0}.action--3mKMEHF4Cc{background:transparent;border:none;display:block;line-height:14px;color:#000;cursor:pointer;font-size:12px;margin-bottom:10px;text-align:left}.action--3mKMEHF4Cc:hover{color:#52b6ca}.action--3mKMEHF4Cc:last-child{margin-bottom:0}.action--3mKMEHF4Cc:disabled{color:#ccc;cursor:default}.icon--1q0w8JiliW{margin-right:10px}.arrowMenuContainer--fOytZ9Zsxt{margin:0;position:relative}.arrowMenu--4r1or9HiQX{background-color:#fff;border-radius:2px;font-size:12px;box-shadow:0 0 14px 0 hsla(0,0%,43.1%,.5);overflow:auto;min-width:200px}.arrow--bJop7vN7y9{width:0;height:0;position:absolute}.arrow--bJop7vN7y9.right--2NBH_d3jy4{right:10px}.arrow--bJop7vN7y9.left--FKL0iKRMXW{left:10px}.arrow--bJop7vN7y9.top--398upSLia8{top:-10px;border-left:15px solid transparent;border-right:15px solid transparent;border-bottom:15px solid #fff}.arrow--bJop7vN7y9.bottom--23iQuHKgmD{bottom:-10px;border-left:15px solid transparent;border-right:15px solid transparent;border-top:15px solid #fff}.field--VY-GnCrWFK{margin-bottom:10px}.type--3_ymNx49w2{background:transparent;border:0;color:#585858;cursor:pointer;margin-left:7px;font-size:12px}.type-delimiter--28x9N38BXv{margin-right:7px}.type-icon--1L9msLPWzK{margin-left:3px;font-size:10px}.error--vu_NabseBv>.label--2S0ZduPoBW{color:#d96161}.label--2S0ZduPoBW{display:block;color:#585858;font-size:14px;line-height:19px;margin-bottom:10px;text-align:left;white-space:nowrap}.label--2S0ZduPoBW:after{content:"\200B"}.description-label--10UEOAlmZb,.error-label--kCmWKRItWy{display:block;color:#585858;font-size:10px;line-height:20px;height:20px}.error-label--kCmWKRItWy{color:#cf3939}.grid--3IQZeqSYws{overflow-y:hidden}.grid--3IQZeqSYws,.grid-section--2jSUXJEKui{margin-bottom:-30px}.grid-section--2jSUXJEKui:last-child{margin-bottom:0}.grid-section--2jSUXJEKui+.grid-item--3OxWG0xFvT{margin-top:30px}.grid-item--3OxWG0xFvT+.grid-section--2jSUXJEKui{margin-top:-30px}@media (max-width:520px){.grid-section--2jSUXJEKui+.grid-section--2jSUXJEKui{margin-top:30px}}.divider--32l6kUMZGL{display:flex;align-items:center;font-size:18px;margin:50px 0 30px}.divider--32l6kUMZGL:after,.divider--32l6kUMZGL:before{content:"";display:inline-block;flex:1;height:1px;background:#ccc}.divider--32l6kUMZGL:before{margin-right:40px}.divider--32l6kUMZGL:after{margin-left:40px}.divider--32l6kUMZGL:empty:after,.divider--32l6kUMZGL:empty:before{margin:0}.field-container--2Ljd6_6r9z{min-height:30px;display:flex;align-items:center}.field--eI_QIymGzA{flex:1;max-width:100%;width:100%}.field-exception--uFAS3rCCs5{color:#fff;background:#d96161;border:1px solid #cf3939;padding:0 20px;border-radius:3px;margin-bottom:20px}.dialog-container--3iqPqgpIht{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;justify-content:center;align-items:center}.dialog--RUeFRUqJ7i{width:500px;position:relative;opacity:0;will-change:opacity;transition:opacity .3s;pointer-events:none;max-height:calc(100vh - 100px)}.dialog--RUeFRUqJ7i>*{pointer-events:auto}.dialog--RUeFRUqJ7i.small--51AMVxPkHr{width:50vw}.dialog--RUeFRUqJ7i.large--3aB9-oT0DU{width:80vw}.open--1ztEKgXgPI>*{opacity:1}.content--1lT7Ozsit1{border-radius:3px;background:#f2f2f2;overflow:hidden;position:relative}.content--1lT7Ozsit1 header{color:#000;font-size:22px;font-weight:700;text-align:center;height:85px;line-height:85px}.content--1lT7Ozsit1 footer{background:#fff;border-top:1px solid #ccc;height:90px;padding:0 30px;display:flex;justify-content:space-between;align-items:center;flex-direction:row-reverse}.article--HsA9m-yR9d{max-height:calc(100vh - 275px);color:#999;font-size:12px;line-height:22px;overflow:auto;padding:0 30px 30px}.article--HsA9m-yR9d.left--1ySAvPAxLR{text-align:left}.article--HsA9m-yR9d.center--2OBQ2-TNxd{text-align:center}.article--HsA9m-yR9d ul{text-align:left}.divider--1Fm7gTXM47{width:100%;height:1px;background:#babfc7;margin:5px 0}.menu--37Ejoi9Vs_{border-radius:2px;padding:5px 0;font-size:12px;margin:0;overflow:auto;background:#f5f5f5;box-shadow:2px 6px 12px 0 rgba(0,0,0,.22);border:1px solid #babfc7}.action--2ujqPybEcG{width:100%;position:relative;line-height:20px;padding:0 20px 0 30px;color:#112a46;border:none;background:transparent;cursor:pointer;text-align:left;font-size:12px}.action--2ujqPybEcG:hover{color:#52b6ca}.label--22nuJrNdMC{display:flex;align-items:center;cursor:pointer}.label--22nuJrNdMC>div{font-size:14px;margin-left:10px;overflow:hidden;line-height:20px}.label--22nuJrNdMC+.label--22nuJrNdMC{margin-top:10px}.label--22nuJrNdMC.disabled--2Cej_PnzDf{cursor:default}.switch--52fMu6kGAZ{display:inline-block;position:relative;flex-shrink:0}.switch--52fMu6kGAZ input{position:absolute;width:100%;height:100%;opacity:0;cursor:pointer}.switch--52fMu6kGAZ.disabled--2Cej_PnzDf input{cursor:default}.checkbox--2Z3YMYLqUa.dark--1gdZ2dJMIJ input+span{border-color:#112a46;color:#fff}.checkbox--2Z3YMYLqUa.dark--1gdZ2dJMIJ input:checked+span{background:#112a46}.checkbox--2Z3YMYLqUa.light--29kb21gbll input+span{border-color:#fff;color:#112a46}.checkbox--2Z3YMYLqUa.light--29kb21gbll input:checked+span{background:#fff}.checkbox--2Z3YMYLqUa{width:16px;height:16px}.checkbox--2Z3YMYLqUa input+span{display:block;width:100%;height:100%;background:transparent;position:absolute;top:0;left:0;border-radius:2px;border-width:1px;border-style:solid;text-align:center;line-height:16px}.checkbox--2Z3YMYLqUa input+span>*{position:relative;top:-1px;left:-1px;font-size:16px}.checkbox--2Z3YMYLqUa input:disabled+span{border-color:#ccc;color:#ccc}.checkbox--2Z3YMYLqUa input:disabled:checked+span{background:#ccc;color:#fff}.option--1eWSkGSpFA{width:100%;position:relative;padding:0 20px 0 30px;color:#112a46;border:none;background:transparent;cursor:pointer;text-align:left;font-size:12px;outline:0}.option--1eWSkGSpFA:not(:disabled):hover{color:#52b6ca}.option--1eWSkGSpFA:disabled{color:rgba(17,42,70,.3);cursor:default}.option--1eWSkGSpFA.selected--1-ond8Qok-{font-weight:700}.option--1eWSkGSpFA.icon--3RROHewPwf{line-height:20px}.option--1eWSkGSpFA.icon--3RROHewPwf.selected--1-ond8Qok- .icon--3RROHewPwf{position:absolute;left:10px;line-height:20px;vertical-align:middle}.option--1eWSkGSpFA.checkbox--20iG1zUWsj{line-height:25px;padding-left:35px}.option--1eWSkGSpFA.checkbox--20iG1zUWsj .input--2b5or2iAr4{position:absolute;left:10px;top:4px;line-height:20px;vertical-align:middle}.cropped-text--kjpmxHAsTL{width:100%;overflow:hidden;display:inline-flex;flex-wrap:nowrap;position:relative;line-height:normal}.cropped-text--kjpmxHAsTL .whole--3GXEeu7Wnq{position:absolute;top:0;left:0;color:transparent;white-space:nowrap}.cropped-text--kjpmxHAsTL .front--3wwBW91aMg{text-overflow:ellipsis;white-space:pre}.cropped-text--kjpmxHAsTL .back--2lOqwyu_8t,.cropped-text--kjpmxHAsTL .front--3wwBW91aMg{flex-grow:0;flex-shrink:1;flex-basis:content;overflow:hidden;-webkit-user-select:none;-moz-user-select:none;user-select:none}.cropped-text--kjpmxHAsTL .back--2lOqwyu_8t span{float:right;white-space:pre}.displayValue--2O6vhDMKzo{cursor:pointer;position:relative;padding:7px 30px 7px 10px}.displayValue--2O6vhDMKzo.flat--1i-jpyShvi{border:none;background-color:transparent;color:inherit}.displayValue--2O6vhDMKzo.dark--kOMfdHyQbH,.displayValue--2O6vhDMKzo.default--1qHeDKVcu7{display:flex;width:100%;height:30px;border:1px solid #ccc;border-radius:3px;text-align:left;font-size:12px;color:#000;background-color:#fff}.displayValue--2O6vhDMKzo.dark--kOMfdHyQbH:hover,.displayValue--2O6vhDMKzo.default--1qHeDKVcu7:hover{color:#52b6ca}.displayValue--2O6vhDMKzo.dark--kOMfdHyQbH{background-color:#fff;color:#000;border-color:#6e6e6e;border-radius:4px}.displayValue--2O6vhDMKzo:disabled{cursor:default;color:#878787;background-color:#f5f5f5}.displayValue--2O6vhDMKzo:disabled:hover{color:#878787}.has-icon--1xE1O9fM4T{padding-left:30px;text-align:center}.front-icon--2QiEDGhKo2{left:10px}.front-icon--2QiEDGhKo2,.toggle--3gWiwmRHGz{display:block;position:absolute;top:0;bottom:0;line-height:27px;vertical-align:middle;font-size:10px}.toggle--3gWiwmRHGz{right:10px}.select--2Y_GcUrdzb{display:inline-block;width:100%}.options-list--3aq1Q6866f{list-style:none;margin:0;padding:0}.card--1A_1l_zcun{background-color:#fff;border:1px solid #ccc;border-radius:3px;padding:30px;width:100%}.icons--2OK2vq2EMX{font-size:16px;float:right}.icons--2OK2vq2EMX>*{margin-left:20px}.cards--8przrrkuGX{display:flex;flex-wrap:wrap;margin-right:-20px}.card--1JiLTIqY32{display:flex;align-items:stretch;flex-shrink:0;width:50%;padding:0 20px 20px 0}@media (max-width:1024px){.card--1JiLTIqY32{float:none;width:100%;padding:0 0 20px}}.add-button-container--W2KubJcFS6{text-align:center}.overlay--2i3nf0KP-c{padding:40px 60px}.list--3YmuTTGhXs{display:flex;padding:30px 60px 60px}.overlay--2G9JZcdD4X.adapter-container--2m4SiICIc4.column_list--3it7BObNwV{margin-top:-1px;height:calc(100vh - 272px);overflow:hidden}.overlay--2G9JZcdD4X .adapter--ofe8U2ROPD.column_list--3it7BObNwV{padding:0;height:calc(100vh - 271px)}.dialog--fv57WrfaJo{text-align:left;margin:0 -30px -30px}.dialog--fv57WrfaJo.adapter-container--2m4SiICIc4.column_list--3it7BObNwV{height:calc(100vh - 272px);overflow:hidden}.dialog--fv57WrfaJo .adapter--ofe8U2ROPD.column_list--3it7BObNwV{padding:0;height:calc(100vh - 271px)}.button-group--3ZXJDYPX-3{display:flex}.button--30g09RbEvQ{border-radius:0;min-width:34px}.button--30g09RbEvQ:first-child{border-top-left-radius:4px;border-bottom-left-radius:4px}.button--30g09RbEvQ:last-child{border-top-right-radius:4px;border-bottom-right-radius:4px}.button--30g09RbEvQ:not(:last-child){border-right:0}.list--24qxBVT_IF,.list-container--1KaAm9Rrfq{display:flex;flex-direction:column;flex-grow:1}.list--24qxBVT_IF.disabled--1ABE7xWUvc{opacity:.5;pointer-events:none}.toolbar--1g1N15_Ogd{display:flex;justify-content:flex-end;align-items:center;margin-bottom:20px}.toolbar--1g1N15_Ogd>*{height:30px;margin-right:10px;width:auto}.toolbar--1g1N15_Ogd>:last-child{margin-right:0}.overlay--k9H5mFbXyn{display:flex;flex-direction:column;padding:40px 60px}.overlay--k9H5mFbXyn.sorting--ZdXIUoDhfl{-webkit-user-select:none;-moz-user-select:none;user-select:none}.column-option--jZQUsDRZlT{color:#000;display:flex;font-size:14px;padding:15px 0;width:100%}.column-option--jZQUsDRZlT:hover{background:#ccc}.column-option--jZQUsDRZlT .drag-handle--10N92JZ3Y-{cursor:move;padding:0 20px}.column-option--jZQUsDRZlT .label--1fD1ji4PAQ{flex-grow:1}.column-option--jZQUsDRZlT .icon--25swyaK0Z0{align-self:flex-end;font-size:20px;padding:0 20px}.column-option--jZQUsDRZlT.dragging--29HRxXAtIb{background:#ccc;box-shadow:0 3px 6px rgba(0,0,0,.1),0 -3px 6px rgba(0,0,0,.1)}.column-option-disabled--3L7Ort4fTy{color:#999}.column-option-disabled--3L7Ort4fTy.dragging--29HRxXAtIb,.column-option-disabled--3L7Ort4fTy:hover{background:#e6e6e6}.chip--K2e6naIoqw{border:none;border-radius:3px;display:inline-block;font-size:12px;line-height:18px;padding:0 10px;position:relative;white-space:nowrap}.chip--K2e6naIoqw .icon--2cCx3tEBrC{margin-left:10px}.chip--K2e6naIoqw>*{display:inline-block}.clickable--2htTqA8hvR{cursor:pointer}.disabled--32wMqJWJQ8{background-color:#ccc}.primary--3GCecGs-AC.chip--K2e6naIoqw{background-color:#52b6ca;color:#fff}.secondary--3XvyVzZYcd.chip--K2e6naIoqw{background-color:#f5f5f5;color:#000}.small--33Oeas09Ng{height:18px}.medium--2gdW3De9Io{height:30px}.field-filter-item--3ofjriHWP2{margin-right:5px}.button-container--2gG95hAsgn{text-align:right;margin-top:10px}.field-filter--dZnFcTcVXE{display:flex;flex-grow:1}.filter-button--1Wmp_CsCF-{margin-right:10px}.toggler--3g4H4O_qJk{width:37px;height:20px}.toggler--3g4H4O_qJk input+span{top:0;left:0;width:100%;height:100%;transition:background .2s,border-color .2s}.toggler--3g4H4O_qJk input+span,.toggler--3g4H4O_qJk input+span:after{position:absolute;display:block;background:#fff;border:1px solid #ccc;border-radius:10px}.toggler--3g4H4O_qJk input+span:after{content:"";top:-1px;left:-1px;width:20px;height:20px;transition:left .2s,border-color .2s}.toggler--3g4H4O_qJk input:checked+span{background:#112a46;border-color:#112a46}.toggler--3g4H4O_qJk input:checked+span:after{border-color:#112a46;left:16px}.toggler--3g4H4O_qJk input:disabled+span{background:transparent;border-color:#ccc}.toggler--3g4H4O_qJk input:disabled+span:after{border-color:#ccc;background-color:transparent}.color-box--pPJk3nPhC5{width:16px;height:16px;border-radius:2px}.list-icon--27L-PMsQyt{font-size:18px} + */@font-face{font-family:FontAwesome;src:url(/build/admin/fonts/fontawesome-webfont.8b43027f47b20503057dfbbaa9401fef.eot);src:url(/build/admin/fonts/fontawesome-webfont.8b43027f47b20503057dfbbaa9401fef.eot?#iefix&v=4.7.0) format("embedded-opentype"),url(/build/admin/fonts/fontawesome-webfont.20fd1704ea223900efa9fd4e869efb08.woff2) format("woff2"),url(/build/admin/fonts/fontawesome-webfont.f691f37e57f04c152e2315ab7dbad881.woff) format("woff"),url(/build/admin/fonts/fontawesome-webfont.1e59d2330b4c6deb84b340635ed36249.ttf) format("truetype"),url(/build/admin/fonts/fontawesome-webfont.c1e38fd9e0e74ba58f7a2b77ef29fdd3.svg#fontawesomeregular) format("svg");font-weight:400;font-style:normal}.fa{display:inline-block;font:normal normal normal 14px/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-lg{font-size:1.33333333em;line-height:.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.28571429em;text-align:center}.fa-ul{padding-left:0;margin-left:2.14285714em;list-style-type:none}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.14285714em;width:2.14285714em;top:.14285714em;text-align:center}.fa-li.fa-lg{left:-1.85714286em}.fa-border{padding:.2em .25em .15em;border:.08em solid #eee;border-radius:.1em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa.fa-pull-left{margin-right:.3em}.fa.fa-pull-right{margin-left:.3em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left{margin-right:.3em}.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(359deg);transform:rotate(359deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";-webkit-transform:scaleX(-1);-ms-transform:scaleX(-1);transform:scaleX(-1)}.fa-flip-vertical{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";-webkit-transform:scaleY(-1);-ms-transform:scaleY(-1);transform:scaleY(-1)}:root .fa-flip-horizontal,:root .fa-flip-vertical,:root .fa-rotate-90,:root .fa-rotate-180,:root .fa-rotate-270{filter:none}.fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:"\f000"}.fa-music:before{content:"\f001"}.fa-search:before{content:"\f002"}.fa-envelope-o:before{content:"\f003"}.fa-heart:before{content:"\f004"}.fa-star:before{content:"\f005"}.fa-star-o:before{content:"\f006"}.fa-user:before{content:"\f007"}.fa-film:before{content:"\f008"}.fa-th-large:before{content:"\f009"}.fa-th:before{content:"\f00a"}.fa-th-list:before{content:"\f00b"}.fa-check:before{content:"\f00c"}.fa-close:before,.fa-remove:before,.fa-times:before{content:"\f00d"}.fa-search-plus:before{content:"\f00e"}.fa-search-minus:before{content:"\f010"}.fa-power-off:before{content:"\f011"}.fa-signal:before{content:"\f012"}.fa-cog:before,.fa-gear:before{content:"\f013"}.fa-trash-o:before{content:"\f014"}.fa-home:before{content:"\f015"}.fa-file-o:before{content:"\f016"}.fa-clock-o:before{content:"\f017"}.fa-road:before{content:"\f018"}.fa-download:before{content:"\f019"}.fa-arrow-circle-o-down:before{content:"\f01a"}.fa-arrow-circle-o-up:before{content:"\f01b"}.fa-inbox:before{content:"\f01c"}.fa-play-circle-o:before{content:"\f01d"}.fa-repeat:before,.fa-rotate-right:before{content:"\f01e"}.fa-refresh:before{content:"\f021"}.fa-list-alt:before{content:"\f022"}.fa-lock:before{content:"\f023"}.fa-flag:before{content:"\f024"}.fa-headphones:before{content:"\f025"}.fa-volume-off:before{content:"\f026"}.fa-volume-down:before{content:"\f027"}.fa-volume-up:before{content:"\f028"}.fa-qrcode:before{content:"\f029"}.fa-barcode:before{content:"\f02a"}.fa-tag:before{content:"\f02b"}.fa-tags:before{content:"\f02c"}.fa-book:before{content:"\f02d"}.fa-bookmark:before{content:"\f02e"}.fa-print:before{content:"\f02f"}.fa-camera:before{content:"\f030"}.fa-font:before{content:"\f031"}.fa-bold:before{content:"\f032"}.fa-italic:before{content:"\f033"}.fa-text-height:before{content:"\f034"}.fa-text-width:before{content:"\f035"}.fa-align-left:before{content:"\f036"}.fa-align-center:before{content:"\f037"}.fa-align-right:before{content:"\f038"}.fa-align-justify:before{content:"\f039"}.fa-list:before{content:"\f03a"}.fa-dedent:before,.fa-outdent:before{content:"\f03b"}.fa-indent:before{content:"\f03c"}.fa-video-camera:before{content:"\f03d"}.fa-image:before,.fa-photo:before,.fa-picture-o:before{content:"\f03e"}.fa-pencil:before{content:"\f040"}.fa-map-marker:before{content:"\f041"}.fa-adjust:before{content:"\f042"}.fa-tint:before{content:"\f043"}.fa-edit:before,.fa-pencil-square-o:before{content:"\f044"}.fa-share-square-o:before{content:"\f045"}.fa-check-square-o:before{content:"\f046"}.fa-arrows:before{content:"\f047"}.fa-step-backward:before{content:"\f048"}.fa-fast-backward:before{content:"\f049"}.fa-backward:before{content:"\f04a"}.fa-play:before{content:"\f04b"}.fa-pause:before{content:"\f04c"}.fa-stop:before{content:"\f04d"}.fa-forward:before{content:"\f04e"}.fa-fast-forward:before{content:"\f050"}.fa-step-forward:before{content:"\f051"}.fa-eject:before{content:"\f052"}.fa-chevron-left:before{content:"\f053"}.fa-chevron-right:before{content:"\f054"}.fa-plus-circle:before{content:"\f055"}.fa-minus-circle:before{content:"\f056"}.fa-times-circle:before{content:"\f057"}.fa-check-circle:before{content:"\f058"}.fa-question-circle:before{content:"\f059"}.fa-info-circle:before{content:"\f05a"}.fa-crosshairs:before{content:"\f05b"}.fa-times-circle-o:before{content:"\f05c"}.fa-check-circle-o:before{content:"\f05d"}.fa-ban:before{content:"\f05e"}.fa-arrow-left:before{content:"\f060"}.fa-arrow-right:before{content:"\f061"}.fa-arrow-up:before{content:"\f062"}.fa-arrow-down:before{content:"\f063"}.fa-mail-forward:before,.fa-share:before{content:"\f064"}.fa-expand:before{content:"\f065"}.fa-compress:before{content:"\f066"}.fa-plus:before{content:"\f067"}.fa-minus:before{content:"\f068"}.fa-asterisk:before{content:"\f069"}.fa-exclamation-circle:before{content:"\f06a"}.fa-gift:before{content:"\f06b"}.fa-leaf:before{content:"\f06c"}.fa-fire:before{content:"\f06d"}.fa-eye:before{content:"\f06e"}.fa-eye-slash:before{content:"\f070"}.fa-exclamation-triangle:before,.fa-warning:before{content:"\f071"}.fa-plane:before{content:"\f072"}.fa-calendar:before{content:"\f073"}.fa-random:before{content:"\f074"}.fa-comment:before{content:"\f075"}.fa-magnet:before{content:"\f076"}.fa-chevron-up:before{content:"\f077"}.fa-chevron-down:before{content:"\f078"}.fa-retweet:before{content:"\f079"}.fa-shopping-cart:before{content:"\f07a"}.fa-folder:before{content:"\f07b"}.fa-folder-open:before{content:"\f07c"}.fa-arrows-v:before{content:"\f07d"}.fa-arrows-h:before{content:"\f07e"}.fa-bar-chart-o:before,.fa-bar-chart:before{content:"\f080"}.fa-twitter-square:before{content:"\f081"}.fa-facebook-square:before{content:"\f082"}.fa-camera-retro:before{content:"\f083"}.fa-key:before{content:"\f084"}.fa-cogs:before,.fa-gears:before{content:"\f085"}.fa-comments:before{content:"\f086"}.fa-thumbs-o-up:before{content:"\f087"}.fa-thumbs-o-down:before{content:"\f088"}.fa-star-half:before{content:"\f089"}.fa-heart-o:before{content:"\f08a"}.fa-sign-out:before{content:"\f08b"}.fa-linkedin-square:before{content:"\f08c"}.fa-thumb-tack:before{content:"\f08d"}.fa-external-link:before{content:"\f08e"}.fa-sign-in:before{content:"\f090"}.fa-trophy:before{content:"\f091"}.fa-github-square:before{content:"\f092"}.fa-upload:before{content:"\f093"}.fa-lemon-o:before{content:"\f094"}.fa-phone:before{content:"\f095"}.fa-square-o:before{content:"\f096"}.fa-bookmark-o:before{content:"\f097"}.fa-phone-square:before{content:"\f098"}.fa-twitter:before{content:"\f099"}.fa-facebook-f:before,.fa-facebook:before{content:"\f09a"}.fa-github:before{content:"\f09b"}.fa-unlock:before{content:"\f09c"}.fa-credit-card:before{content:"\f09d"}.fa-feed:before,.fa-rss:before{content:"\f09e"}.fa-hdd-o:before{content:"\f0a0"}.fa-bullhorn:before{content:"\f0a1"}.fa-bell:before{content:"\f0f3"}.fa-certificate:before{content:"\f0a3"}.fa-hand-o-right:before{content:"\f0a4"}.fa-hand-o-left:before{content:"\f0a5"}.fa-hand-o-up:before{content:"\f0a6"}.fa-hand-o-down:before{content:"\f0a7"}.fa-arrow-circle-left:before{content:"\f0a8"}.fa-arrow-circle-right:before{content:"\f0a9"}.fa-arrow-circle-up:before{content:"\f0aa"}.fa-arrow-circle-down:before{content:"\f0ab"}.fa-globe:before{content:"\f0ac"}.fa-wrench:before{content:"\f0ad"}.fa-tasks:before{content:"\f0ae"}.fa-filter:before{content:"\f0b0"}.fa-briefcase:before{content:"\f0b1"}.fa-arrows-alt:before{content:"\f0b2"}.fa-group:before,.fa-users:before{content:"\f0c0"}.fa-chain:before,.fa-link:before{content:"\f0c1"}.fa-cloud:before{content:"\f0c2"}.fa-flask:before{content:"\f0c3"}.fa-cut:before,.fa-scissors:before{content:"\f0c4"}.fa-copy:before,.fa-files-o:before{content:"\f0c5"}.fa-paperclip:before{content:"\f0c6"}.fa-floppy-o:before,.fa-save:before{content:"\f0c7"}.fa-square:before{content:"\f0c8"}.fa-bars:before,.fa-navicon:before,.fa-reorder:before{content:"\f0c9"}.fa-list-ul:before{content:"\f0ca"}.fa-list-ol:before{content:"\f0cb"}.fa-strikethrough:before{content:"\f0cc"}.fa-underline:before{content:"\f0cd"}.fa-table:before{content:"\f0ce"}.fa-magic:before{content:"\f0d0"}.fa-truck:before{content:"\f0d1"}.fa-pinterest:before{content:"\f0d2"}.fa-pinterest-square:before{content:"\f0d3"}.fa-google-plus-square:before{content:"\f0d4"}.fa-google-plus:before{content:"\f0d5"}.fa-money:before{content:"\f0d6"}.fa-caret-down:before{content:"\f0d7"}.fa-caret-up:before{content:"\f0d8"}.fa-caret-left:before{content:"\f0d9"}.fa-caret-right:before{content:"\f0da"}.fa-columns:before{content:"\f0db"}.fa-sort:before,.fa-unsorted:before{content:"\f0dc"}.fa-sort-desc:before,.fa-sort-down:before{content:"\f0dd"}.fa-sort-asc:before,.fa-sort-up:before{content:"\f0de"}.fa-envelope:before{content:"\f0e0"}.fa-linkedin:before{content:"\f0e1"}.fa-rotate-left:before,.fa-undo:before{content:"\f0e2"}.fa-gavel:before,.fa-legal:before{content:"\f0e3"}.fa-dashboard:before,.fa-tachometer:before{content:"\f0e4"}.fa-comment-o:before{content:"\f0e5"}.fa-comments-o:before{content:"\f0e6"}.fa-bolt:before,.fa-flash:before{content:"\f0e7"}.fa-sitemap:before{content:"\f0e8"}.fa-umbrella:before{content:"\f0e9"}.fa-clipboard:before,.fa-paste:before{content:"\f0ea"}.fa-lightbulb-o:before{content:"\f0eb"}.fa-exchange:before{content:"\f0ec"}.fa-cloud-download:before{content:"\f0ed"}.fa-cloud-upload:before{content:"\f0ee"}.fa-user-md:before{content:"\f0f0"}.fa-stethoscope:before{content:"\f0f1"}.fa-suitcase:before{content:"\f0f2"}.fa-bell-o:before{content:"\f0a2"}.fa-coffee:before{content:"\f0f4"}.fa-cutlery:before{content:"\f0f5"}.fa-file-text-o:before{content:"\f0f6"}.fa-building-o:before{content:"\f0f7"}.fa-hospital-o:before{content:"\f0f8"}.fa-ambulance:before{content:"\f0f9"}.fa-medkit:before{content:"\f0fa"}.fa-fighter-jet:before{content:"\f0fb"}.fa-beer:before{content:"\f0fc"}.fa-h-square:before{content:"\f0fd"}.fa-plus-square:before{content:"\f0fe"}.fa-angle-double-left:before{content:"\f100"}.fa-angle-double-right:before{content:"\f101"}.fa-angle-double-up:before{content:"\f102"}.fa-angle-double-down:before{content:"\f103"}.fa-angle-left:before{content:"\f104"}.fa-angle-right:before{content:"\f105"}.fa-angle-up:before{content:"\f106"}.fa-angle-down:before{content:"\f107"}.fa-desktop:before{content:"\f108"}.fa-laptop:before{content:"\f109"}.fa-tablet:before{content:"\f10a"}.fa-mobile-phone:before,.fa-mobile:before{content:"\f10b"}.fa-circle-o:before{content:"\f10c"}.fa-quote-left:before{content:"\f10d"}.fa-quote-right:before{content:"\f10e"}.fa-spinner:before{content:"\f110"}.fa-circle:before{content:"\f111"}.fa-mail-reply:before,.fa-reply:before{content:"\f112"}.fa-github-alt:before{content:"\f113"}.fa-folder-o:before{content:"\f114"}.fa-folder-open-o:before{content:"\f115"}.fa-smile-o:before{content:"\f118"}.fa-frown-o:before{content:"\f119"}.fa-meh-o:before{content:"\f11a"}.fa-gamepad:before{content:"\f11b"}.fa-keyboard-o:before{content:"\f11c"}.fa-flag-o:before{content:"\f11d"}.fa-flag-checkered:before{content:"\f11e"}.fa-terminal:before{content:"\f120"}.fa-code:before{content:"\f121"}.fa-mail-reply-all:before,.fa-reply-all:before{content:"\f122"}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:"\f123"}.fa-location-arrow:before{content:"\f124"}.fa-crop:before{content:"\f125"}.fa-code-fork:before{content:"\f126"}.fa-chain-broken:before,.fa-unlink:before{content:"\f127"}.fa-question:before{content:"\f128"}.fa-info:before{content:"\f129"}.fa-exclamation:before{content:"\f12a"}.fa-superscript:before{content:"\f12b"}.fa-subscript:before{content:"\f12c"}.fa-eraser:before{content:"\f12d"}.fa-puzzle-piece:before{content:"\f12e"}.fa-microphone:before{content:"\f130"}.fa-microphone-slash:before{content:"\f131"}.fa-shield:before{content:"\f132"}.fa-calendar-o:before{content:"\f133"}.fa-fire-extinguisher:before{content:"\f134"}.fa-rocket:before{content:"\f135"}.fa-maxcdn:before{content:"\f136"}.fa-chevron-circle-left:before{content:"\f137"}.fa-chevron-circle-right:before{content:"\f138"}.fa-chevron-circle-up:before{content:"\f139"}.fa-chevron-circle-down:before{content:"\f13a"}.fa-html5:before{content:"\f13b"}.fa-css3:before{content:"\f13c"}.fa-anchor:before{content:"\f13d"}.fa-unlock-alt:before{content:"\f13e"}.fa-bullseye:before{content:"\f140"}.fa-ellipsis-h:before{content:"\f141"}.fa-ellipsis-v:before{content:"\f142"}.fa-rss-square:before{content:"\f143"}.fa-play-circle:before{content:"\f144"}.fa-ticket:before{content:"\f145"}.fa-minus-square:before{content:"\f146"}.fa-minus-square-o:before{content:"\f147"}.fa-level-up:before{content:"\f148"}.fa-level-down:before{content:"\f149"}.fa-check-square:before{content:"\f14a"}.fa-pencil-square:before{content:"\f14b"}.fa-external-link-square:before{content:"\f14c"}.fa-share-square:before{content:"\f14d"}.fa-compass:before{content:"\f14e"}.fa-caret-square-o-down:before,.fa-toggle-down:before{content:"\f150"}.fa-caret-square-o-up:before,.fa-toggle-up:before{content:"\f151"}.fa-caret-square-o-right:before,.fa-toggle-right:before{content:"\f152"}.fa-eur:before,.fa-euro:before{content:"\f153"}.fa-gbp:before{content:"\f154"}.fa-dollar:before,.fa-usd:before{content:"\f155"}.fa-inr:before,.fa-rupee:before{content:"\f156"}.fa-cny:before,.fa-jpy:before,.fa-rmb:before,.fa-yen:before{content:"\f157"}.fa-rouble:before,.fa-rub:before,.fa-ruble:before{content:"\f158"}.fa-krw:before,.fa-won:before{content:"\f159"}.fa-bitcoin:before,.fa-btc:before{content:"\f15a"}.fa-file:before{content:"\f15b"}.fa-file-text:before{content:"\f15c"}.fa-sort-alpha-asc:before{content:"\f15d"}.fa-sort-alpha-desc:before{content:"\f15e"}.fa-sort-amount-asc:before{content:"\f160"}.fa-sort-amount-desc:before{content:"\f161"}.fa-sort-numeric-asc:before{content:"\f162"}.fa-sort-numeric-desc:before{content:"\f163"}.fa-thumbs-up:before{content:"\f164"}.fa-thumbs-down:before{content:"\f165"}.fa-youtube-square:before{content:"\f166"}.fa-youtube:before{content:"\f167"}.fa-xing:before{content:"\f168"}.fa-xing-square:before{content:"\f169"}.fa-youtube-play:before{content:"\f16a"}.fa-dropbox:before{content:"\f16b"}.fa-stack-overflow:before{content:"\f16c"}.fa-instagram:before{content:"\f16d"}.fa-flickr:before{content:"\f16e"}.fa-adn:before{content:"\f170"}.fa-bitbucket:before{content:"\f171"}.fa-bitbucket-square:before{content:"\f172"}.fa-tumblr:before{content:"\f173"}.fa-tumblr-square:before{content:"\f174"}.fa-long-arrow-down:before{content:"\f175"}.fa-long-arrow-up:before{content:"\f176"}.fa-long-arrow-left:before{content:"\f177"}.fa-long-arrow-right:before{content:"\f178"}.fa-apple:before{content:"\f179"}.fa-windows:before{content:"\f17a"}.fa-android:before{content:"\f17b"}.fa-linux:before{content:"\f17c"}.fa-dribbble:before{content:"\f17d"}.fa-skype:before{content:"\f17e"}.fa-foursquare:before{content:"\f180"}.fa-trello:before{content:"\f181"}.fa-female:before{content:"\f182"}.fa-male:before{content:"\f183"}.fa-gittip:before,.fa-gratipay:before{content:"\f184"}.fa-sun-o:before{content:"\f185"}.fa-moon-o:before{content:"\f186"}.fa-archive:before{content:"\f187"}.fa-bug:before{content:"\f188"}.fa-vk:before{content:"\f189"}.fa-weibo:before{content:"\f18a"}.fa-renren:before{content:"\f18b"}.fa-pagelines:before{content:"\f18c"}.fa-stack-exchange:before{content:"\f18d"}.fa-arrow-circle-o-right:before{content:"\f18e"}.fa-arrow-circle-o-left:before{content:"\f190"}.fa-caret-square-o-left:before,.fa-toggle-left:before{content:"\f191"}.fa-dot-circle-o:before{content:"\f192"}.fa-wheelchair:before{content:"\f193"}.fa-vimeo-square:before{content:"\f194"}.fa-try:before,.fa-turkish-lira:before{content:"\f195"}.fa-plus-square-o:before{content:"\f196"}.fa-space-shuttle:before{content:"\f197"}.fa-slack:before{content:"\f198"}.fa-envelope-square:before{content:"\f199"}.fa-wordpress:before{content:"\f19a"}.fa-openid:before{content:"\f19b"}.fa-bank:before,.fa-institution:before,.fa-university:before{content:"\f19c"}.fa-graduation-cap:before,.fa-mortar-board:before{content:"\f19d"}.fa-yahoo:before{content:"\f19e"}.fa-google:before{content:"\f1a0"}.fa-reddit:before{content:"\f1a1"}.fa-reddit-square:before{content:"\f1a2"}.fa-stumbleupon-circle:before{content:"\f1a3"}.fa-stumbleupon:before{content:"\f1a4"}.fa-delicious:before{content:"\f1a5"}.fa-digg:before{content:"\f1a6"}.fa-pied-piper-pp:before{content:"\f1a7"}.fa-pied-piper-alt:before{content:"\f1a8"}.fa-drupal:before{content:"\f1a9"}.fa-joomla:before{content:"\f1aa"}.fa-language:before{content:"\f1ab"}.fa-fax:before{content:"\f1ac"}.fa-building:before{content:"\f1ad"}.fa-child:before{content:"\f1ae"}.fa-paw:before{content:"\f1b0"}.fa-spoon:before{content:"\f1b1"}.fa-cube:before{content:"\f1b2"}.fa-cubes:before{content:"\f1b3"}.fa-behance:before{content:"\f1b4"}.fa-behance-square:before{content:"\f1b5"}.fa-steam:before{content:"\f1b6"}.fa-steam-square:before{content:"\f1b7"}.fa-recycle:before{content:"\f1b8"}.fa-automobile:before,.fa-car:before{content:"\f1b9"}.fa-cab:before,.fa-taxi:before{content:"\f1ba"}.fa-tree:before{content:"\f1bb"}.fa-spotify:before{content:"\f1bc"}.fa-deviantart:before{content:"\f1bd"}.fa-soundcloud:before{content:"\f1be"}.fa-database:before{content:"\f1c0"}.fa-file-pdf-o:before{content:"\f1c1"}.fa-file-word-o:before{content:"\f1c2"}.fa-file-excel-o:before{content:"\f1c3"}.fa-file-powerpoint-o:before{content:"\f1c4"}.fa-file-image-o:before,.fa-file-photo-o:before,.fa-file-picture-o:before{content:"\f1c5"}.fa-file-archive-o:before,.fa-file-zip-o:before{content:"\f1c6"}.fa-file-audio-o:before,.fa-file-sound-o:before{content:"\f1c7"}.fa-file-movie-o:before,.fa-file-video-o:before{content:"\f1c8"}.fa-file-code-o:before{content:"\f1c9"}.fa-vine:before{content:"\f1ca"}.fa-codepen:before{content:"\f1cb"}.fa-jsfiddle:before{content:"\f1cc"}.fa-life-bouy:before,.fa-life-buoy:before,.fa-life-ring:before,.fa-life-saver:before,.fa-support:before{content:"\f1cd"}.fa-circle-o-notch:before{content:"\f1ce"}.fa-ra:before,.fa-rebel:before,.fa-resistance:before{content:"\f1d0"}.fa-empire:before,.fa-ge:before{content:"\f1d1"}.fa-git-square:before{content:"\f1d2"}.fa-git:before{content:"\f1d3"}.fa-hacker-news:before,.fa-y-combinator-square:before,.fa-yc-square:before{content:"\f1d4"}.fa-tencent-weibo:before{content:"\f1d5"}.fa-qq:before{content:"\f1d6"}.fa-wechat:before,.fa-weixin:before{content:"\f1d7"}.fa-paper-plane:before,.fa-send:before{content:"\f1d8"}.fa-paper-plane-o:before,.fa-send-o:before{content:"\f1d9"}.fa-history:before{content:"\f1da"}.fa-circle-thin:before{content:"\f1db"}.fa-header:before{content:"\f1dc"}.fa-paragraph:before{content:"\f1dd"}.fa-sliders:before{content:"\f1de"}.fa-share-alt:before{content:"\f1e0"}.fa-share-alt-square:before{content:"\f1e1"}.fa-bomb:before{content:"\f1e2"}.fa-futbol-o:before,.fa-soccer-ball-o:before{content:"\f1e3"}.fa-tty:before{content:"\f1e4"}.fa-binoculars:before{content:"\f1e5"}.fa-plug:before{content:"\f1e6"}.fa-slideshare:before{content:"\f1e7"}.fa-twitch:before{content:"\f1e8"}.fa-yelp:before{content:"\f1e9"}.fa-newspaper-o:before{content:"\f1ea"}.fa-wifi:before{content:"\f1eb"}.fa-calculator:before{content:"\f1ec"}.fa-paypal:before{content:"\f1ed"}.fa-google-wallet:before{content:"\f1ee"}.fa-cc-visa:before{content:"\f1f0"}.fa-cc-mastercard:before{content:"\f1f1"}.fa-cc-discover:before{content:"\f1f2"}.fa-cc-amex:before{content:"\f1f3"}.fa-cc-paypal:before{content:"\f1f4"}.fa-cc-stripe:before{content:"\f1f5"}.fa-bell-slash:before{content:"\f1f6"}.fa-bell-slash-o:before{content:"\f1f7"}.fa-trash:before{content:"\f1f8"}.fa-copyright:before{content:"\f1f9"}.fa-at:before{content:"\f1fa"}.fa-eyedropper:before{content:"\f1fb"}.fa-paint-brush:before{content:"\f1fc"}.fa-birthday-cake:before{content:"\f1fd"}.fa-area-chart:before{content:"\f1fe"}.fa-pie-chart:before{content:"\f200"}.fa-line-chart:before{content:"\f201"}.fa-lastfm:before{content:"\f202"}.fa-lastfm-square:before{content:"\f203"}.fa-toggle-off:before{content:"\f204"}.fa-toggle-on:before{content:"\f205"}.fa-bicycle:before{content:"\f206"}.fa-bus:before{content:"\f207"}.fa-ioxhost:before{content:"\f208"}.fa-angellist:before{content:"\f209"}.fa-cc:before{content:"\f20a"}.fa-ils:before,.fa-shekel:before,.fa-sheqel:before{content:"\f20b"}.fa-meanpath:before{content:"\f20c"}.fa-buysellads:before{content:"\f20d"}.fa-connectdevelop:before{content:"\f20e"}.fa-dashcube:before{content:"\f210"}.fa-forumbee:before{content:"\f211"}.fa-leanpub:before{content:"\f212"}.fa-sellsy:before{content:"\f213"}.fa-shirtsinbulk:before{content:"\f214"}.fa-simplybuilt:before{content:"\f215"}.fa-skyatlas:before{content:"\f216"}.fa-cart-plus:before{content:"\f217"}.fa-cart-arrow-down:before{content:"\f218"}.fa-diamond:before{content:"\f219"}.fa-ship:before{content:"\f21a"}.fa-user-secret:before{content:"\f21b"}.fa-motorcycle:before{content:"\f21c"}.fa-street-view:before{content:"\f21d"}.fa-heartbeat:before{content:"\f21e"}.fa-venus:before{content:"\f221"}.fa-mars:before{content:"\f222"}.fa-mercury:before{content:"\f223"}.fa-intersex:before,.fa-transgender:before{content:"\f224"}.fa-transgender-alt:before{content:"\f225"}.fa-venus-double:before{content:"\f226"}.fa-mars-double:before{content:"\f227"}.fa-venus-mars:before{content:"\f228"}.fa-mars-stroke:before{content:"\f229"}.fa-mars-stroke-v:before{content:"\f22a"}.fa-mars-stroke-h:before{content:"\f22b"}.fa-neuter:before{content:"\f22c"}.fa-genderless:before{content:"\f22d"}.fa-facebook-official:before{content:"\f230"}.fa-pinterest-p:before{content:"\f231"}.fa-whatsapp:before{content:"\f232"}.fa-server:before{content:"\f233"}.fa-user-plus:before{content:"\f234"}.fa-user-times:before{content:"\f235"}.fa-bed:before,.fa-hotel:before{content:"\f236"}.fa-viacoin:before{content:"\f237"}.fa-train:before{content:"\f238"}.fa-subway:before{content:"\f239"}.fa-medium:before{content:"\f23a"}.fa-y-combinator:before,.fa-yc:before{content:"\f23b"}.fa-optin-monster:before{content:"\f23c"}.fa-opencart:before{content:"\f23d"}.fa-expeditedssl:before{content:"\f23e"}.fa-battery-4:before,.fa-battery-full:before,.fa-battery:before{content:"\f240"}.fa-battery-3:before,.fa-battery-three-quarters:before{content:"\f241"}.fa-battery-2:before,.fa-battery-half:before{content:"\f242"}.fa-battery-1:before,.fa-battery-quarter:before{content:"\f243"}.fa-battery-0:before,.fa-battery-empty:before{content:"\f244"}.fa-mouse-pointer:before{content:"\f245"}.fa-i-cursor:before{content:"\f246"}.fa-object-group:before{content:"\f247"}.fa-object-ungroup:before{content:"\f248"}.fa-sticky-note:before{content:"\f249"}.fa-sticky-note-o:before{content:"\f24a"}.fa-cc-jcb:before{content:"\f24b"}.fa-cc-diners-club:before{content:"\f24c"}.fa-clone:before{content:"\f24d"}.fa-balance-scale:before{content:"\f24e"}.fa-hourglass-o:before{content:"\f250"}.fa-hourglass-1:before,.fa-hourglass-start:before{content:"\f251"}.fa-hourglass-2:before,.fa-hourglass-half:before{content:"\f252"}.fa-hourglass-3:before,.fa-hourglass-end:before{content:"\f253"}.fa-hourglass:before{content:"\f254"}.fa-hand-grab-o:before,.fa-hand-rock-o:before{content:"\f255"}.fa-hand-paper-o:before,.fa-hand-stop-o:before{content:"\f256"}.fa-hand-scissors-o:before{content:"\f257"}.fa-hand-lizard-o:before{content:"\f258"}.fa-hand-spock-o:before{content:"\f259"}.fa-hand-pointer-o:before{content:"\f25a"}.fa-hand-peace-o:before{content:"\f25b"}.fa-trademark:before{content:"\f25c"}.fa-registered:before{content:"\f25d"}.fa-creative-commons:before{content:"\f25e"}.fa-gg:before{content:"\f260"}.fa-gg-circle:before{content:"\f261"}.fa-tripadvisor:before{content:"\f262"}.fa-odnoklassniki:before{content:"\f263"}.fa-odnoklassniki-square:before{content:"\f264"}.fa-get-pocket:before{content:"\f265"}.fa-wikipedia-w:before{content:"\f266"}.fa-safari:before{content:"\f267"}.fa-chrome:before{content:"\f268"}.fa-firefox:before{content:"\f269"}.fa-opera:before{content:"\f26a"}.fa-internet-explorer:before{content:"\f26b"}.fa-television:before,.fa-tv:before{content:"\f26c"}.fa-contao:before{content:"\f26d"}.fa-500px:before{content:"\f26e"}.fa-amazon:before{content:"\f270"}.fa-calendar-plus-o:before{content:"\f271"}.fa-calendar-minus-o:before{content:"\f272"}.fa-calendar-times-o:before{content:"\f273"}.fa-calendar-check-o:before{content:"\f274"}.fa-industry:before{content:"\f275"}.fa-map-pin:before{content:"\f276"}.fa-map-signs:before{content:"\f277"}.fa-map-o:before{content:"\f278"}.fa-map:before{content:"\f279"}.fa-commenting:before{content:"\f27a"}.fa-commenting-o:before{content:"\f27b"}.fa-houzz:before{content:"\f27c"}.fa-vimeo:before{content:"\f27d"}.fa-black-tie:before{content:"\f27e"}.fa-fonticons:before{content:"\f280"}.fa-reddit-alien:before{content:"\f281"}.fa-edge:before{content:"\f282"}.fa-credit-card-alt:before{content:"\f283"}.fa-codiepie:before{content:"\f284"}.fa-modx:before{content:"\f285"}.fa-fort-awesome:before{content:"\f286"}.fa-usb:before{content:"\f287"}.fa-product-hunt:before{content:"\f288"}.fa-mixcloud:before{content:"\f289"}.fa-scribd:before{content:"\f28a"}.fa-pause-circle:before{content:"\f28b"}.fa-pause-circle-o:before{content:"\f28c"}.fa-stop-circle:before{content:"\f28d"}.fa-stop-circle-o:before{content:"\f28e"}.fa-shopping-bag:before{content:"\f290"}.fa-shopping-basket:before{content:"\f291"}.fa-hashtag:before{content:"\f292"}.fa-bluetooth:before{content:"\f293"}.fa-bluetooth-b:before{content:"\f294"}.fa-percent:before{content:"\f295"}.fa-gitlab:before{content:"\f296"}.fa-wpbeginner:before{content:"\f297"}.fa-wpforms:before{content:"\f298"}.fa-envira:before{content:"\f299"}.fa-universal-access:before{content:"\f29a"}.fa-wheelchair-alt:before{content:"\f29b"}.fa-question-circle-o:before{content:"\f29c"}.fa-blind:before{content:"\f29d"}.fa-audio-description:before{content:"\f29e"}.fa-volume-control-phone:before{content:"\f2a0"}.fa-braille:before{content:"\f2a1"}.fa-assistive-listening-systems:before{content:"\f2a2"}.fa-american-sign-language-interpreting:before,.fa-asl-interpreting:before{content:"\f2a3"}.fa-deaf:before,.fa-deafness:before,.fa-hard-of-hearing:before{content:"\f2a4"}.fa-glide:before{content:"\f2a5"}.fa-glide-g:before{content:"\f2a6"}.fa-sign-language:before,.fa-signing:before{content:"\f2a7"}.fa-low-vision:before{content:"\f2a8"}.fa-viadeo:before{content:"\f2a9"}.fa-viadeo-square:before{content:"\f2aa"}.fa-snapchat:before{content:"\f2ab"}.fa-snapchat-ghost:before{content:"\f2ac"}.fa-snapchat-square:before{content:"\f2ad"}.fa-pied-piper:before{content:"\f2ae"}.fa-first-order:before{content:"\f2b0"}.fa-yoast:before{content:"\f2b1"}.fa-themeisle:before{content:"\f2b2"}.fa-google-plus-circle:before,.fa-google-plus-official:before{content:"\f2b3"}.fa-fa:before,.fa-font-awesome:before{content:"\f2b4"}.fa-handshake-o:before{content:"\f2b5"}.fa-envelope-open:before{content:"\f2b6"}.fa-envelope-open-o:before{content:"\f2b7"}.fa-linode:before{content:"\f2b8"}.fa-address-book:before{content:"\f2b9"}.fa-address-book-o:before{content:"\f2ba"}.fa-address-card:before,.fa-vcard:before{content:"\f2bb"}.fa-address-card-o:before,.fa-vcard-o:before{content:"\f2bc"}.fa-user-circle:before{content:"\f2bd"}.fa-user-circle-o:before{content:"\f2be"}.fa-user-o:before{content:"\f2c0"}.fa-id-badge:before{content:"\f2c1"}.fa-drivers-license:before,.fa-id-card:before{content:"\f2c2"}.fa-drivers-license-o:before,.fa-id-card-o:before{content:"\f2c3"}.fa-quora:before{content:"\f2c4"}.fa-free-code-camp:before{content:"\f2c5"}.fa-telegram:before{content:"\f2c6"}.fa-thermometer-4:before,.fa-thermometer-full:before,.fa-thermometer:before{content:"\f2c7"}.fa-thermometer-3:before,.fa-thermometer-three-quarters:before{content:"\f2c8"}.fa-thermometer-2:before,.fa-thermometer-half:before{content:"\f2c9"}.fa-thermometer-1:before,.fa-thermometer-quarter:before{content:"\f2ca"}.fa-thermometer-0:before,.fa-thermometer-empty:before{content:"\f2cb"}.fa-shower:before{content:"\f2cc"}.fa-bath:before,.fa-bathtub:before,.fa-s15:before{content:"\f2cd"}.fa-podcast:before{content:"\f2ce"}.fa-window-maximize:before{content:"\f2d0"}.fa-window-minimize:before{content:"\f2d1"}.fa-window-restore:before{content:"\f2d2"}.fa-times-rectangle:before,.fa-window-close:before{content:"\f2d3"}.fa-times-rectangle-o:before,.fa-window-close-o:before{content:"\f2d4"}.fa-bandcamp:before{content:"\f2d5"}.fa-grav:before{content:"\f2d6"}.fa-etsy:before{content:"\f2d7"}.fa-imdb:before{content:"\f2d8"}.fa-ravelry:before{content:"\f2d9"}.fa-eercast:before{content:"\f2da"}.fa-microchip:before{content:"\f2db"}.fa-snowflake-o:before{content:"\f2dc"}.fa-superpowers:before{content:"\f2dd"}.fa-wpexplorer:before{content:"\f2de"}.fa-meetup:before{content:"\f2e0"}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}@font-face{font-family:sulu;src:url(/build/admin/fonts/sulu.7918956d252a916c3102478369c134b8.ttf) format("truetype"),url(/build/admin/fonts/sulu.49769d2d0234e781d6202cc11f34f163.woff) format("woff"),url(/build/admin/fonts/sulu.5904240a3998e593f23b852a3cd9d721.svg#sulu) format("svg");font-weight:400;font-style:normal;font-display:block}[class*=" su-"],[class^=su-]{font-family:sulu!important;speak:never;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.su-folder-permission:before{content:"\e9a0"}.su-exclamation-circle:before{content:"\e99a"}.su-permissions:before{content:"\e99e"}.su-more-horizontal:before{content:"\e995"}.su-file-audio:before{content:"\e98c"}.su-audio:before{content:"\e991"}.su-video:before{content:"\e992"}.su-filter:before{content:"\e977"}.su-enter:before{content:"\e974"}.su-display-bottom-center:before{content:"\e91d";color:#585858}.su-display-bottom-left:before{content:"\e923";color:#585858}.su-display-bottom-right:before{content:"\e95c";color:#585858}.su-display-center-center:before{content:"\e95d";color:#585858}.su-display-center-left:before{content:"\e95e";color:#585858}.su-display-center-right:before{content:"\e95f";color:#585858}.su-display-default:before{content:"\e964";color:#585858}.su-display-top-center:before{content:"\e966";color:#585858}.su-display-top-left:before{content:"\e970";color:#585858}.su-display-top-right:before{content:"\e972";color:#585858}.su-shadow-page:before{content:"\e95b"}.su-tree-list:before{content:"\e947"}.su-subscript2:before{content:"\e948"}.su-superscript:before{content:"\e950"}.su-square:before{content:"\e945"}.su-expand:before{content:"\e918"}.su-sync:before{content:"\e919"}.su-columns:before{content:"\e934"}.su-user:before{content:"\e91a"}.su-arrow-alt-v:before{content:"\e93b"}.su-arrow-alt-h:before{content:"\e93d"}.su-arrows-alt:before{content:"\e941"}.su-more:before{content:"\e94f"}.su-list-ol:before{content:"\e951"}.su-save:before{content:"\e952"}.su-clean:before{content:"\e953"}.su-language:before{content:"\e954"}.su-dollar:before{content:"\e955"}.su-list-ul:before{content:"\e956"}.su-list-check:before{content:"\e957"}.su-envelope:before{content:"\e958"}.su-snippet:before{content:"\e959"}.su-exclamation-triangle:before{content:"\e95a"}.su-magic:before{content:"\e983"}.su-map:before{content:"\e987"}.su-ban:before{content:"\e988"}.su-bold:before{content:"\e98a"}.su-fire:before{content:"\e96b"}.su-globe:before{content:"\e98b"}.su-inbox:before{content:"\e99f"}.su-italic:before{content:"\e960"}.su-underline:before{content:"\e961"}.su-subscript:before{content:"\e962"}.su-strikethrough:before{content:"\e963"}.su-file-word:before{content:"\e965"}.su-copyright:before{content:"\e967"}.su-at:before{content:"\e968"}.su-unlink:before{content:"\e969"}.su-brush:before{content:"\e96a"}.su-explose:before{content:"\e96c"}.su-pen:before{content:"\e96d"}.su-tag:before{content:"\e96e"}.su-percent:before{content:"\e96f"}.su-bluetooth:before{content:"\e971"}.su-check-circle:before{content:"\e973"}.su-location-arrow:before{content:"\e975"}.su-microphone:before{content:"\e976"}.su-camera:before{content:"\e978"}.su-ticket:before{content:"\e979"}.su-eye:before{content:"\e97a"}.su-earth:before{content:"\e97b"}.su-heart:before{content:"\e97c"}.su-graduation-cap:before{content:"\e97d"}.su-house:before{content:"\e97e"}.su-trophy:before{content:"\e980"}.su-redirect:before{content:"\e981"}.su-euro:before{content:"\e982"}.su-umbrella:before{content:"\e984"}.su-industry:before{content:"\e985"}.su-information:before{content:"\e986"}.su-paint:before{content:"\e989"}.su-diagramm:before{content:"\e98d"}.su-chart:before{content:"\e98e"}.su-archive:before{content:"\e98f"}.su-phone:before{content:"\e990"}.su-webspace:before{content:"\e944"}.su-download:before{content:"\e993"}.su-upload:before{content:"\e994"}.su-align-center:before{content:"\e996"}.su-wifi:before{content:"\e997"}.su-th-large:before{content:"\e998"}.su-sort:before{content:"\e999"}.su-align-left:before{content:"\e99b"}.su-align-right:before{content:"\e99c"}.su-link2:before{content:"\e99d"}.su-cog:before{content:"\e900"}.su-times:before{content:"\e901"}.su-arrow-up:before{content:"\e902"}.su-arrow-down:before{content:"\e903"}.su-arrow-right:before{content:"\e904"}.su-arrow-left:before{content:"\e905"}.su-document:before{content:"\e949"}.su-focus:before{content:"\e91b"}.su-folder:before{content:"\e91c"}.su-circle:before{content:"\e906"}.su-exchange-alt:before{content:"\e907"}.su-exchange-up:before{content:"\e908"}.su-caret-left:before{content:"\e909"}.su-caret-right:before{content:"\e90a"}.su-caret-up:before{content:"\e90b"}.su-caret-down:before{content:"\e90c"}.su-image:before{content:"\e90d"}.su-minus:before{content:"\e90e"}.su-plus:before{content:"\e92e"}.su-plus-circle:before{content:"\e926"}.su-align:before{content:"\e925"}.su-angle-down:before{content:"\e90f"}.su-caret-down-fill:before{content:"\e910"}.su-caret-left-fill:before{content:"\e911"}.su-caret-right-fill:before{content:"\e912"}.su-caret-up-fill:before{content:"\e913"}.su-angle-left:before{content:"\e914"}.su-angle-right:before{content:"\e915"}.su-angle-up:before{content:"\e916"}.su-newspaper:before{content:"\e917"}.su-battery-empty:before{content:"\e931"}.su-battery-full:before{content:"\e930"}.su-battery-low:before{content:"\e92f"}.su-calendar:before{content:"\e92d"}.su-check:before{content:"\e92a"}.su-circle-full:before{content:"\e92c"}.su-bell:before{content:"\e929"}.su-sign-out-alt:before{content:"\e92b"}.su-cloud:before{content:"\e928"}.su-code:before{content:"\e91e"}.su-comment:before{content:"\e91f"}.su-copy:before{content:"\e920"}.su-credit-card:before{content:"\e921"}.su-cut:before{content:"\e922"}.su-desktop:before{content:"\e924"}.su-exit:before{content:"\e927"}.su-flag:before{content:"\e932"}.su-flash:before{content:"\e933"}.su-mobile:before{content:"\e935"}.su-link:before{content:"\e936"}.su-th-list:before{content:"\e937"}.su-lock:before{content:"\e938"}.su-file-media-alt:before{content:"\e939"}.su-bars:before{content:"\e93a"}.su-news:before{content:"\e93c"}.su-pen2:before{content:"\e93e"}.su-map-pin:before{content:"\e93f"}.su-process:before{content:"\e940"}.su-search:before{content:"\e942"}.su-size:before{content:"\e94e"}.su-small:before{content:"\e94d"}.su-storage:before{content:"\e94c"}.su-sulu:before{content:"\e94b"}.su-clock:before{content:"\e94a"}.su-trash-alt:before{content:"\e943"}.su-align-justify:before{content:"\e946"}.su-hide:before{content:"\e97f"}.clickable--2-TzL1jn1k{cursor:pointer}.item--2MP4_Vp3Oe{color:#ccc;font-size:14px;line-height:16px;cursor:pointer;background:#232e44;box-sizing:border-box;padding-left:4px;position:relative}.item--2MP4_Vp3Oe:hover{color:#52b6ca}.item--2MP4_Vp3Oe.active--2cQkrWKevT{border-left:4px solid #52b6ca;background:#232739;font-weight:700;padding-left:0}.item--2MP4_Vp3Oe .title--QVStj55_lI{padding:20px 40px 20px 36px}.item--2MP4_Vp3Oe .title--QVStj55_lI span{margin-right:20px;width:15px}.item--2MP4_Vp3Oe .children-indicator--1u36bqdpDU{position:absolute;right:20px;top:20px}.item--2MP4_Vp3Oe .item--2MP4_Vp3Oe{font-size:12px;background:inherit;font-weight:400;margin-left:30px;padding-left:0}.item--2MP4_Vp3Oe .item--2MP4_Vp3Oe .title--QVStj55_lI{padding-top:0;padding-bottom:15px;padding-left:41px}.item--2MP4_Vp3Oe .item--2MP4_Vp3Oe.active--2cQkrWKevT{border-left:none;font-weight:700;background:inherit}.navigation--1TPKGVcdtJ{width:260px;background-color:#1c2945;color:#fff;min-height:100%;opacity:.94;position:relative;display:flex;flex-direction:column}.header--1yYASq55gP{height:60px;background-color:rgba(0,0,0,.15)}.header-content--3q2ACaykun{padding:20px 40px}.header-icon--3slb78kEn1{font-size:20px;line-height:20px;padding-right:20px;vertical-align:middle;height:100%}.header-title--3llLneBogU{font-size:16px;line-height:20px;vertical-align:middle;height:100%}.user--1yh8_EoOW4{min-height:130px;background-color:#293650}.user-content--1HWDvaZ5qI{padding:40px;display:flex;font-size:14px;line-height:16px;align-items:center}.user-content--1HWDvaZ5qI .no-user-image--2r0uxVSaEY,.user-content--1HWDvaZ5qI img{width:50px;height:50px;flex-grow:0;flex-shrink:0;border-radius:25px;cursor:pointer}.user-content--1HWDvaZ5qI .no-user-image--2r0uxVSaEY{background-color:#ccc;color:#fff;border:0}.user-content--1HWDvaZ5qI .no-user-image--2r0uxVSaEY span{font-size:30px;height:100%;width:100%;text-align:center;display:block;line-height:50px}.user-profile--3h8wK9aFMr{margin-left:20px}.user-profile--3h8wK9aFMr .username--1iD-BWgeXO{color:#fff;font-size:14px;text-align:left;cursor:pointer}.user-profile--3h8wK9aFMr .logout--3rYtUBtY-s{font-size:12px;color:#ccc;line-height:16px;margin-top:10px}.user-profile--3h8wK9aFMr button{background:none;border:none;padding:0;cursor:pointer}.user-profile--3h8wK9aFMr button span{padding-right:10px}.items--23JrT1L7Qn{flex-grow:1}.footer--3d3KVHirl9{display:flex;justify-content:center;align-items:center;padding:20px}.pin--1EfeTj0EjG{position:relative;flex:0 0 auto;align-self:flex-end;min-width:25px;height:25px;border-radius:5px;border:1px solid #52b6ca;margin-right:20px;background-color:#1c2945;color:#52b6ca;cursor:pointer}.pin--1EfeTj0EjG.pin-active--2xYrKut_aI,.pin--1EfeTj0EjG:hover{background-color:#52b6ca;color:#1c2945}.pin--1EfeTj0EjG .pin-icon--2Bs7SKVMJD{line-height:23px;font-size:14px;margin-left:auto}.versions--1zEVIvOm77{flex:1 1 auto;font-size:10px;line-height:14px;text-align:center;color:#ccc;word-break:break-word}.versions--1zEVIvOm77 a{color:#ccc;text-decoration:none}.versions--1zEVIvOm77 a:hover{text-decoration:underline}.backdrop--1NPZgaTLwy{width:100%;height:100%;background:transparent;position:absolute}.backdrop--1NPZgaTLwy.visible--2Ns3EfQy8A{background:hsla(0,0%,60%,.9)}.backdrop--1NPZgaTLwy.fixed--2GqQpeyTUu{position:fixed;top:0;left:0}.spinner--1SR7qONWz4{position:relative;margin:auto}.double-bounce1--25UAQah_f8,.double-bounce2--hAKcsQjiAL{width:100%;height:100%;border-radius:50%;background-color:#585858;opacity:.6;position:absolute;top:0;left:0;will-change:transform;-webkit-animation:bounce--1esEi9hF2d 2s ease-in-out infinite;animation:bounce--1esEi9hF2d 2s ease-in-out infinite}.double-bounce2--hAKcsQjiAL{-webkit-animation-delay:-1s;animation-delay:-1s}@-webkit-keyframes bounce--1esEi9hF2d{0%,to{transform:scale(0)}50%{transform:scale(1)}}@keyframes bounce--1esEi9hF2d{0%,to{transform:scale(0)}50%{transform:scale(1)}}.button--319u6U1AIl{position:relative;white-space:nowrap;display:inline-flex;justify-content:center}.button--319u6U1AIl:disabled{cursor:default}.primary--1wekDI7P-q,.secondary--1n10BKfoP3{font-size:12px;border:1px solid;border-radius:3px;line-height:28px;cursor:pointer;text-align:center;min-width:140px;padding:0 40px}.primary--1wekDI7P-q .button-icon--2zwDFL5-yo,.primary--1wekDI7P-q .dropdown-icon--1IfR6jDzfv,.secondary--1n10BKfoP3 .button-icon--2zwDFL5-yo,.secondary--1n10BKfoP3 .dropdown-icon--1IfR6jDzfv{display:inline-flex;align-items:center;position:absolute;top:0;bottom:0}.primary--1wekDI7P-q .button-icon--2zwDFL5-yo,.secondary--1n10BKfoP3 .button-icon--2zwDFL5-yo{left:10px}.primary--1wekDI7P-q .dropdown-icon--1IfR6jDzfv,.secondary--1n10BKfoP3 .dropdown-icon--1IfR6jDzfv{left:auto;right:10px;font-size:10px}.primary--1wekDI7P-q{border-color:#52b6ca;background:#52b6ca;color:#fff}.primary--1wekDI7P-q:disabled{border-color:#ccc;background-color:#ccc}.secondary--1n10BKfoP3{border-color:#ccc;background:#f5f5f5;color:#000}.secondary--1n10BKfoP3:disabled{color:#ccc}.link--p45eB9JWbh{padding:0;border:0;background:transparent;cursor:pointer;font-size:12px;color:#000}.link--p45eB9JWbh .button-text--1S_k29yuHf{text-decoration:underline}.link--p45eB9JWbh .button-icon--2zwDFL5-yo+.button-text--1S_k29yuHf{margin-left:10px}.link--p45eB9JWbh .dropdown-icon--1IfR6jDzfv{margin-left:10px;font-size:10px}.link--p45eB9JWbh:disabled{color:#a2a2a2}.text--3HNWf-tIc7{padding:0;border:0;background:transparent;cursor:pointer;font-size:12px;color:#000}.text--3HNWf-tIc7 .button-icon--2zwDFL5-yo+.button-text--1S_k29yuHf{margin-left:10px}.text--3HNWf-tIc7 .dropdown-icon--1IfR6jDzfv{margin-left:10px;font-size:10px}.text--3HNWf-tIc7:disabled{color:#a2a2a2}.icon--2SWnwI7jSC{background:none;min-width:30px;height:30px;line-height:28px;border-radius:4px;border:1px solid #6e6e6e;color:#6e6e6e;cursor:pointer;font-size:14px;padding:0 5px}.icon--2SWnwI7jSC:hover:not(:disabled){background-color:#ccc}.icon--2SWnwI7jSC:disabled{color:#ccc}.icon--2SWnwI7jSC.active--2PPd5kFWvV{background-color:#6e6e6e;color:#fff}.icon--2SWnwI7jSC .button-icon--2zwDFL5-yo,.icon--2SWnwI7jSC .dropdown-icon--1IfR6jDzfv{line-height:28px}.icon--2SWnwI7jSC .dropdown-icon--1IfR6jDzfv{margin-left:5px;font-size:10px}.loader--2SXOeEeNqC{display:none;position:absolute;top:0;left:0;width:100%;height:100%}.loading--NeW6CHK6qx{background-color:transparent;border-color:transparent}.loading--NeW6CHK6qx .button-text--1S_k29yuHf{opacity:0}.loading--NeW6CHK6qx .loader--2SXOeEeNqC{display:flex}.character-counter--14nxaTtyFd{color:#585858;font-size:10px;margin-top:5px}.exceeded--2d6cnYNavZ{color:#cf3939}.segment-counter--2NXlSNVovg{color:#585858;font-size:10px;margin-top:5px}.exceeded--v2ggIaitw-{color:#cf3939}.input--YrRPhYPmPT{border:1px solid #ccc;border-radius:3px;display:inline-flex;font-size:12px;align-items:center;height:30px;width:100%;background-color:#fff;position:relative}.input--YrRPhYPmPT input{width:calc(100% - 32px);flex-grow:1;border:none;border-radius:3px;height:28px;color:#000;will-change:width,padding-left;transition:width .3s,padding-left .1s linear}.input--YrRPhYPmPT input::-moz-placeholder{color:#999}.input--YrRPhYPmPT input::placeholder{color:#999}.input--YrRPhYPmPT input:invalid{box-shadow:none}.input--YrRPhYPmPT input:disabled{color:#878787;background-color:#f5f5f5}.input--YrRPhYPmPT.left--3McDXiCrys input{text-align:left;padding-left:10px;padding-right:1px}.input--YrRPhYPmPT.center--JXk60IDjWJ input{text-align:center;padding-left:1px;padding-right:1px}.input--YrRPhYPmPT.right--pX9XMNaOG9 input{text-align:right;padding-left:1px;padding-right:10px}.input--YrRPhYPmPT.collapsed--3cKiJ1rgll input{padding:0;width:0}.input--YrRPhYPmPT.has-append-icon--pQms0sSnCj input{will-change:margin-right;transition:margin-right .1s;margin-right:34px}.input--YrRPhYPmPT.has-append-icon--pQms0sSnCj.collapsed--3cKiJ1rgll input{margin-right:0;visibility:hidden}.input--YrRPhYPmPT.dark--tc2vktcDJ7{background-color:#fff;color:#000;border-radius:4px;border-color:#6e6e6e}.input--YrRPhYPmPT.dark--tc2vktcDJ7.collapsed--3cKiJ1rgll{background-color:#f5f5f5}.input--YrRPhYPmPT.error--1YjDkE4VYd{border-color:#cf3939}.input--YrRPhYPmPT.disabled--1cFjjKATa0{background-color:#f5f5f5}.input--YrRPhYPmPT .prepended-container--1HLUlo-uAQ{flex:0 0 32px;height:20px;width:32px}.input--YrRPhYPmPT .prepended-container--1HLUlo-uAQ.collapsed--3cKiJ1rgll{height:100%}.input--YrRPhYPmPT .icon--ytM2BXHUpA{display:flex;align-items:center;justify-content:center;height:100%;width:100%;font-size:14px;text-align:center}.input--YrRPhYPmPT.headline--2ofmFMh3Td{font-size:18px;line-height:28px;height:40px}.input--YrRPhYPmPT.headline--2ofmFMh3Td input{font-weight:700}.input--YrRPhYPmPT.headline--2ofmFMh3Td .prepended-container--1HLUlo-uAQ{flex:0 0 42px;height:30px;width:42px}.input--YrRPhYPmPT.headline--2ofmFMh3Td .icon--ytM2BXHUpA{font-size:20px}.prepended-container--1HLUlo-uAQ{position:relative;box-shadow:1px 0 0 #ccc;display:flex;justify-content:center;align-items:center}.prepended-container--1HLUlo-uAQ.dark--tc2vktcDJ7{box-shadow:1px 0 0 #6e6e6e}.prepended-container--1HLUlo-uAQ.collapsed--3cKiJ1rgll{box-shadow:none}.append-container--260F-W2kJw{position:absolute;height:20px;right:0}.append-container--260F-W2kJw .icon--ytM2BXHUpA{margin-right:10px}.icon--ytM2BXHUpA{display:block;flex-grow:0;color:#999;line-height:20px}.icon--ytM2BXHUpA.dark--tc2vktcDJ7{color:#6e6e6e}.icon-clickable--2i8CXxR-rS{cursor:pointer}.header--2ygAfnPWFk{font-size:22px;font-weight:700;line-height:32px;margin:10px 0 80px;text-align:center;width:100%;min-height:50px}.header--2ygAfnPWFk.small--2AqcGA84hV{font-size:14px;line-height:20px;font-weight:400}.form--1pNyeHZ_J6{width:100%}.form--1pNyeHZ_J6 fieldset{padding:0;border:0}.buttons--2B7RG6G7uu{display:flex;justify-content:space-between;margin-top:30px;width:100%}.input-field--31TEuk-dv0{display:block;margin-bottom:10px}.input-field--31TEuk-dv0.error--1E_rPAurFD{color:#d96161}.label-text--2dcgberBAk{margin-bottom:10px}.login--1dPKvzoqvx{height:100vh;width:100vw;display:flex;justify-content:center;align-items:center;color:#000;border-radius:3px;font-size:14px}.login-container--3KCmvHyz7g{background-color:#fff;box-shadow:0 2px 18px 0 rgba(0,0,0,.22);width:480px;min-height:615px}.logo-container--3Rnp2jIalL{font-size:70px;text-align:center}.loader-container--2zvDPfXw7t{flex-grow:1;display:flex;height:100%;width:100%}.form-container--1a48M_vk4X{display:flex;flex-direction:column;min-height:550px;padding:70px 60px 60px}.back-link-container--2ymktxCyG7{border-top:1px solid #e6e6e6;text-decoration:none;display:flex;width:100%;height:80px;align-items:center;justify-content:center}.back-link--3p99EI_qQY{color:#000;text-decoration:none}.back-link-icon--3Ala6w-5jt{margin-right:10px}.actions--3fKNmIlaGZ{line-height:90px}.container--1Af_ukQ1Tq{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;justify-content:center}.container--1Af_ukQ1Tq>*{opacity:0;will-change:opacity;transition:opacity .3s}.overlay--1i69zMOzmm{position:relative;top:-100%;opacity:0;will-change:top,opacity;transition:top .3s,opacity .3s;pointer-events:none;max-height:calc(100vh - 100px)}.overlay--1i69zMOzmm>*{pointer-events:auto}.overlay--1i69zMOzmm.small--3LzryW5Wgh{width:50vw}.overlay--1i69zMOzmm.large--1vOJ_O2MxG{width:80vw}.is-down--1GrBJwFYKD>*{opacity:1}.is-down--1GrBJwFYKD .overlay--1i69zMOzmm{top:0}.content--uDzbc_yR5N{border-radius:0 0 3px 3px;overflow:hidden;box-shadow:0 10px 18px 0 rgba(53,53,53,.5)}.content--uDzbc_yR5N header{background:#f2f2f2;border-bottom:1px solid #ccc;height:82px;text-align:center;line-height:82px}.content--uDzbc_yR5N header h2{display:inline-block;margin:0}.content--uDzbc_yR5N article{max-height:calc(100vh - 272px);overflow:auto;background:#f2f2f2}.content--uDzbc_yR5N footer{background:#fff;border-top:1px solid #ccc;height:90px;padding:0 60px;display:flex;justify-content:space-between;align-items:center}.content--uDzbc_yR5N footer button:only-child{margin-left:auto}.content--uDzbc_yR5N .icon--3x5ECMVMng{position:absolute;right:60px;font-size:14px;font-weight:700;line-height:82px;text-align:center;cursor:pointer}.permission-hint--1-xu7E7ALV{font-size:18px;font-weight:700;color:#878787;width:100%;text-align:center}.permission-icon--3QNsTvSUZN{font-size:32px}.colSpan--1-dAvrr6Hs{width:100%}@media (min-width:520px){.colSpan-1--2FbmDHOf05{width:8.33333%}.colSpan-2--32mWE8xnNT{width:16.66667%}.colSpan-3--YWgZb8jzq2{width:25%}.colSpan-4--3PrZt6EqIQ{width:33.33333%}.colSpan-5--1rBEJVQGbT{width:41.66667%}.colSpan-6--1dEtnH0fLF{width:50%}.colSpan-7--2HCkJEVswE{width:58.33333%}.colSpan-8--34cDQl2pms{width:66.66667%}.colSpan-9--3wPTGWSNKn{width:75%}.colSpan-10--2EG5Y65M5i{width:83.33333%}.colSpan-11--15lXSff09p{width:91.66667%}.colSpan-12--auvwGOVazL{width:100%}.space-before-1--1esoCSFR-u{margin-left:8.33333%}.space-before-2--f1wHMt4Rmd{margin-left:16.66667%}.space-before-3--3HDe8T3Pje{margin-left:25%}.space-before-4--2RKyHLb2uI{margin-left:33.33333%}.space-before-5--1nxb2II90k{margin-left:41.66667%}.space-before-6--1K3F-ulqg4{margin-left:50%}.space-before-7--3uja_9LjlA{margin-left:58.33333%}.space-before-8--3cWhs0mPIQ{margin-left:66.66667%}.space-before-9--pzFcGgnpnX{margin-left:75%}.space-before-10--1ho3Bf-DtI{margin-left:83.33333%}.space-before-11--PwsJFZP62-{margin-left:91.66667%}.space-before-12--7njTyjsxdY{margin-left:100%}.space-after-1--3iF2QSAogD{margin-right:8.33333%}.space-after-2--2jBiGc2Um2{margin-right:16.66667%}.space-after-3--2pLVKlWYlr{margin-right:25%}.space-after-4--1t1ydT_lzZ{margin-right:33.33333%}.space-after-5---k4J3z7IEv{margin-right:41.66667%}.space-after-6--3DsSEzIWpw{margin-right:50%}.space-after-7--1Mv6x0Wauv{margin-right:58.33333%}.space-after-8--3PQwlQSKI0{margin-right:66.66667%}.space-after-9--1g84Il2fiV{margin-right:75%}.space-after-10--3XDTUmY_Ry{margin-right:83.33333%}.space-after-11--176XwWyHT6{margin-right:91.66667%}.space-after-12--gbs-Ox5bvw{margin-right:100%}}.item--3RIViIi05o{float:left;padding-right:20px}.section--2Uk6NDvPTv{float:left}.grid--370cPalb_8{margin-right:-20px}.grid--370cPalb_8:after{content:"";clear:both;display:block}.container--23xz7h0-xz{position:fixed;top:0;left:0;width:100%;height:100%;pointer-events:none}.item--15AVvF2Hj1{background:none;border:none;display:block;height:22px;color:#000;font-size:12px;line-height:22px;margin-bottom:6px;cursor:pointer;text-align:start}.item--15AVvF2Hj1:last-child{margin-bottom:0}.item--15AVvF2Hj1.active--3RZWM1Ykmv,.item--15AVvF2Hj1:hover:not([disabled]){font-weight:700;color:#112a46}.item--15AVvF2Hj1:disabled{color:#ccc;cursor:default}.icon--2p2c6gIM2J{display:inline-block;width:20px}.section--1n3lbbqXnr{padding-left:30px;padding-right:30px;padding-bottom:10px}.section--1n3lbbqXnr:first-child{padding-top:10px}.section--1n3lbbqXnr:last-child{padding-bottom:10px}.section--1n3lbbqXnr:not(:first-child){border-top:1px solid #ccc;padding-top:10px}.children--1ea8Qy5gQh{padding:10px 0}.title--3d8U3BmPFR{color:#000;font-size:14px;line-height:24px;font-weight:700}.title--3d8U3BmPFR:last-child{margin-bottom:0}.action--3mKMEHF4Cc{background:transparent;border:none;display:block;line-height:14px;color:#000;cursor:pointer;font-size:12px;margin-bottom:10px;text-align:left}.action--3mKMEHF4Cc:hover{color:#52b6ca}.action--3mKMEHF4Cc:last-child{margin-bottom:0}.action--3mKMEHF4Cc:disabled{color:#ccc;cursor:default}.icon--1q0w8JiliW{margin-right:10px}.arrowMenuContainer--fOytZ9Zsxt{margin:0;position:relative}.arrowMenu--4r1or9HiQX{background-color:#fff;border-radius:2px;font-size:12px;box-shadow:0 0 14px 0 hsla(0,0%,43.1%,.5);overflow:auto;min-width:200px}.arrow--bJop7vN7y9{width:0;height:0;position:absolute}.arrow--bJop7vN7y9.right--2NBH_d3jy4{right:10px}.arrow--bJop7vN7y9.left--FKL0iKRMXW{left:10px}.arrow--bJop7vN7y9.top--398upSLia8{top:-10px;border-left:15px solid transparent;border-right:15px solid transparent;border-bottom:15px solid #fff}.arrow--bJop7vN7y9.bottom--23iQuHKgmD{bottom:-10px;border-left:15px solid transparent;border-right:15px solid transparent;border-top:15px solid #fff}.field--VY-GnCrWFK{margin-bottom:10px}.type--3_ymNx49w2{background:transparent;border:0;color:#585858;cursor:pointer;margin-left:7px;font-size:12px}.type-delimiter--28x9N38BXv{margin-right:7px}.type-icon--1L9msLPWzK{margin-left:3px;font-size:10px}.error--vu_NabseBv>.label--2S0ZduPoBW{color:#d96161}.label--2S0ZduPoBW{display:block;color:#585858;font-size:14px;line-height:19px;margin-bottom:10px;text-align:left;white-space:nowrap}.label--2S0ZduPoBW:after{content:"\200B"}.description-label--10UEOAlmZb,.error-label--kCmWKRItWy{display:block;color:#585858;font-size:10px;line-height:20px;height:20px}.error-label--kCmWKRItWy{color:#cf3939}.grid--3IQZeqSYws{overflow-y:hidden}.grid--3IQZeqSYws,.grid-section--2jSUXJEKui{margin-bottom:-30px}.grid-section--2jSUXJEKui:last-child{margin-bottom:0}.grid-section--2jSUXJEKui+.grid-item--3OxWG0xFvT{margin-top:30px}.grid-item--3OxWG0xFvT+.grid-section--2jSUXJEKui{margin-top:-30px}@media (max-width:520px){.grid-section--2jSUXJEKui+.grid-section--2jSUXJEKui{margin-top:30px}}.divider--32l6kUMZGL{display:flex;align-items:center;font-size:18px;margin:50px 0 30px}.divider--32l6kUMZGL:after,.divider--32l6kUMZGL:before{content:"";display:inline-block;flex:1;height:1px;background:#ccc}.divider--32l6kUMZGL:before{margin-right:40px}.divider--32l6kUMZGL:after{margin-left:40px}.divider--32l6kUMZGL:empty:after,.divider--32l6kUMZGL:empty:before{margin:0}.field-container--2Ljd6_6r9z{min-height:30px;display:flex;align-items:center}.field--eI_QIymGzA{flex:1;max-width:100%;width:100%}.field-exception--uFAS3rCCs5{color:#fff;background:#d96161;border:1px solid #cf3939;padding:0 20px;border-radius:3px;margin-bottom:20px}.dialog-container--3iqPqgpIht{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;justify-content:center;align-items:center}.dialog--RUeFRUqJ7i{width:500px;position:relative;opacity:0;will-change:opacity;transition:opacity .3s;pointer-events:none;max-height:calc(100vh - 100px)}.dialog--RUeFRUqJ7i>*{pointer-events:auto}.dialog--RUeFRUqJ7i.small--51AMVxPkHr{width:50vw}.dialog--RUeFRUqJ7i.large--3aB9-oT0DU{width:80vw}.open--1ztEKgXgPI>*{opacity:1}.content--1lT7Ozsit1{border-radius:3px;background:#f2f2f2;overflow:hidden;position:relative}.content--1lT7Ozsit1 header{color:#000;font-size:22px;font-weight:700;text-align:center;height:85px;line-height:85px}.content--1lT7Ozsit1 footer{background:#fff;border-top:1px solid #ccc;height:90px;padding:0 30px;display:flex;justify-content:space-between;align-items:center;flex-direction:row-reverse}.article--HsA9m-yR9d{max-height:calc(100vh - 275px);color:#999;font-size:12px;line-height:22px;overflow:auto;padding:0 30px 30px}.article--HsA9m-yR9d.left--1ySAvPAxLR{text-align:left}.article--HsA9m-yR9d.center--2OBQ2-TNxd{text-align:center}.article--HsA9m-yR9d ul{text-align:left}.divider--1Fm7gTXM47{width:100%;height:1px;background:#babfc7;margin:5px 0}.menu--37Ejoi9Vs_{border-radius:2px;padding:5px 0;font-size:12px;margin:0;overflow:auto;background:#f5f5f5;box-shadow:2px 6px 12px 0 rgba(0,0,0,.22);border:1px solid #babfc7}.action--2ujqPybEcG{width:100%;position:relative;line-height:20px;padding:0 20px 0 30px;color:#112a46;border:none;background:transparent;cursor:pointer;text-align:left;font-size:12px}.action--2ujqPybEcG:focus{color:#52b6ca}.label--22nuJrNdMC{display:flex;align-items:center;cursor:pointer}.label--22nuJrNdMC>div{font-size:14px;margin-left:10px;overflow:hidden;line-height:20px}.label--22nuJrNdMC+.label--22nuJrNdMC{margin-top:10px}.label--22nuJrNdMC.disabled--2Cej_PnzDf{cursor:default}.switch--52fMu6kGAZ{display:inline-block;position:relative;flex-shrink:0}.switch--52fMu6kGAZ input{position:absolute;width:100%;height:100%;opacity:0;cursor:pointer}.switch--52fMu6kGAZ.disabled--2Cej_PnzDf input{cursor:default}.checkbox--2Z3YMYLqUa.dark--1gdZ2dJMIJ input+span{border-color:#112a46;color:#fff}.checkbox--2Z3YMYLqUa.dark--1gdZ2dJMIJ input:checked+span{background:#112a46}.checkbox--2Z3YMYLqUa.light--29kb21gbll input+span{border-color:#fff;color:#112a46}.checkbox--2Z3YMYLqUa.light--29kb21gbll input:checked+span{background:#fff}.checkbox--2Z3YMYLqUa{width:16px;height:16px}.checkbox--2Z3YMYLqUa input+span{display:block;width:100%;height:100%;background:transparent;position:absolute;top:0;left:0;border-radius:2px;border-width:1px;border-style:solid;text-align:center;line-height:16px}.checkbox--2Z3YMYLqUa input+span>*{position:relative;top:-1px;left:-1px;font-size:16px}.checkbox--2Z3YMYLqUa input:disabled+span{border-color:#ccc;color:#ccc}.checkbox--2Z3YMYLqUa input:disabled:checked+span{background:#ccc;color:#fff}.option--1eWSkGSpFA{width:100%;position:relative;padding:0 20px 0 30px;color:#112a46;border:none;background:transparent;cursor:pointer;text-align:left;font-size:12px;outline:0}.option--1eWSkGSpFA:not(:disabled):focus{color:#52b6ca}.option--1eWSkGSpFA:disabled{color:rgba(17,42,70,.3);cursor:default}.option--1eWSkGSpFA.selected--1-ond8Qok-{font-weight:700}.option--1eWSkGSpFA.icon--3RROHewPwf{line-height:20px}.option--1eWSkGSpFA.icon--3RROHewPwf.selected--1-ond8Qok- .icon--3RROHewPwf{position:absolute;left:10px;line-height:20px;vertical-align:middle}.option--1eWSkGSpFA.checkbox--20iG1zUWsj{line-height:25px;padding-left:35px}.option--1eWSkGSpFA.checkbox--20iG1zUWsj .input--2b5or2iAr4{position:absolute;left:10px;top:4px;line-height:20px;vertical-align:middle}.cropped-text--kjpmxHAsTL{width:100%;overflow:hidden;display:inline-flex;flex-wrap:nowrap;position:relative;line-height:normal}.cropped-text--kjpmxHAsTL .whole--3GXEeu7Wnq{position:absolute;top:0;left:0;color:transparent;white-space:nowrap}.cropped-text--kjpmxHAsTL .front--3wwBW91aMg{text-overflow:ellipsis;white-space:pre}.cropped-text--kjpmxHAsTL .back--2lOqwyu_8t,.cropped-text--kjpmxHAsTL .front--3wwBW91aMg{flex-grow:0;flex-shrink:1;flex-basis:content;overflow:hidden;-webkit-user-select:none;-moz-user-select:none;user-select:none}.cropped-text--kjpmxHAsTL .back--2lOqwyu_8t span{float:right;white-space:pre}.displayValue--2O6vhDMKzo{cursor:pointer;position:relative;padding:7px 30px 7px 10px}.displayValue--2O6vhDMKzo.flat--1i-jpyShvi{border:none;background-color:transparent;color:inherit}.displayValue--2O6vhDMKzo.dark--kOMfdHyQbH,.displayValue--2O6vhDMKzo.default--1qHeDKVcu7{display:flex;width:100%;height:30px;border:1px solid #ccc;border-radius:3px;text-align:left;font-size:12px;color:#000;background-color:#fff}.displayValue--2O6vhDMKzo.dark--kOMfdHyQbH:hover,.displayValue--2O6vhDMKzo.default--1qHeDKVcu7:hover{color:#52b6ca}.displayValue--2O6vhDMKzo.dark--kOMfdHyQbH{background-color:#fff;color:#000;border-color:#6e6e6e;border-radius:4px}.displayValue--2O6vhDMKzo:disabled{cursor:default;color:#878787;background-color:#f5f5f5}.displayValue--2O6vhDMKzo:disabled:hover{color:#878787}.has-icon--1xE1O9fM4T{padding-left:30px;text-align:center}.front-icon--2QiEDGhKo2{left:10px}.front-icon--2QiEDGhKo2,.toggle--3gWiwmRHGz{display:block;position:absolute;top:0;bottom:0;line-height:27px;vertical-align:middle;font-size:10px}.toggle--3gWiwmRHGz{right:10px}.select--2Y_GcUrdzb{display:inline-block;width:100%}.options-list--3aq1Q6866f{list-style:none;margin:0;padding:0}.card--1A_1l_zcun{background-color:#fff;border:1px solid #ccc;border-radius:3px;padding:30px;width:100%}.icons--2OK2vq2EMX{font-size:16px;float:right}.icons--2OK2vq2EMX>*{margin-left:20px}.cards--8przrrkuGX{display:flex;flex-wrap:wrap;margin-right:-20px}.card--1JiLTIqY32{display:flex;align-items:stretch;flex-shrink:0;width:50%;padding:0 20px 20px 0}@media (max-width:1024px){.card--1JiLTIqY32{float:none;width:100%;padding:0 0 20px}}.add-button-container--W2KubJcFS6{text-align:center}.overlay--2i3nf0KP-c{padding:40px 60px}.list--3YmuTTGhXs{display:flex;padding:30px 60px 60px}.overlay--2G9JZcdD4X.adapter-container--2m4SiICIc4.column_list--3it7BObNwV{margin-top:-1px;height:calc(100vh - 272px);overflow:hidden}.overlay--2G9JZcdD4X .adapter--ofe8U2ROPD.column_list--3it7BObNwV{padding:0;height:calc(100vh - 271px)}.dialog--fv57WrfaJo{text-align:left;margin:0 -30px -30px}.dialog--fv57WrfaJo.adapter-container--2m4SiICIc4.column_list--3it7BObNwV{height:calc(100vh - 272px);overflow:hidden}.dialog--fv57WrfaJo .adapter--ofe8U2ROPD.column_list--3it7BObNwV{padding:0;height:calc(100vh - 271px)}.button-group--3ZXJDYPX-3{display:flex}.button--30g09RbEvQ{border-radius:0;min-width:34px}.button--30g09RbEvQ:first-child{border-top-left-radius:4px;border-bottom-left-radius:4px}.button--30g09RbEvQ:last-child{border-top-right-radius:4px;border-bottom-right-radius:4px}.button--30g09RbEvQ:not(:last-child){border-right:0}.list--24qxBVT_IF,.list-container--1KaAm9Rrfq{display:flex;flex-direction:column;flex-grow:1}.list--24qxBVT_IF.disabled--1ABE7xWUvc{opacity:.5;pointer-events:none}.toolbar--1g1N15_Ogd{display:flex;justify-content:flex-end;align-items:center;margin-bottom:20px}.toolbar--1g1N15_Ogd>*{height:30px;margin-right:10px;width:auto}.toolbar--1g1N15_Ogd>:last-child{margin-right:0}.overlay--k9H5mFbXyn{display:flex;flex-direction:column;padding:40px 60px}.overlay--k9H5mFbXyn.sorting--ZdXIUoDhfl{-webkit-user-select:none;-moz-user-select:none;user-select:none}.column-option--jZQUsDRZlT{color:#000;display:flex;font-size:14px;padding:15px 0;width:100%}.column-option--jZQUsDRZlT:hover{background:#ccc}.column-option--jZQUsDRZlT .drag-handle--10N92JZ3Y-{cursor:move;padding:0 20px}.column-option--jZQUsDRZlT .label--1fD1ji4PAQ{flex-grow:1}.column-option--jZQUsDRZlT .icon--25swyaK0Z0{align-self:flex-end;font-size:20px;padding:0 20px}.column-option--jZQUsDRZlT.dragging--29HRxXAtIb{background:#ccc;box-shadow:0 3px 6px rgba(0,0,0,.1),0 -3px 6px rgba(0,0,0,.1)}.column-option-disabled--3L7Ort4fTy{color:#999}.column-option-disabled--3L7Ort4fTy.dragging--29HRxXAtIb,.column-option-disabled--3L7Ort4fTy:hover{background:#e6e6e6}.chip--K2e6naIoqw{border:none;border-radius:3px;display:inline-block;font-size:12px;line-height:18px;padding:0 10px;position:relative;white-space:nowrap}.chip--K2e6naIoqw .icon--2cCx3tEBrC{margin-left:10px}.chip--K2e6naIoqw>*{display:inline-block}.clickable--2htTqA8hvR{cursor:pointer}.disabled--32wMqJWJQ8{background-color:#ccc}.primary--3GCecGs-AC.chip--K2e6naIoqw{background-color:#52b6ca;color:#fff}.secondary--3XvyVzZYcd.chip--K2e6naIoqw{background-color:#f5f5f5;color:#000}.small--33Oeas09Ng{height:18px}.medium--2gdW3De9Io{height:30px}.field-filter-item--3ofjriHWP2{margin-right:5px}.button-container--2gG95hAsgn{text-align:right;margin-top:10px}.field-filter--dZnFcTcVXE{display:flex;flex-grow:1}.filter-button--1Wmp_CsCF-{margin-right:10px}.toggler--3g4H4O_qJk{width:37px;height:20px}.toggler--3g4H4O_qJk input+span{top:0;left:0;width:100%;height:100%;transition:background .2s,border-color .2s}.toggler--3g4H4O_qJk input+span,.toggler--3g4H4O_qJk input+span:after{position:absolute;display:block;background:#fff;border:1px solid #ccc;border-radius:10px}.toggler--3g4H4O_qJk input+span:after{content:"";top:-1px;left:-1px;width:20px;height:20px;transition:left .2s,border-color .2s}.toggler--3g4H4O_qJk input:checked+span{background:#112a46;border-color:#112a46}.toggler--3g4H4O_qJk input:checked+span:after{border-color:#112a46;left:16px}.toggler--3g4H4O_qJk input:disabled+span{background:transparent;border-color:#ccc}.toggler--3g4H4O_qJk input:disabled+span:after{border-color:#ccc;background-color:transparent}.color-box--pPJk3nPhC5{width:16px;height:16px;border-radius:2px}.list-icon--27L-PMsQyt{font-size:18px} /*! * https://github.com/YouCanBookMe/react-datetime diff --git a/public/build/admin/main.f0cc2182428bc8ac608f.js b/public/build/admin/main.71664cebfa3a198e0e91.js similarity index 66% rename from public/build/admin/main.f0cc2182428bc8ac608f.js rename to public/build/admin/main.71664cebfa3a198e0e91.js index 3fd4877f..2e0f1ef2 100644 --- a/public/build/admin/main.f0cc2182428bc8ac608f.js +++ b/public/build/admin/main.71664cebfa3a198e0e91.js @@ -28,7 +28,7 @@ o.version="2.29.1",t=jt,o.fn=bn,o.min=function(){var e=[].slice.call(arguments,0 * Leaflet 1.7.1, a JS library for interactive maps. http://leafletjs.com * (c) 2010-2019 Vladimir Agafonkin, (c) 2010-2011 CloudMade */ -!function(e){"use strict";function t(e){var t,n,r,o;for(n=1,r=arguments.length;n0?Math.floor(e):Math.ceil(e)};function R(e,t,n){return e instanceof T?e:m(e)?new T(e[0],e[1]):null==e?e:"object"==typeof e&&"x"in e&&"y"in e?new T(e.x,e.y):new T(e,t,n)}function M(e,t){if(e)for(var n=t?[e,t]:e,r=0,o=n.length;r=this.min.x&&n.x<=this.max.x&&t.y>=this.min.y&&n.y<=this.max.y},intersects:function(e){e=A(e);var t=this.min,n=this.max,r=e.min,o=e.max,i=o.x>=t.x&&r.x<=n.x,a=o.y>=t.y&&r.y<=n.y;return i&&a},overlaps:function(e){e=A(e);var t=this.min,n=this.max,r=e.min,o=e.max,i=o.x>t.x&&r.xt.y&&r.y=r.lat&&n.lat<=o.lat&&t.lng>=r.lng&&n.lng<=o.lng},intersects:function(e){e=z(e);var t=this._southWest,n=this._northEast,r=e.getSouthWest(),o=e.getNorthEast(),i=o.lat>=t.lat&&r.lat<=n.lat,a=o.lng>=t.lng&&r.lng<=n.lng;return i&&a},overlaps:function(e){e=z(e);var t=this._southWest,n=this._northEast,r=e.getSouthWest(),o=e.getNorthEast(),i=o.lat>t.lat&&r.latt.lng&&r.lng1,Pe=function(){var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("testPassiveEventSupport",l,t),window.removeEventListener("testPassiveEventSupport",l,t)}catch(e){}return e}(),je=!!document.createElement("canvas").getContext,Ee=!(!document.createElementNS||!$("svg").createSVGRect),Ce=!Ee&&function(){try{var e=document.createElement("div");e.innerHTML='';var t=e.firstChild;return t.style.behavior="url(#default#VML)",t&&"object"==typeof t.adj}catch(e){return!1}}();function xe(e){return navigator.userAgent.toLowerCase().indexOf(e)>=0}var Te={ie:J,ielt9:Q,edge:X,webkit:ee,android:te,android23:ne,androidStock:oe,opera:ie,chrome:ae,gecko:ue,safari:le,phantom:se,opera12:ce,win:fe,ie3d:pe,webkit3d:de,gecko3d:he,any3d:ye,mobile:me,mobileWebkit:be,mobileWebkit3d:ve,msPointer:ge,pointer:we,touch:_e,mobileOpera:Oe,mobileGecko:Se,retina:ke,passiveEvents:Pe,canvas:je,svg:Ee,vml:Ce},De=ge?"MSPointerDown":"pointerdown",Re=ge?"MSPointerMove":"pointermove",Me=ge?"MSPointerUp":"pointerup",Ae=ge?"MSPointerCancel":"pointercancel",Le={},Ie=!1;function ze(e,t,n,o){return"touchstart"===t?function(e,t,n){var o=r((function(e){e.MSPOINTER_TYPE_TOUCH&&e.pointerType===e.MSPOINTER_TYPE_TOUCH&&At(e),Be(e,t)}));e["_leaflet_touchstart"+n]=o,e.addEventListener(De,o,!1),Ie||(document.addEventListener(De,Fe,!0),document.addEventListener(Re,Ye,!0),document.addEventListener(Me,Ne,!0),document.addEventListener(Ae,Ne,!0),Ie=!0)}(e,n,o):"touchmove"===t?function(e,t,n){var r=function(e){e.pointerType===(e.MSPOINTER_TYPE_MOUSE||"mouse")&&0===e.buttons||Be(e,t)};e["_leaflet_touchmove"+n]=r,e.addEventListener(Re,r,!1)}(e,n,o):"touchend"===t&&function(e,t,n){var r=function(e){Be(e,t)};e["_leaflet_touchend"+n]=r,e.addEventListener(Me,r,!1),e.addEventListener(Ae,r,!1)}(e,n,o),this}function Fe(e){Le[e.pointerId]=e}function Ye(e){Le[e.pointerId]&&(Le[e.pointerId]=e)}function Ne(e){delete Le[e.pointerId]}function Be(e,t){for(var n in e.touches=[],Le)e.touches.push(Le[n]);e.changedTouches=[e],t(e)}var He,Ve,We,Ue,qe,Ke=ge?"MSPointerDown":we?"pointerdown":"touchstart",$e=ge?"MSPointerUp":we?"pointerup":"touchend",Ge="_leaflet_",Ze=pt(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),Je=pt(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),Qe="webkitTransition"===Je||"OTransition"===Je?Je+"End":"transitionend";function Xe(e){return"string"==typeof e?document.getElementById(e):e}function et(e,t){var n=e.style[t]||e.currentStyle&&e.currentStyle[t];if((!n||"auto"===n)&&document.defaultView){var r=document.defaultView.getComputedStyle(e,null);n=r?r[t]:null}return"auto"===n?null:n}function tt(e,t,n){var r=document.createElement(e);return r.className=t||"",n&&n.appendChild(r),r}function nt(e){var t=e.parentNode;t&&t.removeChild(e)}function rt(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function ot(e){var t=e.parentNode;t&&t.lastChild!==e&&t.appendChild(e)}function it(e){var t=e.parentNode;t&&t.firstChild!==e&&t.insertBefore(e,t.firstChild)}function at(e,t){if(void 0!==e.classList)return e.classList.contains(t);var n=ct(e);return n.length>0&&new RegExp("(^|\\s)"+t+"(\\s|$)").test(n)}function ut(e,t){if(void 0!==e.classList)for(var n=f(t),r=0,o=n.length;r1)return;var t=Date.now(),n=t-(r||t);o=e.touches?e.touches[0]:e,i=n>0&&n<=250,r=t}function u(e){if(i&&!o.cancelBubble){if(we){if("mouse"===e.pointerType)return;var n,a,u={};for(a in o)n=o[a],u[a]=n&&n.bind?n.bind(o):n;o=u}o.type="dblclick",o.button=0,t(o),r=null}}e[Ge+Ke+n]=a,e[Ge+$e+n]=u,e[Ge+"dblclick"+n]=t,e.addEventListener(Ke,a,!!Pe&&{passive:!1}),e.addEventListener($e,u,!!Pe&&{passive:!1}),e.addEventListener("dblclick",t,!1)}(e,a,o):"addEventListener"in e?"touchstart"===t||"touchmove"===t||"wheel"===t||"mousewheel"===t?e.addEventListener(Ct[t]||t,a,!!Pe&&{passive:!1}):"mouseenter"===t||"mouseleave"===t?(a=function(t){t=t||window.event,Ht(e,t)&&u(t)},e.addEventListener(Ct[t],a,!1)):e.addEventListener(t,u,!1):"attachEvent"in e&&e.attachEvent("on"+t,a),e[Pt]=e[Pt]||{},e[Pt][o]=a}function Tt(e,t,n,r){var o=t+i(n)+(r?"_"+i(r):""),a=e[Pt]&&e[Pt][o];if(!a)return this;we&&0===t.indexOf("touch")?function(e,t,n){var r=e["_leaflet_"+t+n];"touchstart"===t?e.removeEventListener(De,r,!1):"touchmove"===t?e.removeEventListener(Re,r,!1):"touchend"===t&&(e.removeEventListener(Me,r,!1),e.removeEventListener(Ae,r,!1))}(e,t,o):_e&&"dblclick"===t&&!Et()?function(e,t){var n=e[Ge+Ke+t],r=e[Ge+$e+t],o=e[Ge+"dblclick"+t];e.removeEventListener(Ke,n,!!Pe&&{passive:!1}),e.removeEventListener($e,r,!!Pe&&{passive:!1}),e.removeEventListener("dblclick",o,!1)}(e,o):"removeEventListener"in e?e.removeEventListener(Ct[t]||t,a,!1):"detachEvent"in e&&e.detachEvent("on"+t,a),e[Pt][o]=null}function Dt(e){return e.stopPropagation?e.stopPropagation():e.originalEvent?e.originalEvent._stopped=!0:e.cancelBubble=!0,Bt(e),this}function Rt(e){return xt(e,"wheel",Dt),this}function Mt(e){return kt(e,"mousedown touchstart dblclick",Dt),xt(e,"click",Nt),this}function At(e){return e.preventDefault?e.preventDefault():e.returnValue=!1,this}function Lt(e){return At(e),Dt(e),this}function It(e,t){if(!t)return new T(e.clientX,e.clientY);var n=Ot(t),r=n.boundingClientRect;return new T((e.clientX-r.left)/n.x-t.clientLeft,(e.clientY-r.top)/n.y-t.clientTop)}var zt=fe&&ae?2*window.devicePixelRatio:ue?window.devicePixelRatio:1;function Ft(e){return X?e.wheelDeltaY/2:e.deltaY&&0===e.deltaMode?-e.deltaY/zt:e.deltaY&&1===e.deltaMode?20*-e.deltaY:e.deltaY&&2===e.deltaMode?60*-e.deltaY:e.deltaX||e.deltaZ?0:e.wheelDelta?(e.wheelDeltaY||e.wheelDelta)/2:e.detail&&Math.abs(e.detail)<32765?20*-e.detail:e.detail?e.detail/-32765*60:0}var Yt={};function Nt(e){Yt[e.type]=!0}function Bt(e){var t=Yt[e.type];return Yt[e.type]=!1,t}function Ht(e,t){var n=t.relatedTarget;if(!n)return!0;try{for(;n&&n!==e;)n=n.parentNode}catch(e){return!1}return n!==e}var Vt={on:kt,off:jt,stopPropagation:Dt,disableScrollPropagation:Rt,disableClickPropagation:Mt,preventDefault:At,stop:Lt,getMousePosition:It,getWheelDelta:Ft,fakeStop:Nt,skipped:Bt,isExternalTarget:Ht,addListener:kt,removeListener:jt},Wt=x.extend({run:function(e,t,n,r){this.stop(),this._el=e,this._inProgress=!0,this._duration=n||.25,this._easeOutPower=1/Math.max(r||.5,.2),this._startPos=yt(e),this._offset=t.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=k(this._animate,this),this._step()},_step:function(e){var t=+new Date-this._startTime,n=1e3*this._duration;tthis.options.maxZoom)?this.setZoom(e):this},panInsideBounds:function(e,t){this._enforcingBounds=!0;var n=this.getCenter(),r=this._limitCenter(n,this._zoom,z(e));return n.equals(r)||this.panTo(r,t),this._enforcingBounds=!1,this},panInside:function(e,t){var n=R((t=t||{}).paddingTopLeft||t.padding||[0,0]),r=R(t.paddingBottomRight||t.padding||[0,0]),o=this.getCenter(),i=this.project(o),a=this.project(e),u=this.getPixelBounds(),l=u.getSize().divideBy(2),s=A([u.min.add(n),u.max.subtract(r)]);if(!s.contains(a)){this._enforcingBounds=!0;var c=i.subtract(a),f=R(a.x+c.x,a.y+c.y);(a.xs.max.x)&&(f.x=i.x-c.x,c.x>0?f.x+=l.x-n.x:f.x-=l.x-r.x),(a.ys.max.y)&&(f.y=i.y-c.y,c.y>0?f.y+=l.y-n.y:f.y-=l.y-r.y),this.panTo(this.unproject(f),t),this._enforcingBounds=!1}return this},invalidateSize:function(e){if(!this._loaded)return this;e=t({animate:!1,pan:!0},!0===e?{animate:!0}:e);var n=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var o=this.getSize(),i=n.divideBy(2).round(),a=o.divideBy(2).round(),u=i.subtract(a);return u.x||u.y?(e.animate&&e.pan?this.panBy(u):(e.pan&&this._rawPanBy(u),this.fire("move"),e.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(r(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:n,newSize:o})):this},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(e){if(e=this._locateOptions=t({timeout:1e4,watch:!1},e),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var n=r(this._handleGeolocationResponse,this),o=r(this._handleGeolocationError,this);return e.watch?this._locationWatchId=navigator.geolocation.watchPosition(n,o,e):navigator.geolocation.getCurrentPosition(n,o,e),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(e){var t=e.code,n=e.message||(1===t?"permission denied":2===t?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:t,message:"Geolocation error: "+n+"."})},_handleGeolocationResponse:function(e){var t=new F(e.coords.latitude,e.coords.longitude),n=t.toBounds(2*e.coords.accuracy),r=this._locateOptions;if(r.setView){var o=this.getBoundsZoom(n);this.setView(t,r.maxZoom?Math.min(o,r.maxZoom):o)}var i={latlng:t,bounds:n,timestamp:e.timestamp};for(var a in e.coords)"number"==typeof e.coords[a]&&(i[a]=e.coords[a]);this.fire("locationfound",i)},addHandler:function(e,t){if(!t)return this;var n=this[e]=new t(this);return this._handlers.push(n),this.options[e]&&n.enable(),this},remove:function(){if(this._initEvents(!0),this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch(e){this._container._leaflet_id=void 0,this._containerId=void 0}var e;for(e in void 0!==this._locationWatchId&&this.stopLocate(),this._stop(),nt(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(P(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload"),this._layers)this._layers[e].remove();for(e in this._panes)nt(this._panes[e]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(e,t){var n=tt("div","leaflet-pane"+(e?" leaflet-"+e.replace("Pane","")+"-pane":""),t||this._mapPane);return e&&(this._panes[e]=n),n},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter:this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var e=this.getPixelBounds();return new I(this.unproject(e.getBottomLeft()),this.unproject(e.getTopRight()))},getMinZoom:function(){return void 0===this.options.minZoom?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return void 0===this.options.maxZoom?void 0===this._layersMaxZoom?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(e,t,n){e=z(e),n=R(n||[0,0]);var r=this.getZoom()||0,o=this.getMinZoom(),i=this.getMaxZoom(),a=e.getNorthWest(),u=e.getSouthEast(),l=this.getSize().subtract(n),s=A(this.project(u,r),this.project(a,r)).getSize(),c=ye?this.options.zoomSnap:1,f=l.x/s.x,p=l.y/s.y,d=t?Math.max(f,p):Math.min(f,p);return r=this.getScaleZoom(d,r),c&&(r=Math.round(r/(c/100))*(c/100),r=t?Math.ceil(r/c)*c:Math.floor(r/c)*c),Math.max(o,Math.min(i,r))},getSize:function(){return this._size&&!this._sizeChanged||(this._size=new T(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(e,t){var n=this._getTopLeftPoint(e,t);return new M(n,n.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(e){return this.options.crs.getProjectedBounds(void 0===e?this.getZoom():e)},getPane:function(e){return"string"==typeof e?this._panes[e]:e},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(e,t){var n=this.options.crs;return t=void 0===t?this._zoom:t,n.scale(e)/n.scale(t)},getScaleZoom:function(e,t){var n=this.options.crs;t=void 0===t?this._zoom:t;var r=n.zoom(e*n.scale(t));return isNaN(r)?1/0:r},project:function(e,t){return t=void 0===t?this._zoom:t,this.options.crs.latLngToPoint(Y(e),t)},unproject:function(e,t){return t=void 0===t?this._zoom:t,this.options.crs.pointToLatLng(R(e),t)},layerPointToLatLng:function(e){var t=R(e).add(this.getPixelOrigin());return this.unproject(t)},latLngToLayerPoint:function(e){return this.project(Y(e))._round()._subtract(this.getPixelOrigin())},wrapLatLng:function(e){return this.options.crs.wrapLatLng(Y(e))},wrapLatLngBounds:function(e){return this.options.crs.wrapLatLngBounds(z(e))},distance:function(e,t){return this.options.crs.distance(Y(e),Y(t))},containerPointToLayerPoint:function(e){return R(e).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(e){return R(e).add(this._getMapPanePos())},containerPointToLatLng:function(e){var t=this.containerPointToLayerPoint(R(e));return this.layerPointToLatLng(t)},latLngToContainerPoint:function(e){return this.layerPointToContainerPoint(this.latLngToLayerPoint(Y(e)))},mouseEventToContainerPoint:function(e){return It(e,this._container)},mouseEventToLayerPoint:function(e){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(e))},mouseEventToLatLng:function(e){return this.layerPointToLatLng(this.mouseEventToLayerPoint(e))},_initContainer:function(e){var t=this._container=Xe(e);if(!t)throw new Error("Map container not found.");if(t._leaflet_id)throw new Error("Map container is already initialized.");kt(t,"scroll",this._onScroll,this),this._containerId=i(t)},_initLayout:function(){var e=this._container;this._fadeAnimated=this.options.fadeAnimation&&ye,ut(e,"leaflet-container"+(_e?" leaflet-touch":"")+(ke?" leaflet-retina":"")+(Q?" leaflet-oldie":"")+(le?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var t=et(e,"position");"absolute"!==t&&"relative"!==t&&"fixed"!==t&&(e.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var e=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),ht(this._mapPane,new T(0,0)),this.createPane("tilePane"),this.createPane("shadowPane"),this.createPane("overlayPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(ut(e.markerPane,"leaflet-zoom-hide"),ut(e.shadowPane,"leaflet-zoom-hide"))},_resetView:function(e,t){ht(this._mapPane,new T(0,0));var n=!this._loaded;this._loaded=!0,t=this._limitZoom(t),this.fire("viewprereset");var r=this._zoom!==t;this._moveStart(r,!1)._move(e,t)._moveEnd(r),this.fire("viewreset"),n&&this.fire("load")},_moveStart:function(e,t){return e&&this.fire("zoomstart"),t||this.fire("movestart"),this},_move:function(e,t,n){void 0===t&&(t=this._zoom);var r=this._zoom!==t;return this._zoom=t,this._lastCenter=e,this._pixelOrigin=this._getNewPixelOrigin(e),(r||n&&n.pinch)&&this.fire("zoom",n),this.fire("move",n)},_moveEnd:function(e){return e&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return P(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(e){ht(this._mapPane,this._getMapPanePos().subtract(e))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(e){this._targets={},this._targets[i(this._container)]=this;var t=e?jt:kt;t(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&t(window,"resize",this._onResize,this),ye&&this.options.transform3DLimit&&(e?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){P(this._resizeRequest),this._resizeRequest=k((function(){this.invalidateSize({debounceMoveend:!0})}),this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var e=this._getMapPanePos();Math.max(Math.abs(e.x),Math.abs(e.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(e,t){for(var n,r=[],o="mouseout"===t||"mouseover"===t,a=e.target||e.srcElement,u=!1;a;){if((n=this._targets[i(a)])&&("click"===t||"preclick"===t)&&!e._simulated&&this._draggableMoved(n)){u=!0;break}if(n&&n.listens(t,!0)){if(o&&!Ht(a,e))break;if(r.push(n),o)break}if(a===this._container)break;a=a.parentNode}return r.length||u||o||!Ht(a,e)||(r=[this]),r},_handleDOMEvent:function(e){if(this._loaded&&!Bt(e)){var t=e.type;"mousedown"!==t&&"keypress"!==t&&"keyup"!==t&&"keydown"!==t||gt(e.target||e.srcElement),this._fireDOMEvent(e,t)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(e,n,r){if("click"===e.type){var o=t({},e);o.type="preclick",this._fireDOMEvent(o,o.type,r)}if(!e._stopped&&(r=(r||[]).concat(this._findEventTargets(e,n))).length){var i=r[0];"contextmenu"===n&&i.listens(n,!0)&&At(e);var a={originalEvent:e};if("keypress"!==e.type&&"keydown"!==e.type&&"keyup"!==e.type){var u=i.getLatLng&&(!i._radius||i._radius<=10);a.containerPoint=u?this.latLngToContainerPoint(i.getLatLng()):this.mouseEventToContainerPoint(e),a.layerPoint=this.containerPointToLayerPoint(a.containerPoint),a.latlng=u?i.getLatLng():this.layerPointToLatLng(a.layerPoint)}for(var l=0;l0?Math.round(e-t)/2:Math.max(0,Math.ceil(e))-Math.max(0,Math.floor(t))},_limitZoom:function(e){var t=this.getMinZoom(),n=this.getMaxZoom(),r=ye?this.options.zoomSnap:1;return r&&(e=Math.round(e/r)*r),Math.max(t,Math.min(n,e))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){lt(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(e,t){var n=this._getCenterOffset(e)._trunc();return!(!0!==(t&&t.animate)&&!this.getSize().contains(n)||(this.panBy(n,t),0))},_createAnimProxy:function(){var e=this._proxy=tt("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(e),this.on("zoomanim",(function(e){var t=Ze,n=this._proxy.style[t];dt(this._proxy,this.project(e.center,e.zoom),this.getZoomScale(e.zoom,1)),n===this._proxy.style[t]&&this._animatingZoom&&this._onZoomTransitionEnd()}),this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){nt(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var e=this.getCenter(),t=this.getZoom();dt(this._proxy,this.project(e,t),this.getZoomScale(t,1))},_catchTransitionEnd:function(e){this._animatingZoom&&e.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(e,t,n){if(this._animatingZoom)return!0;if(n=n||{},!this._zoomAnimated||!1===n.animate||this._nothingToAnimate()||Math.abs(t-this._zoom)>this.options.zoomAnimationThreshold)return!1;var r=this.getZoomScale(t),o=this._getCenterOffset(e)._divideBy(1-1/r);return!(!0!==n.animate&&!this.getSize().contains(o)||(k((function(){this._moveStart(!0,!1)._animateZoom(e,t,!0)}),this),0))},_animateZoom:function(e,t,n,o){this._mapPane&&(n&&(this._animatingZoom=!0,this._animateToCenter=e,this._animateToZoom=t,ut(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:e,zoom:t,noUpdate:o}),setTimeout(r(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&<(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom),k((function(){this._moveEnd(!0)}),this))}}),qt=E.extend({options:{position:"topright"},initialize:function(e){p(this,e)},getPosition:function(){return this.options.position},setPosition:function(e){var t=this._map;return t&&t.removeControl(this),this.options.position=e,t&&t.addControl(this),this},getContainer:function(){return this._container},addTo:function(e){this.remove(),this._map=e;var t=this._container=this.onAdd(e),n=this.getPosition(),r=e._controlCorners[n];return ut(t,"leaflet-control"),-1!==n.indexOf("bottom")?r.insertBefore(t,r.firstChild):r.appendChild(t),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(nt(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(e){this._map&&e&&e.screenX>0&&e.screenY>0&&this._map.getContainer().focus()}}),Kt=function(e){return new qt(e)};Ut.include({addControl:function(e){return e.addTo(this),this},removeControl:function(e){return e.remove(),this},_initControlPos:function(){var e=this._controlCorners={},t="leaflet-",n=this._controlContainer=tt("div",t+"control-container",this._container);function r(r,o){var i=t+r+" "+t+o;e[r+o]=tt("div",i,n)}r("top","left"),r("top","right"),r("bottom","left"),r("bottom","right")},_clearControlPos:function(){for(var e in this._controlCorners)nt(this._controlCorners[e]);nt(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var $t=qt.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(e,t,n,r){return n1,this._baseLayersList.style.display=e?"":"none"),this._separator.style.display=t&&e?"":"none",this},_onLayerChange:function(e){this._handlingClick||this._update();var t=this._getLayer(i(e.target)),n=t.overlay?"add"===e.type?"overlayadd":"overlayremove":"add"===e.type?"baselayerchange":null;n&&this._map.fire(n,t)},_createRadioElement:function(e,t){var n='",r=document.createElement("div");return r.innerHTML=n,r.firstChild},_addItem:function(e){var t,n=document.createElement("label"),r=this._map.hasLayer(e.layer);e.overlay?((t=document.createElement("input")).type="checkbox",t.className="leaflet-control-layers-selector",t.defaultChecked=r):t=this._createRadioElement("leaflet-base-layers_"+i(this),r),this._layerControlInputs.push(t),t.layerId=i(e.layer),kt(t,"click",this._onInputClick,this);var o=document.createElement("span");o.innerHTML=" "+e.name;var a=document.createElement("div");return n.appendChild(a),a.appendChild(t),a.appendChild(o),(e.overlay?this._overlaysList:this._baseLayersList).appendChild(n),this._checkDisabledLayers(),n},_onInputClick:function(){var e,t,n=this._layerControlInputs,r=[],o=[];this._handlingClick=!0;for(var i=n.length-1;i>=0;i--)e=n[i],t=this._getLayer(e.layerId).layer,e.checked?r.push(t):e.checked||o.push(t);for(i=0;i=0;o--)e=n[o],t=this._getLayer(e.layerId).layer,e.disabled=void 0!==t.options.minZoom&&rt.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expand:function(){return this.expand()},_collapse:function(){return this.collapse()}}),Gt=qt.extend({options:{position:"topleft",zoomInText:"+",zoomInTitle:"Zoom in",zoomOutText:"−",zoomOutTitle:"Zoom out"},onAdd:function(e){var t="leaflet-control-zoom",n=tt("div",t+" leaflet-bar"),r=this.options;return this._zoomInButton=this._createButton(r.zoomInText,r.zoomInTitle,t+"-in",n,this._zoomIn),this._zoomOutButton=this._createButton(r.zoomOutText,r.zoomOutTitle,t+"-out",n,this._zoomOut),this._updateDisabled(),e.on("zoomend zoomlevelschange",this._updateDisabled,this),n},onRemove:function(e){e.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(e){!this._disabled&&this._map._zoomthis._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(e.shiftKey?3:1))},_createButton:function(e,t,n,r,o){var i=tt("a",n,r);return i.innerHTML=e,i.href="#",i.title=t,i.setAttribute("role","button"),i.setAttribute("aria-label",t),Mt(i),kt(i,"click",Lt),kt(i,"click",o,this),kt(i,"click",this._refocusOnMap,this),i},_updateDisabled:function(){var e=this._map,t="leaflet-disabled";lt(this._zoomInButton,t),lt(this._zoomOutButton,t),(this._disabled||e._zoom===e.getMinZoom())&&ut(this._zoomOutButton,t),(this._disabled||e._zoom===e.getMaxZoom())&&ut(this._zoomInButton,t)}});Ut.mergeOptions({zoomControl:!0}),Ut.addInitHook((function(){this.options.zoomControl&&(this.zoomControl=new Gt,this.addControl(this.zoomControl))}));var Zt=qt.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(e){var t=tt("div","leaflet-control-scale"),n=this.options;return this._addScales(n,"leaflet-control-scale-line",t),e.on(n.updateWhenIdle?"moveend":"move",this._update,this),e.whenReady(this._update,this),t},onRemove:function(e){e.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(e,t,n){e.metric&&(this._mScale=tt("div",t,n)),e.imperial&&(this._iScale=tt("div",t,n))},_update:function(){var e=this._map,t=e.getSize().y/2,n=e.distance(e.containerPointToLatLng([0,t]),e.containerPointToLatLng([this.options.maxWidth,t]));this._updateScales(n)},_updateScales:function(e){this.options.metric&&e&&this._updateMetric(e),this.options.imperial&&e&&this._updateImperial(e)},_updateMetric:function(e){var t=this._getRoundNum(e),n=t<1e3?t+" m":t/1e3+" km";this._updateScale(this._mScale,n,t/e)},_updateImperial:function(e){var t,n,r,o=3.2808399*e;o>5280?(t=o/5280,n=this._getRoundNum(t),this._updateScale(this._iScale,n+" mi",n/t)):(r=this._getRoundNum(o),this._updateScale(this._iScale,r+" ft",r/o))},_updateScale:function(e,t,n){e.style.width=Math.round(this.options.maxWidth*n)+"px",e.innerHTML=t},_getRoundNum:function(e){var t=Math.pow(10,(Math.floor(e)+"").length-1),n=e/t;return t*(n=n>=10?10:n>=5?5:n>=3?3:n>=2?2:1)}}),Jt=qt.extend({options:{position:"bottomright",prefix:'Leaflet'},initialize:function(e){p(this,e),this._attributions={}},onAdd:function(e){for(var t in e.attributionControl=this,this._container=tt("div","leaflet-control-attribution"),Mt(this._container),e._layers)e._layers[t].getAttribution&&this.addAttribution(e._layers[t].getAttribution());return this._update(),this._container},setPrefix:function(e){return this.options.prefix=e,this._update(),this},addAttribution:function(e){return e?(this._attributions[e]||(this._attributions[e]=0),this._attributions[e]++,this._update(),this):this},removeAttribution:function(e){return e?(this._attributions[e]&&(this._attributions[e]--,this._update()),this):this},_update:function(){if(this._map){var e=[];for(var t in this._attributions)this._attributions[t]&&e.push(t);var n=[];this.options.prefix&&n.push(this.options.prefix),e.length&&n.push(e.join(", ")),this._container.innerHTML=n.join(" | ")}}});Ut.mergeOptions({attributionControl:!0}),Ut.addInitHook((function(){this.options.attributionControl&&(new Jt).addTo(this)})),qt.Layers=$t,qt.Zoom=Gt,qt.Scale=Zt,qt.Attribution=Jt,Kt.layers=function(e,t,n){return new $t(e,t,n)},Kt.zoom=function(e){return new Gt(e)},Kt.scale=function(e){return new Zt(e)},Kt.attribution=function(e){return new Jt(e)};var Qt=E.extend({initialize:function(e){this._map=e},enable:function(){return this._enabled||(this._enabled=!0,this.addHooks()),this},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});Qt.addTo=function(e,t){return e.addHandler(t,this),this};var Xt,en={Events:C},tn=_e?"touchstart mousedown":"mousedown",nn={mousedown:"mouseup",touchstart:"touchend",pointerdown:"touchend",MSPointerDown:"touchend"},rn={mousedown:"mousemove",touchstart:"touchmove",pointerdown:"touchmove",MSPointerDown:"touchmove"},on=x.extend({options:{clickTolerance:3},initialize:function(e,t,n,r){p(this,r),this._element=e,this._dragStartTarget=t||e,this._preventOutline=n},enable:function(){this._enabled||(kt(this._dragStartTarget,tn,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(on._dragging===this&&this.finishDrag(),jt(this._dragStartTarget,tn,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(e){if(!e._simulated&&this._enabled&&(this._moved=!1,!at(this._element,"leaflet-zoom-anim")&&!(on._dragging||e.shiftKey||1!==e.which&&1!==e.button&&!e.touches||(on._dragging=this,this._preventOutline&>(this._element),bt(),He(),this._moving)))){this.fire("down");var t=e.touches?e.touches[0]:e,n=_t(this._element);this._startPoint=new T(t.clientX,t.clientY),this._parentScale=Ot(n),kt(document,rn[e.type],this._onMove,this),kt(document,nn[e.type],this._onUp,this)}},_onMove:function(e){if(!e._simulated&&this._enabled)if(e.touches&&e.touches.length>1)this._moved=!0;else{var t=e.touches&&1===e.touches.length?e.touches[0]:e,n=new T(t.clientX,t.clientY)._subtract(this._startPoint);(n.x||n.y)&&(Math.abs(n.x)+Math.abs(n.y)s&&(a=u,s=l);s>r&&(n[a]=1,e(t,n,r,o,a),e(t,n,r,a,i))}(e,r,t,0,n-1);var o,i=[];for(o=0;ot&&(n.push(e[r]),o=r);var a,u,l,s;return ot.max.x&&(n|=2),e.yt.max.y&&(n|=8),n}function fn(e,t,n,r){var o,i=t.x,a=t.y,u=n.x-i,l=n.y-a,s=u*u+l*l;return s>0&&((o=((e.x-i)*u+(e.y-a)*l)/s)>1?(i=n.x,a=n.y):o>0&&(i+=u*o,a+=l*o)),u=e.x-i,l=e.y-a,r?u*u+l*l:new T(i,a)}function pn(e){return!m(e[0])||"object"!=typeof e[0][0]&&void 0!==e[0][0]}function dn(e){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),pn(e)}var hn={simplify:an,pointToSegmentDistance:un,closestPointOnSegment:function(e,t,n){return fn(e,t,n)},clipSegment:ln,_getEdgeIntersection:sn,_getBitCode:cn,_sqClosestPointOnSegment:fn,isFlat:pn,_flat:dn};function yn(e,t,n){var r,o,i,a,u,l,s,c,f,p=[1,4,2,8];for(o=0,s=e.length;o1e-7;l++)t=i*Math.sin(u),t=Math.pow((1-t)/(1+t),i/2),u+=s=Math.PI/2-2*Math.atan(a*t)-u;return new F(u*n,e.x*n/r)}},gn={LonLat:bn,Mercator:vn,SphericalMercator:V},wn=t({},H,{code:"EPSG:3395",projection:vn,transformation:function(){var e=.5/(Math.PI*vn.R);return U(e,.5,-e,.5)}()}),_n=t({},H,{code:"EPSG:4326",projection:bn,transformation:U(1/180,1,-1/180,.5)}),On=t({},B,{projection:bn,transformation:U(1,0,-1,0),scale:function(e){return Math.pow(2,e)},zoom:function(e){return Math.log(e)/Math.LN2},distance:function(e,t){var n=t.lng-e.lng,r=t.lat-e.lat;return Math.sqrt(n*n+r*r)},infinite:!0});B.Earth=H,B.EPSG3395=wn,B.EPSG3857=q,B.EPSG900913=K,B.EPSG4326=_n,B.Simple=On;var Sn=x.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(e){return e.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(e){return e&&e.removeLayer(this),this},getPane:function(e){return this._map.getPane(e?this.options[e]||e:this.options.pane)},addInteractiveTarget:function(e){return this._map._targets[i(e)]=this,this},removeInteractiveTarget:function(e){return delete this._map._targets[i(e)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(e){var t=e.target;if(t.hasLayer(this)){if(this._map=t,this._zoomAnimated=t._zoomAnimated,this.getEvents){var n=this.getEvents();t.on(n,this),this.once("remove",(function(){t.off(n,this)}),this)}this.onAdd(t),this.getAttribution&&t.attributionControl&&t.attributionControl.addAttribution(this.getAttribution()),this.fire("add"),t.fire("layeradd",{layer:this})}}});Ut.include({addLayer:function(e){if(!e._layerAdd)throw new Error("The provided object is not a Layer.");var t=i(e);return this._layers[t]||(this._layers[t]=e,e._mapToAdd=this,e.beforeAdd&&e.beforeAdd(this),this.whenReady(e._layerAdd,e)),this},removeLayer:function(e){var t=i(e);return this._layers[t]?(this._loaded&&e.onRemove(this),e.getAttribution&&this.attributionControl&&this.attributionControl.removeAttribution(e.getAttribution()),delete this._layers[t],this._loaded&&(this.fire("layerremove",{layer:e}),e.fire("remove")),e._map=e._mapToAdd=null,this):this},hasLayer:function(e){return!!e&&i(e)in this._layers},eachLayer:function(e,t){for(var n in this._layers)e.call(t,this._layers[n]);return this},_addLayers:function(e){for(var t=0,n=(e=e?m(e)?e:[e]:[]).length;tthis._layersMaxZoom&&this.setZoom(this._layersMaxZoom),void 0===this.options.minZoom&&this._layersMinZoom&&this.getZoom()t)return a=(r-t)/n,this._map.layerPointToLatLng([i.x-a*(i.x-o.x),i.y-a*(i.y-o.y)])},getBounds:function(){return this._bounds},addLatLng:function(e,t){return t=t||this._defaultShape(),e=Y(e),t.push(e),this._bounds.extend(e),this.redraw()},_setLatLngs:function(e){this._bounds=new I,this._latlngs=this._convertLatLngs(e)},_defaultShape:function(){return pn(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(e){for(var t=[],n=pn(e),r=0,o=e.length;r=2&&t[0]instanceof F&&t[0].equals(t[n-1])&&t.pop(),t},_setLatLngs:function(e){Mn.prototype._setLatLngs.call(this,e),pn(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return pn(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var e=this._renderer._bounds,t=this.options.weight,n=new T(t,t);if(e=new M(e.min.subtract(n),e.max.add(n)),this._parts=[],this._pxBounds&&this._pxBounds.intersects(e))if(this.options.noClip)this._parts=this._rings;else for(var r,o=0,i=this._rings.length;oe.y!=r.y>e.y&&e.x<(r.x-n.x)*(e.y-n.y)/(r.y-n.y)+n.x&&(s=!s);return s||Mn.prototype._containsPoint.call(this,e,!0)}}),Ln=Pn.extend({initialize:function(e,t){p(this,t),this._layers={},e&&this.addData(e)},addData:function(e){var t,n,r,o=m(e)?e:e.features;if(o){for(t=0,n=o.length;t0?o:[t.src]}else{m(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(t.style,"objectFit")&&(t.style.objectFit="fill"),t.autoplay=!!this.options.autoplay,t.loop=!!this.options.loop,t.muted=!!this.options.muted;for(var a=0;ao?(t.height=o+"px",ut(e,"leaflet-popup-scrolled")):lt(e,"leaflet-popup-scrolled"),this._containerWidth=this._container.offsetWidth},_animateZoom:function(e){var t=this._map._latLngToNewLayerPoint(this._latlng,e.zoom,e.center),n=this._getAnchor();ht(this._container,t.add(n))},_adjustPan:function(){if(this.options.autoPan){this._map._panAnim&&this._map._panAnim.stop();var e=this._map,t=parseInt(et(this._container,"marginBottom"),10)||0,n=this._container.offsetHeight+t,r=this._containerWidth,o=new T(this._containerLeft,-n-this._containerBottom);o._add(yt(this._container));var i=e.layerPointToContainerPoint(o),a=R(this.options.autoPanPadding),u=R(this.options.autoPanPaddingTopLeft||a),l=R(this.options.autoPanPaddingBottomRight||a),s=e.getSize(),c=0,f=0;i.x+r+l.x>s.x&&(c=i.x+r-s.x+l.x),i.x-c-u.x<0&&(c=i.x-u.x),i.y+n+l.y>s.y&&(f=i.y+n-s.y+l.y),i.y-f-u.y<0&&(f=i.y-u.y),(c||f)&&e.fire("autopanstart").panBy([c,f])}},_onCloseButtonClick:function(e){this._close(),Lt(e)},_getAnchor:function(){return R(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}});Ut.mergeOptions({closePopupOnClick:!0}),Ut.include({openPopup:function(e,t,n){return e instanceof Jn||(e=new Jn(n).setContent(e)),t&&e.setLatLng(t),this.hasLayer(e)?this:(this._popup&&this._popup.options.autoClose&&this.closePopup(),this._popup=e,this.addLayer(e))},closePopup:function(e){return e&&e!==this._popup||(e=this._popup,this._popup=null),e&&this.removeLayer(e),this}}),Sn.include({bindPopup:function(e,t){return e instanceof Jn?(p(e,t),this._popup=e,e._source=this):(this._popup&&!t||(this._popup=new Jn(t,this)),this._popup.setContent(e)),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(e,t){return this._popup&&this._map&&(t=this._popup._prepareOpen(this,e,t),this._map.openPopup(this._popup,t)),this},closePopup:function(){return this._popup&&this._popup._close(),this},togglePopup:function(e){return this._popup&&(this._popup._map?this.closePopup():this.openPopup(e)),this},isPopupOpen:function(){return!!this._popup&&this._popup.isOpen()},setPopupContent:function(e){return this._popup&&this._popup.setContent(e),this},getPopup:function(){return this._popup},_openPopup:function(e){var t=e.layer||e.target;this._popup&&this._map&&(Lt(e),t instanceof Tn?this.openPopup(e.layer||e.target,e.latlng):this._map.hasLayer(this._popup)&&this._popup._source===t?this.closePopup():this.openPopup(t,e.latlng))},_movePopup:function(e){this._popup.setLatLng(e.latlng)},_onKeyPress:function(e){13===e.originalEvent.keyCode&&this._openPopup(e)}});var Qn=Zn.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,interactive:!1,opacity:.9},onAdd:function(e){Zn.prototype.onAdd.call(this,e),this.setOpacity(this.options.opacity),e.fire("tooltipopen",{tooltip:this}),this._source&&this._source.fire("tooltipopen",{tooltip:this},!0)},onRemove:function(e){Zn.prototype.onRemove.call(this,e),e.fire("tooltipclose",{tooltip:this}),this._source&&this._source.fire("tooltipclose",{tooltip:this},!0)},getEvents:function(){var e=Zn.prototype.getEvents.call(this);return _e&&!this.options.permanent&&(e.preclick=this._close),e},_close:function(){this._map&&this._map.closeTooltip(this)},_initLayout:function(){var e="leaflet-tooltip "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=tt("div",e)},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(e){var t,n,r=this._map,o=this._container,i=r.latLngToContainerPoint(r.getCenter()),a=r.layerPointToContainerPoint(e),u=this.options.direction,l=o.offsetWidth,s=o.offsetHeight,c=R(this.options.offset),f=this._getAnchor();"top"===u?(t=l/2,n=s):"bottom"===u?(t=l/2,n=0):"center"===u?(t=l/2,n=s/2):"right"===u?(t=0,n=s/2):"left"===u?(t=l,n=s/2):a.xthis.options.maxZoom||nr&&this._retainParent(o,i,a,r))},_retainChildren:function(e,t,n,r){for(var o=2*e;o<2*e+2;o++)for(var i=2*t;i<2*t+2;i++){var a=new T(o,i);a.z=n+1;var u=this._tileCoordsToKey(a),l=this._tiles[u];l&&l.active?l.retain=!0:(l&&l.loaded&&(l.retain=!0),n+1this.options.maxZoom||void 0!==this.options.minZoom&&o1)this._setView(e,n);else{for(var f=o.min.y;f<=o.max.y;f++)for(var p=o.min.x;p<=o.max.x;p++){var d=new T(p,f);if(d.z=this._tileZoom,this._isValidTile(d)){var h=this._tiles[this._tileCoordsToKey(d)];h?h.current=!0:a.push(d)}}if(a.sort((function(e,t){return e.distanceTo(i)-t.distanceTo(i)})),0!==a.length){this._loading||(this._loading=!0,this.fire("loading"));var y=document.createDocumentFragment();for(p=0;pn.max.x)||!t.wrapLat&&(e.yn.max.y))return!1}if(!this.options.bounds)return!0;var r=this._tileCoordsToBounds(e);return z(this.options.bounds).overlaps(r)},_keyToBounds:function(e){return this._tileCoordsToBounds(this._keyToTileCoords(e))},_tileCoordsToNwSe:function(e){var t=this._map,n=this.getTileSize(),r=e.scaleBy(n),o=r.add(n);return[t.unproject(r,e.z),t.unproject(o,e.z)]},_tileCoordsToBounds:function(e){var t=this._tileCoordsToNwSe(e),n=new I(t[0],t[1]);return this.options.noWrap||(n=this._map.wrapLatLngBounds(n)),n},_tileCoordsToKey:function(e){return e.x+":"+e.y+":"+e.z},_keyToTileCoords:function(e){var t=e.split(":"),n=new T(+t[0],+t[1]);return n.z=+t[2],n},_removeTile:function(e){var t=this._tiles[e];t&&(nt(t.el),delete this._tiles[e],this.fire("tileunload",{tile:t.el,coords:this._keyToTileCoords(e)}))},_initTile:function(e){ut(e,"leaflet-tile");var t=this.getTileSize();e.style.width=t.x+"px",e.style.height=t.y+"px",e.onselectstart=l,e.onmousemove=l,Q&&this.options.opacity<1&&ft(e,this.options.opacity),te&&!ne&&(e.style.WebkitBackfaceVisibility="hidden")},_addTile:function(e,t){var n=this._getTilePos(e),o=this._tileCoordsToKey(e),i=this.createTile(this._wrapCoords(e),r(this._tileReady,this,e));this._initTile(i),this.createTile.length<2&&k(r(this._tileReady,this,e,null,i)),ht(i,n),this._tiles[o]={el:i,coords:e,current:!0},t.appendChild(i),this.fire("tileloadstart",{tile:i,coords:e})},_tileReady:function(e,t,n){t&&this.fire("tileerror",{error:t,tile:n,coords:e});var o=this._tileCoordsToKey(e);(n=this._tiles[o])&&(n.loaded=+new Date,this._map._fadeAnimated?(ft(n.el,0),P(this._fadeFrame),this._fadeFrame=k(this._updateOpacity,this)):(n.active=!0,this._pruneTiles()),t||(ut(n.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:n.el,coords:e})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),Q||!this._map._fadeAnimated?k(this._pruneTiles,this):setTimeout(r(this._pruneTiles,this),250)))},_getTilePos:function(e){return e.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(e){var t=new T(this._wrapX?u(e.x,this._wrapX):e.x,this._wrapY?u(e.y,this._wrapY):e.y);return t.z=e.z,t},_pxBoundsToTileRange:function(e){var t=this.getTileSize();return new M(e.min.unscaleBy(t).floor(),e.max.unscaleBy(t).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var e in this._tiles)if(!this._tiles[e].loaded)return!1;return!0}}),tr=er.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1},initialize:function(e,t){this._url=e,(t=p(this,t)).detectRetina&&ke&&t.maxZoom>0&&(t.tileSize=Math.floor(t.tileSize/2),t.zoomReverse?(t.zoomOffset--,t.minZoom++):(t.zoomOffset++,t.maxZoom--),t.minZoom=Math.max(0,t.minZoom)),"string"==typeof t.subdomains&&(t.subdomains=t.subdomains.split("")),te||this.on("tileunload",this._onTileRemove)},setUrl:function(e,t){return this._url===e&&void 0===t&&(t=!0),this._url=e,t||this.redraw(),this},createTile:function(e,t){var n=document.createElement("img");return kt(n,"load",r(this._tileOnLoad,this,t,n)),kt(n,"error",r(this._tileOnError,this,t,n)),(this.options.crossOrigin||""===this.options.crossOrigin)&&(n.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),n.alt="",n.setAttribute("role","presentation"),n.src=this.getTileUrl(e),n},getTileUrl:function(e){var n={r:ke?"@2x":"",s:this._getSubdomain(e),x:e.x,y:e.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var r=this._globalTileRange.max.y-e.y;this.options.tms&&(n.y=r),n["-y"]=r}return y(this._url,t(n,this.options))},_tileOnLoad:function(e,t){Q?setTimeout(r(e,this,null,t),0):e(null,t)},_tileOnError:function(e,t,n){var r=this.options.errorTileUrl;r&&t.getAttribute("src")!==r&&(t.src=r),e(n,t)},_onTileRemove:function(e){e.tile.onload=null},_getZoomForUrl:function(){var e=this._tileZoom,t=this.options.maxZoom;return this.options.zoomReverse&&(e=t-e),e+this.options.zoomOffset},_getSubdomain:function(e){var t=Math.abs(e.x+e.y)%this.options.subdomains.length;return this.options.subdomains[t]},_abortLoading:function(){var e,t;for(e in this._tiles)this._tiles[e].coords.z!==this._tileZoom&&((t=this._tiles[e].el).onload=l,t.onerror=l,t.complete||(t.src=v,nt(t),delete this._tiles[e]))},_removeTile:function(e){var t=this._tiles[e];if(t)return oe||t.el.setAttribute("src",v),er.prototype._removeTile.call(this,e)},_tileReady:function(e,t,n){if(this._map&&(!n||n.getAttribute("src")!==v))return er.prototype._tileReady.call(this,e,t,n)}});function nr(e,t){return new tr(e,t)}var rr=tr.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(e,n){this._url=e;var r=t({},this.defaultWmsParams);for(var o in n)o in this.options||(r[o]=n[o]);var i=(n=p(this,n)).detectRetina&&ke?2:1,a=this.getTileSize();r.width=a.x*i,r.height=a.y*i,this.wmsParams=r},onAdd:function(e){this._crs=this.options.crs||e.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var t=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[t]=this._crs.code,tr.prototype.onAdd.call(this,e)},getTileUrl:function(e){var t=this._tileCoordsToNwSe(e),n=this._crs,r=A(n.project(t[0]),n.project(t[1])),o=r.min,i=r.max,a=(this._wmsVersion>=1.3&&this._crs===_n?[o.y,o.x,i.y,i.x]:[o.x,o.y,i.x,i.y]).join(","),u=tr.prototype.getTileUrl.call(this,e);return u+d(this.wmsParams,u,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+a},setParams:function(e,n){return t(this.wmsParams,e),n||this.redraw(),this}});tr.WMS=rr,nr.wms=function(e,t){return new rr(e,t)};var or=Sn.extend({options:{padding:.1,tolerance:0},initialize:function(e){p(this,e),i(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),this._zoomAnimated&&ut(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var e={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(e.zoomanim=this._onAnimZoom),e},_onAnimZoom:function(e){this._updateTransform(e.center,e.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(e,t){var n=this._map.getZoomScale(t,this._zoom),r=yt(this._container),o=this._map.getSize().multiplyBy(.5+this.options.padding),i=this._map.project(this._center,t),a=this._map.project(e,t).subtract(i),u=o.multiplyBy(-n).add(r).add(o).subtract(a);ye?dt(this._container,u,n):ht(this._container,u)},_reset:function(){for(var e in this._update(),this._updateTransform(this._center,this._zoom),this._layers)this._layers[e]._reset()},_onZoomEnd:function(){for(var e in this._layers)this._layers[e]._project()},_updatePaths:function(){for(var e in this._layers)this._layers[e]._update()},_update:function(){var e=this.options.padding,t=this._map.getSize(),n=this._map.containerPointToLayerPoint(t.multiplyBy(-e)).round();this._bounds=new M(n,n.add(t.multiplyBy(1+2*e)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),ir=or.extend({getEvents:function(){var e=or.prototype.getEvents.call(this);return e.viewprereset=this._onViewPreReset,e},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){or.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var e=this._container=document.createElement("canvas");kt(e,"mousemove",this._onMouseMove,this),kt(e,"click dblclick mousedown mouseup contextmenu",this._onClick,this),kt(e,"mouseout",this._handleMouseOut,this),this._ctx=e.getContext("2d")},_destroyContainer:function(){P(this._redrawRequest),delete this._ctx,nt(this._container),jt(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){for(var e in this._redrawBounds=null,this._layers)this._layers[e]._update();this._redraw()}},_update:function(){if(!this._map._animatingZoom||!this._bounds){or.prototype._update.call(this);var e=this._bounds,t=this._container,n=e.getSize(),r=ke?2:1;ht(t,e.min),t.width=r*n.x,t.height=r*n.y,t.style.width=n.x+"px",t.style.height=n.y+"px",ke&&this._ctx.scale(2,2),this._ctx.translate(-e.min.x,-e.min.y),this.fire("update")}},_reset:function(){or.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(e){this._updateDashArray(e),this._layers[i(e)]=e;var t=e._order={layer:e,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=t),this._drawLast=t,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(e){this._requestRedraw(e)},_removePath:function(e){var t=e._order,n=t.next,r=t.prev;n?n.prev=r:this._drawLast=r,r?r.next=n:this._drawFirst=n,delete e._order,delete this._layers[i(e)],this._requestRedraw(e)},_updatePath:function(e){this._extendRedrawBounds(e),e._project(),e._update(),this._requestRedraw(e)},_updateStyle:function(e){this._updateDashArray(e),this._requestRedraw(e)},_updateDashArray:function(e){if("string"==typeof e.options.dashArray){var t,n,r=e.options.dashArray.split(/[, ]+/),o=[];for(n=0;n')}}catch(e){return function(e){return document.createElement("<"+e+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}}(),lr={_initContainer:function(){this._container=tt("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(or.prototype._update.call(this),this.fire("update"))},_initPath:function(e){var t=e._container=ur("shape");ut(t,"leaflet-vml-shape "+(this.options.className||"")),t.coordsize="1 1",e._path=ur("path"),t.appendChild(e._path),this._updateStyle(e),this._layers[i(e)]=e},_addPath:function(e){var t=e._container;this._container.appendChild(t),e.options.interactive&&e.addInteractiveTarget(t)},_removePath:function(e){var t=e._container;nt(t),e.removeInteractiveTarget(t),delete this._layers[i(e)]},_updateStyle:function(e){var t=e._stroke,n=e._fill,r=e.options,o=e._container;o.stroked=!!r.stroke,o.filled=!!r.fill,r.stroke?(t||(t=e._stroke=ur("stroke")),o.appendChild(t),t.weight=r.weight+"px",t.color=r.color,t.opacity=r.opacity,r.dashArray?t.dashStyle=m(r.dashArray)?r.dashArray.join(" "):r.dashArray.replace(/( *, *)/g," "):t.dashStyle="",t.endcap=r.lineCap.replace("butt","flat"),t.joinstyle=r.lineJoin):t&&(o.removeChild(t),e._stroke=null),r.fill?(n||(n=e._fill=ur("fill")),o.appendChild(n),n.color=r.fillColor||r.color,n.opacity=r.fillOpacity):n&&(o.removeChild(n),e._fill=null)},_updateCircle:function(e){var t=e._point.round(),n=Math.round(e._radius),r=Math.round(e._radiusY||n);this._setPath(e,e._empty()?"M0 0":"AL "+t.x+","+t.y+" "+n+","+r+" 0,23592600")},_setPath:function(e,t){e._path.v=t},_bringToFront:function(e){ot(e._container)},_bringToBack:function(e){it(e._container)}},sr=Ce?ur:$,cr=or.extend({getEvents:function(){var e=or.prototype.getEvents.call(this);return e.zoomstart=this._onZoomStart,e},_initContainer:function(){this._container=sr("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=sr("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){nt(this._container),jt(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_onZoomStart:function(){this._update()},_update:function(){if(!this._map._animatingZoom||!this._bounds){or.prototype._update.call(this);var e=this._bounds,t=e.getSize(),n=this._container;this._svgSize&&this._svgSize.equals(t)||(this._svgSize=t,n.setAttribute("width",t.x),n.setAttribute("height",t.y)),ht(n,e.min),n.setAttribute("viewBox",[e.min.x,e.min.y,t.x,t.y].join(" ")),this.fire("update")}},_initPath:function(e){var t=e._path=sr("path");e.options.className&&ut(t,e.options.className),e.options.interactive&&ut(t,"leaflet-interactive"),this._updateStyle(e),this._layers[i(e)]=e},_addPath:function(e){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(e._path),e.addInteractiveTarget(e._path)},_removePath:function(e){nt(e._path),e.removeInteractiveTarget(e._path),delete this._layers[i(e)]},_updatePath:function(e){e._project(),e._update()},_updateStyle:function(e){var t=e._path,n=e.options;t&&(n.stroke?(t.setAttribute("stroke",n.color),t.setAttribute("stroke-opacity",n.opacity),t.setAttribute("stroke-width",n.weight),t.setAttribute("stroke-linecap",n.lineCap),t.setAttribute("stroke-linejoin",n.lineJoin),n.dashArray?t.setAttribute("stroke-dasharray",n.dashArray):t.removeAttribute("stroke-dasharray"),n.dashOffset?t.setAttribute("stroke-dashoffset",n.dashOffset):t.removeAttribute("stroke-dashoffset")):t.setAttribute("stroke","none"),n.fill?(t.setAttribute("fill",n.fillColor||n.color),t.setAttribute("fill-opacity",n.fillOpacity),t.setAttribute("fill-rule",n.fillRule||"evenodd")):t.setAttribute("fill","none"))},_updatePoly:function(e,t){this._setPath(e,G(e._parts,t))},_updateCircle:function(e){var t=e._point,n=Math.max(Math.round(e._radius),1),r="a"+n+","+(Math.max(Math.round(e._radiusY),1)||n)+" 0 1,0 ",o=e._empty()?"M0 0":"M"+(t.x-n)+","+t.y+r+2*n+",0 "+r+2*-n+",0 ";this._setPath(e,o)},_setPath:function(e,t){e._path.setAttribute("d",t)},_bringToFront:function(e){ot(e._path)},_bringToBack:function(e){it(e._path)}});function fr(e){return Ee||Ce?new cr(e):null}Ce&&cr.include(lr),Ut.include({getRenderer:function(e){var t=e.options.renderer||this._getPaneRenderer(e.options.pane)||this.options.renderer||this._renderer;return t||(t=this._renderer=this._createRenderer()),this.hasLayer(t)||this.addLayer(t),t},_getPaneRenderer:function(e){if("overlayPane"===e||void 0===e)return!1;var t=this._paneRenderers[e];return void 0===t&&(t=this._createRenderer({pane:e}),this._paneRenderers[e]=t),t},_createRenderer:function(e){return this.options.preferCanvas&&ar(e)||fr(e)}});var pr=An.extend({initialize:function(e,t){An.prototype.initialize.call(this,this._boundsToLatLngs(e),t)},setBounds:function(e){return this.setLatLngs(this._boundsToLatLngs(e))},_boundsToLatLngs:function(e){return[(e=z(e)).getSouthWest(),e.getNorthWest(),e.getNorthEast(),e.getSouthEast()]}});cr.create=sr,cr.pointsToPath=G,Ln.geometryToLayer=In,Ln.coordsToLatLng=Fn,Ln.coordsToLatLngs=Yn,Ln.latLngToCoords=Nn,Ln.latLngsToCoords=Bn,Ln.getFeature=Hn,Ln.asFeature=Vn,Ut.mergeOptions({boxZoom:!0});var dr=Qt.extend({initialize:function(e){this._map=e,this._container=e._container,this._pane=e._panes.overlayPane,this._resetStateTimeout=0,e.on("unload",this._destroy,this)},addHooks:function(){kt(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){jt(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){nt(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){0!==this._resetStateTimeout&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(e){if(!e.shiftKey||1!==e.which&&1!==e.button)return!1;this._clearDeferredResetState(),this._resetState(),He(),bt(),this._startPoint=this._map.mouseEventToContainerPoint(e),kt(document,{contextmenu:Lt,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(e){this._moved||(this._moved=!0,this._box=tt("div","leaflet-zoom-box",this._container),ut(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(e);var t=new M(this._point,this._startPoint),n=t.getSize();ht(this._box,t.min),this._box.style.width=n.x+"px",this._box.style.height=n.y+"px"},_finish:function(){this._moved&&(nt(this._box),lt(this._container,"leaflet-crosshair")),Ve(),vt(),jt(document,{contextmenu:Lt,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(e){if((1===e.which||1===e.button)&&(this._finish(),this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(r(this._resetState,this),0);var t=new I(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(t).fire("boxzoomend",{boxZoomBounds:t})}},_onKeyDown:function(e){27===e.keyCode&&this._finish()}});Ut.addInitHook("addHandler","boxZoom",dr),Ut.mergeOptions({doubleClickZoom:!0});var hr=Qt.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(e){var t=this._map,n=t.getZoom(),r=t.options.zoomDelta,o=e.originalEvent.shiftKey?n-r:n+r;"center"===t.options.doubleClickZoom?t.setZoom(o):t.setZoomAround(e.containerPoint,o)}});Ut.addInitHook("addHandler","doubleClickZoom",hr),Ut.mergeOptions({dragging:!0,inertia:!ne,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var yr=Qt.extend({addHooks:function(){if(!this._draggable){var e=this._map;this._draggable=new on(e._mapPane,e._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),e.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),e.on("zoomend",this._onZoomEnd,this),e.whenReady(this._onZoomEnd,this))}ut(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){lt(this._map._container,"leaflet-grab"),lt(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var e=this._map;if(e._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var t=z(this._map.options.maxBounds);this._offsetLimit=A(this._map.latLngToContainerPoint(t.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(t.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;e.fire("movestart").fire("dragstart"),e.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(e){if(this._map.options.inertia){var t=this._lastTime=+new Date,n=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(n),this._times.push(t),this._prunePositions(t)}this._map.fire("move",e).fire("drag",e)},_prunePositions:function(e){for(;this._positions.length>1&&e-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var e=this._map.getSize().divideBy(2),t=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=t.subtract(e).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(e,t){return e-(e-t)*this._viscosity},_onPreDragLimit:function(){if(this._viscosity&&this._offsetLimit){var e=this._draggable._newPos.subtract(this._draggable._startPos),t=this._offsetLimit;e.xt.max.x&&(e.x=this._viscousLimit(e.x,t.max.x)),e.y>t.max.y&&(e.y=this._viscousLimit(e.y,t.max.y)),this._draggable._newPos=this._draggable._startPos.add(e)}},_onPreDragWrap:function(){var e=this._worldWidth,t=Math.round(e/2),n=this._initialWorldOffset,r=this._draggable._newPos.x,o=(r-t+n)%e+t-n,i=(r+t+n)%e-t-n,a=Math.abs(o+n)0?i:-i))-t;this._delta=0,this._startTime=null,a&&("center"===e.options.scrollWheelZoom?e.setZoom(t+a):e.setZoomAround(this._lastMousePos,t+a))}});Ut.addInitHook("addHandler","scrollWheelZoom",br),Ut.mergeOptions({tap:!0,tapTolerance:15});var vr=Qt.extend({addHooks:function(){kt(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){jt(this._map._container,"touchstart",this._onDown,this)},_onDown:function(e){if(e.touches){if(At(e),this._fireClick=!0,e.touches.length>1)return this._fireClick=!1,void clearTimeout(this._holdTimeout);var t=e.touches[0],n=t.target;this._startPos=this._newPos=new T(t.clientX,t.clientY),n.tagName&&"a"===n.tagName.toLowerCase()&&ut(n,"leaflet-active"),this._holdTimeout=setTimeout(r((function(){this._isTapValid()&&(this._fireClick=!1,this._onUp(),this._simulateEvent("contextmenu",t))}),this),1e3),this._simulateEvent("mousedown",t),kt(document,{touchmove:this._onMove,touchend:this._onUp},this)}},_onUp:function(e){if(clearTimeout(this._holdTimeout),jt(document,{touchmove:this._onMove,touchend:this._onUp},this),this._fireClick&&e&&e.changedTouches){var t=e.changedTouches[0],n=t.target;n&&n.tagName&&"a"===n.tagName.toLowerCase()&<(n,"leaflet-active"),this._simulateEvent("mouseup",t),this._isTapValid()&&this._simulateEvent("click",t)}},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_onMove:function(e){var t=e.touches[0];this._newPos=new T(t.clientX,t.clientY),this._simulateEvent("mousemove",t)},_simulateEvent:function(e,t){var n=document.createEvent("MouseEvents");n._simulated=!0,t.target._simulatedClick=!0,n.initMouseEvent(e,!0,!0,window,1,t.screenX,t.screenY,t.clientX,t.clientY,!1,!1,!1,!1,0,null),t.target.dispatchEvent(n)}});!_e||we&&!le||Ut.addInitHook("addHandler","tap",vr),Ut.mergeOptions({touchZoom:_e&&!ne,bounceAtZoomLimits:!0});var gr=Qt.extend({addHooks:function(){ut(this._map._container,"leaflet-touch-zoom"),kt(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){lt(this._map._container,"leaflet-touch-zoom"),jt(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(e){var t=this._map;if(e.touches&&2===e.touches.length&&!t._animatingZoom&&!this._zooming){var n=t.mouseEventToContainerPoint(e.touches[0]),r=t.mouseEventToContainerPoint(e.touches[1]);this._centerPoint=t.getSize()._divideBy(2),this._startLatLng=t.containerPointToLatLng(this._centerPoint),"center"!==t.options.touchZoom&&(this._pinchStartLatLng=t.containerPointToLatLng(n.add(r)._divideBy(2))),this._startDist=n.distanceTo(r),this._startZoom=t.getZoom(),this._moved=!1,this._zooming=!0,t._stop(),kt(document,"touchmove",this._onTouchMove,this),kt(document,"touchend",this._onTouchEnd,this),At(e)}},_onTouchMove:function(e){if(e.touches&&2===e.touches.length&&this._zooming){var t=this._map,n=t.mouseEventToContainerPoint(e.touches[0]),o=t.mouseEventToContainerPoint(e.touches[1]),i=n.distanceTo(o)/this._startDist;if(this._zoom=t.getScaleZoom(i,this._startZoom),!t.options.bounceAtZoomLimits&&(this._zoomt.getMaxZoom()&&i>1)&&(this._zoom=t._limitZoom(this._zoom)),"center"===t.options.touchZoom){if(this._center=this._startLatLng,1===i)return}else{var a=n._add(o)._divideBy(2)._subtract(this._centerPoint);if(1===i&&0===a.x&&0===a.y)return;this._center=t.unproject(t.project(this._pinchStartLatLng,this._zoom).subtract(a),this._zoom)}this._moved||(t._moveStart(!0,!1),this._moved=!0),P(this._animRequest);var u=r(t._move,t,this._center,this._zoom,{pinch:!0,round:!1});this._animRequest=k(u,this,!0),At(e)}},_onTouchEnd:function(){this._moved&&this._zooming?(this._zooming=!1,P(this._animRequest),jt(document,"touchmove",this._onTouchMove,this),jt(document,"touchend",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))):this._zooming=!1}});Ut.addInitHook("addHandler","touchZoom",gr),Ut.BoxZoom=dr,Ut.DoubleClickZoom=hr,Ut.Drag=yr,Ut.Keyboard=mr,Ut.ScrollWheelZoom=br,Ut.Tap=vr,Ut.TouchZoom=gr,e.version="1.7.1",e.Control=qt,e.control=Kt,e.Browser=Te,e.Evented=x,e.Mixin=en,e.Util=j,e.Class=E,e.Handler=Qt,e.extend=t,e.bind=r,e.stamp=i,e.setOptions=p,e.DomEvent=Vt,e.DomUtil=St,e.PosAnimation=Wt,e.Draggable=on,e.LineUtil=hn,e.PolyUtil=mn,e.Point=T,e.point=R,e.Bounds=M,e.bounds=A,e.Transformation=W,e.transformation=U,e.Projection=gn,e.LatLng=F,e.latLng=Y,e.LatLngBounds=I,e.latLngBounds=z,e.CRS=B,e.GeoJSON=Ln,e.geoJSON=Un,e.geoJson=qn,e.Layer=Sn,e.LayerGroup=kn,e.layerGroup=function(e,t){return new kn(e,t)},e.FeatureGroup=Pn,e.featureGroup=function(e,t){return new Pn(e,t)},e.ImageOverlay=Kn,e.imageOverlay=function(e,t,n){return new Kn(e,t,n)},e.VideoOverlay=$n,e.videoOverlay=function(e,t,n){return new $n(e,t,n)},e.SVGOverlay=Gn,e.svgOverlay=function(e,t,n){return new Gn(e,t,n)},e.DivOverlay=Zn,e.Popup=Jn,e.popup=function(e,t){return new Jn(e,t)},e.Tooltip=Qn,e.tooltip=function(e,t){return new Qn(e,t)},e.Icon=jn,e.icon=function(e){return new jn(e)},e.DivIcon=Xn,e.divIcon=function(e){return new Xn(e)},e.Marker=xn,e.marker=function(e,t){return new xn(e,t)},e.TileLayer=tr,e.tileLayer=nr,e.GridLayer=er,e.gridLayer=function(e){return new er(e)},e.SVG=cr,e.svg=fr,e.Renderer=or,e.Canvas=ir,e.canvas=ar,e.Path=Tn,e.CircleMarker=Dn,e.circleMarker=function(e,t){return new Dn(e,t)},e.Circle=Rn,e.circle=function(e,t,n){return new Rn(e,t,n)},e.Polyline=Mn,e.polyline=function(e,t){return new Mn(e,t)},e.Polygon=An,e.polygon=function(e,t){return new An(e,t)},e.Rectangle=pr,e.rectangle=function(e,t){return new pr(e,t)},e.Map=Ut,e.map=function(e,t){return new Ut(e,t)};var wr=window.L;e.noConflict=function(){return window.L=wr,this},window.L=e}(t)},function(e,t,n){e.exports={navigation:"navigation--1TPKGVcdtJ",header:"header--1yYASq55gP","header-content":"header-content--3q2ACaykun",headerContent:"header-content--3q2ACaykun","header-icon":"header-icon--3slb78kEn1",headerIcon:"header-icon--3slb78kEn1","header-title":"header-title--3llLneBogU",headerTitle:"header-title--3llLneBogU",user:"user--1yh8_EoOW4","user-content":"user-content--1HWDvaZ5qI",userContent:"user-content--1HWDvaZ5qI","no-user-image":"no-user-image--2r0uxVSaEY",noUserImage:"no-user-image--2r0uxVSaEY","user-profile":"user-profile--3h8wK9aFMr",userProfile:"user-profile--3h8wK9aFMr",username:"username--1iD-BWgeXO",logout:"logout--3rYtUBtY-s",items:"items--23JrT1L7Qn",footer:"footer--3d3KVHirl9",pin:"pin--1EfeTj0EjG","pin-active":"pin-active--2xYrKut_aI",pinActive:"pin-active--2xYrKut_aI","pin-icon":"pin-icon--2Bs7SKVMJD",pinIcon:"pin-icon--2Bs7SKVMJD",versions:"versions--1zEVIvOm77"}},function(e,t,n){e.exports={input:"input--YrRPhYPmPT",left:"left--3McDXiCrys",center:"center--JXk60IDjWJ",right:"right--pX9XMNaOG9",collapsed:"collapsed--3cKiJ1rgll","has-append-icon":"has-append-icon--pQms0sSnCj",hasAppendIcon:"has-append-icon--pQms0sSnCj",dark:"dark--tc2vktcDJ7",error:"error--1YjDkE4VYd",disabled:"disabled--1cFjjKATa0","prepended-container":"prepended-container--1HLUlo-uAQ",prependedContainer:"prepended-container--1HLUlo-uAQ",icon:"icon--ytM2BXHUpA",headline:"headline--2ofmFMh3Td","append-container":"append-container--260F-W2kJw",appendContainer:"append-container--260F-W2kJw","icon-clickable":"icon-clickable--2i8CXxR-rS",iconClickable:"icon-clickable--2i8CXxR-rS"}},function(e,t,n){e.exports={"media-card":"media-card--3zwVt4x9IY",mediaCard:"media-card--3zwVt4x9IY",checkbox:"checkbox--3fO94jPv5b",selected:"selected--2I8c2zZDkN",header:"header--1GmsmRN8kP","header-click-area":"header-click-area--2YgVRnlEME",headerClickArea:"header-click-area--2YgVRnlEME",description:"description--KIscyejKfD","no-download-list":"no-download-list--Dd02_LyMg8",noDownloadList:"no-download-list--Dd02_LyMg8","download-button":"download-button--29bmE_WcBM",downloadButton:"download-button--29bmE_WcBM",active:"active--3MvsR-oqxD","ghost-indicator":"ghost-indicator--1_EW3uSSK6",ghostIndicator:"ghost-indicator--1_EW3uSSK6",title:"title--2BoVb9Cwl9",meta:"meta--Lq76ippoF_","title-text":"title-text--1DQCap-AbL",titleText:"title-text--1DQCap-AbL",media:"media--1-OiFQVLjc",cover:"cover--3_DtNQ3fhJ","show-cover":"show-cover--3T0YdhAWC5",showCover:"show-cover--3T0YdhAWC5","media-icon":"media-icon--3lo3oU5U41",mediaIcon:"media-icon--3lo3oU5U41"}},function(e,t,n){e.exports={"edit-form":"edit-form--nxK2xbxTj_",editForm:"edit-form--nxK2xbxTj_",form:"form--1u86V3nB4Y","media-column":"media-column--1rlxVEqxfN",mediaColumn:"media-column--1rlxVEqxfN","media-button":"media-button--242y4MFzfr",mediaButton:"media-button--242y4MFzfr","media-button-edit-icon":"media-button-edit-icon--22_pNpdNWh",mediaButtonEditIcon:"media-button-edit-icon--22_pNpdNWh","media-button-icon":"media-button-icon--2jrmYJLxGn",mediaButtonIcon:"media-button-icon--2jrmYJLxGn","title-input":"title-input--1dN4wONatr",titleInput:"title-input--1dN4wONatr","description-text-area":"description-text-area--NcKuq5NJ3G",descriptionTextArea:"description-text-area--NcKuq5NJ3G",buttons:"buttons--1mapRd_g0a",item:"item--2Ik0bJ0TWt",media:"media--3hQPdb-uXy",title:"title--2x9BbBTKTw",content:"content--3874kh7Wj0",description:"description--1KwBL0sb0j",type:"type--174ojyRJQN"}},function(e,t){function n(e,t,n){var r,o,i,a,u;function l(){var s=Date.now()-a;s=0?r=setTimeout(l,t-s):(r=null,n||(u=e.apply(i,o),i=o=null))}null==t&&(t=100);var s=function(){i=this,o=arguments,a=Date.now();var s=n&&!r;return r||(r=setTimeout(l,t)),s&&(u=e.apply(i,o),i=o=null),u};return s.clear=function(){r&&(clearTimeout(r),r=null)},s.flush=function(){r&&(u=e.apply(i,o),i=o=null,clearTimeout(r),r=null)},s}n.debounce=n,e.exports=n},function(e,t,n){e.exports={loader:"loader--2gdHZwemxA",root:"root--1xK2HnF3xf",visible:"visible--2-6zspTYQo","navigation-visible":"navigation-visible--2Y0-ThvmLG",navigationVisible:"navigation-visible--2Y0-ThvmLG",content:"content--2IfnEOTquo","with-pinned-navigation":"with-pinned-navigation--2VG8fUyABf",withPinnedNavigation:"with-pinned-navigation--2VG8fUyABf","with-sidebar":"with-sidebar--1mIP1_Go4G",withSidebar:"with-sidebar--1mIP1_Go4G","view-container":"view-container--3-uqYBnaX8",viewContainer:"view-container--3-uqYBnaX8",main:"main--3FrrdgELy2",sidebar:"sidebar--1h00XLaExU",small:"small--3wna2-Mqiy",medium:"medium--3kUvKyrWan",large:"large--3vpSCgRpSZ",navigation:"navigation--1r_Vo8arYt"}},function(e,t,n){e.exports={item:"item--1jtrJ1DYzL",text:"text--3n3NdvKI4C",active:"active--2idn-n2E2S",disabled:"disabled--1gI6QpUX0i",children:"children--7PRJYI6aBE",button:"button--2Fzrhq4BJX",visible:"visible--38dPT7rEGr",buttons:"buttons--1YMVp7Syw2",selected:"selected--34PSNwf2M_",indicator:"indicator--FffGEQh1l8","order-input":"order-input--nidbwm3RYU",orderInput:"order-input--nidbwm3RYU"}},function(e,t,n){e.exports={"media-container":"media-container--24xVCfsRYi",mediaContainer:"media-container--24xVCfsRYi","upload-indicator":"upload-indicator--1AR-kLZKnw",uploadIndicator:"upload-indicator--1AR-kLZKnw","show-upload-indicator":"show-upload-indicator--1T2VN-fo7m",showUploadIndicator:"show-upload-indicator--1T2VN-fo7m",disabled:"disabled--2DUBSGKHYW",progressbar:"progressbar--1ttu1M8akg","upload-indicator-container":"upload-indicator-container--jnVNyT85Go",uploadIndicatorContainer:"upload-indicator-container--jnVNyT85Go","mime-type-indicator":"mime-type-indicator--21ALKYDVwQ",mimeTypeIndicator:"mime-type-indicator--21ALKYDVwQ","empty-indicator":"empty-indicator--3RlQcJQgHp",emptyIndicator:"empty-indicator--3RlQcJQgHp","upload-icon":"upload-icon--3R_c-DlUGT",uploadIcon:"upload-icon--3R_c-DlUGT","upload-info-text":"upload-info-text--Ijzo9z9dY5",uploadInfoText:"upload-info-text--Ijzo9z9dY5",thumbnail:"thumbnail--2MX4oCKfh5",round:"round--7c0ME6Lf-H"}},function(e,t,n){e.exports={block:"block---lmRUaoC4J",expanded:"expanded--1OAMnWu3Nh",children:"children--2vr78c8PWl",header:"header--3Z6dsPKDx6",icons:"icons--3gZEnEY5xT",handle:"handle--DUvm6RDJgb",content:"content--Q--ddExW3x",types:"types--3BMYLuVPAf",type:"type--3zGitGam6V","icon-buttons":"icon-buttons--t5ZAGX2N0A",iconButtons:"icon-buttons--t5ZAGX2N0A"}},function(e,t){var n=Array.isArray;e.exports=n},function(e,t,n){var r; +!function(e){"use strict";function t(e){var t,n,r,o;for(n=1,r=arguments.length;n0?Math.floor(e):Math.ceil(e)};function R(e,t,n){return e instanceof T?e:m(e)?new T(e[0],e[1]):null==e?e:"object"==typeof e&&"x"in e&&"y"in e?new T(e.x,e.y):new T(e,t,n)}function M(e,t){if(e)for(var n=t?[e,t]:e,r=0,o=n.length;r=this.min.x&&n.x<=this.max.x&&t.y>=this.min.y&&n.y<=this.max.y},intersects:function(e){e=A(e);var t=this.min,n=this.max,r=e.min,o=e.max,i=o.x>=t.x&&r.x<=n.x,a=o.y>=t.y&&r.y<=n.y;return i&&a},overlaps:function(e){e=A(e);var t=this.min,n=this.max,r=e.min,o=e.max,i=o.x>t.x&&r.xt.y&&r.y=r.lat&&n.lat<=o.lat&&t.lng>=r.lng&&n.lng<=o.lng},intersects:function(e){e=z(e);var t=this._southWest,n=this._northEast,r=e.getSouthWest(),o=e.getNorthEast(),i=o.lat>=t.lat&&r.lat<=n.lat,a=o.lng>=t.lng&&r.lng<=n.lng;return i&&a},overlaps:function(e){e=z(e);var t=this._southWest,n=this._northEast,r=e.getSouthWest(),o=e.getNorthEast(),i=o.lat>t.lat&&r.latt.lng&&r.lng1,Pe=function(){var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("testPassiveEventSupport",l,t),window.removeEventListener("testPassiveEventSupport",l,t)}catch(e){}return e}(),je=!!document.createElement("canvas").getContext,Ee=!(!document.createElementNS||!$("svg").createSVGRect),Ce=!Ee&&function(){try{var e=document.createElement("div");e.innerHTML='';var t=e.firstChild;return t.style.behavior="url(#default#VML)",t&&"object"==typeof t.adj}catch(e){return!1}}();function xe(e){return navigator.userAgent.toLowerCase().indexOf(e)>=0}var Te={ie:J,ielt9:Q,edge:X,webkit:ee,android:te,android23:ne,androidStock:oe,opera:ie,chrome:ae,gecko:ue,safari:le,phantom:se,opera12:ce,win:fe,ie3d:pe,webkit3d:de,gecko3d:he,any3d:ye,mobile:me,mobileWebkit:be,mobileWebkit3d:ve,msPointer:ge,pointer:we,touch:_e,mobileOpera:Oe,mobileGecko:Se,retina:ke,passiveEvents:Pe,canvas:je,svg:Ee,vml:Ce},De=ge?"MSPointerDown":"pointerdown",Re=ge?"MSPointerMove":"pointermove",Me=ge?"MSPointerUp":"pointerup",Ae=ge?"MSPointerCancel":"pointercancel",Le={},Ie=!1;function ze(e,t,n,o){return"touchstart"===t?function(e,t,n){var o=r((function(e){e.MSPOINTER_TYPE_TOUCH&&e.pointerType===e.MSPOINTER_TYPE_TOUCH&&At(e),Be(e,t)}));e["_leaflet_touchstart"+n]=o,e.addEventListener(De,o,!1),Ie||(document.addEventListener(De,Fe,!0),document.addEventListener(Re,Ye,!0),document.addEventListener(Me,Ne,!0),document.addEventListener(Ae,Ne,!0),Ie=!0)}(e,n,o):"touchmove"===t?function(e,t,n){var r=function(e){e.pointerType===(e.MSPOINTER_TYPE_MOUSE||"mouse")&&0===e.buttons||Be(e,t)};e["_leaflet_touchmove"+n]=r,e.addEventListener(Re,r,!1)}(e,n,o):"touchend"===t&&function(e,t,n){var r=function(e){Be(e,t)};e["_leaflet_touchend"+n]=r,e.addEventListener(Me,r,!1),e.addEventListener(Ae,r,!1)}(e,n,o),this}function Fe(e){Le[e.pointerId]=e}function Ye(e){Le[e.pointerId]&&(Le[e.pointerId]=e)}function Ne(e){delete Le[e.pointerId]}function Be(e,t){for(var n in e.touches=[],Le)e.touches.push(Le[n]);e.changedTouches=[e],t(e)}var He,Ve,We,Ue,qe,Ke=ge?"MSPointerDown":we?"pointerdown":"touchstart",$e=ge?"MSPointerUp":we?"pointerup":"touchend",Ge="_leaflet_",Ze=pt(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),Je=pt(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),Qe="webkitTransition"===Je||"OTransition"===Je?Je+"End":"transitionend";function Xe(e){return"string"==typeof e?document.getElementById(e):e}function et(e,t){var n=e.style[t]||e.currentStyle&&e.currentStyle[t];if((!n||"auto"===n)&&document.defaultView){var r=document.defaultView.getComputedStyle(e,null);n=r?r[t]:null}return"auto"===n?null:n}function tt(e,t,n){var r=document.createElement(e);return r.className=t||"",n&&n.appendChild(r),r}function nt(e){var t=e.parentNode;t&&t.removeChild(e)}function rt(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function ot(e){var t=e.parentNode;t&&t.lastChild!==e&&t.appendChild(e)}function it(e){var t=e.parentNode;t&&t.firstChild!==e&&t.insertBefore(e,t.firstChild)}function at(e,t){if(void 0!==e.classList)return e.classList.contains(t);var n=ct(e);return n.length>0&&new RegExp("(^|\\s)"+t+"(\\s|$)").test(n)}function ut(e,t){if(void 0!==e.classList)for(var n=f(t),r=0,o=n.length;r1)return;var t=Date.now(),n=t-(r||t);o=e.touches?e.touches[0]:e,i=n>0&&n<=250,r=t}function u(e){if(i&&!o.cancelBubble){if(we){if("mouse"===e.pointerType)return;var n,a,u={};for(a in o)n=o[a],u[a]=n&&n.bind?n.bind(o):n;o=u}o.type="dblclick",o.button=0,t(o),r=null}}e[Ge+Ke+n]=a,e[Ge+$e+n]=u,e[Ge+"dblclick"+n]=t,e.addEventListener(Ke,a,!!Pe&&{passive:!1}),e.addEventListener($e,u,!!Pe&&{passive:!1}),e.addEventListener("dblclick",t,!1)}(e,a,o):"addEventListener"in e?"touchstart"===t||"touchmove"===t||"wheel"===t||"mousewheel"===t?e.addEventListener(Ct[t]||t,a,!!Pe&&{passive:!1}):"mouseenter"===t||"mouseleave"===t?(a=function(t){t=t||window.event,Ht(e,t)&&u(t)},e.addEventListener(Ct[t],a,!1)):e.addEventListener(t,u,!1):"attachEvent"in e&&e.attachEvent("on"+t,a),e[Pt]=e[Pt]||{},e[Pt][o]=a}function Tt(e,t,n,r){var o=t+i(n)+(r?"_"+i(r):""),a=e[Pt]&&e[Pt][o];if(!a)return this;we&&0===t.indexOf("touch")?function(e,t,n){var r=e["_leaflet_"+t+n];"touchstart"===t?e.removeEventListener(De,r,!1):"touchmove"===t?e.removeEventListener(Re,r,!1):"touchend"===t&&(e.removeEventListener(Me,r,!1),e.removeEventListener(Ae,r,!1))}(e,t,o):_e&&"dblclick"===t&&!Et()?function(e,t){var n=e[Ge+Ke+t],r=e[Ge+$e+t],o=e[Ge+"dblclick"+t];e.removeEventListener(Ke,n,!!Pe&&{passive:!1}),e.removeEventListener($e,r,!!Pe&&{passive:!1}),e.removeEventListener("dblclick",o,!1)}(e,o):"removeEventListener"in e?e.removeEventListener(Ct[t]||t,a,!1):"detachEvent"in e&&e.detachEvent("on"+t,a),e[Pt][o]=null}function Dt(e){return e.stopPropagation?e.stopPropagation():e.originalEvent?e.originalEvent._stopped=!0:e.cancelBubble=!0,Bt(e),this}function Rt(e){return xt(e,"wheel",Dt),this}function Mt(e){return kt(e,"mousedown touchstart dblclick",Dt),xt(e,"click",Nt),this}function At(e){return e.preventDefault?e.preventDefault():e.returnValue=!1,this}function Lt(e){return At(e),Dt(e),this}function It(e,t){if(!t)return new T(e.clientX,e.clientY);var n=Ot(t),r=n.boundingClientRect;return new T((e.clientX-r.left)/n.x-t.clientLeft,(e.clientY-r.top)/n.y-t.clientTop)}var zt=fe&&ae?2*window.devicePixelRatio:ue?window.devicePixelRatio:1;function Ft(e){return X?e.wheelDeltaY/2:e.deltaY&&0===e.deltaMode?-e.deltaY/zt:e.deltaY&&1===e.deltaMode?20*-e.deltaY:e.deltaY&&2===e.deltaMode?60*-e.deltaY:e.deltaX||e.deltaZ?0:e.wheelDelta?(e.wheelDeltaY||e.wheelDelta)/2:e.detail&&Math.abs(e.detail)<32765?20*-e.detail:e.detail?e.detail/-32765*60:0}var Yt={};function Nt(e){Yt[e.type]=!0}function Bt(e){var t=Yt[e.type];return Yt[e.type]=!1,t}function Ht(e,t){var n=t.relatedTarget;if(!n)return!0;try{for(;n&&n!==e;)n=n.parentNode}catch(e){return!1}return n!==e}var Vt={on:kt,off:jt,stopPropagation:Dt,disableScrollPropagation:Rt,disableClickPropagation:Mt,preventDefault:At,stop:Lt,getMousePosition:It,getWheelDelta:Ft,fakeStop:Nt,skipped:Bt,isExternalTarget:Ht,addListener:kt,removeListener:jt},Wt=x.extend({run:function(e,t,n,r){this.stop(),this._el=e,this._inProgress=!0,this._duration=n||.25,this._easeOutPower=1/Math.max(r||.5,.2),this._startPos=yt(e),this._offset=t.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=k(this._animate,this),this._step()},_step:function(e){var t=+new Date-this._startTime,n=1e3*this._duration;tthis.options.maxZoom)?this.setZoom(e):this},panInsideBounds:function(e,t){this._enforcingBounds=!0;var n=this.getCenter(),r=this._limitCenter(n,this._zoom,z(e));return n.equals(r)||this.panTo(r,t),this._enforcingBounds=!1,this},panInside:function(e,t){var n=R((t=t||{}).paddingTopLeft||t.padding||[0,0]),r=R(t.paddingBottomRight||t.padding||[0,0]),o=this.getCenter(),i=this.project(o),a=this.project(e),u=this.getPixelBounds(),l=u.getSize().divideBy(2),s=A([u.min.add(n),u.max.subtract(r)]);if(!s.contains(a)){this._enforcingBounds=!0;var c=i.subtract(a),f=R(a.x+c.x,a.y+c.y);(a.xs.max.x)&&(f.x=i.x-c.x,c.x>0?f.x+=l.x-n.x:f.x-=l.x-r.x),(a.ys.max.y)&&(f.y=i.y-c.y,c.y>0?f.y+=l.y-n.y:f.y-=l.y-r.y),this.panTo(this.unproject(f),t),this._enforcingBounds=!1}return this},invalidateSize:function(e){if(!this._loaded)return this;e=t({animate:!1,pan:!0},!0===e?{animate:!0}:e);var n=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var o=this.getSize(),i=n.divideBy(2).round(),a=o.divideBy(2).round(),u=i.subtract(a);return u.x||u.y?(e.animate&&e.pan?this.panBy(u):(e.pan&&this._rawPanBy(u),this.fire("move"),e.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(r(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:n,newSize:o})):this},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(e){if(e=this._locateOptions=t({timeout:1e4,watch:!1},e),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var n=r(this._handleGeolocationResponse,this),o=r(this._handleGeolocationError,this);return e.watch?this._locationWatchId=navigator.geolocation.watchPosition(n,o,e):navigator.geolocation.getCurrentPosition(n,o,e),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(e){var t=e.code,n=e.message||(1===t?"permission denied":2===t?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:t,message:"Geolocation error: "+n+"."})},_handleGeolocationResponse:function(e){var t=new F(e.coords.latitude,e.coords.longitude),n=t.toBounds(2*e.coords.accuracy),r=this._locateOptions;if(r.setView){var o=this.getBoundsZoom(n);this.setView(t,r.maxZoom?Math.min(o,r.maxZoom):o)}var i={latlng:t,bounds:n,timestamp:e.timestamp};for(var a in e.coords)"number"==typeof e.coords[a]&&(i[a]=e.coords[a]);this.fire("locationfound",i)},addHandler:function(e,t){if(!t)return this;var n=this[e]=new t(this);return this._handlers.push(n),this.options[e]&&n.enable(),this},remove:function(){if(this._initEvents(!0),this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch(e){this._container._leaflet_id=void 0,this._containerId=void 0}var e;for(e in void 0!==this._locationWatchId&&this.stopLocate(),this._stop(),nt(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(P(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload"),this._layers)this._layers[e].remove();for(e in this._panes)nt(this._panes[e]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(e,t){var n=tt("div","leaflet-pane"+(e?" leaflet-"+e.replace("Pane","")+"-pane":""),t||this._mapPane);return e&&(this._panes[e]=n),n},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter:this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var e=this.getPixelBounds();return new I(this.unproject(e.getBottomLeft()),this.unproject(e.getTopRight()))},getMinZoom:function(){return void 0===this.options.minZoom?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return void 0===this.options.maxZoom?void 0===this._layersMaxZoom?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(e,t,n){e=z(e),n=R(n||[0,0]);var r=this.getZoom()||0,o=this.getMinZoom(),i=this.getMaxZoom(),a=e.getNorthWest(),u=e.getSouthEast(),l=this.getSize().subtract(n),s=A(this.project(u,r),this.project(a,r)).getSize(),c=ye?this.options.zoomSnap:1,f=l.x/s.x,p=l.y/s.y,d=t?Math.max(f,p):Math.min(f,p);return r=this.getScaleZoom(d,r),c&&(r=Math.round(r/(c/100))*(c/100),r=t?Math.ceil(r/c)*c:Math.floor(r/c)*c),Math.max(o,Math.min(i,r))},getSize:function(){return this._size&&!this._sizeChanged||(this._size=new T(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(e,t){var n=this._getTopLeftPoint(e,t);return new M(n,n.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(e){return this.options.crs.getProjectedBounds(void 0===e?this.getZoom():e)},getPane:function(e){return"string"==typeof e?this._panes[e]:e},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(e,t){var n=this.options.crs;return t=void 0===t?this._zoom:t,n.scale(e)/n.scale(t)},getScaleZoom:function(e,t){var n=this.options.crs;t=void 0===t?this._zoom:t;var r=n.zoom(e*n.scale(t));return isNaN(r)?1/0:r},project:function(e,t){return t=void 0===t?this._zoom:t,this.options.crs.latLngToPoint(Y(e),t)},unproject:function(e,t){return t=void 0===t?this._zoom:t,this.options.crs.pointToLatLng(R(e),t)},layerPointToLatLng:function(e){var t=R(e).add(this.getPixelOrigin());return this.unproject(t)},latLngToLayerPoint:function(e){return this.project(Y(e))._round()._subtract(this.getPixelOrigin())},wrapLatLng:function(e){return this.options.crs.wrapLatLng(Y(e))},wrapLatLngBounds:function(e){return this.options.crs.wrapLatLngBounds(z(e))},distance:function(e,t){return this.options.crs.distance(Y(e),Y(t))},containerPointToLayerPoint:function(e){return R(e).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(e){return R(e).add(this._getMapPanePos())},containerPointToLatLng:function(e){var t=this.containerPointToLayerPoint(R(e));return this.layerPointToLatLng(t)},latLngToContainerPoint:function(e){return this.layerPointToContainerPoint(this.latLngToLayerPoint(Y(e)))},mouseEventToContainerPoint:function(e){return It(e,this._container)},mouseEventToLayerPoint:function(e){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(e))},mouseEventToLatLng:function(e){return this.layerPointToLatLng(this.mouseEventToLayerPoint(e))},_initContainer:function(e){var t=this._container=Xe(e);if(!t)throw new Error("Map container not found.");if(t._leaflet_id)throw new Error("Map container is already initialized.");kt(t,"scroll",this._onScroll,this),this._containerId=i(t)},_initLayout:function(){var e=this._container;this._fadeAnimated=this.options.fadeAnimation&&ye,ut(e,"leaflet-container"+(_e?" leaflet-touch":"")+(ke?" leaflet-retina":"")+(Q?" leaflet-oldie":"")+(le?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var t=et(e,"position");"absolute"!==t&&"relative"!==t&&"fixed"!==t&&(e.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var e=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),ht(this._mapPane,new T(0,0)),this.createPane("tilePane"),this.createPane("shadowPane"),this.createPane("overlayPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(ut(e.markerPane,"leaflet-zoom-hide"),ut(e.shadowPane,"leaflet-zoom-hide"))},_resetView:function(e,t){ht(this._mapPane,new T(0,0));var n=!this._loaded;this._loaded=!0,t=this._limitZoom(t),this.fire("viewprereset");var r=this._zoom!==t;this._moveStart(r,!1)._move(e,t)._moveEnd(r),this.fire("viewreset"),n&&this.fire("load")},_moveStart:function(e,t){return e&&this.fire("zoomstart"),t||this.fire("movestart"),this},_move:function(e,t,n){void 0===t&&(t=this._zoom);var r=this._zoom!==t;return this._zoom=t,this._lastCenter=e,this._pixelOrigin=this._getNewPixelOrigin(e),(r||n&&n.pinch)&&this.fire("zoom",n),this.fire("move",n)},_moveEnd:function(e){return e&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return P(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(e){ht(this._mapPane,this._getMapPanePos().subtract(e))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(e){this._targets={},this._targets[i(this._container)]=this;var t=e?jt:kt;t(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&t(window,"resize",this._onResize,this),ye&&this.options.transform3DLimit&&(e?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){P(this._resizeRequest),this._resizeRequest=k((function(){this.invalidateSize({debounceMoveend:!0})}),this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var e=this._getMapPanePos();Math.max(Math.abs(e.x),Math.abs(e.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(e,t){for(var n,r=[],o="mouseout"===t||"mouseover"===t,a=e.target||e.srcElement,u=!1;a;){if((n=this._targets[i(a)])&&("click"===t||"preclick"===t)&&!e._simulated&&this._draggableMoved(n)){u=!0;break}if(n&&n.listens(t,!0)){if(o&&!Ht(a,e))break;if(r.push(n),o)break}if(a===this._container)break;a=a.parentNode}return r.length||u||o||!Ht(a,e)||(r=[this]),r},_handleDOMEvent:function(e){if(this._loaded&&!Bt(e)){var t=e.type;"mousedown"!==t&&"keypress"!==t&&"keyup"!==t&&"keydown"!==t||gt(e.target||e.srcElement),this._fireDOMEvent(e,t)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(e,n,r){if("click"===e.type){var o=t({},e);o.type="preclick",this._fireDOMEvent(o,o.type,r)}if(!e._stopped&&(r=(r||[]).concat(this._findEventTargets(e,n))).length){var i=r[0];"contextmenu"===n&&i.listens(n,!0)&&At(e);var a={originalEvent:e};if("keypress"!==e.type&&"keydown"!==e.type&&"keyup"!==e.type){var u=i.getLatLng&&(!i._radius||i._radius<=10);a.containerPoint=u?this.latLngToContainerPoint(i.getLatLng()):this.mouseEventToContainerPoint(e),a.layerPoint=this.containerPointToLayerPoint(a.containerPoint),a.latlng=u?i.getLatLng():this.layerPointToLatLng(a.layerPoint)}for(var l=0;l0?Math.round(e-t)/2:Math.max(0,Math.ceil(e))-Math.max(0,Math.floor(t))},_limitZoom:function(e){var t=this.getMinZoom(),n=this.getMaxZoom(),r=ye?this.options.zoomSnap:1;return r&&(e=Math.round(e/r)*r),Math.max(t,Math.min(n,e))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){lt(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(e,t){var n=this._getCenterOffset(e)._trunc();return!(!0!==(t&&t.animate)&&!this.getSize().contains(n)||(this.panBy(n,t),0))},_createAnimProxy:function(){var e=this._proxy=tt("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(e),this.on("zoomanim",(function(e){var t=Ze,n=this._proxy.style[t];dt(this._proxy,this.project(e.center,e.zoom),this.getZoomScale(e.zoom,1)),n===this._proxy.style[t]&&this._animatingZoom&&this._onZoomTransitionEnd()}),this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){nt(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var e=this.getCenter(),t=this.getZoom();dt(this._proxy,this.project(e,t),this.getZoomScale(t,1))},_catchTransitionEnd:function(e){this._animatingZoom&&e.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(e,t,n){if(this._animatingZoom)return!0;if(n=n||{},!this._zoomAnimated||!1===n.animate||this._nothingToAnimate()||Math.abs(t-this._zoom)>this.options.zoomAnimationThreshold)return!1;var r=this.getZoomScale(t),o=this._getCenterOffset(e)._divideBy(1-1/r);return!(!0!==n.animate&&!this.getSize().contains(o)||(k((function(){this._moveStart(!0,!1)._animateZoom(e,t,!0)}),this),0))},_animateZoom:function(e,t,n,o){this._mapPane&&(n&&(this._animatingZoom=!0,this._animateToCenter=e,this._animateToZoom=t,ut(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:e,zoom:t,noUpdate:o}),setTimeout(r(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&<(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom),k((function(){this._moveEnd(!0)}),this))}}),qt=E.extend({options:{position:"topright"},initialize:function(e){p(this,e)},getPosition:function(){return this.options.position},setPosition:function(e){var t=this._map;return t&&t.removeControl(this),this.options.position=e,t&&t.addControl(this),this},getContainer:function(){return this._container},addTo:function(e){this.remove(),this._map=e;var t=this._container=this.onAdd(e),n=this.getPosition(),r=e._controlCorners[n];return ut(t,"leaflet-control"),-1!==n.indexOf("bottom")?r.insertBefore(t,r.firstChild):r.appendChild(t),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(nt(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(e){this._map&&e&&e.screenX>0&&e.screenY>0&&this._map.getContainer().focus()}}),Kt=function(e){return new qt(e)};Ut.include({addControl:function(e){return e.addTo(this),this},removeControl:function(e){return e.remove(),this},_initControlPos:function(){var e=this._controlCorners={},t="leaflet-",n=this._controlContainer=tt("div",t+"control-container",this._container);function r(r,o){var i=t+r+" "+t+o;e[r+o]=tt("div",i,n)}r("top","left"),r("top","right"),r("bottom","left"),r("bottom","right")},_clearControlPos:function(){for(var e in this._controlCorners)nt(this._controlCorners[e]);nt(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var $t=qt.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(e,t,n,r){return n1,this._baseLayersList.style.display=e?"":"none"),this._separator.style.display=t&&e?"":"none",this},_onLayerChange:function(e){this._handlingClick||this._update();var t=this._getLayer(i(e.target)),n=t.overlay?"add"===e.type?"overlayadd":"overlayremove":"add"===e.type?"baselayerchange":null;n&&this._map.fire(n,t)},_createRadioElement:function(e,t){var n='",r=document.createElement("div");return r.innerHTML=n,r.firstChild},_addItem:function(e){var t,n=document.createElement("label"),r=this._map.hasLayer(e.layer);e.overlay?((t=document.createElement("input")).type="checkbox",t.className="leaflet-control-layers-selector",t.defaultChecked=r):t=this._createRadioElement("leaflet-base-layers_"+i(this),r),this._layerControlInputs.push(t),t.layerId=i(e.layer),kt(t,"click",this._onInputClick,this);var o=document.createElement("span");o.innerHTML=" "+e.name;var a=document.createElement("div");return n.appendChild(a),a.appendChild(t),a.appendChild(o),(e.overlay?this._overlaysList:this._baseLayersList).appendChild(n),this._checkDisabledLayers(),n},_onInputClick:function(){var e,t,n=this._layerControlInputs,r=[],o=[];this._handlingClick=!0;for(var i=n.length-1;i>=0;i--)e=n[i],t=this._getLayer(e.layerId).layer,e.checked?r.push(t):e.checked||o.push(t);for(i=0;i=0;o--)e=n[o],t=this._getLayer(e.layerId).layer,e.disabled=void 0!==t.options.minZoom&&rt.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expand:function(){return this.expand()},_collapse:function(){return this.collapse()}}),Gt=qt.extend({options:{position:"topleft",zoomInText:"+",zoomInTitle:"Zoom in",zoomOutText:"−",zoomOutTitle:"Zoom out"},onAdd:function(e){var t="leaflet-control-zoom",n=tt("div",t+" leaflet-bar"),r=this.options;return this._zoomInButton=this._createButton(r.zoomInText,r.zoomInTitle,t+"-in",n,this._zoomIn),this._zoomOutButton=this._createButton(r.zoomOutText,r.zoomOutTitle,t+"-out",n,this._zoomOut),this._updateDisabled(),e.on("zoomend zoomlevelschange",this._updateDisabled,this),n},onRemove:function(e){e.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(e){!this._disabled&&this._map._zoomthis._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(e.shiftKey?3:1))},_createButton:function(e,t,n,r,o){var i=tt("a",n,r);return i.innerHTML=e,i.href="#",i.title=t,i.setAttribute("role","button"),i.setAttribute("aria-label",t),Mt(i),kt(i,"click",Lt),kt(i,"click",o,this),kt(i,"click",this._refocusOnMap,this),i},_updateDisabled:function(){var e=this._map,t="leaflet-disabled";lt(this._zoomInButton,t),lt(this._zoomOutButton,t),(this._disabled||e._zoom===e.getMinZoom())&&ut(this._zoomOutButton,t),(this._disabled||e._zoom===e.getMaxZoom())&&ut(this._zoomInButton,t)}});Ut.mergeOptions({zoomControl:!0}),Ut.addInitHook((function(){this.options.zoomControl&&(this.zoomControl=new Gt,this.addControl(this.zoomControl))}));var Zt=qt.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(e){var t=tt("div","leaflet-control-scale"),n=this.options;return this._addScales(n,"leaflet-control-scale-line",t),e.on(n.updateWhenIdle?"moveend":"move",this._update,this),e.whenReady(this._update,this),t},onRemove:function(e){e.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(e,t,n){e.metric&&(this._mScale=tt("div",t,n)),e.imperial&&(this._iScale=tt("div",t,n))},_update:function(){var e=this._map,t=e.getSize().y/2,n=e.distance(e.containerPointToLatLng([0,t]),e.containerPointToLatLng([this.options.maxWidth,t]));this._updateScales(n)},_updateScales:function(e){this.options.metric&&e&&this._updateMetric(e),this.options.imperial&&e&&this._updateImperial(e)},_updateMetric:function(e){var t=this._getRoundNum(e),n=t<1e3?t+" m":t/1e3+" km";this._updateScale(this._mScale,n,t/e)},_updateImperial:function(e){var t,n,r,o=3.2808399*e;o>5280?(t=o/5280,n=this._getRoundNum(t),this._updateScale(this._iScale,n+" mi",n/t)):(r=this._getRoundNum(o),this._updateScale(this._iScale,r+" ft",r/o))},_updateScale:function(e,t,n){e.style.width=Math.round(this.options.maxWidth*n)+"px",e.innerHTML=t},_getRoundNum:function(e){var t=Math.pow(10,(Math.floor(e)+"").length-1),n=e/t;return t*(n=n>=10?10:n>=5?5:n>=3?3:n>=2?2:1)}}),Jt=qt.extend({options:{position:"bottomright",prefix:'Leaflet'},initialize:function(e){p(this,e),this._attributions={}},onAdd:function(e){for(var t in e.attributionControl=this,this._container=tt("div","leaflet-control-attribution"),Mt(this._container),e._layers)e._layers[t].getAttribution&&this.addAttribution(e._layers[t].getAttribution());return this._update(),this._container},setPrefix:function(e){return this.options.prefix=e,this._update(),this},addAttribution:function(e){return e?(this._attributions[e]||(this._attributions[e]=0),this._attributions[e]++,this._update(),this):this},removeAttribution:function(e){return e?(this._attributions[e]&&(this._attributions[e]--,this._update()),this):this},_update:function(){if(this._map){var e=[];for(var t in this._attributions)this._attributions[t]&&e.push(t);var n=[];this.options.prefix&&n.push(this.options.prefix),e.length&&n.push(e.join(", ")),this._container.innerHTML=n.join(" | ")}}});Ut.mergeOptions({attributionControl:!0}),Ut.addInitHook((function(){this.options.attributionControl&&(new Jt).addTo(this)})),qt.Layers=$t,qt.Zoom=Gt,qt.Scale=Zt,qt.Attribution=Jt,Kt.layers=function(e,t,n){return new $t(e,t,n)},Kt.zoom=function(e){return new Gt(e)},Kt.scale=function(e){return new Zt(e)},Kt.attribution=function(e){return new Jt(e)};var Qt=E.extend({initialize:function(e){this._map=e},enable:function(){return this._enabled||(this._enabled=!0,this.addHooks()),this},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});Qt.addTo=function(e,t){return e.addHandler(t,this),this};var Xt,en={Events:C},tn=_e?"touchstart mousedown":"mousedown",nn={mousedown:"mouseup",touchstart:"touchend",pointerdown:"touchend",MSPointerDown:"touchend"},rn={mousedown:"mousemove",touchstart:"touchmove",pointerdown:"touchmove",MSPointerDown:"touchmove"},on=x.extend({options:{clickTolerance:3},initialize:function(e,t,n,r){p(this,r),this._element=e,this._dragStartTarget=t||e,this._preventOutline=n},enable:function(){this._enabled||(kt(this._dragStartTarget,tn,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(on._dragging===this&&this.finishDrag(),jt(this._dragStartTarget,tn,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(e){if(!e._simulated&&this._enabled&&(this._moved=!1,!at(this._element,"leaflet-zoom-anim")&&!(on._dragging||e.shiftKey||1!==e.which&&1!==e.button&&!e.touches||(on._dragging=this,this._preventOutline&>(this._element),bt(),He(),this._moving)))){this.fire("down");var t=e.touches?e.touches[0]:e,n=_t(this._element);this._startPoint=new T(t.clientX,t.clientY),this._parentScale=Ot(n),kt(document,rn[e.type],this._onMove,this),kt(document,nn[e.type],this._onUp,this)}},_onMove:function(e){if(!e._simulated&&this._enabled)if(e.touches&&e.touches.length>1)this._moved=!0;else{var t=e.touches&&1===e.touches.length?e.touches[0]:e,n=new T(t.clientX,t.clientY)._subtract(this._startPoint);(n.x||n.y)&&(Math.abs(n.x)+Math.abs(n.y)s&&(a=u,s=l);s>r&&(n[a]=1,e(t,n,r,o,a),e(t,n,r,a,i))}(e,r,t,0,n-1);var o,i=[];for(o=0;ot&&(n.push(e[r]),o=r);var a,u,l,s;return ot.max.x&&(n|=2),e.yt.max.y&&(n|=8),n}function fn(e,t,n,r){var o,i=t.x,a=t.y,u=n.x-i,l=n.y-a,s=u*u+l*l;return s>0&&((o=((e.x-i)*u+(e.y-a)*l)/s)>1?(i=n.x,a=n.y):o>0&&(i+=u*o,a+=l*o)),u=e.x-i,l=e.y-a,r?u*u+l*l:new T(i,a)}function pn(e){return!m(e[0])||"object"!=typeof e[0][0]&&void 0!==e[0][0]}function dn(e){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),pn(e)}var hn={simplify:an,pointToSegmentDistance:un,closestPointOnSegment:function(e,t,n){return fn(e,t,n)},clipSegment:ln,_getEdgeIntersection:sn,_getBitCode:cn,_sqClosestPointOnSegment:fn,isFlat:pn,_flat:dn};function yn(e,t,n){var r,o,i,a,u,l,s,c,f,p=[1,4,2,8];for(o=0,s=e.length;o1e-7;l++)t=i*Math.sin(u),t=Math.pow((1-t)/(1+t),i/2),u+=s=Math.PI/2-2*Math.atan(a*t)-u;return new F(u*n,e.x*n/r)}},gn={LonLat:bn,Mercator:vn,SphericalMercator:V},wn=t({},H,{code:"EPSG:3395",projection:vn,transformation:function(){var e=.5/(Math.PI*vn.R);return U(e,.5,-e,.5)}()}),_n=t({},H,{code:"EPSG:4326",projection:bn,transformation:U(1/180,1,-1/180,.5)}),On=t({},B,{projection:bn,transformation:U(1,0,-1,0),scale:function(e){return Math.pow(2,e)},zoom:function(e){return Math.log(e)/Math.LN2},distance:function(e,t){var n=t.lng-e.lng,r=t.lat-e.lat;return Math.sqrt(n*n+r*r)},infinite:!0});B.Earth=H,B.EPSG3395=wn,B.EPSG3857=q,B.EPSG900913=K,B.EPSG4326=_n,B.Simple=On;var Sn=x.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(e){return e.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(e){return e&&e.removeLayer(this),this},getPane:function(e){return this._map.getPane(e?this.options[e]||e:this.options.pane)},addInteractiveTarget:function(e){return this._map._targets[i(e)]=this,this},removeInteractiveTarget:function(e){return delete this._map._targets[i(e)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(e){var t=e.target;if(t.hasLayer(this)){if(this._map=t,this._zoomAnimated=t._zoomAnimated,this.getEvents){var n=this.getEvents();t.on(n,this),this.once("remove",(function(){t.off(n,this)}),this)}this.onAdd(t),this.getAttribution&&t.attributionControl&&t.attributionControl.addAttribution(this.getAttribution()),this.fire("add"),t.fire("layeradd",{layer:this})}}});Ut.include({addLayer:function(e){if(!e._layerAdd)throw new Error("The provided object is not a Layer.");var t=i(e);return this._layers[t]||(this._layers[t]=e,e._mapToAdd=this,e.beforeAdd&&e.beforeAdd(this),this.whenReady(e._layerAdd,e)),this},removeLayer:function(e){var t=i(e);return this._layers[t]?(this._loaded&&e.onRemove(this),e.getAttribution&&this.attributionControl&&this.attributionControl.removeAttribution(e.getAttribution()),delete this._layers[t],this._loaded&&(this.fire("layerremove",{layer:e}),e.fire("remove")),e._map=e._mapToAdd=null,this):this},hasLayer:function(e){return!!e&&i(e)in this._layers},eachLayer:function(e,t){for(var n in this._layers)e.call(t,this._layers[n]);return this},_addLayers:function(e){for(var t=0,n=(e=e?m(e)?e:[e]:[]).length;tthis._layersMaxZoom&&this.setZoom(this._layersMaxZoom),void 0===this.options.minZoom&&this._layersMinZoom&&this.getZoom()t)return a=(r-t)/n,this._map.layerPointToLatLng([i.x-a*(i.x-o.x),i.y-a*(i.y-o.y)])},getBounds:function(){return this._bounds},addLatLng:function(e,t){return t=t||this._defaultShape(),e=Y(e),t.push(e),this._bounds.extend(e),this.redraw()},_setLatLngs:function(e){this._bounds=new I,this._latlngs=this._convertLatLngs(e)},_defaultShape:function(){return pn(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(e){for(var t=[],n=pn(e),r=0,o=e.length;r=2&&t[0]instanceof F&&t[0].equals(t[n-1])&&t.pop(),t},_setLatLngs:function(e){Mn.prototype._setLatLngs.call(this,e),pn(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return pn(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var e=this._renderer._bounds,t=this.options.weight,n=new T(t,t);if(e=new M(e.min.subtract(n),e.max.add(n)),this._parts=[],this._pxBounds&&this._pxBounds.intersects(e))if(this.options.noClip)this._parts=this._rings;else for(var r,o=0,i=this._rings.length;oe.y!=r.y>e.y&&e.x<(r.x-n.x)*(e.y-n.y)/(r.y-n.y)+n.x&&(s=!s);return s||Mn.prototype._containsPoint.call(this,e,!0)}}),Ln=Pn.extend({initialize:function(e,t){p(this,t),this._layers={},e&&this.addData(e)},addData:function(e){var t,n,r,o=m(e)?e:e.features;if(o){for(t=0,n=o.length;t0?o:[t.src]}else{m(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(t.style,"objectFit")&&(t.style.objectFit="fill"),t.autoplay=!!this.options.autoplay,t.loop=!!this.options.loop,t.muted=!!this.options.muted;for(var a=0;ao?(t.height=o+"px",ut(e,"leaflet-popup-scrolled")):lt(e,"leaflet-popup-scrolled"),this._containerWidth=this._container.offsetWidth},_animateZoom:function(e){var t=this._map._latLngToNewLayerPoint(this._latlng,e.zoom,e.center),n=this._getAnchor();ht(this._container,t.add(n))},_adjustPan:function(){if(this.options.autoPan){this._map._panAnim&&this._map._panAnim.stop();var e=this._map,t=parseInt(et(this._container,"marginBottom"),10)||0,n=this._container.offsetHeight+t,r=this._containerWidth,o=new T(this._containerLeft,-n-this._containerBottom);o._add(yt(this._container));var i=e.layerPointToContainerPoint(o),a=R(this.options.autoPanPadding),u=R(this.options.autoPanPaddingTopLeft||a),l=R(this.options.autoPanPaddingBottomRight||a),s=e.getSize(),c=0,f=0;i.x+r+l.x>s.x&&(c=i.x+r-s.x+l.x),i.x-c-u.x<0&&(c=i.x-u.x),i.y+n+l.y>s.y&&(f=i.y+n-s.y+l.y),i.y-f-u.y<0&&(f=i.y-u.y),(c||f)&&e.fire("autopanstart").panBy([c,f])}},_onCloseButtonClick:function(e){this._close(),Lt(e)},_getAnchor:function(){return R(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}});Ut.mergeOptions({closePopupOnClick:!0}),Ut.include({openPopup:function(e,t,n){return e instanceof Jn||(e=new Jn(n).setContent(e)),t&&e.setLatLng(t),this.hasLayer(e)?this:(this._popup&&this._popup.options.autoClose&&this.closePopup(),this._popup=e,this.addLayer(e))},closePopup:function(e){return e&&e!==this._popup||(e=this._popup,this._popup=null),e&&this.removeLayer(e),this}}),Sn.include({bindPopup:function(e,t){return e instanceof Jn?(p(e,t),this._popup=e,e._source=this):(this._popup&&!t||(this._popup=new Jn(t,this)),this._popup.setContent(e)),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(e,t){return this._popup&&this._map&&(t=this._popup._prepareOpen(this,e,t),this._map.openPopup(this._popup,t)),this},closePopup:function(){return this._popup&&this._popup._close(),this},togglePopup:function(e){return this._popup&&(this._popup._map?this.closePopup():this.openPopup(e)),this},isPopupOpen:function(){return!!this._popup&&this._popup.isOpen()},setPopupContent:function(e){return this._popup&&this._popup.setContent(e),this},getPopup:function(){return this._popup},_openPopup:function(e){var t=e.layer||e.target;this._popup&&this._map&&(Lt(e),t instanceof Tn?this.openPopup(e.layer||e.target,e.latlng):this._map.hasLayer(this._popup)&&this._popup._source===t?this.closePopup():this.openPopup(t,e.latlng))},_movePopup:function(e){this._popup.setLatLng(e.latlng)},_onKeyPress:function(e){13===e.originalEvent.keyCode&&this._openPopup(e)}});var Qn=Zn.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,interactive:!1,opacity:.9},onAdd:function(e){Zn.prototype.onAdd.call(this,e),this.setOpacity(this.options.opacity),e.fire("tooltipopen",{tooltip:this}),this._source&&this._source.fire("tooltipopen",{tooltip:this},!0)},onRemove:function(e){Zn.prototype.onRemove.call(this,e),e.fire("tooltipclose",{tooltip:this}),this._source&&this._source.fire("tooltipclose",{tooltip:this},!0)},getEvents:function(){var e=Zn.prototype.getEvents.call(this);return _e&&!this.options.permanent&&(e.preclick=this._close),e},_close:function(){this._map&&this._map.closeTooltip(this)},_initLayout:function(){var e="leaflet-tooltip "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=tt("div",e)},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(e){var t,n,r=this._map,o=this._container,i=r.latLngToContainerPoint(r.getCenter()),a=r.layerPointToContainerPoint(e),u=this.options.direction,l=o.offsetWidth,s=o.offsetHeight,c=R(this.options.offset),f=this._getAnchor();"top"===u?(t=l/2,n=s):"bottom"===u?(t=l/2,n=0):"center"===u?(t=l/2,n=s/2):"right"===u?(t=0,n=s/2):"left"===u?(t=l,n=s/2):a.xthis.options.maxZoom||nr&&this._retainParent(o,i,a,r))},_retainChildren:function(e,t,n,r){for(var o=2*e;o<2*e+2;o++)for(var i=2*t;i<2*t+2;i++){var a=new T(o,i);a.z=n+1;var u=this._tileCoordsToKey(a),l=this._tiles[u];l&&l.active?l.retain=!0:(l&&l.loaded&&(l.retain=!0),n+1this.options.maxZoom||void 0!==this.options.minZoom&&o1)this._setView(e,n);else{for(var f=o.min.y;f<=o.max.y;f++)for(var p=o.min.x;p<=o.max.x;p++){var d=new T(p,f);if(d.z=this._tileZoom,this._isValidTile(d)){var h=this._tiles[this._tileCoordsToKey(d)];h?h.current=!0:a.push(d)}}if(a.sort((function(e,t){return e.distanceTo(i)-t.distanceTo(i)})),0!==a.length){this._loading||(this._loading=!0,this.fire("loading"));var y=document.createDocumentFragment();for(p=0;pn.max.x)||!t.wrapLat&&(e.yn.max.y))return!1}if(!this.options.bounds)return!0;var r=this._tileCoordsToBounds(e);return z(this.options.bounds).overlaps(r)},_keyToBounds:function(e){return this._tileCoordsToBounds(this._keyToTileCoords(e))},_tileCoordsToNwSe:function(e){var t=this._map,n=this.getTileSize(),r=e.scaleBy(n),o=r.add(n);return[t.unproject(r,e.z),t.unproject(o,e.z)]},_tileCoordsToBounds:function(e){var t=this._tileCoordsToNwSe(e),n=new I(t[0],t[1]);return this.options.noWrap||(n=this._map.wrapLatLngBounds(n)),n},_tileCoordsToKey:function(e){return e.x+":"+e.y+":"+e.z},_keyToTileCoords:function(e){var t=e.split(":"),n=new T(+t[0],+t[1]);return n.z=+t[2],n},_removeTile:function(e){var t=this._tiles[e];t&&(nt(t.el),delete this._tiles[e],this.fire("tileunload",{tile:t.el,coords:this._keyToTileCoords(e)}))},_initTile:function(e){ut(e,"leaflet-tile");var t=this.getTileSize();e.style.width=t.x+"px",e.style.height=t.y+"px",e.onselectstart=l,e.onmousemove=l,Q&&this.options.opacity<1&&ft(e,this.options.opacity),te&&!ne&&(e.style.WebkitBackfaceVisibility="hidden")},_addTile:function(e,t){var n=this._getTilePos(e),o=this._tileCoordsToKey(e),i=this.createTile(this._wrapCoords(e),r(this._tileReady,this,e));this._initTile(i),this.createTile.length<2&&k(r(this._tileReady,this,e,null,i)),ht(i,n),this._tiles[o]={el:i,coords:e,current:!0},t.appendChild(i),this.fire("tileloadstart",{tile:i,coords:e})},_tileReady:function(e,t,n){t&&this.fire("tileerror",{error:t,tile:n,coords:e});var o=this._tileCoordsToKey(e);(n=this._tiles[o])&&(n.loaded=+new Date,this._map._fadeAnimated?(ft(n.el,0),P(this._fadeFrame),this._fadeFrame=k(this._updateOpacity,this)):(n.active=!0,this._pruneTiles()),t||(ut(n.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:n.el,coords:e})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),Q||!this._map._fadeAnimated?k(this._pruneTiles,this):setTimeout(r(this._pruneTiles,this),250)))},_getTilePos:function(e){return e.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(e){var t=new T(this._wrapX?u(e.x,this._wrapX):e.x,this._wrapY?u(e.y,this._wrapY):e.y);return t.z=e.z,t},_pxBoundsToTileRange:function(e){var t=this.getTileSize();return new M(e.min.unscaleBy(t).floor(),e.max.unscaleBy(t).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var e in this._tiles)if(!this._tiles[e].loaded)return!1;return!0}}),tr=er.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1},initialize:function(e,t){this._url=e,(t=p(this,t)).detectRetina&&ke&&t.maxZoom>0&&(t.tileSize=Math.floor(t.tileSize/2),t.zoomReverse?(t.zoomOffset--,t.minZoom++):(t.zoomOffset++,t.maxZoom--),t.minZoom=Math.max(0,t.minZoom)),"string"==typeof t.subdomains&&(t.subdomains=t.subdomains.split("")),te||this.on("tileunload",this._onTileRemove)},setUrl:function(e,t){return this._url===e&&void 0===t&&(t=!0),this._url=e,t||this.redraw(),this},createTile:function(e,t){var n=document.createElement("img");return kt(n,"load",r(this._tileOnLoad,this,t,n)),kt(n,"error",r(this._tileOnError,this,t,n)),(this.options.crossOrigin||""===this.options.crossOrigin)&&(n.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),n.alt="",n.setAttribute("role","presentation"),n.src=this.getTileUrl(e),n},getTileUrl:function(e){var n={r:ke?"@2x":"",s:this._getSubdomain(e),x:e.x,y:e.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var r=this._globalTileRange.max.y-e.y;this.options.tms&&(n.y=r),n["-y"]=r}return y(this._url,t(n,this.options))},_tileOnLoad:function(e,t){Q?setTimeout(r(e,this,null,t),0):e(null,t)},_tileOnError:function(e,t,n){var r=this.options.errorTileUrl;r&&t.getAttribute("src")!==r&&(t.src=r),e(n,t)},_onTileRemove:function(e){e.tile.onload=null},_getZoomForUrl:function(){var e=this._tileZoom,t=this.options.maxZoom;return this.options.zoomReverse&&(e=t-e),e+this.options.zoomOffset},_getSubdomain:function(e){var t=Math.abs(e.x+e.y)%this.options.subdomains.length;return this.options.subdomains[t]},_abortLoading:function(){var e,t;for(e in this._tiles)this._tiles[e].coords.z!==this._tileZoom&&((t=this._tiles[e].el).onload=l,t.onerror=l,t.complete||(t.src=v,nt(t),delete this._tiles[e]))},_removeTile:function(e){var t=this._tiles[e];if(t)return oe||t.el.setAttribute("src",v),er.prototype._removeTile.call(this,e)},_tileReady:function(e,t,n){if(this._map&&(!n||n.getAttribute("src")!==v))return er.prototype._tileReady.call(this,e,t,n)}});function nr(e,t){return new tr(e,t)}var rr=tr.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(e,n){this._url=e;var r=t({},this.defaultWmsParams);for(var o in n)o in this.options||(r[o]=n[o]);var i=(n=p(this,n)).detectRetina&&ke?2:1,a=this.getTileSize();r.width=a.x*i,r.height=a.y*i,this.wmsParams=r},onAdd:function(e){this._crs=this.options.crs||e.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var t=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[t]=this._crs.code,tr.prototype.onAdd.call(this,e)},getTileUrl:function(e){var t=this._tileCoordsToNwSe(e),n=this._crs,r=A(n.project(t[0]),n.project(t[1])),o=r.min,i=r.max,a=(this._wmsVersion>=1.3&&this._crs===_n?[o.y,o.x,i.y,i.x]:[o.x,o.y,i.x,i.y]).join(","),u=tr.prototype.getTileUrl.call(this,e);return u+d(this.wmsParams,u,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+a},setParams:function(e,n){return t(this.wmsParams,e),n||this.redraw(),this}});tr.WMS=rr,nr.wms=function(e,t){return new rr(e,t)};var or=Sn.extend({options:{padding:.1,tolerance:0},initialize:function(e){p(this,e),i(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),this._zoomAnimated&&ut(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var e={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(e.zoomanim=this._onAnimZoom),e},_onAnimZoom:function(e){this._updateTransform(e.center,e.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(e,t){var n=this._map.getZoomScale(t,this._zoom),r=yt(this._container),o=this._map.getSize().multiplyBy(.5+this.options.padding),i=this._map.project(this._center,t),a=this._map.project(e,t).subtract(i),u=o.multiplyBy(-n).add(r).add(o).subtract(a);ye?dt(this._container,u,n):ht(this._container,u)},_reset:function(){for(var e in this._update(),this._updateTransform(this._center,this._zoom),this._layers)this._layers[e]._reset()},_onZoomEnd:function(){for(var e in this._layers)this._layers[e]._project()},_updatePaths:function(){for(var e in this._layers)this._layers[e]._update()},_update:function(){var e=this.options.padding,t=this._map.getSize(),n=this._map.containerPointToLayerPoint(t.multiplyBy(-e)).round();this._bounds=new M(n,n.add(t.multiplyBy(1+2*e)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),ir=or.extend({getEvents:function(){var e=or.prototype.getEvents.call(this);return e.viewprereset=this._onViewPreReset,e},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){or.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var e=this._container=document.createElement("canvas");kt(e,"mousemove",this._onMouseMove,this),kt(e,"click dblclick mousedown mouseup contextmenu",this._onClick,this),kt(e,"mouseout",this._handleMouseOut,this),this._ctx=e.getContext("2d")},_destroyContainer:function(){P(this._redrawRequest),delete this._ctx,nt(this._container),jt(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){for(var e in this._redrawBounds=null,this._layers)this._layers[e]._update();this._redraw()}},_update:function(){if(!this._map._animatingZoom||!this._bounds){or.prototype._update.call(this);var e=this._bounds,t=this._container,n=e.getSize(),r=ke?2:1;ht(t,e.min),t.width=r*n.x,t.height=r*n.y,t.style.width=n.x+"px",t.style.height=n.y+"px",ke&&this._ctx.scale(2,2),this._ctx.translate(-e.min.x,-e.min.y),this.fire("update")}},_reset:function(){or.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(e){this._updateDashArray(e),this._layers[i(e)]=e;var t=e._order={layer:e,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=t),this._drawLast=t,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(e){this._requestRedraw(e)},_removePath:function(e){var t=e._order,n=t.next,r=t.prev;n?n.prev=r:this._drawLast=r,r?r.next=n:this._drawFirst=n,delete e._order,delete this._layers[i(e)],this._requestRedraw(e)},_updatePath:function(e){this._extendRedrawBounds(e),e._project(),e._update(),this._requestRedraw(e)},_updateStyle:function(e){this._updateDashArray(e),this._requestRedraw(e)},_updateDashArray:function(e){if("string"==typeof e.options.dashArray){var t,n,r=e.options.dashArray.split(/[, ]+/),o=[];for(n=0;n')}}catch(e){return function(e){return document.createElement("<"+e+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}}(),lr={_initContainer:function(){this._container=tt("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(or.prototype._update.call(this),this.fire("update"))},_initPath:function(e){var t=e._container=ur("shape");ut(t,"leaflet-vml-shape "+(this.options.className||"")),t.coordsize="1 1",e._path=ur("path"),t.appendChild(e._path),this._updateStyle(e),this._layers[i(e)]=e},_addPath:function(e){var t=e._container;this._container.appendChild(t),e.options.interactive&&e.addInteractiveTarget(t)},_removePath:function(e){var t=e._container;nt(t),e.removeInteractiveTarget(t),delete this._layers[i(e)]},_updateStyle:function(e){var t=e._stroke,n=e._fill,r=e.options,o=e._container;o.stroked=!!r.stroke,o.filled=!!r.fill,r.stroke?(t||(t=e._stroke=ur("stroke")),o.appendChild(t),t.weight=r.weight+"px",t.color=r.color,t.opacity=r.opacity,r.dashArray?t.dashStyle=m(r.dashArray)?r.dashArray.join(" "):r.dashArray.replace(/( *, *)/g," "):t.dashStyle="",t.endcap=r.lineCap.replace("butt","flat"),t.joinstyle=r.lineJoin):t&&(o.removeChild(t),e._stroke=null),r.fill?(n||(n=e._fill=ur("fill")),o.appendChild(n),n.color=r.fillColor||r.color,n.opacity=r.fillOpacity):n&&(o.removeChild(n),e._fill=null)},_updateCircle:function(e){var t=e._point.round(),n=Math.round(e._radius),r=Math.round(e._radiusY||n);this._setPath(e,e._empty()?"M0 0":"AL "+t.x+","+t.y+" "+n+","+r+" 0,23592600")},_setPath:function(e,t){e._path.v=t},_bringToFront:function(e){ot(e._container)},_bringToBack:function(e){it(e._container)}},sr=Ce?ur:$,cr=or.extend({getEvents:function(){var e=or.prototype.getEvents.call(this);return e.zoomstart=this._onZoomStart,e},_initContainer:function(){this._container=sr("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=sr("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){nt(this._container),jt(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_onZoomStart:function(){this._update()},_update:function(){if(!this._map._animatingZoom||!this._bounds){or.prototype._update.call(this);var e=this._bounds,t=e.getSize(),n=this._container;this._svgSize&&this._svgSize.equals(t)||(this._svgSize=t,n.setAttribute("width",t.x),n.setAttribute("height",t.y)),ht(n,e.min),n.setAttribute("viewBox",[e.min.x,e.min.y,t.x,t.y].join(" ")),this.fire("update")}},_initPath:function(e){var t=e._path=sr("path");e.options.className&&ut(t,e.options.className),e.options.interactive&&ut(t,"leaflet-interactive"),this._updateStyle(e),this._layers[i(e)]=e},_addPath:function(e){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(e._path),e.addInteractiveTarget(e._path)},_removePath:function(e){nt(e._path),e.removeInteractiveTarget(e._path),delete this._layers[i(e)]},_updatePath:function(e){e._project(),e._update()},_updateStyle:function(e){var t=e._path,n=e.options;t&&(n.stroke?(t.setAttribute("stroke",n.color),t.setAttribute("stroke-opacity",n.opacity),t.setAttribute("stroke-width",n.weight),t.setAttribute("stroke-linecap",n.lineCap),t.setAttribute("stroke-linejoin",n.lineJoin),n.dashArray?t.setAttribute("stroke-dasharray",n.dashArray):t.removeAttribute("stroke-dasharray"),n.dashOffset?t.setAttribute("stroke-dashoffset",n.dashOffset):t.removeAttribute("stroke-dashoffset")):t.setAttribute("stroke","none"),n.fill?(t.setAttribute("fill",n.fillColor||n.color),t.setAttribute("fill-opacity",n.fillOpacity),t.setAttribute("fill-rule",n.fillRule||"evenodd")):t.setAttribute("fill","none"))},_updatePoly:function(e,t){this._setPath(e,G(e._parts,t))},_updateCircle:function(e){var t=e._point,n=Math.max(Math.round(e._radius),1),r="a"+n+","+(Math.max(Math.round(e._radiusY),1)||n)+" 0 1,0 ",o=e._empty()?"M0 0":"M"+(t.x-n)+","+t.y+r+2*n+",0 "+r+2*-n+",0 ";this._setPath(e,o)},_setPath:function(e,t){e._path.setAttribute("d",t)},_bringToFront:function(e){ot(e._path)},_bringToBack:function(e){it(e._path)}});function fr(e){return Ee||Ce?new cr(e):null}Ce&&cr.include(lr),Ut.include({getRenderer:function(e){var t=e.options.renderer||this._getPaneRenderer(e.options.pane)||this.options.renderer||this._renderer;return t||(t=this._renderer=this._createRenderer()),this.hasLayer(t)||this.addLayer(t),t},_getPaneRenderer:function(e){if("overlayPane"===e||void 0===e)return!1;var t=this._paneRenderers[e];return void 0===t&&(t=this._createRenderer({pane:e}),this._paneRenderers[e]=t),t},_createRenderer:function(e){return this.options.preferCanvas&&ar(e)||fr(e)}});var pr=An.extend({initialize:function(e,t){An.prototype.initialize.call(this,this._boundsToLatLngs(e),t)},setBounds:function(e){return this.setLatLngs(this._boundsToLatLngs(e))},_boundsToLatLngs:function(e){return[(e=z(e)).getSouthWest(),e.getNorthWest(),e.getNorthEast(),e.getSouthEast()]}});cr.create=sr,cr.pointsToPath=G,Ln.geometryToLayer=In,Ln.coordsToLatLng=Fn,Ln.coordsToLatLngs=Yn,Ln.latLngToCoords=Nn,Ln.latLngsToCoords=Bn,Ln.getFeature=Hn,Ln.asFeature=Vn,Ut.mergeOptions({boxZoom:!0});var dr=Qt.extend({initialize:function(e){this._map=e,this._container=e._container,this._pane=e._panes.overlayPane,this._resetStateTimeout=0,e.on("unload",this._destroy,this)},addHooks:function(){kt(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){jt(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){nt(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){0!==this._resetStateTimeout&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(e){if(!e.shiftKey||1!==e.which&&1!==e.button)return!1;this._clearDeferredResetState(),this._resetState(),He(),bt(),this._startPoint=this._map.mouseEventToContainerPoint(e),kt(document,{contextmenu:Lt,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(e){this._moved||(this._moved=!0,this._box=tt("div","leaflet-zoom-box",this._container),ut(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(e);var t=new M(this._point,this._startPoint),n=t.getSize();ht(this._box,t.min),this._box.style.width=n.x+"px",this._box.style.height=n.y+"px"},_finish:function(){this._moved&&(nt(this._box),lt(this._container,"leaflet-crosshair")),Ve(),vt(),jt(document,{contextmenu:Lt,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(e){if((1===e.which||1===e.button)&&(this._finish(),this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(r(this._resetState,this),0);var t=new I(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(t).fire("boxzoomend",{boxZoomBounds:t})}},_onKeyDown:function(e){27===e.keyCode&&this._finish()}});Ut.addInitHook("addHandler","boxZoom",dr),Ut.mergeOptions({doubleClickZoom:!0});var hr=Qt.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(e){var t=this._map,n=t.getZoom(),r=t.options.zoomDelta,o=e.originalEvent.shiftKey?n-r:n+r;"center"===t.options.doubleClickZoom?t.setZoom(o):t.setZoomAround(e.containerPoint,o)}});Ut.addInitHook("addHandler","doubleClickZoom",hr),Ut.mergeOptions({dragging:!0,inertia:!ne,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var yr=Qt.extend({addHooks:function(){if(!this._draggable){var e=this._map;this._draggable=new on(e._mapPane,e._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),e.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),e.on("zoomend",this._onZoomEnd,this),e.whenReady(this._onZoomEnd,this))}ut(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){lt(this._map._container,"leaflet-grab"),lt(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var e=this._map;if(e._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var t=z(this._map.options.maxBounds);this._offsetLimit=A(this._map.latLngToContainerPoint(t.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(t.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;e.fire("movestart").fire("dragstart"),e.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(e){if(this._map.options.inertia){var t=this._lastTime=+new Date,n=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(n),this._times.push(t),this._prunePositions(t)}this._map.fire("move",e).fire("drag",e)},_prunePositions:function(e){for(;this._positions.length>1&&e-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var e=this._map.getSize().divideBy(2),t=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=t.subtract(e).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(e,t){return e-(e-t)*this._viscosity},_onPreDragLimit:function(){if(this._viscosity&&this._offsetLimit){var e=this._draggable._newPos.subtract(this._draggable._startPos),t=this._offsetLimit;e.xt.max.x&&(e.x=this._viscousLimit(e.x,t.max.x)),e.y>t.max.y&&(e.y=this._viscousLimit(e.y,t.max.y)),this._draggable._newPos=this._draggable._startPos.add(e)}},_onPreDragWrap:function(){var e=this._worldWidth,t=Math.round(e/2),n=this._initialWorldOffset,r=this._draggable._newPos.x,o=(r-t+n)%e+t-n,i=(r+t+n)%e-t-n,a=Math.abs(o+n)0?i:-i))-t;this._delta=0,this._startTime=null,a&&("center"===e.options.scrollWheelZoom?e.setZoom(t+a):e.setZoomAround(this._lastMousePos,t+a))}});Ut.addInitHook("addHandler","scrollWheelZoom",br),Ut.mergeOptions({tap:!0,tapTolerance:15});var vr=Qt.extend({addHooks:function(){kt(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){jt(this._map._container,"touchstart",this._onDown,this)},_onDown:function(e){if(e.touches){if(At(e),this._fireClick=!0,e.touches.length>1)return this._fireClick=!1,void clearTimeout(this._holdTimeout);var t=e.touches[0],n=t.target;this._startPos=this._newPos=new T(t.clientX,t.clientY),n.tagName&&"a"===n.tagName.toLowerCase()&&ut(n,"leaflet-active"),this._holdTimeout=setTimeout(r((function(){this._isTapValid()&&(this._fireClick=!1,this._onUp(),this._simulateEvent("contextmenu",t))}),this),1e3),this._simulateEvent("mousedown",t),kt(document,{touchmove:this._onMove,touchend:this._onUp},this)}},_onUp:function(e){if(clearTimeout(this._holdTimeout),jt(document,{touchmove:this._onMove,touchend:this._onUp},this),this._fireClick&&e&&e.changedTouches){var t=e.changedTouches[0],n=t.target;n&&n.tagName&&"a"===n.tagName.toLowerCase()&<(n,"leaflet-active"),this._simulateEvent("mouseup",t),this._isTapValid()&&this._simulateEvent("click",t)}},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_onMove:function(e){var t=e.touches[0];this._newPos=new T(t.clientX,t.clientY),this._simulateEvent("mousemove",t)},_simulateEvent:function(e,t){var n=document.createEvent("MouseEvents");n._simulated=!0,t.target._simulatedClick=!0,n.initMouseEvent(e,!0,!0,window,1,t.screenX,t.screenY,t.clientX,t.clientY,!1,!1,!1,!1,0,null),t.target.dispatchEvent(n)}});!_e||we&&!le||Ut.addInitHook("addHandler","tap",vr),Ut.mergeOptions({touchZoom:_e&&!ne,bounceAtZoomLimits:!0});var gr=Qt.extend({addHooks:function(){ut(this._map._container,"leaflet-touch-zoom"),kt(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){lt(this._map._container,"leaflet-touch-zoom"),jt(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(e){var t=this._map;if(e.touches&&2===e.touches.length&&!t._animatingZoom&&!this._zooming){var n=t.mouseEventToContainerPoint(e.touches[0]),r=t.mouseEventToContainerPoint(e.touches[1]);this._centerPoint=t.getSize()._divideBy(2),this._startLatLng=t.containerPointToLatLng(this._centerPoint),"center"!==t.options.touchZoom&&(this._pinchStartLatLng=t.containerPointToLatLng(n.add(r)._divideBy(2))),this._startDist=n.distanceTo(r),this._startZoom=t.getZoom(),this._moved=!1,this._zooming=!0,t._stop(),kt(document,"touchmove",this._onTouchMove,this),kt(document,"touchend",this._onTouchEnd,this),At(e)}},_onTouchMove:function(e){if(e.touches&&2===e.touches.length&&this._zooming){var t=this._map,n=t.mouseEventToContainerPoint(e.touches[0]),o=t.mouseEventToContainerPoint(e.touches[1]),i=n.distanceTo(o)/this._startDist;if(this._zoom=t.getScaleZoom(i,this._startZoom),!t.options.bounceAtZoomLimits&&(this._zoomt.getMaxZoom()&&i>1)&&(this._zoom=t._limitZoom(this._zoom)),"center"===t.options.touchZoom){if(this._center=this._startLatLng,1===i)return}else{var a=n._add(o)._divideBy(2)._subtract(this._centerPoint);if(1===i&&0===a.x&&0===a.y)return;this._center=t.unproject(t.project(this._pinchStartLatLng,this._zoom).subtract(a),this._zoom)}this._moved||(t._moveStart(!0,!1),this._moved=!0),P(this._animRequest);var u=r(t._move,t,this._center,this._zoom,{pinch:!0,round:!1});this._animRequest=k(u,this,!0),At(e)}},_onTouchEnd:function(){this._moved&&this._zooming?(this._zooming=!1,P(this._animRequest),jt(document,"touchmove",this._onTouchMove,this),jt(document,"touchend",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))):this._zooming=!1}});Ut.addInitHook("addHandler","touchZoom",gr),Ut.BoxZoom=dr,Ut.DoubleClickZoom=hr,Ut.Drag=yr,Ut.Keyboard=mr,Ut.ScrollWheelZoom=br,Ut.Tap=vr,Ut.TouchZoom=gr,e.version="1.7.1",e.Control=qt,e.control=Kt,e.Browser=Te,e.Evented=x,e.Mixin=en,e.Util=j,e.Class=E,e.Handler=Qt,e.extend=t,e.bind=r,e.stamp=i,e.setOptions=p,e.DomEvent=Vt,e.DomUtil=St,e.PosAnimation=Wt,e.Draggable=on,e.LineUtil=hn,e.PolyUtil=mn,e.Point=T,e.point=R,e.Bounds=M,e.bounds=A,e.Transformation=W,e.transformation=U,e.Projection=gn,e.LatLng=F,e.latLng=Y,e.LatLngBounds=I,e.latLngBounds=z,e.CRS=B,e.GeoJSON=Ln,e.geoJSON=Un,e.geoJson=qn,e.Layer=Sn,e.LayerGroup=kn,e.layerGroup=function(e,t){return new kn(e,t)},e.FeatureGroup=Pn,e.featureGroup=function(e,t){return new Pn(e,t)},e.ImageOverlay=Kn,e.imageOverlay=function(e,t,n){return new Kn(e,t,n)},e.VideoOverlay=$n,e.videoOverlay=function(e,t,n){return new $n(e,t,n)},e.SVGOverlay=Gn,e.svgOverlay=function(e,t,n){return new Gn(e,t,n)},e.DivOverlay=Zn,e.Popup=Jn,e.popup=function(e,t){return new Jn(e,t)},e.Tooltip=Qn,e.tooltip=function(e,t){return new Qn(e,t)},e.Icon=jn,e.icon=function(e){return new jn(e)},e.DivIcon=Xn,e.divIcon=function(e){return new Xn(e)},e.Marker=xn,e.marker=function(e,t){return new xn(e,t)},e.TileLayer=tr,e.tileLayer=nr,e.GridLayer=er,e.gridLayer=function(e){return new er(e)},e.SVG=cr,e.svg=fr,e.Renderer=or,e.Canvas=ir,e.canvas=ar,e.Path=Tn,e.CircleMarker=Dn,e.circleMarker=function(e,t){return new Dn(e,t)},e.Circle=Rn,e.circle=function(e,t,n){return new Rn(e,t,n)},e.Polyline=Mn,e.polyline=function(e,t){return new Mn(e,t)},e.Polygon=An,e.polygon=function(e,t){return new An(e,t)},e.Rectangle=pr,e.rectangle=function(e,t){return new pr(e,t)},e.Map=Ut,e.map=function(e,t){return new Ut(e,t)};var wr=window.L;e.noConflict=function(){return window.L=wr,this},window.L=e}(t)},function(e,t,n){e.exports={navigation:"navigation--1TPKGVcdtJ",header:"header--1yYASq55gP","header-content":"header-content--3q2ACaykun",headerContent:"header-content--3q2ACaykun","header-icon":"header-icon--3slb78kEn1",headerIcon:"header-icon--3slb78kEn1","header-title":"header-title--3llLneBogU",headerTitle:"header-title--3llLneBogU",user:"user--1yh8_EoOW4","user-content":"user-content--1HWDvaZ5qI",userContent:"user-content--1HWDvaZ5qI","no-user-image":"no-user-image--2r0uxVSaEY",noUserImage:"no-user-image--2r0uxVSaEY","user-profile":"user-profile--3h8wK9aFMr",userProfile:"user-profile--3h8wK9aFMr",username:"username--1iD-BWgeXO",logout:"logout--3rYtUBtY-s",items:"items--23JrT1L7Qn",footer:"footer--3d3KVHirl9",pin:"pin--1EfeTj0EjG","pin-active":"pin-active--2xYrKut_aI",pinActive:"pin-active--2xYrKut_aI","pin-icon":"pin-icon--2Bs7SKVMJD",pinIcon:"pin-icon--2Bs7SKVMJD",versions:"versions--1zEVIvOm77"}},function(e,t,n){e.exports={input:"input--YrRPhYPmPT",left:"left--3McDXiCrys",center:"center--JXk60IDjWJ",right:"right--pX9XMNaOG9",collapsed:"collapsed--3cKiJ1rgll","has-append-icon":"has-append-icon--pQms0sSnCj",hasAppendIcon:"has-append-icon--pQms0sSnCj",dark:"dark--tc2vktcDJ7",error:"error--1YjDkE4VYd",disabled:"disabled--1cFjjKATa0","prepended-container":"prepended-container--1HLUlo-uAQ",prependedContainer:"prepended-container--1HLUlo-uAQ",icon:"icon--ytM2BXHUpA",headline:"headline--2ofmFMh3Td","append-container":"append-container--260F-W2kJw",appendContainer:"append-container--260F-W2kJw","icon-clickable":"icon-clickable--2i8CXxR-rS",iconClickable:"icon-clickable--2i8CXxR-rS"}},function(e,t,n){e.exports={"media-card":"media-card--3zwVt4x9IY",mediaCard:"media-card--3zwVt4x9IY",checkbox:"checkbox--3fO94jPv5b",selected:"selected--2I8c2zZDkN",header:"header--1GmsmRN8kP","header-click-area":"header-click-area--2YgVRnlEME",headerClickArea:"header-click-area--2YgVRnlEME",description:"description--KIscyejKfD","no-download-list":"no-download-list--Dd02_LyMg8",noDownloadList:"no-download-list--Dd02_LyMg8","download-button":"download-button--29bmE_WcBM",downloadButton:"download-button--29bmE_WcBM",active:"active--3MvsR-oqxD","ghost-indicator":"ghost-indicator--1_EW3uSSK6",ghostIndicator:"ghost-indicator--1_EW3uSSK6",title:"title--2BoVb9Cwl9",meta:"meta--Lq76ippoF_","title-text":"title-text--1DQCap-AbL",titleText:"title-text--1DQCap-AbL",media:"media--1-OiFQVLjc",cover:"cover--3_DtNQ3fhJ","show-cover":"show-cover--3T0YdhAWC5",showCover:"show-cover--3T0YdhAWC5","media-icon":"media-icon--3lo3oU5U41",mediaIcon:"media-icon--3lo3oU5U41"}},function(e,t){function n(e,t,n){var r,o,i,a,u;function l(){var s=Date.now()-a;s=0?r=setTimeout(l,t-s):(r=null,n||(u=e.apply(i,o),i=o=null))}null==t&&(t=100);var s=function(){i=this,o=arguments,a=Date.now();var s=n&&!r;return r||(r=setTimeout(l,t)),s&&(u=e.apply(i,o),i=o=null),u};return s.clear=function(){r&&(clearTimeout(r),r=null)},s.flush=function(){r&&(u=e.apply(i,o),i=o=null,clearTimeout(r),r=null)},s}n.debounce=n,e.exports=n},function(e,t,n){e.exports={"edit-form":"edit-form--nxK2xbxTj_",editForm:"edit-form--nxK2xbxTj_",form:"form--1u86V3nB4Y","media-column":"media-column--1rlxVEqxfN",mediaColumn:"media-column--1rlxVEqxfN","media-button":"media-button--242y4MFzfr",mediaButton:"media-button--242y4MFzfr","media-button-edit-icon":"media-button-edit-icon--22_pNpdNWh",mediaButtonEditIcon:"media-button-edit-icon--22_pNpdNWh","media-button-icon":"media-button-icon--2jrmYJLxGn",mediaButtonIcon:"media-button-icon--2jrmYJLxGn","title-input":"title-input--1dN4wONatr",titleInput:"title-input--1dN4wONatr","description-text-area":"description-text-area--NcKuq5NJ3G",descriptionTextArea:"description-text-area--NcKuq5NJ3G",buttons:"buttons--1mapRd_g0a",item:"item--2Ik0bJ0TWt",media:"media--3hQPdb-uXy",title:"title--2x9BbBTKTw",content:"content--3874kh7Wj0",description:"description--1KwBL0sb0j",type:"type--174ojyRJQN"}},function(e,t,n){e.exports={loader:"loader--2gdHZwemxA",root:"root--1xK2HnF3xf",visible:"visible--2-6zspTYQo","navigation-visible":"navigation-visible--2Y0-ThvmLG",navigationVisible:"navigation-visible--2Y0-ThvmLG",content:"content--2IfnEOTquo","with-pinned-navigation":"with-pinned-navigation--2VG8fUyABf",withPinnedNavigation:"with-pinned-navigation--2VG8fUyABf","with-sidebar":"with-sidebar--1mIP1_Go4G",withSidebar:"with-sidebar--1mIP1_Go4G","view-container":"view-container--3-uqYBnaX8",viewContainer:"view-container--3-uqYBnaX8",main:"main--3FrrdgELy2",sidebar:"sidebar--1h00XLaExU",small:"small--3wna2-Mqiy",medium:"medium--3kUvKyrWan",large:"large--3vpSCgRpSZ",navigation:"navigation--1r_Vo8arYt"}},function(e,t,n){e.exports={item:"item--1jtrJ1DYzL",text:"text--3n3NdvKI4C",active:"active--2idn-n2E2S",disabled:"disabled--1gI6QpUX0i",children:"children--7PRJYI6aBE",button:"button--2Fzrhq4BJX",visible:"visible--38dPT7rEGr",buttons:"buttons--1YMVp7Syw2",selected:"selected--34PSNwf2M_",indicator:"indicator--FffGEQh1l8","order-input":"order-input--nidbwm3RYU",orderInput:"order-input--nidbwm3RYU"}},function(e,t,n){e.exports={"media-container":"media-container--24xVCfsRYi",mediaContainer:"media-container--24xVCfsRYi","upload-indicator":"upload-indicator--1AR-kLZKnw",uploadIndicator:"upload-indicator--1AR-kLZKnw","show-upload-indicator":"show-upload-indicator--1T2VN-fo7m",showUploadIndicator:"show-upload-indicator--1T2VN-fo7m",disabled:"disabled--2DUBSGKHYW",progressbar:"progressbar--1ttu1M8akg","upload-indicator-container":"upload-indicator-container--jnVNyT85Go",uploadIndicatorContainer:"upload-indicator-container--jnVNyT85Go","mime-type-indicator":"mime-type-indicator--21ALKYDVwQ",mimeTypeIndicator:"mime-type-indicator--21ALKYDVwQ","empty-indicator":"empty-indicator--3RlQcJQgHp",emptyIndicator:"empty-indicator--3RlQcJQgHp","upload-icon":"upload-icon--3R_c-DlUGT",uploadIcon:"upload-icon--3R_c-DlUGT","upload-info-text":"upload-info-text--Ijzo9z9dY5",uploadInfoText:"upload-info-text--Ijzo9z9dY5",thumbnail:"thumbnail--2MX4oCKfh5",round:"round--7c0ME6Lf-H"}},function(e,t,n){e.exports={block:"block---lmRUaoC4J",expanded:"expanded--1OAMnWu3Nh",children:"children--2vr78c8PWl",header:"header--3Z6dsPKDx6",icons:"icons--3gZEnEY5xT",handle:"handle--DUvm6RDJgb",content:"content--Q--ddExW3x",types:"types--3BMYLuVPAf",type:"type--3zGitGam6V","icon-buttons":"icon-buttons--t5ZAGX2N0A",iconButtons:"icon-buttons--t5ZAGX2N0A"}},function(e,t){var n=Array.isArray;e.exports=n},function(e,t,n){var r; /*! Copyright (c) 2017 Jed Watson. Licensed under the MIT License (MIT), see @@ -427,7 +427,7 @@ var r;r=function(){return function(e){var t={};function n(r){if(t[r])return t[r] * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */function Ae(e){return(Ae="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Le(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ie(e,t){for(var n=0;n6?u-6:0),s=6;s>",a=a||r,null==n[r]){if(t){var u=null===n[r]?"null":"undefined";return new Error("The "+i+" `"+a+"` is marked as required in `"+o+"`, but its value is `"+u+"`.")}return null}return e.apply(void 0,[n,r,o,i,a].concat(l))}))}var n=t.bind(null,!1);return n.isRequired=t.bind(null,!0),n}function ot(e){var t=Ae(e);return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}(t,e)?"symbol":t}function it(e,t){return rt((function(n,r,o,i,a){return Object(v.v)((function(){if(e&&ot(n[r])===t.toLowerCase())return null;var i;switch(t){case"Array":i=v.n;break;case"Object":i=v.p;break;case"Map":i=v.o;break;default:throw new Error("Unexpected mobxType: ".concat(t))}var u=n[r];if(!i(u)){var l=function(e){var t=ot(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}(u),s=e?" or javascript `"+t.toLowerCase()+"`":"";return new Error("Invalid prop `"+a+"` of type `"+l+"` supplied to `"+o+"`, expected `mobx.Observable"+t+"`"+s+".")}return null}))}))}function at(e,t){return rt((function(n,r,o,i,a){for(var u=arguments.length,l=new Array(u>5?u-5:0),s=5;s2?r-2:0),i=2;i2?r-2:0),i=2;i",o=this._reactInternalInstance&&this._reactInternalInstance._rootNodeID||this._reactInternalInstance&&this._reactInternalInstance._debugID||this._reactInternalFiber&&this._reactInternalFiber._debugID;Mt(this,Tt,!1),Mt(this,Dt,!1);var i=e.bind(this),a=!1,u=new v.b("".concat(r,"#").concat(o,".render()"),(function(){if(!a&&(a=!0,"function"==typeof t.componentWillReact&&t.componentWillReact(),!0!==t[kt])){var e=!0;try{Mt(t,Dt,!0),t[Tt]||h.Component.prototype.forceUpdate.call(t),e=!1}finally{Mt(t,Dt,!1),e&&u.dispose()}}}));return u.reactComponent=this,n[St]=u,this.render=n,n.call(this)}var Nt={componentWillUnmount:function(){if(!0!==jt&&(this.render[St]&&this.render[St].dispose(),this[kt]=!0,Pt)){var e=At(this);e&&Ct&&Ct.delete(e),xt.emit({event:"destroy",component:this,node:e})}},componentDidMount:function(){Pt&&Lt(this)},componentDidUpdate:function(){Pt&&Lt(this)},shouldComponentUpdate:function(e,t){return jt&&console.warn("[mobx-react] It seems that a re-rendering of a React component is triggered while in static (server-side) mode. Please make sure components are rendered only once server-side."),this.state!==t||!zt(this.props,e)}};function Bt(e,t){var n=ct("reactProp_".concat(t,"_valueHolder")),r=ct("reactProp_".concat(t,"_atomHolder"));function o(){return this[r]||Mt(this,r,Object(v.i)("reactive "+t)),this[r]}Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:function(){return o.call(this).reportObserved(),this[n]},set:function(e){this[Dt]||zt(this[n],e)?Mt(this,n,e):(Mt(this,n,e),Mt(this,Tt,!0),o.call(this).reportChanged(),Mt(this,Tt,!1))}})}function Ht(e,t){if("string"==typeof e)throw new Error("Store names should be provided as array");if(Array.isArray(e))return Et||(Et=!0,console.warn('Mobx observer: Using observer to inject stores is deprecated since 4.0. Use `@inject("store1", "store2") @observer ComponentClass` or `inject("store1", "store2")(observer(componentClass))` instead of `@observer(["store1", "store2"]) ComponentClass`')),t?Ot.apply(null,e)(Ht(t)):function(t){return Ht(e,t)};var n=e;if(!0===n.isMobxInjector&&console.warn("Mobx observer: You are trying to use 'observer' on a component that already has 'inject'. Please apply 'observer' before applying 'inject'"),n.__proto__===h.PureComponent&&console.warn("Mobx observer: You are using 'observer' on React.PureComponent. These two achieve two opposite goals and should not be used together"),Rt&&n.$$typeof===Rt){var r=n.render;if("function"!=typeof r)throw new Error("render property of ForwardRef was not a function");return Object(h.forwardRef)((function(){var e=arguments;return y.a.createElement(Vt,null,(function(){return r.apply(void 0,e)}))}))}if(!("function"!=typeof n||n.prototype&&n.prototype.render||n.isReactClass||h.Component.isPrototypeOf(n))){var o,i,a=Ht((i=o=function(e){function t(){return Le(this,t),He(this,Ne(t).apply(this,arguments))}return Ye(t,e),ze(t,[{key:"render",value:function(){return n.call(this,this.props,this.context)}}]),t}(h.Component),o.displayName=n.displayName||n.name,o.contextTypes=n.contextTypes,o.propTypes=n.propTypes,o.defaultProps=n.defaultProps,i));return tt(a,n),a}if(!n)throw new Error("Please pass a valid component to 'observer'");var u=n.prototype||n;!function(e){["componentDidMount","componentWillUnmount","componentDidUpdate"].forEach((function(t){!function(e,t){mt(e,t,Nt[t])}(e,t)})),e.shouldComponentUpdate?e.shouldComponentUpdate!==Nt.shouldComponentUpdate&&console.warn("Use `shouldComponentUpdate` in an `observer` based component breaks the behavior of `observer` and might lead to unexpected results. Manually implementing `sCU` should not be needed when using mobx-react."):e.shouldComponentUpdate=Nt.shouldComponentUpdate}(u),n.isMobXReactObserver=!0,Bt(u,"props"),Bt(u,"state");var l=u.render;return u.render=function(){return Yt.call(this,l)},n}var Vt=Ht((function(e){var t=e.children,n=e.inject,r=e.render,o=t||r;if(void 0===o)return null;if(!n)return o();console.warn(" is no longer supported. Please use inject on the enclosing component instead");var i=Ot(n)(o);return y.a.createElement(i,null)}));Vt.displayName="Observer";var Wt=function(e,t,n,r,o){var i="children"===t?"render":"children";return"function"==typeof e[t]&&"function"==typeof e[i]?new Error("Invalid prop,do not use children and render in the same time in`"+n):"function"!=typeof e[t]&&"function"!=typeof e[i]?new Error("Invalid prop `"+o+"` of type `"+Ae(e[t])+"` supplied to `"+n+"`, expected `function`."):void 0};function Ut(){var e=this.constructor.getDerivedStateFromProps(this.props,this.state);null!=e&&this.setState(e)}function qt(e){this.setState(function(t){var n=this.constructor.getDerivedStateFromProps(e,t);return null!=n?n:null}.bind(this))}function Kt(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}}Vt.propTypes={render:Wt,children:Wt},Ut.__suppressDeprecationWarning=!0,qt.__suppressDeprecationWarning=!0,Kt.__suppressDeprecationWarning=!0;var $t={children:!0,key:!0,ref:!0},Gt=function(e){function t(e,n){var r;return Le(this,t),(r=He(this,Ne(t).call(this,e,n))).state={},Zt(e,r.state),r}return Ye(t,e),ze(t,[{key:"render",value:function(){return h.Children.only(this.props.children)}},{key:"getChildContext",value:function(){var e={};return Zt(this.context.mobxStores,e),Zt(this.props,e),{mobxStores:e}}}],[{key:"getDerivedStateFromProps",value:function(e,t){if(!e)return null;if(!t)return e;if(Object.keys(e).filter(Jt).length!==Object.keys(t).filter(Jt).length&&console.warn("MobX Provider: The set of provided stores has changed. Please avoid changing stores as the change might not propagate to all children"),!e.suppressChangedStoreWarning)for(var n in e)Jt(n)&&t[n]!==e[n]&&console.warn("MobX Provider: Provided store '"+n+"' has changed. Please avoid replacing stores as the change might not propagate to all children");return e}}]),t}(h.Component);function Zt(e,t){if(e)for(var n in e)Jt(n)&&(t[n]=e[n])}function Jt(e){return!$t[e]&&"suppressChangedStoreWarning"!==e}Gt.contextTypes={mobxStores:ut},Gt.childContextTypes={mobxStores:ut.isRequired},function(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,o=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?o="componentWillUpdate":"function"==typeof t.UNSAFE_componentWillUpdate&&(o="UNSAFE_componentWillUpdate"),null!==n||null!==r||null!==o){var i=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"+i+" uses "+a+" but also contains the following legacy lifecycles:"+(null!==n?"\n "+n:"")+(null!==r?"\n "+r:"")+(null!==o?"\n "+o:"")+"\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=Ut,t.componentWillReceiveProps=qt),"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=Kt;var u=t.componentDidUpdate;t.componentDidUpdate=function(e,t,n){var r=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:n;u.call(this,e,t,r)}}}(Gt);ct("disposeOnUnmount");if(!h.Component)throw new Error("mobx-react requires React to be available");if(!v.t)throw new Error("mobx-react requires mobx to be available");"function"==typeof m.unstable_batchedUpdates&&Object(v.h)({reactionScheduler:m.unstable_batchedUpdates});if("object"===("undefined"==typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__?"undefined":Ae(__MOBX_DEVTOOLS_GLOBAL_HOOK__))){var Qt={spy:v.t,extras:{getDebugName:v.k}},Xt={renderReporter:xt,componentByNodeRegistry:Ct,componentByNodeRegistery:Ct,trackComponents:function(){if("undefined"==typeof WeakMap)throw new Error("[mobx-react] tracking components is not supported in this browser.");Pt||(Pt=!0)}};__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobxReact(Xt,Qt)}var en=n(4),tn=n.n(en),nn=(n(488),n(489),n(377)),rn=n.n(nn);function on(e){return(on="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function an(){return(an=Object.assign||function(e){for(var t=1;t0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function nr(){for(var e=[],t=0;t1)throw new RangeError("Fraction-precision stems only accept a single optional option");o.stem.replace(mr,(function(e,n,r,o,i,a){return"*"===r?t.minimumFractionDigits=n.length:o&&"#"===o[0]?t.maximumFractionDigits=o.length:i&&a?(t.minimumFractionDigits=i.length,t.maximumFractionDigits=i.length+a.length):(t.minimumFractionDigits=n.length,t.maximumFractionDigits=n.length),""})),o.options.length&&(t=Qn(Qn({},t),vr(o.options[0])))}else if(br.test(o.stem))t=Qn(Qn({},t),vr(o.stem));else{var i=gr(o.stem);i&&(t=Qn(Qn({},t),i))}}return t}var Or=function(e){function t(n,r,o,i){var a=e.call(this)||this;return a.message=n,a.expected=r,a.found=o,a.location=i,a.name="SyntaxError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(a,t),a}return Gn(t,e),t.buildMessage=function(e,t){function n(e){return e.charCodeAt(0).toString(16).toUpperCase()}function r(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+n(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+n(e)}))}function o(e){return e.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+n(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+n(e)}))}function i(e){switch(e.type){case"literal":return'"'+r(e.text)+'"';case"class":var t=e.parts.map((function(e){return Array.isArray(e)?o(e[0])+"-"+o(e[1]):o(e)}));return"["+(e.inverted?"^":"")+t+"]";case"any":return"any character";case"end":return"end of input";case"other":return e.description}}return"Expected "+function(e){var t,n,r=e.map(i);if(r.sort(),r.length>0){for(t=1,n=1;t",!1),f=we(">",!1),p=we("1&&"}"===e)},ee=we("\n",!1),te=Oe("argNameOrNumber"),ne=Oe("validTag"),re=Oe("argNumber"),oe=we("0",!1),ie=/^[1-9]/,ae=_e([["1","9"]],!1,!1),ue=/^[0-9]/,le=_e([["0","9"]],!1,!1),se=Oe("argName"),ce=Oe("tagName"),fe=0,pe=0,de=[{line:1,column:1}],he=0,ye=[],me=0;if(void 0!==t.startRule){if(!(t.startRule in o))throw new Error("Can't start parsing from rule \""+t.startRule+'".');i=o[t.startRule]}function be(){return e.substring(pe,fe)}function ve(){return ke(pe,fe)}function ge(e,t){throw function(e,t){return new Or(e,[],"",t)}(e,t=void 0!==t?t:ke(pe,fe))}function we(e,t){return{type:"literal",text:e,ignoreCase:t}}function _e(e,t,n){return{type:"class",parts:e,inverted:t,ignoreCase:n}}function Oe(e){return{type:"other",description:e}}function Se(t){var n,r=de[t];if(r)return r;for(n=t-1;!de[n];)n--;for(r={line:(r=de[n]).line,column:r.column};nhe&&(he=fe,ye=[]),ye.push(e))}function je(e,t,n){return new Or(Or.buildMessage(e,t),e,t,n)}function Ee(){return Ce()}function Ce(){var e,t;for(e=[],t=xe();t!==r;)e.push(t),t=xe();return e}function xe(){var t,n;return t=fe,pe=fe,(!nt?void 0:r)!==r&&(n=function(){var e,t,n,o;me++,(e=Re())===r&&(e=fe,(t=Me())!==r&&(n=Ce())!==r&&(o=Ae())!==r?(pe=e,a=n,(i=t)!==(u=o)&&ge('Mismatch tag "'+i+'" !== "'+u+'"',ve()),t=Qn({type:Zn.tag,value:i,children:a},tt()),e=t):(fe=e,e=r));var i,a,u;me--,e===r&&(t=r,0===me&&Pe(s));return e}())!==r?(pe=t,t=n):(fe=t,t=r),t===r&&(t=function(){var e,t;e=fe,(t=Te())!==r&&(pe=e,n=t,t=Qn({type:Zn.literal,value:n},tt()));var n;return e=t}())===r&&(t=function(){var t,n,o,i;me++,t=fe,123===e.charCodeAt(fe)?(n="{",fe++):(n=r,0===me&&Pe(h));n!==r&&We()!==r&&(o=Ge())!==r&&We()!==r?(125===e.charCodeAt(fe)?(i="}",fe++):(i=r,0===me&&Pe(y)),i!==r?(pe=t,n=function(e){return Qn({type:Zn.argument,value:e},tt())}(o),t=n):(fe=t,t=r)):(fe=t,t=r);me--,t===r&&(n=r,0===me&&Pe(d));return t}())===r&&(t=function(){var t;(t=function(){var t,n,o,i,a,u,l,s,c;t=fe,123===e.charCodeAt(fe)?(n="{",fe++):(n=r,0===me&&Pe(h));n!==r&&We()!==r&&(o=Ge())!==r&&We()!==r?(44===e.charCodeAt(fe)?(i=",",fe++):(i=r,0===me&&Pe(P)),i!==r&&We()!==r?("number"===e.substr(fe,6)?(a="number",fe+=6):(a=r,0===me&&Pe(j)),a!==r&&We()!==r?(u=fe,44===e.charCodeAt(fe)?(l=",",fe++):(l=r,0===me&&Pe(P)),l!==r&&(s=We())!==r&&(c=function(){var t,n,o;t=fe,"::"===e.substr(fe,2)?(n="::",fe+=2):(n=r,0===me&&Pe(S));n!==r&&(o=function(){var e,t,n;if(e=fe,t=[],(n=ze())!==r)for(;n!==r;)t.push(n),n=ze();else t=r;t!==r&&(pe=e,t=Qn({type:0,tokens:o=t,parsedOptions:rt?_r(o):{}},tt()));var o;return e=t}())!==r?(pe=t,t=n=o):(fe=t,t=r);t===r&&(t=fe,pe=fe,Xe.push("numberArgStyle"),(n=(n=!0)?void 0:r)!==r&&(o=Te())!==r?(pe=t,n=k(o),t=n):(fe=t,t=r));return t}())!==r?u=l=[l,s,c]:(fe=u,u=r),u===r&&(u=null),u!==r&&(l=We())!==r?(125===e.charCodeAt(fe)?(s="}",fe++):(s=r,0===me&&Pe(y)),s!==r?(pe=t,n=E(o,a,u),t=n):(fe=t,t=r)):(fe=t,t=r)):(fe=t,t=r)):(fe=t,t=r)):(fe=t,t=r);return t}())===r&&(t=function(){var t,n,o,i,a,u,l,s,c;t=fe,123===e.charCodeAt(fe)?(n="{",fe++):(n=r,0===me&&Pe(h));n!==r&&We()!==r&&(o=Ge())!==r&&We()!==r?(44===e.charCodeAt(fe)?(i=",",fe++):(i=r,0===me&&Pe(P)),i!==r&&We()!==r?("date"===e.substr(fe,4)?(a="date",fe+=4):(a=r,0===me&&Pe(L)),a===r&&("time"===e.substr(fe,4)?(a="time",fe+=4):(a=r,0===me&&Pe(I))),a!==r&&We()!==r?(u=fe,44===e.charCodeAt(fe)?(l=",",fe++):(l=r,0===me&&Pe(P)),l!==r&&(s=We())!==r&&(c=function(){var t,n,o;t=fe,"::"===e.substr(fe,2)?(n="::",fe+=2):(n=r,0===me&&Pe(S));n!==r&&(o=function(){var t,n,o,i;t=fe,n=fe,o=[],(i=Fe())===r&&(i=Ye());if(i!==r)for(;i!==r;)o.push(i),(i=Fe())===r&&(i=Ye());else o=r;n=o!==r?e.substring(n,fe):o;n!==r&&(pe=t,n=Qn({type:1,pattern:a=n,parsedOptions:rt?(u=a,l={},u.replace(yr,(function(e){var t=e.length;switch(e[0]){case"G":l.era=4===t?"long":5===t?"narrow":"short";break;case"y":l.year=2===t?"2-digit":"numeric";break;case"Y":case"u":case"U":case"r":throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");case"q":case"Q":throw new RangeError("`q/Q` (quarter) patterns are not supported");case"M":case"L":l.month=["numeric","2-digit","short","long","narrow"][t-1];break;case"w":case"W":throw new RangeError("`w/W` (week) patterns are not supported");case"d":l.day=["numeric","2-digit"][t-1];break;case"D":case"F":case"g":throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");case"E":l.weekday=4===t?"short":5===t?"narrow":"short";break;case"e":if(t<4)throw new RangeError("`e..eee` (weekday) patterns are not supported");l.weekday=["short","long","narrow","short"][t-4];break;case"c":if(t<4)throw new RangeError("`c..ccc` (weekday) patterns are not supported");l.weekday=["short","long","narrow","short"][t-4];break;case"a":l.hour12=!0;break;case"b":case"B":throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");case"h":l.hourCycle="h12",l.hour=["numeric","2-digit"][t-1];break;case"H":l.hourCycle="h23",l.hour=["numeric","2-digit"][t-1];break;case"K":l.hourCycle="h11",l.hour=["numeric","2-digit"][t-1];break;case"k":l.hourCycle="h24",l.hour=["numeric","2-digit"][t-1];break;case"j":case"J":case"C":throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");case"m":l.minute=["numeric","2-digit"][t-1];break;case"s":l.second=["numeric","2-digit"][t-1];break;case"S":case"A":throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");case"z":l.timeZoneName=t<4?"short":"long";break;case"Z":case"O":case"v":case"V":case"X":case"x":throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead")}return""})),l):{}},tt()));var a,u,l;return t=n}())!==r?(pe=t,t=n=o):(fe=t,t=r);t===r&&(t=fe,pe=fe,Xe.push("dateOrTimeArgStyle"),(n=(n=!0)?void 0:r)!==r&&(o=Te())!==r?(pe=t,n=k(o),t=n):(fe=t,t=r));return t}())!==r?u=l=[l,s,c]:(fe=u,u=r),u===r&&(u=null),u!==r&&(l=We())!==r?(125===e.charCodeAt(fe)?(s="}",fe++):(s=r,0===me&&Pe(y)),s!==r?(pe=t,n=E(o,a,u),t=n):(fe=t,t=r)):(fe=t,t=r)):(fe=t,t=r)):(fe=t,t=r)):(fe=t,t=r);return t}());return t}())===r&&(t=function(){var t,n,o,i,a,u,l,s,c,f,p;t=fe,123===e.charCodeAt(fe)?(n="{",fe++):(n=r,0===me&&Pe(h));if(n!==r)if(We()!==r)if((o=Ge())!==r)if(We()!==r)if(44===e.charCodeAt(fe)?(i=",",fe++):(i=r,0===me&&Pe(P)),i!==r)if(We()!==r)if("plural"===e.substr(fe,6)?(a="plural",fe+=6):(a=r,0===me&&Pe(z)),a===r&&("selectordinal"===e.substr(fe,13)?(a="selectordinal",fe+=13):(a=r,0===me&&Pe(F))),a!==r)if(We()!==r)if(44===e.charCodeAt(fe)?(u=",",fe++):(u=r,0===me&&Pe(P)),u!==r)if(We()!==r)if(l=fe,"offset:"===e.substr(fe,7)?(s="offset:",fe+=7):(s=r,0===me&&Pe(Y)),s!==r&&(c=We())!==r&&(f=Ue())!==r?l=s=[s,c,f]:(fe=l,l=r),l===r&&(l=null),l!==r)if((s=We())!==r){if(c=[],(f=Be())!==r)for(;f!==r;)c.push(f),f=Be();else c=r;c!==r&&(f=We())!==r?(125===e.charCodeAt(fe)?(p="}",fe++):(p=r,0===me&&Pe(y)),p!==r?(pe=t,n=function(e,t,n,r){return Qn({type:Zn.plural,pluralType:"plural"===t?"cardinal":"ordinal",value:e,offset:n?n[2]:0,options:r.reduce((function(e,t){var n=t.id,r=t.value,o=t.location;return n in e&&ge('Duplicate option "'+n+'" in plural element: "'+be()+'"',ve()),e[n]={value:r,location:o},e}),{})},tt())}(o,a,l,c),t=n):(fe=t,t=r)):(fe=t,t=r)}else fe=t,t=r;else fe=t,t=r;else fe=t,t=r;else fe=t,t=r;else fe=t,t=r;else fe=t,t=r;else fe=t,t=r;else fe=t,t=r;else fe=t,t=r;else fe=t,t=r;else fe=t,t=r;else fe=t,t=r;return t}())===r&&(t=function(){var t,n,o,i,a,u,l,s,c;t=fe,123===e.charCodeAt(fe)?(n="{",fe++):(n=r,0===me&&Pe(h));if(n!==r)if(We()!==r)if((o=Ge())!==r)if(We()!==r)if(44===e.charCodeAt(fe)?(i=",",fe++):(i=r,0===me&&Pe(P)),i!==r)if(We()!==r)if("select"===e.substr(fe,6)?(a="select",fe+=6):(a=r,0===me&&Pe(N)),a!==r)if(We()!==r)if(44===e.charCodeAt(fe)?(u=",",fe++):(u=r,0===me&&Pe(P)),u!==r)if(We()!==r){if(l=[],(s=Ne())!==r)for(;s!==r;)l.push(s),s=Ne();else l=r;l!==r&&(s=We())!==r?(125===e.charCodeAt(fe)?(c="}",fe++):(c=r,0===me&&Pe(y)),c!==r?(pe=t,n=function(e,t){return Qn({type:Zn.select,value:e,options:t.reduce((function(e,t){var n=t.id,r=t.value,o=t.location;return n in e&&ge('Duplicate option "'+n+'" in select element: "'+be()+'"',ve()),e[n]={value:r,location:o},e}),{})},tt())}(o,l),t=n):(fe=t,t=r)):(fe=t,t=r)}else fe=t,t=r;else fe=t,t=r;else fe=t,t=r;else fe=t,t=r;else fe=t,t=r;else fe=t,t=r;else fe=t,t=r;else fe=t,t=r;else fe=t,t=r;else fe=t,t=r;return t}())===r&&(t=function(){var t,n;t=fe,35===e.charCodeAt(fe)?(n="#",fe++):(n=r,0===me&&Pe(l));n!==r&&(pe=t,n=Qn({type:Zn.pound},tt()));return t=n}()),t}function Te(){var t,n,o,i;if(t=fe,pe=fe,(n=(n=nt)?void 0:r)!==r){if(o=[],(i=qe())===r&&(i=Ke())===r&&(i=$e())===r&&(60===e.charCodeAt(fe)?(i="<",fe++):(i=r,0===me&&Pe(a))),i!==r)for(;i!==r;)o.push(i),(i=qe())===r&&(i=Ke())===r&&(i=$e())===r&&(60===e.charCodeAt(fe)?(i="<",fe++):(i=r,0===me&&Pe(a)));else o=r;o!==r?(pe=t,t=n=u(o)):(fe=t,t=r)}else fe=t,t=r;if(t===r){if(t=fe,n=[],(o=qe())===r&&(o=Ke())===r&&(o=$e())===r&&(o=De()),o!==r)for(;o!==r;)n.push(o),(o=qe())===r&&(o=Ke())===r&&(o=$e())===r&&(o=De());else n=r;n!==r&&(pe=t,n=u(n)),t=n}return t}function De(){var t,n,o;return t=fe,n=fe,me++,(o=Me())===r&&(o=Ae())===r&&(o=Re()),me--,o===r?n=void 0:(fe=n,n=r),n!==r?(60===e.charCodeAt(fe)?(o="<",fe++):(o=r,0===me&&Pe(a)),o!==r?(pe=t,t=n="<"):(fe=t,t=r)):(fe=t,t=r),t}function Re(){var t,n,o,i,u,l;return t=fe,n=fe,60===e.charCodeAt(fe)?(o="<",fe++):(o=r,0===me&&Pe(a)),o!==r&&(i=Ze())!==r&&(u=We())!==r?("/>"===e.substr(fe,2)?(l="/>",fe+=2):(l=r,0===me&&Pe(c)),l!==r?n=o=[o,i,u,l]:(fe=n,n=r)):(fe=n,n=r),n!==r&&(pe=t,n=function(e){return Qn({type:Zn.literal,value:e.join("")},tt())}(n)),t=n}function Me(){var t,n,o,i;return t=fe,60===e.charCodeAt(fe)?(n="<",fe++):(n=r,0===me&&Pe(a)),n!==r&&(o=Ze())!==r?(62===e.charCodeAt(fe)?(i=">",fe++):(i=r,0===me&&Pe(f)),i!==r?(pe=t,t=n=o):(fe=t,t=r)):(fe=t,t=r),t}function Ae(){var t,n,o,i;return t=fe,"",fe++):(i=r,0===me&&Pe(f)),i!==r?(pe=t,t=n=o):(fe=t,t=r)):(fe=t,t=r),t}function Le(){var t,n,o,i,a;if(me++,t=fe,n=[],o=fe,i=fe,me++,(a=He())===r&&(b.test(e.charAt(fe))?(a=e.charAt(fe),fe++):(a=r,0===me&&Pe(v))),me--,a===r?i=void 0:(fe=i,i=r),i!==r?(e.length>fe?(a=e.charAt(fe),fe++):(a=r,0===me&&Pe(g)),a!==r?o=i=[i,a]:(fe=o,o=r)):(fe=o,o=r),o!==r)for(;o!==r;)n.push(o),o=fe,i=fe,me++,(a=He())===r&&(b.test(e.charAt(fe))?(a=e.charAt(fe),fe++):(a=r,0===me&&Pe(v))),me--,a===r?i=void 0:(fe=i,i=r),i!==r?(e.length>fe?(a=e.charAt(fe),fe++):(a=r,0===me&&Pe(g)),a!==r?o=i=[i,a]:(fe=o,o=r)):(fe=o,o=r);else n=r;return t=n!==r?e.substring(t,fe):n,me--,t===r&&(n=r,0===me&&Pe(m)),t}function Ie(){var t,n,o;return me++,t=fe,47===e.charCodeAt(fe)?(n="/",fe++):(n=r,0===me&&Pe(_)),n!==r&&(o=Le())!==r?(pe=t,t=n=o):(fe=t,t=r),me--,t===r&&(n=r,0===me&&Pe(w)),t}function ze(){var e,t,n,o;if(me++,e=fe,We()!==r)if((t=Le())!==r){for(n=[],o=Ie();o!==r;)n.push(o),o=Ie();n!==r?(pe=e,e=function(e,t){return{stem:e,options:t}}(t,n)):(fe=e,e=r)}else fe=e,e=r;else fe=e,e=r;return me--,e===r&&(r,0===me&&Pe(O)),e}function Fe(){var t,n,o,i;if(t=fe,39===e.charCodeAt(fe)?(n="'",fe++):(n=r,0===me&&Pe(C)),n!==r){if(o=[],(i=qe())===r&&(x.test(e.charAt(fe))?(i=e.charAt(fe),fe++):(i=r,0===me&&Pe(T))),i!==r)for(;i!==r;)o.push(i),(i=qe())===r&&(x.test(e.charAt(fe))?(i=e.charAt(fe),fe++):(i=r,0===me&&Pe(T)));else o=r;o!==r?(39===e.charCodeAt(fe)?(i="'",fe++):(i=r,0===me&&Pe(C)),i!==r?t=n=[n,o,i]:(fe=t,t=r)):(fe=t,t=r)}else fe=t,t=r;if(t===r)if(t=[],(n=qe())===r&&(D.test(e.charAt(fe))?(n=e.charAt(fe),fe++):(n=r,0===me&&Pe(R))),n!==r)for(;n!==r;)t.push(n),(n=qe())===r&&(D.test(e.charAt(fe))?(n=e.charAt(fe),fe++):(n=r,0===me&&Pe(R)));else t=r;return t}function Ye(){var t,n;if(t=[],M.test(e.charAt(fe))?(n=e.charAt(fe),fe++):(n=r,0===me&&Pe(A)),n!==r)for(;n!==r;)t.push(n),M.test(e.charAt(fe))?(n=e.charAt(fe),fe++):(n=r,0===me&&Pe(A));else t=r;return t}function Ne(){var t,n,o,i,a;return t=fe,We()!==r&&(n=Qe())!==r&&We()!==r?(123===e.charCodeAt(fe)?(o="{",fe++):(o=r,0===me&&Pe(h)),o!==r?(pe=fe,Xe.push("select"),(!0?void 0:r)!==r&&(i=Ce())!==r?(125===e.charCodeAt(fe)?(a="}",fe++):(a=r,0===me&&Pe(y)),a!==r?(pe=t,t=function(e,t){return Xe.pop(),Qn({id:e,value:t},tt())}(n,i)):(fe=t,t=r)):(fe=t,t=r)):(fe=t,t=r)):(fe=t,t=r),t}function Be(){var t,n,o,i,a;return t=fe,We()!==r&&(n=function(){var t,n,o,i;return t=fe,n=fe,61===e.charCodeAt(fe)?(o="=",fe++):(o=r,0===me&&Pe(B)),o!==r&&(i=Ue())!==r?n=o=[o,i]:(fe=n,n=r),(t=n!==r?e.substring(t,fe):n)===r&&(t=Qe()),t}())!==r&&We()!==r?(123===e.charCodeAt(fe)?(o="{",fe++):(o=r,0===me&&Pe(h)),o!==r?(pe=fe,Xe.push("plural"),(!0?void 0:r)!==r&&(i=Ce())!==r?(125===e.charCodeAt(fe)?(a="}",fe++):(a=r,0===me&&Pe(y)),a!==r?(pe=t,t=function(e,t){return Xe.pop(),Qn({id:e,value:t},tt())}(n,i)):(fe=t,t=r)):(fe=t,t=r)):(fe=t,t=r)):(fe=t,t=r),t}function He(){var t;return me++,V.test(e.charAt(fe))?(t=e.charAt(fe),fe++):(t=r,0===me&&Pe(W)),me--,t===r&&(r,0===me&&Pe(H)),t}function Ve(){var t;return me++,q.test(e.charAt(fe))?(t=e.charAt(fe),fe++):(t=r,0===me&&Pe(K)),me--,t===r&&(r,0===me&&Pe(U)),t}function We(){var t,n,o;for(me++,t=fe,n=[],o=He();o!==r;)n.push(o),o=He();return t=n!==r?e.substring(t,fe):n,me--,t===r&&(n=r,0===me&&Pe($)),t}function Ue(){var t,n,o,i,a;return me++,t=fe,45===e.charCodeAt(fe)?(n="-",fe++):(n=r,0===me&&Pe(Z)),n===r&&(n=null),n!==r&&(o=Je())!==r?(pe=t,i=n,t=n=(a=o)?i?-a:a:0):(fe=t,t=r),me--,t===r&&(n=r,0===me&&Pe(G)),t}function qe(){var t,n;return me++,t=fe,"''"===e.substr(fe,2)?(n="''",fe+=2):(n=r,0===me&&Pe(Q)),n!==r&&(pe=t,n="'"),me--,(t=n)===r&&(n=r,0===me&&Pe(J)),t}function Ke(){var t,n,o,i,a,u;if(t=fe,39===e.charCodeAt(fe)?(n="'",fe++):(n=r,0===me&&Pe(C)),n!==r)if((o=function(){var t,n,o,i;t=fe,n=fe,e.length>fe?(o=e.charAt(fe),fe++):(o=r,0===me&&Pe(g));o!==r?(pe=fe,(i=(i=function(e){return"<"===e||">"===e||"{"===e||"}"===e||et()&&"#"===e}(o))?void 0:r)!==r?n=o=[o,i]:(fe=n,n=r)):(fe=n,n=r);t=n!==r?e.substring(t,fe):n;return t}())!==r){for(i=fe,a=[],"''"===e.substr(fe,2)?(u="''",fe+=2):(u=r,0===me&&Pe(Q)),u===r&&(x.test(e.charAt(fe))?(u=e.charAt(fe),fe++):(u=r,0===me&&Pe(T)));u!==r;)a.push(u),"''"===e.substr(fe,2)?(u="''",fe+=2):(u=r,0===me&&Pe(Q)),u===r&&(x.test(e.charAt(fe))?(u=e.charAt(fe),fe++):(u=r,0===me&&Pe(T)));(i=a!==r?e.substring(i,fe):a)!==r?(39===e.charCodeAt(fe)?(a="'",fe++):(a=r,0===me&&Pe(C)),a===r&&(a=null),a!==r?(pe=t,t=n=o+i.replace("''","'")):(fe=t,t=r)):(fe=t,t=r)}else fe=t,t=r;else fe=t,t=r;return t}function $e(){var t,n,o,i;return t=fe,n=fe,e.length>fe?(o=e.charAt(fe),fe++):(o=r,0===me&&Pe(g)),o!==r?(pe=fe,(i=(i=X(o))?void 0:r)!==r?n=o=[o,i]:(fe=n,n=r)):(fe=n,n=r),n===r&&(10===e.charCodeAt(fe)?(n="\n",fe++):(n=r,0===me&&Pe(ee))),t=n!==r?e.substring(t,fe):n}function Ge(){var t,n;return me++,t=fe,(n=Je())===r&&(n=Qe()),t=n!==r?e.substring(t,fe):n,me--,t===r&&(n=r,0===me&&Pe(te)),t}function Ze(){var t,n;return me++,t=fe,(n=Je())===r&&(n=function(){var t,n,o,i,a;me++,t=fe,n=[],45===e.charCodeAt(fe)?(o="-",fe++):(o=r,0===me&&Pe(Z));o===r&&(o=fe,i=fe,me++,(a=He())===r&&(a=Ve()),me--,a===r?i=void 0:(fe=i,i=r),i!==r?(e.length>fe?(a=e.charAt(fe),fe++):(a=r,0===me&&Pe(g)),a!==r?o=i=[i,a]:(fe=o,o=r)):(fe=o,o=r));if(o!==r)for(;o!==r;)n.push(o),45===e.charCodeAt(fe)?(o="-",fe++):(o=r,0===me&&Pe(Z)),o===r&&(o=fe,i=fe,me++,(a=He())===r&&(a=Ve()),me--,a===r?i=void 0:(fe=i,i=r),i!==r?(e.length>fe?(a=e.charAt(fe),fe++):(a=r,0===me&&Pe(g)),a!==r?o=i=[i,a]:(fe=o,o=r)):(fe=o,o=r));else n=r;t=n!==r?e.substring(t,fe):n;me--,t===r&&(n=r,0===me&&Pe(ce));return t}()),t=n!==r?e.substring(t,fe):n,me--,t===r&&(n=r,0===me&&Pe(ne)),t}function Je(){var t,n,o,i,a;if(me++,t=fe,48===e.charCodeAt(fe)?(n="0",fe++):(n=r,0===me&&Pe(oe)),n!==r&&(pe=t,n=0),(t=n)===r){if(t=fe,n=fe,ie.test(e.charAt(fe))?(o=e.charAt(fe),fe++):(o=r,0===me&&Pe(ae)),o!==r){for(i=[],ue.test(e.charAt(fe))?(a=e.charAt(fe),fe++):(a=r,0===me&&Pe(le));a!==r;)i.push(a),ue.test(e.charAt(fe))?(a=e.charAt(fe),fe++):(a=r,0===me&&Pe(le));i!==r?n=o=[o,i]:(fe=n,n=r)}else fe=n,n=r;n!==r&&(pe=t,n=parseInt(n.join(""),10)),t=n}return me--,t===r&&(n=r,0===me&&Pe(re)),t}function Qe(){var t,n,o,i,a;if(me++,t=fe,n=[],o=fe,i=fe,me++,(a=He())===r&&(a=Ve()),me--,a===r?i=void 0:(fe=i,i=r),i!==r?(e.length>fe?(a=e.charAt(fe),fe++):(a=r,0===me&&Pe(g)),a!==r?o=i=[i,a]:(fe=o,o=r)):(fe=o,o=r),o!==r)for(;o!==r;)n.push(o),o=fe,i=fe,me++,(a=He())===r&&(a=Ve()),me--,a===r?i=void 0:(fe=i,i=r),i!==r?(e.length>fe?(a=e.charAt(fe),fe++):(a=r,0===me&&Pe(g)),a!==r?o=i=[i,a]:(fe=o,o=r)):(fe=o,o=r);else n=r;return t=n!==r?e.substring(t,fe):n,me--,t===r&&(n=r,0===me&&Pe(se)),t}var Xe=["root"];function et(){return"plural"===Xe[Xe.length-1]}function tt(){return t&&t.captureLocation?{location:ve()}:{}}var nt=t&&t.ignoreTag,rt=t&&t.shouldParseSkeleton;if((n=i())!==r&&fe===e.length)return n;throw n!==r&&fe1&&void 0!==arguments[1]?arguments[1]:{};if(!this.endpoints[e])throw new Error('There are no routes for the resourceKey "'+e+'"!');if(!this.endpoints[e].routes.detail)throw new Error('There is no detail route for the resourceKey "'+e+'"');return Hr.a.generate(this.endpoints[e].routes.detail,Ur(t))}},{key:"getListUrl",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.endpoints[e])throw new Error('There are no routes for the resourceKey "'+e+'"!');if(!this.endpoints[e].routes.list)throw new Error('There is no list route for the resourceKey "'+e+'"');return Hr.a.generate(this.endpoints[e].routes.list,Ur(t))}}])&&Vr(t.prototype,n),r&&Vr(t,r),e}());function Kr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function $r(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{};return G.get(qr.getListUrl(e,$r($r({},t),{},{flat:!0})))}},{key:"delete",value:function(e,t){return G.delete(qr.getDetailUrl(e,$r({},t)))}},{key:"deleteList",value:function(e,t){return G.delete(qr.getListUrl(e,t))}}],(n=null)&&Zr(t.prototype,n),r&&Zr(t,r),e}();function ro(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return oo(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return oo(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function oo(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0?t[0]:void 0;return r?r.locale:Un.fallbackLocale}}])&&Do(t.prototype,n),r&&Do(t,r),e}()).prototype,"persistentSettings",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return new Map}}),So=Ro(_o.prototype,"user",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){}}),ko=Ro(_o.prototype,"contact",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){}}),Po=Ro(_o.prototype,"loggedIn",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),jo=Ro(_o.prototype,"loading",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),Eo=Ro(_o.prototype,"loginError",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),Co=Ro(_o.prototype,"forgotPasswordSuccess",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),Ro(_o.prototype,"clear",[v.d],Object.getOwnPropertyDescriptor(_o.prototype,"clear"),_o.prototype),Ro(_o.prototype,"systemLocale",[v.g],Object.getOwnPropertyDescriptor(_o.prototype,"systemLocale"),_o.prototype),Ro(_o.prototype,"setLoggedIn",[v.d],Object.getOwnPropertyDescriptor(_o.prototype,"setLoggedIn"),_o.prototype),Ro(_o.prototype,"setLoading",[v.d],Object.getOwnPropertyDescriptor(_o.prototype,"setLoading"),_o.prototype),Ro(_o.prototype,"setLoginError",[v.d],Object.getOwnPropertyDescriptor(_o.prototype,"setLoginError"),_o.prototype),Ro(_o.prototype,"setForgotPasswordSuccess",[v.d],Object.getOwnPropertyDescriptor(_o.prototype,"setForgotPasswordSuccess"),_o.prototype),Ro(_o.prototype,"contentLocale",[v.g],Object.getOwnPropertyDescriptor(_o.prototype,"contentLocale"),_o.prototype),Ro(_o.prototype,"setUser",[v.d],Object.getOwnPropertyDescriptor(_o.prototype,"setUser"),_o.prototype),Ro(_o.prototype,"updateContentLocale",[v.d],Object.getOwnPropertyDescriptor(_o.prototype,"updateContentLocale"),_o.prototype),Ro(_o.prototype,"setContact",[v.d],Object.getOwnPropertyDescriptor(_o.prototype,"setContact"),_o.prototype),Ro(_o.prototype,"setFullName",[v.d],Object.getOwnPropertyDescriptor(_o.prototype,"setFullName"),_o.prototype),Ro(_o.prototype,"setPersistentSetting",[v.d],Object.getOwnPropertyDescriptor(_o.prototype,"setPersistentSetting"),_o.prototype),_o),Ao=function(e,t){if(t.locale)return t;if(!e.availableAttributes.includes("locale"))return t;var n=Object(v.u)(e.options.locales);return n&&!n.includes(Mo.contentLocale)||(t.locale=Mo.contentLocale),t},Lo=function(e,t){if(!e||!t)return!0;if(!e.availableAttributes.includes("locale"))return!0;if(t.locale){var n="function"==typeof t.locale.get?t.locale.get():t.locale;if("string"!=typeof n)throw new Error('The "locale" router attribute must be a string if given!');Mo.updateContentLocale(n)}return!0},Io=function(e){401===e.status&&Mo.setLoggedIn(!1)},zo=Mo;function Fo(e,t){for(var n=0;n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function No(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function ks(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ps(e,t){for(var n=0;n=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function Is(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function zs(e,t){for(var n=0;n9&&void 0!==arguments[9])||arguments[9],f=window.innerWidth,p=window.innerHeight,d={top:r+l-s,left:o+u,height:n,scrollTop:0};c?d.top=r+l+a:r<10?d.top=10:r+a>p-10&&(d.top=p-n-10);var h=e.cropVerticalDimensions(d,p);return!c&&h.dimensions.height>=200||(h.touchesTopBorder&&(d.top=r+l),h.touchesBottomBorder&&(d.top=c?r-n-l:r+a-n-l),h=e.cropVerticalDimensions(d,p)),e.cropHorizontalDimensions(h.dimensions,f,t,o,i)}},{key:"cropVerticalDimensions",value:function(e,t){var n=tc({},e),r=!1,o=!1;if(e.top<10){var i=e.height+e.top-10;n.top=10,n.height=i<0?e.height:i,n.scrollTop=10-e.top,r=!0}return n.top+n.height>t-10&&(n.height=t-n.top-10,o=!0),{dimensions:n,touchesTopBorder:r,touchesBottomBorder:o}}},{key:"cropHorizontalDimensions",value:function(e,t,n,r,o){var i=tc({},e);return i.left=Math.max(10,i.left),n+i.left+10>t&&(i.left=r+o-n),i}}],(n=null)&&rc(t.prototype,n),r&&rc(t,r),e}(),dc=n(382),hc=n.n(dc);function yc(e){return(yc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function mc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function bc(e){for(var t=1;tr.getBoundingClientRect().top?"bottom":"top",l=i.left===r.getBoundingClientRect().left?"left":"right";return y.a.createElement(h.Fragment,null,y.a.createElement(gl,null,o&&y.a.createElement(ci,{onClick:this.handleBackdropClick,visible:!1}),y.a.createElement("div",{className:hc.a.container},n&&n(this.setPopoverChildRef,a,u,l))))}},{key:"dimensions",get:function(){var e=this.props,t=e.anchorElement,n=e.verticalOffset,r=e.horizontalOffset,o=e.centerChildElement,i=t.getBoundingClientRect(),a=i.top,u=void 0===a?0:a,l=i.left,s=void 0===l?0:l,c=i.width,f=void 0===c?0:c,p=i.height,d=void 0===p?0:p,h=o?o.offsetTop:0,y=!o;return pc.getCroppedDimensions(this.popoverWidth,this.popoverHeight,u,s,f,d,r,n,h,y)}}])&&wc(t.prototype,n),r&&wc(t,r),i}(y.a.Component),cc.defaultProps={backdrop:!0,horizontalOffset:0,open:!1,verticalOffset:0},ac=jc((ic=fc).prototype,"popoverChildRef",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),uc=jc(ic.prototype,"popoverWidth",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),lc=jc(ic.prototype,"popoverHeight",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),jc(ic.prototype,"dimensions",[v.g],Object.getOwnPropertyDescriptor(ic.prototype,"dimensions"),ic.prototype),jc(ic.prototype,"setPopoverSize",[v.d],Object.getOwnPropertyDescriptor(ic.prototype,"setPopoverSize"),ic.prototype),sc=jc(ic.prototype,"setPopoverChildRef",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){t&&(e.popoverChildRef=t,e.mutationObserver.disconnect(),e.mutationObserver.observe(e.popoverChildRef,{childList:!0,subtree:!0}));var n=e.props.popoverChildRef;n&&n(t)}}}),oc=ic))||oc,Cc=n(92),xc=n.n(Cc);function Tc(e){return(Tc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Dc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Rc(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:"top",o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"left",i=this.props.children,a=this.cloneChildren(i),u=tn()(wf.a.arrow,(Of(n={},wf.a.top,"top"===r),Of(n,wf.a.bottom,"bottom"===r),Of(n,wf.a.left,"left"===o),Of(n,wf.a.right,"right"===o),n));return y.a.createElement("div",{className:wf.a.arrowMenuContainer,ref:e,style:t},y.a.createElement("div",{className:u}),y.a.createElement("div",{className:wf.a.arrowMenu},a))}}])&&Pf(t.prototype,n),r&&Pf(t,r),i}(y.a.Component),bf.defaultProps={refProp:"ref"},bf.Section=Kc,bf.SingleItemSection=tf,bf.Item=zc,bf.Action=pf,yf=Df((hf=vf).prototype,"displayValueRef",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),mf=Df(hf.prototype,"setDisplayValueRef",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){e.displayValueRef=t}}}),df=hf))||df,Bf=n(30),Hf=n.n(Bf),Vf=n(71),Wf=n.n(Vf);function Uf(e){return(Uf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function qf(e,t,n,r){n&&Object.defineProperty(e,t,{enumerable:n.enumerable,configurable:n.configurable,writable:n.writable,value:n.initializer?n.initializer.call(r):void 0})}function Kf(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $f(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};if(e in this.fields)throw new Error('The key "'+e+'" has already been used for another field');this.fields[e]=t,this.options[e]=n}},{key:"get",value:function(e){if(!(e in this.fields))throw new Error('There is no field with key "'+e+'" registered');return this.fields[e]}},{key:"getOptions",value:function(e){if(!(e in this.options))throw new Error('There are no options for a field with the key "'+e+'" registered');return this.options[e]}},{key:"has",value:function(e){return e in this.fields}}])&&xp(t.prototype,n),r&&xp(t,r),e}()),Rp=n(73),Mp=n.n(Rp);function Ap(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0?i:y.a.createElement(Zh,{disabled:!0,value:null},Nr("sulu_admin.no_options_available")))})))}}])&&My(t.prototype,n),r&&My(t,r),i}(y.a.Component),jy.defaultProps={closeOnSelect:!0,disabled:!1,skin:"default"},jy.Action=uh,jy.Option=Zh,jy.Divider=Jd.Divider,gy=Yy((vy=Ey).prototype,"displayValueRef",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),wy=Yy(vy.prototype,"selectedOptionRef",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),_y=Yy(vy.prototype,"open",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Oy=Yy(vy.prototype,"openOptionList",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){e.open=!0}}}),Sy=Yy(vy.prototype,"closeOptionList",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){var t=e.props.onClose;t&&t(),e.open=!1}}}),ky=Yy(vy.prototype,"setDisplayValueRef",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){t&&(e.displayValueRef=t)}}}),Py=Yy(vy.prototype,"setSelectedOptionRef",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t,n){(!e.selectedOptionRef||t&&n)&&(e.selectedOptionRef=t)}}}),by=vy))||by;function By(e){return(By="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Hy(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Vy(e,t){for(var n=0;n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function lb(e){return function(e){if(Array.isArray(e))return cb(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||sb(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function sb(e,t){if(e){if("string"==typeof e)return cb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?cb(e,t):void 0}}function cb(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n3&&void 0!==arguments[3]?arguments[3]:"",o=arguments.length>4?arguments[4]:void 0,i=arguments.length>5?arguments[5]:void 0;return Object.keys(e).reduce((function(a,u){return a[u]=yb(e[u],t,n,r+"/"+u,o,i),a}),{})}function yb(e,t,n,r,o,i){var a=tb.getAll().reduce((function(e,t){return pb(pb({},e),t(e,o,i))}),pb(pb({},t),{},{__locale:n}));return Object.keys(e).reduce((function(u,l){if("disabledCondition"===l&&e[l])u.disabled=w.a.evalSync(e[l],a);else if("visibleCondition"===l&&e[l])u.visible=w.a.evalSync(e[l],a);else if("items"===l&&e.items)u.items=hb(e.items,t,n,r,o,i);else if("types"===l&&e.types){var s=e.types;u.types=Object.keys(s).reduce((function(e,a){return e[a]={title:s[a].title,form:hb(s[a].form,t,n,r+"/types/"+a+"/form",o,i)},e}),{})}else u[l]=e[l];return u}),{})}function mb(e,t){return e.priority>t.priority?-1:e.priority3&&void 0!==arguments[3]?arguments[3]:[""],o=[];for(var i in n){var a=n[i],u=a.items,l=a.tags,s=a.type,c=a.types;if("section"===s&&u)o.push.apply(o,lb(bb(e,t,u,r)));else if(c&&Object.keys(c).length>0&&t[i]){var f,p=ub(t[i].keys());try{for(p.s();!(f=p.n()).done;){var d=f.value,h=t[i][d];o.push.apply(o,lb(bb(e,h,c[h.type].form,r.concat([i,d]))))}}catch(e){p.e(e)}finally{p.f()}}else if(l){var y=l.filter((function(t){return t.name===e}));if(0===y.length)continue;o.push({path:r.concat([i]).join("/"),priority:Math.max.apply(Math,lb(y.map((function(e){return e.priority||0}))))})}else;}return o.sort(mb)}var vb,gb,wb,_b,Ob=(Zm=v.g.struct,Qm=ab((Jm=function(){function e(){var t=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),ob(this,"rawSchema",Qm,this),ob(this,"evaluatedSchema",Xm,this),this.modifiedFields=[],ob(this,"errors",eb,this),this.pathsByTag={},this.updateFieldPathEvaluations=function(){var e=t.loading,n=t.rawSchema,r=t.locale?t.locale.get():void 0;Object(v.w)((function(){return!e}),(function(){return t.setEvaluatedSchema(hb(n,Object(v.v)((function(){return Object(v.u)(t.data)})),r,"",t.options,t.metadataOptions))}))},this.getValueByPath=function(e){return ls.a.has(t.data,e)?ls.a.get(t.data,e):void 0}}var t,n,r;return t=e,(n=[{key:"isFieldModified",value:function(e){return this.modifiedFields.includes(e)}},{key:"finishField",value:function(e){this.modifiedFields.includes(e)||this.modifiedFields.push(e),this.updateFieldPathEvaluations()}},{key:"setMultiple",value:function(){this.updateFieldPathEvaluations()}},{key:"validate",value:function(){var e=this.validator,t={};if(e&&!e(Object(v.u)(this.data))){var n,r=ub(e.errors);try{for(r.s();!(n=r.n()).done;){var o=n.value;switch(o.keyword){case"oneOf":case"anyOf":break;case"required":ls.a.set(t,o.dataPath+"/"+o.params.missingProperty,{keyword:o.keyword,parameters:o.params});break;default:ls.a.set(t,o.dataPath,{keyword:o.keyword,parameters:o.params})}}}catch(e){r.e(e)}finally{r.f()}}return this.errors=t,!(Object.keys(this.errors).length>0&&(d.a.info("Form validation detected the following errors: ",Object(v.u)(this.errors)),1))}},{key:"setEvaluatedSchema",value:function(e){this.evaluatedSchema=e}},{key:"getValuesByTag",value:function(e){return this.getPathsByTag(e).map(this.getValueByPath)}},{key:"getPathsByTag",value:function(e){var t=this.data,n=this.rawSchema;return e in this.pathsByTag||(this.pathsByTag[e]=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[""];return bb(e,t,n,r).map((function(e){return e.path}))}(e,t,n)),this.pathsByTag[e]}},{key:"getSchemaEntryByPath",value:function(e){return ls.a.get(this.schema,e)}},{key:"addMissingSchemaProperties",value:function(){var e=this,t=Object.keys(this.rawSchema).reduce((function(t,n){return function e(t,n,r){var o=r[n].type;"section"!==o&&ls.a.set(t,"/"+n,void 0);var i=r[n].items;return"section"===o&&i&&Object.keys(i).reduce((function(n,r){return e(t,r,i)}),t),t}(t,n,e.rawSchema)}),{});Object(v.s)(this.data,pb(pb({},t),this.data))}},{key:"schema",get:function(){return Object(v.u)(this.evaluatedSchema)}},{key:"forbidden",get:function(){return!1}}])&&ib(t.prototype,n),r&&ib(t,r),e}()).prototype,"rawSchema",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Xm=ab(Jm.prototype,"evaluatedSchema",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return{}}}),eb=ab(Jm.prototype,"errors",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return{}}}),ab(Jm.prototype,"schema",[Zm],Object.getOwnPropertyDescriptor(Jm.prototype,"schema"),Jm.prototype),ab(Jm.prototype,"validate",[v.d],Object.getOwnPropertyDescriptor(Jm.prototype,"validate"),Jm.prototype),ab(Jm.prototype,"setEvaluatedSchema",[v.d],Object.getOwnPropertyDescriptor(Jm.prototype,"setEvaluatedSchema"),Jm.prototype),ab(Jm.prototype,"addMissingSchemaProperties",[v.d],Object.getOwnPropertyDescriptor(Jm.prototype,"addMissingSchemaProperties"),Jm.prototype),Jm);function Sb(e){return(Sb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function kb(e,t,n,r){n&&Object.defineProperty(e,t,{enumerable:n.enumerable,configurable:n.configurable,writable:n.writable,value:n.initializer?n.initializer.call(r):void 0})}function Pb(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{},o=Ib({type:e,key:t},r);this.metadataPromises[e]||(this.metadataPromises[e]={});var i=t+ki(r);if(!this.metadataPromises[e][i]){var a=Hr.a.generate("sulu_admin.metadata",o),u=fetch(a,Yb).then((function(t){if(!t.ok)return n.metadataPromises[e][i]=void 0,Promise.reject(t);var r=t.headers.get("cache-control");return r&&r.includes("no-store")&&(n.metadataPromises[e][i]=void 0),t.json()}));return this.metadataPromises[e][i]=u,u}return this.metadataPromises[e][i]}}])&&Fb(t.prototype,n),r&&Fb(t,r),e}());function Bb(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0;return new Zb((function(e,r){return new Ab(t,e,r,n,o)}),e,r,o)}},{key:"createFromSchema",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return new Ab(n,e,t)}}])&&Jb(t.prototype,n),r&&Jb(t,r),e}());function fv(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function pv(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=arguments.length>4?arguments[4]:void 0,u=arguments.length>5&&void 0!==arguments[5]&&arguments[5];yv(this,e),hv(this,"id",Xb,this),hv(this,"initialized",ev,this),hv(this,"loading",tv,this),hv(this,"saving",nv,this),hv(this,"deleting",rv,this),hv(this,"moving",ov,this),hv(this,"data",iv,this),hv(this,"dirty",av,this),hv(this,"forbidden",uv,this),this.loadOptions={},this.load=function(){var e=r.id,t=r.observableOptions.locale;if(!t||t.get())if(r.preventLoadingOnce)r.preventLoadingOnce=!1;else if(e){var n={};t&&(n.locale=t.get()),d.a.info('ResourceStore loads "'+r.resourceKey+'" data with the ID "'+e+'"'),r.setLoading(!0),r.setForbidden(!1),(r.idQueryParameter?no.get(r.resourceKey,pv(pv(pv({},n),r.loadOptions),{},dv({},r.idQueryParameter,e))):no.get(r.resourceKey,pv(pv(pv({},n),r.loadOptions),{},{id:e}))).then(Object(v.d)((function(e){r.idQueryParameter?(r.handleIdQueryParameterResponse(e),r.setMultiple(e)):r.setMultiple(e),r.initialized=!0,r.setLoading(!1),r.dirty=!1}))).catch(Object(v.d)((function(e){403===e.status&&r.setForbidden(!0)})))}else r.initialized=!0},hv(this,"reload",lv,this),hv(this,"move",sv,this),this.resourceKey=t,this.id=n,this.observableOptions=o,this.loadOptions=i,this.idQueryParameter=a,this.preventLoadingOnce=u,this.disposer=Object(v.e)(this.load)}var t,n,r;return t=e,(n=[{key:"setLoading",value:function(e){this.loading=e}},{key:"setForbidden",value:function(e){this.forbidden=e}},{key:"save",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.observableOptions.locale;return t&&(e.locale=t.get()),this.idQueryParameter||!this.id?this.create(e):this.update(e)}},{key:"create",value:function(e){var t=this;this.saving=!0;var n=e;return this.idQueryParameter&&(n[this.idQueryParameter]=this.id),no.post(this.resourceKey,this.data,n).then(Object(v.d)((function(e){return t.handleIdQueryParameterResponse(e),t.setMultiple(e),t.saving=!1,t.dirty=!1,e}))).catch(Object(v.d)((function(e){throw t.saving=!1,e})))}},{key:"update",value:function(e){var t=this;if(!this.id)throw new Error('Can not save resource with an undefined "id"');return this.saving=!0,no.put(this.resourceKey,this.data,pv(pv({},e),{},{id:this.id})).then(Object(v.d)((function(e){return t.setMultiple(e),t.saving=!1,t.dirty=!1,e}))).catch(Object(v.d)((function(e){throw t.saving=!1,e})))}},{key:"delete",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!this.data.id)throw new Error('Cannot delete resource with an undefined "id"');this.deleting=!0;var n=this.observableOptions.locale,r=t;return n&&(r.locale=n.get()),no.delete(this.resourceKey,pv(pv({},r),{},{id:this.data.id})).then(Object(v.d)((function(t){e.id=void 0,e.setMultiple(t),e.deleting=!1,e.dirty=!1,e.destroy()}))).catch(Object(v.d)((function(t){throw e.deleting=!1,t})))}},{key:"copyFromLocale",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.id)throw new Error("Copying from another locale does not work for new objects!");if(!this.locale)throw new Error("Copying from another locale does only work for objects with locales!");var r=this.locale.get();return no.post(this.resourceKey,{},pv(pv({},n),{},{action:"copy-locale",dest:r,id:this.id,locale:r,src:e})).then(Object(v.d)((function(e){return t.setMultiple(e),e})))}},{key:"set",value:function(e,t){"id"!==e||"string"!=typeof t&&"number"!=typeof t||(this.id=t),ls.a.set(this.data,"/"+e,t)}},{key:"setMultiple",value:function(e){var t=this;e.id&&(this.id=e.id),Object.keys(e).forEach((function(n){t.set(n,e[n])})),Object(v.s)(this.data,this.data),d.a.info('ResourceStore changed "'+this.resourceKey+'" data with the ID "'+(this.id||"undefined")+'"',this.data)}},{key:"change",value:function(e,t){this.set(e,t),this.dirty=!0}},{key:"changeMultiple",value:function(e){this.setMultiple(e),this.dirty=!0}},{key:"clone",value:function(){var t=this,n=new e(this.resourceKey,this.id,this.observableOptions,this.loadOptions,void 0,!0);return n.loading=this.loading,Object(v.w)((function(){return!t.loading}),(function(){n.data=Object(v.u)(t.data),n.loading=!1})),n}},{key:"destroy",value:function(){this.disposer()}},{key:"handleIdQueryParameterResponse",value:function(e){e.id&&(this.idQueryParameter=void 0,this.id=e.id,this.preventLoadingOnce=!0)}},{key:"locale",get:function(){return this.observableOptions.locale}}])&&mv(t.prototype,n),r&&mv(t,r),e}()).prototype,"id",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ev=bv(Qb.prototype,"initialized",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),tv=bv(Qb.prototype,"loading",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),nv=bv(Qb.prototype,"saving",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),rv=bv(Qb.prototype,"deleting",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),ov=bv(Qb.prototype,"moving",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),iv=bv(Qb.prototype,"data",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return{}}}),av=bv(Qb.prototype,"dirty",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),uv=bv(Qb.prototype,"forbidden",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),lv=bv(Qb.prototype,"reload",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){e.load()}}}),bv(Qb.prototype,"setLoading",[v.d],Object.getOwnPropertyDescriptor(Qb.prototype,"setLoading"),Qb.prototype),bv(Qb.prototype,"setForbidden",[v.d],Object.getOwnPropertyDescriptor(Qb.prototype,"setForbidden"),Qb.prototype),bv(Qb.prototype,"save",[v.d],Object.getOwnPropertyDescriptor(Qb.prototype,"save"),Qb.prototype),bv(Qb.prototype,"create",[v.d],Object.getOwnPropertyDescriptor(Qb.prototype,"create"),Qb.prototype),bv(Qb.prototype,"update",[v.d],Object.getOwnPropertyDescriptor(Qb.prototype,"update"),Qb.prototype),bv(Qb.prototype,"delete",[v.d],Object.getOwnPropertyDescriptor(Qb.prototype,"delete"),Qb.prototype),sv=bv(Qb.prototype,"move",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){if(!e.id)throw new Error("Moving does not work for new objects!");e.moving=!0;var n=e.observableOptions.locale,r={action:"move",destination:t,locale:n?n.get():void 0};return no.post(e.resourceKey,void 0,pv(pv({},r),{},{id:e.id})).then(Object(v.d)((function(){e.moving=!1}))).catch(Object(v.d)((function(t){throw e.moving=!1,t})))}}}),bv(Qb.prototype,"set",[v.d],Object.getOwnPropertyDescriptor(Qb.prototype,"set"),Qb.prototype),bv(Qb.prototype,"setMultiple",[v.d],Object.getOwnPropertyDescriptor(Qb.prototype,"setMultiple"),Qb.prototype),bv(Qb.prototype,"change",[v.d],Object.getOwnPropertyDescriptor(Qb.prototype,"change"),Qb.prototype),bv(Qb.prototype,"changeMultiple",[v.d],Object.getOwnPropertyDescriptor(Qb.prototype,"changeMultiple"),Qb.prototype),bv(Qb.prototype,"clone",[v.d],Object.getOwnPropertyDescriptor(Qb.prototype,"clone"),Qb.prototype),bv(Qb.prototype,"handleIdQueryParameterResponse",[v.d],Object.getOwnPropertyDescriptor(Qb.prototype,"handleIdQueryParameterResponse"),Qb.prototype),Qb);function jv(e){return(jv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ev(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Cv(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Cv(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Cv(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:{},a=arguments.length>3?arguments[3]:void 0;return Mv(this,i),Rv(n=o.call(this),"type",gv,Yv(n)),Rv(n,"types",wv,Yv(n)),Rv(n,"schemaLoading",_v,Yv(n)),Rv(n,"typesLoading",Ov,Yv(n)),Rv(n,"handleSchemaTypeResponse",Sv,Yv(n)),Rv(n,"handleSchemaResponse",kv,Yv(n)),n.resourceStore=e,n.formKey=t,n.options=r,n.metadataOptions=a,Ub.getSchemaTypes(n.formKey,n.metadataOptions).then(n.handleSchemaTypeResponse),n}return t=i,(n=[{key:"destroy",value:function(){this.schemaDisposer&&this.schemaDisposer(),this.typeDisposer&&this.typeDisposer(),this.updateFieldPathEvaluationsDisposer&&this.updateFieldPathEvaluationsDisposer()}},{key:"save",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.validate()?this.resourceStore.save(Tv(Tv({},this.options),t)).then((function(t){var n=e.modifiedFields;return n.splice(0,n.length),t})).catch((function(e){return e.json().then(Object(v.d)((function(e){return Promise.reject(e)})))})):Promise.reject("Errors occured when trying to save the data from the FormStore")}},{key:"delete",value:function(e){return this.resourceStore.delete(Tv(Tv({},this.options),e))}},{key:"copyFromLocale",value:function(e){var t=this;return this.resourceStore.copyFromLocale(e,this.options).then((function(e){t.hasTypes&&t.setType(e.template)}))}},{key:"set",value:function(e,t){this.resourceStore.set(e,t)}},{key:"setMultiple",value:function(e){this.resourceStore.setMultiple(e),Lv(Nv(i.prototype),"setMultiple",this).call(this)}},{key:"change",value:function(e,t){this.resourceStore.change(e,t)}},{key:"setSchemaLoading",value:function(e){this.schemaLoading=e}},{key:"setType",value:function(e){this.validateTypes(),this.type=e,this.set("template",e)}},{key:"changeType",value:function(e){this.validateTypes(),this.type=e,this.change("template",e)}},{key:"validateTypes",value:function(){if(0===Object.keys(this.types).length)throw new Error('The form "'+this.formKey+'" handled by this ResourceFormStore cannot handle types')}},{key:"getSchemaEntryByPath",value:function(e){return ls.a.get(this.schema,e)}},{key:"hasTypes",get:function(){return Object.keys(this.types).length>0}},{key:"hasInvalidType",get:function(){return!!this.types&&!!this.type&&!Object(v.j)(this.types,this.type)}},{key:"loading",get:function(){return this.resourceStore.loading||this.schemaLoading}},{key:"data",get:function(){return this.resourceStore.data}},{key:"locale",get:function(){return this.resourceStore.locale}},{key:"resourceKey",get:function(){return this.resourceStore.resourceKey}},{key:"id",get:function(){return this.resourceStore.id}},{key:"saving",get:function(){return this.resourceStore.saving}},{key:"deleting",get:function(){return this.resourceStore.deleting}},{key:"forbidden",get:function(){return this.resourceStore.forbidden}},{key:"dirty",get:function(){return this.resourceStore.dirty},set:function(e){this.resourceStore.dirty=e}}])&&Av(t.prototype,n),r&&Av(t,r),i}(Ob)).prototype,"type",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),wv=Bv(vv.prototype,"types",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return{}}}),_v=Bv(vv.prototype,"schemaLoading",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),Ov=Bv(vv.prototype,"typesLoading",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),Sv=Bv(vv.prototype,"handleSchemaTypeResponse",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){var n=t||{},r=n.types,o=void 0===r?{}:r,i=n.defaultType;e.types=o,e.typesLoading=!1,e.hasTypes&&Object(v.w)((function(){return!e.resourceStore.loading}),(function(){e.setType(e.resourceStore.data.template||i||Object.keys(e.types)[0])})),e.schemaDisposer=Object(v.e)((function(){var t=e.type;(!e.hasTypes||t)&&(!e.hasTypes||e.types[t])?(e.setSchemaLoading(!0),Promise.all([Ub.getSchema(e.formKey,t,e.metadataOptions),Ub.getJsonSchema(e.formKey,t,e.metadataOptions)]).then(e.handleSchemaResponse)):e.setSchemaLoading(!1)}))}}}),kv=Bv(vv.prototype,"handleSchemaResponse",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){var n=Ev(t,2),r=n[0],o=n[1];e.validator=o?Hv.compile(o):void 0,e.pathsByTag={},e.rawSchema=r,e.addMissingSchemaProperties(),e.setSchemaLoading(!1),e.updateFieldPathEvaluationsDisposer=Object(v.e)(e.updateFieldPathEvaluations)}}}),Bv(vv.prototype,"hasTypes",[v.g],Object.getOwnPropertyDescriptor(vv.prototype,"hasTypes"),vv.prototype),Bv(vv.prototype,"hasInvalidType",[v.g],Object.getOwnPropertyDescriptor(vv.prototype,"hasInvalidType"),vv.prototype),Bv(vv.prototype,"loading",[v.g],Object.getOwnPropertyDescriptor(vv.prototype,"loading"),vv.prototype),Bv(vv.prototype,"data",[v.g],Object.getOwnPropertyDescriptor(vv.prototype,"data"),vv.prototype),Bv(vv.prototype,"save",[v.d],Object.getOwnPropertyDescriptor(vv.prototype,"save"),vv.prototype),Bv(vv.prototype,"locale",[v.g],Object.getOwnPropertyDescriptor(vv.prototype,"locale"),vv.prototype),Bv(vv.prototype,"resourceKey",[v.g],Object.getOwnPropertyDescriptor(vv.prototype,"resourceKey"),vv.prototype),Bv(vv.prototype,"id",[v.g],Object.getOwnPropertyDescriptor(vv.prototype,"id"),vv.prototype),Bv(vv.prototype,"saving",[v.g],Object.getOwnPropertyDescriptor(vv.prototype,"saving"),vv.prototype),Bv(vv.prototype,"deleting",[v.g],Object.getOwnPropertyDescriptor(vv.prototype,"deleting"),vv.prototype),Bv(vv.prototype,"forbidden",[v.g],Object.getOwnPropertyDescriptor(vv.prototype,"forbidden"),vv.prototype),Bv(vv.prototype,"dirty",[v.g],Object.getOwnPropertyDescriptor(vv.prototype,"dirty"),vv.prototype),Bv(vv.prototype,"setSchemaLoading",[v.d],Object.getOwnPropertyDescriptor(vv.prototype,"setSchemaLoading"),vv.prototype),Bv(vv.prototype,"setType",[v.d],Object.getOwnPropertyDescriptor(vv.prototype,"setType"),vv.prototype),Bv(vv.prototype,"changeType",[v.d],Object.getOwnPropertyDescriptor(vv.prototype,"changeType"),vv.prototype),vv);function Wv(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3?arguments[3]:void 0;return new Vv(e,t,n,r)}}])&&Wv(t.prototype,n),r&&Wv(t,r),e}());function Xv(e){return(Xv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function eg(e,t,n,r){n&&Object.defineProperty(e,t,{enumerable:n.enumerable,configurable:n.configurable,writable:n.writable,value:n.initializer?n.initializer.call(r):void 0})}function tg(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ng(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Ew(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n4&&void 0!==arguments[4]?arguments[4]:{},u=arguments.length>5?arguments[5]:void 0,l=arguments.length>6?arguments[6]:void 0;Rw(this,e),Dw(this,"pageCount",ow,this),Dw(this,"selections",iw,this),Dw(this,"dataLoading",aw,this),Dw(this,"deleting",uw,this),Dw(this,"deletingSelection",lw,this),Dw(this,"moving",sw,this),Dw(this,"movingSelection",cw,this),Dw(this,"copying",fw,this),Dw(this,"ordering",pw,this),Dw(this,"schemaLoading",dw,this),Dw(this,"shouldReload",hw,this),Dw(this,"loadingStrategy",yw,this),Dw(this,"structureStrategy",mw,this),Dw(this,"options",bw,this),Dw(this,"schema",vw,this),Dw(this,"forbidden",gw,this),this.active=v.q.box(),this.filterOptions=v.q.box({}),this.sortColumn=v.q.box(),this.sortOrder=v.q.box(),this.searchTerm=v.q.box(),this.limit=v.q.box(10),this.changeUserSchema=function(t){var n=[];Object.keys(t).map((function(e){var r=t[e];n.push({schemaKey:e,visibility:r.visibility})})),e.setSchemaSetting(i.listKey,i.userSettingsKey,n)},Dw(this,"updateLoadingStrategy",ww,this),Dw(this,"updateStructureStrategy",_w,this),Dw(this,"clear",Ow,this),this.delete=function(e,t){return i.deleting=!0,no.delete(i.resourceKey,xw(xw(xw({},i.queryOptions),t),{},{id:e})).then(Object(v.d)((function(){i.deleting=!1,i.deselectById(e),i.remove(e)}))).catch(Object(v.d)((function(e){throw i.deleting=!1,e})))},this.move=function(e,t){return i.moving=!0,i.requestMove(e,t).then(Object(v.d)((function(){i.moving=!1,i.activate(e),i.clear()})))},Dw(this,"moveSelection",Sw,this),this.copy=function(e,t,n){var r=xw(xw({},i.options),{},{action:"copy",destination:t}),o=i.observableOptions.locale;return o&&(r.locale=o.get()),i.copying=!0,no.post(i.resourceKey,void 0,xw(xw({},r),{},{id:e})).then(Object(v.d)((function(e){i.copying=!1,null==n||n(e),i.activate(e.id),i.clear()})))},Dw(this,"deleteSelection",kw,this),this.remove=function(e){i.structureStrategy.remove(e)},this.sendRequest=function(){if(i.initialized){var t={};for(var n in i.observableOptions)t[n]=i.observableOptions[n].get();i.setDataLoading(!0),i.setForbidden(!1);var r=i.active.get(),o=xw(xw({},t),i.options);i.initialSelectionIds&&(o.selectedIds=i.initialSelectionIds.join(",")),o.selectedIds||(r&&Object(v.v)((function(){return!i.structureStrategy.findById(r)}))&&(i.structureStrategy.clear(),o.expandedIds=r),!o.expandedIds&&r&&(o.parentId=r)),o.sortBy=i.sortColumn.get(),o.sortOrder=i.sortOrder.get(),o.limit=i.limit.get(),o.fields=i.fields,Object.keys(i.filterQueryOption).length>0&&(o.filter=i.filterQueryOption),i.searchTerm.get()&&(o.search=i.searchTerm.get()),d.a.info('List loads "'+i.resourceKey+'" data with the following options:',o),i.pendingRequest&&i.pendingRequest.abort(),i.pendingRequest=i.loadingStrategy.load(i.resourceKey,o,o.selectedIds||o.expandedIds?void 0:r).then(Object(v.d)((function(e){i.pendingRequest=void 0,i.pageCount=e.pages,i.setDataLoading(!1),i.initialSelectionIds&&(i.initialSelectionIds.map((function(e){return i.findById(e)})).forEach((function(e){e&&i.select(e)})),i.initialSelectionIds=void 0)}))).catch((function(t){if("AbortError"!==t.name){if(i.pendingRequest=void 0,i.active.get()&&404===t.status)return e.setActiveSetting(i.listKey,i.userSettingsKey,void 0),void i.setActive(void 0);403===t.status&&i.setForbidden(!0),i.setDataLoading(!1)}}))}},this.resourceKey=t,this.listKey=n,this.userSettingsKey=r,this.observableOptions=o,this.options=a,this.metadataOptions=u,this.initialSelectionIds=l,this.sendRequestDisposer=Object(v.e)((function(){i.shouldReload?i.setShouldReload(!1):i.sendRequest()}));var s=function(e){i.initialized&&e.object.get()!==e.newValue&&i.reset()},c=this.observableOptions.locale;c&&(this.localeDisposer=Object(v.l)(c,"",(function(e){return s(e),e}))),this.searchDisposer=Object(v.l)(this.searchTerm,"",(function(e){return s(e),e})),this.filterDisposer=Object(v.l)(this.filterOptions,"",(function(t){var n=t.object.get(),r=n?Object.keys(n).reduce((function(e,t){return void 0!==n[t]&&(e[t]=n[t]),e}),{}):{},o=t.newValue,a=o?Object.keys(o).reduce((function(e,t){return void 0!==o[t]&&(e[t]=o[t]),e}),{}):{};return J()(r,a)||s(t),J()(n,o)||e.setFilterSetting(i.listKey,i.userSettingsKey,t.newValue),t})),this.sortColumnDisposer=Object(v.l)(this.sortColumn,"",(function(t){return e.setSortColumnSetting(i.listKey,i.userSettingsKey,t.newValue),s(t),t})),this.sortOrderDisposer=Object(v.l)(this.sortOrder,"",(function(t){return e.setSortOrderSetting(i.listKey,i.userSettingsKey,t.newValue),s(t),t})),this.limitDisposer=Object(v.l)(this.limit,"",(function(t){return e.setLimitSetting(i.listKey,i.userSettingsKey,t.newValue),s(t),t})),this.activeSettingDisposer=Object(v.l)(this.active,"",(function(t){return e.setActiveSetting(i.listKey,i.userSettingsKey,t.newValue),t})),Pw.getSchema(this.listKey,this.metadataOptions).then(Object(v.d)((function(e){i.schema=e,i.schemaLoading=!1})))}return Aw(e,null,[{key:"getActiveSetting",value:function(e,t){var n=[Nw,e,t,Bw].join(".");return zo.getPersistentSetting(n)}},{key:"setActiveSetting",value:function(e,t,n){var r=[Nw,e,t,Bw].join(".");zo.setPersistentSetting(r,n)}},{key:"getFilterSetting",value:function(e,t){var n=[Nw,e,t,Ww].join(".");return zo.getPersistentSetting(n)}},{key:"setFilterSetting",value:function(e,t,n){var r=[Nw,e,t,Ww].join(".");zo.setPersistentSetting(r,n)}},{key:"getSortColumnSetting",value:function(e,t){var n=[Nw,e,t,Hw].join(".");return zo.getPersistentSetting(n)}},{key:"setSortColumnSetting",value:function(e,t,n){var r=[Nw,e,t,Hw].join(".");zo.setPersistentSetting(r,n)}},{key:"getSortOrderSetting",value:function(e,t){var n=[Nw,e,t,Vw].join(".");return zo.getPersistentSetting(n)}},{key:"setSortOrderSetting",value:function(e,t,n){var r=[Nw,e,t,Vw].join(".");zo.setPersistentSetting(r,n)}},{key:"getLimitSetting",value:function(e,t){var n=[Nw,e,t,Uw].join(".");return zo.getPersistentSetting(n)}},{key:"setLimitSetting",value:function(e,t,n){var r=[Nw,e,t,Uw].join(".");zo.setPersistentSetting(r,n)}},{key:"getSchemaSetting",value:function(e,t){var n=[Nw,e,t,qw].join(".");return zo.getPersistentSetting(n)}},{key:"setSchemaSetting",value:function(e,t,n){var r=[Nw,e,t,qw].join(".");zo.setPersistentSetting(r,n)}}]),Aw(e,[{key:"reset",value:function(){var e=this.getPage();this.clear(),this.pageCount=0,e&&e>1&&this.setPage(1)}},{key:"reload",value:function(){this.setShouldReload(!0)}},{key:"findById",value:function(e){return this.structureStrategy.findById(e)}},{key:"requestMove",value:function(e,t){var n=xw(xw({},this.options),{},{action:"move",destination:t}),r=this.observableOptions.locale;return r&&(n.locale=r.get()),no.post(this.resourceKey,void 0,xw(xw({},n),{},{id:e}))}},{key:"setDataLoading",value:function(e){this.dataLoading=e}},{key:"setForbidden",value:function(e){this.forbidden=e}},{key:"setShouldReload",value:function(e){this.shouldReload=e}},{key:"getPage",value:function(){return this.observableOptions.page.get()}},{key:"setPage",value:function(e){this.observableOptions.page.set(e)}},{key:"setLimit",value:function(e){this.limit.set(e)}},{key:"setActive",value:function(e){this.active.set(e)}},{key:"activate",value:function(e){this.setActive(void 0),this.setActive(e),this.structureStrategy.activate&&this.structureStrategy.activate(e)}},{key:"deactivate",value:function(e){this.structureStrategy.deactivate&&this.structureStrategy.deactivate(e)}},{key:"sort",value:function(e,t){this.sortColumn.set(e),this.sortOrder.set(t)}},{key:"order",value:function(e,t){var n=this;return this.ordering=!0,no.post(this.resourceKey,{position:t},xw(xw({},this.queryOptions),{},{action:"order",id:e})).then(Object(v.d)((function(){n.ordering=!1,n.structureStrategy.order(e,t)})))}},{key:"search",value:function(e){e!==this.searchTerm.get()&&this.searchTerm.set(e)}},{key:"filter",value:function(e){this.filterOptions.set(e)}},{key:"select",value:function(e){-1===this.selections.findIndex((function(t){return t.id===e.id}))&&this.selections.push(e)}},{key:"selectVisibleItems",value:function(){var e=this;d.a.warn('The "selectVisibleItems" method will select disabled rows. Therefore the method is deprecated since version 2.0. Use the "visibleItems" property and the "select" method instead.'),this.visibleItems.forEach((function(t){e.select(t)}))}},{key:"deselect",value:function(e){this.deselectById(e.id)}},{key:"deselectById",value:function(e){var t=this.selections.findIndex((function(t){return t.id===e}));-1!==t&&this.selections.splice(t,1)}},{key:"deselectVisibleItems",value:function(){var e=this;d.a.warn('The "deselectVisibleItems" method will deselect disabled rows. Therefore the method is deprecated since version 2.0. Use the "visibleItems" property and the "deselect" method instead.'),this.visibleItems.forEach((function(t){e.deselect(t)}))}},{key:"clearSelection",value:function(){this.selections=[]}},{key:"destroy",value:function(){this.sendRequestDisposer(),this.searchDisposer(),this.filterDisposer(),this.sortColumnDisposer(),this.sortOrderDisposer(),this.limitDisposer(),this.activeSettingDisposer(),this.localeDisposer&&this.localeDisposer()}},{key:"initialized",get:function(){return!!this.loadingStrategy&&!!this.structureStrategy&&!!this.schema}},{key:"loading",get:function(){return this.dataLoading||this.schemaLoading}},{key:"data",get:function(){return this.structureStrategy.data}},{key:"visibleItems",get:function(){return this.structureStrategy.visibleItems}},{key:"activeItems",get:function(){return this.structureStrategy.activeItems}},{key:"queryOptions",get:function(){var e=xw({},this.options),t=this.observableOptions.locale;return t&&(e.locale=t.get()),e}},{key:"filterQueryOption",get:function(){var e=this.filterOptions.get();return Object.keys(e).reduce((function(t,n){return void 0!==e[n]&&(t[n]=e[n]),t}),{})}},{key:"userSchema",get:function(){if(!this.initialized)return{};var t,n={},r=jw(e.getSchemaSetting(this.listKey,this.userSettingsKey)||[]);try{for(r.s();!(t=r.n()).done;){var o=t.value;this.schema.hasOwnProperty(o.schemaKey)&&(n[o.schemaKey]=xw(xw({},this.schema[o.schemaKey]),{},{visibility:o.visibility}))}}catch(e){r.e(e)}finally{r.f()}for(var i=0,a=Object.keys(this.schema);i1)throw new Error("The SingleListOverlay can only handle single selection.This should not happen and is likely a bug.");t.props.onConfirm(t.listStore.selections[0])};var n=Object(v.g)((function(){return t.props.excludedIds.length?t.props.excludedIds:void 0}));t.excludedIdsDisposer=n.observe((function(){return t.listStore.clear()}));var r=t.props,a=r.listKey,u=r.locale,l=r.metadataOptions,s=r.options,c=r.preSelectedItem,f=r.resourceKey,p={};p.page=t.page,p.excludedIds=n,u&&(p.locale=u);var d=[];return c&&d.push(c.id),t.listStore=new Kw(f,a,"single_list_overlay",p,s,l,d),t.changeOptionsDisposer=Object(v.r)((function(){return t.props.options}),(function(e){t.listStore.reset(),t.listStore.initialSelectionIds=t.listStore.selectionIds,t.listStore.options=c_(c_({},t.listStore.options),e)}),{equals:v.f.structural}),t.selectionDisposer=Object(v.e)((function(){var e=t.listStore.selections;if(!(e.length<=1)){var n=e[e.length-1];n&&(t.listStore.clearSelection(),t.listStore.select(n))}})),t}return t=i,(n=[{key:"componentWillUnmount",value:function(){this.listStore.destroy(),this.excludedIdsDisposer(),this.changeOptionsDisposer(),this.selectionDisposer()}},{key:"render",value:function(){var e=this.props,t=e.adapter,n=e.allowActivateForDisabledItems,r=e.clearSelectionOnClose,o=e.confirmLoading,i=e.disabledIds,a=e.itemDisabledCondition,u=e.onClose,l=e.open,s=e.overlayType,c=e.preSelectedItem,f=e.reloadOnOpen,p=e.title;return y.a.createElement(u_,{adapter:t,allowActivateForDisabledItems:n,clearSelectionOnClose:r,confirmLoading:o,disabledIds:i,itemDisabledCondition:a,listStore:this.listStore,onClose:u,onConfirm:this.handleConfirm,open:l,overlayType:s,preSelectedItems:c?[c]:void 0,reloadOnOpen:f,title:p})}}])&&p_(t.prototype,n),r&&p_(t,r),i}(y.a.Component),i_.defaultProps={clearSelectionOnClose:!1,disabledIds:[],excludedIds:[],overlayType:"overlay"},o_=a_))||o_;function v_(e){return(v_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function g_(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function w_(e,t){return(w_=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function __(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=S_(e);if(t){var o=S_(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return O_(this,n)}}function O_(e,t){return!t||"object"!==v_(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function S_(e){return(S_=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var k_=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&w_(e,t)}(n,e);var t=__(n);function n(){return g_(this,n),t.apply(this,arguments)}return n}(y.a.Component);function P_(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};if(e in this.adapters)throw new Error('The key "'+e+'" has already been used for another list adapter');this.adapters[e]=t,this.options[e]=n}},{key:"get",value:function(e){if(!(e in this.adapters))throw new Error('The list adapter with the key "'+e+'" is not defined. You probably forgot to add it to the store using the "add" method.');return this.adapters[e]}},{key:"getOptions",value:function(e){if(!(e in this.options))throw new Error('There are no options for a list adapter with the key "'+e+'" registered');return this.options[e]}}])&&P_(t.prototype,n),r&&P_(t,r),e}());function A_(e){return(A_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function L_(e,t,n,r){n&&Object.defineProperty(e,t,{enumerable:n.enumerable,configurable:n.configurable,writable:n.writable,value:n.initializer?n.initializer.call(r):void 0})}function I_(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function z_(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:this.active.collection;return this.refs[e].sort(UO)}}]),e}();function UO(e,t){return e.node.sortableInfo.index-t.node.sortableInfo.index}function qO(e,t){return Object.keys(e).reduce((function(n,r){return-1===t.indexOf(r)&&(n[r]=e[r]),n}),{})}var KO={end:["touchend","touchcancel","mouseup"],move:["touchmove","mousemove"],start:["touchstart","mousedown"]},$O=function(){if("undefined"==typeof window||"undefined"==typeof document)return"";var e=window.getComputedStyle(document.documentElement,"")||["-moz-hidden-iframe"],t=(Array.prototype.slice.call(e).join("").match(/-(moz|webkit|ms)-/)||""===e.OLink&&["","o"])[1];switch(t){case"ms":return"ms";default:return t&&t.length?t[0].toUpperCase()+t.substr(1):""}}();function GO(e,t){Object.keys(t).forEach((function(n){e.style[n]=t[n]}))}function ZO(e,t){e.style["".concat($O,"Transform")]=null==t?"":"translate3d(".concat(t.x,"px,").concat(t.y,"px,0)")}function JO(e,t){e.style["".concat($O,"TransitionDuration")]=null==t?"":"".concat(t,"ms")}function QO(e,t){for(;e;){if(t(e))return e;e=e.parentNode}return null}function XO(e,t,n){return Math.max(e,Math.min(n,t))}function eS(e){return"px"===e.substr(-2)?parseFloat(e):0}function tS(e){var t=window.getComputedStyle(e);return{bottom:eS(t.marginBottom),left:eS(t.marginLeft),right:eS(t.marginRight),top:eS(t.marginTop)}}function nS(e,t){var n=t.displayName||t.name;return n?"".concat(e,"(").concat(n,")"):e}function rS(e,t){var n=e.getBoundingClientRect();return{top:n.top+t.top,left:n.left+t.left}}function oS(e){return e.touches&&e.touches.length?{x:e.touches[0].pageX,y:e.touches[0].pageY}:e.changedTouches&&e.changedTouches.length?{x:e.changedTouches[0].pageX,y:e.changedTouches[0].pageY}:{x:e.pageX,y:e.pageY}}function iS(e){return e.touches&&e.touches.length||e.changedTouches&&e.changedTouches.length}function aS(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{left:0,top:0};if(e){var r={left:n.left+e.offsetLeft,top:n.top+e.offsetTop};return e.parentNode===t?r:aS(e.parentNode,t,r)}}function uS(e,t,n){return et?e-1:e>n&&e0&&n[t].height>0)&&e.getContext("2d").drawImage(n[t],0,0)})),r}function jS(e){var t,n,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{withRef:!1};return n=t=function(t){function n(){return RO(this,n),zO(this,FO(n).apply(this,arguments))}return NO(n,t),AO(n,[{key:"componentDidMount",value:function(){Object(m.findDOMNode)(this).sortableHandle=!0}},{key:"getWrappedInstance",value:function(){return HO()(o.withRef,"To access the wrapped instance, you need to pass in {withRef: true} as the second argument of the SortableHandle() call"),this.refs.wrappedInstance}},{key:"render",value:function(){var t=o.withRef?"wrappedInstance":null;return Object(h.createElement)(e,r({ref:t},this.props))}}]),n}(h.Component),TO(t,"displayName",nS("sortableHandle",e)),n}function ES(e){return null!=e.sortableHandle}var CS=function(){function e(t,n){RO(this,e),this.container=t,this.onScrollCallback=n}return AO(e,[{key:"clear",value:function(){null!=this.interval&&(clearInterval(this.interval),this.interval=null)}},{key:"update",value:function(e){var t=this,n=e.translate,r=e.minTranslate,o=e.maxTranslate,i=e.width,a=e.height,u={x:0,y:0},l={x:1,y:1},s=10,c=10,f=this.container,p=f.scrollTop,d=f.scrollLeft,h=f.scrollHeight,y=f.scrollWidth,m=0===p,b=h-p-f.clientHeight==0,v=0===d,g=y-d-f.clientWidth==0;n.y>=o.y-a/2&&!b?(u.y=1,l.y=c*Math.abs((o.y-a/2-n.y)/a)):n.x>=o.x-i/2&&!g?(u.x=1,l.x=s*Math.abs((o.x-i/2-n.x)/i)):n.y<=r.y+a/2&&!m?(u.y=-1,l.y=c*Math.abs((n.y-a/2-r.y)/a)):n.x<=r.x+i/2&&!v&&(u.x=-1,l.x=s*Math.abs((n.x-i/2-r.x)/i)),this.interval&&(this.clear(),this.isAutoScrolling=!1),0===u.x&&0===u.y||(this.interval=setInterval((function(){t.isAutoScrolling=!0;var e={left:l.x*u.x,top:l.y*u.y};t.container.scrollTop+=e.top,t.container.scrollLeft+=e.left,t.onScrollCallback(e)}),5))}}]),e}();var xS={axis:ul.a.oneOf(["x","y","xy"]),contentWindow:ul.a.any,disableAutoscroll:ul.a.bool,distance:ul.a.number,getContainer:ul.a.func,getHelperDimensions:ul.a.func,helperClass:ul.a.string,helperContainer:ul.a.oneOfType([ul.a.func,"undefined"==typeof HTMLElement?ul.a.any:ul.a.instanceOf(HTMLElement)]),hideSortableGhost:ul.a.bool,keyboardSortingTransitionDuration:ul.a.number,lockAxis:ul.a.string,lockOffset:ul.a.oneOfType([ul.a.number,ul.a.string,ul.a.arrayOf(ul.a.oneOfType([ul.a.number,ul.a.string]))]),lockToContainerEdges:ul.a.bool,onSortEnd:ul.a.func,onSortMove:ul.a.func,onSortOver:ul.a.func,onSortStart:ul.a.func,pressDelay:ul.a.number,pressThreshold:ul.a.number,keyCodes:ul.a.shape({lift:ul.a.arrayOf(ul.a.number),drop:ul.a.arrayOf(ul.a.number),cancel:ul.a.arrayOf(ul.a.number),up:ul.a.arrayOf(ul.a.number),down:ul.a.arrayOf(ul.a.number)}),shouldCancelStart:ul.a.func,transitionDuration:ul.a.number,updateBeforeSortStart:ul.a.func,useDragHandle:ul.a.bool,useWindowAsScrollContainer:ul.a.bool},TS={lift:[dS],drop:[dS],cancel:[pS],up:[yS,hS],down:[bS,mS]},DS={axis:"y",disableAutoscroll:!1,distance:0,getHelperDimensions:function(e){var t=e.node;return{height:t.offsetHeight,width:t.offsetWidth}},hideSortableGhost:!0,lockOffset:"50%",lockToContainerEdges:!1,pressDelay:0,pressThreshold:5,keyCodes:TS,shouldCancelStart:function(e){return-1!==[_S,SS,kS,OS,gS].indexOf(e.target.tagName)||!!QO(e.target,(function(e){return"true"===e.contentEditable}))},transitionDuration:300,useWindowAsScrollContainer:!1},RS=Object.keys(xS);function MS(e){HO()(!(e.distance&&e.pressDelay),"Attempted to set both `pressDelay` and `distance` on SortableContainer, you may only use one or the other, not both at the same time.")}function AS(e,t){try{var n=e()}catch(e){return t(!0,e)}return n&&n.then?n.then(t.bind(null,!1),t.bind(null,!0)):t(!1,value)}function LS(e){var t,n,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{withRef:!1};return n=t=function(t){function n(e){var t;return RO(this,n),TO(IO(IO(t=zO(this,FO(n).call(this,e)))),"state",{}),TO(IO(IO(t)),"handleStart",(function(e){var n=t.props,r=n.distance,o=n.shouldCancelStart;if(2!==e.button&&!o(e)){t.touched=!0,t.position=oS(e);var i=QO(e.target,(function(e){return null!=e.sortableInfo}));if(i&&i.sortableInfo&&t.nodeIsChild(i)&&!t.state.sorting){var a=t.props.useDragHandle,u=i.sortableInfo,l=u.index,s=u.collection;if(u.disabled)return;if(a&&!QO(e.target,ES))return;t.manager.active={collection:s,index:l},iS(e)||e.target.tagName!==vS||e.preventDefault(),r||(0===t.props.pressDelay?t.handlePress(e):t.pressTimer=setTimeout((function(){return t.handlePress(e)}),t.props.pressDelay))}}})),TO(IO(IO(t)),"nodeIsChild",(function(e){return e.sortableInfo.manager===t.manager})),TO(IO(IO(t)),"handleMove",(function(e){var n=t.props,r=n.distance,o=n.pressThreshold;if(!t.state.sorting&&t.touched&&!t._awaitingUpdateBeforeSortStart){var i=oS(e),a={x:t.position.x-i.x,y:t.position.y-i.y},u=Math.abs(a.x)+Math.abs(a.y);t.delta=a,r||o&&!(u>=o)?r&&u>=r&&t.manager.isActive()&&t.handlePress(e):(clearTimeout(t.cancelTimer),t.cancelTimer=setTimeout(t.cancel,0))}})),TO(IO(IO(t)),"handleEnd",(function(){t.touched=!1,t.cancel()})),TO(IO(IO(t)),"cancel",(function(){var e=t.props.distance;t.state.sorting||(e||clearTimeout(t.pressTimer),t.manager.active=null)})),TO(IO(IO(t)),"handlePress",(function(e){try{var n=t.manager.getActive(),r=function(){if(n){var r=function(){var n=p.sortableInfo.index,r=tS(p),o=fS(t.container),s=t.scrollContainer.getBoundingClientRect(),y=a({index:n,node:p,collection:d});if(t.node=p,t.margin=r,t.gridGap=o,t.width=y.width,t.height=y.height,t.marginOffset={x:t.margin.left+t.margin.right+t.gridGap.x,y:Math.max(t.margin.top,t.margin.bottom,t.gridGap.y)},t.boundingClientRect=p.getBoundingClientRect(),t.containerBoundingRect=s,t.index=n,t.newIndex=n,t.axis={x:i.indexOf("x")>=0,y:i.indexOf("y")>=0},t.offsetEdge=aS(p,t.container),t.initialOffset=oS(h?DO({},e,{pageX:t.boundingClientRect.left,pageY:t.boundingClientRect.top}):e),t.initialScroll={left:t.scrollContainer.scrollLeft,top:t.scrollContainer.scrollTop},t.initialWindowScroll={left:window.pageXOffset,top:window.pageYOffset},t.helper=t.helperContainer.appendChild(PS(p)),GO(t.helper,{boxSizing:"border-box",height:"".concat(t.height,"px"),left:"".concat(t.boundingClientRect.left-r.left,"px"),pointerEvents:"none",position:"fixed",top:"".concat(t.boundingClientRect.top-r.top,"px"),width:"".concat(t.width,"px")}),h&&t.helper.focus(),l&&(t.sortableGhost=p,GO(p,{opacity:0,visibility:"hidden"})),t.minTranslate={},t.maxTranslate={},h){var m=f?{top:0,left:0,width:t.contentWindow.innerWidth,height:t.contentWindow.innerHeight}:t.containerBoundingRect,b=m.top,v=m.left,g=m.width,w=b+m.height,_=v+g;t.axis.x&&(t.minTranslate.x=v-t.boundingClientRect.left,t.maxTranslate.x=_-(t.boundingClientRect.left+t.width)),t.axis.y&&(t.minTranslate.y=b-t.boundingClientRect.top,t.maxTranslate.y=w-(t.boundingClientRect.top+t.height))}else t.axis.x&&(t.minTranslate.x=(f?0:s.left)-t.boundingClientRect.left-t.width/2,t.maxTranslate.x=(f?t.contentWindow.innerWidth:s.left+s.width)-t.boundingClientRect.left-t.width/2),t.axis.y&&(t.minTranslate.y=(f?0:s.top)-t.boundingClientRect.top-t.height/2,t.maxTranslate.y=(f?t.contentWindow.innerHeight:s.top+s.height)-t.boundingClientRect.top-t.height/2);u&&u.split(" ").forEach((function(e){return t.helper.classList.add(e)})),t.listenerNode=e.touches?p:t.contentWindow,h?(t.listenerNode.addEventListener("wheel",t.handleKeyEnd,!0),t.listenerNode.addEventListener("mousedown",t.handleKeyEnd,!0),t.listenerNode.addEventListener("keydown",t.handleKeyDown)):(KO.move.forEach((function(e){return t.listenerNode.addEventListener(e,t.handleSortMove,!1)})),KO.end.forEach((function(e){return t.listenerNode.addEventListener(e,t.handleSortEnd,!1)}))),t.setState({sorting:!0,sortingIndex:n}),c&&c({node:p,index:n,collection:d,isKeySorting:h,nodes:t.manager.getOrderedRefs(),helper:t.helper},e),h&&t.keyMove(0)},o=t.props,i=o.axis,a=o.getHelperDimensions,u=o.helperClass,l=o.hideSortableGhost,s=o.updateBeforeSortStart,c=o.onSortStart,f=o.useWindowAsScrollContainer,p=n.node,d=n.collection,h=t.manager.isKeySorting,y=function(){if("function"==typeof s){t._awaitingUpdateBeforeSortStart=!0;var n=AS((function(){var t=p.sortableInfo.index;return Promise.resolve(s({collection:d,index:t,node:p,isKeySorting:h},e)).then((function(){}))}),(function(e,n){if(t._awaitingUpdateBeforeSortStart=!1,e)throw n;return n}));if(n&&n.then)return n.then((function(){}))}}();return y&&y.then?y.then(r):r()}}();return Promise.resolve(r&&r.then?r.then((function(){})):void 0)}catch(e){return Promise.reject(e)}})),TO(IO(IO(t)),"handleSortMove",(function(e){var n=t.props.onSortMove;"function"==typeof e.preventDefault&&e.preventDefault(),t.updateHelperPosition(e),t.animateNodes(),t.autoscroll(),n&&n(e)})),TO(IO(IO(t)),"handleSortEnd",(function(e){var n=t.props,r=n.hideSortableGhost,o=n.onSortEnd,i=t.manager,a=i.active.collection,u=i.isKeySorting,l=t.manager.getOrderedRefs();t.listenerNode&&(u?(t.listenerNode.removeEventListener("wheel",t.handleKeyEnd,!0),t.listenerNode.removeEventListener("mousedown",t.handleKeyEnd,!0),t.listenerNode.removeEventListener("keydown",t.handleKeyDown)):(KO.move.forEach((function(e){return t.listenerNode.removeEventListener(e,t.handleSortMove)})),KO.end.forEach((function(e){return t.listenerNode.removeEventListener(e,t.handleSortEnd)})))),t.helper.parentNode.removeChild(t.helper),r&&t.sortableGhost&&GO(t.sortableGhost,{opacity:"",visibility:""});for(var s=0,c=l.length;sr)){t.prevIndex=i,t.newIndex=o;var a=uS(t.newIndex,t.prevIndex,t.index),u=n.find((function(e){return e.node.sortableInfo.index===a})),l=u.node,s=t.containerScrollDelta,c=u.boundingClientRect||rS(l,s),f=u.translate||{x:0,y:0},p=c.top+f.y-s.top,d=c.left+f.x-s.left,h=im?m/2:this.height/2,width:this.width>y?y/2:this.width/2},v=s&&h>this.index&&h<=c,g=s&&h=c,w={x:0,y:0},_=a[f].edgeOffset;_||(_=aS(d,this.container),a[f].edgeOffset=_,s&&(a[f].boundingClientRect=rS(d,o)));var O=f0&&a[f-1];O&&!O.edgeOffset&&(O.edgeOffset=aS(O.node,this.container),s&&(O.boundingClientRect=rS(O.node,o))),h!==this.index?(t&&JO(d,t),this.axis.x?this.axis.y?g||hthis.containerBoundingRect.width-b.width&&O&&(w.x=O.edgeOffset.left-_.left,w.y=O.edgeOffset.top-_.top),null===this.newIndex&&(this.newIndex=h)):(v||h>this.index&&(u+i.left+b.width>=_.left&&l+i.top+b.height>=_.top||l+i.top+b.height>=_.top+m))&&(w.x=-(this.width+this.marginOffset.x),_.left+w.xthis.index&&u+i.left+b.width>=_.left?(w.x=-(this.width+this.marginOffset.x),this.newIndex=h):(g||hthis.index&&l+i.top+b.height>=_.top?(w.y=-(this.height+this.marginOffset.y),this.newIndex=h):(g||h1&&void 0!==arguments[1]?arguments[1]:{withRef:!1};return n=t=function(t){function n(){return RO(this,n),zO(this,FO(n).apply(this,arguments))}return NO(n,t),AO(n,[{key:"componentDidMount",value:function(){this.register()}},{key:"componentDidUpdate",value:function(e){this.node&&(e.index!==this.props.index&&(this.node.sortableInfo.index=this.props.index),e.disabled!==this.props.disabled&&(this.node.sortableInfo.disabled=this.props.disabled)),e.collection!==this.props.collection&&(this.unregister(e.collection),this.register())}},{key:"componentWillUnmount",value:function(){this.unregister()}},{key:"register",value:function(){var e=this.props,t=e.collection,n=e.disabled,r=e.index,o=Object(m.findDOMNode)(this);o.sortableInfo={collection:t,disabled:n,index:r,manager:this.context.manager},this.node=o,this.ref={node:o},this.context.manager.add(t,this.ref)}},{key:"unregister",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props.collection;this.context.manager.remove(e,this.ref)}},{key:"getWrappedInstance",value:function(){return HO()(o.withRef,"To access the wrapped instance, you need to pass in {withRef: true} as the second argument of the SortableElement() call"),this.refs.wrappedInstance}},{key:"render",value:function(){var t=o.withRef?"wrappedInstance":null;return Object(h.createElement)(e,r({ref:t},qO(this.props,zS)))}}]),n}(h.Component),TO(t,"displayName",nS("sortableElement",e)),TO(t,"contextTypes",{manager:ul.a.object.isRequired}),TO(t,"propTypes",IS),TO(t,"defaultProps",{collection:0}),n}var YS=n(35),NS=n.n(YS);function BS(e){return(BS="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function HS(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function VS(e,t){for(var n=0;n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function lk(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n3&&void 0!==arguments[3]?arguments[3]:{};Ik(this,e),Lk(this,"value",Mk,this),this.confirm=function(){},this.onChange=t,this.parameters=n,this.value=r,this.options=o}var t,n,r;return t=e,(n=[{key:"destroy",value:function(){}},{key:"setValue",value:function(e){this.value=e}},{key:"getFormNode",value:function(){return null}},{key:"getValueNode",value:function(e){return Promise.resolve(null)}}])&&zk(t.prototype,n),r&&zk(t,r),e}()).prototype,"value",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Fk(Rk.prototype,"setValue",[v.d],Object.getOwnPropertyDescriptor(Rk.prototype,"setValue"),Rk.prototype),Rk);function Nk(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};if(e in this.fieldFilterTypes)throw new Error('The key "'+e+'" has already been used for another field filter type');this.fieldFilterTypes[e]=t,this.options[e]=n}},{key:"get",value:function(e){if(!(e in this.fieldFilterTypes))throw new Error('The list field filter type with the key "'+e+'" is not defined. You probably forgot to add it to the registry using the "add" method.');return this.fieldFilterTypes[e]}},{key:"getOptions",value:function(e){if(!(e in this.options))throw new Error('There are no options for a field with the key "'+e+'" registered');return this.options[e]}}])&&Nk(t.prototype,n),r&&Nk(t,r),e}()),Gk=n(174),Zk=n.n(Gk);function Jk(e){return(Jk="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Qk(e,t,n,r){n&&Object.defineProperty(e,t,{enumerable:n.enumerable,configurable:n.configurable,writable:n.writable,value:n.initializer?n.initializer.call(r):void 0})}function Xk(e,t){for(var n=0;n=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function _P(e){var t=function(e,t){if("object"!==gP(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==gP(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===gP(t)?t:String(t)}function OP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function SP(e){for(var t=1;t0&&y.a.createElement(Nf,{anchorElement:y.a.createElement("div",{className:vP.a.filterButton},y.a.createElement(Ii,{icon:"su-filter",onClick:this.handleFilterMenuButtonClick,showDropdownIcon:!0,skin:"icon"})),onClose:this.handleFilterMenuClose,open:this.filterMenuOpen},y.a.createElement(Nf.Section,null,Object.keys(n).map((function(t){return y.a.createElement(Nf.Action,{disabled:e.filteredFields.includes(t),key:t,onClick:e.handleFilterMenuActionClick,value:t},n[t].label)})))),this.filteredFields.map((function(t){return y.a.createElement(mP,{column:t,filterType:n[t].filterType,filterTypeParameters:n[t].filterTypeParameters,key:t,label:n[t].label,onChange:e.handleFilterItemChange,onClick:e.handleFilterItemClick,onClose:e.handleFilterItemClose,onDelete:e.handleFilterItemDelete,open:e.filterChipOpen===t,value:r[t]})})))}},{key:"filteredFields",get:function(){return Object.keys(this.props.value)}}])&&EP(t.prototype,n),r&&EP(t,r),i}(y.a.Component),lP=MP((uP=yP).prototype,"filterMenuOpen",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),sP=MP(uP.prototype,"filterChipOpen",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){}}),MP(uP.prototype,"filteredFields",[v.g],Object.getOwnPropertyDescriptor(uP.prototype,"filteredFields"),uP.prototype),cP=MP(uP.prototype,"handleFilterMenuButtonClick",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){e.filterMenuOpen=!0}}}),fP=MP(uP.prototype,"handleFilterMenuClose",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){e.filterMenuOpen=!1}}}),pP=MP(uP.prototype,"openFilterItem",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){e.filterChipOpen=t}}}),dP=MP(uP.prototype,"closeFilterItem",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){e.filterChipOpen=void 0}}}),hP=MP(uP.prototype,"handleFilterItemDelete",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){var n=e.props,r=n.onChange,o=n.value;o[t];r(wP(o,[t].map(_P)))}}}),aP=uP))||aP;function _j(e){return(_j="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Oj(e,t,n,r){n&&Object.defineProperty(e,t,{enumerable:n.enumerable,configurable:n.configurable,writable:n.writable,value:n.initializer?n.initializer.call(r):void 0})}function Sj(e){return function(e){if(Array.isArray(e))return kj(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return kj(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return kj(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function kj(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0;return d.forbidden?y.a.createElement(as,null):y.a.createElement("div",{className:jO.a.listContainer},a,!g&&(k||n.length>1||P||this.showColumnOptions)&&y.a.createElement("div",{className:S},k&&y.a.createElement(kO,{onSearch:this.handleSearch,value:d.searchTerm.get()}),y.a.createElement(wj,{fields:b||{},onChange:this.handleFilterChange,value:d.filterOptions.get()}),this.showColumnOptions&&y.a.createElement(h.Fragment,null,y.a.createElement(Nf,{anchorElement:y.a.createElement("div",null,y.a.createElement(Ii,{icon:"su-sort",onClick:this.handleAdapterOptionsButtonClick,showDropdownIcon:!0,skin:"icon"})),onClose:this.handleAdapterOptionsClose,open:this.adapterOptionsOpen},y.a.createElement(Nf.Section,null,y.a.createElement(Nf.Action,{onClick:this.handleColumnOptionsOpen},Nr("sulu_admin.column_options")))),y.a.createElement(wk,{onClose:this.handleColumnOptionsClose,onConfirm:this.handleColumnOptionsChange,open:this.columnOptionsOpen,schema:w})),y.a.createElement(dO,{adapters:n,currentAdapter:this.currentAdapterKey,onAdapterChange:this.handleAdapterChange})),y.a.createElement("div",{className:O},v&&0===d.pageCount?y.a.createElement(_i,null):y.a.createElement(_,{active:d.active.get(),activeItems:d.activeItems,adapterOptions:t?t[this.currentAdapterKey]:void 0,data:d.data,disabledIds:this.disabledIds,itemActionsProvider:u,limit:d.limit.get(),loading:v,onAllSelectionChange:p?this.handleAllSelectionChange:void 0,onItemActivate:this.handleItemActivate,onItemAdd:c,onItemClick:s,onItemDeactivate:this.handleItemDeactivate,onItemSelectionChange:p?this.handleItemSelectionChange:void 0,onLimitChange:this.handleLimitChange,onPageChange:this.handlePageChange,onRequestItemCopy:r?this.handleRequestItemCopy:void 0,onRequestItemDelete:o?this.handleRequestItemDelete:void 0,onRequestItemMove:l?this.handleRequestItemMove:void 0,onRequestItemOrder:f?this.handleRequestItemOrder:void 0,onSort:this.handleSort,options:this.currentAdapterOptions,page:d.getPage(),pageCount:d.pageCount,schema:d.userSchema,selections:d.selectionIds,sortColumn:d.sortColumn.get(),sortOrder:d.sortOrder.get()})),y.a.createElement(Td,{cancelText:Nr("sulu_admin.cancel"),confirmLoading:d.deletingSelection,confirmText:Nr("sulu_admin.ok"),onCancel:this.handleSelectionDeleteDialogCancelClick,onConfirm:this.handleSelectionDeleteDialogConfirmClick,open:this.showDeleteSelectionDialog,title:Nr("sulu_admin.delete_warning_title")},Nr("sulu_admin.delete_selection_warning_text",{count:d.selections.length})),o&&y.a.createElement(h.Fragment,null,y.a.createElement(Td,{cancelText:Nr("sulu_admin.cancel"),confirmLoading:d.deleting,confirmText:Nr("sulu_admin.ok"),onCancel:this.handleDeleteDialogCancelClick,onConfirm:this.handleDeleteDialogConfirmClick,open:this.showDeleteDialog,title:Nr("sulu_admin.delete_warning_title")},Nr("sulu_admin.delete_warning_text")),y.a.createElement(Td,{cancelText:Nr("sulu_admin.cancel"),confirmLoading:d.deleting,confirmText:Nr("sulu_admin.ok"),onCancel:this.allowConflictDeletion?this.handleDeleteDialogCancelClick:void 0,onConfirm:this.allowConflictDeletion?this.handleDeleteDialogConfirmClick:this.handleDeleteDialogCancelClick,open:this.showDeleteLinkedDialog,title:this.allowConflictDeletion?Nr("sulu_admin.delete_linked_warning_title"):Nr("sulu_admin.item_not_deletable")},this.allowConflictDeletion?Nr("sulu_admin.delete_linked_warning_text"):Nr("sulu_admin.delete_linked_abort_text"),y.a.createElement("ul",null,this.referencingItemsForDelete.map((function(e,t){return y.a.createElement("li",{key:t},e.name)}))))),l&&y.a.createElement(h.Fragment,null,y.a.createElement(b_,{adapter:n[0],allowActivateForDisabledItems:!1,clearSelectionOnClose:!0,confirmLoading:d.movingSelection||d.moving,disabledIds:this.moveId?[this.moveId]:[],listKey:d.listKey,locale:d.observableOptions.locale,metadataOptions:d.metadataOptions,onClose:this.handleMoveOverlayClose,onConfirm:this.handleMoveOverlayConfirmClick,open:this.showMoveOverlay,options:d.options,reloadOnOpen:!0,resourceKey:d.resourceKey,title:Nr("sulu_admin.move_copy_overlay_title")}),y.a.createElement(Td,{cancelText:Nr("sulu_admin.cancel"),confirmText:Nr("sulu_admin.confirm"),onCancel:this.handleMovePermissionWarningCancel,onConfirm:this.handleMovePermissionWarningConfirm,open:!!this.movingRestrictedTarget,title:Nr("sulu_security.move_permission_title")},Nr("sulu_security.move_permission_warning"))),r&&y.a.createElement(b_,{adapter:n[0],clearSelectionOnClose:!0,confirmLoading:d.copying,listKey:d.listKey,locale:d.observableOptions.locale,metadataOptions:d.metadataOptions,onClose:this.handleCopyOverlayClose,onConfirm:this.handleCopyOverlayConfirmClick,open:this.showCopyOverlay,reloadOnOpen:!0,resourceKey:d.resourceKey,title:Nr("sulu_admin.move_copy_overlay_title")}),f&&y.a.createElement(Td,{cancelText:Nr("sulu_admin.cancel"),confirmLoading:d.ordering,confirmText:Nr("sulu_admin.ok"),onCancel:this.handleOrderDialogCancelClick,onConfirm:this.handleOrderDialogConfirmClick,open:this.showOrderDialog,title:Nr("sulu_admin.order_warning_title")},Nr("sulu_admin.order_warning_text")))}}]),n}(y.a.Component),vj.defaultProps={allowActivateForDisabledItems:!0,copyable:!0,deletable:!0,disabled:!1,disabledIds:[],movable:!0,orderable:!0,searchable:!0,selectable:!0,showColumnOptions:!0},IP=Rj((LP=gj).prototype,"currentAdapterKey",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),zP=Rj(LP.prototype,"showCopyOverlay",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),FP=Rj(LP.prototype,"showDeleteDialog",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),YP=Rj(LP.prototype,"showDeleteLinkedDialog",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),NP=Rj(LP.prototype,"showMoveOverlay",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),BP=Rj(LP.prototype,"showDeleteSelectionDialog",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),HP=Rj(LP.prototype,"allowConflictDeletion",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),VP=Rj(LP.prototype,"showOrderDialog",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),WP=Rj(LP.prototype,"adapterOptionsOpen",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),UP=Rj(LP.prototype,"columnOptionsOpen",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),qP=Rj(LP.prototype,"referencingItemsForDelete",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),KP=Rj(LP.prototype,"movingRestrictedTarget",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){}}),Rj(LP.prototype,"currentAdapter",[v.g],Object.getOwnPropertyDescriptor(LP.prototype,"currentAdapter"),LP.prototype),Rj(LP.prototype,"currentAdapterOptions",[v.g],Object.getOwnPropertyDescriptor(LP.prototype,"currentAdapterOptions"),LP.prototype),Rj(LP.prototype,"disabledIds",[v.g],Object.getOwnPropertyDescriptor(LP.prototype,"disabledIds"),LP.prototype),Rj(LP.prototype,"showColumnOptions",[v.g],Object.getOwnPropertyDescriptor(LP.prototype,"showColumnOptions"),LP.prototype),$P=Rj(LP.prototype,"setCurrentAdapterKey",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){e.currentAdapterKey=t,e.props.store.loadingStrategy instanceof e.currentAdapter.LoadingStrategy||e.props.store.updateLoadingStrategy(new e.currentAdapter.LoadingStrategy),e.props.store.structureStrategy instanceof e.currentAdapter.StructureStrategy||e.props.store.updateStructureStrategy(new e.currentAdapter.StructureStrategy)}}}),GP=Rj(LP.prototype,"requestSelectionDelete",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];e.showDeleteSelectionDialog=!0,e.allowConflictDeletion=t}}}),ZP=Rj(LP.prototype,"handleSelectionDeleteDialogConfirmClick",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){e.props.store.deleteSelection().then(Object(v.d)((function(){e.showDeleteSelectionDialog=!1}))).catch(e.handleDeleteResponseError)}}}),JP=Rj(LP.prototype,"handleSelectionDeleteDialogCancelClick",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){e.showDeleteSelectionDialog=!1}}}),QP=Rj(LP.prototype,"handleRequestItemDelete",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){e.showDeleteDialog=!0;var n=new Promise((function(t){return e.resolveDelete=t}));return n.then(Object(v.d)((function(n){return n.deleted?(e.props.store.delete(t).then(Object(v.d)((function(){e.showDeleteDialog=!1}))).catch(e.handleDeleteResponseError),n):(e.showDeleteDialog=!1,n)}))),n}}}),XP=Rj(LP.prototype,"handleDeleteResponseError",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){if(409!==t.status)throw t;e.showDeleteDialog=!1,e.showDeleteSelectionDialog=!1,e.showDeleteLinkedDialog=!0,t.json().then(Object(v.d)((function(t){var n;e.referencingItemsForDelete.splice(0,e.referencingItemsForDelete.length),(n=e.referencingItemsForDelete).push.apply(n,Sj(t.items)),new Promise((function(t){return e.resolveDelete=t})).then(Object(v.d)((function(n){if(!n.deleted)return e.showDeleteDialog=!1,e.showDeleteSelectionDialog=!1,e.showDeleteLinkedDialog=!1,n;e.props.store.delete(t.id,{force:!0}).then(Object(v.d)((function(){e.showDeleteDialog=!1,e.showDeleteSelectionDialog=!1,e.showDeleteLinkedDialog=!1})))})))})))}}}),ej=Rj(LP.prototype,"handleDeleteDialogConfirmClick",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){if(!e.resolveDelete)throw new Error("The resolveDelete function is not set. This should not happen, and is likely a bug.");e.resolveDelete({deleted:!0})}}}),tj=Rj(LP.prototype,"handleDeleteDialogCancelClick",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){if(!e.resolveDelete)throw new Error("The resolveDelete function is not set. This should not happen, and is likely a bug.");e.resolveDelete({deleted:!1})}}}),nj=Rj(LP.prototype,"handleRequestItemMove",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){e.moveId=t,e.showMoveOverlay=!0;var n=new Promise((function(t){return e.resolveMove=t}));return n.then(Object(v.d)((function(t){if(!t.moved||!t.parent)return e.showMoveOverlay=!1,e.moveId=void 0,t;if(!e.moveId)throw new Error("The moveId is not set. This should not happen and is likely a bug.");return e.props.store.move(e.moveId,t.parent.id).then(Object(v.d)((function(){e.moveId=void 0,e.showMoveOverlay=!1}))),t}))),n}}}),rj=Rj(LP.prototype,"handleMoveOverlayConfirmClick",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){if(!e.moveId)throw new Error("The moveId is not set. This should not happen and is likely a bug.");var n=e.props.store.findById(e.moveId);if(!n)throw new Error("The moveId does not refer to an element. This should not happen and is likely a bug.");if(n._hasPermissions||t._hasPermissions)e.movingRestrictedTarget=t;else{if(!e.resolveMove)throw new Error("The resolveMove function is not set. This should not happen, and is likely a bug.");e.resolveMove({moved:!0,parent:t})}}}}),oj=Rj(LP.prototype,"handleMoveOverlayClose",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){if(!e.resolveMove)throw new Error("The resolveMove function is not set. This should not happen, and is likely a bug.");e.resolveMove({moved:!1})}}}),ij=Rj(LP.prototype,"handleMovePermissionWarningConfirm",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){if(!e.resolveMove)throw new Error("The resolveMove function is not set. This should not happen, and is likely a bug.");e.resolveMove({moved:!0,parent:e.movingRestrictedTarget}),e.movingRestrictedTarget=void 0}}}),aj=Rj(LP.prototype,"handleMovePermissionWarningCancel",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){e.movingRestrictedTarget=void 0}}}),uj=Rj(LP.prototype,"handleRequestItemCopy",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){e.showCopyOverlay=!0;var n=new Promise((function(t){return e.resolveCopy=t}));return n.then(Object(v.d)((function(n){var r;return n.copied?(e.props.store.copy(t,n.parent.id,null===(r=e.props)||void 0===r?void 0:r.onCopyFinished).then(Object(v.d)((function(){e.showCopyOverlay=!1}))),n):(e.showCopyOverlay=!1,n)}))),n}}}),lj=Rj(LP.prototype,"handleCopyOverlayConfirmClick",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){if(!e.resolveCopy)throw new Error("The resolveCopy function is not set. This should not happen, and is likely a bug.");e.resolveCopy({copied:!0,parent:t})}}}),sj=Rj(LP.prototype,"handleCopyOverlayClose",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){if(!e.resolveCopy)throw new Error("The resolveCopy function is not set. This should not happen, and is likely a bug.");e.resolveCopy({copied:!1})}}}),cj=Rj(LP.prototype,"handleRequestItemOrder",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t,n){e.showOrderDialog=!0;var r=new Promise((function(t){return e.resolveOrder=t}));return r.then(Object(v.d)((function(r){return r.ordered?(e.props.store.order(t,n).then(Object(v.d)((function(){e.showOrderDialog=!1}))),r):(e.showOrderDialog=!1,r)}))),r}}}),fj=Rj(LP.prototype,"handleOrderDialogConfirmClick",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){if(!e.resolveOrder)throw new Error("The resolveOrder function is not set. This should not happen, and is likely a bug.");e.resolveOrder({ordered:!0})}}}),pj=Rj(LP.prototype,"handleOrderDialogCancelClick",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){if(!e.resolveOrder)throw new Error("The resolveOrder function is not set. This should not happen, and is likely a bug.");e.resolveOrder({ordered:!1})}}}),dj=Rj(LP.prototype,"handleAdapterOptionsButtonClick",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){e.adapterOptionsOpen=!e.adapterOptionsOpen}}}),hj=Rj(LP.prototype,"handleAdapterOptionsClose",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){e.adapterOptionsOpen=!1}}}),yj=Rj(LP.prototype,"handleColumnOptionsOpen",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){e.columnOptionsOpen=!0}}}),mj=Rj(LP.prototype,"handleColumnOptionsClose",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){e.columnOptionsOpen=!1}}}),bj=Rj(LP.prototype,"handleColumnOptionsChange",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){e.columnOptionsOpen=!1,e.props.store.changeUserSchema(t)}}}),AP=LP))||AP;function Ij(e,t){for(var n=0;n0?t:void 0)},e}return t=i,(n=[{key:"getFormNode",value:function(){var e=this,t=this.value;return y.a.createElement(Yh,{onChange:this.handleChange,values:t||[]},Object.keys(this.parameterOptions).map((function(t){return y.a.createElement(Nh,{key:t,value:t},Nr(e.parameterOptions[t]))})))}},{key:"getValueNode",value:function(e){var t=this;return e?Promise.resolve(e.map((function(e){return Nr(t.parameterOptions[e])})).join(", ")):Promise.resolve(null)}},{key:"parameterOptions",get:function(){var e=this.parameters;if(!e)throw new Error('The "SelectFieldFilterType" needs some parameters to work!');var t=e.options;if("object"!==kC(t)||null===t)throw new Error('The "options" parameter must be an object!');return t}}])&&jC(t.prototype,n),r&&jC(t,r),i}(Yk)).prototype,"parameterOptions",[v.g],Object.getOwnPropertyDescriptor(OC.prototype,"parameterOptions"),OC.prototype),OC),MC=n(392),AC=n.n(MC);function LC(e){return(LC="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function IC(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zC(e,t){for(var n=0;n"};function UC(e){var t=e?Object.keys(e):[];if(t.length>1)throw new Error('The "NumberFilterFieldType" only accepts an array with exactly one key!');return t[0]}function qC(e){if(e)return e[UC(e)]}var KC=(VC((DC=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&FC(e,t)}(i,e);var t,n,r,o=YC(i);function i(e,t,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(r=o.call(this,e,t,n)).handleOperatorChange=function(e){if(!e)throw new Error("The operator cannot be changed to undefined! This should not happen and is likely a bug.");(0,BC(r).onChange)(IC({},e,r.number))},r.handleInputChange=function(e){(0,BC(r).onChange)(IC({},r.operator,e))},void 0===n&&e({eq:void 0}),r}return t=i,(n=[{key:"setInputRef",value:function(e){e&&e.focus()}},{key:"getFormNode",value:function(){return y.a.createElement("div",{className:AC.a.numberFieldFilterType},y.a.createElement(em,{onChange:this.handleOperatorChange,value:this.operator},y.a.createElement(em.Option,{value:"lt"},WC.lt),y.a.createElement(em.Option,{value:"eq"},WC.eq),y.a.createElement(em.Option,{value:"gt"},WC.gt)),y.a.createElement(ha,{inputRef:this.setInputRef,onChange:this.handleInputChange,type:"number",value:this.number}))}},{key:"getValueNode",value:function(e){return Promise.resolve((WC[UC(e)]||"")+" "+(qC(e)||""))}},{key:"operator",get:function(){return UC(this.value)}},{key:"number",get:function(){return qC(this.value)}}])&&zC(t.prototype,n),r&&zC(t,r),i}(Yk)).prototype,"operator",[v.g],Object.getOwnPropertyDescriptor(DC.prototype,"operator"),DC.prototype),VC(DC.prototype,"number",[v.g],Object.getOwnPropertyDescriptor(DC.prototype,"number"),DC.prototype),DC);function $C(e,t){for(var n=0;n3&&void 0!==arguments[3]?arguments[3]:"ids",i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};rx(this,e),nx(this,"items",ZC,this),nx(this,"loading",JC,this),this.resourceKey=t,this.locale=r,this.idFilterParameter=o,this.requestParameters=i,this.loadItems(n)}var t,n,r;return t=e,(n=[{key:"set",value:function(e){this.items=e}},{key:"getById",value:function(e){return this.items.find((function(t){return t.id===e}))}},{key:"removeById",value:function(e){this.items.splice(this.items.findIndex((function(t){return t.id===e})),1)}},{key:"move",value:function(e,t){this.items=Si()(this.items,e,t)}},{key:"setLoading",value:function(e){this.loading=e}},{key:"setRequestParameters",value:function(e){this.requestParameters=e}},{key:"loadItems",value:function(e){var t,n=this;if(e&&0!==e.length)return this.setLoading(!0),no.getList(this.resourceKey,ex(ex({},this.requestParameters),{},(t={locale:this.locale?this.locale.get():void 0},tx(t,this.idFilterParameter,e.join(",")),tx(t,"limit",void 0),tx(t,"page",1),t))).then(Object(v.d)((function(e){n.set(e._embedded[n.resourceKey]),n.setLoading(!1)})));this.set([])}},{key:"ids",get:function(){return this.items.map((function(e){return e.id}))}}])&&ox(t.prototype,n),r&&ox(t,r),e}()).prototype,"items",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),JC=ix(GC.prototype,"loading",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),ix(GC.prototype,"ids",[v.g],Object.getOwnPropertyDescriptor(GC.prototype,"ids"),GC.prototype),ix(GC.prototype,"set",[v.d],Object.getOwnPropertyDescriptor(GC.prototype,"set"),GC.prototype),ix(GC.prototype,"removeById",[v.d],Object.getOwnPropertyDescriptor(GC.prototype,"removeById"),GC.prototype),ix(GC.prototype,"move",[v.d],Object.getOwnPropertyDescriptor(GC.prototype,"move"),GC.prototype),ix(GC.prototype,"setLoading",[v.d],Object.getOwnPropertyDescriptor(GC.prototype,"setLoading"),GC.prototype),GC),ux=n(122),lx=n.n(ux);function sx(e){return(sx="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function cx(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fx(e,t){for(var n=0;n".concat(o[i++],"")}));return y.a.createElement("span",{dangerouslySetInnerHTML:{__html:a}})},e.handleClick=function(){var t=e.props,n=t.value,r=t.onSelect;r&&r(n)},e}return t=i,(n=[{key:"render",value:function(){var e=this.props,t=e.minWidth,n=e.icon,r=e.children;return y.a.createElement("li",{className:lx.a.suggestionItem,style:{minWidth:t+"px"}},y.a.createElement("button",{className:lx.a.suggestion,onClick:this.handleClick},n&&y.a.createElement(yn,{className:lx.a.icon,name:n}),"string"==typeof r&&this.highlightMatchingTextPart(r),"function"==typeof r&&r(this.highlightMatchingTextPart)))}}])&&fx(t.prototype,n),r&&fx(t,r),i}(y.a.PureComponent);mx.defaultProps={minWidth:0,query:""};var bx,vx,gx,wx,_x=n(393),Ox=n.n(_x);function Sx(e){return(Sx="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function kx(e,t,n,r){n&&Object.defineProperty(e,t,{enumerable:n.enumerable,configurable:n.configurable,writable:n.writable,value:n.initializer?n.initializer.call(r):void 0})}function Px(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function jx(e,t){for(var n=0;n0&&n(r[0])},e.handleUp=function(){var t=e.buttons[e.activeButtonIndex-1];t&&t.focus()},e.handleDown=function(){var t=e.buttons[e.activeButtonIndex+1];t&&t.focus()},e}return t=i,(n=[{key:"componentDidUpdate",value:function(e){!0===this.props.open&&!1===e.open&&(il.a.bind("up",this.handleUp),il.a.bind("down",this.handleDown)),!1===this.props.open&&!0===e.open&&(il.a.unbind("up"),il.a.unbind("down"))}},{key:"render",value:function(){var e=this.props,t=e.anchorElement,n=e.idProperty,r=e.minWidth,o=e.onSelect,i=e.open,a=e.query,u=e.searchProperties,l=e.suggestions;return y.a.createElement(Ec,{anchorElement:t,horizontalOffset:5,onClose:this.handlePopoverClose,open:i,popoverChildRef:this.setSuggestionsRef,verticalOffset:-2},(function(e,t){return y.a.createElement(Jd,{menuRef:e,style:t},l.map((function(e){return y.a.createElement(mx,{key:e[n],minWidth:r,onSelect:o,query:a,value:e},(function(t){return u.map((function(n){return y.a.createElement("span",{className:Ox.a.column,key:n},t(e[n]))}))}))})))}))}},{key:"buttons",get:function(){return this.suggestionsRef?Array.from(this.suggestionsRef.getElementsByTagName("button")):[]}},{key:"activeButtonIndex",get:function(){return this.buttons.findIndex((function(e){return e===document.activeElement}))}}])&&jx(t.prototype,n),r&&jx(t,r),i}(y.a.Component),gx.defaultProps={idProperty:"id",minWidth:0},vx=Rx((bx=wx).prototype,"suggestionsRef",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Rx(bx.prototype,"buttons",[v.g],Object.getOwnPropertyDescriptor(bx.prototype,"buttons"),bx.prototype),Rx(bx.prototype,"activeButtonIndex",[v.g],Object.getOwnPropertyDescriptor(bx.prototype,"activeButtonIndex"),bx.prototype),bx),$x=n(60),Gx=n.n($x);function Zx(e){return(Zx="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Jx(e){return function(e){if(Array.isArray(e))return Qx(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Qx(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Qx(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Qx(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0||0!==t.length&&void e.handleDelete(t[t.length-1])},eT(e,"handleSelect",Wx,aT(e)),e.debouncedSearch=Wn()((function(t){e.props.onSearch(t)}),300),e}return t=i,(n=[{key:"render",value:function(){var e=this,t=this.props,n=t.disabled,r=t.displayProperty,o=t.id,i=t.idProperty,a=t.loading,u=t.searchProperties,l=t.suggestions,s=t.value,c=!!this.inputValue&&this.inputValue.length>0&&l.length>0,f=tn()(Gx.a.multiAutoComplete,Xx({},Gx.a.disabled,n)),p=tn()(Gx.a.input,"mousetrap");return y.a.createElement(h.Fragment,null,y.a.createElement("label",{className:f,ref:this.setLabelRef},y.a.createElement("div",{className:Gx.a.icon},a?y.a.createElement(_i,{size:16}):y.a.createElement(yn,{name:"su-search"})),y.a.createElement("div",{className:Gx.a.items},s.map((function(t){return y.a.createElement("span",{className:Gx.a.chip,key:t[i]},y.a.createElement(Ak,{disabled:n,onDelete:e.handleDelete,value:t},t[r]))})),y.a.createElement("input",{className:p,disabled:n,id:o,onBlur:this.handleInputBlur,onChange:this.handleInputChange,onFocus:this.handleInputFocus,ref:this.setInputRef,value:this.inputValue}))),y.a.createElement(Kx,{anchorElement:this.labelRef,idProperty:i,minWidth:this.popoverMinWidth,onSelect:this.handleSelect,open:!n&&c,query:this.inputValue,searchProperties:u,suggestions:l}))}},{key:"popoverMinWidth",get:function(){return this.labelRef?this.labelRef.scrollWidth-10:0}}])&&nT(t.prototype,n),r&&nT(t,r),i}(y.a.Component),Ux.defaultProps={allowAdd:!1,disabled:!1,idProperty:"id",loading:!1},Lx=lT((Ax=qx).prototype,"labelRef",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ix=lT(Ax.prototype,"inputRef",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),zx=lT(Ax.prototype,"inputValue",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),Fx=lT(Ax.prototype,"setLabelRef",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){t&&(e.labelRef=t)}}}),Yx=lT(Ax.prototype,"setInputRef",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){var n=e.props.inputRef;n&&n(t),t&&(e.inputRef=t)}}}),lT(Ax.prototype,"popoverMinWidth",[v.g],Object.getOwnPropertyDescriptor(Ax.prototype,"popoverMinWidth"),Ax.prototype),Nx=lT(Ax.prototype,"handleDelete",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){var n=e.props,r=n.onChange,o=n.onFinish;r(n.value.filter((function(e){return e!=t}))),o&&o()}}}),Bx=lT(Ax.prototype,"handleInputChange",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){e.inputValue=t.currentTarget.value,e.debouncedSearch(e.inputValue)}}}),Hx=lT(Ax.prototype,"handleInputFocus",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){il.a.bind("enter",e.handleEnterAndComma),il.a.bind(",",e.handleEnterAndComma),il.a.bind("backspace",e.handleBackspace)}}}),Vx=lT(Ax.prototype,"handleInputBlur",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return function(){il.a.unbind("enter"),il.a.unbind(","),il.a.unbind("backspace")}}}),Wx=lT(Ax.prototype,"handleSelect",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){var n=e.props,r=n.onChange,o=n.onFinish,i=n.value;r([].concat(Jx(i),[t])),e.inputValue="",e.inputRef.focus(),o&&o()}}}),Mx=Ax))||Mx;function yT(e){return function(e){if(Array.isArray(e))return mT(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return mT(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return mT(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function mT(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:{};_T(this,e),wT(this,"searchResults",cT,this),wT(this,"loading",fT,this),wT(this,"clearSearchResults",pT,this),wT(this,"search",dT,this),this.resourceKey=t,this.searchProperties=n,this.options=r}).prototype,"searchResults",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),fT=OT(sT.prototype,"loading",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),pT=OT(sT.prototype,"clearSearchResults",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){e.searchResults.splice(0,e.searchResults.length)}}}),dT=OT(sT.prototype,"search",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,r=e.resourceKey,o=e.searchProperties;return t?(e.loading=!0,no.getList(r,vT(vT({},e.options),{},{excludedIds:n,limit:10,page:1,searchFields:o,search:t})).then(Object(v.d)((function(t){var n;return e.clearSearchResults(),(n=e.searchResults).push.apply(n,yT(t._embedded[r])),e.loading=!1,e.searchResults}))).catch(Object(v.d)((function(){e.loading=!1}))).then((function(){return[]}))):(e.clearSearchResults(),Promise.resolve([]))}}}),sT);function ET(e){return(ET="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function CT(e,t){for(var n=0;n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function NT(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"id";UT(this,e),WT(this,"initialLoading",AT,this),WT(this,"deleting",LT,this),WT(this,"patching",IT,this),WT(this,"data",zT,this),this.resourceKey=t,this.requestParameters=r,this.idProperty=o,this.initialLoading=!0,no.getList(t,r).then(Object(v.d)((function(e){n.data=e._embedded[t],n.initialLoading=!1}))).catch(Object(v.d)((function(){n.initialLoading=!1})))}return KT(e,[{key:"loading",get:function(){return this.initialLoading||this.deleting||this.patching}}]),KT(e,[{key:"deleteList",value:function(e){var t=this;return this.deleting=!0,no.deleteList(this.resourceKey,HT(HT({},this.requestParameters),{},{ids:e})).then(Object(v.d)((function(){var n,r=YT(e);try{var o=function(){var e=n.value;t.data.splice(t.data.findIndex((function(n){return n[t.idProperty]===e})),1)};for(r.s();!(n=r.n()).done;)o()}catch(e){r.e(e)}finally{r.f()}t.deleting=!1})))}},{key:"patchList",value:function(e){var t=this;return this.patching=!0,no.patchList(this.resourceKey,e).then(Object(v.d)((function(e){var n,r=YT(e);try{var o=function(){var e=n.value,r=t.data.findIndex((function(n){return n[t.idProperty]===e[t.idProperty]}));-1===r?t.data.push(e):t.data[r]=e};for(r.s();!(n=r.n()).done;)o()}catch(e){r.e(e)}finally{r.f()}t.patching=!1})))}}]),e}()).prototype,"initialLoading",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),LT=$T(MT.prototype,"deleting",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),IT=$T(MT.prototype,"patching",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),zT=$T(MT.prototype,"data",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),$T(MT.prototype,"loading",[v.g],Object.getOwnPropertyDescriptor(MT.prototype,"loading"),MT.prototype),$T(MT.prototype,"deleteList",[v.d],Object.getOwnPropertyDescriptor(MT.prototype,"deleteList"),MT.prototype),$T(MT.prototype,"patchList",[v.d],Object.getOwnPropertyDescriptor(MT.prototype,"patchList"),MT.prototype),MT);function nD(e){return(nD="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function rD(e,t,n,r){n&&Object.defineProperty(e,t,{enumerable:n.enumerable,configurable:n.configurable,writable:n.writable,value:n.initializer?n.initializer.call(r):void 0})}function oD(e,t){for(var n=0;n=y.a.Children.count(t)&&(this.activeColumnIndex=0),this.container&&this.props.children!==e.children&&(this.container.scrollLeft=this.columnWidth*(y.a.Children.count(t)-1))}},{key:"render",value:function(){var e,t=this.props.children,n=-this.scrollPosition+this.activeColumnIndex*this.columnWidth,r=tn()(bM.a.columnListContainer,(gM(e={},bM.a.firstVisibleColumnActive,n<=0),gM(e,bM.a.lastVisibleColumnActive,n>=this.containerWidth-this.columnWidth),e)),o=this.props.toolbarItemsProvider(this.activeColumnIndex);return y.a.createElement("div",{className:bM.a.columnListToolbarContainer},!!o&&y.a.createElement("div",{className:bM.a.toolbarContainer,style:{marginLeft:n}},!!o.length&&y.a.createElement(yM,{toolbarItems:o,toolbarRef:this.setToolbarRef})),y.a.createElement("div",{className:r,ref:this.setContainerRef},y.a.createElement("div",{className:bM.a.columnList},this.cloneColumns(t))))}},{key:"columnWidth",get:function(){var e=parseInt(bM.a.columnWidth);return isNaN(e)?0:e}},{key:"containerWidth",get:function(){return this.container?this.container.clientWidth:0}},{key:"containerScrollWidth",get:function(){return this.container?this.container.scrollWidth:0}},{key:"containerScrolling",get:function(){return this.containerWidth=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function dA(e){return function(e){if(Array.isArray(e))return yA(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||hA(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function hA(e,t){if(e){if("string"==typeof e)return yA(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?yA(e,t):void 0}}function yA(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);nt})).forEach((function(e){return n.delete(e)}))}var wA,_A,OA,SA,kA,PA,jA=(cA=vA((sA=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),function(e,t,n,r){n&&Object.defineProperty(e,t,{enumerable:n.enumerable,configurable:n.configurable,writable:n.writable,value:n.initializer?n.initializer.call(r):void 0})}(this,"rawData",cA,this),this.rawData.set(void 0,[])}return bA(e,[{key:"visibleItems",get:function(){return this.data.reduce((function(e,t){return e.concat.apply(e,dA(t))}),[])}},{key:"activeItems",get:function(){return Array.from(this.rawData.keys())}},{key:"data",get:function(){return Array.from(this.rawData.values())}}]),bA(e,[{key:"activate",value:function(e){var t=this.data.findIndex((function(t){return-1!==t.findIndex((function(t){return t.id===e}))}));gA(this.activeItems,t,this.rawData),this.rawData.set(e,[])}},{key:"remove",value:function(e){var t,n=pA(this.activeItems.keys());try{for(n.s();!(t=n.n()).done;){var r=t.value,o=this.activeItems[r];if(o){var i=this.rawData.get(o);if(i){var a,u=pA(i.keys());try{for(u.s();!(a=u.n()).done;){var l=a.value,s=i[l].id;if(s===e&&(this.activeItems.includes(s)&&gA(this.activeItems,r,this.rawData),i.splice(l,1),0===i.length)){var c=this.findById(o);c&&(c.hasChildren=!1)}}}catch(e){u.e(e)}finally{u.f()}}}}}catch(e){n.e(e)}finally{n.f()}}},{key:"findById",value:function(e){var t,n=pA(this.data);try{for(n.s();!(t=n.n()).done;){var r,o=pA(t.value);try{for(o.s();!(r=o.n()).done;){var i=r.value;if(i.id===e)return i}}catch(e){o.e(e)}finally{o.f()}}}catch(e){n.e(e)}finally{n.f()}}},{key:"order",value:function(e,t){var n,r=pA(this.rawData.keys());try{for(r.s();!(n=r.n()).done;){var o=n.value,i=this.rawData.get(o);if(i){var a=i.findIndex((function(t){return t.id===e}));if(-1!==a)return void this.rawData.set(o,Si()(i,a,t-1))}}}catch(e){r.e(e)}finally{r.f()}throw new Error('The id "'+e+'" was tried to be ordered to a different position, but it does not exist!')}},{key:"clear",value:function(e){e||(this.rawData.clear(),this.rawData.set(e,[]));var t=this.activeItems.indexOf(e);if(-1!==t){gA(this.activeItems,t,this.rawData);var n=this.rawData.get(e);n&&n.length>0&&n.splice(0,n.length)}}},{key:"addItem",value:function(e,t){var n=this,r=this.rawData.get(t);if(r||(r=[],this.rawData.set(t,r)),r.push(e),e._embedded){var o=Object.keys(e._embedded)[0],i=e._embedded[o];Array.isArray(i)&&!this.rawData.has(e.id)&&(this.rawData.set(e.id,[]),i.forEach((function(t){n.addItem(t,e.id)})))}}}]),e}()).prototype,"rawData",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return new Map}}),vA(sA.prototype,"visibleItems",[v.g],Object.getOwnPropertyDescriptor(sA.prototype,"visibleItems"),sA.prototype),vA(sA.prototype,"activeItems",[v.g],Object.getOwnPropertyDescriptor(sA.prototype,"activeItems"),sA.prototype),vA(sA.prototype,"data",[v.g],Object.getOwnPropertyDescriptor(sA.prototype,"data"),sA.prototype),vA(sA.prototype,"remove",[v.d],Object.getOwnPropertyDescriptor(sA.prototype,"remove"),sA.prototype),vA(sA.prototype,"order",[v.d],Object.getOwnPropertyDescriptor(sA.prototype,"order"),sA.prototype),vA(sA.prototype,"clear",[v.d],Object.getOwnPropertyDescriptor(sA.prototype,"clear"),sA.prototype),sA),EA=n(397),CA=n.n(EA);function xA(e){return(xA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function TA(e){return function(e){if(Array.isArray(e))return DA(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return DA(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return DA(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function DA(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);na&&(n=a),i(t,n).then((function(e){return e.ordered}))},e.getIndicators=function(t){if(t.ghostLocale)return[y.a.createElement(YM,{key:"ghost",locale:t.ghostLocale})];var n=[];if(t._hasPermissions&&n.push(y.a.createElement(yn,{key:"permissions",name:"su-permissions"})),"internal"===t.linked?n.push(y.a.createElement(yn,{key:"internal",name:"su-link2"})):"external"===t.linked?n.push(y.a.createElement(yn,{key:"external",name:"su-link"})):t.shadowLocale&&n.push(y.a.createElement(yn,{key:"shadow",name:"su-shadow-page"})),void 0!==t.publishedState||void 0!==t.published){var r=!t.publishedState,o=!!t.published;!r&&o||n.push(y.a.createElement(ZM,{draft:r,key:"publish",published:o}))}var i=e.props.adapterOptions,a=(i=void 0===i?{}:i).get_indicators;if(a){if("function"!=typeof a)throw new Error('The "get_indicators" option of the ColumnListAdapter must be a function!');n.push.apply(n,TA(a(t)))}return n},e.getButtons=function(t){var n=e.props,r=n.onItemClick,o=n.onItemSelectionChange,i=!!t.ghostLocale,a=[],u=t._permissions,l=(u=void 0===u?{}:u).view,s=void 0===l||l,c=u.edit;if(r){var f=i?"su-plus-circle":void 0===c||c?"su-pen":"su-eye";a.push({icon:f,onClick:r,visible:s})}if(o){var p={icon:"su-check",onClick:e.handleItemSelectionChange};a.push(p)}return a},e.getToolbarItems=function(t){var n=e.props,r=n.activeItems,o=n.adapterOptions,i=(o=void 0===o?{}:o).display_root_level_toolbar,a=void 0===i||i,u=n.data,l=n.onItemAdd,s=n.onRequestItemCopy,c=n.onRequestItemDelete,f=n.onRequestItemMove,p=n.onRequestItemOrder;if(!r)throw new Error("The ColumnListAdapter does not work without activeItems. This error should not happen and is likely a bug.");if(!a&&!r[t])return[];if(e.orderColumn===t)return[{icon:"su-times",type:"button",onClick:Object(v.d)((function(){e.orderColumn=void 0}))}];var d=[],h=u[t-1],y=((h?h.find((function(e){return e.id===r[t]})):void 0)||{})._permissions,m=(y=void 0===y?{}:y).add,b=void 0===m||m,g=y.edit,w=void 0===g||g;l&&b&&d.push({icon:"su-plus-circle",type:"button",onClick:function(){l(r[t])}});var _=void 0!==r[t+1],O=u[t],S=((O?O.find((function(e){return e.id===r[t+1]})):void 0)||{})._permissions,k=(S=void 0===S?{}:S).delete,P=void 0===k||k,j=S.edit,E=void 0===j||j,C=[];return c&&C.push({disabled:!_||!P,label:Nr("sulu_admin.delete"),onClick:function(){var e=r[t+1];if(!e)throw new Error("An undefined itemId cannot be deleted! This should not happen and is likely a bug.");c(e)}}),f&&C.push({disabled:!_||!E,label:Nr("sulu_admin.move"),onClick:function(){var e=r[t+1];if(!e)throw new Error("An undefined itemId cannot be deleted! This should not happen and is likely a bug.");f(e)}}),s&&C.push({disabled:!_||!E,label:Nr("sulu_admin.copy"),onClick:function(){var e=r[t+1];if(!e)throw new Error("An undefined itemId cannot be deleted! This should not happen and is likely a bug.");s(e)}}),p&&C.push({disabled:!w,label:Nr("sulu_admin.order"),onClick:Object(v.d)((function(){e.orderColumn=t}))}),C.length>0&&d.push({icon:"su-cog",type:"dropdown",options:C}),d.length>0?d:void 0},e}return t=i,(n=[{key:"render",value:function(){var e=this,t=this.props,n=t.activeItems,r=t.disabledIds,o=t.loading,i=t.onItemClick,a=t.selections;return y.a.createElement("div",{className:CA.a.columnListAdapter},y.a.createElement(xM,{onItemClick:this.handleItemClick,onItemDoubleClick:i,toolbarItemsProvider:this.getToolbarItems},this.props.data.map((function(t,i){return y.a.createElement(xM.Column,{key:i,loading:i>=e.props.data.length-1&&o},t.map((function(t,o){return y.a.createElement(xM.Item,{active:n?n.includes(t.id):void 0,buttons:e.getButtons(t),disabled:r.includes(t.id),hasChildren:t.hasChildren,id:t.id,indicators:e.getIndicators(t),key:t.id,onOrderChange:e.handleOrderChange,order:o+1,selected:a.includes(t.id),showOrderField:e.orderColumn===i},t.title||t.name)})))}))))}}])&&AA(t.prototype,n),r&&AA(t,r),i}(k_),kA.LoadingStrategy=fA,kA.StructureStrategy=jA,kA.icon="su-columns",kA.searchable=!1,kA.defaultProps={data:[]},OA=NA((_A=PA).prototype,"orderColumn",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){}}),SA=NA(_A.prototype,"handleItemClick",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){var n=e.props,r=n.data,o=n.onItemActivate;void 0!==e.orderColumn&&null!==e.orderColumn&&r[e.orderColumn].some((function(e){return e.id===t}))||o&&(o(t),e.orderColumn=void 0)}}}),wA=_A))||wA,HA=n(12),VA=n.n(HA);function WA(e){return(WA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function UA(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function qA(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0){var u=e.createHeaderButtonCells();u&&i.push.apply(i,nL(u))}return o||(e.isMultipleSelect()?i.push(e.createCheckboxCell()):e.isSingleSelect()&&i.push(e.createEmptyCell())),a.unshift.apply(a,i),a},e.createHeaderCells=function(t){return y.a.Children.map(t,(function(t,n){var r="header-".concat(n),o=t.props,i=o.children;return 0===n&&(i=e.createFirstCell(i)),y.a.cloneElement(t,eL(eL({},o),{},{key:r,children:i}))}))},e.createFirstCell=function(t){var n=e.props,r=n.allSelected,o=n.selectInFirstCell,i=n.onAllSelectionChange,a=n.skin;return o&&e.isMultipleSelect()&&i?y.a.createElement(h.Fragment,null,y.a.createElement("span",{className:VA.a.cellSelect},y.a.createElement(Nh,{checked:r,onChange:e.handleAllSelectionChange,skin:"dark"===a?"light":"dark"})),t):t},e.createHeaderButtonCells=function(){var t=e.props.buttons;return t?t.map((function(e,t){var n="header-button-".concat(t);return y.a.createElement(JA,{className:VA.a.headerButtonCell,key:n},y.a.createElement(yn,{name:e.icon}))})):null},e.createCheckboxCell=function(){var t=e.props.skin;return y.a.createElement(JA,{key:"header-checkbox"},y.a.createElement(Nh,{checked:e.props.allSelected,onChange:e.handleAllSelectionChange,skin:"dark"===t?"light":"dark"}))},e.createEmptyCell=function(){return y.a.createElement(JA,{key:"header-empty"})},e.handleAllSelectionChange=function(t){var n=e.props.onAllSelectionChange;n&&n(t)},e}return t=i,(n=[{key:"render",value:function(){var e=this.props.children,t=this.createHeader(e);return y.a.createElement("thead",{className:VA.a.header},y.a.createElement("tr",null,t))}}])&&iL(t.prototype,n),r&&iL(t,r),i}(y.a.PureComponent);cL.defaultProps={allSelected:!1,selectInFirstCell:!1,selectMode:"none",skin:"dark"};var fL=n(125),pL=n.n(fL);function dL(e){return(dL="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function hL(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function yL(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0){var a=e.createButtonCells();a&&i.push.apply(i,$L(a))}if(!o){var u=e.createSelect();u&&i.push(y.a.createElement(LL,{key:"choice",small:!0},u))}var l=e.cloneCells(t);return l.unshift(i),l},e.cloneCells=function(t){return y.a.Children.map(t,(function(t,n){var r="cell-".concat(n),o=t.props,i=0===n,a=e.props.depth,u=o.children;return i&&(u=e.createFirstCell(u)),y.a.cloneElement(t,qL(qL({},o),{},{key:r,children:u,depth:i&&a?a:void 0}))}))},e.createFirstCell=function(t){var n=e.props,r=n.hasChildren,o=n.selectInFirstCell,i=n.onSelectionChange;return y.a.createElement(h.Fragment,null,o&&i&&y.a.createElement("div",{className:VA.a.cellSelect},e.createSelect()),r&&e.createToggler(),t)},e.createSelect=function(){return e.props.onSelectionChange?e.isSingleSelect()?e.createRadioCell():e.isMultipleSelect()?e.createCheckboxCell():void 0:null},e.createToggler=function(){var t=e.props,n=t.isLoading,r=t.expanded;return y.a.createElement("span",{className:VA.a.toggleIcon},n?y.a.createElement(wi,{size:10}):y.a.createElement(hn,{name:!0===r?"su-angle-down":"su-angle-right",onClick:!1===r?e.handleExpand:e.handleCollapse}))},e.createRadioCell=function(){var t=e.props.selected;return y.a.createElement(wL,{checked:t,onChange:e.handleSingleSelectionChange,skin:"dark",value:e.getIdentifier()})},e.createCheckboxCell=function(){var t=e.props.selected;return y.a.createElement(Nh,{checked:t,onChange:e.handleMultipleSelectionChange,skin:"dark",value:e.getIdentifier()})},e.createButtonCells=function(){var t=e.props,n=t.buttons,r=t.rowIndex;return n?n.map((function(t,n){var o="control-".concat(r,"-").concat(n),i=t.disabled,a=t.icon,u=t.onClick;return y.a.createElement(VL,{disabled:i,icon:a,key:o,onClick:u,rowId:e.getIdentifier(),rowIndex:r})})):null},e.handleCollapse=function(){var t=e.props.onCollapse;t&&t(e.getIdentifier())},e.handleExpand=function(){var t=e.props.onExpand;t&&t(e.getIdentifier())},e.handleSingleSelectionChange=function(t){var n=e.props.onSelectionChange;n&&t&&n(t)},e.handleMultipleSelectionChange=function(t,n){var r=e.props.onSelectionChange;r&&null!=n&&r(n,t)},e}return t=i,(n=[{key:"render",value:function(){var e=this.props,t=e.children,n=e.disabled,r=tn()(VA.a.row,KL({},VA.a.disabled,n)),o=this.createCells(t);return y.a.createElement("tr",{className:r},o)}}])&&JL(t.prototype,n),r&&JL(t,r),i}(y.a.PureComponent);function rI(e){return(rI="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function oI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function iI(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function RI(e){return function(e){if(Array.isArray(e))return AI(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||MI(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function MI(e,t){if(e){if("string"==typeof e)return AI(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?AI(e,t):void 0}}function AI(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0){var o=Object.keys(e._embedded)[0],i=e._embedded[o];i&&i.forEach((function(t){return n.addItem(t,e.id)}))}}},{key:"clear",value:function(e){var t=LI(this.data,e);t&&0!==t.length&&t.splice(0,t.length)}},{key:"visibleItems",get:function(){return function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];n.push.apply(n,RI(t.map((function(e){return e.data}))));var r,o=DI(t);try{for(o.s();!(r=o.n()).done;){var i=r.value;e(i.children,n)}}catch(e){o.e(e)}finally{o.f()}return n}(this.data)}}])&&xI(t.prototype,n),r&&xI(t,r),e}()).prototype,"data",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),TI(jI.prototype,"visibleItems",[v.g],Object.getOwnPropertyDescriptor(jI.prototype,"visibleItems"),jI.prototype),TI(jI.prototype,"order",[v.d],Object.getOwnPropertyDescriptor(jI.prototype,"order"),jI.prototype),TI(jI.prototype,"clear",[v.d],Object.getOwnPropertyDescriptor(jI.prototype,"clear"),jI.prototype),jI),NI=n(177),BI=n.n(NI);function HI(e){return(HI="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function VI(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function WI(e,t){for(var n=0;n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function oz(e){return function(e){if(Array.isArray(e))return az(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||iz(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function iz(e,t){if(e){if("string"==typeof e)return az(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?az(e,t):void 0}}function az(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:0,r=[],o=this.props,i=o.disabledIds,a=o.selections,u=rz(e);try{for(u.s();!(t=u.n()).done;){var l=t.value,s=l.data,c=l.hasChildren;r.push(y.a.createElement(CI.Row,{buttons:this.getButtons(l),depth:n,disabled:i.includes(s.id),expanded:l.children.length>0,hasChildren:c,id:s.id,isLoading:this.props.active===s.id&&this.props.loading,key:s.id,selected:a.includes(s.id)},this.renderCells(s))),r.push.apply(r,oz(this.renderRows(l.children,n+1)))}}catch(e){u.e(e)}finally{u.f()}return r}},{key:"render",value:function(){var e=this.props,t=e.active,n=e.data,r=e.loading,o=e.onAllSelectionChange,i=e.onItemSelectionChange,a=e.options.showHeader,u=void 0===a||a;return!t&&r?y.a.createElement(_i,null):y.a.createElement(CI,{buttons:this.getButtons(),onAllSelectionChange:o,onRowCollapse:this.handleRowCollapse,onRowExpand:this.handleRowExpand,onRowSelectionChange:i,selectInFirstCell:!0,selectMode:"multiple"},u&&y.a.createElement(CI.Header,null,this.renderHeaderCells()),y.a.createElement(CI.Body,null,this.renderRows(n)))}}])&&sz(t.prototype,n),r&&sz(t,r),i}(tz),XI.LoadingStrategy=fA,XI.StructureStrategy=YI,XI.icon="su-tree-list",JI=yz((ZI=ez).prototype,"handleRowCollapse",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){e.props.onItemDeactivate(t)}}}),QI=yz(ZI.prototype,"handleRowExpand",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){e.props.onItemActivate(t)}}}),GI=ZI))||GI,kz=n(76),Pz=n.n(kz);function jz(e){return(jz="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ez(e,t,n,r){n&&Object.defineProperty(e,t,{enumerable:n.enumerable,configurable:n.configurable,writable:n.writable,value:n.initializer?n.initializer.call(r):void 0})}function Cz(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xz(e,t){for(var n=0;n1},e.handlePreviousClick=function(){var t=e.props,n=t.currentPage,r=t.onPageChange;e.hasPreviousPage()&&n&&r(n-1)},e.handleNextClick=function(){var t=e.props,n=t.currentPage,r=t.onPageChange;e.hasNextPage()&&n&&r(n+1)},e.handleLimitChange=function(t){var n=e.props,r=n.currentLimit,o=n.onLimitChange,i=parseInt(t);i!==r&&o(i)},Ez(e,"handleInputChange",gz,Mz(e)),Ez(e,"handleInputBlur",wz,Mz(e)),e}return t=i,(n=[{key:"componentDidMount",value:function(){this.props.currentPage&&(this.currentInputValue=this.props.currentPage)}},{key:"componentDidUpdate",value:function(e){var t=this.props.currentPage;if(e.currentPage!==t){if(!t)return void(this.currentInputValue=1);this.currentInputValue=t}}},{key:"render",value:function(){var e=this.currentInputValue,t=this.props,n=t.children,r=t.loading,o=t.totalPages,i=t.currentLimit;return y.a.createElement("section",null,n,y.a.createElement("nav",{className:Pz.a.pagination},y.a.createElement("span",{className:Pz.a.display},Nr("sulu_admin.per_page"),":"),y.a.createElement("span",null,y.a.createElement(em,{onChange:this.handleLimitChange,skin:"dark",value:i},Iz.map((function(e){return y.a.createElement(em.Option,{key:e,value:e},e)})))),y.a.createElement("div",{className:Pz.a.loader},r&&y.a.createElement(_i,{size:24})),y.a.createElement("span",null,Nr("sulu_admin.page"),":"),y.a.createElement("span",{className:Pz.a.inputContainer},y.a.createElement(ha,{alignment:"center",inputMode:"numeric",onBlur:this.handleInputBlur,onChange:this.handleInputChange,skin:"dark",type:"text",value:e})),y.a.createElement("span",{className:Pz.a.display},Nr("sulu_admin.of")," ",o),y.a.createElement(eO,null,y.a.createElement(Ii,{disabled:!this.hasPreviousPage(),icon:"su-angle-left",onClick:this.handlePreviousClick}),y.a.createElement(Ii,{disabled:!this.hasNextPage(),icon:"su-angle-right",onClick:this.handleNextClick}))))}}])&&xz(t.prototype,n),r&&xz(t,r),i}(y.a.Component),_z.defaultProps={loading:!1},vz=Lz((bz=Oz).prototype,"currentInputValue",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 1}}),Lz(bz.prototype,"componentDidMount",[v.d],Object.getOwnPropertyDescriptor(bz.prototype,"componentDidMount"),bz.prototype),Lz(bz.prototype,"componentDidUpdate",[v.d],Object.getOwnPropertyDescriptor(bz.prototype,"componentDidUpdate"),bz.prototype),gz=Lz(bz.prototype,"handleInputChange",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){if(void 0!==t){var n=parseInt(t);isNaN(n)||(e.currentInputValue=n)}else e.currentInputValue=void 0}}}),wz=Lz(bz.prototype,"handleInputBlur",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){var t=e.props,n=t.currentPage,r=t.onPageChange,o=t.totalPages,i=e.currentInputValue;!i||!o||i<1?i=1:i>o&&(i=o),i!==n&&r(i),e.currentInputValue=n}}}),mz=bz))||mz;function Fz(e){return(Fz="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Yz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Nz(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Bz(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Hz(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&i.deleteList(l.map((function(e){return e[r]}))),u.length>0||s.length>0){var c=[].concat(RB(u),RB(s)).filter((function(e){return e[n]}));i.patchList(c)}o()}}}),gB=wB))||gB;function ZB(e){return(ZB="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function JB(e,t,n,r){n&&Object.defineProperty(e,t,{enumerable:n.enumerable,configurable:n.configurable,writable:n.writable,value:n.initializer?n.initializer.call(r):void 0})}function QB(e,t){for(var n=0;n0&&u.length>0;return y.a.createElement("div",{className:yH.a.singleAutoComplete},y.a.createElement(ha,{autocomplete:"off",disabled:t,icon:"su-search",id:n,inputClass:"mousetrap",labelRef:this.setLabelRef,loading:r,onBlur:o,onChange:this.handleInputChange,placeholder:i,value:l}),y.a.createElement(Kx,{anchorElement:this.labelRef,minWidth:this.popoverMinWidth,onSelect:this.handleSelect,open:!t&&s,query:l,searchProperties:a,suggestions:u}))}},{key:"popoverMinWidth",get:function(){return this.labelRef?this.labelRef.scrollWidth-10:0}}])&&gH(t.prototype,n),r&&gH(t,r),i}(y.a.Component),fH.defaultProps={disabled:!1},lH=PH((uH=pH).prototype,"labelRef",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),sH=PH(uH.prototype,"inputValue",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return this.props.value?this.props.value[this.props.displayProperty]:void 0}}),PH(uH.prototype,"setInputValue",[v.d],Object.getOwnPropertyDescriptor(uH.prototype,"setInputValue"),uH.prototype),cH=PH(uH.prototype,"setLabelRef",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){t&&(e.labelRef=t)}}}),PH(uH.prototype,"popoverMinWidth",[v.g],Object.getOwnPropertyDescriptor(uH.prototype,"popoverMinWidth"),uH.prototype),aH=uH))||aH;function TH(e){return(TH="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function DH(e,t){for(var n=0;n3&&void 0!==arguments[3]?arguments[3]:{};SV(this,e),OV(this,"item",mV,this),OV(this,"loading",bV,this),this.resourceKey=t,this.locale=r,this.options=o,n&&this.loadItem(n)}var t,n,r;return t=e,(n=[{key:"set",value:function(e){this.item=e}},{key:"clear",value:function(){this.item=void 0}},{key:"setLoading",value:function(e){this.loading=e}},{key:"loadItem",value:function(e){var t=this;if(e)return this.setLoading(!0),no.get(this.resourceKey,wV(wV({},this.options),{},{id:e,locale:this.locale?this.locale.get():void 0})).then(Object(v.d)((function(e){t.item=e,t.setLoading(!1)}))).catch(Object(v.d)((function(e){if(404!==e.status)return Promise.reject(e);t.item=null,t.setLoading(!1)})));this.item=void 0}}])&&kV(t.prototype,n),r&&kV(t,r),e}()).prototype,"item",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),bV=PV(yV.prototype,"loading",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),PV(yV.prototype,"set",[v.d],Object.getOwnPropertyDescriptor(yV.prototype,"set"),yV.prototype),PV(yV.prototype,"clear",[v.d],Object.getOwnPropertyDescriptor(yV.prototype,"clear"),yV.prototype),PV(yV.prototype,"setLoading",[v.d],Object.getOwnPropertyDescriptor(yV.prototype,"setLoading"),yV.prototype),PV(yV.prototype,"loadItem",[v.d],Object.getOwnPropertyDescriptor(yV.prototype,"loadItem"),yV.prototype),yV),AV=n(402),LV=n.n(AV);function IV(e){return(IV="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function zV(e,t,n,r){n&&Object.defineProperty(e,t,{enumerable:n.enumerable,configurable:n.configurable,writable:n.writable,value:n.initializer?n.initializer.call(r):void 0})}function FV(e,t){for(var n=0;na?1:Math.round(100*c/a)/100,t.a!==f)return{h:t.h,s:t.s,l:t.l,a:f,source:"rgb"}}else{var p=void 0;if(r!==(p=s<0?0:s>i?1:Math.round(100*s/i)/100))return{h:t.h,s:t.s,l:t.l,a:p,source:"rgb"}}return null},WW={},UW=function(e,t,n,r){var o=e+"-"+t+"-"+n+(r?"-server":"");if(WW[o])return WW[o];var i=function(e,t,n,r){if("undefined"==typeof document&&!r)return null;var o=r?new r:document.createElement("canvas");o.width=2*n,o.height=2*n;var i=o.getContext("2d");return i?(i.fillStyle=e,i.fillRect(0,0,o.width,o.height),i.fillStyle=t,i.fillRect(0,0,n,n),i.translate(n,n),i.fillRect(0,0,n,n),o.toDataURL()):null}(e,t,n,r);return WW[o]=i,i},qW=Object.assign||function(e){for(var t=1;t-1)){var o=n.getArrowOffset(),i=38===e.keyCode?r+o:r-o;n.setUpdatedValue(i,e)}},n.handleDrag=function(e){if(n.props.dragLabel){var t=Math.round(n.props.value+e.movementX);t>=0&&t<=n.props.dragMax&&n.props.onChange&&n.props.onChange(n.getValueObjectWithLabel(t),e)}},n.handleMouseDown=function(e){n.props.dragLabel&&(e.preventDefault(),n.handleDrag(e),window.addEventListener("mousemove",n.handleDrag),window.addEventListener("mouseup",n.handleMouseUp))},n.handleMouseUp=function(){n.unbindEventListeners()},n.unbindEventListeners=function(){window.removeEventListener("mousemove",n.handleDrag),window.removeEventListener("mouseup",n.handleMouseUp)},n.state={value:String(e.value).toUpperCase(),blurValue:String(e.value).toUpperCase()},n.inputId="rc-editable-input-"+nU++,n}return function(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)}(t,e),eU(t,[{key:"componentDidUpdate",value:function(e,t){this.props.value===this.state.value||e.value===this.props.value&&t.value===this.state.value||(this.input===document.activeElement?this.setState({blurValue:String(this.props.value).toUpperCase()}):this.setState({value:String(this.props.value).toUpperCase(),blurValue:!this.state.blurValue&&String(this.props.value).toUpperCase()}))}},{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"getValueObjectWithLabel",value:function(e){return function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}({},this.props.label,e)}},{key:"getArrowOffset",value:function(){return this.props.arrowOffset||1}},{key:"setUpdatedValue",value:function(e,t){var n=this.props.label?this.getValueObjectWithLabel(e):e;this.props.onChange&&this.props.onChange(n,t),this.setState({value:e})}},{key:"render",value:function(){var e=this,t=HW()({default:{wrap:{position:"relative"}},"user-override":{wrap:this.props.style&&this.props.style.wrap?this.props.style.wrap:{},input:this.props.style&&this.props.style.input?this.props.style.input:{},label:this.props.style&&this.props.style.label?this.props.style.label:{}},"dragLabel-true":{label:{cursor:"ew-resize"}}},{"user-override":!0},this.props);return y.a.createElement("div",{style:t.wrap},y.a.createElement("input",{id:this.inputId,style:t.input,ref:function(t){return e.input=t},value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,onBlur:this.handleBlur,placeholder:this.props.placeholder,spellCheck:"false"}),this.props.label&&!this.props.hideLabel?y.a.createElement("label",{htmlFor:this.inputId,style:t.label,onMouseDown:this.handleMouseDown},this.props.label):null)}}]),t}(h.PureComponent||h.Component),oU=function(e,t,n,r){var o=r.clientWidth,i=r.clientHeight,a="number"==typeof e.pageX?e.pageX:e.touches[0].pageX,u="number"==typeof e.pageY?e.pageY:e.touches[0].pageY,l=a-(r.getBoundingClientRect().left+window.pageXOffset),s=u-(r.getBoundingClientRect().top+window.pageYOffset);if("vertical"===t){var c=void 0;if(s<0)c=359;else if(s>i)c=0;else{c=360*(-100*s/i+100)/100}if(n.h!==c)return{h:c,s:n.s,l:n.l,a:n.a,source:"hsl"}}else{var f=void 0;if(l<0)f=0;else if(l>o)f=359;else{f=360*(100*l/o)/100}if(n.h!==f)return{h:f,s:n.s,l:n.l,a:n.a,source:"hsl"}}return null},iU=function(){function e(e,t){for(var n=0;n-1};var mU=function(e,t){var n=this.__data__,r=fU(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};function bU(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e<=9007199254740991};var Kq=function(e){return null!=e&&qq(e.length)&&!zU(e)};var $q=function(e){return Yq(e)&&Kq(e)},Gq=n(38),Zq=Function.prototype,Jq=Object.prototype,Qq=Zq.toString,Xq=Jq.hasOwnProperty,eK=Qq.call(Object);var tK=function(e){if(!Yq(e)||"[object Object]"!=MU(e))return!1;var t=Aq(e);if(null===t)return!0;var n=Xq.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Qq.call(n)==eK},nK={};nK["[object Float32Array]"]=nK["[object Float64Array]"]=nK["[object Int8Array]"]=nK["[object Int16Array]"]=nK["[object Int32Array]"]=nK["[object Uint8Array]"]=nK["[object Uint8ClampedArray]"]=nK["[object Uint16Array]"]=nK["[object Uint32Array]"]=!0,nK["[object Arguments]"]=nK["[object Array]"]=nK["[object ArrayBuffer]"]=nK["[object Boolean]"]=nK["[object DataView]"]=nK["[object Date]"]=nK["[object Error]"]=nK["[object Function]"]=nK["[object Map]"]=nK["[object Number]"]=nK["[object Object]"]=nK["[object RegExp]"]=nK["[object Set]"]=nK["[object String]"]=nK["[object WeakMap]"]=!1;var rK=function(e){return Yq(e)&&qq(e.length)&&!!nK[MU(e)]};var oK=function(e){return function(t){return e(t)}},iK=n(39),aK=iK.a&&iK.a.isTypedArray,uK=aK?oK(aK):rK;var lK=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]},sK=Object.prototype.hasOwnProperty;var cK=function(e,t,n){var r=e[t];sK.call(e,t)&&cU(r,n)&&(void 0!==n||t in e)||Sq(e,t,n)};var fK=function(e,t,n,r){var o=!n;n||(n={});for(var i=-1,a=t.length;++i-1&&e%1==0&&e0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(TK);var MK=function(e,t){return RK(CK(e,t,PK),e+"")};function AK(e){return(AK="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var LK=function(e,t,n){if(!LU(n))return!1;var r=AK(t);return!!("number"==r?Kq(n)&&yK(t,n.length):"string"==r&&t in n)&&cU(n[t],e)};var IK=function(e){return MK((function(t,n){var r=-1,o=n.length,i=o>1?n[o-1]:void 0,a=o>2?n[2]:void 0;for(i=e.length>3&&"function"==typeof i?(o--,i):void 0,a&&LK(n[0],n[1],a)&&(i=o<3?void 0:i,o=1),t=Object(t);++r=t||n<0||f&&e-s>=i}function m(){var e=NK();if(y(e))return b(e);u=setTimeout(m,function(e){var n=t-(e-l);return f?ZK(n,i-(e-s)):n}(e))}function b(e){return u=void 0,p&&r?d(e):(r=o=void 0,a)}function v(){var e=NK(),n=y(e);if(r=arguments,o=this,l=e,n){if(void 0===u)return h(l);if(f)return clearTimeout(u),u=setTimeout(m,t),d(l)}return void 0===u&&(u=setTimeout(m,t)),a}return t=$K(t)||0,LU(n)&&(c=!!n.leading,i=(f="maxWait"in n)?GK($K(n.maxWait)||0,t):i,p="trailing"in n?!!n.trailing:p),v.cancel=function(){void 0!==u&&clearTimeout(u),s=0,r=l=o=u=void 0},v.flush=function(){return void 0===u?a:b(NK())},v};var QK=function(e,t,n){var r=!0,o=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return LU(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),JK(e,t,{leading:r,maxWait:t,trailing:o})},XK=function(){function e(e,t){for(var n=0;no&&(l=o),s<0?s=0:s>i&&(s=i);var c=l/o,f=1-s/i;return{h:t.h,s:c,v:f,a:t.a,source:"hsv"}}(e,n.props.hsl,n.container),e)},n.handleMouseDown=function(e){n.handleChange(e);var t=n.getContainerRenderWindow();t.addEventListener("mousemove",n.handleChange),t.addEventListener("mouseup",n.handleMouseUp)},n.handleMouseUp=function(){n.unbindEventListeners()},n.throttle=QK((function(e,t,n){e(t,n)}),50),n}return function(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)}(t,e),XK(t,[{key:"componentWillUnmount",value:function(){this.throttle.cancel(),this.unbindEventListeners()}},{key:"getContainerRenderWindow",value:function(){for(var e=this.container,t=window;!t.document.contains(e)&&t.parent!==t;)t=t.parent;return t}},{key:"unbindEventListeners",value:function(){var e=this.getContainerRenderWindow();e.removeEventListener("mousemove",this.handleChange),e.removeEventListener("mouseup",this.handleMouseUp)}},{key:"render",value:function(){var e=this,t=this.props.style||{},n=t.color,r=t.white,o=t.black,i=t.pointer,a=t.circle,u=HW()({default:{color:{absolute:"0px 0px 0px 0px",background:"hsl("+this.props.hsl.h+",100%, 50%)",borderRadius:this.props.radius},white:{absolute:"0px 0px 0px 0px",borderRadius:this.props.radius},black:{absolute:"0px 0px 0px 0px",boxShadow:this.props.shadow,borderRadius:this.props.radius},pointer:{position:"absolute",top:-100*this.props.hsv.v+100+"%",left:100*this.props.hsv.s+"%",cursor:"default"},circle:{width:"4px",height:"4px",boxShadow:"0 0 0 1.5px #fff, inset 0 0 1px 1px rgba(0,0,0,.3),\n 0 0 1px 2px rgba(0,0,0,.4)",borderRadius:"50%",cursor:"hand",transform:"translate(-2px, -2px)"}},custom:{color:n,white:r,black:o,pointer:i,circle:a}},{custom:!!this.props.style});return y.a.createElement("div",{style:u.color,ref:function(t){return e.container=t},onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange},y.a.createElement("style",null,"\n .saturation-white {\n background: -webkit-linear-gradient(to right, #fff, rgba(255,255,255,0));\n background: linear-gradient(to right, #fff, rgba(255,255,255,0));\n }\n .saturation-black {\n background: -webkit-linear-gradient(to top, #000, rgba(0,0,0,0));\n background: linear-gradient(to top, #000, rgba(0,0,0,0));\n }\n "),y.a.createElement("div",{style:u.white,className:"saturation-white"},y.a.createElement("div",{style:u.black,className:"saturation-black"}),y.a.createElement("div",{style:u.pointer},this.props.pointer?y.a.createElement(this.props.pointer,this.props):y.a.createElement("div",{style:u.circle}))))}}]),t}(h.PureComponent||h.Component);var t$=function(e,t){for(var n=-1,r=null==e?0:e.length;++n=128?"#000":"#fff"},y$=function(e,t){var n=e.replace("°","");return c$()(t+" ("+n+")")._ok},m$=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:"span";return function(n){function r(){var e,t,n;_$(this,r);for(var o=arguments.length,i=Array(o),a=0;au))return!1;var s=i.get(e);if(s&&i.get(t))return s==t;var c=-1,f=!0,p=2&n?new M$:void 0;for(i.set(e,t),i.set(t,e);++c1&&(e.a=1),n.props.onChange({h:n.props.hsl.h,s:n.props.hsl.s,l:n.props.hsl.l,a:Math.round(100*e.a)/100,source:"rgb"},t)):(e.h||e.s||e.l)&&("string"==typeof e.s&&e.s.includes("%")&&(e.s=e.s.replace("%","")),"string"==typeof e.l&&e.l.includes("%")&&(e.l=e.l.replace("%","")),1==e.s?e.s=.01:1==e.l&&(e.l=.01),n.props.onChange({h:e.h||n.props.hsl.h,s:Number(hZ(e.s)?n.props.hsl.s:e.s),l:Number(hZ(e.l)?n.props.hsl.l:e.l),source:"hsl"},t))},n.showHighlight=function(e){e.currentTarget.style.background="#eee"},n.hideHighlight=function(e){e.currentTarget.style.background="transparent"},1!==e.hsl.a&&"hex"===e.view?n.state={view:"rgb"}:n.state={view:e.view},n}return function(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)}(t,e),bZ(t,[{key:"render",value:function(){var e=this,t=HW()({default:{wrap:{paddingTop:"16px",display:"flex"},fields:{flex:"1",display:"flex",marginLeft:"-6px"},field:{paddingLeft:"6px",width:"100%"},alpha:{paddingLeft:"6px",width:"100%"},toggle:{width:"32px",textAlign:"right",position:"relative"},icon:{marginRight:"-4px",marginTop:"12px",cursor:"pointer",position:"relative"},iconHighlight:{position:"absolute",width:"24px",height:"28px",background:"#eee",borderRadius:"4px",top:"10px",left:"12px",display:"none"},input:{fontSize:"11px",color:"#333",width:"100%",borderRadius:"2px",border:"none",boxShadow:"inset 0 0 0 1px #dadada",height:"21px",textAlign:"center"},label:{textTransform:"uppercase",fontSize:"11px",lineHeight:"11px",color:"#969696",textAlign:"center",display:"block",marginTop:"12px"},svg:{fill:"#333",width:"24px",height:"24px",border:"1px transparent solid",borderRadius:"5px"}},disableAlpha:{alpha:{display:"none"}}},this.props,this.state),n=void 0;return"hex"===this.state.view?n=y.a.createElement("div",{style:t.fields,className:"flexbox-fix"},y.a.createElement("div",{style:t.field},y.a.createElement(rU,{style:{input:t.input,label:t.label},label:"hex",value:this.props.hex,onChange:this.handleChange}))):"rgb"===this.state.view?n=y.a.createElement("div",{style:t.fields,className:"flexbox-fix"},y.a.createElement("div",{style:t.field},y.a.createElement(rU,{style:{input:t.input,label:t.label},label:"r",value:this.props.rgb.r,onChange:this.handleChange})),y.a.createElement("div",{style:t.field},y.a.createElement(rU,{style:{input:t.input,label:t.label},label:"g",value:this.props.rgb.g,onChange:this.handleChange})),y.a.createElement("div",{style:t.field},y.a.createElement(rU,{style:{input:t.input,label:t.label},label:"b",value:this.props.rgb.b,onChange:this.handleChange})),y.a.createElement("div",{style:t.alpha},y.a.createElement(rU,{style:{input:t.input,label:t.label},label:"a",value:this.props.rgb.a,arrowOffset:.01,onChange:this.handleChange}))):"hsl"===this.state.view&&(n=y.a.createElement("div",{style:t.fields,className:"flexbox-fix"},y.a.createElement("div",{style:t.field},y.a.createElement(rU,{style:{input:t.input,label:t.label},label:"h",value:Math.round(this.props.hsl.h),onChange:this.handleChange})),y.a.createElement("div",{style:t.field},y.a.createElement(rU,{style:{input:t.input,label:t.label},label:"s",value:Math.round(100*this.props.hsl.s)+"%",onChange:this.handleChange})),y.a.createElement("div",{style:t.field},y.a.createElement(rU,{style:{input:t.input,label:t.label},label:"l",value:Math.round(100*this.props.hsl.l)+"%",onChange:this.handleChange})),y.a.createElement("div",{style:t.alpha},y.a.createElement(rU,{style:{input:t.input,label:t.label},label:"a",value:this.props.hsl.a,arrowOffset:.01,onChange:this.handleChange})))),y.a.createElement("div",{style:t.wrap,className:"flexbox-fix"},n,y.a.createElement("div",{style:t.toggle},y.a.createElement("div",{style:t.icon,onClick:this.toggleViews,ref:function(t){return e.icon=t}},y.a.createElement(mZ.a,{style:t.svg,onMouseOver:this.showHighlight,onMouseEnter:this.showHighlight,onMouseOut:this.hideHighlight}))))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return 1!==e.hsl.a&&"hex"===t.view?{view:"rgb"}:null}}]),t}(y.a.Component);vZ.defaultProps={view:"hex"};var gZ=vZ,wZ=function(){var e=HW()({default:{picker:{width:"12px",height:"12px",borderRadius:"6px",transform:"translate(-6px, -1px)",backgroundColor:"rgb(248, 248, 248)",boxShadow:"0 1px 4px 0 rgba(0, 0, 0, 0.37)"}}});return y.a.createElement("div",{style:e.picker})},_Z=function(){var e=HW()({default:{picker:{width:"12px",height:"12px",borderRadius:"6px",boxShadow:"inset 0 0 0 1px #fff",transform:"translate(-6px, -6px)"}}});return y.a.createElement("div",{style:e.picker})},OZ=function(e){var t=e.width,n=e.onChange,r=e.disableAlpha,o=e.rgb,i=e.hsl,a=e.hsv,u=e.hex,l=e.renderers,s=e.styles,c=void 0===s?{}:s,f=e.className,p=void 0===f?"":f,d=e.defaultView,h=HW()(zK({default:{picker:{width:t,background:"#fff",borderRadius:"2px",boxShadow:"0 0 2px rgba(0,0,0,.3), 0 4px 8px rgba(0,0,0,.3)",boxSizing:"initial",fontFamily:"Menlo"},saturation:{width:"100%",paddingBottom:"55%",position:"relative",borderRadius:"2px 2px 0 0",overflow:"hidden"},Saturation:{radius:"2px 2px 0 0"},body:{padding:"16px 16px 12px"},controls:{display:"flex"},color:{width:"32px"},swatch:{marginTop:"6px",width:"16px",height:"16px",borderRadius:"8px",position:"relative",overflow:"hidden"},active:{absolute:"0px 0px 0px 0px",borderRadius:"8px",boxShadow:"inset 0 0 0 1px rgba(0,0,0,.1)",background:"rgba("+o.r+", "+o.g+", "+o.b+", "+o.a+")",zIndex:"2"},toggles:{flex:"1"},hue:{height:"10px",position:"relative",marginBottom:"8px"},Hue:{radius:"2px"},alpha:{height:"10px",position:"relative"},Alpha:{radius:"2px"}},disableAlpha:{color:{width:"22px"},alpha:{display:"none"},hue:{marginBottom:"0px"},swatch:{width:"10px",height:"10px",marginTop:"0px"}}},c),{disableAlpha:r});return y.a.createElement("div",{style:h.picker,className:"chrome-picker "+p},y.a.createElement("div",{style:h.saturation},y.a.createElement(e$,{style:h.Saturation,hsl:i,hsv:a,pointer:_Z,onChange:n})),y.a.createElement("div",{style:h.body},y.a.createElement("div",{style:h.controls,className:"flexbox-fix"},y.a.createElement("div",{style:h.color},y.a.createElement("div",{style:h.swatch},y.a.createElement("div",{style:h.active}),y.a.createElement($W,{renderers:l}))),y.a.createElement("div",{style:h.toggles},y.a.createElement("div",{style:h.hue},y.a.createElement(lU,{style:h.Hue,hsl:i,pointer:wZ,onChange:n})),y.a.createElement("div",{style:h.alpha},y.a.createElement(XW,{style:h.Alpha,rgb:o,hsl:i,pointer:wZ,renderers:l,onChange:n})))),y.a.createElement(gZ,{rgb:o,hsl:i,hex:u,view:d,onChange:n,disableAlpha:r})))};OZ.propTypes={width:ul.a.oneOfType([ul.a.string,ul.a.number]),disableAlpha:ul.a.bool,styles:ul.a.object,defaultView:ul.a.oneOf(["hex","rgb","hsl"])},OZ.defaultProps={width:225,disableAlpha:!1,styles:{}};v$(OZ);var SZ=function(e){var t=e.color,n=e.onClick,r=void 0===n?function(){}:n,o=e.onSwatchHover,i=e.active,a=HW()({default:{color:{background:t,width:"15px",height:"15px",float:"left",marginRight:"5px",marginBottom:"5px",position:"relative",cursor:"pointer"},dot:{absolute:"5px 5px 5px 5px",background:h$(t),borderRadius:"50%",opacity:"0"}},active:{dot:{opacity:"1"}},"color-#FFFFFF":{color:{boxShadow:"inset 0 0 0 1px #ddd"},dot:{background:"#000"}},transparent:{dot:{background:"#000"}}},{active:i,"color-#FFFFFF":"#FFFFFF"===t,transparent:"transparent"===t});return y.a.createElement(P$,{style:a.color,color:t,onClick:r,onHover:o,focusStyle:{boxShadow:"0 0 4px "+t}},y.a.createElement("div",{style:a.dot}))},kZ=function(e){var t=e.hex,n=e.rgb,r=e.onChange,o=HW()({default:{fields:{display:"flex",paddingBottom:"6px",paddingRight:"5px",position:"relative"},active:{position:"absolute",top:"6px",left:"5px",height:"9px",width:"9px",background:t},HEXwrap:{flex:"6",position:"relative"},HEXinput:{width:"80%",padding:"0px",paddingLeft:"20%",border:"none",outline:"none",background:"none",fontSize:"12px",color:"#333",height:"16px"},HEXlabel:{display:"none"},RGBwrap:{flex:"3",position:"relative"},RGBinput:{width:"70%",padding:"0px",paddingLeft:"30%",border:"none",outline:"none",background:"none",fontSize:"12px",color:"#333",height:"16px"},RGBlabel:{position:"absolute",top:"3px",left:"0px",lineHeight:"16px",textTransform:"uppercase",fontSize:"12px",color:"#999"}}}),i=function(e,t){e.r||e.g||e.b?r({r:e.r||n.r,g:e.g||n.g,b:e.b||n.b,source:"rgb"},t):r({hex:e.hex,source:"hex"},t)};return y.a.createElement("div",{style:o.fields,className:"flexbox-fix"},y.a.createElement("div",{style:o.active}),y.a.createElement(rU,{style:{wrap:o.HEXwrap,input:o.HEXinput,label:o.HEXlabel},label:"hex",value:t,onChange:i}),y.a.createElement(rU,{style:{wrap:o.RGBwrap,input:o.RGBinput,label:o.RGBlabel},label:"r",value:n.r,onChange:i}),y.a.createElement(rU,{style:{wrap:o.RGBwrap,input:o.RGBinput,label:o.RGBlabel},label:"g",value:n.g,onChange:i}),y.a.createElement(rU,{style:{wrap:o.RGBwrap,input:o.RGBinput,label:o.RGBlabel},label:"b",value:n.b,onChange:i}))},PZ=function(e){var t=e.onChange,n=e.onSwatchHover,r=e.colors,o=e.hex,i=e.rgb,a=e.styles,u=void 0===a?{}:a,l=e.className,s=void 0===l?"":l,c=HW()(zK({default:{Compact:{background:"#f6f6f6",radius:"4px"},compact:{paddingTop:"5px",paddingLeft:"5px",boxSizing:"initial",width:"240px"},clear:{clear:"both"}}},u)),f=function(e,n){e.hex?d$(e.hex)&&t({hex:e.hex,source:"hex"},n):t(e,n)};return y.a.createElement(YK,{style:c.Compact,styles:u},y.a.createElement("div",{style:c.compact,className:"compact-picker "+s},y.a.createElement("div",null,WG(r,(function(e){return y.a.createElement(SZ,{key:e,color:e,active:e.toLowerCase()===o,onClick:f,onSwatchHover:n})})),y.a.createElement("div",{style:c.clear})),y.a.createElement(kZ,{hex:o,rgb:i,onChange:f})))};PZ.propTypes={colors:ul.a.arrayOf(ul.a.string),styles:ul.a.object},PZ.defaultProps={colors:["#4D4D4D","#999999","#FFFFFF","#F44E3B","#FE9200","#FCDC00","#DBDF00","#A4DD00","#68CCCA","#73D8FF","#AEA1FF","#FDA1FF","#333333","#808080","#cccccc","#D33115","#E27300","#FCC400","#B0BC00","#68BC00","#16A5A5","#009CE0","#7B64FF","#FA28FF","#000000","#666666","#B3B3B3","#9F0500","#C45100","#FB9E00","#808900","#194D33","#0C797D","#0062B1","#653294","#AB149E"],styles:{}};v$(PZ);var jZ=Object(BW.handleHover)((function(e){var t=e.hover,n=e.color,r=e.onClick,o=e.onSwatchHover,i={position:"relative",zIndex:"2",outline:"2px solid #fff",boxShadow:"0 0 5px 2px rgba(0,0,0,0.25)"},a=HW()({default:{swatch:{width:"25px",height:"25px",fontSize:"0"}},hover:{swatch:i}},{hover:t});return y.a.createElement("div",{style:a.swatch},y.a.createElement(P$,{color:n,onClick:r,onHover:o,focusStyle:i}))})),EZ=function(e){var t=e.width,n=e.colors,r=e.onChange,o=e.onSwatchHover,i=e.triangle,a=e.styles,u=void 0===a?{}:a,l=e.className,s=void 0===l?"":l,c=HW()(zK({default:{card:{width:t,background:"#fff",border:"1px solid rgba(0,0,0,0.2)",boxShadow:"0 3px 12px rgba(0,0,0,0.15)",borderRadius:"4px",position:"relative",padding:"5px",display:"flex",flexWrap:"wrap"},triangle:{position:"absolute",border:"7px solid transparent",borderBottomColor:"#fff"},triangleShadow:{position:"absolute",border:"8px solid transparent",borderBottomColor:"rgba(0,0,0,0.15)"}},"hide-triangle":{triangle:{display:"none"},triangleShadow:{display:"none"}},"top-left-triangle":{triangle:{top:"-14px",left:"10px"},triangleShadow:{top:"-16px",left:"9px"}},"top-right-triangle":{triangle:{top:"-14px",right:"10px"},triangleShadow:{top:"-16px",right:"9px"}},"bottom-left-triangle":{triangle:{top:"35px",left:"10px",transform:"rotate(180deg)"},triangleShadow:{top:"37px",left:"9px",transform:"rotate(180deg)"}},"bottom-right-triangle":{triangle:{top:"35px",right:"10px",transform:"rotate(180deg)"},triangleShadow:{top:"37px",right:"9px",transform:"rotate(180deg)"}}},u),{"hide-triangle":"hide"===i,"top-left-triangle":"top-left"===i,"top-right-triangle":"top-right"===i,"bottom-left-triangle":"bottom-left"===i,"bottom-right-triangle":"bottom-right"===i}),f=function(e,t){return r({hex:e,source:"hex"},t)};return y.a.createElement("div",{style:c.card,className:"github-picker "+s},y.a.createElement("div",{style:c.triangleShadow}),y.a.createElement("div",{style:c.triangle}),WG(n,(function(e){return y.a.createElement(jZ,{color:e,key:e,onClick:f,onSwatchHover:o})})))};EZ.propTypes={width:ul.a.oneOfType([ul.a.string,ul.a.number]),colors:ul.a.arrayOf(ul.a.string),triangle:ul.a.oneOf(["hide","top-left","top-right","bottom-left","bottom-right"]),styles:ul.a.object},EZ.defaultProps={width:200,colors:["#B80000","#DB3E00","#FCCB00","#008B02","#006B76","#1273DE","#004DCF","#5300EB","#EB9694","#FAD0C3","#FEF3BD","#C1E1C5","#BEDADC","#C4DEF6","#BED3F3","#D4C4FB"],triangle:"top-left",styles:{}};v$(EZ);var CZ=function(e){var t=e.direction,n=HW()({default:{picker:{width:"18px",height:"18px",borderRadius:"50%",transform:"translate(-9px, -1px)",backgroundColor:"rgb(248, 248, 248)",boxShadow:"0 1px 4px 0 rgba(0, 0, 0, 0.37)"}},vertical:{picker:{transform:"translate(-3px, -9px)"}}},{vertical:"vertical"===t});return y.a.createElement("div",{style:n.picker})},xZ=Object.assign||function(e){for(var t=1;t.5});return y.a.createElement("div",{style:n.picker})},MZ=function(){var e=HW()({default:{triangle:{width:0,height:0,borderStyle:"solid",borderWidth:"4px 0 4px 6px",borderColor:"transparent transparent transparent #fff",position:"absolute",top:"1px",left:"1px"},triangleBorder:{width:0,height:0,borderStyle:"solid",borderWidth:"5px 0 5px 8px",borderColor:"transparent transparent transparent #555"},left:{Extend:"triangleBorder",transform:"translate(-13px, -4px)"},leftInside:{Extend:"triangle",transform:"translate(-8px, -5px)"},right:{Extend:"triangleBorder",transform:"translate(20px, -14px) rotate(180deg)"},rightInside:{Extend:"triangle",transform:"translate(-8px, -5px)"}}});return y.a.createElement("div",{style:e.pointer},y.a.createElement("div",{style:e.left},y.a.createElement("div",{style:e.leftInside})),y.a.createElement("div",{style:e.right},y.a.createElement("div",{style:e.rightInside})))},AZ=function(e){var t=e.onClick,n=e.label,r=e.children,o=e.active,i=HW()({default:{button:{backgroundImage:"linear-gradient(-180deg, #FFFFFF 0%, #E6E6E6 100%)",border:"1px solid #878787",borderRadius:"2px",height:"20px",boxShadow:"0 1px 0 0 #EAEAEA",fontSize:"14px",color:"#000",lineHeight:"20px",textAlign:"center",marginBottom:"10px",cursor:"pointer"}},active:{button:{boxShadow:"0 0 0 1px #878787"}}},{active:o});return y.a.createElement("div",{style:i.button,onClick:t},n||r)},LZ=function(e){var t=e.rgb,n=e.currentColor,r=HW()({default:{swatches:{border:"1px solid #B3B3B3",borderBottom:"1px solid #F0F0F0",marginBottom:"2px",marginTop:"1px"},new:{height:"34px",background:"rgb("+t.r+","+t.g+", "+t.b+")",boxShadow:"inset 1px 0 0 #000, inset -1px 0 0 #000, inset 0 1px 0 #000"},current:{height:"34px",background:n,boxShadow:"inset 1px 0 0 #000, inset -1px 0 0 #000, inset 0 -1px 0 #000"},label:{fontSize:"14px",color:"#000",textAlign:"center"}}});return y.a.createElement("div",null,y.a.createElement("div",{style:r.label},"new"),y.a.createElement("div",{style:r.swatches},y.a.createElement("div",{style:r.new}),y.a.createElement("div",{style:r.current})),y.a.createElement("div",{style:r.label},"current"))},IZ=function(){function e(e,t){for(var n=0;n100&&(e.a=100),e.a/=100,t({h:r.h,s:r.s,l:r.l,a:e.a,source:"rgb"},o))};return y.a.createElement("div",{style:a.fields,className:"flexbox-fix"},y.a.createElement("div",{style:a.double},y.a.createElement(rU,{style:{input:a.input,label:a.label},label:"hex",value:o.replace("#",""),onChange:u})),y.a.createElement("div",{style:a.single},y.a.createElement(rU,{style:{input:a.input,label:a.label},label:"r",value:n.r,onChange:u,dragLabel:"true",dragMax:"255"})),y.a.createElement("div",{style:a.single},y.a.createElement(rU,{style:{input:a.input,label:a.label},label:"g",value:n.g,onChange:u,dragLabel:"true",dragMax:"255"})),y.a.createElement("div",{style:a.single},y.a.createElement(rU,{style:{input:a.input,label:a.label},label:"b",value:n.b,onChange:u,dragLabel:"true",dragMax:"255"})),y.a.createElement("div",{style:a.alpha},y.a.createElement(rU,{style:{input:a.input,label:a.label},label:"a",value:Math.round(100*n.a),onChange:u,dragLabel:"true",dragMax:"100"})))},YZ=Object.assign||function(e){for(var t=1;t1?this.handleIconClick:void 0,placeholder:i,type:"email",valid:n&&!this.showError,value:this.value})}},{key:"isValidValue",get:function(){return!this.value||oQ.a.validate(this.value)}}])&&lQ(t.prototype,n),r&&lQ(t,r),i}(y.a.Component),eQ.defaultProps={disabled:!1,valid:!0},QJ=hQ((JJ=tQ).prototype,"value",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),XJ=hQ(JJ.prototype,"showError",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),hQ(JJ.prototype,"setValue",[v.d],Object.getOwnPropertyDescriptor(JJ.prototype,"setValue"),JJ.prototype),hQ(JJ.prototype,"setShowError",[v.d],Object.getOwnPropertyDescriptor(JJ.prototype,"setShowError"),JJ.prototype),hQ(JJ.prototype,"isValidValue",[v.g],Object.getOwnPropertyDescriptor(JJ.prototype,"isValidValue"),JJ.prototype),ZJ=JJ))||ZJ;function mQ(e){return(mQ="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function bQ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function vQ(e,t){for(var n=0;n1?this.handleIconClick:void 0,placeholder:i,type:"tel",valid:n,value:l})}}])&&DX(t.prototype,n),r&&DX(t,r),i}(y.a.PureComponent);IX.defaultProps={disabled:!1,valid:!0};var zX=IX;function FX(e){return(FX="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function YX(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function NX(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0?a:void 0),o()};var n=t.props,r=n.onChange,a=n.schemaOptions,u=n.value,l=a.default_values,s=(l=void 0===l?{}:l).value;if(null==s)return y0(t);if(!Array.isArray(s))throw new Error('The "default_values" schema option must be an array!');var c=s.map((function(e){var t=e.name;if("number"!=typeof t&&"string"!=typeof t)throw new Error('A single schema option of "default_values" must be a string or number');return t}));return void 0===u&&r(c),t}return t=i,(n=[{key:"render",value:function(){var e=this.props,t=e.disabled,n=e.value;return y.a.createElement(c0,{disabled:!!t,onChange:this.handleChange,values:n||[]},this.values.map((function(e){var t=e.name,n=e.title;if("string"!=typeof t&&"number"!=typeof t)throw new Error('The children of "values" must only contain values of type string or number!');return y.a.createElement(c0.Option,{key:t,value:t},n)})))}},{key:"values",get:function(){var e=this.props.schemaOptions.values;if(!e||!Array.isArray(e.value))throw new Error('The "values" option has to be set for the Select FieldType');return e.value}}])&&p0(t.prototype,n),r&&p0(t,r),i}(y.a.Component)).prototype,"values",[v.g],Object.getOwnPropertyDescriptor(s0.prototype,"values"),s0.prototype),s0),S0=n(181),k0=n.n(S0);function P0(e){return(P0="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function j0(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0}},{key:"enableRefreshButton",get:function(){return!this.enableAutoGeneration&&((this.inputChangedSinceRefresh||this.partsChangedSinceRefresh)&&Object.keys(this.parts).length>0)}}]),j1(n,[{key:"componentWillUnmount",value:function(){this.partsChangeDisposer&&this.partsChangeDisposer()}},{key:"render",value:function(){if(!this.mode)return null;var e=this.props.fieldTypeOptions,t=e.historyResourceKey,n=e.options,r=void 0===n?{}:n;if(!t||"string"!=typeof t)throw new Error('The "historyResourceKey" field type option must be set to a string!');if("object"!==_1(r))throw new Error('The "options" field type must be an object if given!');var o=this.props,i=o.dataPath,a=o.disabled,u=o.formInspector,l=o.value;return"/"===l?"/":y.a.createElement(h.Fragment,null,y.a.createElement(W0,{disabled:!!a,id:i,mode:this.mode,onBlur:this.handleInputBlur,onChange:this.handleInputChange,value:l}),y.a.createElement("div",{className:b1.a.buttonsContainer},y.a.createElement(Ii,{className:b1.a.refreshButton,disabled:!this.enableRefreshButton,icon:"su-sync",onClick:this.handleRefreshButtonClick,skin:"link"},Nr("sulu_admin.refresh_url")),y.a.createElement(y1,{id:u.id,options:g1({locale:u.locale,resourceKey:u.resourceKey,webspace:u.options.webspace},r),resourceKey:t})))}}]),n}(y.a.Component),l1=R1((u1=h1).prototype,"mode",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),s1=R1(u1.prototype,"inputChanged",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),c1=R1(u1.prototype,"inputChangedSinceRefresh",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),f1=R1(u1.prototype,"partsChangedSinceRefresh",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),R1(u1.prototype,"parts",[v.g],Object.getOwnPropertyDescriptor(u1.prototype,"parts"),u1.prototype),R1(u1.prototype,"enableAutoGeneration",[v.g],Object.getOwnPropertyDescriptor(u1.prototype,"enableAutoGeneration"),u1.prototype),R1(u1.prototype,"enableRefreshButton",[v.g],Object.getOwnPropertyDescriptor(u1.prototype,"enableRefreshButton"),u1.prototype),p1=R1(u1.prototype,"refreshResourceLocator",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){var t=e.props,n=t.fieldTypeOptions,r=n.generationUrl,o=n.resourceStorePropertiesToRequest,i=void 0===o?{}:o,a=t.formInspector,u=t.onChange,l=g1({},a.options);Object.entries(i).forEach((function(e){var t=S1(e,2),n=t[0],r=t[1],o=Object(v.u)(a.getValueByPath("/"+n));void 0!==o&&(l[r]=o)})),e.inputChangedSinceRefresh=!1,e.partsChangedSinceRefresh=!1,G.post(r,g1({parts:e.parts,resourceKey:a.resourceKey,locale:a.locale?a.locale.get():void 0},l)).then(Object(v.d)((function(e){u(e.resourcelocator)})))}}}),d1=R1(u1.prototype,"handleInputChange",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){var n=e.props.onChange;e.inputChanged=!0,e.inputChangedSinceRefresh=!0,n(t)}}}),a1=u1))||a1;function A1(e,t){for(var n=0;n0?t[0].name:void 0,sortBy:n.sorting.length>0?n.sorting[0].name:void 0,sortMethod:n.sorting.length>0?"asc":void 0,tagOperator:n.tags?"or":void 0,tags:void 0}}}])&&A1(t.prototype,n),r&&A1(t,r),e}());function X1(e){return function(e){if(Array.isArray(e))return e2(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return e2(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e2(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function e2(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0?this.categories.map((function(e){return e.id})):void 0,categoryOperator:this.categoryOperator,dataSource:this.dataSource?this.dataSource.id:void 0,includeSubFolders:this.includeSubElements,limitResult:this.limit,sortBy:this.sortBy,sortMethod:this.sortOrder,tagOperator:this.tagOperator,tags:this.tags&&this.tags.length>0?Object(v.u)(this.tags):void 0,presentAs:this.presentation}}}])&&o2(t.prototype,n),r&&o2(t,r),e}()).prototype,"items",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),z1=i2(L1.prototype,"itemsLoading",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),F1=i2(L1.prototype,"categoriesLoading",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Y1=i2(L1.prototype,"dataSourceLoading",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),N1=i2(L1.prototype,"dataSource",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),B1=i2(L1.prototype,"includeSubElements",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),H1=i2(L1.prototype,"categories",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),V1=i2(L1.prototype,"categoryOperator",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),W1=i2(L1.prototype,"tags",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),U1=i2(L1.prototype,"tagOperator",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),q1=i2(L1.prototype,"audienceTargeting",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),K1=i2(L1.prototype,"sortBy",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),$1=i2(L1.prototype,"sortOrder",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),G1=i2(L1.prototype,"presentation",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Z1=i2(L1.prototype,"limit",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),J1=i2(L1.prototype,"excludedIds",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),i2(L1.prototype,"setItems",[v.d],Object.getOwnPropertyDescriptor(L1.prototype,"setItems"),L1.prototype),i2(L1.prototype,"setItemsLoading",[v.d],Object.getOwnPropertyDescriptor(L1.prototype,"setItemsLoading"),L1.prototype),i2(L1.prototype,"setExcludedIds",[v.d],Object.getOwnPropertyDescriptor(L1.prototype,"setExcludedIds"),L1.prototype),i2(L1.prototype,"loading",[v.g],Object.getOwnPropertyDescriptor(L1.prototype,"loading"),L1.prototype),i2(L1.prototype,"filterCriteria",[v.g],Object.getOwnPropertyDescriptor(L1.prototype,"filterCriteria"),L1.prototype),L1),N2=n(15),B2=n.n(N2);function H2(e){return(H2="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function V2(e,t,n,r){n&&Object.defineProperty(e,t,{enumerable:n.enumerable,configurable:n.configurable,writable:n.writable,value:n.initializer?n.initializer.call(r):void 0})}function W2(e,t){for(var n=0;n=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function n3(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r3(e,t){for(var n=0;n0&&this.sections.push("sorting"),this.config.presentAs&&this.props.presentations.length>0&&this.sections.push("presentation"),this.config.limit&&this.sections.push("limit")}},{key:"render",value:function(){var e=this.props,t=e.categoryRootKey,n=e.defaultValue,r=e.disabled,o=e.fieldLabel,i=e.onItemClick,a=e.store,u=this.props.presentations.reduce((function(e,t){return e[t.name]=t.value,e}),{});return y.a.createElement(h.Fragment,null,y.a.createElement(mN,{disabled:r,label:Nr("sulu_admin.smart_content_label",{count:a.items.length}),leftButton:{icon:"su-filter",onClick:this.handleFilterClick},loading:a.itemsLoading||a.loading,onItemClick:i,sortable:!1},a.items.map((function(e,t){return y.a.createElement(mN.Item,{id:e.id,index:t+1,key:t,value:e},y.a.createElement(y3,{item:e}))}))),y.a.createElement(J2,{categoryRootKey:t,dataSourceAdapter:this.config.datasourceAdapter,dataSourceListKey:this.config.datasourceListKey,dataSourceResourceKey:this.config.datasourceResourceKey,defaultValue:n,onClose:this.handleFilterOverlayClose,open:this.showFilterOverlay,presentations:u,sections:this.sections,smartContentStore:a,sortings:this.config.sorting,title:Nr("sulu_admin.filter_overlay_title",{fieldLabel:o||""})}))}}])&&v3(t.prototype,n),r&&v3(t,r),i}(y.a.Component),d3.defaultProps={disabled:!1,presentations:[]},c3=k3((s3=h3).prototype,"showFilterOverlay",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),k3(s3.prototype,"initialize",[v.d],Object.getOwnPropertyDescriptor(s3.prototype,"initialize"),s3.prototype),f3=k3(s3.prototype,"handleFilterClick",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){e.showFilterOverlay=!0}}}),p3=k3(s3.prototype,"handleFilterOverlayClose",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){e.showFilterOverlay=!1}}}),l3=s3))||l3;function C3(e){return function(e){if(Array.isArray(e))return T3(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||x3(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function x3(e,t){if(e){if("string"==typeof e)return T3(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?T3(e,t):void 0}}function T3(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}(this.stores);try{for(r.s();!(t=r.n()).done;){var o=t.value;if(o===e)break;o.provider===e.provider&&n.push(o)}}catch(e){r.e(e)}finally{r.f()}return n}}]),e}()).prototype,"entries",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),M3(P3.prototype,"stores",[v.g],Object.getOwnPropertyDescriptor(P3.prototype,"stores"),P3.prototype),M3(P3.prototype,"add",[v.d],Object.getOwnPropertyDescriptor(P3.prototype,"add"),P3.prototype),M3(P3.prototype,"remove",[v.d],Object.getOwnPropertyDescriptor(P3.prototype,"remove"),P3.prototype),P3);function I3(e){return(I3="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function z3(e,t){for(var n=0;n=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function m5(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function b5(e,t){for(var n=0;n-1}}])&&I4(t.prototype,n),r&&I4(t,r),e}()),Y4=n(408),N4=n.n(Y4);function B4(e){return(B4="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function H4(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function V4(e,t){for(var n=0;n=this.expandedWidth}}])&&M8(t.prototype,n),r&&M8(t,r),i}(y.a.Component),O8.defaultProps={skin:"light"},g8=Y8((v8=S8).prototype,"expandedWidth",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),w8=Y8(v8.prototype,"parentWidth",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),Y8(v8.prototype,"componentDidUpdate",[v.d],Object.getOwnPropertyDescriptor(v8.prototype,"componentDidUpdate"),v8.prototype),_8=Y8(v8.prototype,"setDimensions",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){var t=e.parentRef,n=e.childRef;n&&(e.showText||n.offsetWidth>e.expandedWidth)&&(e.expandedWidth=n.offsetWidth),t&&(e.parentWidth=t.offsetWidth)}}}),Y8(v8.prototype,"showText",[v.g],Object.getOwnPropertyDescriptor(v8.prototype,"showText"),v8.prototype),b8=v8))||b8,B8=n(131),H8=n.n(B8);function V8(e){return(V8="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function W8(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function U8(e,t){for(var n=0;n=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var M9="dropdown",A9="select",L9="toggler";var I9=Ht((g9=v9=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&P9(e,t)}(i,e);var t,n,r,o=j9(i);function i(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(t=o.call(this,e)).setStore=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";w9.hasStore(e)?t.toolbarStore=w9.getStore(e):t.toolbarStore=w9.createStore(e)},function(e,t,n,r){n&&Object.defineProperty(e,t,{enumerable:n.enumerable,configurable:n.configurable,writable:n.writable,value:n.initializer?n.initializer.call(r):void 0})}(t,"handleErrorSnackbarCloseClick",b9,C9(t)),t.setStore(t.props.storeKey),t}return t=i,(n=[{key:"componentDidUpdate",value:function(e){e.storeKey&&this.setStore(e.storeKey)}},{key:"render",value:function(){var e=this.props,t=e.onNavigationButtonClick,n=e.navigationOpen,r=this.toolbarStore,o=r.errors,i=r.showSuccess,a=r.warnings,u=this.toolbarStore.getIconsConfig(),l=this.toolbarStore.getItemsConfig(),s=this.toolbarStore.getLocaleConfig();return y.a.createElement(h.Fragment,null,y.a.createElement(f9,{message:o[o.length-1],onCloseClick:this.handleErrorSnackbarCloseClick,type:"error",visible:o.length>0}),y.a.createElement(f9,{message:a[a.length-1],type:"warning",visible:a.length>0}),y.a.createElement($7,null,y.a.createElement($7.Controls,{grow:!0},!!t&&y.a.createElement($7.Button,{disabled:!t,icon:i?"su-check":n?"su-times":"su-bars",onClick:t,primary:!0,success:i}),!!this.backButtonConfig&&y.a.createElement($7.Button,D9({},this.backButtonConfig,{icon:!t&&i?"su-check":"su-angle-left",success:!t&&i})),l.length>0&&y.a.createElement($7.Items,null,this.itemsConfig.map((function(e,t){return function(e,t){switch(e.type){case A9:e.type;var n=R9(e,["type"]);return y.a.createElement($7.Select,D9({},n,{key:t}));case M9:e.type;var r=R9(e,["type"]);return y.a.createElement($7.Dropdown,D9({},r,{key:t}));case L9:e.type;var o=R9(e,["type"]);return y.a.createElement($7.Toggler,D9({},o,{key:t}));default:e.type;var i=R9(e,["type"]);return y.a.createElement($7.Button,D9({},i,{key:t}))}}(e,t)})))),y.a.createElement($7.Controls,null,u.length>0&&y.a.createElement($7.Icons,null,u.map((function(e){return Object(v.u)(e)}))),!!s&&y.a.createElement($7.Select,D9({className:O9.a.locale,size:"small"},s)))))}},{key:"disableAllButtons",get:function(){var e=this.toolbarStore.getItemsConfig().filter((function(e){return e.loading}));return this.toolbarStore.disableAll||e.length>0}},{key:"backButtonConfig",get:function(){var e=this.toolbarStore.getBackButtonConfig();if(e)return this.disableAllButtons&&(e.disabled=!0),e}},{key:"itemsConfig",get:function(){var e=this.toolbarStore.getItemsConfig();return this.disableAllButtons&&e.forEach((function(e){e.disabled=!0})),e}}])&&k9(t.prototype,n),r&&k9(t,r),i}(y.a.Component),v9.defaultProps={navigationOpen:!1},b9=T9((m9=g9).prototype,"handleErrorSnackbarCloseClick",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){e.toolbarStore.errors.pop()}}}),T9(m9.prototype,"disableAllButtons",[v.g],Object.getOwnPropertyDescriptor(m9.prototype,"disableAllButtons"),m9.prototype),T9(m9.prototype,"backButtonConfig",[v.g],Object.getOwnPropertyDescriptor(m9.prototype,"backButtonConfig"),m9.prototype),T9(m9.prototype,"itemsConfig",[v.g],Object.getOwnPropertyDescriptor(m9.prototype,"itemsConfig"),m9.prototype),y9=m9))||y9;function z9(e){return(z9="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function F9(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Y9(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:"default",r=function(e){H9(o,e);var r=W9(o);function o(){return F9(this,o),r.apply(this,arguments)}return N9(o,[{key:"componentDidMount",value:function(){var e=this;B9(q9(o.prototype),"componentDidMount",this)&&B9(q9(o.prototype),"componentDidMount",this).call(this);var r=this.props.router,i=Object(v.e)((function(){var r=t.call(e);w9.setToolbarConfig(n,r),d.a.info((o.displayName||"")+' configured toolbar "'+n+'"',r)}));this.updateRouteHookDisposer=r.addUpdateRouteHook((function(e,t){var n=r.attributes,o=r.route;return Re(e,t)!==Re(o,n)&&i(),!0}),1024)}},{key:"componentWillUnmount",value:function(){B9(q9(o.prototype),"componentWillUnmount",this)&&B9(q9(o.prototype),"componentWillUnmount",this).call(this),this.updateRouteHookDisposer(),w9.setToolbarConfig(n,{})}}]),o}(e);return r.displayName=G4("withToolbar",e),r}var $9=I9;function G9(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:null,n=this.props.router,r=this.getView(e),o=y.a.createElement(r,{key:Re(e,n.attributes),route:e,router:n},(function(e){return t?y.a.cloneElement(t,e):null}));return e.parent?this.renderView(e.parent,o):o}},{key:"render",value:function(){return this.renderView(this.props.router.route)}}])&&oee(t.prototype,n),r&&oee(t,r),i}(y.a.Component))||eee,yee=(n(651),n(24)),mee=n.n(yee);function bee(e){return(bee="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function vee(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gee(e,t,n,r){n&&Object.defineProperty(e,t,{enumerable:n.enumerable,configurable:n.configurable,writable:n.writable,value:n.initializer?n.initializer.call(r):void 0})}function wee(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}(o);try{for(a.s();!(i=a.n()).done;){var u=i.value,l=this.tabWidths.get(u);if(void 0===l){if(r.length>0)break;return this.childIndices}if(n+l>this.tabsContainerWrapperWidth)break;n+=l,r=[].concat(Fte(r),[u])}}catch(e){a.e(e)}finally{a.f()}return r.sort((function(e,t){return e-t})),r}},{key:"collapsedTabIndices",get:function(){var e=this.visibleTabIndices;return this.childIndices.filter((function(t){return!e.includes(t)}))}},{key:"hasCollapsedTabs",get:function(){return this.collapsedTabIndices.length>0}}])&&Vte(t.prototype,n),r&&Vte(t,r),i}(y.a.Component),Tte.defaultProps={skin:"default",small:!1},Tte.Tab=qee,yte=Gte((hte=Dte).prototype,"tabsWidth",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),mte=Gte(hte.prototype,"tabsContainerWrapperWidth",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),bte=Gte(hte.prototype,"tabsContainerWidth",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),vte=Gte(hte.prototype,"tabWidths",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return new Map}}),gte=Gte(hte.prototype,"tabRefs",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return new Map}}),wte=Gte(hte.prototype,"dropdownOpen",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),_te=Gte(hte.prototype,"lastSelectedIndex",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ote=Gte(hte.prototype,"setTabsWidth",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){if(e.tabsRef){var t=e.tabsRef.offsetWidth,n=window.getComputedStyle(e.tabsRef);e.tabsWidth!==t&&(e.tabsWidth=t-parseFloat(n.paddingLeft)-parseFloat(n.paddingRight))}}}}),Ste=Gte(hte.prototype,"setTabsContainerWrapperWidth",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){if(e.tabsContainerWrapperRef){var t=e.tabsContainerWrapperRef.offsetWidth;e.tabsContainerWrapperWidth!==t&&(e.tabsContainerWrapperWidth=t)}}}}),kte=Gte(hte.prototype,"setTabsContainerWidth",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){if(e.tabsContainerRef){var t=e.tabsContainerRef.offsetWidth;e.tabsContainerWidth!==t&&(e.tabsContainerWidth=t)}}}}),Pte=Gte(hte.prototype,"updateTabWidths",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){e.tabRefs.forEach((function(t,n){if(t){var r=t.offsetWidth;e.tabWidths.get(n)!==r&&e.tabWidths.set(n,r)}}))}}}),jte=Gte(hte.prototype,"setTabRef",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t,n){e.tabRefs.get(t)!==n&&e.tabRefs.set(t,n)}}}),Ete=Gte(hte.prototype,"handleDropdownToggle",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){e.dropdownOpen=!e.dropdownOpen}}}),Cte=Gte(hte.prototype,"handleDropdownClose",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){e.dropdownOpen=!1}}}),xte=Gte(hte.prototype,"handleCollapsedTabClick",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){e.dropdownOpen=!1,e.lastSelectedIndex=t,e.changeTab(t)}}}),Gte(hte.prototype,"visibleTabIndices",[v.g],Object.getOwnPropertyDescriptor(hte.prototype,"visibleTabIndices"),hte.prototype),Gte(hte.prototype,"collapsedTabIndices",[v.g],Object.getOwnPropertyDescriptor(hte.prototype,"collapsedTabIndices"),hte.prototype),Gte(hte.prototype,"hasCollapsedTabs",[v.g],Object.getOwnPropertyDescriptor(hte.prototype,"hasCollapsedTabs"),hte.prototype),dte=hte))||dte,tne=n(411),nne=n.n(tne);function rne(e){return(rne="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function one(e,t){for(var n=0;n=(void 0===o?0:o)?e:t}),void 0)}},{key:"routeChildren",get:function(){var e=this.props,t=e.route;return e.routeChildren||t.children}},{key:"sortedTabRoutes",get:function(){return this.routeChildren.concat().sort((function(e,t){var n=e.options.tabOrder,r=void 0===n?0:n,o=t.options.tabOrder;return r-(void 0===o?0:o)}))}}])&&one(t.prototype,n),r&&one(t,r),i}(y.a.Component),Qte.defaultProps={childrenProps:{}},sne((Jte=Xte).prototype,"tabRouteWithHighestPriority",[v.g],Object.getOwnPropertyDescriptor(Jte.prototype,"tabRouteWithHighestPriority"),Jte.prototype),sne(Jte.prototype,"routeChildren",[v.g],Object.getOwnPropertyDescriptor(Jte.prototype,"routeChildren"),Jte.prototype),sne(Jte.prototype,"sortedTabRoutes",[v.g],Object.getOwnPropertyDescriptor(Jte.prototype,"sortedTabRoutes"),Jte.prototype),Zte=Jte))||Zte,hne=n(412),yne=n.n(hne);function mne(e){return(mne="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function bne(){return(bne=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0])||arguments[0];if(!r.list)throw new Error("List not created yet.");r.list.requestSelectionDelete(e)},r.reload=function(){r.listStore.reload()},r.setListRef=function(e){r.list=e};var o=r.props,i=o.locale,a=o.router,u=a.attributes,l=a.route.options,s=l.adapters,c=l.requestParameters,f=void 0===c?{}:c,p=l.listKey,d=l.resourceKey,h=l.routerAttributesToListRequest,y=void 0===h?{}:h,m=l.resourceStorePropertiesToListRequest,b=void 0===m?{}:m,g=l.userSettingsKey,w=void 0===g?"list":g,_=l.routerAttributesToListMetadata,O=void 0===_?{}:_,S=l.resourceStorePropertiesToListMetadata,k=void 0===S?{}:S;if(!d)throw new Error('The route does not define the mandatory "resourceKey" option');if(!p)throw new Error('The route does not define the mandatory "listKey" option');if(!s)throw new Error('The route does not define the mandatory "adapters" option');r.locale=i||v.q.box();var P={};a.bind("page",r.page,1),P.page=r.page,r.locales&&(a.bind("locale",r.locale),P.locale=r.locale);var j=r.buildListStoreOptions(f,u,y,b,e.resourceStore),E=r.buildMetadataOptions(u,O,k,e.resourceStore);return r.listStore=new Kw(d,p,w,P,j,E),a.bind("active",r.listStore.active),a.bind("sortColumn",r.listStore.sortColumn),a.bind("sortOrder",r.listStore.sortOrder),a.bind("search",r.listStore.searchTerm),a.bind("limit",r.listStore.limit,10),a.bind("filter",r.listStore.filterOptions,{}),r}return Vne(n,[{key:"locales",get:function(){var e=this.props,t=e.locales,n=e.router.route.options.locales;return n||t}}],[{key:"getDerivedRouteAttributes",value:function(e){var t=e.options,n=t.listKey,r=t.userSettingsKey,o=void 0===r?"list":r,i=Kw.getLimitSetting(n,o);return{active:Kw.getActiveSetting(n,o),filter:Kw.getFilterSetting(n,o),sortColumn:Kw.getSortColumnSetting(n,o),sortOrder:Kw.getSortOrderSetting(n,o),limit:10===i?void 0:i}}}]),Vne(n,[{key:"buildMetadataOptions",value:function(e,t,n,r){var o={};return t=Object(v.u)(t),Object.keys(t).forEach((function(n){var r=t[n],i=isNaN(n)?n:t[n];o[r]=e[i]})),n=Object(v.u)(n),Object.keys(n).forEach((function(e){var t=n[e],i=isNaN(e)?e:n[e];r&&r.data&&(o[t]=r.data[i])})),o}},{key:"buildListStoreOptions",value:function(e,t,n,r,o){var i=e||{};return n=Object(v.u)(n),Object.keys(n).forEach((function(e){var r=n[e],o=isNaN(e)?e:n[e];i[r]=t[o]})),r=Object(v.u)(r),Object.keys(r).forEach((function(e){var t=r[e],n=isNaN(e)?e:r[e];o&&o.data&&(i[t]=o.data[n])})),i}},{key:"componentDidMount",value:function(){var e=this,t=this.props,n=t.resourceStore,r=t.router,o=r.route.options,i=o.locales,a=o.toolbarActions,u=void 0===a?[]:a,l=o.itemActions,s=void 0===l?[]:l;u.forEach((function(t){if("object"!==Nne(t))throw new Error("The value of a toolbarAction entry must be an object, but "+Nne(t)+" was given!");e.toolbarActions.push(new(xne.get(t.type))(e.listStore,e,r,i,n,t.options))})),s.forEach((function(t){if("object"!==Nne(t))throw new Error("The value of a itemAction entry must be an object, but "+Nne(t)+" was given!");e.itemActions.push(new(Yne.get(t.type))(e.listStore,e,r,i,n,t.options))}))}},{key:"componentDidUpdate",value:function(e){var t=this.props.router.route.options.locales,n=e.router.route.options.prevLocales;J()(t,n)||(this.toolbarActions.forEach((function(e){e.setLocales(t)})),this.itemActions.forEach((function(e){e.setLocales(t)})))}},{key:"componentWillUnmount",value:function(){this.listStore.destroy(),this.toolbarActions.forEach((function(e){return e.destroy()}))}},{key:"render",value:function(){var e=this.props,t=e.onItemAdd,n=e.onItemClick,r=e.router.route.options,o=r.adapters,i=r.addView,a=r.editView,u=r.itemDisabledCondition,l=r.searchable,s=r.selectable,c=r.title,f=e.title,p=c?Nr(c):f;return y.a.createElement(h.Fragment,null,y.a.createElement(pY,{adapters:o,header:p&&y.a.createElement("h1",null,p),itemActionsProvider:this.getItemActionConfigs,itemDisabledCondition:u,onItemAdd:t||i?this.addItem:void 0,onItemClick:n||a?this.handleItemClick:void 0,ref:this.setListRef,searchable:l,selectable:s,store:this.listStore}),this.toolbarActions.map((function(e){return e.getNode()})),this.itemActions.map((function(e){return e.getNode()})))}}]),n}(y.a.Component),Lne=Gne((Ane=Fne).prototype,"toolbarActions",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),Ine=Gne(Ane.prototype,"itemActions",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),zne=Gne(Ane.prototype,"errors",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),Gne(Ane.prototype,"locales",[v.g],Object.getOwnPropertyDescriptor(Ane.prototype,"locales"),Ane.prototype),Gne(Ane.prototype,"componentDidMount",[v.d],Object.getOwnPropertyDescriptor(Ane.prototype,"componentDidMount"),Ane.prototype),Mne=Ane))||Mne,(function(){var e=this,t=this.errors,n=this.props.router,r=n.route.options.backView;return{backButton:r?{onClick:function(){var t={};e.locale&&(t.locale=e.locale.get()),n.restore(r,t)}}:void 0,errors:t,locale:this.locales?{value:this.locale.get(),onChange:Object(v.d)((function(t){e.locale.set(t)})),options:this.locales.map((function(e){return{value:e,label:e}}))}:void 0,items:this.toolbarActions.map((function(e){return e.getToolbarItemConfig()})).filter((function(e){return null!=e}))}}));function Jne(e){return(Jne="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Qne(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Xne(e,t){for(var n=0;n0?t:void 0,r=e.listStore.searchTerm.get();window.location.assign(qr.getListUrl(e.listStore.resourceKey,Qre(Qre({_format:"csv",locale:e.list.locale.get(),flat:!0,delimiter:e.delimiter,escape:e.escape,enclosure:e.enclosure,newLine:e.newLine},e.listStore.options),{},{filter:n,search:r}))),e.showOverlay=!1}}}),Lre),coe=Zne;var foe= + */function Ae(e){return(Ae="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Le(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ie(e,t){for(var n=0;n6?u-6:0),s=6;s>",a=a||r,null==n[r]){if(t){var u=null===n[r]?"null":"undefined";return new Error("The "+i+" `"+a+"` is marked as required in `"+o+"`, but its value is `"+u+"`.")}return null}return e.apply(void 0,[n,r,o,i,a].concat(l))}))}var n=t.bind(null,!1);return n.isRequired=t.bind(null,!0),n}function ot(e){var t=Ae(e);return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}(t,e)?"symbol":t}function it(e,t){return rt((function(n,r,o,i,a){return Object(v.v)((function(){if(e&&ot(n[r])===t.toLowerCase())return null;var i;switch(t){case"Array":i=v.n;break;case"Object":i=v.p;break;case"Map":i=v.o;break;default:throw new Error("Unexpected mobxType: ".concat(t))}var u=n[r];if(!i(u)){var l=function(e){var t=ot(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}(u),s=e?" or javascript `"+t.toLowerCase()+"`":"";return new Error("Invalid prop `"+a+"` of type `"+l+"` supplied to `"+o+"`, expected `mobx.Observable"+t+"`"+s+".")}return null}))}))}function at(e,t){return rt((function(n,r,o,i,a){for(var u=arguments.length,l=new Array(u>5?u-5:0),s=5;s2?r-2:0),i=2;i2?r-2:0),i=2;i",o=this._reactInternalInstance&&this._reactInternalInstance._rootNodeID||this._reactInternalInstance&&this._reactInternalInstance._debugID||this._reactInternalFiber&&this._reactInternalFiber._debugID;Mt(this,Tt,!1),Mt(this,Dt,!1);var i=e.bind(this),a=!1,u=new v.b("".concat(r,"#").concat(o,".render()"),(function(){if(!a&&(a=!0,"function"==typeof t.componentWillReact&&t.componentWillReact(),!0!==t[kt])){var e=!0;try{Mt(t,Dt,!0),t[Tt]||h.Component.prototype.forceUpdate.call(t),e=!1}finally{Mt(t,Dt,!1),e&&u.dispose()}}}));return u.reactComponent=this,n[St]=u,this.render=n,n.call(this)}var Nt={componentWillUnmount:function(){if(!0!==jt&&(this.render[St]&&this.render[St].dispose(),this[kt]=!0,Pt)){var e=At(this);e&&Ct&&Ct.delete(e),xt.emit({event:"destroy",component:this,node:e})}},componentDidMount:function(){Pt&&Lt(this)},componentDidUpdate:function(){Pt&&Lt(this)},shouldComponentUpdate:function(e,t){return jt&&console.warn("[mobx-react] It seems that a re-rendering of a React component is triggered while in static (server-side) mode. Please make sure components are rendered only once server-side."),this.state!==t||!zt(this.props,e)}};function Bt(e,t){var n=ct("reactProp_".concat(t,"_valueHolder")),r=ct("reactProp_".concat(t,"_atomHolder"));function o(){return this[r]||Mt(this,r,Object(v.i)("reactive "+t)),this[r]}Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:function(){return o.call(this).reportObserved(),this[n]},set:function(e){this[Dt]||zt(this[n],e)?Mt(this,n,e):(Mt(this,n,e),Mt(this,Tt,!0),o.call(this).reportChanged(),Mt(this,Tt,!1))}})}function Ht(e,t){if("string"==typeof e)throw new Error("Store names should be provided as array");if(Array.isArray(e))return Et||(Et=!0,console.warn('Mobx observer: Using observer to inject stores is deprecated since 4.0. Use `@inject("store1", "store2") @observer ComponentClass` or `inject("store1", "store2")(observer(componentClass))` instead of `@observer(["store1", "store2"]) ComponentClass`')),t?Ot.apply(null,e)(Ht(t)):function(t){return Ht(e,t)};var n=e;if(!0===n.isMobxInjector&&console.warn("Mobx observer: You are trying to use 'observer' on a component that already has 'inject'. Please apply 'observer' before applying 'inject'"),n.__proto__===h.PureComponent&&console.warn("Mobx observer: You are using 'observer' on React.PureComponent. These two achieve two opposite goals and should not be used together"),Rt&&n.$$typeof===Rt){var r=n.render;if("function"!=typeof r)throw new Error("render property of ForwardRef was not a function");return Object(h.forwardRef)((function(){var e=arguments;return y.a.createElement(Vt,null,(function(){return r.apply(void 0,e)}))}))}if(!("function"!=typeof n||n.prototype&&n.prototype.render||n.isReactClass||h.Component.isPrototypeOf(n))){var o,i,a=Ht((i=o=function(e){function t(){return Le(this,t),He(this,Ne(t).apply(this,arguments))}return Ye(t,e),ze(t,[{key:"render",value:function(){return n.call(this,this.props,this.context)}}]),t}(h.Component),o.displayName=n.displayName||n.name,o.contextTypes=n.contextTypes,o.propTypes=n.propTypes,o.defaultProps=n.defaultProps,i));return tt(a,n),a}if(!n)throw new Error("Please pass a valid component to 'observer'");var u=n.prototype||n;!function(e){["componentDidMount","componentWillUnmount","componentDidUpdate"].forEach((function(t){!function(e,t){mt(e,t,Nt[t])}(e,t)})),e.shouldComponentUpdate?e.shouldComponentUpdate!==Nt.shouldComponentUpdate&&console.warn("Use `shouldComponentUpdate` in an `observer` based component breaks the behavior of `observer` and might lead to unexpected results. Manually implementing `sCU` should not be needed when using mobx-react."):e.shouldComponentUpdate=Nt.shouldComponentUpdate}(u),n.isMobXReactObserver=!0,Bt(u,"props"),Bt(u,"state");var l=u.render;return u.render=function(){return Yt.call(this,l)},n}var Vt=Ht((function(e){var t=e.children,n=e.inject,r=e.render,o=t||r;if(void 0===o)return null;if(!n)return o();console.warn(" is no longer supported. Please use inject on the enclosing component instead");var i=Ot(n)(o);return y.a.createElement(i,null)}));Vt.displayName="Observer";var Wt=function(e,t,n,r,o){var i="children"===t?"render":"children";return"function"==typeof e[t]&&"function"==typeof e[i]?new Error("Invalid prop,do not use children and render in the same time in`"+n):"function"!=typeof e[t]&&"function"!=typeof e[i]?new Error("Invalid prop `"+o+"` of type `"+Ae(e[t])+"` supplied to `"+n+"`, expected `function`."):void 0};function Ut(){var e=this.constructor.getDerivedStateFromProps(this.props,this.state);null!=e&&this.setState(e)}function qt(e){this.setState(function(t){var n=this.constructor.getDerivedStateFromProps(e,t);return null!=n?n:null}.bind(this))}function Kt(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}}Vt.propTypes={render:Wt,children:Wt},Ut.__suppressDeprecationWarning=!0,qt.__suppressDeprecationWarning=!0,Kt.__suppressDeprecationWarning=!0;var $t={children:!0,key:!0,ref:!0},Gt=function(e){function t(e,n){var r;return Le(this,t),(r=He(this,Ne(t).call(this,e,n))).state={},Zt(e,r.state),r}return Ye(t,e),ze(t,[{key:"render",value:function(){return h.Children.only(this.props.children)}},{key:"getChildContext",value:function(){var e={};return Zt(this.context.mobxStores,e),Zt(this.props,e),{mobxStores:e}}}],[{key:"getDerivedStateFromProps",value:function(e,t){if(!e)return null;if(!t)return e;if(Object.keys(e).filter(Jt).length!==Object.keys(t).filter(Jt).length&&console.warn("MobX Provider: The set of provided stores has changed. Please avoid changing stores as the change might not propagate to all children"),!e.suppressChangedStoreWarning)for(var n in e)Jt(n)&&t[n]!==e[n]&&console.warn("MobX Provider: Provided store '"+n+"' has changed. Please avoid replacing stores as the change might not propagate to all children");return e}}]),t}(h.Component);function Zt(e,t){if(e)for(var n in e)Jt(n)&&(t[n]=e[n])}function Jt(e){return!$t[e]&&"suppressChangedStoreWarning"!==e}Gt.contextTypes={mobxStores:ut},Gt.childContextTypes={mobxStores:ut.isRequired},function(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,o=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?o="componentWillUpdate":"function"==typeof t.UNSAFE_componentWillUpdate&&(o="UNSAFE_componentWillUpdate"),null!==n||null!==r||null!==o){var i=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"+i+" uses "+a+" but also contains the following legacy lifecycles:"+(null!==n?"\n "+n:"")+(null!==r?"\n "+r:"")+(null!==o?"\n "+o:"")+"\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=Ut,t.componentWillReceiveProps=qt),"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=Kt;var u=t.componentDidUpdate;t.componentDidUpdate=function(e,t,n){var r=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:n;u.call(this,e,t,r)}}}(Gt);ct("disposeOnUnmount");if(!h.Component)throw new Error("mobx-react requires React to be available");if(!v.t)throw new Error("mobx-react requires mobx to be available");"function"==typeof m.unstable_batchedUpdates&&Object(v.h)({reactionScheduler:m.unstable_batchedUpdates});if("object"===("undefined"==typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__?"undefined":Ae(__MOBX_DEVTOOLS_GLOBAL_HOOK__))){var Qt={spy:v.t,extras:{getDebugName:v.k}},Xt={renderReporter:xt,componentByNodeRegistry:Ct,componentByNodeRegistery:Ct,trackComponents:function(){if("undefined"==typeof WeakMap)throw new Error("[mobx-react] tracking components is not supported in this browser.");Pt||(Pt=!0)}};__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobxReact(Xt,Qt)}var en=n(4),tn=n.n(en),nn=(n(488),n(489),n(377)),rn=n.n(nn);function on(e){return(on="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function an(){return(an=Object.assign||function(e){for(var t=1;t0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function nr(){for(var e=[],t=0;t1)throw new RangeError("Fraction-precision stems only accept a single optional option");o.stem.replace(mr,(function(e,n,r,o,i,a){return"*"===r?t.minimumFractionDigits=n.length:o&&"#"===o[0]?t.maximumFractionDigits=o.length:i&&a?(t.minimumFractionDigits=i.length,t.maximumFractionDigits=i.length+a.length):(t.minimumFractionDigits=n.length,t.maximumFractionDigits=n.length),""})),o.options.length&&(t=Qn(Qn({},t),vr(o.options[0])))}else if(br.test(o.stem))t=Qn(Qn({},t),vr(o.stem));else{var i=gr(o.stem);i&&(t=Qn(Qn({},t),i))}}return t}var Or=function(e){function t(n,r,o,i){var a=e.call(this)||this;return a.message=n,a.expected=r,a.found=o,a.location=i,a.name="SyntaxError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(a,t),a}return Gn(t,e),t.buildMessage=function(e,t){function n(e){return e.charCodeAt(0).toString(16).toUpperCase()}function r(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+n(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+n(e)}))}function o(e){return e.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+n(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+n(e)}))}function i(e){switch(e.type){case"literal":return'"'+r(e.text)+'"';case"class":var t=e.parts.map((function(e){return Array.isArray(e)?o(e[0])+"-"+o(e[1]):o(e)}));return"["+(e.inverted?"^":"")+t+"]";case"any":return"any character";case"end":return"end of input";case"other":return e.description}}return"Expected "+function(e){var t,n,r=e.map(i);if(r.sort(),r.length>0){for(t=1,n=1;t",!1),f=we(">",!1),p=we("1&&"}"===e)},ee=we("\n",!1),te=Oe("argNameOrNumber"),ne=Oe("validTag"),re=Oe("argNumber"),oe=we("0",!1),ie=/^[1-9]/,ae=_e([["1","9"]],!1,!1),ue=/^[0-9]/,le=_e([["0","9"]],!1,!1),se=Oe("argName"),ce=Oe("tagName"),fe=0,pe=0,de=[{line:1,column:1}],he=0,ye=[],me=0;if(void 0!==t.startRule){if(!(t.startRule in o))throw new Error("Can't start parsing from rule \""+t.startRule+'".');i=o[t.startRule]}function be(){return e.substring(pe,fe)}function ve(){return ke(pe,fe)}function ge(e,t){throw function(e,t){return new Or(e,[],"",t)}(e,t=void 0!==t?t:ke(pe,fe))}function we(e,t){return{type:"literal",text:e,ignoreCase:t}}function _e(e,t,n){return{type:"class",parts:e,inverted:t,ignoreCase:n}}function Oe(e){return{type:"other",description:e}}function Se(t){var n,r=de[t];if(r)return r;for(n=t-1;!de[n];)n--;for(r={line:(r=de[n]).line,column:r.column};nhe&&(he=fe,ye=[]),ye.push(e))}function je(e,t,n){return new Or(Or.buildMessage(e,t),e,t,n)}function Ee(){return Ce()}function Ce(){var e,t;for(e=[],t=xe();t!==r;)e.push(t),t=xe();return e}function xe(){var t,n;return t=fe,pe=fe,(!nt?void 0:r)!==r&&(n=function(){var e,t,n,o;me++,(e=Re())===r&&(e=fe,(t=Me())!==r&&(n=Ce())!==r&&(o=Ae())!==r?(pe=e,a=n,(i=t)!==(u=o)&&ge('Mismatch tag "'+i+'" !== "'+u+'"',ve()),t=Qn({type:Zn.tag,value:i,children:a},tt()),e=t):(fe=e,e=r));var i,a,u;me--,e===r&&(t=r,0===me&&Pe(s));return e}())!==r?(pe=t,t=n):(fe=t,t=r),t===r&&(t=function(){var e,t;e=fe,(t=Te())!==r&&(pe=e,n=t,t=Qn({type:Zn.literal,value:n},tt()));var n;return e=t}())===r&&(t=function(){var t,n,o,i;me++,t=fe,123===e.charCodeAt(fe)?(n="{",fe++):(n=r,0===me&&Pe(h));n!==r&&We()!==r&&(o=Ge())!==r&&We()!==r?(125===e.charCodeAt(fe)?(i="}",fe++):(i=r,0===me&&Pe(y)),i!==r?(pe=t,n=function(e){return Qn({type:Zn.argument,value:e},tt())}(o),t=n):(fe=t,t=r)):(fe=t,t=r);me--,t===r&&(n=r,0===me&&Pe(d));return t}())===r&&(t=function(){var t;(t=function(){var t,n,o,i,a,u,l,s,c;t=fe,123===e.charCodeAt(fe)?(n="{",fe++):(n=r,0===me&&Pe(h));n!==r&&We()!==r&&(o=Ge())!==r&&We()!==r?(44===e.charCodeAt(fe)?(i=",",fe++):(i=r,0===me&&Pe(P)),i!==r&&We()!==r?("number"===e.substr(fe,6)?(a="number",fe+=6):(a=r,0===me&&Pe(j)),a!==r&&We()!==r?(u=fe,44===e.charCodeAt(fe)?(l=",",fe++):(l=r,0===me&&Pe(P)),l!==r&&(s=We())!==r&&(c=function(){var t,n,o;t=fe,"::"===e.substr(fe,2)?(n="::",fe+=2):(n=r,0===me&&Pe(S));n!==r&&(o=function(){var e,t,n;if(e=fe,t=[],(n=ze())!==r)for(;n!==r;)t.push(n),n=ze();else t=r;t!==r&&(pe=e,t=Qn({type:0,tokens:o=t,parsedOptions:rt?_r(o):{}},tt()));var o;return e=t}())!==r?(pe=t,t=n=o):(fe=t,t=r);t===r&&(t=fe,pe=fe,Xe.push("numberArgStyle"),(n=(n=!0)?void 0:r)!==r&&(o=Te())!==r?(pe=t,n=k(o),t=n):(fe=t,t=r));return t}())!==r?u=l=[l,s,c]:(fe=u,u=r),u===r&&(u=null),u!==r&&(l=We())!==r?(125===e.charCodeAt(fe)?(s="}",fe++):(s=r,0===me&&Pe(y)),s!==r?(pe=t,n=E(o,a,u),t=n):(fe=t,t=r)):(fe=t,t=r)):(fe=t,t=r)):(fe=t,t=r)):(fe=t,t=r);return t}())===r&&(t=function(){var t,n,o,i,a,u,l,s,c;t=fe,123===e.charCodeAt(fe)?(n="{",fe++):(n=r,0===me&&Pe(h));n!==r&&We()!==r&&(o=Ge())!==r&&We()!==r?(44===e.charCodeAt(fe)?(i=",",fe++):(i=r,0===me&&Pe(P)),i!==r&&We()!==r?("date"===e.substr(fe,4)?(a="date",fe+=4):(a=r,0===me&&Pe(L)),a===r&&("time"===e.substr(fe,4)?(a="time",fe+=4):(a=r,0===me&&Pe(I))),a!==r&&We()!==r?(u=fe,44===e.charCodeAt(fe)?(l=",",fe++):(l=r,0===me&&Pe(P)),l!==r&&(s=We())!==r&&(c=function(){var t,n,o;t=fe,"::"===e.substr(fe,2)?(n="::",fe+=2):(n=r,0===me&&Pe(S));n!==r&&(o=function(){var t,n,o,i;t=fe,n=fe,o=[],(i=Fe())===r&&(i=Ye());if(i!==r)for(;i!==r;)o.push(i),(i=Fe())===r&&(i=Ye());else o=r;n=o!==r?e.substring(n,fe):o;n!==r&&(pe=t,n=Qn({type:1,pattern:a=n,parsedOptions:rt?(u=a,l={},u.replace(yr,(function(e){var t=e.length;switch(e[0]){case"G":l.era=4===t?"long":5===t?"narrow":"short";break;case"y":l.year=2===t?"2-digit":"numeric";break;case"Y":case"u":case"U":case"r":throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");case"q":case"Q":throw new RangeError("`q/Q` (quarter) patterns are not supported");case"M":case"L":l.month=["numeric","2-digit","short","long","narrow"][t-1];break;case"w":case"W":throw new RangeError("`w/W` (week) patterns are not supported");case"d":l.day=["numeric","2-digit"][t-1];break;case"D":case"F":case"g":throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");case"E":l.weekday=4===t?"short":5===t?"narrow":"short";break;case"e":if(t<4)throw new RangeError("`e..eee` (weekday) patterns are not supported");l.weekday=["short","long","narrow","short"][t-4];break;case"c":if(t<4)throw new RangeError("`c..ccc` (weekday) patterns are not supported");l.weekday=["short","long","narrow","short"][t-4];break;case"a":l.hour12=!0;break;case"b":case"B":throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");case"h":l.hourCycle="h12",l.hour=["numeric","2-digit"][t-1];break;case"H":l.hourCycle="h23",l.hour=["numeric","2-digit"][t-1];break;case"K":l.hourCycle="h11",l.hour=["numeric","2-digit"][t-1];break;case"k":l.hourCycle="h24",l.hour=["numeric","2-digit"][t-1];break;case"j":case"J":case"C":throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");case"m":l.minute=["numeric","2-digit"][t-1];break;case"s":l.second=["numeric","2-digit"][t-1];break;case"S":case"A":throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");case"z":l.timeZoneName=t<4?"short":"long";break;case"Z":case"O":case"v":case"V":case"X":case"x":throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead")}return""})),l):{}},tt()));var a,u,l;return t=n}())!==r?(pe=t,t=n=o):(fe=t,t=r);t===r&&(t=fe,pe=fe,Xe.push("dateOrTimeArgStyle"),(n=(n=!0)?void 0:r)!==r&&(o=Te())!==r?(pe=t,n=k(o),t=n):(fe=t,t=r));return t}())!==r?u=l=[l,s,c]:(fe=u,u=r),u===r&&(u=null),u!==r&&(l=We())!==r?(125===e.charCodeAt(fe)?(s="}",fe++):(s=r,0===me&&Pe(y)),s!==r?(pe=t,n=E(o,a,u),t=n):(fe=t,t=r)):(fe=t,t=r)):(fe=t,t=r)):(fe=t,t=r)):(fe=t,t=r);return t}());return t}())===r&&(t=function(){var t,n,o,i,a,u,l,s,c,f,p;t=fe,123===e.charCodeAt(fe)?(n="{",fe++):(n=r,0===me&&Pe(h));if(n!==r)if(We()!==r)if((o=Ge())!==r)if(We()!==r)if(44===e.charCodeAt(fe)?(i=",",fe++):(i=r,0===me&&Pe(P)),i!==r)if(We()!==r)if("plural"===e.substr(fe,6)?(a="plural",fe+=6):(a=r,0===me&&Pe(z)),a===r&&("selectordinal"===e.substr(fe,13)?(a="selectordinal",fe+=13):(a=r,0===me&&Pe(F))),a!==r)if(We()!==r)if(44===e.charCodeAt(fe)?(u=",",fe++):(u=r,0===me&&Pe(P)),u!==r)if(We()!==r)if(l=fe,"offset:"===e.substr(fe,7)?(s="offset:",fe+=7):(s=r,0===me&&Pe(Y)),s!==r&&(c=We())!==r&&(f=Ue())!==r?l=s=[s,c,f]:(fe=l,l=r),l===r&&(l=null),l!==r)if((s=We())!==r){if(c=[],(f=Be())!==r)for(;f!==r;)c.push(f),f=Be();else c=r;c!==r&&(f=We())!==r?(125===e.charCodeAt(fe)?(p="}",fe++):(p=r,0===me&&Pe(y)),p!==r?(pe=t,n=function(e,t,n,r){return Qn({type:Zn.plural,pluralType:"plural"===t?"cardinal":"ordinal",value:e,offset:n?n[2]:0,options:r.reduce((function(e,t){var n=t.id,r=t.value,o=t.location;return n in e&&ge('Duplicate option "'+n+'" in plural element: "'+be()+'"',ve()),e[n]={value:r,location:o},e}),{})},tt())}(o,a,l,c),t=n):(fe=t,t=r)):(fe=t,t=r)}else fe=t,t=r;else fe=t,t=r;else fe=t,t=r;else fe=t,t=r;else fe=t,t=r;else fe=t,t=r;else fe=t,t=r;else fe=t,t=r;else fe=t,t=r;else fe=t,t=r;else fe=t,t=r;else fe=t,t=r;return t}())===r&&(t=function(){var t,n,o,i,a,u,l,s,c;t=fe,123===e.charCodeAt(fe)?(n="{",fe++):(n=r,0===me&&Pe(h));if(n!==r)if(We()!==r)if((o=Ge())!==r)if(We()!==r)if(44===e.charCodeAt(fe)?(i=",",fe++):(i=r,0===me&&Pe(P)),i!==r)if(We()!==r)if("select"===e.substr(fe,6)?(a="select",fe+=6):(a=r,0===me&&Pe(N)),a!==r)if(We()!==r)if(44===e.charCodeAt(fe)?(u=",",fe++):(u=r,0===me&&Pe(P)),u!==r)if(We()!==r){if(l=[],(s=Ne())!==r)for(;s!==r;)l.push(s),s=Ne();else l=r;l!==r&&(s=We())!==r?(125===e.charCodeAt(fe)?(c="}",fe++):(c=r,0===me&&Pe(y)),c!==r?(pe=t,n=function(e,t){return Qn({type:Zn.select,value:e,options:t.reduce((function(e,t){var n=t.id,r=t.value,o=t.location;return n in e&&ge('Duplicate option "'+n+'" in select element: "'+be()+'"',ve()),e[n]={value:r,location:o},e}),{})},tt())}(o,l),t=n):(fe=t,t=r)):(fe=t,t=r)}else fe=t,t=r;else fe=t,t=r;else fe=t,t=r;else fe=t,t=r;else fe=t,t=r;else fe=t,t=r;else fe=t,t=r;else fe=t,t=r;else fe=t,t=r;else fe=t,t=r;return t}())===r&&(t=function(){var t,n;t=fe,35===e.charCodeAt(fe)?(n="#",fe++):(n=r,0===me&&Pe(l));n!==r&&(pe=t,n=Qn({type:Zn.pound},tt()));return t=n}()),t}function Te(){var t,n,o,i;if(t=fe,pe=fe,(n=(n=nt)?void 0:r)!==r){if(o=[],(i=qe())===r&&(i=Ke())===r&&(i=$e())===r&&(60===e.charCodeAt(fe)?(i="<",fe++):(i=r,0===me&&Pe(a))),i!==r)for(;i!==r;)o.push(i),(i=qe())===r&&(i=Ke())===r&&(i=$e())===r&&(60===e.charCodeAt(fe)?(i="<",fe++):(i=r,0===me&&Pe(a)));else o=r;o!==r?(pe=t,t=n=u(o)):(fe=t,t=r)}else fe=t,t=r;if(t===r){if(t=fe,n=[],(o=qe())===r&&(o=Ke())===r&&(o=$e())===r&&(o=De()),o!==r)for(;o!==r;)n.push(o),(o=qe())===r&&(o=Ke())===r&&(o=$e())===r&&(o=De());else n=r;n!==r&&(pe=t,n=u(n)),t=n}return t}function De(){var t,n,o;return t=fe,n=fe,me++,(o=Me())===r&&(o=Ae())===r&&(o=Re()),me--,o===r?n=void 0:(fe=n,n=r),n!==r?(60===e.charCodeAt(fe)?(o="<",fe++):(o=r,0===me&&Pe(a)),o!==r?(pe=t,t=n="<"):(fe=t,t=r)):(fe=t,t=r),t}function Re(){var t,n,o,i,u,l;return t=fe,n=fe,60===e.charCodeAt(fe)?(o="<",fe++):(o=r,0===me&&Pe(a)),o!==r&&(i=Ze())!==r&&(u=We())!==r?("/>"===e.substr(fe,2)?(l="/>",fe+=2):(l=r,0===me&&Pe(c)),l!==r?n=o=[o,i,u,l]:(fe=n,n=r)):(fe=n,n=r),n!==r&&(pe=t,n=function(e){return Qn({type:Zn.literal,value:e.join("")},tt())}(n)),t=n}function Me(){var t,n,o,i;return t=fe,60===e.charCodeAt(fe)?(n="<",fe++):(n=r,0===me&&Pe(a)),n!==r&&(o=Ze())!==r?(62===e.charCodeAt(fe)?(i=">",fe++):(i=r,0===me&&Pe(f)),i!==r?(pe=t,t=n=o):(fe=t,t=r)):(fe=t,t=r),t}function Ae(){var t,n,o,i;return t=fe,"",fe++):(i=r,0===me&&Pe(f)),i!==r?(pe=t,t=n=o):(fe=t,t=r)):(fe=t,t=r),t}function Le(){var t,n,o,i,a;if(me++,t=fe,n=[],o=fe,i=fe,me++,(a=He())===r&&(b.test(e.charAt(fe))?(a=e.charAt(fe),fe++):(a=r,0===me&&Pe(v))),me--,a===r?i=void 0:(fe=i,i=r),i!==r?(e.length>fe?(a=e.charAt(fe),fe++):(a=r,0===me&&Pe(g)),a!==r?o=i=[i,a]:(fe=o,o=r)):(fe=o,o=r),o!==r)for(;o!==r;)n.push(o),o=fe,i=fe,me++,(a=He())===r&&(b.test(e.charAt(fe))?(a=e.charAt(fe),fe++):(a=r,0===me&&Pe(v))),me--,a===r?i=void 0:(fe=i,i=r),i!==r?(e.length>fe?(a=e.charAt(fe),fe++):(a=r,0===me&&Pe(g)),a!==r?o=i=[i,a]:(fe=o,o=r)):(fe=o,o=r);else n=r;return t=n!==r?e.substring(t,fe):n,me--,t===r&&(n=r,0===me&&Pe(m)),t}function Ie(){var t,n,o;return me++,t=fe,47===e.charCodeAt(fe)?(n="/",fe++):(n=r,0===me&&Pe(_)),n!==r&&(o=Le())!==r?(pe=t,t=n=o):(fe=t,t=r),me--,t===r&&(n=r,0===me&&Pe(w)),t}function ze(){var e,t,n,o;if(me++,e=fe,We()!==r)if((t=Le())!==r){for(n=[],o=Ie();o!==r;)n.push(o),o=Ie();n!==r?(pe=e,e=function(e,t){return{stem:e,options:t}}(t,n)):(fe=e,e=r)}else fe=e,e=r;else fe=e,e=r;return me--,e===r&&(r,0===me&&Pe(O)),e}function Fe(){var t,n,o,i;if(t=fe,39===e.charCodeAt(fe)?(n="'",fe++):(n=r,0===me&&Pe(C)),n!==r){if(o=[],(i=qe())===r&&(x.test(e.charAt(fe))?(i=e.charAt(fe),fe++):(i=r,0===me&&Pe(T))),i!==r)for(;i!==r;)o.push(i),(i=qe())===r&&(x.test(e.charAt(fe))?(i=e.charAt(fe),fe++):(i=r,0===me&&Pe(T)));else o=r;o!==r?(39===e.charCodeAt(fe)?(i="'",fe++):(i=r,0===me&&Pe(C)),i!==r?t=n=[n,o,i]:(fe=t,t=r)):(fe=t,t=r)}else fe=t,t=r;if(t===r)if(t=[],(n=qe())===r&&(D.test(e.charAt(fe))?(n=e.charAt(fe),fe++):(n=r,0===me&&Pe(R))),n!==r)for(;n!==r;)t.push(n),(n=qe())===r&&(D.test(e.charAt(fe))?(n=e.charAt(fe),fe++):(n=r,0===me&&Pe(R)));else t=r;return t}function Ye(){var t,n;if(t=[],M.test(e.charAt(fe))?(n=e.charAt(fe),fe++):(n=r,0===me&&Pe(A)),n!==r)for(;n!==r;)t.push(n),M.test(e.charAt(fe))?(n=e.charAt(fe),fe++):(n=r,0===me&&Pe(A));else t=r;return t}function Ne(){var t,n,o,i,a;return t=fe,We()!==r&&(n=Qe())!==r&&We()!==r?(123===e.charCodeAt(fe)?(o="{",fe++):(o=r,0===me&&Pe(h)),o!==r?(pe=fe,Xe.push("select"),(!0?void 0:r)!==r&&(i=Ce())!==r?(125===e.charCodeAt(fe)?(a="}",fe++):(a=r,0===me&&Pe(y)),a!==r?(pe=t,t=function(e,t){return Xe.pop(),Qn({id:e,value:t},tt())}(n,i)):(fe=t,t=r)):(fe=t,t=r)):(fe=t,t=r)):(fe=t,t=r),t}function Be(){var t,n,o,i,a;return t=fe,We()!==r&&(n=function(){var t,n,o,i;return t=fe,n=fe,61===e.charCodeAt(fe)?(o="=",fe++):(o=r,0===me&&Pe(B)),o!==r&&(i=Ue())!==r?n=o=[o,i]:(fe=n,n=r),(t=n!==r?e.substring(t,fe):n)===r&&(t=Qe()),t}())!==r&&We()!==r?(123===e.charCodeAt(fe)?(o="{",fe++):(o=r,0===me&&Pe(h)),o!==r?(pe=fe,Xe.push("plural"),(!0?void 0:r)!==r&&(i=Ce())!==r?(125===e.charCodeAt(fe)?(a="}",fe++):(a=r,0===me&&Pe(y)),a!==r?(pe=t,t=function(e,t){return Xe.pop(),Qn({id:e,value:t},tt())}(n,i)):(fe=t,t=r)):(fe=t,t=r)):(fe=t,t=r)):(fe=t,t=r),t}function He(){var t;return me++,V.test(e.charAt(fe))?(t=e.charAt(fe),fe++):(t=r,0===me&&Pe(W)),me--,t===r&&(r,0===me&&Pe(H)),t}function Ve(){var t;return me++,q.test(e.charAt(fe))?(t=e.charAt(fe),fe++):(t=r,0===me&&Pe(K)),me--,t===r&&(r,0===me&&Pe(U)),t}function We(){var t,n,o;for(me++,t=fe,n=[],o=He();o!==r;)n.push(o),o=He();return t=n!==r?e.substring(t,fe):n,me--,t===r&&(n=r,0===me&&Pe($)),t}function Ue(){var t,n,o,i,a;return me++,t=fe,45===e.charCodeAt(fe)?(n="-",fe++):(n=r,0===me&&Pe(Z)),n===r&&(n=null),n!==r&&(o=Je())!==r?(pe=t,i=n,t=n=(a=o)?i?-a:a:0):(fe=t,t=r),me--,t===r&&(n=r,0===me&&Pe(G)),t}function qe(){var t,n;return me++,t=fe,"''"===e.substr(fe,2)?(n="''",fe+=2):(n=r,0===me&&Pe(Q)),n!==r&&(pe=t,n="'"),me--,(t=n)===r&&(n=r,0===me&&Pe(J)),t}function Ke(){var t,n,o,i,a,u;if(t=fe,39===e.charCodeAt(fe)?(n="'",fe++):(n=r,0===me&&Pe(C)),n!==r)if((o=function(){var t,n,o,i;t=fe,n=fe,e.length>fe?(o=e.charAt(fe),fe++):(o=r,0===me&&Pe(g));o!==r?(pe=fe,(i=(i=function(e){return"<"===e||">"===e||"{"===e||"}"===e||et()&&"#"===e}(o))?void 0:r)!==r?n=o=[o,i]:(fe=n,n=r)):(fe=n,n=r);t=n!==r?e.substring(t,fe):n;return t}())!==r){for(i=fe,a=[],"''"===e.substr(fe,2)?(u="''",fe+=2):(u=r,0===me&&Pe(Q)),u===r&&(x.test(e.charAt(fe))?(u=e.charAt(fe),fe++):(u=r,0===me&&Pe(T)));u!==r;)a.push(u),"''"===e.substr(fe,2)?(u="''",fe+=2):(u=r,0===me&&Pe(Q)),u===r&&(x.test(e.charAt(fe))?(u=e.charAt(fe),fe++):(u=r,0===me&&Pe(T)));(i=a!==r?e.substring(i,fe):a)!==r?(39===e.charCodeAt(fe)?(a="'",fe++):(a=r,0===me&&Pe(C)),a===r&&(a=null),a!==r?(pe=t,t=n=o+i.replace("''","'")):(fe=t,t=r)):(fe=t,t=r)}else fe=t,t=r;else fe=t,t=r;return t}function $e(){var t,n,o,i;return t=fe,n=fe,e.length>fe?(o=e.charAt(fe),fe++):(o=r,0===me&&Pe(g)),o!==r?(pe=fe,(i=(i=X(o))?void 0:r)!==r?n=o=[o,i]:(fe=n,n=r)):(fe=n,n=r),n===r&&(10===e.charCodeAt(fe)?(n="\n",fe++):(n=r,0===me&&Pe(ee))),t=n!==r?e.substring(t,fe):n}function Ge(){var t,n;return me++,t=fe,(n=Je())===r&&(n=Qe()),t=n!==r?e.substring(t,fe):n,me--,t===r&&(n=r,0===me&&Pe(te)),t}function Ze(){var t,n;return me++,t=fe,(n=Je())===r&&(n=function(){var t,n,o,i,a;me++,t=fe,n=[],45===e.charCodeAt(fe)?(o="-",fe++):(o=r,0===me&&Pe(Z));o===r&&(o=fe,i=fe,me++,(a=He())===r&&(a=Ve()),me--,a===r?i=void 0:(fe=i,i=r),i!==r?(e.length>fe?(a=e.charAt(fe),fe++):(a=r,0===me&&Pe(g)),a!==r?o=i=[i,a]:(fe=o,o=r)):(fe=o,o=r));if(o!==r)for(;o!==r;)n.push(o),45===e.charCodeAt(fe)?(o="-",fe++):(o=r,0===me&&Pe(Z)),o===r&&(o=fe,i=fe,me++,(a=He())===r&&(a=Ve()),me--,a===r?i=void 0:(fe=i,i=r),i!==r?(e.length>fe?(a=e.charAt(fe),fe++):(a=r,0===me&&Pe(g)),a!==r?o=i=[i,a]:(fe=o,o=r)):(fe=o,o=r));else n=r;t=n!==r?e.substring(t,fe):n;me--,t===r&&(n=r,0===me&&Pe(ce));return t}()),t=n!==r?e.substring(t,fe):n,me--,t===r&&(n=r,0===me&&Pe(ne)),t}function Je(){var t,n,o,i,a;if(me++,t=fe,48===e.charCodeAt(fe)?(n="0",fe++):(n=r,0===me&&Pe(oe)),n!==r&&(pe=t,n=0),(t=n)===r){if(t=fe,n=fe,ie.test(e.charAt(fe))?(o=e.charAt(fe),fe++):(o=r,0===me&&Pe(ae)),o!==r){for(i=[],ue.test(e.charAt(fe))?(a=e.charAt(fe),fe++):(a=r,0===me&&Pe(le));a!==r;)i.push(a),ue.test(e.charAt(fe))?(a=e.charAt(fe),fe++):(a=r,0===me&&Pe(le));i!==r?n=o=[o,i]:(fe=n,n=r)}else fe=n,n=r;n!==r&&(pe=t,n=parseInt(n.join(""),10)),t=n}return me--,t===r&&(n=r,0===me&&Pe(re)),t}function Qe(){var t,n,o,i,a;if(me++,t=fe,n=[],o=fe,i=fe,me++,(a=He())===r&&(a=Ve()),me--,a===r?i=void 0:(fe=i,i=r),i!==r?(e.length>fe?(a=e.charAt(fe),fe++):(a=r,0===me&&Pe(g)),a!==r?o=i=[i,a]:(fe=o,o=r)):(fe=o,o=r),o!==r)for(;o!==r;)n.push(o),o=fe,i=fe,me++,(a=He())===r&&(a=Ve()),me--,a===r?i=void 0:(fe=i,i=r),i!==r?(e.length>fe?(a=e.charAt(fe),fe++):(a=r,0===me&&Pe(g)),a!==r?o=i=[i,a]:(fe=o,o=r)):(fe=o,o=r);else n=r;return t=n!==r?e.substring(t,fe):n,me--,t===r&&(n=r,0===me&&Pe(se)),t}var Xe=["root"];function et(){return"plural"===Xe[Xe.length-1]}function tt(){return t&&t.captureLocation?{location:ve()}:{}}var nt=t&&t.ignoreTag,rt=t&&t.shouldParseSkeleton;if((n=i())!==r&&fe===e.length)return n;throw n!==r&&fe1&&void 0!==arguments[1]?arguments[1]:{};if(!this.endpoints[e])throw new Error('There are no routes for the resourceKey "'+e+'"!');if(!this.endpoints[e].routes.detail)throw new Error('There is no detail route for the resourceKey "'+e+'"');return Hr.a.generate(this.endpoints[e].routes.detail,Ur(t))}},{key:"getListUrl",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.endpoints[e])throw new Error('There are no routes for the resourceKey "'+e+'"!');if(!this.endpoints[e].routes.list)throw new Error('There is no list route for the resourceKey "'+e+'"');return Hr.a.generate(this.endpoints[e].routes.list,Ur(t))}}])&&Vr(t.prototype,n),r&&Vr(t,r),e}());function Kr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function $r(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{};return G.get(qr.getListUrl(e,$r($r({},t),{},{flat:!0})))}},{key:"delete",value:function(e,t){return G.delete(qr.getDetailUrl(e,$r({},t)))}},{key:"deleteList",value:function(e,t){return G.delete(qr.getListUrl(e,t))}}],(n=null)&&Zr(t.prototype,n),r&&Zr(t,r),e}();function ro(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return oo(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return oo(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function oo(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0?t[0]:void 0;return r?r.locale:Un.fallbackLocale}}])&&Do(t.prototype,n),r&&Do(t,r),e}()).prototype,"persistentSettings",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return new Map}}),So=Ro(_o.prototype,"user",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){}}),ko=Ro(_o.prototype,"contact",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){}}),Po=Ro(_o.prototype,"loggedIn",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),jo=Ro(_o.prototype,"loading",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),Eo=Ro(_o.prototype,"loginError",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),Co=Ro(_o.prototype,"forgotPasswordSuccess",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),Ro(_o.prototype,"clear",[v.d],Object.getOwnPropertyDescriptor(_o.prototype,"clear"),_o.prototype),Ro(_o.prototype,"systemLocale",[v.g],Object.getOwnPropertyDescriptor(_o.prototype,"systemLocale"),_o.prototype),Ro(_o.prototype,"setLoggedIn",[v.d],Object.getOwnPropertyDescriptor(_o.prototype,"setLoggedIn"),_o.prototype),Ro(_o.prototype,"setLoading",[v.d],Object.getOwnPropertyDescriptor(_o.prototype,"setLoading"),_o.prototype),Ro(_o.prototype,"setLoginError",[v.d],Object.getOwnPropertyDescriptor(_o.prototype,"setLoginError"),_o.prototype),Ro(_o.prototype,"setForgotPasswordSuccess",[v.d],Object.getOwnPropertyDescriptor(_o.prototype,"setForgotPasswordSuccess"),_o.prototype),Ro(_o.prototype,"contentLocale",[v.g],Object.getOwnPropertyDescriptor(_o.prototype,"contentLocale"),_o.prototype),Ro(_o.prototype,"setUser",[v.d],Object.getOwnPropertyDescriptor(_o.prototype,"setUser"),_o.prototype),Ro(_o.prototype,"updateContentLocale",[v.d],Object.getOwnPropertyDescriptor(_o.prototype,"updateContentLocale"),_o.prototype),Ro(_o.prototype,"setContact",[v.d],Object.getOwnPropertyDescriptor(_o.prototype,"setContact"),_o.prototype),Ro(_o.prototype,"setFullName",[v.d],Object.getOwnPropertyDescriptor(_o.prototype,"setFullName"),_o.prototype),Ro(_o.prototype,"setPersistentSetting",[v.d],Object.getOwnPropertyDescriptor(_o.prototype,"setPersistentSetting"),_o.prototype),_o),Ao=function(e,t){if(t.locale)return t;if(!e.availableAttributes.includes("locale"))return t;var n=Object(v.u)(e.options.locales);return n&&!n.includes(Mo.contentLocale)||(t.locale=Mo.contentLocale),t},Lo=function(e,t){if(!e||!t)return!0;if(!e.availableAttributes.includes("locale"))return!0;if(t.locale){var n="function"==typeof t.locale.get?t.locale.get():t.locale;if("string"!=typeof n)throw new Error('The "locale" router attribute must be a string if given!');Mo.updateContentLocale(n)}return!0},Io=function(e){401===e.status&&Mo.setLoggedIn(!1)},zo=Mo;function Fo(e,t){for(var n=0;n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function No(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function ks(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ps(e,t){for(var n=0;n=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function Is(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function zs(e,t){for(var n=0;n9&&void 0!==arguments[9])||arguments[9],f=window.innerWidth,p=window.innerHeight,d={top:r+l-s,left:o+u,height:n,scrollTop:0};c?d.top=r+l+a:r<10?d.top=10:r+a>p-10&&(d.top=p-n-10);var h=e.cropVerticalDimensions(d,p);return!c&&h.dimensions.height>=200||(h.touchesTopBorder&&(d.top=r+l),h.touchesBottomBorder&&(d.top=c?r-n-l:r+a-n-l),h=e.cropVerticalDimensions(d,p)),e.cropHorizontalDimensions(h.dimensions,f,t,o,i)}},{key:"cropVerticalDimensions",value:function(e,t){var n=tc({},e),r=!1,o=!1;if(e.top<10){var i=e.height+e.top-10;n.top=10,n.height=i<0?e.height:i,n.scrollTop=10-e.top,r=!0}return n.top+n.height>t-10&&(n.height=t-n.top-10,o=!0),{dimensions:n,touchesTopBorder:r,touchesBottomBorder:o}}},{key:"cropHorizontalDimensions",value:function(e,t,n,r,o){var i=tc({},e);return i.left=Math.max(10,i.left),n+i.left+10>t&&(i.left=r+o-n),i}}],(n=null)&&rc(t.prototype,n),r&&rc(t,r),e}(),dc=n(382),hc=n.n(dc);function yc(e){return(yc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function mc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function bc(e){for(var t=1;tr.getBoundingClientRect().top?"bottom":"top",l=i.left===r.getBoundingClientRect().left?"left":"right";return y.a.createElement(h.Fragment,null,y.a.createElement(gl,null,o&&y.a.createElement(ci,{onClick:this.handleBackdropClick,visible:!1}),y.a.createElement("div",{className:hc.a.container},n&&n(this.setPopoverChildRef,a,u,l))))}},{key:"dimensions",get:function(){var e=this.props,t=e.anchorElement,n=e.verticalOffset,r=e.horizontalOffset,o=e.centerChildElement,i=t.getBoundingClientRect(),a=i.top,u=void 0===a?0:a,l=i.left,s=void 0===l?0:l,c=i.width,f=void 0===c?0:c,p=i.height,d=void 0===p?0:p,h=o?o.offsetTop:0,y=!o;return pc.getCroppedDimensions(this.popoverWidth,this.popoverHeight,u,s,f,d,r,n,h,y)}}])&&wc(t.prototype,n),r&&wc(t,r),i}(y.a.Component),cc.defaultProps={backdrop:!0,horizontalOffset:0,open:!1,verticalOffset:0},ac=jc((ic=fc).prototype,"popoverChildRef",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),uc=jc(ic.prototype,"popoverWidth",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),lc=jc(ic.prototype,"popoverHeight",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),jc(ic.prototype,"dimensions",[v.g],Object.getOwnPropertyDescriptor(ic.prototype,"dimensions"),ic.prototype),jc(ic.prototype,"setPopoverSize",[v.d],Object.getOwnPropertyDescriptor(ic.prototype,"setPopoverSize"),ic.prototype),sc=jc(ic.prototype,"setPopoverChildRef",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){t&&(e.popoverChildRef=t,e.mutationObserver.disconnect(),e.mutationObserver.observe(e.popoverChildRef,{childList:!0,subtree:!0}));var n=e.props.popoverChildRef;n&&n(t)}}}),oc=ic))||oc,Cc=n(92),xc=n.n(Cc);function Tc(e){return(Tc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Dc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Rc(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:"top",o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"left",i=this.props.children,a=this.cloneChildren(i),u=tn()(wf.a.arrow,(Of(n={},wf.a.top,"top"===r),Of(n,wf.a.bottom,"bottom"===r),Of(n,wf.a.left,"left"===o),Of(n,wf.a.right,"right"===o),n));return y.a.createElement("div",{className:wf.a.arrowMenuContainer,ref:e,style:t},y.a.createElement("div",{className:u}),y.a.createElement("div",{className:wf.a.arrowMenu},a))}}])&&Pf(t.prototype,n),r&&Pf(t,r),i}(y.a.Component),bf.defaultProps={refProp:"ref"},bf.Section=Kc,bf.SingleItemSection=tf,bf.Item=zc,bf.Action=pf,yf=Df((hf=vf).prototype,"displayValueRef",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),mf=Df(hf.prototype,"setDisplayValueRef",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){e.displayValueRef=t}}}),df=hf))||df,Bf=n(30),Hf=n.n(Bf),Vf=n(71),Wf=n.n(Vf);function Uf(e){return(Uf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function qf(e,t,n,r){n&&Object.defineProperty(e,t,{enumerable:n.enumerable,configurable:n.configurable,writable:n.writable,value:n.initializer?n.initializer.call(r):void 0})}function Kf(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $f(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};if(e in this.fields)throw new Error('The key "'+e+'" has already been used for another field');this.fields[e]=t,this.options[e]=n}},{key:"get",value:function(e){if(!(e in this.fields))throw new Error('There is no field with key "'+e+'" registered');return this.fields[e]}},{key:"getOptions",value:function(e){if(!(e in this.options))throw new Error('There are no options for a field with the key "'+e+'" registered');return this.options[e]}},{key:"has",value:function(e){return e in this.fields}}])&&xp(t.prototype,n),r&&xp(t,r),e}()),Rp=n(73),Mp=n.n(Rp);function Ap(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.focusedElementIndex})))))):void 0},e.handleKeyPress=function(t){e.open&&(t.preventDefault(),e.appendSearchText(t.key))},e}return t=i,(n=[{key:"cloneOption",value:function(e,t){var n=this.displayValueRef?this.displayValueRef.getBoundingClientRect().width:0;return y.a.cloneElement(e,{anchorWidth:n,onClick:this.handleOptionClick,selected:this.props.isOptionSelected(e),selectedVisualization:this.props.selectedVisualization,requestFocus:this.handleRequestFocus(t),optionRef:this.setSelectedOptionRef,buttonRef:this.setButtonRef(t)})}},{key:"cloneAction",value:function(e,t){return y.a.cloneElement(e,{afterAction:this.closeOptionList,buttonRef:this.setButtonRef(t),requestFocus:this.handleRequestFocus(t)})}},{key:"cloneChildren",value:function(){var e=this;return y.a.Children.map(this.props.children,(function(t,n){if(!t)return t;switch(t.type){case Zh:return e.cloneOption(t,n);case uh:return e.cloneAction(t,n);default:return t}}))}},{key:"render",value:function(){var e=this.props,t=e.icon,n=e.disabled,r=e.displayValue,o=e.skin,i=this.cloneChildren();return y.a.createElement("div",{className:Ly.a.select,onKeyDown:this.handleKeyDown,onKeyPress:this.handleKeyPress,role:"none"},y.a.createElement(my,{disabled:n,displayValueRef:this.setDisplayValueRef,icon:t,onClick:this.handleDisplayValueClick,skin:o},r),y.a.createElement(Ec,{anchorElement:this.displayValueRef,centerChildElement:this.selectedOptionRef,horizontalOffset:-20,onClose:this.handleOptionListClose,open:this.open,verticalOffset:2},(function(e,t){return y.a.createElement(Jd,{menuRef:e,style:t},y.a.Children.count(i)>0?i:y.a.createElement(Zh,{disabled:!0,value:null},Nr("sulu_admin.no_options_available")))})))}},{key:"buttonTextsByIndex",get:function(){return Array.from(this.buttonRefsByIndex.entries()).reduce((function(e,t){var n=zy(t,2),r=n[0],o=n[1];return e.set(r,o.textContent),e}),new Map)}},{key:"availableButtonIndices",get:function(){return Array.from(this.buttonRefsByIndex.keys())}},{key:"firstSelectedIndex",get:function(){var e=this,t=-1;return y.a.Children.forEach(this.props.children,(function(n,r){n&&n.type===Zh&&-1===t&&e.props.isOptionSelected(n)&&(t=r)})),t}}])&&Vy(t.prototype,n),r&&Vy(t,r),i}(y.a.Component),Ry.defaultProps={closeOnSelect:!0,disabled:!1,skin:"default"},Ry.Action=uh,Ry.Option=Zh,Ry.Divider=Jd.Divider,gy=Gy((vy=My).prototype,"displayValueRef",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),wy=Gy(vy.prototype,"selectedOptionRef",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),_y=Gy(vy.prototype,"buttonRefsByIndex",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return new Map}}),Oy=Gy(vy.prototype,"searchText",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),Sy=Gy(vy.prototype,"focusedElementIndex",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return-1}}),ky=Gy(vy.prototype,"open",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Gy(vy.prototype,"buttonTextsByIndex",[v.g],Object.getOwnPropertyDescriptor(vy.prototype,"buttonTextsByIndex"),vy.prototype),Gy(vy.prototype,"availableButtonIndices",[v.g],Object.getOwnPropertyDescriptor(vy.prototype,"availableButtonIndices"),vy.prototype),Gy(vy.prototype,"firstSelectedIndex",[v.g],Object.getOwnPropertyDescriptor(vy.prototype,"firstSelectedIndex"),vy.prototype),Py=Gy(vy.prototype,"setDisplayValueRef",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){t&&(e.displayValueRef=t)}}}),jy=Gy(vy.prototype,"setSelectedOptionRef",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t,n){(!e.selectedOptionRef||t&&n)&&(e.selectedOptionRef=t)}}}),Ey=Gy(vy.prototype,"openOptionList",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){e.open=!0,e.clearSearchText(),e.focusedElementIndex=e.firstSelectedIndex}}}),Cy=Gy(vy.prototype,"closeOptionList",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){var t=e.props.onClose;t&&t(),e.open=!1,e.displayValueRef&&e.displayValueRef.focus()}}}),xy=Gy(vy.prototype,"clearSearchText",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){e.searchText=""}}}),Ty=Gy(vy.prototype,"appendSearchText",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){e.searchText+=t;var n=Array.from(e.buttonTextsByIndex.entries()).find((function(t){return zy(t,2)[1].toLowerCase().startsWith(e.searchText.toLowerCase())}));n&&e.requestFocus(n[0]),e.debouncedClearSearchText()}}}),Dy=Gy(vy.prototype,"requestFocus",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){if(e.buttonRefsByIndex.has(t)){e.focusedElementIndex=t;var n=e.buttonRefsByIndex.get(t);n&&n.focus()}}}}),by=vy))||by;function Jy(e){return(Jy="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Qy(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Xy(e,t){for(var n=0;n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function vb(e){return function(e){if(Array.isArray(e))return wb(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||gb(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function gb(e,t){if(e){if("string"==typeof e)return wb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?wb(e,t):void 0}}function wb(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n3&&void 0!==arguments[3]?arguments[3]:"",o=arguments.length>4?arguments[4]:void 0,i=arguments.length>5?arguments[5]:void 0;return Object.keys(e).reduce((function(a,u){return a[u]=Pb(e[u],t,n,r+"/"+u,o,i),a}),{})}function Pb(e,t,n,r,o,i){var a=fb.getAll().reduce((function(e,t){return Ob(Ob({},e),t(e,o,i))}),Ob(Ob({},t),{},{__locale:n}));return Object.keys(e).reduce((function(u,l){if("disabledCondition"===l&&e[l])u.disabled=w.a.evalSync(e[l],a);else if("visibleCondition"===l&&e[l])u.visible=w.a.evalSync(e[l],a);else if("items"===l&&e.items)u.items=kb(e.items,t,n,r,o,i);else if("types"===l&&e.types){var s=e.types;u.types=Object.keys(s).reduce((function(e,a){return e[a]={title:s[a].title,form:kb(s[a].form,t,n,r+"/types/"+a+"/form",o,i)},e}),{})}else u[l]=e[l];return u}),{})}function jb(e,t){return e.priority>t.priority?-1:e.priority3&&void 0!==arguments[3]?arguments[3]:[""],o=[];for(var i in n){var a=n[i],u=a.items,l=a.tags,s=a.type,c=a.types;if("section"===s&&u)o.push.apply(o,vb(Eb(e,t,u,r)));else if(c&&Object.keys(c).length>0&&t[i]&&(Array.isArray(t[i])||Object(v.n)(t[i]))){var f,p=bb(t[i].keys());try{for(p.s();!(f=p.n()).done;){var d=f.value,h=t[i][d];o.push.apply(o,vb(Eb(e,h,c[h.type].form,r.concat([i,d]))))}}catch(e){p.e(e)}finally{p.f()}}else if(l){var y=l.filter((function(t){return t.name===e}));if(0===y.length)continue;o.push({path:r.concat([i]).join("/"),priority:Math.max.apply(Math,vb(y.map((function(e){return e.priority||0}))))})}else;}return o.sort(jb)}var Cb,xb,Tb,Db,Rb=(ab=v.g.struct,lb=mb((ub=function(){function e(){var t=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),hb(this,"rawSchema",lb,this),hb(this,"evaluatedSchema",sb,this),this.modifiedFields=[],hb(this,"errors",cb,this),this.pathsByTag={},this.updateFieldPathEvaluations=function(){var e=t.loading,n=t.rawSchema,r=t.locale?t.locale.get():void 0;Object(v.w)((function(){return!e}),(function(){return t.setEvaluatedSchema(kb(n,Object(v.v)((function(){return Object(v.u)(t.data)})),r,"",t.options,t.metadataOptions))}))},this.getValueByPath=function(e){return ls.a.has(t.data,e)?ls.a.get(t.data,e):void 0}}var t,n,r;return t=e,(n=[{key:"isFieldModified",value:function(e){return this.modifiedFields.includes(e)}},{key:"finishField",value:function(e){this.modifiedFields.includes(e)||this.modifiedFields.push(e),this.updateFieldPathEvaluations()}},{key:"setMultiple",value:function(){this.updateFieldPathEvaluations()}},{key:"validate",value:function(){var e=this.validator,t={};if(e&&!e(Object(v.u)(this.data))){var n,r=bb(e.errors);try{for(r.s();!(n=r.n()).done;){var o=n.value;switch(o.keyword){case"oneOf":case"anyOf":break;case"required":ls.a.set(t,o.dataPath+"/"+o.params.missingProperty,{keyword:o.keyword,parameters:o.params});break;default:ls.a.set(t,o.dataPath,{keyword:o.keyword,parameters:o.params})}}}catch(e){r.e(e)}finally{r.f()}}return this.errors=t,!(Object.keys(this.errors).length>0&&(d.a.info("Form validation detected the following errors: ",Object(v.u)(this.errors)),1))}},{key:"setEvaluatedSchema",value:function(e){this.evaluatedSchema=e}},{key:"getValuesByTag",value:function(e){return this.getPathsByTag(e).map(this.getValueByPath)}},{key:"getPathsByTag",value:function(e){var t=this.data,n=this.rawSchema;return e in this.pathsByTag||(this.pathsByTag[e]=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[""];return Eb(e,t,n,r).map((function(e){return e.path}))}(e,t,n)),this.pathsByTag[e]}},{key:"getSchemaEntryByPath",value:function(e){return ls.a.get(this.schema,e)}},{key:"addMissingSchemaProperties",value:function(){var e=this,t=Object.keys(this.rawSchema).reduce((function(t,n){return function e(t,n,r){var o=r[n].type;"section"!==o&&ls.a.set(t,"/"+n,void 0);var i=r[n].items;return"section"===o&&i&&Object.keys(i).reduce((function(n,r){return e(t,r,i)}),t),t}(t,n,e.rawSchema)}),{});Object(v.s)(this.data,Ob(Ob({},t),this.data))}},{key:"schema",get:function(){return Object(v.u)(this.evaluatedSchema)}},{key:"forbidden",get:function(){return!1}}])&&yb(t.prototype,n),r&&yb(t,r),e}()).prototype,"rawSchema",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),sb=mb(ub.prototype,"evaluatedSchema",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return{}}}),cb=mb(ub.prototype,"errors",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return{}}}),mb(ub.prototype,"schema",[ab],Object.getOwnPropertyDescriptor(ub.prototype,"schema"),ub.prototype),mb(ub.prototype,"validate",[v.d],Object.getOwnPropertyDescriptor(ub.prototype,"validate"),ub.prototype),mb(ub.prototype,"setEvaluatedSchema",[v.d],Object.getOwnPropertyDescriptor(ub.prototype,"setEvaluatedSchema"),ub.prototype),mb(ub.prototype,"addMissingSchemaProperties",[v.d],Object.getOwnPropertyDescriptor(ub.prototype,"addMissingSchemaProperties"),ub.prototype),ub);function Mb(e){return(Mb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ab(e,t,n,r){n&&Object.defineProperty(e,t,{enumerable:n.enumerable,configurable:n.configurable,writable:n.writable,value:n.initializer?n.initializer.call(r):void 0})}function Lb(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{},o=qb({type:e,key:t},r);this.metadataPromises[e]||(this.metadataPromises[e]={});var i=t+ki(r);if(!this.metadataPromises[e][i]){var a=Hr.a.generate("sulu_admin.metadata",o),u=fetch(a,Gb).then((function(t){if(!t.ok)return n.metadataPromises[e][i]=void 0,Promise.reject(t);var r=t.headers.get("cache-control");return r&&r.includes("no-store")&&(n.metadataPromises[e][i]=void 0),t.json()}));return this.metadataPromises[e][i]=u,u}return this.metadataPromises[e][i]}}])&&$b(t.prototype,n),r&&$b(t,r),e}());function Jb(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0;return new av((function(e,r){return new Wb(t,e,r,n,o)}),e,r,o)}},{key:"createFromSchema",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return new Wb(n,e,t)}}])&&uv(t.prototype,n),r&&uv(t,r),e}());function _v(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ov(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=arguments.length>4?arguments[4]:void 0,u=arguments.length>5&&void 0!==arguments[5]&&arguments[5];Pv(this,e),kv(this,"id",sv,this),kv(this,"initialized",cv,this),kv(this,"loading",fv,this),kv(this,"saving",pv,this),kv(this,"deleting",dv,this),kv(this,"moving",hv,this),kv(this,"data",yv,this),kv(this,"dirty",mv,this),kv(this,"forbidden",bv,this),this.loadOptions={},this.load=function(){var e=r.id,t=r.observableOptions.locale;if(!t||t.get())if(r.preventLoadingOnce)r.preventLoadingOnce=!1;else if(e){var n={};t&&(n.locale=t.get()),d.a.info('ResourceStore loads "'+r.resourceKey+'" data with the ID "'+e+'"'),r.setLoading(!0),r.setForbidden(!1),(r.idQueryParameter?no.get(r.resourceKey,Ov(Ov(Ov({},n),r.loadOptions),{},Sv({},r.idQueryParameter,e))):no.get(r.resourceKey,Ov(Ov(Ov({},n),r.loadOptions),{},{id:e}))).then(Object(v.d)((function(e){r.idQueryParameter?(r.handleIdQueryParameterResponse(e),r.setMultiple(e)):r.setMultiple(e),r.initialized=!0,r.setLoading(!1),r.dirty=!1}))).catch(Object(v.d)((function(e){403===e.status&&r.setForbidden(!0)})))}else r.initialized=!0},kv(this,"reload",vv,this),kv(this,"move",gv,this),this.resourceKey=t,this.id=n,this.observableOptions=o,this.loadOptions=i,this.idQueryParameter=a,this.preventLoadingOnce=u,this.disposer=Object(v.e)(this.load)}var t,n,r;return t=e,(n=[{key:"setLoading",value:function(e){this.loading=e}},{key:"setForbidden",value:function(e){this.forbidden=e}},{key:"save",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.observableOptions.locale;return t&&(e.locale=t.get()),this.idQueryParameter||!this.id?this.create(e):this.update(e)}},{key:"create",value:function(e){var t=this;this.saving=!0;var n=e;return this.idQueryParameter&&(n[this.idQueryParameter]=this.id),no.post(this.resourceKey,this.data,n).then(Object(v.d)((function(e){return t.handleIdQueryParameterResponse(e),t.setMultiple(e),t.saving=!1,t.dirty=!1,e}))).catch(Object(v.d)((function(e){throw t.saving=!1,e})))}},{key:"update",value:function(e){var t=this;if(!this.id)throw new Error('Can not save resource with an undefined "id"');return this.saving=!0,no.put(this.resourceKey,this.data,Ov(Ov({},e),{},{id:this.id})).then(Object(v.d)((function(e){return t.setMultiple(e),t.saving=!1,t.dirty=!1,e}))).catch(Object(v.d)((function(e){throw t.saving=!1,e})))}},{key:"delete",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!this.data.id)throw new Error('Cannot delete resource with an undefined "id"');this.deleting=!0;var n=this.observableOptions.locale,r=t;return n&&(r.locale=n.get()),no.delete(this.resourceKey,Ov(Ov({},r),{},{id:this.data.id})).then(Object(v.d)((function(t){e.id=void 0,e.setMultiple(t),e.deleting=!1,e.dirty=!1,e.destroy()}))).catch(Object(v.d)((function(t){throw e.deleting=!1,t})))}},{key:"copyFromLocale",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.id)throw new Error("Copying from another locale does not work for new objects!");if(!this.locale)throw new Error("Copying from another locale does only work for objects with locales!");var r=this.locale.get();return no.post(this.resourceKey,{},Ov(Ov({},n),{},{action:"copy-locale",dest:r,id:this.id,locale:r,src:e})).then(Object(v.d)((function(e){return t.setMultiple(e),e})))}},{key:"set",value:function(e,t){"id"!==e||"string"!=typeof t&&"number"!=typeof t||(this.id=t),ls.a.set(this.data,"/"+e,t)}},{key:"setMultiple",value:function(e){var t=this;e.id&&(this.id=e.id),Object.keys(e).forEach((function(n){t.set(n,e[n])})),Object(v.s)(this.data,this.data),d.a.info('ResourceStore changed "'+this.resourceKey+'" data with the ID "'+(this.id||"undefined")+'"',this.data)}},{key:"change",value:function(e,t){this.set(e,t),this.dirty=!0}},{key:"changeMultiple",value:function(e){this.setMultiple(e),this.dirty=!0}},{key:"clone",value:function(){var t=this,n=new e(this.resourceKey,this.id,this.observableOptions,this.loadOptions,void 0,!0);return n.loading=this.loading,Object(v.w)((function(){return!t.loading}),(function(){n.data=Object(v.u)(t.data),n.loading=!1})),n}},{key:"destroy",value:function(){this.disposer()}},{key:"handleIdQueryParameterResponse",value:function(e){e.id&&(this.idQueryParameter=void 0,this.id=e.id,this.preventLoadingOnce=!0)}},{key:"locale",get:function(){return this.observableOptions.locale}}])&&jv(t.prototype,n),r&&jv(t,r),e}()).prototype,"id",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),cv=Ev(lv.prototype,"initialized",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),fv=Ev(lv.prototype,"loading",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),pv=Ev(lv.prototype,"saving",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),dv=Ev(lv.prototype,"deleting",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),hv=Ev(lv.prototype,"moving",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),yv=Ev(lv.prototype,"data",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return{}}}),mv=Ev(lv.prototype,"dirty",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),bv=Ev(lv.prototype,"forbidden",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),vv=Ev(lv.prototype,"reload",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){e.load()}}}),Ev(lv.prototype,"setLoading",[v.d],Object.getOwnPropertyDescriptor(lv.prototype,"setLoading"),lv.prototype),Ev(lv.prototype,"setForbidden",[v.d],Object.getOwnPropertyDescriptor(lv.prototype,"setForbidden"),lv.prototype),Ev(lv.prototype,"save",[v.d],Object.getOwnPropertyDescriptor(lv.prototype,"save"),lv.prototype),Ev(lv.prototype,"create",[v.d],Object.getOwnPropertyDescriptor(lv.prototype,"create"),lv.prototype),Ev(lv.prototype,"update",[v.d],Object.getOwnPropertyDescriptor(lv.prototype,"update"),lv.prototype),Ev(lv.prototype,"delete",[v.d],Object.getOwnPropertyDescriptor(lv.prototype,"delete"),lv.prototype),gv=Ev(lv.prototype,"move",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){if(!e.id)throw new Error("Moving does not work for new objects!");e.moving=!0;var n=e.observableOptions.locale,r={action:"move",destination:t,locale:n?n.get():void 0};return no.post(e.resourceKey,void 0,Ov(Ov({},r),{},{id:e.id})).then(Object(v.d)((function(){e.moving=!1}))).catch(Object(v.d)((function(t){throw e.moving=!1,t})))}}}),Ev(lv.prototype,"set",[v.d],Object.getOwnPropertyDescriptor(lv.prototype,"set"),lv.prototype),Ev(lv.prototype,"setMultiple",[v.d],Object.getOwnPropertyDescriptor(lv.prototype,"setMultiple"),lv.prototype),Ev(lv.prototype,"change",[v.d],Object.getOwnPropertyDescriptor(lv.prototype,"change"),lv.prototype),Ev(lv.prototype,"changeMultiple",[v.d],Object.getOwnPropertyDescriptor(lv.prototype,"changeMultiple"),lv.prototype),Ev(lv.prototype,"clone",[v.d],Object.getOwnPropertyDescriptor(lv.prototype,"clone"),lv.prototype),Ev(lv.prototype,"handleIdQueryParameterResponse",[v.d],Object.getOwnPropertyDescriptor(lv.prototype,"handleIdQueryParameterResponse"),lv.prototype),lv);function Iv(e){return(Iv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function zv(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Fv(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Fv(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Fv(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:{},a=arguments.length>3?arguments[3]:void 0;return Vv(this,i),Hv(n=o.call(this),"type",xv,Gv(n)),Hv(n,"types",Tv,Gv(n)),Hv(n,"schemaLoading",Dv,Gv(n)),Hv(n,"typesLoading",Rv,Gv(n)),Hv(n,"handleSchemaTypeResponse",Mv,Gv(n)),Hv(n,"handleSchemaResponse",Av,Gv(n)),n.resourceStore=e,n.formKey=t,n.options=r,n.metadataOptions=a,tv.getSchemaTypes(n.formKey,n.metadataOptions).then(n.handleSchemaTypeResponse),n}return t=i,(n=[{key:"destroy",value:function(){this.schemaDisposer&&this.schemaDisposer(),this.typeDisposer&&this.typeDisposer(),this.updateFieldPathEvaluationsDisposer&&this.updateFieldPathEvaluationsDisposer()}},{key:"save",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.validate()?this.resourceStore.save(Nv(Nv({},this.options),t)).then((function(t){var n=e.modifiedFields;return n.splice(0,n.length),t})).catch((function(e){return e.json().then(Object(v.d)((function(e){return Promise.reject(e)})))})):Promise.reject("Errors occured when trying to save the data from the FormStore")}},{key:"delete",value:function(e){return this.resourceStore.delete(Nv(Nv({},this.options),e))}},{key:"copyFromLocale",value:function(e){var t=this;return this.resourceStore.copyFromLocale(e,this.options).then((function(e){t.hasTypes&&t.setType(e.template)}))}},{key:"set",value:function(e,t){this.resourceStore.set(e,t)}},{key:"setMultiple",value:function(e){this.resourceStore.setMultiple(e),Uv(Zv(i.prototype),"setMultiple",this).call(this)}},{key:"change",value:function(e,t){this.resourceStore.change(e,t)}},{key:"setSchemaLoading",value:function(e){this.schemaLoading=e}},{key:"setType",value:function(e){this.validateTypes(),this.type=e,this.set("template",e)}},{key:"changeType",value:function(e){this.validateTypes(),this.type=e,this.change("template",e)}},{key:"validateTypes",value:function(){if(0===Object.keys(this.types).length)throw new Error('The form "'+this.formKey+'" handled by this ResourceFormStore cannot handle types')}},{key:"getSchemaEntryByPath",value:function(e){return ls.a.get(this.schema,e)}},{key:"hasTypes",get:function(){return Object.keys(this.types).length>0}},{key:"hasInvalidType",get:function(){return!!this.types&&!!this.type&&!Object(v.j)(this.types,this.type)}},{key:"loading",get:function(){return this.resourceStore.loading||this.schemaLoading}},{key:"data",get:function(){return this.resourceStore.data}},{key:"locale",get:function(){return this.resourceStore.locale}},{key:"resourceKey",get:function(){return this.resourceStore.resourceKey}},{key:"id",get:function(){return this.resourceStore.id}},{key:"saving",get:function(){return this.resourceStore.saving}},{key:"deleting",get:function(){return this.resourceStore.deleting}},{key:"forbidden",get:function(){return this.resourceStore.forbidden}},{key:"dirty",get:function(){return this.resourceStore.dirty},set:function(e){this.resourceStore.dirty=e}}])&&Wv(t.prototype,n),r&&Wv(t,r),i}(Rb)).prototype,"type",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Tv=Jv(Cv.prototype,"types",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return{}}}),Dv=Jv(Cv.prototype,"schemaLoading",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),Rv=Jv(Cv.prototype,"typesLoading",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),Mv=Jv(Cv.prototype,"handleSchemaTypeResponse",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){var n=t||{},r=n.types,o=void 0===r?{}:r,i=n.defaultType;e.types=o,e.typesLoading=!1,e.hasTypes&&Object(v.w)((function(){return!e.resourceStore.loading}),(function(){e.setType(e.resourceStore.data.template||i||Object.keys(e.types)[0])})),e.schemaDisposer=Object(v.e)((function(){var t=e.type;(!e.hasTypes||t)&&(!e.hasTypes||e.types[t])?(e.setSchemaLoading(!0),Promise.all([tv.getSchema(e.formKey,t,e.metadataOptions),tv.getJsonSchema(e.formKey,t,e.metadataOptions)]).then(e.handleSchemaResponse)):e.setSchemaLoading(!1)}))}}}),Av=Jv(Cv.prototype,"handleSchemaResponse",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){var n=zv(t,2),r=n[0],o=n[1];e.validator=o?Qv.compile(o):void 0,e.pathsByTag={},e.rawSchema=r,e.addMissingSchemaProperties(),e.setSchemaLoading(!1),e.updateFieldPathEvaluationsDisposer=Object(v.e)(e.updateFieldPathEvaluations)}}}),Jv(Cv.prototype,"hasTypes",[v.g],Object.getOwnPropertyDescriptor(Cv.prototype,"hasTypes"),Cv.prototype),Jv(Cv.prototype,"hasInvalidType",[v.g],Object.getOwnPropertyDescriptor(Cv.prototype,"hasInvalidType"),Cv.prototype),Jv(Cv.prototype,"loading",[v.g],Object.getOwnPropertyDescriptor(Cv.prototype,"loading"),Cv.prototype),Jv(Cv.prototype,"data",[v.g],Object.getOwnPropertyDescriptor(Cv.prototype,"data"),Cv.prototype),Jv(Cv.prototype,"save",[v.d],Object.getOwnPropertyDescriptor(Cv.prototype,"save"),Cv.prototype),Jv(Cv.prototype,"locale",[v.g],Object.getOwnPropertyDescriptor(Cv.prototype,"locale"),Cv.prototype),Jv(Cv.prototype,"resourceKey",[v.g],Object.getOwnPropertyDescriptor(Cv.prototype,"resourceKey"),Cv.prototype),Jv(Cv.prototype,"id",[v.g],Object.getOwnPropertyDescriptor(Cv.prototype,"id"),Cv.prototype),Jv(Cv.prototype,"saving",[v.g],Object.getOwnPropertyDescriptor(Cv.prototype,"saving"),Cv.prototype),Jv(Cv.prototype,"deleting",[v.g],Object.getOwnPropertyDescriptor(Cv.prototype,"deleting"),Cv.prototype),Jv(Cv.prototype,"forbidden",[v.g],Object.getOwnPropertyDescriptor(Cv.prototype,"forbidden"),Cv.prototype),Jv(Cv.prototype,"dirty",[v.g],Object.getOwnPropertyDescriptor(Cv.prototype,"dirty"),Cv.prototype),Jv(Cv.prototype,"setSchemaLoading",[v.d],Object.getOwnPropertyDescriptor(Cv.prototype,"setSchemaLoading"),Cv.prototype),Jv(Cv.prototype,"setType",[v.d],Object.getOwnPropertyDescriptor(Cv.prototype,"setType"),Cv.prototype),Jv(Cv.prototype,"changeType",[v.d],Object.getOwnPropertyDescriptor(Cv.prototype,"changeType"),Cv.prototype),Cv);function eg(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3?arguments[3]:void 0;return new Xv(e,t,n,r)}}])&&eg(t.prototype,n),r&&eg(t,r),e}());function sg(e){return(sg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function cg(e,t,n,r){n&&Object.defineProperty(e,t,{enumerable:n.enumerable,configurable:n.configurable,writable:n.writable,value:n.initializer?n.initializer.call(r):void 0})}function fg(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pg(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function zw(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n4&&void 0!==arguments[4]?arguments[4]:{},u=arguments.length>5?arguments[5]:void 0,l=arguments.length>6?arguments[6]:void 0;Hw(this,e),Bw(this,"pageCount",hw,this),Bw(this,"selections",yw,this),Bw(this,"dataLoading",mw,this),Bw(this,"deleting",bw,this),Bw(this,"deletingSelection",vw,this),Bw(this,"moving",gw,this),Bw(this,"movingSelection",ww,this),Bw(this,"copying",_w,this),Bw(this,"ordering",Ow,this),Bw(this,"schemaLoading",Sw,this),Bw(this,"shouldReload",kw,this),Bw(this,"loadingStrategy",Pw,this),Bw(this,"structureStrategy",jw,this),Bw(this,"options",Ew,this),Bw(this,"schema",Cw,this),Bw(this,"forbidden",xw,this),this.active=v.q.box(),this.filterOptions=v.q.box({}),this.sortColumn=v.q.box(),this.sortOrder=v.q.box(),this.searchTerm=v.q.box(),this.limit=v.q.box(10),this.changeUserSchema=function(t){var n=[];Object.keys(t).map((function(e){var r=t[e];n.push({schemaKey:e,visibility:r.visibility})})),e.setSchemaSetting(i.listKey,i.userSettingsKey,n)},Bw(this,"updateLoadingStrategy",Tw,this),Bw(this,"updateStructureStrategy",Dw,this),Bw(this,"clear",Rw,this),this.delete=function(e,t){return i.deleting=!0,no.delete(i.resourceKey,Yw(Yw(Yw({},i.queryOptions),t),{},{id:e})).then(Object(v.d)((function(){i.deleting=!1,i.deselectById(e),i.remove(e)}))).catch(Object(v.d)((function(e){throw i.deleting=!1,e})))},this.move=function(e,t){return i.moving=!0,i.requestMove(e,t).then(Object(v.d)((function(){i.moving=!1,i.activate(e),i.clear()})))},Bw(this,"moveSelection",Mw,this),this.copy=function(e,t,n){var r=Yw(Yw({},i.options),{},{action:"copy",destination:t}),o=i.observableOptions.locale;return o&&(r.locale=o.get()),i.copying=!0,no.post(i.resourceKey,void 0,Yw(Yw({},r),{},{id:e})).then(Object(v.d)((function(e){i.copying=!1,null==n||n(e),i.activate(e.id),i.clear()})))},Bw(this,"deleteSelection",Aw,this),this.remove=function(e){i.structureStrategy.remove(e)},this.sendRequest=function(){if(i.initialized){var t={};for(var n in i.observableOptions)t[n]=i.observableOptions[n].get();i.setDataLoading(!0),i.setForbidden(!1);var r=i.active.get(),o=Yw(Yw({},t),i.options);i.initialSelectionIds&&(o.selectedIds=i.initialSelectionIds.join(",")),o.selectedIds||(r&&Object(v.v)((function(){return!i.structureStrategy.findById(r)}))&&(i.structureStrategy.clear(),o.expandedIds=r),!o.expandedIds&&r&&(o.parentId=r)),o.sortBy=i.sortColumn.get(),o.sortOrder=i.sortOrder.get(),o.limit=i.limit.get(),o.fields=i.fields,Object.keys(i.filterQueryOption).length>0&&(o.filter=i.filterQueryOption),i.searchTerm.get()&&(o.search=i.searchTerm.get()),d.a.info('List loads "'+i.resourceKey+'" data with the following options:',o),i.pendingRequest&&i.pendingRequest.abort(),i.pendingRequest=i.loadingStrategy.load(i.resourceKey,o,o.selectedIds||o.expandedIds?void 0:r).then(Object(v.d)((function(e){i.pendingRequest=void 0,i.pageCount=e.pages,i.setDataLoading(!1),i.initialSelectionIds&&(i.initialSelectionIds.map((function(e){return i.findById(e)})).forEach((function(e){e&&i.select(e)})),i.initialSelectionIds=void 0)}))).catch((function(t){if("AbortError"!==t.name){if(i.pendingRequest=void 0,i.active.get()&&404===t.status)return e.setActiveSetting(i.listKey,i.userSettingsKey,void 0),void i.setActive(void 0);403===t.status&&i.setForbidden(!0),i.setDataLoading(!1)}}))}},this.resourceKey=t,this.listKey=n,this.userSettingsKey=r,this.observableOptions=o,this.options=a,this.metadataOptions=u,this.initialSelectionIds=l,this.sendRequestDisposer=Object(v.e)((function(){i.shouldReload?i.setShouldReload(!1):i.sendRequest()}));var s=function(e){i.initialized&&e.object.get()!==e.newValue&&i.reset()},c=this.observableOptions.locale;c&&(this.localeDisposer=Object(v.l)(c,"",(function(e){return s(e),e}))),this.searchDisposer=Object(v.l)(this.searchTerm,"",(function(e){return s(e),e})),this.filterDisposer=Object(v.l)(this.filterOptions,"",(function(t){var n=t.object.get(),r=n?Object.keys(n).reduce((function(e,t){return void 0!==n[t]&&(e[t]=n[t]),e}),{}):{},o=t.newValue,a=o?Object.keys(o).reduce((function(e,t){return void 0!==o[t]&&(e[t]=o[t]),e}),{}):{};return J()(r,a)||s(t),J()(n,o)||e.setFilterSetting(i.listKey,i.userSettingsKey,t.newValue),t})),this.sortColumnDisposer=Object(v.l)(this.sortColumn,"",(function(t){return e.setSortColumnSetting(i.listKey,i.userSettingsKey,t.newValue),s(t),t})),this.sortOrderDisposer=Object(v.l)(this.sortOrder,"",(function(t){return e.setSortOrderSetting(i.listKey,i.userSettingsKey,t.newValue),s(t),t})),this.limitDisposer=Object(v.l)(this.limit,"",(function(t){return e.setLimitSetting(i.listKey,i.userSettingsKey,t.newValue),s(t),t})),this.activeSettingDisposer=Object(v.l)(this.active,"",(function(t){return e.setActiveSetting(i.listKey,i.userSettingsKey,t.newValue),t})),Lw.getSchema(this.listKey,this.metadataOptions).then(Object(v.d)((function(e){i.schema=e,i.schemaLoading=!1})))}return Ww(e,null,[{key:"getActiveSetting",value:function(e,t){var n=[Zw,e,t,Jw].join(".");return zo.getPersistentSetting(n)}},{key:"setActiveSetting",value:function(e,t,n){var r=[Zw,e,t,Jw].join(".");zo.setPersistentSetting(r,n)}},{key:"getFilterSetting",value:function(e,t){var n=[Zw,e,t,e_].join(".");return zo.getPersistentSetting(n)}},{key:"setFilterSetting",value:function(e,t,n){var r=[Zw,e,t,e_].join(".");zo.setPersistentSetting(r,n)}},{key:"getSortColumnSetting",value:function(e,t){var n=[Zw,e,t,Qw].join(".");return zo.getPersistentSetting(n)}},{key:"setSortColumnSetting",value:function(e,t,n){var r=[Zw,e,t,Qw].join(".");zo.setPersistentSetting(r,n)}},{key:"getSortOrderSetting",value:function(e,t){var n=[Zw,e,t,Xw].join(".");return zo.getPersistentSetting(n)}},{key:"setSortOrderSetting",value:function(e,t,n){var r=[Zw,e,t,Xw].join(".");zo.setPersistentSetting(r,n)}},{key:"getLimitSetting",value:function(e,t){var n=[Zw,e,t,t_].join(".");return zo.getPersistentSetting(n)}},{key:"setLimitSetting",value:function(e,t,n){var r=[Zw,e,t,t_].join(".");zo.setPersistentSetting(r,n)}},{key:"getSchemaSetting",value:function(e,t){var n=[Zw,e,t,n_].join(".");return zo.getPersistentSetting(n)}},{key:"setSchemaSetting",value:function(e,t,n){var r=[Zw,e,t,n_].join(".");zo.setPersistentSetting(r,n)}}]),Ww(e,[{key:"reset",value:function(){var e=this.getPage();this.clear(),this.pageCount=0,e&&e>1&&this.setPage(1)}},{key:"reload",value:function(){this.setShouldReload(!0)}},{key:"findById",value:function(e){return this.structureStrategy.findById(e)}},{key:"requestMove",value:function(e,t){var n=Yw(Yw({},this.options),{},{action:"move",destination:t}),r=this.observableOptions.locale;return r&&(n.locale=r.get()),no.post(this.resourceKey,void 0,Yw(Yw({},n),{},{id:e}))}},{key:"setDataLoading",value:function(e){this.dataLoading=e}},{key:"setForbidden",value:function(e){this.forbidden=e}},{key:"setShouldReload",value:function(e){this.shouldReload=e}},{key:"getPage",value:function(){return this.observableOptions.page.get()}},{key:"setPage",value:function(e){this.observableOptions.page.set(e)}},{key:"setLimit",value:function(e){this.limit.set(e)}},{key:"setActive",value:function(e){this.active.set(e)}},{key:"activate",value:function(e){this.setActive(void 0),this.setActive(e),this.structureStrategy.activate&&this.structureStrategy.activate(e)}},{key:"deactivate",value:function(e){this.structureStrategy.deactivate&&this.structureStrategy.deactivate(e)}},{key:"sort",value:function(e,t){this.sortColumn.set(e),this.sortOrder.set(t)}},{key:"order",value:function(e,t){var n=this;return this.ordering=!0,no.post(this.resourceKey,{position:t},Yw(Yw({},this.queryOptions),{},{action:"order",id:e})).then(Object(v.d)((function(){n.ordering=!1,n.structureStrategy.order(e,t)})))}},{key:"search",value:function(e){e!==this.searchTerm.get()&&this.searchTerm.set(e)}},{key:"filter",value:function(e){this.filterOptions.set(e)}},{key:"select",value:function(e){-1===this.selections.findIndex((function(t){return t.id===e.id}))&&this.selections.push(e)}},{key:"selectVisibleItems",value:function(){var e=this;d.a.warn('The "selectVisibleItems" method will select disabled rows. Therefore the method is deprecated since version 2.0. Use the "visibleItems" property and the "select" method instead.'),this.visibleItems.forEach((function(t){e.select(t)}))}},{key:"deselect",value:function(e){this.deselectById(e.id)}},{key:"deselectById",value:function(e){var t=this.selections.findIndex((function(t){return t.id===e}));-1!==t&&this.selections.splice(t,1)}},{key:"deselectVisibleItems",value:function(){var e=this;d.a.warn('The "deselectVisibleItems" method will deselect disabled rows. Therefore the method is deprecated since version 2.0. Use the "visibleItems" property and the "deselect" method instead.'),this.visibleItems.forEach((function(t){e.deselect(t)}))}},{key:"clearSelection",value:function(){this.selections=[]}},{key:"destroy",value:function(){this.sendRequestDisposer(),this.searchDisposer(),this.filterDisposer(),this.sortColumnDisposer(),this.sortOrderDisposer(),this.limitDisposer(),this.activeSettingDisposer(),this.localeDisposer&&this.localeDisposer()}},{key:"initialized",get:function(){return!!this.loadingStrategy&&!!this.structureStrategy&&!!this.schema}},{key:"loading",get:function(){return this.dataLoading||this.schemaLoading}},{key:"data",get:function(){return this.structureStrategy.data}},{key:"visibleItems",get:function(){return this.structureStrategy.visibleItems}},{key:"activeItems",get:function(){return this.structureStrategy.activeItems}},{key:"queryOptions",get:function(){var e=Yw({},this.options),t=this.observableOptions.locale;return t&&(e.locale=t.get()),e}},{key:"filterQueryOption",get:function(){var e=this.filterOptions.get();return Object.keys(e).reduce((function(t,n){return void 0!==e[n]&&(t[n]=e[n]),t}),{})}},{key:"userSchema",get:function(){if(!this.initialized)return{};var t,n={},r=Iw(e.getSchemaSetting(this.listKey,this.userSettingsKey)||[]);try{for(r.s();!(t=r.n()).done;){var o=t.value;this.schema.hasOwnProperty(o.schemaKey)&&(n[o.schemaKey]=Yw(Yw({},this.schema[o.schemaKey]),{},{visibility:o.visibility}))}}catch(e){r.e(e)}finally{r.f()}for(var i=0,a=Object.keys(this.schema);i1)throw new Error("The SingleListOverlay can only handle single selection.This should not happen and is likely a bug.");t.props.onConfirm(t.listStore.selections[0])};var n=Object(v.g)((function(){return t.props.excludedIds.length?t.props.excludedIds:void 0}));t.excludedIdsDisposer=n.observe((function(){return t.listStore.clear()}));var r=t.props,a=r.listKey,u=r.locale,l=r.metadataOptions,s=r.options,c=r.preSelectedItem,f=r.resourceKey,p={};p.page=t.page,p.excludedIds=n,u&&(p.locale=u);var d=[];return c&&d.push(c.id),t.listStore=new r_(f,a,"single_list_overlay",p,s,l,d),t.changeOptionsDisposer=Object(v.r)((function(){return t.props.options}),(function(e){t.listStore.reset(),t.listStore.initialSelectionIds=t.listStore.selectionIds,t.listStore.options=w_(w_({},t.listStore.options),e)}),{equals:v.f.structural}),t.selectionDisposer=Object(v.e)((function(){var e=t.listStore.selections;if(!(e.length<=1)){var n=e[e.length-1];n&&(t.listStore.clearSelection(),t.listStore.select(n))}})),t}return t=i,(n=[{key:"componentWillUnmount",value:function(){this.listStore.destroy(),this.excludedIdsDisposer(),this.changeOptionsDisposer(),this.selectionDisposer()}},{key:"render",value:function(){var e=this.props,t=e.adapter,n=e.allowActivateForDisabledItems,r=e.clearSelectionOnClose,o=e.confirmLoading,i=e.disabledIds,a=e.itemDisabledCondition,u=e.onClose,l=e.open,s=e.overlayType,c=e.preSelectedItem,f=e.reloadOnOpen,p=e.title;return y.a.createElement(b_,{adapter:t,allowActivateForDisabledItems:n,clearSelectionOnClose:r,confirmLoading:o,disabledIds:i,itemDisabledCondition:a,listStore:this.listStore,onClose:u,onConfirm:this.handleConfirm,open:l,overlayType:s,preSelectedItems:c?[c]:void 0,reloadOnOpen:f,title:p})}}])&&O_(t.prototype,n),r&&O_(t,r),i}(y.a.Component),y_.defaultProps={clearSelectionOnClose:!1,disabledIds:[],excludedIds:[],overlayType:"overlay"},h_=m_))||h_;function C_(e){return(C_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function x_(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function T_(e,t){return(T_=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function D_(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=M_(e);if(t){var o=M_(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return R_(this,n)}}function R_(e,t){return!t||"object"!==C_(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function M_(e){return(M_=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var A_=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&T_(e,t)}(n,e);var t=D_(n);function n(){return x_(this,n),t.apply(this,arguments)}return n}(y.a.Component);function L_(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};if(e in this.adapters)throw new Error('The key "'+e+'" has already been used for another list adapter');this.adapters[e]=t,this.options[e]=n}},{key:"get",value:function(e){if(!(e in this.adapters))throw new Error('The list adapter with the key "'+e+'" is not defined. You probably forgot to add it to the store using the "add" method.');return this.adapters[e]}},{key:"getOptions",value:function(e){if(!(e in this.options))throw new Error('There are no options for a list adapter with the key "'+e+'" registered');return this.options[e]}}])&&L_(t.prototype,n),r&&L_(t,r),e}());function W_(e){return(W_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function U_(e,t,n,r){n&&Object.defineProperty(e,t,{enumerable:n.enumerable,configurable:n.configurable,writable:n.writable,value:n.initializer?n.initializer.call(r):void 0})}function q_(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function K_(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:this.active.collection;return this.refs[e].sort(tS)}}]),e}();function tS(e,t){return e.node.sortableInfo.index-t.node.sortableInfo.index}function nS(e,t){return Object.keys(e).reduce((function(n,r){return-1===t.indexOf(r)&&(n[r]=e[r]),n}),{})}var rS={end:["touchend","touchcancel","mouseup"],move:["touchmove","mousemove"],start:["touchstart","mousedown"]},oS=function(){if("undefined"==typeof window||"undefined"==typeof document)return"";var e=window.getComputedStyle(document.documentElement,"")||["-moz-hidden-iframe"],t=(Array.prototype.slice.call(e).join("").match(/-(moz|webkit|ms)-/)||""===e.OLink&&["","o"])[1];switch(t){case"ms":return"ms";default:return t&&t.length?t[0].toUpperCase()+t.substr(1):""}}();function iS(e,t){Object.keys(t).forEach((function(n){e.style[n]=t[n]}))}function aS(e,t){e.style["".concat(oS,"Transform")]=null==t?"":"translate3d(".concat(t.x,"px,").concat(t.y,"px,0)")}function uS(e,t){e.style["".concat(oS,"TransitionDuration")]=null==t?"":"".concat(t,"ms")}function lS(e,t){for(;e;){if(t(e))return e;e=e.parentNode}return null}function sS(e,t,n){return Math.max(e,Math.min(n,t))}function cS(e){return"px"===e.substr(-2)?parseFloat(e):0}function fS(e){var t=window.getComputedStyle(e);return{bottom:cS(t.marginBottom),left:cS(t.marginLeft),right:cS(t.marginRight),top:cS(t.marginTop)}}function pS(e,t){var n=t.displayName||t.name;return n?"".concat(e,"(").concat(n,")"):e}function dS(e,t){var n=e.getBoundingClientRect();return{top:n.top+t.top,left:n.left+t.left}}function hS(e){return e.touches&&e.touches.length?{x:e.touches[0].pageX,y:e.touches[0].pageY}:e.changedTouches&&e.changedTouches.length?{x:e.changedTouches[0].pageX,y:e.changedTouches[0].pageY}:{x:e.pageX,y:e.pageY}}function yS(e){return e.touches&&e.touches.length||e.changedTouches&&e.changedTouches.length}function mS(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{left:0,top:0};if(e){var r={left:n.left+e.offsetLeft,top:n.top+e.offsetTop};return e.parentNode===t?r:mS(e.parentNode,t,r)}}function bS(e,t,n){return et?e-1:e>n&&e0&&n[t].height>0)&&e.getContext("2d").drawImage(n[t],0,0)})),r}function IS(e){var t,n,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{withRef:!1};return n=t=function(t){function n(){return HO(this,n),KO(this,$O(n).apply(this,arguments))}return ZO(n,t),WO(n,[{key:"componentDidMount",value:function(){Object(m.findDOMNode)(this).sortableHandle=!0}},{key:"getWrappedInstance",value:function(){return QO()(o.withRef,"To access the wrapped instance, you need to pass in {withRef: true} as the second argument of the SortableHandle() call"),this.refs.wrappedInstance}},{key:"render",value:function(){var t=o.withRef?"wrappedInstance":null;return Object(h.createElement)(e,r({ref:t},this.props))}}]),n}(h.Component),NO(t,"displayName",pS("sortableHandle",e)),n}function zS(e){return null!=e.sortableHandle}var FS=function(){function e(t,n){HO(this,e),this.container=t,this.onScrollCallback=n}return WO(e,[{key:"clear",value:function(){null!=this.interval&&(clearInterval(this.interval),this.interval=null)}},{key:"update",value:function(e){var t=this,n=e.translate,r=e.minTranslate,o=e.maxTranslate,i=e.width,a=e.height,u={x:0,y:0},l={x:1,y:1},s=10,c=10,f=this.container,p=f.scrollTop,d=f.scrollLeft,h=f.scrollHeight,y=f.scrollWidth,m=0===p,b=h-p-f.clientHeight==0,v=0===d,g=y-d-f.clientWidth==0;n.y>=o.y-a/2&&!b?(u.y=1,l.y=c*Math.abs((o.y-a/2-n.y)/a)):n.x>=o.x-i/2&&!g?(u.x=1,l.x=s*Math.abs((o.x-i/2-n.x)/i)):n.y<=r.y+a/2&&!m?(u.y=-1,l.y=c*Math.abs((n.y-a/2-r.y)/a)):n.x<=r.x+i/2&&!v&&(u.x=-1,l.x=s*Math.abs((n.x-i/2-r.x)/i)),this.interval&&(this.clear(),this.isAutoScrolling=!1),0===u.x&&0===u.y||(this.interval=setInterval((function(){t.isAutoScrolling=!0;var e={left:l.x*u.x,top:l.y*u.y};t.container.scrollTop+=e.top,t.container.scrollLeft+=e.left,t.onScrollCallback(e)}),5))}}]),e}();var YS={axis:ul.a.oneOf(["x","y","xy"]),contentWindow:ul.a.any,disableAutoscroll:ul.a.bool,distance:ul.a.number,getContainer:ul.a.func,getHelperDimensions:ul.a.func,helperClass:ul.a.string,helperContainer:ul.a.oneOfType([ul.a.func,"undefined"==typeof HTMLElement?ul.a.any:ul.a.instanceOf(HTMLElement)]),hideSortableGhost:ul.a.bool,keyboardSortingTransitionDuration:ul.a.number,lockAxis:ul.a.string,lockOffset:ul.a.oneOfType([ul.a.number,ul.a.string,ul.a.arrayOf(ul.a.oneOfType([ul.a.number,ul.a.string]))]),lockToContainerEdges:ul.a.bool,onSortEnd:ul.a.func,onSortMove:ul.a.func,onSortOver:ul.a.func,onSortStart:ul.a.func,pressDelay:ul.a.number,pressThreshold:ul.a.number,keyCodes:ul.a.shape({lift:ul.a.arrayOf(ul.a.number),drop:ul.a.arrayOf(ul.a.number),cancel:ul.a.arrayOf(ul.a.number),up:ul.a.arrayOf(ul.a.number),down:ul.a.arrayOf(ul.a.number)}),shouldCancelStart:ul.a.func,transitionDuration:ul.a.number,updateBeforeSortStart:ul.a.func,useDragHandle:ul.a.bool,useWindowAsScrollContainer:ul.a.bool},NS={lift:[SS],drop:[SS],cancel:[OS],up:[PS,kS],down:[ES,jS]},BS={axis:"y",disableAutoscroll:!1,distance:0,getHelperDimensions:function(e){var t=e.node;return{height:t.offsetHeight,width:t.offsetWidth}},hideSortableGhost:!0,lockOffset:"50%",lockToContainerEdges:!1,pressDelay:0,pressThreshold:5,keyCodes:NS,shouldCancelStart:function(e){return-1!==[DS,MS,AS,RS,xS].indexOf(e.target.tagName)||!!lS(e.target,(function(e){return"true"===e.contentEditable}))},transitionDuration:300,useWindowAsScrollContainer:!1},HS=Object.keys(YS);function VS(e){QO()(!(e.distance&&e.pressDelay),"Attempted to set both `pressDelay` and `distance` on SortableContainer, you may only use one or the other, not both at the same time.")}function WS(e,t){try{var n=e()}catch(e){return t(!0,e)}return n&&n.then?n.then(t.bind(null,!1),t.bind(null,!0)):t(!1,value)}function US(e){var t,n,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{withRef:!1};return n=t=function(t){function n(e){var t;return HO(this,n),NO(qO(qO(t=KO(this,$O(n).call(this,e)))),"state",{}),NO(qO(qO(t)),"handleStart",(function(e){var n=t.props,r=n.distance,o=n.shouldCancelStart;if(2!==e.button&&!o(e)){t.touched=!0,t.position=hS(e);var i=lS(e.target,(function(e){return null!=e.sortableInfo}));if(i&&i.sortableInfo&&t.nodeIsChild(i)&&!t.state.sorting){var a=t.props.useDragHandle,u=i.sortableInfo,l=u.index,s=u.collection;if(u.disabled)return;if(a&&!lS(e.target,zS))return;t.manager.active={collection:s,index:l},yS(e)||e.target.tagName!==CS||e.preventDefault(),r||(0===t.props.pressDelay?t.handlePress(e):t.pressTimer=setTimeout((function(){return t.handlePress(e)}),t.props.pressDelay))}}})),NO(qO(qO(t)),"nodeIsChild",(function(e){return e.sortableInfo.manager===t.manager})),NO(qO(qO(t)),"handleMove",(function(e){var n=t.props,r=n.distance,o=n.pressThreshold;if(!t.state.sorting&&t.touched&&!t._awaitingUpdateBeforeSortStart){var i=hS(e),a={x:t.position.x-i.x,y:t.position.y-i.y},u=Math.abs(a.x)+Math.abs(a.y);t.delta=a,r||o&&!(u>=o)?r&&u>=r&&t.manager.isActive()&&t.handlePress(e):(clearTimeout(t.cancelTimer),t.cancelTimer=setTimeout(t.cancel,0))}})),NO(qO(qO(t)),"handleEnd",(function(){t.touched=!1,t.cancel()})),NO(qO(qO(t)),"cancel",(function(){var e=t.props.distance;t.state.sorting||(e||clearTimeout(t.pressTimer),t.manager.active=null)})),NO(qO(qO(t)),"handlePress",(function(e){try{var n=t.manager.getActive(),r=function(){if(n){var r=function(){var n=p.sortableInfo.index,r=fS(p),o=_S(t.container),s=t.scrollContainer.getBoundingClientRect(),y=a({index:n,node:p,collection:d});if(t.node=p,t.margin=r,t.gridGap=o,t.width=y.width,t.height=y.height,t.marginOffset={x:t.margin.left+t.margin.right+t.gridGap.x,y:Math.max(t.margin.top,t.margin.bottom,t.gridGap.y)},t.boundingClientRect=p.getBoundingClientRect(),t.containerBoundingRect=s,t.index=n,t.newIndex=n,t.axis={x:i.indexOf("x")>=0,y:i.indexOf("y")>=0},t.offsetEdge=mS(p,t.container),t.initialOffset=hS(h?BO({},e,{pageX:t.boundingClientRect.left,pageY:t.boundingClientRect.top}):e),t.initialScroll={left:t.scrollContainer.scrollLeft,top:t.scrollContainer.scrollTop},t.initialWindowScroll={left:window.pageXOffset,top:window.pageYOffset},t.helper=t.helperContainer.appendChild(LS(p)),iS(t.helper,{boxSizing:"border-box",height:"".concat(t.height,"px"),left:"".concat(t.boundingClientRect.left-r.left,"px"),pointerEvents:"none",position:"fixed",top:"".concat(t.boundingClientRect.top-r.top,"px"),width:"".concat(t.width,"px")}),h&&t.helper.focus(),l&&(t.sortableGhost=p,iS(p,{opacity:0,visibility:"hidden"})),t.minTranslate={},t.maxTranslate={},h){var m=f?{top:0,left:0,width:t.contentWindow.innerWidth,height:t.contentWindow.innerHeight}:t.containerBoundingRect,b=m.top,v=m.left,g=m.width,w=b+m.height,_=v+g;t.axis.x&&(t.minTranslate.x=v-t.boundingClientRect.left,t.maxTranslate.x=_-(t.boundingClientRect.left+t.width)),t.axis.y&&(t.minTranslate.y=b-t.boundingClientRect.top,t.maxTranslate.y=w-(t.boundingClientRect.top+t.height))}else t.axis.x&&(t.minTranslate.x=(f?0:s.left)-t.boundingClientRect.left-t.width/2,t.maxTranslate.x=(f?t.contentWindow.innerWidth:s.left+s.width)-t.boundingClientRect.left-t.width/2),t.axis.y&&(t.minTranslate.y=(f?0:s.top)-t.boundingClientRect.top-t.height/2,t.maxTranslate.y=(f?t.contentWindow.innerHeight:s.top+s.height)-t.boundingClientRect.top-t.height/2);u&&u.split(" ").forEach((function(e){return t.helper.classList.add(e)})),t.listenerNode=e.touches?p:t.contentWindow,h?(t.listenerNode.addEventListener("wheel",t.handleKeyEnd,!0),t.listenerNode.addEventListener("mousedown",t.handleKeyEnd,!0),t.listenerNode.addEventListener("keydown",t.handleKeyDown)):(rS.move.forEach((function(e){return t.listenerNode.addEventListener(e,t.handleSortMove,!1)})),rS.end.forEach((function(e){return t.listenerNode.addEventListener(e,t.handleSortEnd,!1)}))),t.setState({sorting:!0,sortingIndex:n}),c&&c({node:p,index:n,collection:d,isKeySorting:h,nodes:t.manager.getOrderedRefs(),helper:t.helper},e),h&&t.keyMove(0)},o=t.props,i=o.axis,a=o.getHelperDimensions,u=o.helperClass,l=o.hideSortableGhost,s=o.updateBeforeSortStart,c=o.onSortStart,f=o.useWindowAsScrollContainer,p=n.node,d=n.collection,h=t.manager.isKeySorting,y=function(){if("function"==typeof s){t._awaitingUpdateBeforeSortStart=!0;var n=WS((function(){var t=p.sortableInfo.index;return Promise.resolve(s({collection:d,index:t,node:p,isKeySorting:h},e)).then((function(){}))}),(function(e,n){if(t._awaitingUpdateBeforeSortStart=!1,e)throw n;return n}));if(n&&n.then)return n.then((function(){}))}}();return y&&y.then?y.then(r):r()}}();return Promise.resolve(r&&r.then?r.then((function(){})):void 0)}catch(e){return Promise.reject(e)}})),NO(qO(qO(t)),"handleSortMove",(function(e){var n=t.props.onSortMove;"function"==typeof e.preventDefault&&e.preventDefault(),t.updateHelperPosition(e),t.animateNodes(),t.autoscroll(),n&&n(e)})),NO(qO(qO(t)),"handleSortEnd",(function(e){var n=t.props,r=n.hideSortableGhost,o=n.onSortEnd,i=t.manager,a=i.active.collection,u=i.isKeySorting,l=t.manager.getOrderedRefs();t.listenerNode&&(u?(t.listenerNode.removeEventListener("wheel",t.handleKeyEnd,!0),t.listenerNode.removeEventListener("mousedown",t.handleKeyEnd,!0),t.listenerNode.removeEventListener("keydown",t.handleKeyDown)):(rS.move.forEach((function(e){return t.listenerNode.removeEventListener(e,t.handleSortMove)})),rS.end.forEach((function(e){return t.listenerNode.removeEventListener(e,t.handleSortEnd)})))),t.helper.parentNode.removeChild(t.helper),r&&t.sortableGhost&&iS(t.sortableGhost,{opacity:"",visibility:""});for(var s=0,c=l.length;sr)){t.prevIndex=i,t.newIndex=o;var a=bS(t.newIndex,t.prevIndex,t.index),u=n.find((function(e){return e.node.sortableInfo.index===a})),l=u.node,s=t.containerScrollDelta,c=u.boundingClientRect||dS(l,s),f=u.translate||{x:0,y:0},p=c.top+f.y-s.top,d=c.left+f.x-s.left,h=im?m/2:this.height/2,width:this.width>y?y/2:this.width/2},v=s&&h>this.index&&h<=c,g=s&&h=c,w={x:0,y:0},_=a[f].edgeOffset;_||(_=mS(d,this.container),a[f].edgeOffset=_,s&&(a[f].boundingClientRect=dS(d,o)));var O=f0&&a[f-1];O&&!O.edgeOffset&&(O.edgeOffset=mS(O.node,this.container),s&&(O.boundingClientRect=dS(O.node,o))),h!==this.index?(t&&uS(d,t),this.axis.x?this.axis.y?g||hthis.containerBoundingRect.width-b.width&&O&&(w.x=O.edgeOffset.left-_.left,w.y=O.edgeOffset.top-_.top),null===this.newIndex&&(this.newIndex=h)):(v||h>this.index&&(u+i.left+b.width>=_.left&&l+i.top+b.height>=_.top||l+i.top+b.height>=_.top+m))&&(w.x=-(this.width+this.marginOffset.x),_.left+w.xthis.index&&u+i.left+b.width>=_.left?(w.x=-(this.width+this.marginOffset.x),this.newIndex=h):(g||hthis.index&&l+i.top+b.height>=_.top?(w.y=-(this.height+this.marginOffset.y),this.newIndex=h):(g||h1&&void 0!==arguments[1]?arguments[1]:{withRef:!1};return n=t=function(t){function n(){return HO(this,n),KO(this,$O(n).apply(this,arguments))}return ZO(n,t),WO(n,[{key:"componentDidMount",value:function(){this.register()}},{key:"componentDidUpdate",value:function(e){this.node&&(e.index!==this.props.index&&(this.node.sortableInfo.index=this.props.index),e.disabled!==this.props.disabled&&(this.node.sortableInfo.disabled=this.props.disabled)),e.collection!==this.props.collection&&(this.unregister(e.collection),this.register())}},{key:"componentWillUnmount",value:function(){this.unregister()}},{key:"register",value:function(){var e=this.props,t=e.collection,n=e.disabled,r=e.index,o=Object(m.findDOMNode)(this);o.sortableInfo={collection:t,disabled:n,index:r,manager:this.context.manager},this.node=o,this.ref={node:o},this.context.manager.add(t,this.ref)}},{key:"unregister",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props.collection;this.context.manager.remove(e,this.ref)}},{key:"getWrappedInstance",value:function(){return QO()(o.withRef,"To access the wrapped instance, you need to pass in {withRef: true} as the second argument of the SortableElement() call"),this.refs.wrappedInstance}},{key:"render",value:function(){var t=o.withRef?"wrappedInstance":null;return Object(h.createElement)(e,r({ref:t},nS(this.props,KS)))}}]),n}(h.Component),NO(t,"displayName",pS("sortableElement",e)),NO(t,"contextTypes",{manager:ul.a.object.isRequired}),NO(t,"propTypes",qS),NO(t,"defaultProps",{collection:0}),n}var GS=n(35),ZS=n.n(GS);function JS(e){return(JS="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function QS(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function XS(e,t){for(var n=0;n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function vk(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n3&&void 0!==arguments[3]?arguments[3]:{};qk(this,e),Uk(this,"value",Vk,this),this.confirm=function(){},this.onChange=t,this.parameters=n,this.value=r,this.options=o}var t,n,r;return t=e,(n=[{key:"destroy",value:function(){}},{key:"setValue",value:function(e){this.value=e}},{key:"getFormNode",value:function(){return null}},{key:"getValueNode",value:function(e){return Promise.resolve(null)}}])&&Kk(t.prototype,n),r&&Kk(t,r),e}()).prototype,"value",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),$k(Hk.prototype,"setValue",[v.d],Object.getOwnPropertyDescriptor(Hk.prototype,"setValue"),Hk.prototype),Hk);function Zk(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};if(e in this.fieldFilterTypes)throw new Error('The key "'+e+'" has already been used for another field filter type');this.fieldFilterTypes[e]=t,this.options[e]=n}},{key:"get",value:function(e){if(!(e in this.fieldFilterTypes))throw new Error('The list field filter type with the key "'+e+'" is not defined. You probably forgot to add it to the registry using the "add" method.');return this.fieldFilterTypes[e]}},{key:"getOptions",value:function(e){if(!(e in this.options))throw new Error('There are no options for a field with the key "'+e+'" registered');return this.options[e]}}])&&Zk(t.prototype,n),r&&Zk(t,r),e}()),iP=n(174),aP=n.n(iP);function uP(e){return(uP="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function lP(e,t,n,r){n&&Object.defineProperty(e,t,{enumerable:n.enumerable,configurable:n.configurable,writable:n.writable,value:n.initializer?n.initializer.call(r):void 0})}function sP(e,t){for(var n=0;n=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function DP(e){var t=function(e,t){if("object"!==xP(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==xP(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===xP(t)?t:String(t)}function RP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function MP(e){for(var t=1;t0&&y.a.createElement(Nf,{anchorElement:y.a.createElement("div",{className:CP.a.filterButton},y.a.createElement(Ii,{icon:"su-filter",onClick:this.handleFilterMenuButtonClick,showDropdownIcon:!0,skin:"icon"})),onClose:this.handleFilterMenuClose,open:this.filterMenuOpen},y.a.createElement(Nf.Section,null,Object.keys(n).map((function(t){return y.a.createElement(Nf.Action,{disabled:e.filteredFields.includes(t),key:t,onClick:e.handleFilterMenuActionClick,value:t},n[t].label)})))),this.filteredFields.map((function(t){return y.a.createElement(jP,{column:t,filterType:n[t].filterType,filterTypeParameters:n[t].filterTypeParameters,key:t,label:n[t].label,onChange:e.handleFilterItemChange,onClick:e.handleFilterItemClick,onClose:e.handleFilterItemClose,onDelete:e.handleFilterItemDelete,open:e.filterChipOpen===t,value:r[t]})})))}},{key:"filteredFields",get:function(){return Object.keys(this.props.value)}}])&&zP(t.prototype,n),r&&zP(t,r),i}(y.a.Component),vP=VP((bP=PP).prototype,"filterMenuOpen",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),gP=VP(bP.prototype,"filterChipOpen",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){}}),VP(bP.prototype,"filteredFields",[v.g],Object.getOwnPropertyDescriptor(bP.prototype,"filteredFields"),bP.prototype),wP=VP(bP.prototype,"handleFilterMenuButtonClick",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){e.filterMenuOpen=!0}}}),_P=VP(bP.prototype,"handleFilterMenuClose",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){e.filterMenuOpen=!1}}}),OP=VP(bP.prototype,"openFilterItem",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){e.filterChipOpen=t}}}),SP=VP(bP.prototype,"closeFilterItem",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){e.filterChipOpen=void 0}}}),kP=VP(bP.prototype,"handleFilterItemDelete",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){var n=e.props,r=n.onChange,o=n.value;o[t];r(TP(o,[t].map(DP)))}}}),mP=bP))||mP;function Dj(e){return(Dj="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Rj(e,t,n,r){n&&Object.defineProperty(e,t,{enumerable:n.enumerable,configurable:n.configurable,writable:n.writable,value:n.initializer?n.initializer.call(r):void 0})}function Mj(e){return function(e){if(Array.isArray(e))return Aj(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Aj(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Aj(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Aj(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0;return d.forbidden?y.a.createElement(as,null):y.a.createElement("div",{className:IO.a.listContainer},a,!g&&(k||n.length>1||P||this.showColumnOptions)&&y.a.createElement("div",{className:S},k&&y.a.createElement(AO,{onSearch:this.handleSearch,value:d.searchTerm.get()}),y.a.createElement(Tj,{fields:b||{},onChange:this.handleFilterChange,value:d.filterOptions.get()}),this.showColumnOptions&&y.a.createElement(h.Fragment,null,y.a.createElement(Nf,{anchorElement:y.a.createElement("div",null,y.a.createElement(Ii,{icon:"su-sort",onClick:this.handleAdapterOptionsButtonClick,showDropdownIcon:!0,skin:"icon"})),onClose:this.handleAdapterOptionsClose,open:this.adapterOptionsOpen},y.a.createElement(Nf.Section,null,y.a.createElement(Nf.Action,{onClick:this.handleColumnOptionsOpen},Nr("sulu_admin.column_options")))),y.a.createElement(Tk,{onClose:this.handleColumnOptionsClose,onConfirm:this.handleColumnOptionsChange,open:this.columnOptionsOpen,schema:w})),y.a.createElement(SO,{adapters:n,currentAdapter:this.currentAdapterKey,onAdapterChange:this.handleAdapterChange})),y.a.createElement("div",{className:O},v&&0===d.pageCount?y.a.createElement(_i,null):y.a.createElement(_,{active:d.active.get(),activeItems:d.activeItems,adapterOptions:t?t[this.currentAdapterKey]:void 0,data:d.data,disabledIds:this.disabledIds,itemActionsProvider:u,limit:d.limit.get(),loading:v,onAllSelectionChange:p?this.handleAllSelectionChange:void 0,onItemActivate:this.handleItemActivate,onItemAdd:c,onItemClick:s,onItemDeactivate:this.handleItemDeactivate,onItemSelectionChange:p?this.handleItemSelectionChange:void 0,onLimitChange:this.handleLimitChange,onPageChange:this.handlePageChange,onRequestItemCopy:r?this.handleRequestItemCopy:void 0,onRequestItemDelete:o?this.handleRequestItemDelete:void 0,onRequestItemMove:l?this.handleRequestItemMove:void 0,onRequestItemOrder:f?this.handleRequestItemOrder:void 0,onSort:this.handleSort,options:this.currentAdapterOptions,page:d.getPage(),pageCount:d.pageCount,schema:d.userSchema,selections:d.selectionIds,sortColumn:d.sortColumn.get(),sortOrder:d.sortOrder.get()})),y.a.createElement(Td,{cancelText:Nr("sulu_admin.cancel"),confirmLoading:d.deletingSelection,confirmText:Nr("sulu_admin.ok"),onCancel:this.handleSelectionDeleteDialogCancelClick,onConfirm:this.handleSelectionDeleteDialogConfirmClick,open:this.showDeleteSelectionDialog,title:Nr("sulu_admin.delete_warning_title")},Nr("sulu_admin.delete_selection_warning_text",{count:d.selections.length})),o&&y.a.createElement(h.Fragment,null,y.a.createElement(Td,{cancelText:Nr("sulu_admin.cancel"),confirmLoading:d.deleting,confirmText:Nr("sulu_admin.ok"),onCancel:this.handleDeleteDialogCancelClick,onConfirm:this.handleDeleteDialogConfirmClick,open:this.showDeleteDialog,title:Nr("sulu_admin.delete_warning_title")},Nr("sulu_admin.delete_warning_text")),y.a.createElement(Td,{cancelText:Nr("sulu_admin.cancel"),confirmLoading:d.deleting,confirmText:Nr("sulu_admin.ok"),onCancel:this.allowConflictDeletion?this.handleDeleteDialogCancelClick:void 0,onConfirm:this.allowConflictDeletion?this.handleDeleteDialogConfirmClick:this.handleDeleteDialogCancelClick,open:this.showDeleteLinkedDialog,title:this.allowConflictDeletion?Nr("sulu_admin.delete_linked_warning_title"):Nr("sulu_admin.item_not_deletable")},this.allowConflictDeletion?Nr("sulu_admin.delete_linked_warning_text"):Nr("sulu_admin.delete_linked_abort_text"),y.a.createElement("ul",null,this.referencingItemsForDelete.map((function(e,t){return y.a.createElement("li",{key:t},e.name)}))))),l&&y.a.createElement(h.Fragment,null,y.a.createElement(E_,{adapter:n[0],allowActivateForDisabledItems:!1,clearSelectionOnClose:!0,confirmLoading:d.movingSelection||d.moving,disabledIds:this.moveId?[this.moveId]:[],listKey:d.listKey,locale:d.observableOptions.locale,metadataOptions:d.metadataOptions,onClose:this.handleMoveOverlayClose,onConfirm:this.handleMoveOverlayConfirmClick,open:this.showMoveOverlay,options:d.options,reloadOnOpen:!0,resourceKey:d.resourceKey,title:Nr("sulu_admin.move_copy_overlay_title")}),y.a.createElement(Td,{cancelText:Nr("sulu_admin.cancel"),confirmText:Nr("sulu_admin.confirm"),onCancel:this.handleMovePermissionWarningCancel,onConfirm:this.handleMovePermissionWarningConfirm,open:!!this.movingRestrictedTarget,title:Nr("sulu_security.move_permission_title")},Nr("sulu_security.move_permission_warning"))),r&&y.a.createElement(E_,{adapter:n[0],clearSelectionOnClose:!0,confirmLoading:d.copying,listKey:d.listKey,locale:d.observableOptions.locale,metadataOptions:d.metadataOptions,onClose:this.handleCopyOverlayClose,onConfirm:this.handleCopyOverlayConfirmClick,open:this.showCopyOverlay,reloadOnOpen:!0,resourceKey:d.resourceKey,title:Nr("sulu_admin.move_copy_overlay_title")}),f&&y.a.createElement(Td,{cancelText:Nr("sulu_admin.cancel"),confirmLoading:d.ordering,confirmText:Nr("sulu_admin.ok"),onCancel:this.handleOrderDialogCancelClick,onConfirm:this.handleOrderDialogConfirmClick,open:this.showOrderDialog,title:Nr("sulu_admin.order_warning_title")},Nr("sulu_admin.order_warning_text")))}}]),n}(y.a.Component),Cj.defaultProps={allowActivateForDisabledItems:!0,copyable:!0,deletable:!0,disabled:!1,disabledIds:[],movable:!0,orderable:!0,searchable:!0,selectable:!0,showColumnOptions:!0},qP=Hj((UP=xj).prototype,"currentAdapterKey",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),KP=Hj(UP.prototype,"showCopyOverlay",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),$P=Hj(UP.prototype,"showDeleteDialog",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),GP=Hj(UP.prototype,"showDeleteLinkedDialog",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),ZP=Hj(UP.prototype,"showMoveOverlay",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),JP=Hj(UP.prototype,"showDeleteSelectionDialog",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),QP=Hj(UP.prototype,"allowConflictDeletion",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),XP=Hj(UP.prototype,"showOrderDialog",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),ej=Hj(UP.prototype,"adapterOptionsOpen",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),tj=Hj(UP.prototype,"columnOptionsOpen",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),nj=Hj(UP.prototype,"referencingItemsForDelete",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),rj=Hj(UP.prototype,"movingRestrictedTarget",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){}}),Hj(UP.prototype,"currentAdapter",[v.g],Object.getOwnPropertyDescriptor(UP.prototype,"currentAdapter"),UP.prototype),Hj(UP.prototype,"currentAdapterOptions",[v.g],Object.getOwnPropertyDescriptor(UP.prototype,"currentAdapterOptions"),UP.prototype),Hj(UP.prototype,"disabledIds",[v.g],Object.getOwnPropertyDescriptor(UP.prototype,"disabledIds"),UP.prototype),Hj(UP.prototype,"showColumnOptions",[v.g],Object.getOwnPropertyDescriptor(UP.prototype,"showColumnOptions"),UP.prototype),oj=Hj(UP.prototype,"setCurrentAdapterKey",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){e.currentAdapterKey=t,e.props.store.loadingStrategy instanceof e.currentAdapter.LoadingStrategy||e.props.store.updateLoadingStrategy(new e.currentAdapter.LoadingStrategy),e.props.store.structureStrategy instanceof e.currentAdapter.StructureStrategy||e.props.store.updateStructureStrategy(new e.currentAdapter.StructureStrategy)}}}),ij=Hj(UP.prototype,"requestSelectionDelete",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];e.showDeleteSelectionDialog=!0,e.allowConflictDeletion=t}}}),aj=Hj(UP.prototype,"handleSelectionDeleteDialogConfirmClick",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){e.props.store.deleteSelection().then(Object(v.d)((function(){e.showDeleteSelectionDialog=!1}))).catch(e.handleDeleteResponseError)}}}),uj=Hj(UP.prototype,"handleSelectionDeleteDialogCancelClick",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){e.showDeleteSelectionDialog=!1}}}),lj=Hj(UP.prototype,"handleRequestItemDelete",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){e.showDeleteDialog=!0;var n=new Promise((function(t){return e.resolveDelete=t}));return n.then(Object(v.d)((function(n){return n.deleted?(e.props.store.delete(t).then(Object(v.d)((function(){e.showDeleteDialog=!1}))).catch(e.handleDeleteResponseError),n):(e.showDeleteDialog=!1,n)}))),n}}}),sj=Hj(UP.prototype,"handleDeleteResponseError",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){if(409!==t.status)throw t;e.showDeleteDialog=!1,e.showDeleteSelectionDialog=!1,e.showDeleteLinkedDialog=!0,t.json().then(Object(v.d)((function(t){var n;e.referencingItemsForDelete.splice(0,e.referencingItemsForDelete.length),(n=e.referencingItemsForDelete).push.apply(n,Mj(t.items)),new Promise((function(t){return e.resolveDelete=t})).then(Object(v.d)((function(n){if(!n.deleted)return e.showDeleteDialog=!1,e.showDeleteSelectionDialog=!1,e.showDeleteLinkedDialog=!1,n;e.props.store.delete(t.id,{force:!0}).then(Object(v.d)((function(){e.showDeleteDialog=!1,e.showDeleteSelectionDialog=!1,e.showDeleteLinkedDialog=!1})))})))})))}}}),cj=Hj(UP.prototype,"handleDeleteDialogConfirmClick",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){if(!e.resolveDelete)throw new Error("The resolveDelete function is not set. This should not happen, and is likely a bug.");e.resolveDelete({deleted:!0})}}}),fj=Hj(UP.prototype,"handleDeleteDialogCancelClick",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){if(!e.resolveDelete)throw new Error("The resolveDelete function is not set. This should not happen, and is likely a bug.");e.resolveDelete({deleted:!1})}}}),pj=Hj(UP.prototype,"handleRequestItemMove",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){e.moveId=t,e.showMoveOverlay=!0;var n=new Promise((function(t){return e.resolveMove=t}));return n.then(Object(v.d)((function(t){if(!t.moved||!t.parent)return e.showMoveOverlay=!1,e.moveId=void 0,t;if(!e.moveId)throw new Error("The moveId is not set. This should not happen and is likely a bug.");return e.props.store.move(e.moveId,t.parent.id).then(Object(v.d)((function(){e.moveId=void 0,e.showMoveOverlay=!1}))),t}))),n}}}),dj=Hj(UP.prototype,"handleMoveOverlayConfirmClick",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){if(!e.moveId)throw new Error("The moveId is not set. This should not happen and is likely a bug.");var n=e.props.store.findById(e.moveId);if(!n)throw new Error("The moveId does not refer to an element. This should not happen and is likely a bug.");if(n._hasPermissions||t._hasPermissions)e.movingRestrictedTarget=t;else{if(!e.resolveMove)throw new Error("The resolveMove function is not set. This should not happen, and is likely a bug.");e.resolveMove({moved:!0,parent:t})}}}}),hj=Hj(UP.prototype,"handleMoveOverlayClose",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){if(!e.resolveMove)throw new Error("The resolveMove function is not set. This should not happen, and is likely a bug.");e.resolveMove({moved:!1})}}}),yj=Hj(UP.prototype,"handleMovePermissionWarningConfirm",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){if(!e.resolveMove)throw new Error("The resolveMove function is not set. This should not happen, and is likely a bug.");e.resolveMove({moved:!0,parent:e.movingRestrictedTarget}),e.movingRestrictedTarget=void 0}}}),mj=Hj(UP.prototype,"handleMovePermissionWarningCancel",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){e.movingRestrictedTarget=void 0}}}),bj=Hj(UP.prototype,"handleRequestItemCopy",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){e.showCopyOverlay=!0;var n=new Promise((function(t){return e.resolveCopy=t}));return n.then(Object(v.d)((function(n){var r;return n.copied?(e.props.store.copy(t,n.parent.id,null===(r=e.props)||void 0===r?void 0:r.onCopyFinished).then(Object(v.d)((function(){e.showCopyOverlay=!1}))),n):(e.showCopyOverlay=!1,n)}))),n}}}),vj=Hj(UP.prototype,"handleCopyOverlayConfirmClick",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){if(!e.resolveCopy)throw new Error("The resolveCopy function is not set. This should not happen, and is likely a bug.");e.resolveCopy({copied:!0,parent:t})}}}),gj=Hj(UP.prototype,"handleCopyOverlayClose",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){if(!e.resolveCopy)throw new Error("The resolveCopy function is not set. This should not happen, and is likely a bug.");e.resolveCopy({copied:!1})}}}),wj=Hj(UP.prototype,"handleRequestItemOrder",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t,n){e.showOrderDialog=!0;var r=new Promise((function(t){return e.resolveOrder=t}));return r.then(Object(v.d)((function(r){return r.ordered?(e.props.store.order(t,n).then(Object(v.d)((function(){e.showOrderDialog=!1}))),r):(e.showOrderDialog=!1,r)}))),r}}}),_j=Hj(UP.prototype,"handleOrderDialogConfirmClick",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){if(!e.resolveOrder)throw new Error("The resolveOrder function is not set. This should not happen, and is likely a bug.");e.resolveOrder({ordered:!0})}}}),Oj=Hj(UP.prototype,"handleOrderDialogCancelClick",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){if(!e.resolveOrder)throw new Error("The resolveOrder function is not set. This should not happen, and is likely a bug.");e.resolveOrder({ordered:!1})}}}),Sj=Hj(UP.prototype,"handleAdapterOptionsButtonClick",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){e.adapterOptionsOpen=!e.adapterOptionsOpen}}}),kj=Hj(UP.prototype,"handleAdapterOptionsClose",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){e.adapterOptionsOpen=!1}}}),Pj=Hj(UP.prototype,"handleColumnOptionsOpen",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){e.columnOptionsOpen=!0}}}),jj=Hj(UP.prototype,"handleColumnOptionsClose",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){e.columnOptionsOpen=!1}}}),Ej=Hj(UP.prototype,"handleColumnOptionsChange",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){e.columnOptionsOpen=!1,e.props.store.changeUserSchema(t)}}}),WP=UP))||WP;function qj(e,t){for(var n=0;n0?t:void 0)},e}return t=i,(n=[{key:"getFormNode",value:function(){var e=this,t=this.value;return y.a.createElement(Yh,{onChange:this.handleChange,values:t||[]},Object.keys(this.parameterOptions).map((function(t){return y.a.createElement(Nh,{key:t,value:t},Nr(e.parameterOptions[t]))})))}},{key:"getValueNode",value:function(e){var t=this;return e?Promise.resolve(e.map((function(e){return Nr(t.parameterOptions[e])})).join(", ")):Promise.resolve(null)}},{key:"parameterOptions",get:function(){var e=this.parameters;if(!e)throw new Error('The "SelectFieldFilterType" needs some parameters to work!');var t=e.options;if("object"!==AC(t)||null===t)throw new Error('The "options" parameter must be an object!');return t}}])&&IC(t.prototype,n),r&&IC(t,r),i}(Gk)).prototype,"parameterOptions",[v.g],Object.getOwnPropertyDescriptor(RC.prototype,"parameterOptions"),RC.prototype),RC),VC=n(392),WC=n.n(VC);function UC(e){return(UC="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function qC(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function KC(e,t){for(var n=0;n"};function tx(e){var t=e?Object.keys(e):[];if(t.length>1)throw new Error('The "NumberFilterFieldType" only accepts an array with exactly one key!');return t[0]}function nx(e){if(e)return e[tx(e)]}var rx=(XC((BC=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&$C(e,t)}(i,e);var t,n,r,o=GC(i);function i(e,t,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(r=o.call(this,e,t,n)).handleOperatorChange=function(e){if(!e)throw new Error("The operator cannot be changed to undefined! This should not happen and is likely a bug.");(0,JC(r).onChange)(qC({},e,r.number))},r.handleInputChange=function(e){(0,JC(r).onChange)(qC({},r.operator,e))},void 0===n&&e({eq:void 0}),r}return t=i,(n=[{key:"setInputRef",value:function(e){e&&e.focus()}},{key:"getFormNode",value:function(){return y.a.createElement("div",{className:WC.a.numberFieldFilterType},y.a.createElement(cm,{onChange:this.handleOperatorChange,value:this.operator},y.a.createElement(cm.Option,{value:"lt"},ex.lt),y.a.createElement(cm.Option,{value:"eq"},ex.eq),y.a.createElement(cm.Option,{value:"gt"},ex.gt)),y.a.createElement(ha,{inputRef:this.setInputRef,onChange:this.handleInputChange,type:"number",value:this.number}))}},{key:"getValueNode",value:function(e){return Promise.resolve((ex[tx(e)]||"")+" "+(nx(e)||""))}},{key:"operator",get:function(){return tx(this.value)}},{key:"number",get:function(){return nx(this.value)}}])&&KC(t.prototype,n),r&&KC(t,r),i}(Gk)).prototype,"operator",[v.g],Object.getOwnPropertyDescriptor(BC.prototype,"operator"),BC.prototype),XC(BC.prototype,"number",[v.g],Object.getOwnPropertyDescriptor(BC.prototype,"number"),BC.prototype),BC);function ox(e,t){for(var n=0;n3&&void 0!==arguments[3]?arguments[3]:"ids",i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};dx(this,e),px(this,"items",ax,this),px(this,"loading",ux,this),this.resourceKey=t,this.locale=r,this.idFilterParameter=o,this.requestParameters=i,this.loadItems(n)}var t,n,r;return t=e,(n=[{key:"set",value:function(e){this.items=e}},{key:"getById",value:function(e){return this.items.find((function(t){return t.id===e}))}},{key:"removeById",value:function(e){this.items.splice(this.items.findIndex((function(t){return t.id===e})),1)}},{key:"move",value:function(e,t){this.items=Si()(this.items,e,t)}},{key:"setLoading",value:function(e){this.loading=e}},{key:"setRequestParameters",value:function(e){this.requestParameters=e}},{key:"loadItems",value:function(e){var t,n=this;if(e&&0!==e.length)return this.setLoading(!0),no.getList(this.resourceKey,cx(cx({},this.requestParameters),{},(t={locale:this.locale?this.locale.get():void 0},fx(t,this.idFilterParameter,e.join(",")),fx(t,"limit",void 0),fx(t,"page",1),t))).then(Object(v.d)((function(e){n.set(e._embedded[n.resourceKey]),n.setLoading(!1)})));this.set([])}},{key:"ids",get:function(){return this.items.map((function(e){return e.id}))}}])&&hx(t.prototype,n),r&&hx(t,r),e}()).prototype,"items",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),ux=yx(ix.prototype,"loading",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),yx(ix.prototype,"ids",[v.g],Object.getOwnPropertyDescriptor(ix.prototype,"ids"),ix.prototype),yx(ix.prototype,"set",[v.d],Object.getOwnPropertyDescriptor(ix.prototype,"set"),ix.prototype),yx(ix.prototype,"removeById",[v.d],Object.getOwnPropertyDescriptor(ix.prototype,"removeById"),ix.prototype),yx(ix.prototype,"move",[v.d],Object.getOwnPropertyDescriptor(ix.prototype,"move"),ix.prototype),yx(ix.prototype,"setLoading",[v.d],Object.getOwnPropertyDescriptor(ix.prototype,"setLoading"),ix.prototype),ix),bx=n(122),vx=n.n(bx);function gx(e){return(gx="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function wx(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _x(e,t){for(var n=0;n".concat(o[i++],"")}));return y.a.createElement("span",{dangerouslySetInnerHTML:{__html:a}})},e.handleClick=function(){var t=e.props,n=t.value,r=t.onSelect;r&&r(n)},e}return t=i,(n=[{key:"render",value:function(){var e=this.props,t=e.minWidth,n=e.icon,r=e.children;return y.a.createElement("li",{className:vx.a.suggestionItem,style:{minWidth:t+"px"}},y.a.createElement("button",{className:vx.a.suggestion,onClick:this.handleClick},n&&y.a.createElement(yn,{className:vx.a.icon,name:n}),"string"==typeof r&&this.highlightMatchingTextPart(r),"function"==typeof r&&r(this.highlightMatchingTextPart)))}}])&&_x(t.prototype,n),r&&_x(t,r),i}(y.a.PureComponent);jx.defaultProps={minWidth:0,query:""};var Ex,Cx,xx,Tx,Dx=n(393),Rx=n.n(Dx);function Mx(e){return(Mx="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ax(e,t,n,r){n&&Object.defineProperty(e,t,{enumerable:n.enumerable,configurable:n.configurable,writable:n.writable,value:n.initializer?n.initializer.call(r):void 0})}function Lx(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ix(e,t){for(var n=0;n0&&n(r[0])},e.handleUp=function(){var t=e.buttons[e.activeButtonIndex-1];t&&t.focus()},e.handleDown=function(){var t=e.buttons[e.activeButtonIndex+1];t&&t.focus()},e}return t=i,(n=[{key:"componentDidUpdate",value:function(e){!0===this.props.open&&!1===e.open&&(il.a.bind("up",this.handleUp),il.a.bind("down",this.handleDown)),!1===this.props.open&&!0===e.open&&(il.a.unbind("up"),il.a.unbind("down"))}},{key:"render",value:function(){var e=this.props,t=e.anchorElement,n=e.idProperty,r=e.minWidth,o=e.onSelect,i=e.open,a=e.query,u=e.searchProperties,l=e.suggestions;return y.a.createElement(Ec,{anchorElement:t,horizontalOffset:5,onClose:this.handlePopoverClose,open:i,popoverChildRef:this.setSuggestionsRef,verticalOffset:-2},(function(e,t){return y.a.createElement(Jd,{menuRef:e,style:t},l.map((function(e){return y.a.createElement(jx,{key:e[n],minWidth:r,onSelect:o,query:a,value:e},(function(t){return u.map((function(n){return y.a.createElement("span",{className:Rx.a.column,key:n},t(e[n]))}))}))})))}))}},{key:"buttons",get:function(){return this.suggestionsRef?Array.from(this.suggestionsRef.getElementsByTagName("button")):[]}},{key:"activeButtonIndex",get:function(){return this.buttons.findIndex((function(e){return e===document.activeElement}))}}])&&Ix(t.prototype,n),r&&Ix(t,r),i}(y.a.Component),xx.defaultProps={idProperty:"id",minWidth:0},Cx=Hx((Ex=Tx).prototype,"suggestionsRef",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Hx(Ex.prototype,"buttons",[v.g],Object.getOwnPropertyDescriptor(Ex.prototype,"buttons"),Ex.prototype),Hx(Ex.prototype,"activeButtonIndex",[v.g],Object.getOwnPropertyDescriptor(Ex.prototype,"activeButtonIndex"),Ex.prototype),Ex),oT=n(60),iT=n.n(oT);function aT(e){return(aT="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function uT(e){return function(e){if(Array.isArray(e))return lT(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return lT(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return lT(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function lT(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0||0!==t.length&&void e.handleDelete(t[t.length-1])},cT(e,"handleSelect",eT,mT(e)),e.debouncedSearch=Wn()((function(t){e.props.onSearch(t)}),300),e}return t=i,(n=[{key:"render",value:function(){var e=this,t=this.props,n=t.disabled,r=t.displayProperty,o=t.id,i=t.idProperty,a=t.loading,u=t.searchProperties,l=t.suggestions,s=t.value,c=!!this.inputValue&&this.inputValue.length>0&&l.length>0,f=tn()(iT.a.multiAutoComplete,sT({},iT.a.disabled,n)),p=tn()(iT.a.input,"mousetrap");return y.a.createElement(h.Fragment,null,y.a.createElement("label",{className:f,ref:this.setLabelRef},y.a.createElement("div",{className:iT.a.icon},a?y.a.createElement(_i,{size:16}):y.a.createElement(yn,{name:"su-search"})),y.a.createElement("div",{className:iT.a.items},s.map((function(t){return y.a.createElement("span",{className:iT.a.chip,key:t[i]},y.a.createElement(Wk,{disabled:n,onDelete:e.handleDelete,value:t},t[r]))})),y.a.createElement("input",{className:p,disabled:n,id:o,onBlur:this.handleInputBlur,onChange:this.handleInputChange,onFocus:this.handleInputFocus,ref:this.setInputRef,value:this.inputValue}))),y.a.createElement(rT,{anchorElement:this.labelRef,idProperty:i,minWidth:this.popoverMinWidth,onSelect:this.handleSelect,open:!n&&c,query:this.inputValue,searchProperties:u,suggestions:l}))}},{key:"popoverMinWidth",get:function(){return this.labelRef?this.labelRef.scrollWidth-10:0}}])&&pT(t.prototype,n),r&&pT(t,r),i}(y.a.Component),tT.defaultProps={allowAdd:!1,disabled:!1,idProperty:"id",loading:!1},Ux=vT((Wx=nT).prototype,"labelRef",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),qx=vT(Wx.prototype,"inputRef",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Kx=vT(Wx.prototype,"inputValue",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),$x=vT(Wx.prototype,"setLabelRef",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){t&&(e.labelRef=t)}}}),Gx=vT(Wx.prototype,"setInputRef",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){var n=e.props.inputRef;n&&n(t),t&&(e.inputRef=t)}}}),vT(Wx.prototype,"popoverMinWidth",[v.g],Object.getOwnPropertyDescriptor(Wx.prototype,"popoverMinWidth"),Wx.prototype),Zx=vT(Wx.prototype,"handleDelete",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){var n=e.props,r=n.onChange,o=n.onFinish;r(n.value.filter((function(e){return e!=t}))),o&&o()}}}),Jx=vT(Wx.prototype,"handleInputChange",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){e.inputValue=t.currentTarget.value,e.debouncedSearch(e.inputValue)}}}),Qx=vT(Wx.prototype,"handleInputFocus",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){il.a.bind("enter",e.handleEnterAndComma),il.a.bind(",",e.handleEnterAndComma),il.a.bind("backspace",e.handleBackspace)}}}),Xx=vT(Wx.prototype,"handleInputBlur",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return function(){il.a.unbind("enter"),il.a.unbind(","),il.a.unbind("backspace")}}}),eT=vT(Wx.prototype,"handleSelect",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){var n=e.props,r=n.onChange,o=n.onFinish,i=n.value;r([].concat(uT(i),[t])),e.inputValue="",e.inputRef.focus(),o&&o()}}}),Vx=Wx))||Vx;function PT(e){return function(e){if(Array.isArray(e))return jT(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return jT(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return jT(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function jT(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:{};DT(this,e),TT(this,"searchResults",wT,this),TT(this,"loading",_T,this),TT(this,"clearSearchResults",OT,this),TT(this,"search",ST,this),this.resourceKey=t,this.searchProperties=n,this.options=r}).prototype,"searchResults",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),_T=RT(gT.prototype,"loading",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),OT=RT(gT.prototype,"clearSearchResults",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){e.searchResults.splice(0,e.searchResults.length)}}}),ST=RT(gT.prototype,"search",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,r=e.resourceKey,o=e.searchProperties;return t?(e.loading=!0,no.getList(r,CT(CT({},e.options),{},{excludedIds:n,limit:10,page:1,searchFields:o,search:t})).then(Object(v.d)((function(t){var n;return e.clearSearchResults(),(n=e.searchResults).push.apply(n,PT(t._embedded[r])),e.loading=!1,e.searchResults}))).catch(Object(v.d)((function(){e.loading=!1}))).then((function(){return[]}))):(e.clearSearchResults(),Promise.resolve([]))}}}),gT);function zT(e){return(zT="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function FT(e,t){for(var n=0;n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function ZT(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"id";tD(this,e),eD(this,"initialLoading",WT,this),eD(this,"deleting",UT,this),eD(this,"patching",qT,this),eD(this,"data",KT,this),this.resourceKey=t,this.requestParameters=r,this.idProperty=o,this.initialLoading=!0,no.getList(t,r).then(Object(v.d)((function(e){n.data=e._embedded[t],n.initialLoading=!1}))).catch(Object(v.d)((function(){n.initialLoading=!1})))}return rD(e,[{key:"loading",get:function(){return this.initialLoading||this.deleting||this.patching}}]),rD(e,[{key:"deleteList",value:function(e){var t=this;return this.deleting=!0,no.deleteList(this.resourceKey,QT(QT({},this.requestParameters),{},{ids:e})).then(Object(v.d)((function(){var n,r=GT(e);try{var o=function(){var e=n.value;t.data.splice(t.data.findIndex((function(n){return n[t.idProperty]===e})),1)};for(r.s();!(n=r.n()).done;)o()}catch(e){r.e(e)}finally{r.f()}t.deleting=!1})))}},{key:"patchList",value:function(e){var t=this;return this.patching=!0,no.patchList(this.resourceKey,e).then(Object(v.d)((function(e){var n,r=GT(e);try{var o=function(){var e=n.value,r=t.data.findIndex((function(n){return n[t.idProperty]===e[t.idProperty]}));-1===r?t.data.push(e):t.data[r]=e};for(r.s();!(n=r.n()).done;)o()}catch(e){r.e(e)}finally{r.f()}t.patching=!1})))}}]),e}()).prototype,"initialLoading",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),UT=oD(VT.prototype,"deleting",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),qT=oD(VT.prototype,"patching",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),KT=oD(VT.prototype,"data",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),oD(VT.prototype,"loading",[v.g],Object.getOwnPropertyDescriptor(VT.prototype,"loading"),VT.prototype),oD(VT.prototype,"deleteList",[v.d],Object.getOwnPropertyDescriptor(VT.prototype,"deleteList"),VT.prototype),oD(VT.prototype,"patchList",[v.d],Object.getOwnPropertyDescriptor(VT.prototype,"patchList"),VT.prototype),VT);function pD(e){return(pD="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function dD(e,t,n,r){n&&Object.defineProperty(e,t,{enumerable:n.enumerable,configurable:n.configurable,writable:n.writable,value:n.initializer?n.initializer.call(r):void 0})}function hD(e,t){for(var n=0;n=y.a.Children.count(t)&&(this.activeColumnIndex=0),this.container&&this.props.children!==e.children&&(this.container.scrollLeft=this.columnWidth*(y.a.Children.count(t)-1))}},{key:"render",value:function(){var e,t=this.props.children,n=-this.scrollPosition+this.activeColumnIndex*this.columnWidth,r=tn()(EM.a.columnListContainer,(xM(e={},EM.a.firstVisibleColumnActive,n<=0),xM(e,EM.a.lastVisibleColumnActive,n>=this.containerWidth-this.columnWidth),e)),o=this.props.toolbarItemsProvider(this.activeColumnIndex);return y.a.createElement("div",{className:EM.a.columnListToolbarContainer},!!o&&y.a.createElement("div",{className:EM.a.toolbarContainer,style:{marginLeft:n}},!!o.length&&y.a.createElement(PM,{toolbarItems:o,toolbarRef:this.setToolbarRef})),y.a.createElement("div",{className:r,ref:this.setContainerRef},y.a.createElement("div",{className:EM.a.columnList},this.cloneColumns(t))))}},{key:"columnWidth",get:function(){var e=parseInt(EM.a.columnWidth);return isNaN(e)?0:e}},{key:"containerWidth",get:function(){return this.container?this.container.clientWidth:0}},{key:"containerScrollWidth",get:function(){return this.container?this.container.scrollWidth:0}},{key:"containerScrolling",get:function(){return this.containerWidth=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function SA(e){return function(e){if(Array.isArray(e))return PA(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||kA(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function kA(e,t){if(e){if("string"==typeof e)return PA(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?PA(e,t):void 0}}function PA(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);nt})).forEach((function(e){return n.delete(e)}))}var TA,DA,RA,MA,AA,LA,IA=(wA=CA((gA=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),function(e,t,n,r){n&&Object.defineProperty(e,t,{enumerable:n.enumerable,configurable:n.configurable,writable:n.writable,value:n.initializer?n.initializer.call(r):void 0})}(this,"rawData",wA,this),this.rawData.set(void 0,[])}return EA(e,[{key:"visibleItems",get:function(){return this.data.reduce((function(e,t){return e.concat.apply(e,SA(t))}),[])}},{key:"activeItems",get:function(){return Array.from(this.rawData.keys())}},{key:"data",get:function(){return Array.from(this.rawData.values())}}]),EA(e,[{key:"activate",value:function(e){var t=this.data.findIndex((function(t){return-1!==t.findIndex((function(t){return t.id===e}))}));xA(this.activeItems,t,this.rawData),this.rawData.set(e,[])}},{key:"remove",value:function(e){var t,n=OA(this.activeItems.keys());try{for(n.s();!(t=n.n()).done;){var r=t.value,o=this.activeItems[r];if(o){var i=this.rawData.get(o);if(i){var a,u=OA(i.keys());try{for(u.s();!(a=u.n()).done;){var l=a.value,s=i[l].id;if(s===e&&(this.activeItems.includes(s)&&xA(this.activeItems,r,this.rawData),i.splice(l,1),0===i.length)){var c=this.findById(o);c&&(c.hasChildren=!1)}}}catch(e){u.e(e)}finally{u.f()}}}}}catch(e){n.e(e)}finally{n.f()}}},{key:"findById",value:function(e){var t,n=OA(this.data);try{for(n.s();!(t=n.n()).done;){var r,o=OA(t.value);try{for(o.s();!(r=o.n()).done;){var i=r.value;if(i.id===e)return i}}catch(e){o.e(e)}finally{o.f()}}}catch(e){n.e(e)}finally{n.f()}}},{key:"order",value:function(e,t){var n,r=OA(this.rawData.keys());try{for(r.s();!(n=r.n()).done;){var o=n.value,i=this.rawData.get(o);if(i){var a=i.findIndex((function(t){return t.id===e}));if(-1!==a)return void this.rawData.set(o,Si()(i,a,t-1))}}}catch(e){r.e(e)}finally{r.f()}throw new Error('The id "'+e+'" was tried to be ordered to a different position, but it does not exist!')}},{key:"clear",value:function(e){e||(this.rawData.clear(),this.rawData.set(e,[]));var t=this.activeItems.indexOf(e);if(-1!==t){xA(this.activeItems,t,this.rawData);var n=this.rawData.get(e);n&&n.length>0&&n.splice(0,n.length)}}},{key:"addItem",value:function(e,t){var n=this,r=this.rawData.get(t);if(r||(r=[],this.rawData.set(t,r)),r.push(e),e._embedded){var o=Object.keys(e._embedded)[0],i=e._embedded[o];Array.isArray(i)&&!this.rawData.has(e.id)&&(this.rawData.set(e.id,[]),i.forEach((function(t){n.addItem(t,e.id)})))}}}]),e}()).prototype,"rawData",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return new Map}}),CA(gA.prototype,"visibleItems",[v.g],Object.getOwnPropertyDescriptor(gA.prototype,"visibleItems"),gA.prototype),CA(gA.prototype,"activeItems",[v.g],Object.getOwnPropertyDescriptor(gA.prototype,"activeItems"),gA.prototype),CA(gA.prototype,"data",[v.g],Object.getOwnPropertyDescriptor(gA.prototype,"data"),gA.prototype),CA(gA.prototype,"remove",[v.d],Object.getOwnPropertyDescriptor(gA.prototype,"remove"),gA.prototype),CA(gA.prototype,"order",[v.d],Object.getOwnPropertyDescriptor(gA.prototype,"order"),gA.prototype),CA(gA.prototype,"clear",[v.d],Object.getOwnPropertyDescriptor(gA.prototype,"clear"),gA.prototype),gA),zA=n(397),FA=n.n(zA);function YA(e){return(YA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function NA(e){return function(e){if(Array.isArray(e))return BA(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return BA(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return BA(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function BA(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);na&&(n=a),i(t,n).then((function(e){return e.ordered}))},e.getIndicators=function(t){if(t.ghostLocale)return[y.a.createElement(GM,{key:"ghost",locale:t.ghostLocale})];var n=[];if(t._hasPermissions&&n.push(y.a.createElement(yn,{key:"permissions",name:"su-permissions"})),"internal"===t.linked?n.push(y.a.createElement(yn,{key:"internal",name:"su-link2"})):"external"===t.linked?n.push(y.a.createElement(yn,{key:"external",name:"su-link"})):t.shadowLocale&&n.push(y.a.createElement(yn,{key:"shadow",name:"su-shadow-page"})),void 0!==t.publishedState||void 0!==t.published){var r=!t.publishedState,o=!!t.published;!r&&o||n.push(y.a.createElement(aA,{draft:r,key:"publish",published:o}))}var i=e.props.adapterOptions,a=(i=void 0===i?{}:i).get_indicators;if(a){if("function"!=typeof a)throw new Error('The "get_indicators" option of the ColumnListAdapter must be a function!');n.push.apply(n,NA(a(t)))}return n},e.getButtons=function(t){var n=e.props,r=n.onItemClick,o=n.onItemSelectionChange,i=!!t.ghostLocale,a=[],u=t._permissions,l=(u=void 0===u?{}:u).view,s=void 0===l||l,c=u.edit;if(r){var f=i?"su-plus-circle":void 0===c||c?"su-pen":"su-eye";a.push({icon:f,onClick:r,visible:s})}if(o){var p={icon:"su-check",onClick:e.handleItemSelectionChange};a.push(p)}return a},e.getToolbarItems=function(t){var n=e.props,r=n.activeItems,o=n.adapterOptions,i=(o=void 0===o?{}:o).display_root_level_toolbar,a=void 0===i||i,u=n.data,l=n.onItemAdd,s=n.onRequestItemCopy,c=n.onRequestItemDelete,f=n.onRequestItemMove,p=n.onRequestItemOrder;if(!r)throw new Error("The ColumnListAdapter does not work without activeItems. This error should not happen and is likely a bug.");if(!a&&!r[t])return[];if(e.orderColumn===t)return[{icon:"su-times",type:"button",onClick:Object(v.d)((function(){e.orderColumn=void 0}))}];var d=[],h=u[t-1],y=((h?h.find((function(e){return e.id===r[t]})):void 0)||{})._permissions,m=(y=void 0===y?{}:y).add,b=void 0===m||m,g=y.edit,w=void 0===g||g;l&&b&&d.push({icon:"su-plus-circle",type:"button",onClick:function(){l(r[t])}});var _=void 0!==r[t+1],O=u[t],S=((O?O.find((function(e){return e.id===r[t+1]})):void 0)||{})._permissions,k=(S=void 0===S?{}:S).delete,P=void 0===k||k,j=S.edit,E=void 0===j||j,C=[];return c&&C.push({disabled:!_||!P,label:Nr("sulu_admin.delete"),onClick:function(){var e=r[t+1];if(!e)throw new Error("An undefined itemId cannot be deleted! This should not happen and is likely a bug.");c(e)}}),f&&C.push({disabled:!_||!E,label:Nr("sulu_admin.move"),onClick:function(){var e=r[t+1];if(!e)throw new Error("An undefined itemId cannot be deleted! This should not happen and is likely a bug.");f(e)}}),s&&C.push({disabled:!_||!E,label:Nr("sulu_admin.copy"),onClick:function(){var e=r[t+1];if(!e)throw new Error("An undefined itemId cannot be deleted! This should not happen and is likely a bug.");s(e)}}),p&&C.push({disabled:!w,label:Nr("sulu_admin.order"),onClick:Object(v.d)((function(){e.orderColumn=t}))}),C.length>0&&d.push({icon:"su-cog",type:"dropdown",options:C}),d.length>0?d:void 0},e}return t=i,(n=[{key:"render",value:function(){var e=this,t=this.props,n=t.activeItems,r=t.disabledIds,o=t.loading,i=t.onItemClick,a=t.selections;return y.a.createElement("div",{className:FA.a.columnListAdapter},y.a.createElement(YM,{onItemClick:this.handleItemClick,onItemDoubleClick:i,toolbarItemsProvider:this.getToolbarItems},this.props.data.map((function(t,i){return y.a.createElement(YM.Column,{key:i,loading:i>=e.props.data.length-1&&o},t.map((function(t,o){return y.a.createElement(YM.Item,{active:n?n.includes(t.id):void 0,buttons:e.getButtons(t),disabled:r.includes(t.id),hasChildren:t.hasChildren,id:t.id,indicators:e.getIndicators(t),key:t.id,onOrderChange:e.handleOrderChange,order:o+1,selected:a.includes(t.id),showOrderField:e.orderColumn===i},t.title||t.name)})))}))))}}])&&WA(t.prototype,n),r&&WA(t,r),i}(A_),AA.LoadingStrategy=_A,AA.StructureStrategy=IA,AA.icon="su-columns",AA.searchable=!1,AA.defaultProps={data:[]},RA=ZA((DA=LA).prototype,"orderColumn",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){}}),MA=ZA(DA.prototype,"handleItemClick",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){var n=e.props,r=n.data,o=n.onItemActivate;void 0!==e.orderColumn&&null!==e.orderColumn&&r[e.orderColumn].some((function(e){return e.id===t}))||o&&(o(t),e.orderColumn=void 0)}}}),TA=DA))||TA,QA=n(12),XA=n.n(QA);function eL(e){return(eL="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function tL(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function nL(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0){var u=e.createHeaderButtonCells();u&&i.push.apply(i,pL(u))}return o||(e.isMultipleSelect()?i.push(e.createCheckboxCell()):e.isSingleSelect()&&i.push(e.createEmptyCell())),a.unshift.apply(a,i),a},e.createHeaderCells=function(t){return y.a.Children.map(t,(function(t,n){var r="header-".concat(n),o=t.props,i=o.children;return 0===n&&(i=e.createFirstCell(i)),y.a.cloneElement(t,cL(cL({},o),{},{key:r,children:i}))}))},e.createFirstCell=function(t){var n=e.props,r=n.allSelected,o=n.selectInFirstCell,i=n.onAllSelectionChange,a=n.skin;return o&&e.isMultipleSelect()&&i?y.a.createElement(h.Fragment,null,y.a.createElement("span",{className:XA.a.cellSelect},y.a.createElement(Nh,{checked:r,onChange:e.handleAllSelectionChange,skin:"dark"===a?"light":"dark"})),t):t},e.createHeaderButtonCells=function(){var t=e.props.buttons;return t?t.map((function(e,t){var n="header-button-".concat(t);return y.a.createElement(uL,{className:XA.a.headerButtonCell,key:n},y.a.createElement(yn,{name:e.icon}))})):null},e.createCheckboxCell=function(){var t=e.props.skin;return y.a.createElement(uL,{key:"header-checkbox"},y.a.createElement(Nh,{checked:e.props.allSelected,onChange:e.handleAllSelectionChange,skin:"dark"===t?"light":"dark"}))},e.createEmptyCell=function(){return y.a.createElement(uL,{key:"header-empty"})},e.handleAllSelectionChange=function(t){var n=e.props.onAllSelectionChange;n&&n(t)},e}return t=i,(n=[{key:"render",value:function(){var e=this.props.children,t=this.createHeader(e);return y.a.createElement("thead",{className:XA.a.header},y.a.createElement("tr",null,t))}}])&&yL(t.prototype,n),r&&yL(t,r),i}(y.a.PureComponent);wL.defaultProps={allSelected:!1,selectInFirstCell:!1,selectMode:"none",skin:"dark"};var _L=n(125),OL=n.n(_L);function SL(e){return(SL="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function kL(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function PL(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0){var a=e.createButtonCells();a&&i.push.apply(i,oI(a))}if(!o){var u=e.createSelect();u&&i.push(y.a.createElement(UL,{key:"choice",small:!0},u))}var l=e.cloneCells(t);return l.unshift(i),l},e.cloneCells=function(t){return y.a.Children.map(t,(function(t,n){var r="cell-".concat(n),o=t.props,i=0===n,a=e.props.depth,u=o.children;return i&&(u=e.createFirstCell(u)),y.a.cloneElement(t,nI(nI({},o),{},{key:r,children:u,depth:i&&a?a:void 0}))}))},e.createFirstCell=function(t){var n=e.props,r=n.hasChildren,o=n.selectInFirstCell,i=n.onSelectionChange;return y.a.createElement(h.Fragment,null,o&&i&&y.a.createElement("div",{className:XA.a.cellSelect},e.createSelect()),r&&e.createToggler(),t)},e.createSelect=function(){return e.props.onSelectionChange?e.isSingleSelect()?e.createRadioCell():e.isMultipleSelect()?e.createCheckboxCell():void 0:null},e.createToggler=function(){var t=e.props,n=t.isLoading,r=t.expanded;return y.a.createElement("span",{className:XA.a.toggleIcon},n?y.a.createElement(wi,{size:10}):y.a.createElement(hn,{name:!0===r?"su-angle-down":"su-angle-right",onClick:!1===r?e.handleExpand:e.handleCollapse}))},e.createRadioCell=function(){var t=e.props.selected;return y.a.createElement(TL,{checked:t,onChange:e.handleSingleSelectionChange,skin:"dark",value:e.getIdentifier()})},e.createCheckboxCell=function(){var t=e.props.selected;return y.a.createElement(Nh,{checked:t,onChange:e.handleMultipleSelectionChange,skin:"dark",value:e.getIdentifier()})},e.createButtonCells=function(){var t=e.props,n=t.buttons,r=t.rowIndex;return n?n.map((function(t,n){var o="control-".concat(r,"-").concat(n),i=t.disabled,a=t.icon,u=t.onClick;return y.a.createElement(XL,{disabled:i,icon:a,key:o,onClick:u,rowId:e.getIdentifier(),rowIndex:r})})):null},e.handleCollapse=function(){var t=e.props.onCollapse;t&&t(e.getIdentifier())},e.handleExpand=function(){var t=e.props.onExpand;t&&t(e.getIdentifier())},e.handleSingleSelectionChange=function(t){var n=e.props.onSelectionChange;n&&t&&n(t)},e.handleMultipleSelectionChange=function(t,n){var r=e.props.onSelectionChange;r&&null!=n&&r(n,t)},e}return t=i,(n=[{key:"render",value:function(){var e=this.props,t=e.children,n=e.disabled,r=tn()(XA.a.row,rI({},XA.a.disabled,n)),o=this.createCells(t);return y.a.createElement("tr",{className:r},o)}}])&&uI(t.prototype,n),r&&uI(t,r),i}(y.a.PureComponent);function dI(e){return(dI="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function hI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function yI(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function HI(e){return function(e){if(Array.isArray(e))return WI(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||VI(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function VI(e,t){if(e){if("string"==typeof e)return WI(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?WI(e,t):void 0}}function WI(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0){var o=Object.keys(e._embedded)[0],i=e._embedded[o];i&&i.forEach((function(t){return n.addItem(t,e.id)}))}}},{key:"clear",value:function(e){var t=UI(this.data,e);t&&0!==t.length&&t.splice(0,t.length)}},{key:"visibleItems",get:function(){return function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];n.push.apply(n,HI(t.map((function(e){return e.data}))));var r,o=BI(t);try{for(o.s();!(r=o.n()).done;){var i=r.value;e(i.children,n)}}catch(e){o.e(e)}finally{o.f()}return n}(this.data)}}])&&YI(t.prototype,n),r&&YI(t,r),e}()).prototype,"data",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),NI(II.prototype,"visibleItems",[v.g],Object.getOwnPropertyDescriptor(II.prototype,"visibleItems"),II.prototype),NI(II.prototype,"order",[v.d],Object.getOwnPropertyDescriptor(II.prototype,"order"),II.prototype),NI(II.prototype,"clear",[v.d],Object.getOwnPropertyDescriptor(II.prototype,"clear"),II.prototype),II),ZI=n(177),JI=n.n(ZI);function QI(e){return(QI="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function XI(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ez(e,t){for(var n=0;n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function hz(e){return function(e){if(Array.isArray(e))return mz(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||yz(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function yz(e,t){if(e){if("string"==typeof e)return mz(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?mz(e,t):void 0}}function mz(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:0,r=[],o=this.props,i=o.disabledIds,a=o.selections,u=dz(e);try{for(u.s();!(t=u.n()).done;){var l=t.value,s=l.data,c=l.hasChildren;r.push(y.a.createElement(FI.Row,{buttons:this.getButtons(l),depth:n,disabled:i.includes(s.id),expanded:l.children.length>0,hasChildren:c,id:s.id,isLoading:this.props.active===s.id&&this.props.loading,key:s.id,selected:a.includes(s.id)},this.renderCells(s))),r.push.apply(r,hz(this.renderRows(l.children,n+1)))}}catch(e){u.e(e)}finally{u.f()}return r}},{key:"render",value:function(){var e=this.props,t=e.active,n=e.data,r=e.loading,o=e.onAllSelectionChange,i=e.onItemSelectionChange,a=e.options.showHeader,u=void 0===a||a;return!t&&r?y.a.createElement(_i,null):y.a.createElement(FI,{buttons:this.getButtons(),onAllSelectionChange:o,onRowCollapse:this.handleRowCollapse,onRowExpand:this.handleRowExpand,onRowSelectionChange:i,selectInFirstCell:!0,selectMode:"multiple"},u&&y.a.createElement(FI.Header,null,this.renderHeaderCells()),y.a.createElement(FI.Body,null,this.renderRows(n)))}}])&&gz(t.prototype,n),r&&gz(t,r),i}(fz),sz.LoadingStrategy=_A,sz.StructureStrategy=GI,sz.icon="su-tree-list",uz=Pz((az=cz).prototype,"handleRowCollapse",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){e.props.onItemDeactivate(t)}}}),lz=Pz(az.prototype,"handleRowExpand",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){e.props.onItemActivate(t)}}}),iz=az))||iz,Az=n(76),Lz=n.n(Az);function Iz(e){return(Iz="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function zz(e,t,n,r){n&&Object.defineProperty(e,t,{enumerable:n.enumerable,configurable:n.configurable,writable:n.writable,value:n.initializer?n.initializer.call(r):void 0})}function Fz(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Yz(e,t){for(var n=0;n1},e.handlePreviousClick=function(){var t=e.props,n=t.currentPage,r=t.onPageChange;e.hasPreviousPage()&&n&&r(n-1)},e.handleNextClick=function(){var t=e.props,n=t.currentPage,r=t.onPageChange;e.hasNextPage()&&n&&r(n+1)},e.handleLimitChange=function(t){var n=e.props,r=n.currentLimit,o=n.onLimitChange,i=parseInt(t);i!==r&&o(i)},zz(e,"handleInputChange",xz,Vz(e)),zz(e,"handleInputBlur",Tz,Vz(e)),e}return t=i,(n=[{key:"componentDidMount",value:function(){this.props.currentPage&&(this.currentInputValue=this.props.currentPage)}},{key:"componentDidUpdate",value:function(e){var t=this.props.currentPage;if(e.currentPage!==t){if(!t)return void(this.currentInputValue=1);this.currentInputValue=t}}},{key:"render",value:function(){var e=this.currentInputValue,t=this.props,n=t.children,r=t.loading,o=t.totalPages,i=t.currentLimit;return y.a.createElement("section",null,n,y.a.createElement("nav",{className:Lz.a.pagination},y.a.createElement("span",{className:Lz.a.display},Nr("sulu_admin.per_page"),":"),y.a.createElement("span",null,y.a.createElement(cm,{onChange:this.handleLimitChange,skin:"dark",value:i},qz.map((function(e){return y.a.createElement(cm.Option,{key:e,value:e},e)})))),y.a.createElement("div",{className:Lz.a.loader},r&&y.a.createElement(_i,{size:24})),y.a.createElement("span",null,Nr("sulu_admin.page"),":"),y.a.createElement("span",{className:Lz.a.inputContainer},y.a.createElement(ha,{alignment:"center",inputMode:"numeric",onBlur:this.handleInputBlur,onChange:this.handleInputChange,skin:"dark",type:"text",value:e})),y.a.createElement("span",{className:Lz.a.display},Nr("sulu_admin.of")," ",o),y.a.createElement(cO,null,y.a.createElement(Ii,{disabled:!this.hasPreviousPage(),icon:"su-angle-left",onClick:this.handlePreviousClick}),y.a.createElement(Ii,{disabled:!this.hasNextPage(),icon:"su-angle-right",onClick:this.handleNextClick}))))}}])&&Yz(t.prototype,n),r&&Yz(t,r),i}(y.a.Component),Dz.defaultProps={loading:!1},Cz=Uz((Ez=Rz).prototype,"currentInputValue",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 1}}),Uz(Ez.prototype,"componentDidMount",[v.d],Object.getOwnPropertyDescriptor(Ez.prototype,"componentDidMount"),Ez.prototype),Uz(Ez.prototype,"componentDidUpdate",[v.d],Object.getOwnPropertyDescriptor(Ez.prototype,"componentDidUpdate"),Ez.prototype),xz=Uz(Ez.prototype,"handleInputChange",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){if(void 0!==t){var n=parseInt(t);isNaN(n)||(e.currentInputValue=n)}else e.currentInputValue=void 0}}}),Tz=Uz(Ez.prototype,"handleInputBlur",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){var t=e.props,n=t.currentPage,r=t.onPageChange,o=t.totalPages,i=e.currentInputValue;!i||!o||i<1?i=1:i>o&&(i=o),i!==n&&r(i),e.currentInputValue=n}}}),jz=Ez))||jz;function $z(e){return($z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Gz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Zz(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Jz(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Qz(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&i.deleteList(l.map((function(e){return e[r]}))),u.length>0||s.length>0){var c=[].concat(HB(u),HB(s)).filter((function(e){return e[n]}));i.patchList(c)}o()}}}),xB=TB))||xB;function aH(e){return(aH="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function uH(e,t,n,r){n&&Object.defineProperty(e,t,{enumerable:n.enumerable,configurable:n.configurable,writable:n.writable,value:n.initializer?n.initializer.call(r):void 0})}function lH(e,t){for(var n=0;n0&&u.length>0;return y.a.createElement("div",{className:PH.a.singleAutoComplete},y.a.createElement(ha,{autocomplete:"off",disabled:t,icon:"su-search",id:n,inputClass:"mousetrap",labelRef:this.setLabelRef,loading:r,onBlur:o,onChange:this.handleInputChange,placeholder:i,value:l}),y.a.createElement(rT,{anchorElement:this.labelRef,minWidth:this.popoverMinWidth,onSelect:this.handleSelect,open:!t&&s,query:l,searchProperties:a,suggestions:u}))}},{key:"popoverMinWidth",get:function(){return this.labelRef?this.labelRef.scrollWidth-10:0}}])&&xH(t.prototype,n),r&&xH(t,r),i}(y.a.Component),_H.defaultProps={disabled:!1},vH=LH((bH=OH).prototype,"labelRef",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),gH=LH(bH.prototype,"inputValue",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return this.props.value?this.props.value[this.props.displayProperty]:void 0}}),LH(bH.prototype,"setInputValue",[v.d],Object.getOwnPropertyDescriptor(bH.prototype,"setInputValue"),bH.prototype),wH=LH(bH.prototype,"setLabelRef",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){t&&(e.labelRef=t)}}}),LH(bH.prototype,"popoverMinWidth",[v.g],Object.getOwnPropertyDescriptor(bH.prototype,"popoverMinWidth"),bH.prototype),mH=bH))||mH;function NH(e){return(NH="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function BH(e,t){for(var n=0;n3&&void 0!==arguments[3]?arguments[3]:{};MV(this,e),RV(this,"item",jV,this),RV(this,"loading",EV,this),this.resourceKey=t,this.locale=r,this.options=o,n&&this.loadItem(n)}var t,n,r;return t=e,(n=[{key:"set",value:function(e){this.item=e}},{key:"clear",value:function(){this.item=void 0}},{key:"setLoading",value:function(e){this.loading=e}},{key:"loadItem",value:function(e){var t=this;if(e)return this.setLoading(!0),no.get(this.resourceKey,TV(TV({},this.options),{},{id:e,locale:this.locale?this.locale.get():void 0})).then(Object(v.d)((function(e){t.item=e,t.setLoading(!1)}))).catch(Object(v.d)((function(e){if(404!==e.status)return Promise.reject(e);t.item=null,t.setLoading(!1)})));this.item=void 0}}])&&AV(t.prototype,n),r&&AV(t,r),e}()).prototype,"item",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),EV=LV(PV.prototype,"loading",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),LV(PV.prototype,"set",[v.d],Object.getOwnPropertyDescriptor(PV.prototype,"set"),PV.prototype),LV(PV.prototype,"clear",[v.d],Object.getOwnPropertyDescriptor(PV.prototype,"clear"),PV.prototype),LV(PV.prototype,"setLoading",[v.d],Object.getOwnPropertyDescriptor(PV.prototype,"setLoading"),PV.prototype),LV(PV.prototype,"loadItem",[v.d],Object.getOwnPropertyDescriptor(PV.prototype,"loadItem"),PV.prototype),PV),WV=n(402),UV=n.n(WV);function qV(e){return(qV="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function KV(e,t,n,r){n&&Object.defineProperty(e,t,{enumerable:n.enumerable,configurable:n.configurable,writable:n.writable,value:n.initializer?n.initializer.call(r):void 0})}function $V(e,t){for(var n=0;na?1:Math.round(100*c/a)/100,t.a!==f)return{h:t.h,s:t.s,l:t.l,a:f,source:"rgb"}}else{var p=void 0;if(r!==(p=s<0?0:s>i?1:Math.round(100*s/i)/100))return{h:t.h,s:t.s,l:t.l,a:p,source:"rgb"}}return null},eU={},tU=function(e,t,n,r){var o=e+"-"+t+"-"+n+(r?"-server":"");if(eU[o])return eU[o];var i=function(e,t,n,r){if("undefined"==typeof document&&!r)return null;var o=r?new r:document.createElement("canvas");o.width=2*n,o.height=2*n;var i=o.getContext("2d");return i?(i.fillStyle=e,i.fillRect(0,0,o.width,o.height),i.fillStyle=t,i.fillRect(0,0,n,n),i.translate(n,n),i.fillRect(0,0,n,n),o.toDataURL()):null}(e,t,n,r);return eU[o]=i,i},nU=Object.assign||function(e){for(var t=1;t-1)){var o=n.getArrowOffset(),i=38===e.keyCode?r+o:r-o;n.setUpdatedValue(i,e)}},n.handleDrag=function(e){if(n.props.dragLabel){var t=Math.round(n.props.value+e.movementX);t>=0&&t<=n.props.dragMax&&n.props.onChange&&n.props.onChange(n.getValueObjectWithLabel(t),e)}},n.handleMouseDown=function(e){n.props.dragLabel&&(e.preventDefault(),n.handleDrag(e),window.addEventListener("mousemove",n.handleDrag),window.addEventListener("mouseup",n.handleMouseUp))},n.handleMouseUp=function(){n.unbindEventListeners()},n.unbindEventListeners=function(){window.removeEventListener("mousemove",n.handleDrag),window.removeEventListener("mouseup",n.handleMouseUp)},n.state={value:String(e.value).toUpperCase(),blurValue:String(e.value).toUpperCase()},n.inputId="rc-editable-input-"+pU++,n}return function(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)}(t,e),cU(t,[{key:"componentDidUpdate",value:function(e,t){this.props.value===this.state.value||e.value===this.props.value&&t.value===this.state.value||(this.input===document.activeElement?this.setState({blurValue:String(this.props.value).toUpperCase()}):this.setState({value:String(this.props.value).toUpperCase(),blurValue:!this.state.blurValue&&String(this.props.value).toUpperCase()}))}},{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"getValueObjectWithLabel",value:function(e){return function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}({},this.props.label,e)}},{key:"getArrowOffset",value:function(){return this.props.arrowOffset||1}},{key:"setUpdatedValue",value:function(e,t){var n=this.props.label?this.getValueObjectWithLabel(e):e;this.props.onChange&&this.props.onChange(n,t),this.setState({value:e})}},{key:"render",value:function(){var e=this,t=QW()({default:{wrap:{position:"relative"}},"user-override":{wrap:this.props.style&&this.props.style.wrap?this.props.style.wrap:{},input:this.props.style&&this.props.style.input?this.props.style.input:{},label:this.props.style&&this.props.style.label?this.props.style.label:{}},"dragLabel-true":{label:{cursor:"ew-resize"}}},{"user-override":!0},this.props);return y.a.createElement("div",{style:t.wrap},y.a.createElement("input",{id:this.inputId,style:t.input,ref:function(t){return e.input=t},value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,onBlur:this.handleBlur,placeholder:this.props.placeholder,spellCheck:"false"}),this.props.label&&!this.props.hideLabel?y.a.createElement("label",{htmlFor:this.inputId,style:t.label,onMouseDown:this.handleMouseDown},this.props.label):null)}}]),t}(h.PureComponent||h.Component),hU=function(e,t,n,r){var o=r.clientWidth,i=r.clientHeight,a="number"==typeof e.pageX?e.pageX:e.touches[0].pageX,u="number"==typeof e.pageY?e.pageY:e.touches[0].pageY,l=a-(r.getBoundingClientRect().left+window.pageXOffset),s=u-(r.getBoundingClientRect().top+window.pageYOffset);if("vertical"===t){var c=void 0;if(s<0)c=359;else if(s>i)c=0;else{c=360*(-100*s/i+100)/100}if(n.h!==c)return{h:c,s:n.s,l:n.l,a:n.a,source:"hsl"}}else{var f=void 0;if(l<0)f=0;else if(l>o)f=359;else{f=360*(100*l/o)/100}if(n.h!==f)return{h:f,s:n.s,l:n.l,a:n.a,source:"hsl"}}return null},yU=function(){function e(e,t){for(var n=0;n-1};var jU=function(e,t){var n=this.__data__,r=_U(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};function EU(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e<=9007199254740991};var rK=function(e){return null!=e&&nK(e.length)&&!KU(e)};var oK=function(e){return Gq(e)&&rK(e)},iK=n(38),aK=Function.prototype,uK=Object.prototype,lK=aK.toString,sK=uK.hasOwnProperty,cK=lK.call(Object);var fK=function(e){if(!Gq(e)||"[object Object]"!=VU(e))return!1;var t=Wq(e);if(null===t)return!0;var n=sK.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&lK.call(n)==cK},pK={};pK["[object Float32Array]"]=pK["[object Float64Array]"]=pK["[object Int8Array]"]=pK["[object Int16Array]"]=pK["[object Int32Array]"]=pK["[object Uint8Array]"]=pK["[object Uint8ClampedArray]"]=pK["[object Uint16Array]"]=pK["[object Uint32Array]"]=!0,pK["[object Arguments]"]=pK["[object Array]"]=pK["[object ArrayBuffer]"]=pK["[object Boolean]"]=pK["[object DataView]"]=pK["[object Date]"]=pK["[object Error]"]=pK["[object Function]"]=pK["[object Map]"]=pK["[object Number]"]=pK["[object Object]"]=pK["[object RegExp]"]=pK["[object Set]"]=pK["[object String]"]=pK["[object WeakMap]"]=!1;var dK=function(e){return Gq(e)&&nK(e.length)&&!!pK[VU(e)]};var hK=function(e){return function(t){return e(t)}},yK=n(39),mK=yK.a&&yK.a.isTypedArray,bK=mK?hK(mK):dK;var vK=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]},gK=Object.prototype.hasOwnProperty;var wK=function(e,t,n){var r=e[t];gK.call(e,t)&&wU(r,n)&&(void 0!==n||t in e)||Mq(e,t,n)};var _K=function(e,t,n,r){var o=!n;n||(n={});for(var i=-1,a=t.length;++i-1&&e%1==0&&e0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(NK);var VK=function(e,t){return HK(FK(e,t,LK),e+"")};function WK(e){return(WK="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var UK=function(e,t,n){if(!UU(n))return!1;var r=WK(t);return!!("number"==r?rK(n)&&PK(t,n.length):"string"==r&&t in n)&&wU(n[t],e)};var qK=function(e){return VK((function(t,n){var r=-1,o=n.length,i=o>1?n[o-1]:void 0,a=o>2?n[2]:void 0;for(i=e.length>3&&"function"==typeof i?(o--,i):void 0,a&&UK(n[0],n[1],a)&&(i=o<3?void 0:i,o=1),t=Object(t);++r=t||n<0||f&&e-s>=i}function m(){var e=ZK();if(y(e))return b(e);u=setTimeout(m,function(e){var n=t-(e-l);return f?a$(n,i-(e-s)):n}(e))}function b(e){return u=void 0,p&&r?d(e):(r=o=void 0,a)}function v(){var e=ZK(),n=y(e);if(r=arguments,o=this,l=e,n){if(void 0===u)return h(l);if(f)return clearTimeout(u),u=setTimeout(m,t),d(l)}return void 0===u&&(u=setTimeout(m,t)),a}return t=o$(t)||0,UU(n)&&(c=!!n.leading,i=(f="maxWait"in n)?i$(o$(n.maxWait)||0,t):i,p="trailing"in n?!!n.trailing:p),v.cancel=function(){void 0!==u&&clearTimeout(u),s=0,r=l=o=u=void 0},v.flush=function(){return void 0===u?a:b(ZK())},v};var l$=function(e,t,n){var r=!0,o=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return UU(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),u$(e,t,{leading:r,maxWait:t,trailing:o})},s$=function(){function e(e,t){for(var n=0;no&&(l=o),s<0?s=0:s>i&&(s=i);var c=l/o,f=1-s/i;return{h:t.h,s:c,v:f,a:t.a,source:"hsv"}}(e,n.props.hsl,n.container),e)},n.handleMouseDown=function(e){n.handleChange(e);var t=n.getContainerRenderWindow();t.addEventListener("mousemove",n.handleChange),t.addEventListener("mouseup",n.handleMouseUp)},n.handleMouseUp=function(){n.unbindEventListeners()},n.throttle=l$((function(e,t,n){e(t,n)}),50),n}return function(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)}(t,e),s$(t,[{key:"componentWillUnmount",value:function(){this.throttle.cancel(),this.unbindEventListeners()}},{key:"getContainerRenderWindow",value:function(){for(var e=this.container,t=window;!t.document.contains(e)&&t.parent!==t;)t=t.parent;return t}},{key:"unbindEventListeners",value:function(){var e=this.getContainerRenderWindow();e.removeEventListener("mousemove",this.handleChange),e.removeEventListener("mouseup",this.handleMouseUp)}},{key:"render",value:function(){var e=this,t=this.props.style||{},n=t.color,r=t.white,o=t.black,i=t.pointer,a=t.circle,u=QW()({default:{color:{absolute:"0px 0px 0px 0px",background:"hsl("+this.props.hsl.h+",100%, 50%)",borderRadius:this.props.radius},white:{absolute:"0px 0px 0px 0px",borderRadius:this.props.radius},black:{absolute:"0px 0px 0px 0px",boxShadow:this.props.shadow,borderRadius:this.props.radius},pointer:{position:"absolute",top:-100*this.props.hsv.v+100+"%",left:100*this.props.hsv.s+"%",cursor:"default"},circle:{width:"4px",height:"4px",boxShadow:"0 0 0 1.5px #fff, inset 0 0 1px 1px rgba(0,0,0,.3),\n 0 0 1px 2px rgba(0,0,0,.4)",borderRadius:"50%",cursor:"hand",transform:"translate(-2px, -2px)"}},custom:{color:n,white:r,black:o,pointer:i,circle:a}},{custom:!!this.props.style});return y.a.createElement("div",{style:u.color,ref:function(t){return e.container=t},onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange},y.a.createElement("style",null,"\n .saturation-white {\n background: -webkit-linear-gradient(to right, #fff, rgba(255,255,255,0));\n background: linear-gradient(to right, #fff, rgba(255,255,255,0));\n }\n .saturation-black {\n background: -webkit-linear-gradient(to top, #000, rgba(0,0,0,0));\n background: linear-gradient(to top, #000, rgba(0,0,0,0));\n }\n "),y.a.createElement("div",{style:u.white,className:"saturation-white"},y.a.createElement("div",{style:u.black,className:"saturation-black"}),y.a.createElement("div",{style:u.pointer},this.props.pointer?y.a.createElement(this.props.pointer,this.props):y.a.createElement("div",{style:u.circle}))))}}]),t}(h.PureComponent||h.Component);var f$=function(e,t){for(var n=-1,r=null==e?0:e.length;++n=128?"#000":"#fff"},P$=function(e,t){var n=e.replace("°","");return w$()(t+" ("+n+")")._ok},j$=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:"span";return function(n){function r(){var e,t,n;D$(this,r);for(var o=arguments.length,i=Array(o),a=0;au))return!1;var s=i.get(e);if(s&&i.get(t))return s==t;var c=-1,f=!0,p=2&n?new V$:void 0;for(i.set(e,t),i.set(t,e);++c1&&(e.a=1),n.props.onChange({h:n.props.hsl.h,s:n.props.hsl.s,l:n.props.hsl.l,a:Math.round(100*e.a)/100,source:"rgb"},t)):(e.h||e.s||e.l)&&("string"==typeof e.s&&e.s.includes("%")&&(e.s=e.s.replace("%","")),"string"==typeof e.l&&e.l.includes("%")&&(e.l=e.l.replace("%","")),1==e.s?e.s=.01:1==e.l&&(e.l=.01),n.props.onChange({h:e.h||n.props.hsl.h,s:Number(kZ(e.s)?n.props.hsl.s:e.s),l:Number(kZ(e.l)?n.props.hsl.l:e.l),source:"hsl"},t))},n.showHighlight=function(e){e.currentTarget.style.background="#eee"},n.hideHighlight=function(e){e.currentTarget.style.background="transparent"},1!==e.hsl.a&&"hex"===e.view?n.state={view:"rgb"}:n.state={view:e.view},n}return function(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)}(t,e),EZ(t,[{key:"render",value:function(){var e=this,t=QW()({default:{wrap:{paddingTop:"16px",display:"flex"},fields:{flex:"1",display:"flex",marginLeft:"-6px"},field:{paddingLeft:"6px",width:"100%"},alpha:{paddingLeft:"6px",width:"100%"},toggle:{width:"32px",textAlign:"right",position:"relative"},icon:{marginRight:"-4px",marginTop:"12px",cursor:"pointer",position:"relative"},iconHighlight:{position:"absolute",width:"24px",height:"28px",background:"#eee",borderRadius:"4px",top:"10px",left:"12px",display:"none"},input:{fontSize:"11px",color:"#333",width:"100%",borderRadius:"2px",border:"none",boxShadow:"inset 0 0 0 1px #dadada",height:"21px",textAlign:"center"},label:{textTransform:"uppercase",fontSize:"11px",lineHeight:"11px",color:"#969696",textAlign:"center",display:"block",marginTop:"12px"},svg:{fill:"#333",width:"24px",height:"24px",border:"1px transparent solid",borderRadius:"5px"}},disableAlpha:{alpha:{display:"none"}}},this.props,this.state),n=void 0;return"hex"===this.state.view?n=y.a.createElement("div",{style:t.fields,className:"flexbox-fix"},y.a.createElement("div",{style:t.field},y.a.createElement(dU,{style:{input:t.input,label:t.label},label:"hex",value:this.props.hex,onChange:this.handleChange}))):"rgb"===this.state.view?n=y.a.createElement("div",{style:t.fields,className:"flexbox-fix"},y.a.createElement("div",{style:t.field},y.a.createElement(dU,{style:{input:t.input,label:t.label},label:"r",value:this.props.rgb.r,onChange:this.handleChange})),y.a.createElement("div",{style:t.field},y.a.createElement(dU,{style:{input:t.input,label:t.label},label:"g",value:this.props.rgb.g,onChange:this.handleChange})),y.a.createElement("div",{style:t.field},y.a.createElement(dU,{style:{input:t.input,label:t.label},label:"b",value:this.props.rgb.b,onChange:this.handleChange})),y.a.createElement("div",{style:t.alpha},y.a.createElement(dU,{style:{input:t.input,label:t.label},label:"a",value:this.props.rgb.a,arrowOffset:.01,onChange:this.handleChange}))):"hsl"===this.state.view&&(n=y.a.createElement("div",{style:t.fields,className:"flexbox-fix"},y.a.createElement("div",{style:t.field},y.a.createElement(dU,{style:{input:t.input,label:t.label},label:"h",value:Math.round(this.props.hsl.h),onChange:this.handleChange})),y.a.createElement("div",{style:t.field},y.a.createElement(dU,{style:{input:t.input,label:t.label},label:"s",value:Math.round(100*this.props.hsl.s)+"%",onChange:this.handleChange})),y.a.createElement("div",{style:t.field},y.a.createElement(dU,{style:{input:t.input,label:t.label},label:"l",value:Math.round(100*this.props.hsl.l)+"%",onChange:this.handleChange})),y.a.createElement("div",{style:t.alpha},y.a.createElement(dU,{style:{input:t.input,label:t.label},label:"a",value:this.props.hsl.a,arrowOffset:.01,onChange:this.handleChange})))),y.a.createElement("div",{style:t.wrap,className:"flexbox-fix"},n,y.a.createElement("div",{style:t.toggle},y.a.createElement("div",{style:t.icon,onClick:this.toggleViews,ref:function(t){return e.icon=t}},y.a.createElement(jZ.a,{style:t.svg,onMouseOver:this.showHighlight,onMouseEnter:this.showHighlight,onMouseOut:this.hideHighlight}))))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return 1!==e.hsl.a&&"hex"===t.view?{view:"rgb"}:null}}]),t}(y.a.Component);CZ.defaultProps={view:"hex"};var xZ=CZ,TZ=function(){var e=QW()({default:{picker:{width:"12px",height:"12px",borderRadius:"6px",transform:"translate(-6px, -1px)",backgroundColor:"rgb(248, 248, 248)",boxShadow:"0 1px 4px 0 rgba(0, 0, 0, 0.37)"}}});return y.a.createElement("div",{style:e.picker})},DZ=function(){var e=QW()({default:{picker:{width:"12px",height:"12px",borderRadius:"6px",boxShadow:"inset 0 0 0 1px #fff",transform:"translate(-6px, -6px)"}}});return y.a.createElement("div",{style:e.picker})},RZ=function(e){var t=e.width,n=e.onChange,r=e.disableAlpha,o=e.rgb,i=e.hsl,a=e.hsv,u=e.hex,l=e.renderers,s=e.styles,c=void 0===s?{}:s,f=e.className,p=void 0===f?"":f,d=e.defaultView,h=QW()(KK({default:{picker:{width:t,background:"#fff",borderRadius:"2px",boxShadow:"0 0 2px rgba(0,0,0,.3), 0 4px 8px rgba(0,0,0,.3)",boxSizing:"initial",fontFamily:"Menlo"},saturation:{width:"100%",paddingBottom:"55%",position:"relative",borderRadius:"2px 2px 0 0",overflow:"hidden"},Saturation:{radius:"2px 2px 0 0"},body:{padding:"16px 16px 12px"},controls:{display:"flex"},color:{width:"32px"},swatch:{marginTop:"6px",width:"16px",height:"16px",borderRadius:"8px",position:"relative",overflow:"hidden"},active:{absolute:"0px 0px 0px 0px",borderRadius:"8px",boxShadow:"inset 0 0 0 1px rgba(0,0,0,.1)",background:"rgba("+o.r+", "+o.g+", "+o.b+", "+o.a+")",zIndex:"2"},toggles:{flex:"1"},hue:{height:"10px",position:"relative",marginBottom:"8px"},Hue:{radius:"2px"},alpha:{height:"10px",position:"relative"},Alpha:{radius:"2px"}},disableAlpha:{color:{width:"22px"},alpha:{display:"none"},hue:{marginBottom:"0px"},swatch:{width:"10px",height:"10px",marginTop:"0px"}}},c),{disableAlpha:r});return y.a.createElement("div",{style:h.picker,className:"chrome-picker "+p},y.a.createElement("div",{style:h.saturation},y.a.createElement(c$,{style:h.Saturation,hsl:i,hsv:a,pointer:DZ,onChange:n})),y.a.createElement("div",{style:h.body},y.a.createElement("div",{style:h.controls,className:"flexbox-fix"},y.a.createElement("div",{style:h.color},y.a.createElement("div",{style:h.swatch},y.a.createElement("div",{style:h.active}),y.a.createElement(oU,{renderers:l}))),y.a.createElement("div",{style:h.toggles},y.a.createElement("div",{style:h.hue},y.a.createElement(vU,{style:h.Hue,hsl:i,pointer:TZ,onChange:n})),y.a.createElement("div",{style:h.alpha},y.a.createElement(sU,{style:h.Alpha,rgb:o,hsl:i,pointer:TZ,renderers:l,onChange:n})))),y.a.createElement(xZ,{rgb:o,hsl:i,hex:u,view:d,onChange:n,disableAlpha:r})))};RZ.propTypes={width:ul.a.oneOfType([ul.a.string,ul.a.number]),disableAlpha:ul.a.bool,styles:ul.a.object,defaultView:ul.a.oneOf(["hex","rgb","hsl"])},RZ.defaultProps={width:225,disableAlpha:!1,styles:{}};C$(RZ);var MZ=function(e){var t=e.color,n=e.onClick,r=void 0===n?function(){}:n,o=e.onSwatchHover,i=e.active,a=QW()({default:{color:{background:t,width:"15px",height:"15px",float:"left",marginRight:"5px",marginBottom:"5px",position:"relative",cursor:"pointer"},dot:{absolute:"5px 5px 5px 5px",background:k$(t),borderRadius:"50%",opacity:"0"}},active:{dot:{opacity:"1"}},"color-#FFFFFF":{color:{boxShadow:"inset 0 0 0 1px #ddd"},dot:{background:"#000"}},transparent:{dot:{background:"#000"}}},{active:i,"color-#FFFFFF":"#FFFFFF"===t,transparent:"transparent"===t});return y.a.createElement(L$,{style:a.color,color:t,onClick:r,onHover:o,focusStyle:{boxShadow:"0 0 4px "+t}},y.a.createElement("div",{style:a.dot}))},AZ=function(e){var t=e.hex,n=e.rgb,r=e.onChange,o=QW()({default:{fields:{display:"flex",paddingBottom:"6px",paddingRight:"5px",position:"relative"},active:{position:"absolute",top:"6px",left:"5px",height:"9px",width:"9px",background:t},HEXwrap:{flex:"6",position:"relative"},HEXinput:{width:"80%",padding:"0px",paddingLeft:"20%",border:"none",outline:"none",background:"none",fontSize:"12px",color:"#333",height:"16px"},HEXlabel:{display:"none"},RGBwrap:{flex:"3",position:"relative"},RGBinput:{width:"70%",padding:"0px",paddingLeft:"30%",border:"none",outline:"none",background:"none",fontSize:"12px",color:"#333",height:"16px"},RGBlabel:{position:"absolute",top:"3px",left:"0px",lineHeight:"16px",textTransform:"uppercase",fontSize:"12px",color:"#999"}}}),i=function(e,t){e.r||e.g||e.b?r({r:e.r||n.r,g:e.g||n.g,b:e.b||n.b,source:"rgb"},t):r({hex:e.hex,source:"hex"},t)};return y.a.createElement("div",{style:o.fields,className:"flexbox-fix"},y.a.createElement("div",{style:o.active}),y.a.createElement(dU,{style:{wrap:o.HEXwrap,input:o.HEXinput,label:o.HEXlabel},label:"hex",value:t,onChange:i}),y.a.createElement(dU,{style:{wrap:o.RGBwrap,input:o.RGBinput,label:o.RGBlabel},label:"r",value:n.r,onChange:i}),y.a.createElement(dU,{style:{wrap:o.RGBwrap,input:o.RGBinput,label:o.RGBlabel},label:"g",value:n.g,onChange:i}),y.a.createElement(dU,{style:{wrap:o.RGBwrap,input:o.RGBinput,label:o.RGBlabel},label:"b",value:n.b,onChange:i}))},LZ=function(e){var t=e.onChange,n=e.onSwatchHover,r=e.colors,o=e.hex,i=e.rgb,a=e.styles,u=void 0===a?{}:a,l=e.className,s=void 0===l?"":l,c=QW()(KK({default:{Compact:{background:"#f6f6f6",radius:"4px"},compact:{paddingTop:"5px",paddingLeft:"5px",boxSizing:"initial",width:"240px"},clear:{clear:"both"}}},u)),f=function(e,n){e.hex?S$(e.hex)&&t({hex:e.hex,source:"hex"},n):t(e,n)};return y.a.createElement(GK,{style:c.Compact,styles:u},y.a.createElement("div",{style:c.compact,className:"compact-picker "+s},y.a.createElement("div",null,eZ(r,(function(e){return y.a.createElement(MZ,{key:e,color:e,active:e.toLowerCase()===o,onClick:f,onSwatchHover:n})})),y.a.createElement("div",{style:c.clear})),y.a.createElement(AZ,{hex:o,rgb:i,onChange:f})))};LZ.propTypes={colors:ul.a.arrayOf(ul.a.string),styles:ul.a.object},LZ.defaultProps={colors:["#4D4D4D","#999999","#FFFFFF","#F44E3B","#FE9200","#FCDC00","#DBDF00","#A4DD00","#68CCCA","#73D8FF","#AEA1FF","#FDA1FF","#333333","#808080","#cccccc","#D33115","#E27300","#FCC400","#B0BC00","#68BC00","#16A5A5","#009CE0","#7B64FF","#FA28FF","#000000","#666666","#B3B3B3","#9F0500","#C45100","#FB9E00","#808900","#194D33","#0C797D","#0062B1","#653294","#AB149E"],styles:{}};C$(LZ);var IZ=Object(JW.handleHover)((function(e){var t=e.hover,n=e.color,r=e.onClick,o=e.onSwatchHover,i={position:"relative",zIndex:"2",outline:"2px solid #fff",boxShadow:"0 0 5px 2px rgba(0,0,0,0.25)"},a=QW()({default:{swatch:{width:"25px",height:"25px",fontSize:"0"}},hover:{swatch:i}},{hover:t});return y.a.createElement("div",{style:a.swatch},y.a.createElement(L$,{color:n,onClick:r,onHover:o,focusStyle:i}))})),zZ=function(e){var t=e.width,n=e.colors,r=e.onChange,o=e.onSwatchHover,i=e.triangle,a=e.styles,u=void 0===a?{}:a,l=e.className,s=void 0===l?"":l,c=QW()(KK({default:{card:{width:t,background:"#fff",border:"1px solid rgba(0,0,0,0.2)",boxShadow:"0 3px 12px rgba(0,0,0,0.15)",borderRadius:"4px",position:"relative",padding:"5px",display:"flex",flexWrap:"wrap"},triangle:{position:"absolute",border:"7px solid transparent",borderBottomColor:"#fff"},triangleShadow:{position:"absolute",border:"8px solid transparent",borderBottomColor:"rgba(0,0,0,0.15)"}},"hide-triangle":{triangle:{display:"none"},triangleShadow:{display:"none"}},"top-left-triangle":{triangle:{top:"-14px",left:"10px"},triangleShadow:{top:"-16px",left:"9px"}},"top-right-triangle":{triangle:{top:"-14px",right:"10px"},triangleShadow:{top:"-16px",right:"9px"}},"bottom-left-triangle":{triangle:{top:"35px",left:"10px",transform:"rotate(180deg)"},triangleShadow:{top:"37px",left:"9px",transform:"rotate(180deg)"}},"bottom-right-triangle":{triangle:{top:"35px",right:"10px",transform:"rotate(180deg)"},triangleShadow:{top:"37px",right:"9px",transform:"rotate(180deg)"}}},u),{"hide-triangle":"hide"===i,"top-left-triangle":"top-left"===i,"top-right-triangle":"top-right"===i,"bottom-left-triangle":"bottom-left"===i,"bottom-right-triangle":"bottom-right"===i}),f=function(e,t){return r({hex:e,source:"hex"},t)};return y.a.createElement("div",{style:c.card,className:"github-picker "+s},y.a.createElement("div",{style:c.triangleShadow}),y.a.createElement("div",{style:c.triangle}),eZ(n,(function(e){return y.a.createElement(IZ,{color:e,key:e,onClick:f,onSwatchHover:o})})))};zZ.propTypes={width:ul.a.oneOfType([ul.a.string,ul.a.number]),colors:ul.a.arrayOf(ul.a.string),triangle:ul.a.oneOf(["hide","top-left","top-right","bottom-left","bottom-right"]),styles:ul.a.object},zZ.defaultProps={width:200,colors:["#B80000","#DB3E00","#FCCB00","#008B02","#006B76","#1273DE","#004DCF","#5300EB","#EB9694","#FAD0C3","#FEF3BD","#C1E1C5","#BEDADC","#C4DEF6","#BED3F3","#D4C4FB"],triangle:"top-left",styles:{}};C$(zZ);var FZ=function(e){var t=e.direction,n=QW()({default:{picker:{width:"18px",height:"18px",borderRadius:"50%",transform:"translate(-9px, -1px)",backgroundColor:"rgb(248, 248, 248)",boxShadow:"0 1px 4px 0 rgba(0, 0, 0, 0.37)"}},vertical:{picker:{transform:"translate(-3px, -9px)"}}},{vertical:"vertical"===t});return y.a.createElement("div",{style:n.picker})},YZ=Object.assign||function(e){for(var t=1;t.5});return y.a.createElement("div",{style:n.picker})},VZ=function(){var e=QW()({default:{triangle:{width:0,height:0,borderStyle:"solid",borderWidth:"4px 0 4px 6px",borderColor:"transparent transparent transparent #fff",position:"absolute",top:"1px",left:"1px"},triangleBorder:{width:0,height:0,borderStyle:"solid",borderWidth:"5px 0 5px 8px",borderColor:"transparent transparent transparent #555"},left:{Extend:"triangleBorder",transform:"translate(-13px, -4px)"},leftInside:{Extend:"triangle",transform:"translate(-8px, -5px)"},right:{Extend:"triangleBorder",transform:"translate(20px, -14px) rotate(180deg)"},rightInside:{Extend:"triangle",transform:"translate(-8px, -5px)"}}});return y.a.createElement("div",{style:e.pointer},y.a.createElement("div",{style:e.left},y.a.createElement("div",{style:e.leftInside})),y.a.createElement("div",{style:e.right},y.a.createElement("div",{style:e.rightInside})))},WZ=function(e){var t=e.onClick,n=e.label,r=e.children,o=e.active,i=QW()({default:{button:{backgroundImage:"linear-gradient(-180deg, #FFFFFF 0%, #E6E6E6 100%)",border:"1px solid #878787",borderRadius:"2px",height:"20px",boxShadow:"0 1px 0 0 #EAEAEA",fontSize:"14px",color:"#000",lineHeight:"20px",textAlign:"center",marginBottom:"10px",cursor:"pointer"}},active:{button:{boxShadow:"0 0 0 1px #878787"}}},{active:o});return y.a.createElement("div",{style:i.button,onClick:t},n||r)},UZ=function(e){var t=e.rgb,n=e.currentColor,r=QW()({default:{swatches:{border:"1px solid #B3B3B3",borderBottom:"1px solid #F0F0F0",marginBottom:"2px",marginTop:"1px"},new:{height:"34px",background:"rgb("+t.r+","+t.g+", "+t.b+")",boxShadow:"inset 1px 0 0 #000, inset -1px 0 0 #000, inset 0 1px 0 #000"},current:{height:"34px",background:n,boxShadow:"inset 1px 0 0 #000, inset -1px 0 0 #000, inset 0 -1px 0 #000"},label:{fontSize:"14px",color:"#000",textAlign:"center"}}});return y.a.createElement("div",null,y.a.createElement("div",{style:r.label},"new"),y.a.createElement("div",{style:r.swatches},y.a.createElement("div",{style:r.new}),y.a.createElement("div",{style:r.current})),y.a.createElement("div",{style:r.label},"current"))},qZ=function(){function e(e,t){for(var n=0;n100&&(e.a=100),e.a/=100,t({h:r.h,s:r.s,l:r.l,a:e.a,source:"rgb"},o))};return y.a.createElement("div",{style:a.fields,className:"flexbox-fix"},y.a.createElement("div",{style:a.double},y.a.createElement(dU,{style:{input:a.input,label:a.label},label:"hex",value:o.replace("#",""),onChange:u})),y.a.createElement("div",{style:a.single},y.a.createElement(dU,{style:{input:a.input,label:a.label},label:"r",value:n.r,onChange:u,dragLabel:"true",dragMax:"255"})),y.a.createElement("div",{style:a.single},y.a.createElement(dU,{style:{input:a.input,label:a.label},label:"g",value:n.g,onChange:u,dragLabel:"true",dragMax:"255"})),y.a.createElement("div",{style:a.single},y.a.createElement(dU,{style:{input:a.input,label:a.label},label:"b",value:n.b,onChange:u,dragLabel:"true",dragMax:"255"})),y.a.createElement("div",{style:a.alpha},y.a.createElement(dU,{style:{input:a.input,label:a.label},label:"a",value:Math.round(100*n.a),onChange:u,dragLabel:"true",dragMax:"100"})))},GZ=Object.assign||function(e){for(var t=1;t1?this.handleIconClick:void 0,placeholder:i,type:"email",valid:n&&!this.showError,value:this.value})}},{key:"isValidValue",get:function(){return!this.value||hQ.a.validate(this.value)}}])&&vQ(t.prototype,n),r&&vQ(t,r),i}(y.a.Component),cQ.defaultProps={disabled:!1,valid:!0},lQ=kQ((uQ=fQ).prototype,"value",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),sQ=kQ(uQ.prototype,"showError",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),kQ(uQ.prototype,"setValue",[v.d],Object.getOwnPropertyDescriptor(uQ.prototype,"setValue"),uQ.prototype),kQ(uQ.prototype,"setShowError",[v.d],Object.getOwnPropertyDescriptor(uQ.prototype,"setShowError"),uQ.prototype),kQ(uQ.prototype,"isValidValue",[v.g],Object.getOwnPropertyDescriptor(uQ.prototype,"isValidValue"),uQ.prototype),aQ=uQ))||aQ;function jQ(e){return(jQ="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function EQ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function CQ(e,t){for(var n=0;n1?this.handleIconClick:void 0,placeholder:i,type:"tel",valid:n,value:l})}}])&&BX(t.prototype,n),r&&BX(t,r),i}(y.a.PureComponent);qX.defaultProps={disabled:!1,valid:!0};var KX=qX;function $X(e){return($X="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function GX(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ZX(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0?a:void 0),o()};var n=t.props,r=n.onChange,a=n.schemaOptions,u=n.value,l=a.default_values,s=(l=void 0===l?{}:l).value;if(null==s)return P0(t);if(!Array.isArray(s))throw new Error('The "default_values" schema option must be an array!');var c=s.map((function(e){var t=e.name;if("number"!=typeof t&&"string"!=typeof t)throw new Error('A single schema option of "default_values" must be a string or number');return t}));return void 0===u&&r(c),t}return t=i,(n=[{key:"render",value:function(){var e=this.props,t=e.disabled,n=e.value;return y.a.createElement(w0,{disabled:!!t,onChange:this.handleChange,values:n||[]},this.values.map((function(e){var t=e.name,n=e.title;if("string"!=typeof t&&"number"!=typeof t)throw new Error('The children of "values" must only contain values of type string or number!');return y.a.createElement(w0.Option,{key:t,value:t},n)})))}},{key:"values",get:function(){var e=this.props.schemaOptions.values;if(!e||!Array.isArray(e.value))throw new Error('The "values" option has to be set for the Select FieldType');return e.value}}])&&O0(t.prototype,n),r&&O0(t,r),i}(y.a.Component)).prototype,"values",[v.g],Object.getOwnPropertyDescriptor(g0.prototype,"values"),g0.prototype),g0),M0=n(181),A0=n.n(M0);function L0(e){return(L0="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function I0(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0}},{key:"enableRefreshButton",get:function(){return!this.enableAutoGeneration&&((this.inputChangedSinceRefresh||this.partsChangedSinceRefresh)&&Object.keys(this.parts).length>0)}}]),I1(n,[{key:"componentWillUnmount",value:function(){this.partsChangeDisposer&&this.partsChangeDisposer()}},{key:"render",value:function(){if(!this.mode)return null;var e=this.props.fieldTypeOptions,t=e.historyResourceKey,n=e.options,r=void 0===n?{}:n;if(!t||"string"!=typeof t)throw new Error('The "historyResourceKey" field type option must be set to a string!');if("object"!==D1(r))throw new Error('The "options" field type must be an object if given!');var o=this.props,i=o.dataPath,a=o.disabled,u=o.formInspector,l=o.value;return"/"===l?"/":y.a.createElement(h.Fragment,null,y.a.createElement(e1,{disabled:!!a,id:i,mode:this.mode,onBlur:this.handleInputBlur,onChange:this.handleInputChange,value:l}),y.a.createElement("div",{className:E1.a.buttonsContainer},y.a.createElement(Ii,{className:E1.a.refreshButton,disabled:!this.enableRefreshButton,icon:"su-sync",onClick:this.handleRefreshButtonClick,skin:"link"},Nr("sulu_admin.refresh_url")),y.a.createElement(P1,{id:u.id,options:x1({locale:u.locale,resourceKey:u.resourceKey,webspace:u.options.webspace},r),resourceKey:t})))}}]),n}(y.a.Component),v1=H1((b1=k1).prototype,"mode",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),g1=H1(b1.prototype,"inputChanged",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),w1=H1(b1.prototype,"inputChangedSinceRefresh",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),_1=H1(b1.prototype,"partsChangedSinceRefresh",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),H1(b1.prototype,"parts",[v.g],Object.getOwnPropertyDescriptor(b1.prototype,"parts"),b1.prototype),H1(b1.prototype,"enableAutoGeneration",[v.g],Object.getOwnPropertyDescriptor(b1.prototype,"enableAutoGeneration"),b1.prototype),H1(b1.prototype,"enableRefreshButton",[v.g],Object.getOwnPropertyDescriptor(b1.prototype,"enableRefreshButton"),b1.prototype),O1=H1(b1.prototype,"refreshResourceLocator",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){var t=e.props,n=t.fieldTypeOptions,r=n.generationUrl,o=n.resourceStorePropertiesToRequest,i=void 0===o?{}:o,a=t.formInspector,u=t.onChange,l=x1({},a.options);Object.entries(i).forEach((function(e){var t=M1(e,2),n=t[0],r=t[1],o=Object(v.u)(a.getValueByPath("/"+n));void 0!==o&&(l[r]=o)})),e.inputChangedSinceRefresh=!1,e.partsChangedSinceRefresh=!1,G.post(r,x1({parts:e.parts,resourceKey:a.resourceKey,locale:a.locale?a.locale.get():void 0},l)).then(Object(v.d)((function(e){u(e.resourcelocator)})))}}}),S1=H1(b1.prototype,"handleInputChange",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){var n=e.props.onChange;e.inputChanged=!0,e.inputChangedSinceRefresh=!0,n(t)}}}),m1=b1))||m1;function W1(e,t){for(var n=0;n0?t[0].name:void 0,sortBy:n.sorting.length>0?n.sorting[0].name:void 0,sortMethod:n.sorting.length>0?"asc":void 0,tagOperator:n.tags?"or":void 0,tags:void 0}}}])&&W1(t.prototype,n),r&&W1(t,r),e}());function s2(e){return function(e){if(Array.isArray(e))return c2(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return c2(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return c2(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c2(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0?this.categories.map((function(e){return e.id})):void 0,categoryOperator:this.categoryOperator,dataSource:this.dataSource?this.dataSource.id:void 0,includeSubFolders:this.includeSubElements,limitResult:this.limit,sortBy:this.sortBy,sortMethod:this.sortOrder,tagOperator:this.tagOperator,tags:this.tags&&this.tags.length>0?Object(v.u)(this.tags):void 0,presentAs:this.presentation}}}])&&h2(t.prototype,n),r&&h2(t,r),e}()).prototype,"items",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),K1=y2(U1.prototype,"itemsLoading",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),$1=y2(U1.prototype,"categoriesLoading",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),G1=y2(U1.prototype,"dataSourceLoading",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Z1=y2(U1.prototype,"dataSource",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),J1=y2(U1.prototype,"includeSubElements",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Q1=y2(U1.prototype,"categories",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),X1=y2(U1.prototype,"categoryOperator",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),e2=y2(U1.prototype,"tags",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),t2=y2(U1.prototype,"tagOperator",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),n2=y2(U1.prototype,"audienceTargeting",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),r2=y2(U1.prototype,"sortBy",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),o2=y2(U1.prototype,"sortOrder",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),i2=y2(U1.prototype,"presentation",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),a2=y2(U1.prototype,"limit",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),u2=y2(U1.prototype,"excludedIds",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),y2(U1.prototype,"setItems",[v.d],Object.getOwnPropertyDescriptor(U1.prototype,"setItems"),U1.prototype),y2(U1.prototype,"setItemsLoading",[v.d],Object.getOwnPropertyDescriptor(U1.prototype,"setItemsLoading"),U1.prototype),y2(U1.prototype,"setExcludedIds",[v.d],Object.getOwnPropertyDescriptor(U1.prototype,"setExcludedIds"),U1.prototype),y2(U1.prototype,"loading",[v.g],Object.getOwnPropertyDescriptor(U1.prototype,"loading"),U1.prototype),y2(U1.prototype,"filterCriteria",[v.g],Object.getOwnPropertyDescriptor(U1.prototype,"filterCriteria"),U1.prototype),U1),Z2=n(15),J2=n.n(Z2);function Q2(e){return(Q2="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function X2(e,t,n,r){n&&Object.defineProperty(e,t,{enumerable:n.enumerable,configurable:n.configurable,writable:n.writable,value:n.initializer?n.initializer.call(r):void 0})}function e3(e,t){for(var n=0;n=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function p3(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d3(e,t){for(var n=0;n0&&this.sections.push("sorting"),this.config.presentAs&&this.props.presentations.length>0&&this.sections.push("presentation"),this.config.limit&&this.sections.push("limit")}},{key:"render",value:function(){var e=this.props,t=e.categoryRootKey,n=e.defaultValue,r=e.disabled,o=e.fieldLabel,i=e.onItemClick,a=e.store,u=this.props.presentations.reduce((function(e,t){return e[t.name]=t.value,e}),{});return y.a.createElement(h.Fragment,null,y.a.createElement(jN,{disabled:r,label:Nr("sulu_admin.smart_content_label",{count:a.items.length}),leftButton:{icon:"su-filter",onClick:this.handleFilterClick},loading:a.itemsLoading||a.loading,onItemClick:i,sortable:!1},a.items.map((function(e,t){return y.a.createElement(jN.Item,{id:e.id,index:t+1,key:t,value:e},y.a.createElement(P3,{item:e}))}))),y.a.createElement(u3,{categoryRootKey:t,dataSourceAdapter:this.config.datasourceAdapter,dataSourceListKey:this.config.datasourceListKey,dataSourceResourceKey:this.config.datasourceResourceKey,defaultValue:n,onClose:this.handleFilterOverlayClose,open:this.showFilterOverlay,presentations:u,sections:this.sections,smartContentStore:a,sortings:this.config.sorting,title:Nr("sulu_admin.filter_overlay_title",{fieldLabel:o||""})}))}}])&&C3(t.prototype,n),r&&C3(t,r),i}(y.a.Component),S3.defaultProps={disabled:!1,presentations:[]},w3=A3((g3=k3).prototype,"showFilterOverlay",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),A3(g3.prototype,"initialize",[v.d],Object.getOwnPropertyDescriptor(g3.prototype,"initialize"),g3.prototype),_3=A3(g3.prototype,"handleFilterClick",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){e.showFilterOverlay=!0}}}),O3=A3(g3.prototype,"handleFilterOverlayClose",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){e.showFilterOverlay=!1}}}),v3=g3))||v3;function F3(e){return function(e){if(Array.isArray(e))return N3(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||Y3(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Y3(e,t){if(e){if("string"==typeof e)return N3(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?N3(e,t):void 0}}function N3(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}(this.stores);try{for(r.s();!(t=r.n()).done;){var o=t.value;if(o===e)break;o.provider===e.provider&&n.push(o)}}catch(e){r.e(e)}finally{r.f()}return n}}]),e}()).prototype,"entries",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),V3(L3.prototype,"stores",[v.g],Object.getOwnPropertyDescriptor(L3.prototype,"stores"),L3.prototype),V3(L3.prototype,"add",[v.d],Object.getOwnPropertyDescriptor(L3.prototype,"add"),L3.prototype),V3(L3.prototype,"remove",[v.d],Object.getOwnPropertyDescriptor(L3.prototype,"remove"),L3.prototype),L3);function q3(e){return(q3="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function K3(e,t){for(var n=0;n=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function j5(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function E5(e,t){for(var n=0;n-1}}])&&q4(t.prototype,n),r&&q4(t,r),e}()),G4=n(408),Z4=n.n(G4);function J4(e){return(J4="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Q4(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function X4(e,t){for(var n=0;n=this.expandedWidth}}])&&V8(t.prototype,n),r&&V8(t,r),i}(y.a.Component),R8.defaultProps={skin:"light"},x8=G8((C8=M8).prototype,"expandedWidth",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),T8=G8(C8.prototype,"parentWidth",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),G8(C8.prototype,"componentDidUpdate",[v.d],Object.getOwnPropertyDescriptor(C8.prototype,"componentDidUpdate"),C8.prototype),D8=G8(C8.prototype,"setDimensions",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){var t=e.parentRef,n=e.childRef;n&&(e.showText||n.offsetWidth>e.expandedWidth)&&(e.expandedWidth=n.offsetWidth),t&&(e.parentWidth=t.offsetWidth)}}}),G8(C8.prototype,"showText",[v.g],Object.getOwnPropertyDescriptor(C8.prototype,"showText"),C8.prototype),E8=C8))||E8,J8=n(131),Q8=n.n(J8);function X8(e){return(X8="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function e7(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t7(e,t){for(var n=0;n=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var V9="dropdown",W9="select",U9="toggler";var q9=Ht((x9=C9=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&L9(e,t)}(i,e);var t,n,r,o=I9(i);function i(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(t=o.call(this,e)).setStore=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";T9.hasStore(e)?t.toolbarStore=T9.getStore(e):t.toolbarStore=T9.createStore(e)},function(e,t,n,r){n&&Object.defineProperty(e,t,{enumerable:n.enumerable,configurable:n.configurable,writable:n.writable,value:n.initializer?n.initializer.call(r):void 0})}(t,"handleErrorSnackbarCloseClick",E9,F9(t)),t.setStore(t.props.storeKey),t}return t=i,(n=[{key:"componentDidUpdate",value:function(e){e.storeKey&&this.setStore(e.storeKey)}},{key:"render",value:function(){var e=this.props,t=e.onNavigationButtonClick,n=e.navigationOpen,r=this.toolbarStore,o=r.errors,i=r.showSuccess,a=r.warnings,u=this.toolbarStore.getIconsConfig(),l=this.toolbarStore.getItemsConfig(),s=this.toolbarStore.getLocaleConfig();return y.a.createElement(h.Fragment,null,y.a.createElement(_9,{message:o[o.length-1],onCloseClick:this.handleErrorSnackbarCloseClick,type:"error",visible:o.length>0}),y.a.createElement(_9,{message:a[a.length-1],type:"warning",visible:a.length>0}),y.a.createElement(o9,null,y.a.createElement(o9.Controls,{grow:!0},!!t&&y.a.createElement(o9.Button,{disabled:!t,icon:i?"su-check":n?"su-times":"su-bars",onClick:t,primary:!0,success:i}),!!this.backButtonConfig&&y.a.createElement(o9.Button,B9({},this.backButtonConfig,{icon:!t&&i?"su-check":"su-angle-left",success:!t&&i})),l.length>0&&y.a.createElement(o9.Items,null,this.itemsConfig.map((function(e,t){return function(e,t){switch(e.type){case W9:e.type;var n=H9(e,["type"]);return y.a.createElement(o9.Select,B9({},n,{key:t}));case V9:e.type;var r=H9(e,["type"]);return y.a.createElement(o9.Dropdown,B9({},r,{key:t}));case U9:e.type;var o=H9(e,["type"]);return y.a.createElement(o9.Toggler,B9({},o,{key:t}));default:e.type;var i=H9(e,["type"]);return y.a.createElement(o9.Button,B9({},i,{key:t}))}}(e,t)})))),y.a.createElement(o9.Controls,null,u.length>0&&y.a.createElement(o9.Icons,null,u.map((function(e){return Object(v.u)(e)}))),!!s&&y.a.createElement(o9.Select,B9({className:R9.a.locale,size:"small"},s)))))}},{key:"disableAllButtons",get:function(){var e=this.toolbarStore.getItemsConfig().filter((function(e){return e.loading}));return this.toolbarStore.disableAll||e.length>0}},{key:"backButtonConfig",get:function(){var e=this.toolbarStore.getBackButtonConfig();if(e)return this.disableAllButtons&&(e.disabled=!0),e}},{key:"itemsConfig",get:function(){var e=this.toolbarStore.getItemsConfig();return this.disableAllButtons&&e.forEach((function(e){e.disabled=!0})),e}}])&&A9(t.prototype,n),r&&A9(t,r),i}(y.a.Component),C9.defaultProps={navigationOpen:!1},E9=N9((j9=x9).prototype,"handleErrorSnackbarCloseClick",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){e.toolbarStore.errors.pop()}}}),N9(j9.prototype,"disableAllButtons",[v.g],Object.getOwnPropertyDescriptor(j9.prototype,"disableAllButtons"),j9.prototype),N9(j9.prototype,"backButtonConfig",[v.g],Object.getOwnPropertyDescriptor(j9.prototype,"backButtonConfig"),j9.prototype),N9(j9.prototype,"itemsConfig",[v.g],Object.getOwnPropertyDescriptor(j9.prototype,"itemsConfig"),j9.prototype),P9=j9))||P9;function K9(e){return(K9="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function $9(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function G9(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:"default",r=function(e){Q9(o,e);var r=eee(o);function o(){return $9(this,o),r.apply(this,arguments)}return Z9(o,[{key:"componentDidMount",value:function(){var e=this;J9(nee(o.prototype),"componentDidMount",this)&&J9(nee(o.prototype),"componentDidMount",this).call(this);var r=this.props.router,i=Object(v.e)((function(){var r=t.call(e);T9.setToolbarConfig(n,r),d.a.info((o.displayName||"")+' configured toolbar "'+n+'"',r)}));this.updateRouteHookDisposer=r.addUpdateRouteHook((function(e,t){var n=r.attributes,o=r.route;return Re(e,t)!==Re(o,n)&&i(),!0}),1024)}},{key:"componentWillUnmount",value:function(){J9(nee(o.prototype),"componentWillUnmount",this)&&J9(nee(o.prototype),"componentWillUnmount",this).call(this),this.updateRouteHookDisposer(),T9.setToolbarConfig(n,{})}}]),o}(e);return r.displayName=i6("withToolbar",e),r}var oee=q9;function iee(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:null,n=this.props.router,r=this.getView(e),o=y.a.createElement(r,{key:Re(e,n.attributes),route:e,router:n},(function(e){return t?y.a.cloneElement(t,e):null}));return e.parent?this.renderView(e.parent,o):o}},{key:"render",value:function(){return this.renderView(this.props.router.route)}}])&&hee(t.prototype,n),r&&hee(t,r),i}(y.a.Component))||cee,Pee=(n(651),n(24)),jee=n.n(Pee);function Eee(e){return(Eee="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Cee(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xee(e,t,n,r){n&&Object.defineProperty(e,t,{enumerable:n.enumerable,configurable:n.configurable,writable:n.writable,value:n.initializer?n.initializer.call(r):void 0})}function Tee(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}(o);try{for(a.s();!(i=a.n()).done;){var u=i.value,l=this.tabWidths.get(u);if(void 0===l){if(r.length>0)break;return this.childIndices}if(n+l>this.tabsContainerWrapperWidth)break;n+=l,r=[].concat($te(r),[u])}}catch(e){a.e(e)}finally{a.f()}return r.sort((function(e,t){return e-t})),r}},{key:"collapsedTabIndices",get:function(){var e=this.visibleTabIndices;return this.childIndices.filter((function(t){return!e.includes(t)}))}},{key:"hasCollapsedTabs",get:function(){return this.collapsedTabIndices.length>0}}])&&Xte(t.prototype,n),r&&Xte(t,r),i}(y.a.Component),Nte.defaultProps={skin:"default",small:!1},Nte.Tab=nte,Pte=ine((kte=Bte).prototype,"tabsWidth",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),jte=ine(kte.prototype,"tabsContainerWrapperWidth",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),Ete=ine(kte.prototype,"tabsContainerWidth",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),Cte=ine(kte.prototype,"tabWidths",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return new Map}}),xte=ine(kte.prototype,"tabRefs",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return new Map}}),Tte=ine(kte.prototype,"dropdownOpen",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),Dte=ine(kte.prototype,"lastSelectedIndex",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Rte=ine(kte.prototype,"setTabsWidth",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){if(e.tabsRef){var t=e.tabsRef.offsetWidth,n=window.getComputedStyle(e.tabsRef);e.tabsWidth!==t&&(e.tabsWidth=t-parseFloat(n.paddingLeft)-parseFloat(n.paddingRight))}}}}),Mte=ine(kte.prototype,"setTabsContainerWrapperWidth",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){if(e.tabsContainerWrapperRef){var t=e.tabsContainerWrapperRef.offsetWidth;e.tabsContainerWrapperWidth!==t&&(e.tabsContainerWrapperWidth=t)}}}}),Ate=ine(kte.prototype,"setTabsContainerWidth",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){if(e.tabsContainerRef){var t=e.tabsContainerRef.offsetWidth;e.tabsContainerWidth!==t&&(e.tabsContainerWidth=t)}}}}),Lte=ine(kte.prototype,"updateTabWidths",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){e.tabRefs.forEach((function(t,n){if(t){var r=t.offsetWidth;e.tabWidths.get(n)!==r&&e.tabWidths.set(n,r)}}))}}}),Ite=ine(kte.prototype,"setTabRef",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t,n){e.tabRefs.get(t)!==n&&e.tabRefs.set(t,n)}}}),zte=ine(kte.prototype,"handleDropdownToggle",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){e.dropdownOpen=!e.dropdownOpen}}}),Fte=ine(kte.prototype,"handleDropdownClose",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){e.dropdownOpen=!1}}}),Yte=ine(kte.prototype,"handleCollapsedTabClick",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){e.dropdownOpen=!1,e.lastSelectedIndex=t,e.changeTab(t)}}}),ine(kte.prototype,"visibleTabIndices",[v.g],Object.getOwnPropertyDescriptor(kte.prototype,"visibleTabIndices"),kte.prototype),ine(kte.prototype,"collapsedTabIndices",[v.g],Object.getOwnPropertyDescriptor(kte.prototype,"collapsedTabIndices"),kte.prototype),ine(kte.prototype,"hasCollapsedTabs",[v.g],Object.getOwnPropertyDescriptor(kte.prototype,"hasCollapsedTabs"),kte.prototype),Ste=kte))||Ste,fne=n(411),pne=n.n(fne);function dne(e){return(dne="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function hne(e,t){for(var n=0;n=(void 0===o?0:o)?e:t}),void 0)}},{key:"routeChildren",get:function(){var e=this.props,t=e.route;return e.routeChildren||t.children}},{key:"sortedTabRoutes",get:function(){return this.routeChildren.concat().sort((function(e,t){var n=e.options.tabOrder,r=void 0===n?0:n,o=t.options.tabOrder;return r-(void 0===o?0:o)}))}}])&&hne(t.prototype,n),r&&hne(t,r),i}(y.a.Component),lne.defaultProps={childrenProps:{}},gne((une=sne).prototype,"tabRouteWithHighestPriority",[v.g],Object.getOwnPropertyDescriptor(une.prototype,"tabRouteWithHighestPriority"),une.prototype),gne(une.prototype,"routeChildren",[v.g],Object.getOwnPropertyDescriptor(une.prototype,"routeChildren"),une.prototype),gne(une.prototype,"sortedTabRoutes",[v.g],Object.getOwnPropertyDescriptor(une.prototype,"sortedTabRoutes"),une.prototype),ane=une))||ane,kne=n(412),Pne=n.n(kne);function jne(e){return(jne="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ene(){return(Ene=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0])||arguments[0];if(!r.list)throw new Error("List not created yet.");r.list.requestSelectionDelete(e)},r.reload=function(){r.listStore.reload()},r.setListRef=function(e){r.list=e};var o=r.props,i=o.locale,a=o.router,u=a.attributes,l=a.route.options,s=l.adapters,c=l.requestParameters,f=void 0===c?{}:c,p=l.listKey,d=l.resourceKey,h=l.routerAttributesToListRequest,y=void 0===h?{}:h,m=l.resourceStorePropertiesToListRequest,b=void 0===m?{}:m,g=l.userSettingsKey,w=void 0===g?"list":g,_=l.routerAttributesToListMetadata,O=void 0===_?{}:_,S=l.resourceStorePropertiesToListMetadata,k=void 0===S?{}:S;if(!d)throw new Error('The route does not define the mandatory "resourceKey" option');if(!p)throw new Error('The route does not define the mandatory "listKey" option');if(!s)throw new Error('The route does not define the mandatory "adapters" option');r.locale=i||v.q.box();var P={};a.bind("page",r.page,1),P.page=r.page,r.locales&&(a.bind("locale",r.locale),P.locale=r.locale);var j=r.buildListStoreOptions(f,u,y,b,e.resourceStore),E=r.buildMetadataOptions(u,O,k,e.resourceStore);return r.listStore=new r_(d,p,w,P,j,E),a.bind("active",r.listStore.active),a.bind("sortColumn",r.listStore.sortColumn),a.bind("sortOrder",r.listStore.sortOrder),a.bind("search",r.listStore.searchTerm),a.bind("limit",r.listStore.limit,10),a.bind("filter",r.listStore.filterOptions,{}),r}return Xne(n,[{key:"locales",get:function(){var e=this.props,t=e.locales,n=e.router.route.options.locales;return n||t}}],[{key:"getDerivedRouteAttributes",value:function(e){var t=e.options,n=t.listKey,r=t.userSettingsKey,o=void 0===r?"list":r,i=r_.getLimitSetting(n,o);return{active:r_.getActiveSetting(n,o),filter:r_.getFilterSetting(n,o),sortColumn:r_.getSortColumnSetting(n,o),sortOrder:r_.getSortOrderSetting(n,o),limit:10===i?void 0:i}}}]),Xne(n,[{key:"buildMetadataOptions",value:function(e,t,n,r){var o={};return t=Object(v.u)(t),Object.keys(t).forEach((function(n){var r=t[n],i=isNaN(n)?n:t[n];o[r]=e[i]})),n=Object(v.u)(n),Object.keys(n).forEach((function(e){var t=n[e],i=isNaN(e)?e:n[e];r&&r.data&&(o[t]=r.data[i])})),o}},{key:"buildListStoreOptions",value:function(e,t,n,r,o){var i=e||{};return n=Object(v.u)(n),Object.keys(n).forEach((function(e){var r=n[e],o=isNaN(e)?e:n[e];i[r]=t[o]})),r=Object(v.u)(r),Object.keys(r).forEach((function(e){var t=r[e],n=isNaN(e)?e:r[e];o&&o.data&&(i[t]=o.data[n])})),i}},{key:"componentDidMount",value:function(){var e=this,t=this.props,n=t.resourceStore,r=t.router,o=r.route.options,i=o.locales,a=o.toolbarActions,u=void 0===a?[]:a,l=o.itemActions,s=void 0===l?[]:l;u.forEach((function(t){if("object"!==Zne(t))throw new Error("The value of a toolbarAction entry must be an object, but "+Zne(t)+" was given!");e.toolbarActions.push(new(Yne.get(t.type))(e.listStore,e,r,i,n,t.options))})),s.forEach((function(t){if("object"!==Zne(t))throw new Error("The value of a itemAction entry must be an object, but "+Zne(t)+" was given!");e.itemActions.push(new(Gne.get(t.type))(e.listStore,e,r,i,n,t.options))}))}},{key:"componentDidUpdate",value:function(e){var t=this.props.router.route.options.locales,n=e.router.route.options.prevLocales;J()(t,n)||(this.toolbarActions.forEach((function(e){e.setLocales(t)})),this.itemActions.forEach((function(e){e.setLocales(t)})))}},{key:"componentWillUnmount",value:function(){this.listStore.destroy(),this.toolbarActions.forEach((function(e){return e.destroy()}))}},{key:"render",value:function(){var e=this.props,t=e.onItemAdd,n=e.onItemClick,r=e.router.route.options,o=r.adapters,i=r.addView,a=r.editView,u=r.itemDisabledCondition,l=r.searchable,s=r.selectable,c=r.title,f=e.title,p=c?Nr(c):f;return y.a.createElement(h.Fragment,null,y.a.createElement(OY,{adapters:o,header:p&&y.a.createElement("h1",null,p),itemActionsProvider:this.getItemActionConfigs,itemDisabledCondition:u,onItemAdd:t||i?this.addItem:void 0,onItemClick:n||a?this.handleItemClick:void 0,ref:this.setListRef,searchable:l,selectable:s,store:this.listStore}),this.toolbarActions.map((function(e){return e.getNode()})),this.itemActions.map((function(e){return e.getNode()})))}}]),n}(y.a.Component),Une=ire((Wne=$ne).prototype,"toolbarActions",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),qne=ire(Wne.prototype,"itemActions",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),Kne=ire(Wne.prototype,"errors",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),ire(Wne.prototype,"locales",[v.g],Object.getOwnPropertyDescriptor(Wne.prototype,"locales"),Wne.prototype),ire(Wne.prototype,"componentDidMount",[v.d],Object.getOwnPropertyDescriptor(Wne.prototype,"componentDidMount"),Wne.prototype),Vne=Wne))||Vne,(function(){var e=this,t=this.errors,n=this.props.router,r=n.route.options.backView;return{backButton:r?{onClick:function(){var t={};e.locale&&(t.locale=e.locale.get()),n.restore(r,t)}}:void 0,errors:t,locale:this.locales?{value:this.locale.get(),onChange:Object(v.d)((function(t){e.locale.set(t)})),options:this.locales.map((function(e){return{value:e,label:e}}))}:void 0,items:this.toolbarActions.map((function(e){return e.getToolbarItemConfig()})).filter((function(e){return null!=e}))}}));function ure(e){return(ure="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function lre(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function sre(e,t){for(var n=0;n0?t:void 0,r=e.listStore.searchTerm.get();window.location.assign(qr.getListUrl(e.listStore.resourceKey,loe(loe({_format:"csv",locale:e.list.locale.get(),flat:!0,delimiter:e.delimiter,escape:e.escape,enclosure:e.enclosure,newLine:e.newLine},e.listStore.options),{},{filter:n,search:r}))),e.showOverlay=!1}}}),Ure),woe=are;var _oe= /** * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license @@ -437,96 +437,96 @@ function(){return function e(){e.called=!0}}; * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -var poe=function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.source=t,this.name=n,this.path=[],this.stop=foe(),this.off=foe()},doe=new Array(256).fill().map((function(e,t){return("0"+t.toString(16)).slice(-2)})); +var Ooe=function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.source=t,this.name=n,this.path=[],this.stop=_oe(),this.off=_oe()},Soe=new Array(256).fill().map((function(e,t){return("0"+t.toString(16)).slice(-2)})); /** * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */function hoe(){var e=4294967296*Math.random()>>>0,t=4294967296*Math.random()>>>0,n=4294967296*Math.random()>>>0,r=4294967296*Math.random()>>>0;return"e"+doe[e>>0&255]+doe[e>>8&255]+doe[e>>16&255]+doe[e>>24&255]+doe[t>>0&255]+doe[t>>8&255]+doe[t>>16&255]+doe[t>>24&255]+doe[n>>0&255]+doe[n>>8&255]+doe[n>>16&255]+doe[n>>24&255]+doe[r>>0&255]+doe[r>>8&255]+doe[r>>16&255]+doe[r>>24&255]} + */function koe(){var e=4294967296*Math.random()>>>0,t=4294967296*Math.random()>>>0,n=4294967296*Math.random()>>>0,r=4294967296*Math.random()>>>0;return"e"+Soe[e>>0&255]+Soe[e>>8&255]+Soe[e>>16&255]+Soe[e>>24&255]+Soe[t>>0&255]+Soe[t>>8&255]+Soe[t>>16&255]+Soe[t>>24&255]+Soe[n>>0&255]+Soe[n>>8&255]+Soe[n>>16&255]+Soe[n>>24&255]+Soe[r>>0&255]+Soe[r>>8&255]+Soe[r>>16&255]+Soe[r>>24&255]} /** * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */var yoe={get:function(e){return"number"!=typeof e?this[e]||this.normal:e},highest:1e5,high:1e3,normal:0,low:-1e3,lowest:-1e5},moe=(n(88),n(2));function boe(e){return function(e){if(Array.isArray(e))return _oe(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||woe(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function voe(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n}(e,t)||woe(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function goe(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=woe(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function woe(e,t){if(e){if("string"==typeof e)return _oe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_oe(e,t):void 0}}function _oe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Toe(e,t){if(e){if("string"==typeof e)return Doe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Doe(e,t):void 0}}function Doe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:{};this.listenTo(this,e,t,n)},once:function(e,t,n){var r=!1;this.listenTo(this,e,(function(e){if(!r){r=!0,e.off();for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i3&&void 0!==arguments[3]?arguments[3]:{};this[Ooe]||(this[Ooe]={});var a=this[Ooe];joe(e)||Poe(e);var u=joe(e);(r=a[u])||(r=a[u]={emitter:e,callbacks:{}}),(o=r.callbacks[t])||(o=r.callbacks[t]=[]),o.push(n),Coe(e,t);var l,s=xoe(e,t),c=yoe.get(i.priority),f={callback:n,priority:c},p=goe(s);try{for(p.s();!(l=p.n()).done;){for(var d=l.value,h=!1,y=0;y1?o-1:0),a=1;a-1?Toe(e,t.substr(0,t.lastIndexOf(":"))):null}function Doe(e,t,n){var r,o=goe(e);try{for(o.s();!(r=o.n()).done;){var i=voe(r.value,2),a=i[0],u=i[1];u?"function"==typeof u&&(u=u(t.name)):u=t.name;var l=new poe(t.source,u);l.path=boe(t.path),a.fire.apply(a,[l].concat(boe(n)))}}catch(e){o.e(e)}finally{o.f()}}function Roe(e,t,n){var r,o=goe(xoe(e,t));try{for(o.s();!(r=o.n()).done;)for(var i=r.value,a=0;ae.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:{};this.listenTo(this,e,t,n)},once:function(e,t,n){var r=!1;this.listenTo(this,e,(function(e){if(!r){r=!0,e.off();for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i3&&void 0!==arguments[3]?arguments[3]:{};this[Roe]||(this[Roe]={});var a=this[Roe];Ioe(e)||Loe(e);var u=Ioe(e);(r=a[u])||(r=a[u]={emitter:e,callbacks:{}}),(o=r.callbacks[t])||(o=r.callbacks[t]=[]),o.push(n),Foe(e,t);var l,s=Yoe(e,t),c=Poe.get(i.priority),f={callback:n,priority:c},p=xoe(s);try{for(p.s();!(l=p.n()).done;){for(var d=l.value,h=!1,y=0;y1?o-1:0),a=1;a-1?Noe(e,t.substr(0,t.lastIndexOf(":"))):null}function Boe(e,t,n){var r,o=xoe(e);try{for(o.s();!(r=o.n()).done;){var i=Coe(r.value,2),a=i[0],u=i[1];u?"function"==typeof u&&(u=u(t.name)):u=t.name;var l=new Ooe(t.source,u);l.path=Eoe(t.path),a.fire.apply(a,[l].concat(Eoe(n)))}}catch(e){o.e(e)}finally{o.f()}}function Hoe(e,t,n){var r,o=xoe(Yoe(e,t));try{for(o.s();!(r=o.n()).done;)for(var i=r.value,a=0;ae.length)&&(t=e.length);for(var n=0,r=new Array(t);n1)throw new moe.a("observable-bind-to-no-callback",this);if(r>1&&t.callback)throw new moe.a("observable-bind-to-extra-callback",this);t.to.forEach((function(t){if(t.properties.length&&t.properties.length!==r)throw new moe.a("observable-bind-to-properties-length",e);t.properties.length||(t.properties=e._bindProperties)})),this._to=t.to,t.callback&&(this._bindings.get(n[0]).callback=t.callback),Goe(this._observable,this._to),Koe(this),this._bindProperties.forEach((function(t){$oe(e._observable,t)}))}function Woe(e,t,n){if(this._bindings.size>1)throw new moe.a("observable-bind-to-many-not-one-binding",this);this.to.apply(this,Loe(function(e,t){var n=e.map((function(e){return[e,t]}));return Array.prototype.concat.apply([],n)}(e,t)).concat([n]))}function Uoe(e){return e.every((function(e){return"string"==typeof e}))}function qoe(){for(var e=arguments.length,t=new Array(e),n=0;n1)throw new joe.a("observable-bind-to-no-callback",this);if(r>1&&t.callback)throw new joe.a("observable-bind-to-extra-callback",this);t.to.forEach((function(t){if(t.properties.length&&t.properties.length!==r)throw new joe.a("observable-bind-to-properties-length",e);t.properties.length||(t.properties=e._bindProperties)})),this._to=t.to,t.callback&&(this._bindings.get(n[0]).callback=t.callback),iie(this._observable,this._to),rie(this),this._bindProperties.forEach((function(t){oie(e._observable,t)}))}function eie(e,t,n){if(this._bindings.size>1)throw new joe.a("observable-bind-to-many-not-one-binding",this);this.to.apply(this,Uoe(function(e,t){var n=e.map((function(e){return[e,t]}));return Array.prototype.concat.apply([],n)}(e,t)).concat([n]))}function tie(e){return e.every((function(e){return"string"==typeof e}))}function nie(){for(var e=arguments.length,t=new Array(e),n=0;n1?t-1:0),r=1;r1?t-1:0),r=1;r=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function lie(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function vie(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:{},n=this.editor,r=n.locale,o=n.model,i=o.document,a=t.value;o.change((function(t){var n=Array.from(i.selection.getSelectedBlocks()).filter((function(t){return e._canBeAligned(t)})),o=n[0].getAttribute("alignment");aie(a,r)||o===a||!a?bie(n,t):vie(n,t,a)}))}},{key:"_canBeAligned",value:function(e){return this.editor.model.schema.checkAttribute(e,"alignment")}}])&&fie(t.prototype,n),r&&fie(t,r),i}(tie);function bie(e,t){var n,r=uie(e);try{for(r.s();!(n=r.n()).done;){var o=n.value;t.removeAttribute("alignment",o)}}catch(e){r.e(e)}finally{r.f()}}function vie(e,t,n){var r,o=uie(e);try{for(o.s();!(r=o.n()).done;){var i=r.value;t.setAttribute("alignment",n,i)}}catch(e){o.e(e)}finally{o.f()}}function gie(e){return(gie="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function wie(e){return function(e){if(Array.isArray(e))return Oie(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||_ie(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _ie(e,t){if(e){if("string"==typeof e)return Oie(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Oie(e,t):void 0}}function Oie(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:{},n=this.editor,r=n.locale,o=n.model,i=o.document,a=t.value;o.change((function(t){var n=Array.from(i.selection.getSelectedBlocks()).filter((function(t){return e._canBeAligned(t)})),o=n[0].getAttribute("alignment");mie(a,r)||o===a||!a?Eie(n,t):Cie(n,t,a)}))}},{key:"_canBeAligned",value:function(e){return this.editor.model.schema.checkAttribute(e,"alignment")}}])&&_ie(t.prototype,n),r&&_ie(t,r),i}(fie);function Eie(e,t){var n,r=bie(e);try{for(r.s();!(n=r.n()).done;){var o=n.value;t.removeAttribute("alignment",o)}}catch(e){r.e(e)}finally{r.f()}}function Cie(e,t,n){var r,o=bie(e);try{for(o.s();!(r=o.n()).done;){var i=r.value;t.setAttribute("alignment",n,i)}}catch(e){o.e(e)}finally{o.f()}}function xie(e){return(xie="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Tie(e){return function(e){if(Array.isArray(e))return Rie(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||Die(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Die(e,t){if(e){if("string"==typeof e)return Rie(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Rie(e,t):void 0}}function Rie(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}(e);try{for(r.s();!(t=r.n()).done;){var o=t.value;n.view[o]={key:"style",value:{"text-align":o}}}}catch(e){r.e(e)}finally{r.f()}return n} + */var Yie=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Lie(e,t)}(n,e);var t=Iie(n);function n(e){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),r=t.call(this,e),e.config.define("alignment",{options:Tie(hie)}),r}return Aie(n,null,[{key:"pluginName",get:function(){return"AlignmentEditing"}}]),Aie(n,[{key:"init",value:function(){var e=this.editor,t=e.locale,n=e.model.schema,r=e.config.get("alignment.options").filter(yie);n.extend("$block",{allowAttributes:"alignment"}),e.model.schema.setAttributeProperties("alignment",{isFormatting:!0});var o=function(e){var t,n={model:{key:"alignment",values:e.slice()},view:{}},r=function(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=Die(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}(e);try{for(r.s();!(t=r.n()).done;){var o=t.value;n.view[o]={key:"style",value:{"text-align":o}}}}catch(e){r.e(e)}finally{r.f()}return n} /** * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */(r.filter((function(e){return!aie(e,t)})));e.conversion.attributeToAttribute(o),e.commands.add("alignment",new mie(e))}}]),n}(Qoe);function Tie(e){return!(!e||!e[Symbol.iterator])}function Die(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n}(e,t)||Mie(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Rie(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=Mie(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Mie(e,t){if(e){if("string"==typeof e)return Aie(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Aie(e,t):void 0}}function Aie(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Vie(e,t){if(e){if("string"==typeof e)return Wie(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Wie(e,t):void 0}}function Wie(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Lie(this,e);var r=Tie(t);if(r||(n=t),this._items=[],this._itemMap=new Map,this._idProperty=n.idProperty||"id",this._bindToExternalToInternalMap=new WeakMap,this._bindToInternalToExternalMap=new WeakMap,this._skippedIndexesFromExternal=[],r){var o,i=Rie(t);try{for(i.s();!(o=i.n()).done;){var a=o.value;this._items.push(a),this._itemMap.set(this._getItemIdBeforeAdding(a),a)}}catch(e){i.e(e)}finally{i.f()}}}var t,n,r;return t=e,(n=[{key:"add",value:function(e,t){return this.addMany([e],t)}},{key:"addMany",value:function(e,t){if(void 0===t)t=this._items.length;else if(t>this._items.length||t<0)throw new moe.a("collection-add-item-invalid-index",this);for(var n=0;ns.value&&c--}catch(e){f.e(e)}finally{f.f()}var p,d=Rie(r._skippedIndexesFromExternal);try{for(d.s();!(p=d.n()).done;)c>=p.value&&c++}catch(e){d.e(e)}finally{d.f()}n._bindToExternalToInternalMap.set(o,l),n._bindToInternalToExternalMap.set(l,o),n.add(l,c);for(var h=0;ht&&e.push(t),e}),[])}))}},{key:"_getItemIdBeforeAdding",value:function(e){var t,n=this._idProperty;if(n in e){if("string"!=typeof(t=e[n]))throw new moe.a("collection-add-invalid-id",this);if(this.get(t))throw new moe.a("collection-add-item-already-exists",this)}else e[n]=t=hoe();return t}},{key:"_remove",value:function(e){var t,n,r,o=!1,i=this._idProperty;if("string"==typeof e?(n=e,o=!(r=this._itemMap.get(n)),r&&(t=this._items.indexOf(r))):"number"==typeof e?(t=e,o=!(r=this._items[t]),r&&(n=r[i])):(n=(r=e)[i],o=-1==(t=this._items.indexOf(r))||!this._itemMap.get(n)),o)throw new moe.a("collection-remove-404",this);this._items.splice(t,1),this._itemMap.delete(n);var a=this._bindToInternalToExternalMap.get(r);return this._bindToInternalToExternalMap.delete(r),this._bindToExternalToInternalMap.delete(a),this.fire("remove",r,t),[r,t]}},{key:Symbol.iterator,value:function(){return this._items[Symbol.iterator]()}},{key:"length",get:function(){return this._items.length}},{key:"first",get:function(){return this._items[0]||null}},{key:"last",get:function(){return this._items[this.length-1]||null}}])&&Iie(t.prototype,n),r&&Iie(t,r),e}();function Fie(e){return(Fie="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Yie(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Nie(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Nie(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Nie(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Uie(this,e);var r=Nie(t);if(r||(n=t),this._items=[],this._itemMap=new Map,this._idProperty=n.idProperty||"id",this._bindToExternalToInternalMap=new WeakMap,this._bindToInternalToExternalMap=new WeakMap,this._skippedIndexesFromExternal=[],r){var o,i=Hie(t);try{for(i.s();!(o=i.n()).done;){var a=o.value;this._items.push(a),this._itemMap.set(this._getItemIdBeforeAdding(a),a)}}catch(e){i.e(e)}finally{i.f()}}}var t,n,r;return t=e,(n=[{key:"add",value:function(e,t){return this.addMany([e],t)}},{key:"addMany",value:function(e,t){if(void 0===t)t=this._items.length;else if(t>this._items.length||t<0)throw new joe.a("collection-add-item-invalid-index",this);for(var n=0;ns.value&&c--}catch(e){f.e(e)}finally{f.f()}var p,d=Hie(r._skippedIndexesFromExternal);try{for(d.s();!(p=d.n()).done;)c>=p.value&&c++}catch(e){d.e(e)}finally{d.f()}n._bindToExternalToInternalMap.set(o,l),n._bindToInternalToExternalMap.set(l,o),n.add(l,c);for(var h=0;ht&&e.push(t),e}),[])}))}},{key:"_getItemIdBeforeAdding",value:function(e){var t,n=this._idProperty;if(n in e){if("string"!=typeof(t=e[n]))throw new joe.a("collection-add-invalid-id",this);if(this.get(t))throw new joe.a("collection-add-item-already-exists",this)}else e[n]=t=koe();return t}},{key:"_remove",value:function(e){var t,n,r,o=!1,i=this._idProperty;if("string"==typeof e?(n=e,o=!(r=this._itemMap.get(n)),r&&(t=this._items.indexOf(r))):"number"==typeof e?(t=e,o=!(r=this._items[t]),r&&(n=r[i])):(n=(r=e)[i],o=-1==(t=this._items.indexOf(r))||!this._itemMap.get(n)),o)throw new joe.a("collection-remove-404",this);this._items.splice(t,1),this._itemMap.delete(n);var a=this._bindToInternalToExternalMap.get(r);return this._bindToInternalToExternalMap.delete(r),this._bindToExternalToInternalMap.delete(a),this.fire("remove",r,t),[r,t]}},{key:Symbol.iterator,value:function(){return this._items[Symbol.iterator]()}},{key:"length",get:function(){return this._items.length}},{key:"first",get:function(){return this._items[0]||null}},{key:"last",get:function(){return this._items[this.length-1]||null}}])&&qie(t.prototype,n),r&&qie(t,r),e}();function $ie(e){return($ie="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Gie(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Zie(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Zie(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Zie(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:[];return Bie(this,i),(e=o.call(this,t,{idProperty:"viewUid"})).on("add",(function(t,n,r){e._renderViewIntoCollectionParent(n,r)})),e.on("remove",(function(t,n){n.element&&e._parentElement&&n.element.remove()})),e._parentElement=null,e}return t=i,(n=[{key:"destroy",value:function(){this.map((function(e){return e.destroy()}))}},{key:"setParent",value:function(e){this._parentElement=e;var t,n=Yie(this);try{for(n.s();!(t=n.n()).done;){var r=t.value;this._renderViewIntoCollectionParent(r)}}catch(e){n.e(e)}finally{n.f()}}},{key:"delegate",value:function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r0&&void 0!==arguments[0]?arguments[0]:[];return Jie(this,i),(e=o.call(this,t,{idProperty:"viewUid"})).on("add",(function(t,n,r){e._renderViewIntoCollectionParent(n,r)})),e.on("remove",(function(t,n){n.element&&e._parentElement&&n.element.remove()})),e._parentElement=null,e}return t=i,(n=[{key:"destroy",value:function(){this.map((function(e){return e.destroy()}))}},{key:"setParent",value:function(e){this._parentElement=e;var t,n=Gie(this);try{for(n.s();!(t=n.n()).done;){var r=t.value;this._renderViewIntoCollectionParent(r)}}catch(e){n.e(e)}finally{n.f()}}},{key:"delegate",value:function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Tae(e,t){if(e){if("string"==typeof e)return Dae(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Dae(e,t):void 0}}function Dae(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Nae(e,t){if(e){if("string"==typeof e)return Bae(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Bae(e,t):void 0}}function Bae(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1?n-1:0),o=1;o2&&void 0!==arguments[2]?arguments[2]:{};if(!this._domListeners||!this._domListeners[e]){var r={capture:!!n.useCapture,passive:!!n.usePassive},o=this._createDomListener(e,r);this._domNode.addEventListener(e,o,r),this._domListeners||(this._domListeners={}),this._domListeners[e]=o}},detach:function(e){var t;!this._domListeners[e]||(t=this._events[e])&&t.callbacks.length||this._domListeners[e].removeListener()},_createDomListener:function(e,t){var n=this,r=function(t){n.fire(e,t)};return r.removeListener=function(){n._domNode.removeEventListener(e,r,t),delete n._domListeners[e]},r}});n(652);function oue(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return iue(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return iue(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function iue(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1?n-1:0),o=1;o2&&void 0!==arguments[2]?arguments[2]:{};if(!this._domListeners||!this._domListeners[e]){var r={capture:!!n.useCapture,passive:!!n.usePassive},o=this._createDomListener(e,r);this._domNode.addEventListener(e,o,r),this._domListeners||(this._domListeners={}),this._domListeners[e]=o}},detach:function(e){var t;!this._domListeners[e]||(t=this._events[e])&&t.callbacks.length||this._domListeners[e].removeListener()},_createDomListener:function(e,t){var n=this,r=function(t){n.fire(e,t)};return r.removeListener=function(){n._domNode.removeEventListener(e,r,t),delete n._domListeners[e]},r}});n(652);function hue(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return yue(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return yue(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function yue(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0;)this.element.appendChild(e.childNodes[0])}}},{key:"_colorFillPaths",value:function(){var e=this;this.fillColor&&this.element.querySelectorAll(".ck-icon__fill").forEach((function(t){t.style.fill=e.fillColor}))}}])&&sue(t.prototype,n),r&&sue(t,r),i}(uue);n(654);function mue(e){return(mue="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function bue(e,t){return(bue=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function vue(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=wue(e);if(t){var o=wue(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return gue(this,n)}}function gue(e,t){return!t||"object"!==mue(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function wue(e){return(wue=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)} + */var Pue=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_ue(e,t)}(i,e);var t,n,r,o=Oue(i);function i(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i);var t=(e=o.call(this)).bindTemplate;return e.set("content",""),e.set("viewBox","0 0 20 20"),e.set("fillColor",""),e.setTemplate({tag:"svg",ns:"http://www.w3.org/2000/svg",attributes:{class:["ck","ck-icon"],viewBox:t.to("viewBox")}}),e}return t=i,(n=[{key:"render",value:function(){var e=this;wue(kue(i.prototype),"render",this).call(this),this._updateXMLContent(),this._colorFillPaths(),this.on("change:content",(function(){e._updateXMLContent(),e._colorFillPaths()})),this.on("change:fillColor",(function(){e._colorFillPaths()}))}},{key:"_updateXMLContent",value:function(){if(this.content){var e=(new DOMParser).parseFromString(this.content.trim(),"image/svg+xml").querySelector("svg"),t=e.getAttribute("viewBox");for(t&&(this.viewBox=t),this.element.innerHTML="";e.childNodes.length>0;)this.element.appendChild(e.childNodes[0])}}},{key:"_colorFillPaths",value:function(){var e=this;this.fillColor&&this.element.querySelectorAll(".ck-icon__fill").forEach((function(t){t.style.fill=e.fillColor}))}}])&&gue(t.prototype,n),r&&gue(t,r),i}(bue);n(654);function jue(e){return(jue="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Eue(e,t){return(Eue=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Cue(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Tue(e);if(t){var o=Tue(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return xue(this,n)}}function xue(e,t){return!t||"object"!==jue(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Tue(e){return(Tue=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)} /** * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */var _ue=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&bue(e,t)}(n,e);var t=vue(n);function n(e){var r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),(r=t.call(this,e)).set("text",""),r.set("position","s");var o=r.bindTemplate;return r.setTemplate({tag:"span",attributes:{class:["ck","ck-tooltip",o.to("position",(function(e){return"ck-tooltip_"+e})),o.if("text","ck-hidden",(function(e){return!e.trim()}))]},children:[{tag:"span",attributes:{class:["ck","ck-tooltip__text"]},children:[{text:o.to("text")}]}]}),r}return n}(uue),Oue=navigator.userAgent.toLowerCase(),Sue={isMac:function(e){return e.indexOf("macintosh")>-1}(Oue),isGecko:function(e){return!!e.match(/gecko\/\d+/)}(Oue),isSafari:function(e){return e.indexOf(" applewebkit/")>-1&&-1===e.indexOf("chrome")}(Oue),isAndroid:function(e){return e.indexOf("android")>-1}(Oue),isBlink:function(e){return e.indexOf("chrome/")>-1&&e.indexOf("edge/")<0}(Oue),features:{isRegExpUnicodePropertySupported:function(){var e=!1;try{e=0==="ć".search(new RegExp("[\\p{L}]","u"))}catch(e){}return e} + */var Due=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Eue(e,t)}(n,e);var t=Cue(n);function n(e){var r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),(r=t.call(this,e)).set("text",""),r.set("position","s");var o=r.bindTemplate;return r.setTemplate({tag:"span",attributes:{class:["ck","ck-tooltip",o.to("position",(function(e){return"ck-tooltip_"+e})),o.if("text","ck-hidden",(function(e){return!e.trim()}))]},children:[{tag:"span",attributes:{class:["ck","ck-tooltip__text"]},children:[{text:o.to("text")}]}]}),r}return n}(bue),Rue=navigator.userAgent.toLowerCase(),Mue={isMac:function(e){return e.indexOf("macintosh")>-1}(Rue),isGecko:function(e){return!!e.match(/gecko\/\d+/)}(Rue),isSafari:function(e){return e.indexOf(" applewebkit/")>-1&&-1===e.indexOf("chrome")}(Rue),isAndroid:function(e){return e.indexOf("android")>-1}(Rue),isBlink:function(e){return e.indexOf("chrome/")>-1&&e.indexOf("edge/")<0}(Rue),features:{isRegExpUnicodePropertySupported:function(){var e=!1;try{e=0==="ć".search(new RegExp("[\\p{L}]","u"))}catch(e){}return e} /** * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license @@ -534,134 +534,134 @@ var uue=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new T /** * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */var kue={"⌘":"ctrl","⇧":"shift","⌥":"alt"},Pue={ctrl:"⌘",shift:"⇧",alt:"⌥"},jue=function(){for(var e={arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,backspace:8,delete:46,enter:13,space:32,esc:27,tab:9,ctrl:1114112,cmd:1114112,shift:2228224,alt:4456448},t=65;t<=90;t++){var n=String.fromCharCode(t);e[n.toLowerCase()]=t}for(var r=48;r<=57;r++)e[r-48]=r;for(var o=112;o<=123;o++)e["f"+(o-111)]=o;return e}();function Eue(e){var t;if("string"==typeof e){if(!(t=jue[e.toLowerCase()]))throw new moe.a("keyboard-unknown-key",null,{key:e})}else t=e.keyCode+(e.altKey?jue.alt:0)+(e.ctrlKey?jue.ctrl:0)+(e.shiftKey?jue.shift:0);return t}function Cue(e){return"string"==typeof e&&(e=Mue(e)),e.map((function(e){return"string"==typeof e?Eue(e):e})).reduce((function(e,t){return t+e}),0)}function xue(e){return Sue.isMac?Mue(e).map((function(e){return Pue[e.toLowerCase()]||e})).reduce((function(e,t){return e.slice(-1)in kue?e+t:e+"+"+t})):e}function Tue(e){return e==jue.arrowright||e==jue.arrowleft||e==jue.arrowup||e==jue.arrowdown}function Due(e,t){var n="ltr"===t;switch(e){case jue.arrowleft:return n?"left":"right";case jue.arrowright:return n?"right":"left";case jue.arrowup:return"up";case jue.arrowdown:return"down"}}function Rue(e,t){var n=Due(e,t);return"down"===n||"right"===n}function Mue(e){return e.split(/\s*\+\s*/)}n(655);function Aue(e){return(Aue="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Lue(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{},r=Cue(e),o=n.priority;this._listener.listenTo(this._listener,"_keydown:"+r,(function(e,n){t(n,(function(){n.preventDefault(),n.stopPropagation(),e.stop()})),e.return=!0}),{priority:o})}},{key:"press",value:function(e){return!!this._listener.fire("_keydown:"+Eue(e),e)}},{key:"destroy",value:function(){this._listener.stopListening()}}])&&Zue(t.prototype,n),r&&Zue(t,r),e}(),Que=(n(656),{window:window,document:document}); +var ule=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._listener=Object.create(fue)}var t,n,r;return t=e,(n=[{key:"listenTo",value:function(e){var t=this;this._listener.listenTo(e,"keydown",(function(e,n){t._listener.fire("_keydown:"+zue(n),n)}))}},{key:"set",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=Fue(e),o=n.priority;this._listener.listenTo(this._listener,"_keydown:"+r,(function(e,n){t(n,(function(){n.preventDefault(),n.stopPropagation(),e.stop()})),e.return=!0}),{priority:o})}},{key:"press",value:function(e){return!!this._listener.fire("_keydown:"+zue(e),e)}},{key:"destroy",value:function(){this._listener.stopListening()}}])&&ale(t.prototype,n),r&&ale(t,r),e}(),lle=(n(656),{window:window,document:document}); /** * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -function Xue(e){return"[object Range]"==Object.prototype.toString.apply(e)} +function sle(e){return"[object Range]"==Object.prototype.toString.apply(e)} /** * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */function ele(e){var t=e.ownerDocument.defaultView.getComputedStyle(e);return{top:parseInt(t.borderTopWidth,10),right:parseInt(t.borderRightWidth,10),bottom:parseInt(t.borderBottomWidth,10),left:parseInt(t.borderLeftWidth,10)}} + */function cle(e){var t=e.ownerDocument.defaultView.getComputedStyle(e);return{top:parseInt(t.borderTopWidth,10),right:parseInt(t.borderRightWidth,10),bottom:parseInt(t.borderBottomWidth,10),left:parseInt(t.borderLeftWidth,10)}} /** * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */function tle(e){return"[object Text]"==Object.prototype.toString.call(e)}var nle=function(e){return Yq(e)&&1===e.nodeType&&!tK(e)};function rle(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return ole(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ole(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function ole(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function hle(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function fle(e,t){return function(e){if(Array.isArray(e))return e} + */function wle(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=Ole(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function _le(e,t){return function(e){if(Array.isArray(e))return e} /** * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n}(e,t)||ple(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ple(e,t){if(e){if("string"==typeof e)return dle(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?dle(e,t):void 0}}function dle(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ni&&(i=p,n=s,r=l)}}catch(e){a.e(e)}finally{a.f()}return n?[r,n]:null}function ble(e){var t=e.left,n=e.top,r=Que.window;return{left:t+r.scrollX,top:n+r.scrollY}}function vle(e){return(vle="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function gle(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ni&&(i=p,n=s,r=l)}}catch(e){a.e(e)}finally{a.f()}return n?[r,n]:null}function Ele(e){var t=e.left,n=e.top,r=lle.window;return{left:t+r.scrollX,top:n+r.scrollY}}function Cle(e){return(Cle="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function xle(e,t){for(var n=0;n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Yle(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Gle(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Zle(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function ase(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function ose(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function hse(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=n.ungroupedItems.length?n.groupedItems.remove(a):n.ungroupedItems.remove(a)}}catch(e){i.e(e)}finally{i.f()}for(var u=o;un.ungroupedItems.length?n.groupedItems.add(l,u-n.ungroupedItems.length):n.ungroupedItems.add(l,u)}n._updateGrouping()})),t.extendTemplate({attributes:{class:["ck-toolbar_grouping"]}})}return use(e,[{key:"render",value:function(e){this.viewElement=e.element,this._enableGroupingOnResize(),this._enableGroupingOnMaxWidthChange(e)}},{key:"destroy",value:function(){this.groupedItemsDropdown.destroy(),this.resizeObserver.destroy()}},{key:"_updateGrouping",value:function(){if(this.viewElement.ownerDocument.body.contains(this.viewElement))if(this.viewElement.offsetParent){for(var e,t=this.groupedItems.length;this._areItemsOverflowing;)this._groupLastItem(),e=!0;if(!e&&this.groupedItems.length){for(;this.groupedItems.length&&!this._areItemsOverflowing;)this._ungroupFirstItem();this._areItemsOverflowing&&this._groupLastItem()}this.groupedItems.length!==t&&this.view.fire("groupedItemsUpdate")}else this.shouldUpdateGroupingOnNextResize=!0}},{key:"_enableGroupingOnResize",value:function(){var e,t=this;this.resizeObserver=new ese(this.viewElement,(function(n){e&&e===n.contentRect.width&&!t.shouldUpdateGroupingOnNextResize||(t.shouldUpdateGroupingOnNextResize=!1,t._updateGrouping(),e=n.contentRect.width)})),this._updateGrouping()}},{key:"_enableGroupingOnMaxWidthChange",value:function(e){var t=this;e.on("change:maxWidth",(function(){t._updateGrouping()}))}},{key:"_groupLastItem",value:function(){this.groupedItems.length||(this.viewChildren.add(new $le),this.viewChildren.add(this.groupedItemsDropdown),this.viewFocusTracker.add(this.groupedItemsDropdown.element)),this.groupedItems.add(this.ungroupedItems.remove(this.ungroupedItems.last),0)}},{key:"_ungroupFirstItem",value:function(){this.ungroupedItems.add(this.groupedItems.remove(this.groupedItems.first)),this.groupedItems.length||(this.viewChildren.remove(this.groupedItemsDropdown),this.viewChildren.remove(this.viewChildren.last),this.viewFocusTracker.remove(this.groupedItemsDropdown.element))}},{key:"_createGroupedItemsDropdown",value:function(){var e=this.viewLocale,t=e.t,n=ece(e);return n.class="ck-toolbar__grouped-dropdown",n.panelPosition="ltr"===e.uiLanguageDirection?"sw":"se",tce(n,[]),n.buttonView.set({label:t("Show more items"),tooltip:!0,icon:''}),n.toolbarView.items.bindTo(this.groupedItems).using((function(e){return e})),n}},{key:"_updateFocusCycleableItems",value:function(){var e=this;this.viewFocusables.clear(),this.ungroupedItems.map((function(t){e.viewFocusables.add(t)})),this.groupedItems.length&&this.viewFocusables.add(this.groupedItemsDropdown)}},{key:"_areItemsOverflowing",get:function(){if(!this.ungroupedItems.length)return!1;var e=this.viewElement,t=this.viewLocale.uiLanguageDirection,n=new ule(e.lastChild),r=new ule(e);if(!this.cachedPadding){var o=Que.window.getComputedStyle(e),i="ltr"===t?"paddingRight":"paddingLeft";this.cachedPadding=Number.parseInt(o[i])}return"ltr"===t?n.right>r.right-this.cachedPadding:n.left=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function _se(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=n.ungroupedItems.length?n.groupedItems.remove(a):n.ungroupedItems.remove(a)}}catch(e){i.e(e)}finally{i.f()}for(var u=o;un.ungroupedItems.length?n.groupedItems.add(l,u-n.ungroupedItems.length):n.ungroupedItems.add(l,u)}n._updateGrouping()})),t.extendTemplate({attributes:{class:["ck-toolbar_grouping"]}})}return bse(e,[{key:"render",value:function(e){this.viewElement=e.element,this._enableGroupingOnResize(),this._enableGroupingOnMaxWidthChange(e)}},{key:"destroy",value:function(){this.groupedItemsDropdown.destroy(),this.resizeObserver.destroy()}},{key:"_updateGrouping",value:function(){if(this.viewElement.ownerDocument.body.contains(this.viewElement))if(this.viewElement.offsetParent){for(var e,t=this.groupedItems.length;this._areItemsOverflowing;)this._groupLastItem(),e=!0;if(!e&&this.groupedItems.length){for(;this.groupedItems.length&&!this._areItemsOverflowing;)this._ungroupFirstItem();this._areItemsOverflowing&&this._groupLastItem()}this.groupedItems.length!==t&&this.view.fire("groupedItemsUpdate")}else this.shouldUpdateGroupingOnNextResize=!0}},{key:"_enableGroupingOnResize",value:function(){var e,t=this;this.resizeObserver=new cse(this.viewElement,(function(n){e&&e===n.contentRect.width&&!t.shouldUpdateGroupingOnNextResize||(t.shouldUpdateGroupingOnNextResize=!1,t._updateGrouping(),e=n.contentRect.width)})),this._updateGrouping()}},{key:"_enableGroupingOnMaxWidthChange",value:function(e){var t=this;e.on("change:maxWidth",(function(){t._updateGrouping()}))}},{key:"_groupLastItem",value:function(){this.groupedItems.length||(this.viewChildren.add(new ose),this.viewChildren.add(this.groupedItemsDropdown),this.viewFocusTracker.add(this.groupedItemsDropdown.element)),this.groupedItems.add(this.ungroupedItems.remove(this.ungroupedItems.last),0)}},{key:"_ungroupFirstItem",value:function(){this.ungroupedItems.add(this.groupedItems.remove(this.groupedItems.first)),this.groupedItems.length||(this.viewChildren.remove(this.groupedItemsDropdown),this.viewChildren.remove(this.viewChildren.last),this.viewFocusTracker.remove(this.groupedItemsDropdown.element))}},{key:"_createGroupedItemsDropdown",value:function(){var e=this.viewLocale,t=e.t,n=cce(e);return n.class="ck-toolbar__grouped-dropdown",n.panelPosition="ltr"===e.uiLanguageDirection?"sw":"se",fce(n,[]),n.buttonView.set({label:t("Show more items"),tooltip:!0,icon:''}),n.toolbarView.items.bindTo(this.groupedItems).using((function(e){return e})),n}},{key:"_updateFocusCycleableItems",value:function(){var e=this;this.viewFocusables.clear(),this.ungroupedItems.map((function(t){e.viewFocusables.add(t)})),this.groupedItems.length&&this.viewFocusables.add(this.groupedItemsDropdown)}},{key:"_areItemsOverflowing",get:function(){if(!this.ungroupedItems.length)return!1;var e=this.viewElement,t=this.viewLocale.uiLanguageDirection,n=new ble(e.lastChild),r=new ble(e);if(!this.cachedPadding){var o=lle.window.getComputedStyle(e),i="ltr"===t?"paddingRight":"paddingLeft";this.cachedPadding=Number.parseInt(o[i])}return"ltr"===t?n.right>r.right-this.cachedPadding:n.left=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Dse(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Jse(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function uce(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:Lle,n=new t(e),r=new Gue(e),o=new Ple(e,n,r);return n.bind("isEnabled").to(o),n instanceof Lle?n.bind("isOn").to(o,"isOpen"):n.arrowView.bind("isOn").to(o,"isOpen"),rce(o),o}function tce(e,t){var n=e.locale,r=n.t,o=e.toolbarView=new yse(n);o.set("ariaLabel",r("Dropdown toolbar")),e.extendTemplate({attributes:{class:["ck-toolbar-dropdown"]}}),t.map((function(e){return o.items.add(e)})),e.panelView.children.add(o),o.items.delegate("execute").to(e)}function nce(e,t){var n=e.locale,r=e.listView=new Cse(n);r.items.bindTo(t).using((function(e){var t=e.type,r=e.model;if("separator"===t)return new Bse(n);if("button"===t||"switchbutton"===t){var o,i,a=new Lse(n);return(o=i="button"===t?new Hue(n):new Gse(n)).bind.apply(o,Qse(Object.keys(r))).to(r),i.delegate("execute").to(a),a.children.add(i),a}})),e.panelView.children.add(r),r.items.delegate("execute").to(e)}function rce(e){!function(e){e.on("render",(function(){var t,n,r,o,i;t={emitter:e,activator:function(){return e.isOpen},callback:function(){e.isOpen=!1},contextElements:[e.element]},n=t.emitter,r=t.activator,o=t.callback,i=t.contextElements,n.listenTo(document,"mousedown",(function(e,t){if(r()){var n,a="function"==typeof t.composedPath?t.composedPath():[],u=Zse(i);try{for(u.s();!(n=u.n()).done;){var l=n.value;if(l.contains(t.target)||a.includes(l))return}}catch(e){u.e(e)}finally{u.f()}o()}}))}))}(e),function(e){e.on("execute",(function(t){t.source instanceof Gse||(e.isOpen=!1)}))}(e),function(e){e.keystrokes.set("arrowdown",(function(t,n){e.isOpen&&(e.panelView.focus(),n())})),e.keystrokes.set("arrowup",(function(t,n){e.isOpen&&(e.panelView.focusLast(),n())}))}(e)}var oce='',ice='';function ace(e){return(ace="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function uce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function lce(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:Ule,n=new t(e),r=new ile(e),o=new Lle(e,n,r);return n.bind("isEnabled").to(o),n instanceof Ule?n.bind("isOn").to(o,"isOpen"):n.arrowView.bind("isOn").to(o,"isOpen"),dce(o),o}function fce(e,t){var n=e.locale,r=n.t,o=e.toolbarView=new Pse(n);o.set("ariaLabel",r("Dropdown toolbar")),e.extendTemplate({attributes:{class:["ck-toolbar-dropdown"]}}),t.map((function(e){return o.items.add(e)})),e.panelView.children.add(o),o.items.delegate("execute").to(e)}function pce(e,t){var n=e.locale,r=e.listView=new Fse(n);r.items.bindTo(t).using((function(e){var t=e.type,r=e.model;if("separator"===t)return new Jse(n);if("button"===t||"switchbutton"===t){var o,i,a=new Use(n);return(o=i="button"===t?new Que(n):new ice(n)).bind.apply(o,lce(Object.keys(r))).to(r),i.delegate("execute").to(a),a.children.add(i),a}})),e.panelView.children.add(r),r.items.delegate("execute").to(e)}function dce(e){!function(e){e.on("render",(function(){var t,n,r,o,i;t={emitter:e,activator:function(){return e.isOpen},callback:function(){e.isOpen=!1},contextElements:[e.element]},n=t.emitter,r=t.activator,o=t.callback,i=t.contextElements,n.listenTo(document,"mousedown",(function(e,t){if(r()){var n,a="function"==typeof t.composedPath?t.composedPath():[],u=ace(i);try{for(u.s();!(n=u.n()).done;){var l=n.value;if(l.contains(t.target)||a.includes(l))return}}catch(e){u.e(e)}finally{u.f()}o()}}))}))}(e),function(e){e.on("execute",(function(t){t.source instanceof ice||(e.isOpen=!1)}))}(e),function(e){e.keystrokes.set("arrowdown",(function(t,n){e.isOpen&&(e.panelView.focus(),n())})),e.keystrokes.set("arrowup",(function(t,n){e.isOpen&&(e.panelView.focusLast(),n())}))}(e)}var hce='',yce='';function mce(e){return(mce="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function bce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function vce(e,t){for(var n=0;n'],["justify",'']]),hce=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&sce(e,t)}(i,e);var t,n,r,o=cce(i);function i(){return uce(this,i),o.apply(this,arguments)}return t=i,r=[{key:"pluginName",get:function(){return"AlignmentUI"}}],(n=[{key:"init",value:function(){var e=this,t=this.editor,n=t.ui.componentFactory,r=t.t,o=t.config.get("alignment.options");o.filter(iie).forEach((function(t){return e._addButton(t)})),n.add("alignment",(function(e){var t=ece(e),i=o.map((function(e){return n.create("alignment:".concat(e))}));tce(t,i),t.buttonView.set({label:r("Text alignment"),tooltip:!0}),t.toolbarView.isVertical=!0,t.toolbarView.ariaLabel=r("Text alignment toolbar"),t.extendTemplate({attributes:{class:"ck-alignment-dropdown"}});var a="rtl"===e.contentLanguageDirection?ice:oce;return t.buttonView.bind("icon").toMany(i,"isOn",(function(){for(var e=arguments.length,t=new Array(e),n=0;n'],["justify",'']]),kce=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&gce(e,t)}(i,e);var t,n,r,o=wce(i);function i(){return bce(this,i),o.apply(this,arguments)}return t=i,r=[{key:"pluginName",get:function(){return"AlignmentUI"}}],(n=[{key:"init",value:function(){var e=this,t=this.editor,n=t.ui.componentFactory,r=t.t,o=t.config.get("alignment.options");o.filter(yie).forEach((function(t){return e._addButton(t)})),n.add("alignment",(function(e){var t=cce(e),i=o.map((function(e){return n.create("alignment:".concat(e))}));fce(t,i),t.buttonView.set({label:r("Text alignment"),tooltip:!0}),t.toolbarView.isVertical=!0,t.toolbarView.ariaLabel=r("Text alignment toolbar"),t.extendTemplate({attributes:{class:"ck-alignment-dropdown"}});var a="rtl"===e.contentLanguageDirection?yce:hce;return t.buttonView.bind("icon").toMany(i,"isOn",(function(){for(var e=arguments.length,t=new Array(e),n=0;n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Pce(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Lce(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:{},n=this.editor.model,r=n.document,o=r.selection,i=void 0===t.forceValue?!this.value:t.forceValue;n.change((function(t){if(o.isCollapsed)i?t.setSelectionAttribute(e.attributeKey,!0):t.removeSelectionAttribute(e.attributeKey);else{var r,a=kce(n.schema.getValidRanges(o.getRanges(),e.attributeKey));try{for(a.s();!(r=a.n()).done;){var u=r.value;i?t.setAttribute(e.attributeKey,i,u):t.removeAttribute(e.attributeKey,u)}}catch(e){a.e(e)}finally{a.f()}}}))}},{key:"_getValueFromFirstAllowedNode",value:function(){var e=this.editor.model,t=e.schema,n=e.document.selection;if(n.isCollapsed)return n.hasAttribute(this.attributeKey);var r,o=kce(n.getRanges());try{for(o.s();!(r=o.n()).done;){var i,a=kce(r.value.getItems());try{for(a.s();!(i=a.n()).done;){var u=i.value;if(t.checkAttribute(u,this.attributeKey))return u.hasAttribute(this.attributeKey)}}catch(e){a.e(e)}finally{a.f()}}}catch(e){o.e(e)}finally{o.f()}return!1}}])&&jce(t.prototype,n),r&&jce(t,r),i}(tie);function Rce(e){return(Rce="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Mce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ace(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{},n=this.editor.model,r=n.document,o=r.selection,i=void 0===t.forceValue?!this.value:t.forceValue;n.change((function(t){if(o.isCollapsed)i?t.setSelectionAttribute(e.attributeKey,!0):t.removeSelectionAttribute(e.attributeKey);else{var r,a=Ace(n.schema.getValidRanges(o.getRanges(),e.attributeKey));try{for(a.s();!(r=a.n()).done;){var u=r.value;i?t.setAttribute(e.attributeKey,i,u):t.removeAttribute(e.attributeKey,u)}}catch(e){a.e(e)}finally{a.f()}}}))}},{key:"_getValueFromFirstAllowedNode",value:function(){var e=this.editor.model,t=e.schema,n=e.document.selection;if(n.isCollapsed)return n.hasAttribute(this.attributeKey);var r,o=Ace(n.getRanges());try{for(o.s();!(r=o.n()).done;){var i,a=Ace(r.value.getItems());try{for(a.s();!(i=a.n()).done;){var u=i.value;if(t.checkAttribute(u,this.attributeKey))return u.hasAttribute(this.attributeKey)}}catch(e){a.e(e)}finally{a.f()}}}catch(e){o.e(e)}finally{o.f()}return!1}}])&&Ice(t.prototype,n),r&&Ice(t,r),i}(fie);function Hce(e){return(Hce="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Vce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Wce(e,t){for(var n=0;n=600?{name:!0,styles:["font-weight"]}:void 0:null}]}),e.commands.add("bold",new Dce(e,"bold")),e.keystrokes.set("CTRL+B","bold")}}])&&Ace(t.prototype,n),r&&Ace(t,r),i}(Qoe);function Nce(e){return(Nce="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Bce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Hce(e,t){for(var n=0;n=600?{name:!0,styles:["font-weight"]}:void 0:null}]}),e.commands.add("bold",new Bce(e,"bold")),e.keystrokes.set("CTRL+B","bold")}}])&&Wce(t.prototype,n),r&&Wce(t,r),i}(lie);function Zce(e){return(Zce="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Jce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Qce(e,t){for(var n=0;n',keystroke:"CTRL+B",tooltip:!0,isToggleable:!0}),i.bind("isOn","isEnabled").to(o,"value","isEnabled"),e.listenTo(i,"execute",(function(){t.execute("bold"),t.editing.view.focus()})),i}))}}])&&Hce(t.prototype,n),r&&Hce(t,r),i}(Qoe);function $ce(e){return($ce="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Gce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Zce(e,t){for(var n=0;n',keystroke:"CTRL+B",tooltip:!0,isToggleable:!0}),i.bind("isOn","isEnabled").to(o,"value","isEnabled"),e.listenTo(i,"execute",(function(){t.execute("bold"),t.editing.view.focus()})),i}))}}])&&Qce(t.prototype,n),r&&Qce(t,r),i}(lie);function ofe(e){return(ofe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ife(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function afe(e,t){for(var n=0;n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function rfe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function dfe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n3&&void 0!==arguments[3]&&arguments[3];if(tK(t))this._setObjectToTarget(e,t,r);else{var o=t.split(".");t=o.pop();var i,a=nfe(o);try{for(a.s();!(i=a.n()).done;){var u=i.value;tK(e[u])||(e[u]={}),e=e[u]}}catch(e){a.e(e)}finally{a.f()}if(tK(n))return tK(e[t])||(e[t]={}),e=e[t],void this._setObjectToTarget(e,n,r);r&&void 0!==e[t]||(e[t]=n)}}},{key:"_getFromSource",value:function(e,t){var n=t.split(".");t=n.pop();var r,o=nfe(n);try{for(o.s();!(r=o.n()).done;){var i=r.value;if(!tK(e[i])){e=null;break}e=e[i]}}catch(e){o.e(e)}finally{o.f()}return e?afe(e[t]):void 0}},{key:"_setObjectToTarget",value:function(e,t,n){var r=this;Object.keys(t).forEach((function(o){r._setToTarget(e,o,t[o],n)}))}}])&&ofe(t.prototype,n),r&&ofe(t,r),e}();function afe(e){return gae(e,ufe)}function ufe(e){return nle(e)?e:void 0}function lfe(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n}(e,t)||cfe(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function sfe(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=cfe(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function cfe(e,t){if(e){if("string"==typeof e)return ffe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ffe(e,t):void 0}}function ffe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n3&&void 0!==arguments[3]&&arguments[3];if(fK(t))this._setObjectToTarget(e,t,r);else{var o=t.split(".");t=o.pop();var i,a=pfe(o);try{for(a.s();!(i=a.n()).done;){var u=i.value;fK(e[u])||(e[u]={}),e=e[u]}}catch(e){a.e(e)}finally{a.f()}if(fK(n))return fK(e[t])||(e[t]={}),e=e[t],void this._setObjectToTarget(e,n,r);r&&void 0!==e[t]||(e[t]=n)}}},{key:"_getFromSource",value:function(e,t){var n=t.split(".");t=n.pop();var r,o=pfe(n);try{for(o.s();!(r=o.n()).done;){var i=r.value;if(!fK(e[i])){e=null;break}e=e[i]}}catch(e){o.e(e)}finally{o.f()}return e?mfe(e[t]):void 0}},{key:"_setObjectToTarget",value:function(e,t,n){var r=this;Object.keys(t).forEach((function(o){r._setToTarget(e,o,t[o],n)}))}}])&&hfe(t.prototype,n),r&&hfe(t,r),e}();function mfe(e){return xae(e,bfe)}function bfe(e){return ple(e)?e:void 0}function vfe(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n}(e,t)||wfe(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function gfe(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=wfe(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function wfe(e,t){if(e){if("string"==typeof e)return _fe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_fe(e,t):void 0}}function _fe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];pfe(this,e),this._context=t,this._plugins=new Map,this._availablePlugins=new Map;var o,i=sfe(n);try{for(i.s();!(o=i.n()).done;){var a=o.value;a.pluginName&&this._availablePlugins.set(a.pluginName,a)}}catch(e){i.e(e)}finally{i.f()}this._contextPlugins=new Map;var u,l=sfe(r);try{for(l.s();!(u=l.n()).done;){var s=lfe(u.value,2),c=s[0],f=s[1];this._contextPlugins.set(c,f),this._contextPlugins.set(f,c),c.pluginName&&this._availablePlugins.set(c.pluginName,c)}}catch(e){l.e(e)}finally{l.f()}}var t,n,r;return t=e,(n=[{key:Symbol.iterator,value:regeneratorRuntime.mark((function e(){var t,n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=sfe(this._plugins),e.prev=1,t.s();case 3:if((n=t.n()).done){e.next=10;break}if("function"!=typeof(r=n.value)[0]){e.next=8;break}return e.next=8,r;case 8:e.next=3;break;case 10:e.next=15;break;case 12:e.prev=12,e.t0=e.catch(1),t.e(e.t0);case 15:return e.prev=15,t.f(),e.finish(15);case 18:case"end":return e.stop()}}),e,this,[[1,12,15,18]])}))},{key:"get",value:function(e){var t=this._plugins.get(e);if(!t){var n=e;throw"function"==typeof e&&(n=e.pluginName||e.name),new moe.a("plugincollection-plugin-not-loaded",this._context,{plugin:n})}return t}},{key:"has",value:function(e){return this._plugins.has(e)}},{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=this,r=this._context,o=new Set,i=[],a=y(e),u=y(t),l=h(e);if(l){var s="plugincollection-plugin-not-found";return Object(moe.b)(s,{plugins:l}),Promise.reject(new moe.a(s,r,{plugins:l}))}return Promise.all(a.map(c)).then((function(){return f(i,"init")})).then((function(){return f(i,"afterInit")})).then((function(){return i}));function c(e){if(!u.includes(e)&&!n._plugins.has(e)&&!o.has(e))return p(e).catch((function(t){throw Object(moe.b)("plugincollection-load",{plugin:e}),t}))}function f(e,t){return e.reduce((function(e,r){return r[t]?n._contextPlugins.has(r)?e:e.then(r[t].bind(r)):e}),Promise.resolve())}function p(e){return new Promise((function(a){o.add(e),e.requires&&e.requires.forEach((function(n){var o=d(n);if(e.isContextPlugin&&!o.isContextPlugin)throw new moe.a("plugincollection-context-required",null,{plugin:o.name,requiredBy:e.name});if(t.includes(o))throw new moe.a("plugincollection-required",r,{plugin:o.name,requiredBy:e.name});c(o)}));var u=n._contextPlugins.get(e)||new e(r);n._add(e,u),i.push(u),a()}))}function d(e){return"function"==typeof e?e:n._availablePlugins.get(e)}function h(e){var t,n=[],r=sfe(e);try{for(r.s();!(t=r.n()).done;){var o=t.value;d(o)||n.push(o)}}catch(e){r.e(e)}finally{r.f()}return n.length?n:null}function y(e){return e.map((function(e){return d(e)})).filter((function(e){return!!e}))}}},{key:"destroy",value:function(){var e,t=[],n=sfe(this);try{for(n.s();!(e=n.n()).done;){var r=lfe(e.value,2)[1];"function"!=typeof r.destroy||this._contextPlugins.has(r)||t.push(r.destroy())}}catch(e){n.e(e)}finally{n.f()}return Promise.all(t)}},{key:"_add",value:function(e,t){this._plugins.set(e,t);var n=e.pluginName;if(n){if(this._plugins.has(n))throw new moe.a("plugincollection-plugin-name-conflict",null,{pluginName:n,plugin1:this._plugins.get(n).constructor,plugin2:e});this._plugins.set(n,t)}}}])&&dfe(t.prototype,n),r&&dfe(t,r),e}();function yfe(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if("number"!=typeof n)throw new moe.a("translation-service-quantity-not-a-number",null,{quantity:n});var r=bfe();1===r&&(e=Object.keys(window.CKEDITOR_TRANSLATIONS)[0]);var o=t.id||t.string;if(0===r||!mfe(e,o))return 1!==n?t.plural:t.string;var i=window.CKEDITOR_TRANSLATIONS[e].dictionary,a=window.CKEDITOR_TRANSLATIONS[e].getPluralForm||function(e){return 1===e?0:1};if("string"==typeof i[o])return i[o];var u=Number(a(n));return i[o][u]}function mfe(e,t){return!!window.CKEDITOR_TRANSLATIONS[e]&&!!window.CKEDITOR_TRANSLATIONS[e].dictionary[t]}function bfe(){return Object.keys(window.CKEDITOR_TRANSLATIONS).length}function vfe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function gfe(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];Ofe(this,e),this._context=t,this._plugins=new Map,this._availablePlugins=new Map;var o,i=gfe(n);try{for(i.s();!(o=i.n()).done;){var a=o.value;a.pluginName&&this._availablePlugins.set(a.pluginName,a)}}catch(e){i.e(e)}finally{i.f()}this._contextPlugins=new Map;var u,l=gfe(r);try{for(l.s();!(u=l.n()).done;){var s=vfe(u.value,2),c=s[0],f=s[1];this._contextPlugins.set(c,f),this._contextPlugins.set(f,c),c.pluginName&&this._availablePlugins.set(c.pluginName,c)}}catch(e){l.e(e)}finally{l.f()}}var t,n,r;return t=e,(n=[{key:Symbol.iterator,value:regeneratorRuntime.mark((function e(){var t,n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=gfe(this._plugins),e.prev=1,t.s();case 3:if((n=t.n()).done){e.next=10;break}if("function"!=typeof(r=n.value)[0]){e.next=8;break}return e.next=8,r;case 8:e.next=3;break;case 10:e.next=15;break;case 12:e.prev=12,e.t0=e.catch(1),t.e(e.t0);case 15:return e.prev=15,t.f(),e.finish(15);case 18:case"end":return e.stop()}}),e,this,[[1,12,15,18]])}))},{key:"get",value:function(e){var t=this._plugins.get(e);if(!t){var n=e;throw"function"==typeof e&&(n=e.pluginName||e.name),new joe.a("plugincollection-plugin-not-loaded",this._context,{plugin:n})}return t}},{key:"has",value:function(e){return this._plugins.has(e)}},{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=this,r=this._context,o=new Set,i=[],a=y(e),u=y(t),l=h(e);if(l){var s="plugincollection-plugin-not-found";return Object(joe.b)(s,{plugins:l}),Promise.reject(new joe.a(s,r,{plugins:l}))}return Promise.all(a.map(c)).then((function(){return f(i,"init")})).then((function(){return f(i,"afterInit")})).then((function(){return i}));function c(e){if(!u.includes(e)&&!n._plugins.has(e)&&!o.has(e))return p(e).catch((function(t){throw Object(joe.b)("plugincollection-load",{plugin:e}),t}))}function f(e,t){return e.reduce((function(e,r){return r[t]?n._contextPlugins.has(r)?e:e.then(r[t].bind(r)):e}),Promise.resolve())}function p(e){return new Promise((function(a){o.add(e),e.requires&&e.requires.forEach((function(n){var o=d(n);if(e.isContextPlugin&&!o.isContextPlugin)throw new joe.a("plugincollection-context-required",null,{plugin:o.name,requiredBy:e.name});if(t.includes(o))throw new joe.a("plugincollection-required",r,{plugin:o.name,requiredBy:e.name});c(o)}));var u=n._contextPlugins.get(e)||new e(r);n._add(e,u),i.push(u),a()}))}function d(e){return"function"==typeof e?e:n._availablePlugins.get(e)}function h(e){var t,n=[],r=gfe(e);try{for(r.s();!(t=r.n()).done;){var o=t.value;d(o)||n.push(o)}}catch(e){r.e(e)}finally{r.f()}return n.length?n:null}function y(e){return e.map((function(e){return d(e)})).filter((function(e){return!!e}))}}},{key:"destroy",value:function(){var e,t=[],n=gfe(this);try{for(n.s();!(e=n.n()).done;){var r=vfe(e.value,2)[1];"function"!=typeof r.destroy||this._contextPlugins.has(r)||t.push(r.destroy())}}catch(e){n.e(e)}finally{n.f()}return Promise.all(t)}},{key:"_add",value:function(e,t){this._plugins.set(e,t);var n=e.pluginName;if(n){if(this._plugins.has(n))throw new joe.a("plugincollection-plugin-name-conflict",null,{pluginName:n,plugin1:this._plugins.get(n).constructor,plugin2:e});this._plugins.set(n,t)}}}])&&Sfe(t.prototype,n),r&&Sfe(t,r),e}();function Pfe(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if("number"!=typeof n)throw new joe.a("translation-service-quantity-not-a-number",null,{quantity:n});var r=Efe();1===r&&(e=Object.keys(window.CKEDITOR_TRANSLATIONS)[0]);var o=t.id||t.string;if(0===r||!jfe(e,o))return 1!==n?t.plural:t.string;var i=window.CKEDITOR_TRANSLATIONS[e].dictionary,a=window.CKEDITOR_TRANSLATIONS[e].getPluralForm||function(e){return 1===e?0:1};if("string"==typeof i[o])return i[o];var u=Number(a(n));return i[o][u]}function jfe(e,t){return!!window.CKEDITOR_TRANSLATIONS[e]&&!!window.CKEDITOR_TRANSLATIONS[e].dictionary[t]}function Efe(){return Object.keys(window.CKEDITOR_TRANSLATIONS).length}function Cfe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xfe(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};vfe(this,e),this.uiLanguage=n.uiLanguage||"en",this.contentLanguage=n.contentLanguage||this.uiLanguage,this.uiLanguageDirection=Sfe(this.uiLanguage),this.contentLanguageDirection=Sfe(this.contentLanguage),this.t=function(e,n){return t._t(e,n)}}var t,n,r;return t=e,(n=[{key:"_t",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];Array.isArray(t)||(t=[t]),"string"==typeof e&&(e={string:e});var n=!!e.plural,r=n?t[0]:1,o=yfe(this.uiLanguage,e,r);return Ofe(o,t)}},{key:"language",get:function(){return console.warn("locale-deprecated-language-property: The Locale#language property has been deprecated and will be removed in the near future. Please use #uiLanguage and #contentLanguage properties instead."),this.uiLanguage}}])&&gfe(t.prototype,n),r&&gfe(t,r),e}();function Ofe(e,t){return e.replace(/%(\d+)/g,(function(e,n){return n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Pfe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:{};Cfe(this,e),this.uiLanguage=n.uiLanguage||"en",this.contentLanguage=n.contentLanguage||this.uiLanguage,this.uiLanguageDirection=Mfe(this.uiLanguage),this.contentLanguageDirection=Mfe(this.contentLanguage),this.t=function(e,n){return t._t(e,n)}}var t,n,r;return t=e,(n=[{key:"_t",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];Array.isArray(t)||(t=[t]),"string"==typeof e&&(e={string:e});var n=!!e.plural,r=n?t[0]:1,o=Pfe(this.uiLanguage,e,r);return Rfe(o,t)}},{key:"language",get:function(){return console.warn("locale-deprecated-language-property: The Locale#language property has been deprecated and will be removed in the near future. Please use #uiLanguage and #contentLanguage properties instead."),this.uiLanguage}}])&&xfe(t.prototype,n),r&&xfe(t,r),e}();function Rfe(e,t){return e.replace(/%(\d+)/g,(function(e,n){return n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Lfe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:{includeSelf:!1,parentFirst:!1},t=[],n=e.includeSelf?this:this.parent;n;)t[e.parentFirst?"push":"unshift"](n),n=n.parent;return t}},{key:"getCommonAncestor",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getAncestors(t),r=e.getAncestors(t),o=0;n[o]==r[o]&&n[o];)o++;return 0===o?null:n[o-1]}},{key:"isBefore",value:function(e){if(this==e)return!1;if(this.root!==e.root)return!1;var t=this.getPath(),n=e.getPath(),r=Cfe(t,n);switch(r){case"prefix":return!0;case"extension":return!1;default:return t[r]0&&void 0!==arguments[0]?arguments[0]:{includeSelf:!1,parentFirst:!1},t=[],n=e.includeSelf?this:this.parent;n;)t[e.parentFirst?"push":"unshift"](n),n=n.parent;return t}},{key:"getCommonAncestor",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getAncestors(t),r=e.getAncestors(t),o=0;n[o]==r[o]&&n[o];)o++;return 0===o?null:n[o-1]}},{key:"isBefore",value:function(e){if(this==e)return!1;if(this.root!==e.root)return!1;var t=this.getPath(),n=e.getPath(),r=Ffe(t,n);switch(r){case"prefix":return!0;case"extension":return!1;default:return t[r]t.data.length)throw new moe.a("view-textproxy-wrong-offsetintext",this);if(r<0||n+r>t.data.length)throw new moe.a("view-textproxy-wrong-length",this);this.data=t.data.substring(n,n+r),this.offsetInText=n}var t,n,r;return t=e,(n=[{key:"is",value:function(e){return"$textProxy"===e||"view:$textProxy"===e||"textProxy"===e||"view:textProxy"===e}},{key:"getAncestors",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{includeSelf:!1,parentFirst:!1},t=[],n=e.includeSelf?this.textNode:this.parent;null!==n;)t[e.parentFirst?"push":"unshift"](n),n=n.parent;return t}},{key:"offsetSize",get:function(){return this.data.length}},{key:"isPartial",get:function(){return this.data.length!==this.textNode.data.length}},{key:"parent",get:function(){return this.textNode.parent}},{key:"root",get:function(){return this.textNode.root}},{key:"document",get:function(){return this.textNode.document}}])&&Yfe(t.prototype,n),r&&Yfe(t,r),e}(); +var Zfe=function(){function e(t,n,r){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.textNode=t,n<0||n>t.data.length)throw new joe.a("view-textproxy-wrong-offsetintext",this);if(r<0||n+r>t.data.length)throw new joe.a("view-textproxy-wrong-length",this);this.data=t.data.substring(n,n+r),this.offsetInText=n}var t,n,r;return t=e,(n=[{key:"is",value:function(e){return"$textProxy"===e||"view:$textProxy"===e||"textProxy"===e||"view:textProxy"===e}},{key:"getAncestors",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{includeSelf:!1,parentFirst:!1},t=[],n=e.includeSelf?this.textNode:this.parent;null!==n;)t[e.parentFirst?"push":"unshift"](n),n=n.parent;return t}},{key:"offsetSize",get:function(){return this.data.length}},{key:"isPartial",get:function(){return this.data.length!==this.textNode.data.length}},{key:"parent",get:function(){return this.textNode.parent}},{key:"root",get:function(){return this.textNode.root}},{key:"document",get:function(){return this.textNode.document}}])&&Gfe(t.prototype,n),r&&Gfe(t,r),e}(); /** * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license @@ -703,967 +703,967 @@ var Nfe=function(){function e(t,n,r){if(function(e,t){if(!(e instanceof t))throw * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -function Bfe(e){return Tie(e)?new Map(e):function(e){var t=new Map;for(var n in e)t.set(n,e[n]);return t}(e)}function Hfe(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Vfe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Vfe(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Vfe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Xfe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0?e:null}},{key:"getElementName",value:function(){if(1!==this._patterns.length)return null;var e=this._patterns[0],t=e.name;return"function"==typeof e||!t||t instanceof RegExp?null:t}}])&&Ufe(t.prototype,n),r&&Ufe(t,r),e}();function Kfe(e,t){if("function"==typeof t)return t(e);var n={};return t.name&&(n.name=function(e,t){if(e instanceof RegExp)return e.test(t);return e===t}(t.name,e.name),!n.name)||t.attributes&&(n.attributes=function(e,t){var n=[];for(var r in e){var o=e[r];if(!t.hasAttribute(r))return null;var i=t.getAttribute(r);if(!0===o)n.push(r);else if(o instanceof RegExp){if(!o.test(i))return null;n.push(r)}else{if(i!==o)return null;n.push(r)}}return n}(t.attributes,e),!n.attributes)?null:!(t.classes&&(n.classes=function(e,t){var n,r=[],o=Hfe(e);try{for(o.s();!(n=o.n()).done;){var i=n.value;if(i instanceof RegExp){var a,u=Hfe(t.getClassNames());try{for(u.s();!(a=u.n()).done;){var l=a.value;i.test(l)&&r.push(l)}}catch(e){u.e(e)}finally{u.f()}if(0===r.length)return null}else{if(!t.hasClass(i))return null;r.push(i)}}}catch(e){o.e(e)}finally{o.f()}return r}(t.classes,e),!n.classes))&&(!(t.styles&&(n.styles=function(e,t){var n=[];for(var r in e){var o=e[r];if(!t.hasStyle(r))return null;var i=t.getStyle(r);if(o instanceof RegExp){if(!o.test(i))return null;n.push(r)}else{if(i!==o)return null;n.push(r)}}return n}(t.styles,e),!n.styles))&&n)}var $fe=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0};var Gfe=function(e,t,n){var r=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=Array(o);++re.length)&&(t=e.length);for(var n=0,r=new Array(t);n0?e:null}},{key:"getElementName",value:function(){if(1!==this._patterns.length)return null;var e=this._patterns[0],t=e.name;return"function"==typeof e||!t||t instanceof RegExp?null:t}}])&&tpe(t.prototype,n),r&&tpe(t,r),e}();function rpe(e,t){if("function"==typeof t)return t(e);var n={};return t.name&&(n.name=function(e,t){if(e instanceof RegExp)return e.test(t);return e===t}(t.name,e.name),!n.name)||t.attributes&&(n.attributes=function(e,t){var n=[];for(var r in e){var o=e[r];if(!t.hasAttribute(r))return null;var i=t.getAttribute(r);if(!0===o)n.push(r);else if(o instanceof RegExp){if(!o.test(i))return null;n.push(r)}else{if(i!==o)return null;n.push(r)}}return n}(t.attributes,e),!n.attributes)?null:!(t.classes&&(n.classes=function(e,t){var n,r=[],o=Qfe(e);try{for(o.s();!(n=o.n()).done;){var i=n.value;if(i instanceof RegExp){var a,u=Qfe(t.getClassNames());try{for(u.s();!(a=u.n()).done;){var l=a.value;i.test(l)&&r.push(l)}}catch(e){u.e(e)}finally{u.f()}if(0===r.length)return null}else{if(!t.hasClass(i))return null;r.push(i)}}}catch(e){o.e(e)}finally{o.f()}return r}(t.classes,e),!n.classes))&&(!(t.styles&&(n.styles=function(e,t){var n=[];for(var r in e){var o=e[r];if(!t.hasStyle(r))return null;var i=t.getStyle(r);if(o instanceof RegExp){if(!o.test(i))return null;n.push(r)}else{if(i!==o)return null;n.push(r)}}return n}(t.styles,e),!n.styles))&&n)}var ope=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0};var ipe=function(e,t,n){var r=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=Array(o);++re.length)&&(t=e.length);for(var n=0,r=new Array(t);n1){var n=t.splice(0,t.length-1).join("."),r=MG(this._styles,n);if(r)!Array.from(Object.keys(r)).length&&this.remove(n)}}},{key:"isEmpty",get:function(){var e=Object.entries(this._styles);return!Array.from(e).length}},{key:"size",get:function(){return this.isEmpty?0:this.getStyleNames().length}}]),e}(),spe=function(){function e(){ipe(this,e),this._normalizers=new Map,this._extractors=new Map,this._reducers=new Map,this._consumables=new Map}return upe(e,[{key:"toNormalizedForm",value:function(e,t,n){if(LU(t))fpe(n,cpe(e),t);else if(this._normalizers.has(e)){var r=this._normalizers.get(e)(t);fpe(n,r.path,r.value)}else fpe(n,e,t)}},{key:"getNormalized",value:function(e,t){if(!e)return zK({},t);if(void 0!==t[e])return t[e];if(this._extractors.has(e)){var n=this._extractors.get(e);if("string"==typeof n)return MG(t,n);var r=n(e,t);if(r)return r}return MG(t,cpe(e))}},{key:"getReducedForm",value:function(e,t){var n=this.getNormalized(e,t);return void 0===n?[]:this._reducers.has(e)?this._reducers.get(e)(n):[[e,n]]}},{key:"getRelatedStyles",value:function(e){return this._consumables.get(e)||[]}},{key:"setNormalizer",value:function(e,t){this._normalizers.set(e,t)}},{key:"setExtractor",value:function(e,t){this._extractors.set(e,t)}},{key:"setReducer",value:function(e,t){this._reducers.set(e,t)}},{key:"setStyleRelation",value:function(e,t){this._mapStyleNames(e,t);var n,r=function(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=rpe(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}(t);try{for(r.s();!(n=r.n()).done;){var o=n.value;this._mapStyleNames(o,[e])}}catch(e){r.e(e)}finally{r.f()}}},{key:"_mapStyleNames",value:function(e,t){var n;this._consumables.has(e)||this._consumables.set(e,[]),(n=this._consumables.get(e)).push.apply(n,tpe(t))}}]),e}();function cpe(e){return e.replace("-",".")}function fpe(e,t,n){var r=n;LU(n)&&(r=zK({},MG(e,t),n)),epe(e,t,r)}function ppe(e){return(ppe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function dpe(e,t,n){return(dpe=Ope()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&wpe(o,n.prototype),o}).apply(null,arguments)}function hpe(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n}(e,t)||bpe(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ype(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=bpe(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function mpe(e){return function(e){if(Array.isArray(e))return vpe(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||bpe(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function bpe(e,t){if(e){if("string"==typeof e)return vpe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?vpe(e,t):void 0}}function vpe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1){var n=t.splice(0,t.length-1).join("."),r=VG(this._styles,n);if(r)!Array.from(Object.keys(r)).length&&this.remove(n)}}},{key:"isEmpty",get:function(){var e=Object.entries(this._styles);return!Array.from(e).length}},{key:"size",get:function(){return this.isEmpty?0:this.getStyleNames().length}}]),e}(),gpe=function(){function e(){ype(this,e),this._normalizers=new Map,this._extractors=new Map,this._reducers=new Map,this._consumables=new Map}return bpe(e,[{key:"toNormalizedForm",value:function(e,t,n){if(UU(t))_pe(n,wpe(e),t);else if(this._normalizers.has(e)){var r=this._normalizers.get(e)(t);_pe(n,r.path,r.value)}else _pe(n,e,t)}},{key:"getNormalized",value:function(e,t){if(!e)return KK({},t);if(void 0!==t[e])return t[e];if(this._extractors.has(e)){var n=this._extractors.get(e);if("string"==typeof n)return VG(t,n);var r=n(e,t);if(r)return r}return VG(t,wpe(e))}},{key:"getReducedForm",value:function(e,t){var n=this.getNormalized(e,t);return void 0===n?[]:this._reducers.has(e)?this._reducers.get(e)(n):[[e,n]]}},{key:"getRelatedStyles",value:function(e){return this._consumables.get(e)||[]}},{key:"setNormalizer",value:function(e,t){this._normalizers.set(e,t)}},{key:"setExtractor",value:function(e,t){this._extractors.set(e,t)}},{key:"setReducer",value:function(e,t){this._reducers.set(e,t)}},{key:"setStyleRelation",value:function(e,t){this._mapStyleNames(e,t);var n,r=function(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=dpe(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}(t);try{for(r.s();!(n=r.n()).done;){var o=n.value;this._mapStyleNames(o,[e])}}catch(e){r.e(e)}finally{r.f()}}},{key:"_mapStyleNames",value:function(e,t){var n;this._consumables.has(e)||this._consumables.set(e,[]),(n=this._consumables.get(e)).push.apply(n,fpe(t))}}]),e}();function wpe(e){return e.replace("-",".")}function _pe(e,t,n){var r=n;UU(n)&&(r=KK({},VG(e,t),n)),cpe(e,t,r)}function Ope(e){return(Ope="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Spe(e,t,n){return(Spe=Rpe()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&Tpe(o,n.prototype),o}).apply(null,arguments)}function kpe(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n}(e,t)||Epe(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ppe(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=Epe(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function jpe(e){return function(e){if(Array.isArray(e))return Cpe(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||Epe(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Epe(e,t){if(e){if("string"==typeof e)return Cpe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Cpe(e,t):void 0}}function Cpe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:null;return t?t===this.name&&("element"===e||"view:element"===e):"element"===e||"view:element"===e||"node"===e||"view:node"===e}},{key:"getChild",value:function(e){return this._children[e]}},{key:"getChildIndex",value:function(e){return this._children.indexOf(e)}},{key:"getChildren",value:function(){return this._children[Symbol.iterator]()}},{key:"getAttributeKeys",value:regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(this._classes.size>0)){e.next=3;break}return e.next=3,"class";case 3:if(this._styles.isEmpty){e.next=6;break}return e.next=6,"style";case 6:return e.delegateYield(this._attrs.keys(),"t0",7);case 7:case"end":return e.stop()}}),e,this)}))},{key:"getAttributes",value:regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.delegateYield(this._attrs.entries(),"t0",1);case 1:if(!(this._classes.size>0)){e.next=4;break}return e.next=4,["class",this.getAttribute("class")];case 4:if(this._styles.isEmpty){e.next=7;break}return e.next=7,["style",this.getAttribute("style")];case 7:case"end":return e.stop()}}),e,this)}))},{key:"getAttribute",value:function(e){if("class"==e)return this._classes.size>0?mpe(this._classes).join(" "):void 0;if("style"==e){var t=this._styles.toString();return""==t?void 0:t}return this._attrs.get(e)}},{key:"hasAttribute",value:function(e){return"class"==e?this._classes.size>0:"style"==e?!this._styles.isEmpty:this._attrs.has(e)}},{key:"isSimilar",value:function(e){if(!(e instanceof u))return!1;if(this===e)return!0;if(this.name!=e.name)return!1;if(this._attrs.size!==e._attrs.size||this._classes.size!==e._classes.size||this._styles.size!==e._styles.size)return!1;var t,n=ype(this._attrs);try{for(n.s();!(t=n.n()).done;){var r=hpe(t.value,2),o=r[0],i=r[1];if(!e._attrs.has(o)||e._attrs.get(o)!==i)return!1}}catch(e){n.e(e)}finally{n.f()}var a,l=ype(this._classes);try{for(l.s();!(a=l.n()).done;){var s=a.value;if(!e._classes.has(s))return!1}}catch(e){l.e(e)}finally{l.f()}var c,f=ype(this._styles.getStyleNames());try{for(f.s();!(c=f.n()).done;){var p=c.value;if(!e._styles.has(p)||e._styles.getAsString(p)!==this._styles.getAsString(p))return!1}}catch(e){f.e(e)}finally{f.f()}return!0}},{key:"hasClass",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n0&&void 0!==arguments[0]&&arguments[0],t=[];if(e){var n,r=ype(this.getChildren());try{for(r.s();!(n=r.n()).done;){var o=n.value;t.push(o._clone(e))}}catch(e){r.e(e)}finally{r.f()}}var i=new this.constructor(this.document,this.name,this._attrs,t);return i._classes=new Set(this._classes),i._styles.set(this._styles.getNormalized()),i._customProperties=new Map(this._customProperties),i.getFillerOffset=this.getFillerOffset,i}},{key:"_appendChild",value:function(e){return this._insertChild(this.childCount,e)}},{key:"_insertChild",value:function(e,t){this._fireChange("children",this);var n,r=0,o=ype(function(e,t){return"string"==typeof t?[new Ffe(e,t)]:(Tie(t)||(t=[t]),Array.from(t).map((function(t){return"string"==typeof t?new Ffe(e,t):t instanceof Nfe?new Ffe(e,t.data):t})))}(this.document,t));try{for(o.s();!(n=o.n()).done;){var i=n.value;null!==i.parent&&i._remove(),i.parent=this,i.document=this.document,this._children.splice(e,0,i),e++,r++}}catch(e){o.e(e)}finally{o.f()}return r}},{key:"_removeChildren",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;this._fireChange("children",this);for(var n=e;n0&&(this._classes.clear(),!0):"style"==e?!this._styles.isEmpty&&(this._styles.clear(),!0):this._attrs.delete(e)}},{key:"_addClass",value:function(e){var t=this;this._fireChange("attributes",this),(e=Array.isArray(e)?e:[e]).forEach((function(e){return t._classes.add(e)}))}},{key:"_removeClass",value:function(e){var t=this;this._fireChange("attributes",this),(e=Array.isArray(e)?e:[e]).forEach((function(e){return t._classes.delete(e)}))}},{key:"_setStyle",value:function(e,t){this._fireChange("attributes",this),this._styles.set(e,t)}},{key:"_removeStyle",value:function(e){var t=this;this._fireChange("attributes",this),(e=Array.isArray(e)?e:[e]).forEach((function(e){return t._styles.remove(e)}))}},{key:"_setCustomProperty",value:function(e,t){this._customProperties.set(e,t)}},{key:"_removeCustomProperty",value:function(e){return this._customProperties.delete(e)}},{key:"childCount",get:function(){return this._children.length}},{key:"isEmpty",get:function(){return 0===this._children.length}}])&&gpe(r.prototype,o),i&&gpe(r,i),u}(Dfe);function Ppe(e,t){var n=t.split(/\s+/);e.clear(),n.forEach((function(t){return e.add(t)}))}function jpe(e){return function(e){if(Array.isArray(e))return Cpe(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||Epe(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Epe(e,t){if(e){if("string"==typeof e)return Cpe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Cpe(e,t):void 0}}function Cpe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:null;return t?t===this.name&&("element"===e||"view:element"===e):"element"===e||"view:element"===e||"node"===e||"view:node"===e}},{key:"getChild",value:function(e){return this._children[e]}},{key:"getChildIndex",value:function(e){return this._children.indexOf(e)}},{key:"getChildren",value:function(){return this._children[Symbol.iterator]()}},{key:"getAttributeKeys",value:regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(this._classes.size>0)){e.next=3;break}return e.next=3,"class";case 3:if(this._styles.isEmpty){e.next=6;break}return e.next=6,"style";case 6:return e.delegateYield(this._attrs.keys(),"t0",7);case 7:case"end":return e.stop()}}),e,this)}))},{key:"getAttributes",value:regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.delegateYield(this._attrs.entries(),"t0",1);case 1:if(!(this._classes.size>0)){e.next=4;break}return e.next=4,["class",this.getAttribute("class")];case 4:if(this._styles.isEmpty){e.next=7;break}return e.next=7,["style",this.getAttribute("style")];case 7:case"end":return e.stop()}}),e,this)}))},{key:"getAttribute",value:function(e){if("class"==e)return this._classes.size>0?jpe(this._classes).join(" "):void 0;if("style"==e){var t=this._styles.toString();return""==t?void 0:t}return this._attrs.get(e)}},{key:"hasAttribute",value:function(e){return"class"==e?this._classes.size>0:"style"==e?!this._styles.isEmpty:this._attrs.has(e)}},{key:"isSimilar",value:function(e){if(!(e instanceof u))return!1;if(this===e)return!0;if(this.name!=e.name)return!1;if(this._attrs.size!==e._attrs.size||this._classes.size!==e._classes.size||this._styles.size!==e._styles.size)return!1;var t,n=Ppe(this._attrs);try{for(n.s();!(t=n.n()).done;){var r=kpe(t.value,2),o=r[0],i=r[1];if(!e._attrs.has(o)||e._attrs.get(o)!==i)return!1}}catch(e){n.e(e)}finally{n.f()}var a,l=Ppe(this._classes);try{for(l.s();!(a=l.n()).done;){var s=a.value;if(!e._classes.has(s))return!1}}catch(e){l.e(e)}finally{l.f()}var c,f=Ppe(this._styles.getStyleNames());try{for(f.s();!(c=f.n()).done;){var p=c.value;if(!e._styles.has(p)||e._styles.getAsString(p)!==this._styles.getAsString(p))return!1}}catch(e){f.e(e)}finally{f.f()}return!0}},{key:"hasClass",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n0&&void 0!==arguments[0]&&arguments[0],t=[];if(e){var n,r=Ppe(this.getChildren());try{for(r.s();!(n=r.n()).done;){var o=n.value;t.push(o._clone(e))}}catch(e){r.e(e)}finally{r.f()}}var i=new this.constructor(this.document,this.name,this._attrs,t);return i._classes=new Set(this._classes),i._styles.set(this._styles.getNormalized()),i._customProperties=new Map(this._customProperties),i.getFillerOffset=this.getFillerOffset,i}},{key:"_appendChild",value:function(e){return this._insertChild(this.childCount,e)}},{key:"_insertChild",value:function(e,t){this._fireChange("children",this);var n,r=0,o=Ppe(function(e,t){return"string"==typeof t?[new $fe(e,t)]:(Nie(t)||(t=[t]),Array.from(t).map((function(t){return"string"==typeof t?new $fe(e,t):t instanceof Zfe?new $fe(e,t.data):t})))}(this.document,t));try{for(o.s();!(n=o.n()).done;){var i=n.value;null!==i.parent&&i._remove(),i.parent=this,i.document=this.document,this._children.splice(e,0,i),e++,r++}}catch(e){o.e(e)}finally{o.f()}return r}},{key:"_removeChildren",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;this._fireChange("children",this);for(var n=e;n0&&(this._classes.clear(),!0):"style"==e?!this._styles.isEmpty&&(this._styles.clear(),!0):this._attrs.delete(e)}},{key:"_addClass",value:function(e){var t=this;this._fireChange("attributes",this),(e=Array.isArray(e)?e:[e]).forEach((function(e){return t._classes.add(e)}))}},{key:"_removeClass",value:function(e){var t=this;this._fireChange("attributes",this),(e=Array.isArray(e)?e:[e]).forEach((function(e){return t._classes.delete(e)}))}},{key:"_setStyle",value:function(e,t){this._fireChange("attributes",this),this._styles.set(e,t)}},{key:"_removeStyle",value:function(e){var t=this;this._fireChange("attributes",this),(e=Array.isArray(e)?e:[e]).forEach((function(e){return t._styles.remove(e)}))}},{key:"_setCustomProperty",value:function(e,t){this._customProperties.set(e,t)}},{key:"_removeCustomProperty",value:function(e){return this._customProperties.delete(e)}},{key:"childCount",get:function(){return this._children.length}},{key:"isEmpty",get:function(){return 0===this._children.length}}])&&xpe(r.prototype,o),i&&xpe(r,i),u}(Bfe);function Lpe(e,t){var n=t.split(/\s+/);e.clear(),n.forEach((function(t){return e.add(t)}))}function Ipe(e){return function(e){if(Array.isArray(e))return Fpe(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||zpe(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function zpe(e,t){if(e){if("string"==typeof e)return Fpe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Fpe(e,t):void 0}}function Fpe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:null;return t?t===this.name&&("containerElement"===e||"view:containerElement"===e||"element"===e||"view:element"===e):"containerElement"===e||"view:containerElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e}}])&&Tpe(t.prototype,n),r&&Tpe(t,r),i}(kpe);function Ipe(){var e=jpe(this.getChildren()),t=e[this.childCount-1];if(t&&t.is("element","br"))return this.childCount;var n,r=function(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=Epe(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}(e);try{for(r.s();!(n=r.n()).done;){if(!n.value.is("uiElement"))return null}}catch(e){r.e(e)}finally{r.f()}return this.childCount}function zpe(e){return(zpe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Fpe(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:null;return t?t===this.name&&("containerElement"===e||"view:containerElement"===e||"element"===e||"view:element"===e):"containerElement"===e||"view:containerElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e}}])&&Npe(t.prototype,n),r&&Npe(t,r),i}(Ape);function qpe(){var e=Ipe(this.getChildren()),t=e[this.childCount-1];if(t&&t.is("element","br"))return this.childCount;var n,r=function(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=zpe(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}(e);try{for(r.s();!(n=r.n()).done;){if(!n.value.is("uiElement"))return null}}catch(e){r.e(e)}finally{r.f()}return this.childCount}function Kpe(e){return(Kpe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function $pe(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:null;return t?t===this.name&&("editableElement"===e||"view:editableElement"===e||"containerElement"===e||"view:containerElement"===e||"element"===e||"view:element"===e):"editableElement"===e||"view:editableElement"===e||"containerElement"===e||"view:containerElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e}},{key:"destroy",value:function(){this.stopListening()}}])&&Fpe(t.prototype,n),r&&Fpe(t,r),i}(Lpe);function Upe(e){return(Upe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function qpe(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:null;return t?t===this.name&&("editableElement"===e||"view:editableElement"===e||"containerElement"===e||"view:containerElement"===e||"element"===e||"view:element"===e):"editableElement"===e||"view:editableElement"===e||"containerElement"===e||"view:containerElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e}},{key:"destroy",value:function(){this.stopListening()}}])&&$pe(t.prototype,n),r&&$pe(t,r),i}(Upe);function tde(e){return(tde="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function nde(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:null;return t?t===this.name&&("rootElement"===e||"view:rootElement"===e||"editableElement"===e||"view:editableElement"===e||"containerElement"===e||"view:containerElement"===e||"element"===e||"view:element"===e):"rootElement"===e||"view:rootElement"===e||"editableElement"===e||"view:editableElement"===e||"containerElement"===e||"view:containerElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e}},{key:"rootName",get:function(){return this.getCustomProperty(Jpe)},set:function(e){this._setCustomProperty(Jpe,e)}},{key:"_name",set:function(e){this.name=e}}])&&qpe(t.prototype,n),r&&qpe(t,r),i}(Wpe);function Xpe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ede(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:null;return t?t===this.name&&("rootElement"===e||"view:rootElement"===e||"editableElement"===e||"view:editableElement"===e||"containerElement"===e||"view:containerElement"===e||"element"===e||"view:element"===e):"rootElement"===e||"view:rootElement"===e||"editableElement"===e||"view:editableElement"===e||"containerElement"===e||"view:containerElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e}},{key:"rootName",get:function(){return this.getCustomProperty(ude)},set:function(e){this._setCustomProperty(ude,e)}},{key:"_name",set:function(e){this.name=e}}])&&nde(t.prototype,n),r&&nde(t,r),i}(ede);function sde(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function cde(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};if(Xpe(this,e),!t.boundaries&&!t.startPosition)throw new moe.a("view-tree-walker-no-start-position",null);if(t.direction&&"forward"!=t.direction&&"backward"!=t.direction)throw new moe.a("view-tree-walker-unknown-direction",t.startPosition,{direction:t.direction});this.boundaries=t.boundaries||null,t.startPosition?this.position=rde._createAt(t.startPosition):this.position=rde._createAt(t.boundaries["backward"==t.direction?"end":"start"]),this.direction=t.direction||"forward",this.singleCharacters=!!t.singleCharacters,this.shallow=!!t.shallow,this.ignoreElementEnd=!!t.ignoreElementEnd,this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null,this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null}var t,n,r;return t=e,(n=[{key:Symbol.iterator,value:function(){return this}},{key:"skip",value:function(e){var t,n,r;do{r=this.position;var o=this.next();t=o.done,n=o.value}while(!t&&e(n));t||(this.position=r)}},{key:"next",value:function(){return"forward"==this.direction?this._next():this._previous()}},{key:"_next",value:function(){var e,t=this.position.clone(),n=this.position,r=t.parent;if(null===r.parent&&t.offset===r.childCount)return{done:!0};if(r===this._boundaryEndParent&&t.offset==this.boundaries.end.offset)return{done:!0};if(r instanceof Ffe){if(t.isAtEnd)return this.position=rde._createAfter(r),this._next();e=r.data[t.offset]}else e=r.getChild(t.offset);if(e instanceof kpe)return this.shallow?t.offset++:t=new rde(e,0),this.position=t,this._formatReturnValue("elementStart",e,n,t,1);if(e instanceof Ffe){if(this.singleCharacters)return t=new rde(e,0),this.position=t,this._next();var o,i=e.data.length;return e==this._boundaryEndParent?(i=this.boundaries.end.offset,o=new Nfe(e,0,i),t=rde._createAfter(o)):(o=new Nfe(e,0,e.data.length),t.offset++),this.position=t,this._formatReturnValue("text",o,n,t,i)}if("string"==typeof e){var a;a=this.singleCharacters?1:(r===this._boundaryEndParent?this.boundaries.end.offset:r.data.length)-t.offset;var u=new Nfe(r,t.offset,a);return t.offset+=a,this.position=t,this._formatReturnValue("text",u,n,t,a)}return t=rde._createAfter(r),this.position=t,this.ignoreElementEnd?this._next():this._formatReturnValue("elementEnd",r,n,t)}},{key:"_previous",value:function(){var e,t=this.position.clone(),n=this.position,r=t.parent;if(null===r.parent&&0===t.offset)return{done:!0};if(r==this._boundaryStartParent&&t.offset==this.boundaries.start.offset)return{done:!0};if(r instanceof Ffe){if(t.isAtStart)return this.position=rde._createBefore(r),this._previous();e=r.data[t.offset-1]}else e=r.getChild(t.offset-1);if(e instanceof kpe)return this.shallow?(t.offset--,this.position=t,this._formatReturnValue("elementStart",e,n,t,1)):(t=new rde(e,e.childCount),this.position=t,this.ignoreElementEnd?this._previous():this._formatReturnValue("elementEnd",e,n,t));if(e instanceof Ffe){if(this.singleCharacters)return t=new rde(e,e.data.length),this.position=t,this._previous();var o,i=e.data.length;if(e==this._boundaryStartParent){var a=this.boundaries.start.offset;i=(o=new Nfe(e,a,e.data.length-a)).data.length,t=rde._createBefore(o)}else o=new Nfe(e,0,e.data.length),t.offset--;return this.position=t,this._formatReturnValue("text",o,n,t,i)}if("string"==typeof e){var u;if(this.singleCharacters)u=1;else{var l=r===this._boundaryStartParent?this.boundaries.start.offset:0;u=t.offset-l}t.offset-=u;var s=new Nfe(r,t.offset,u);return this.position=t,this._formatReturnValue("text",s,n,t,u)}return t=rde._createBefore(r),this.position=t,this._formatReturnValue("elementStart",r,n,t,1)}},{key:"_formatReturnValue",value:function(e,t,n,r,o){return t instanceof Nfe&&(t.offsetInText+t.data.length==t.textNode.data.length&&("forward"!=this.direction||this.boundaries&&this.boundaries.end.isEqual(this.position)?n=rde._createAfter(t.textNode):(r=rde._createAfter(t.textNode),this.position=r)),0===t.offsetInText&&("backward"!=this.direction||this.boundaries&&this.boundaries.start.isEqual(this.position)?n=rde._createBefore(t.textNode):(r=rde._createBefore(t.textNode),this.position=r))),{done:!1,value:{type:e,item:t,previousPosition:n,nextPosition:r,length:o}}}}])&&ede(t.prototype,n),r&&ede(t,r),e}();function nde(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};if(sde(this,e),!t.boundaries&&!t.startPosition)throw new joe.a("view-tree-walker-no-start-position",null);if(t.direction&&"forward"!=t.direction&&"backward"!=t.direction)throw new joe.a("view-tree-walker-unknown-direction",t.startPosition,{direction:t.direction});this.boundaries=t.boundaries||null,t.startPosition?this.position=dde._createAt(t.startPosition):this.position=dde._createAt(t.boundaries["backward"==t.direction?"end":"start"]),this.direction=t.direction||"forward",this.singleCharacters=!!t.singleCharacters,this.shallow=!!t.shallow,this.ignoreElementEnd=!!t.ignoreElementEnd,this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null,this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null}var t,n,r;return t=e,(n=[{key:Symbol.iterator,value:function(){return this}},{key:"skip",value:function(e){var t,n,r;do{r=this.position;var o=this.next();t=o.done,n=o.value}while(!t&&e(n));t||(this.position=r)}},{key:"next",value:function(){return"forward"==this.direction?this._next():this._previous()}},{key:"_next",value:function(){var e,t=this.position.clone(),n=this.position,r=t.parent;if(null===r.parent&&t.offset===r.childCount)return{done:!0};if(r===this._boundaryEndParent&&t.offset==this.boundaries.end.offset)return{done:!0};if(r instanceof $fe){if(t.isAtEnd)return this.position=dde._createAfter(r),this._next();e=r.data[t.offset]}else e=r.getChild(t.offset);if(e instanceof Ape)return this.shallow?t.offset++:t=new dde(e,0),this.position=t,this._formatReturnValue("elementStart",e,n,t,1);if(e instanceof $fe){if(this.singleCharacters)return t=new dde(e,0),this.position=t,this._next();var o,i=e.data.length;return e==this._boundaryEndParent?(i=this.boundaries.end.offset,o=new Zfe(e,0,i),t=dde._createAfter(o)):(o=new Zfe(e,0,e.data.length),t.offset++),this.position=t,this._formatReturnValue("text",o,n,t,i)}if("string"==typeof e){var a;a=this.singleCharacters?1:(r===this._boundaryEndParent?this.boundaries.end.offset:r.data.length)-t.offset;var u=new Zfe(r,t.offset,a);return t.offset+=a,this.position=t,this._formatReturnValue("text",u,n,t,a)}return t=dde._createAfter(r),this.position=t,this.ignoreElementEnd?this._next():this._formatReturnValue("elementEnd",r,n,t)}},{key:"_previous",value:function(){var e,t=this.position.clone(),n=this.position,r=t.parent;if(null===r.parent&&0===t.offset)return{done:!0};if(r==this._boundaryStartParent&&t.offset==this.boundaries.start.offset)return{done:!0};if(r instanceof $fe){if(t.isAtStart)return this.position=dde._createBefore(r),this._previous();e=r.data[t.offset-1]}else e=r.getChild(t.offset-1);if(e instanceof Ape)return this.shallow?(t.offset--,this.position=t,this._formatReturnValue("elementStart",e,n,t,1)):(t=new dde(e,e.childCount),this.position=t,this.ignoreElementEnd?this._previous():this._formatReturnValue("elementEnd",e,n,t));if(e instanceof $fe){if(this.singleCharacters)return t=new dde(e,e.data.length),this.position=t,this._previous();var o,i=e.data.length;if(e==this._boundaryStartParent){var a=this.boundaries.start.offset;i=(o=new Zfe(e,a,e.data.length-a)).data.length,t=dde._createBefore(o)}else o=new Zfe(e,0,e.data.length),t.offset--;return this.position=t,this._formatReturnValue("text",o,n,t,i)}if("string"==typeof e){var u;if(this.singleCharacters)u=1;else{var l=r===this._boundaryStartParent?this.boundaries.start.offset:0;u=t.offset-l}t.offset-=u;var s=new Zfe(r,t.offset,u);return this.position=t,this._formatReturnValue("text",s,n,t,u)}return t=dde._createBefore(r),this.position=t,this._formatReturnValue("elementStart",r,n,t,1)}},{key:"_formatReturnValue",value:function(e,t,n,r,o){return t instanceof Zfe&&(t.offsetInText+t.data.length==t.textNode.data.length&&("forward"!=this.direction||this.boundaries&&this.boundaries.end.isEqual(this.position)?n=dde._createAfter(t.textNode):(r=dde._createAfter(t.textNode),this.position=r)),0===t.offsetInText&&("backward"!=this.direction||this.boundaries&&this.boundaries.start.isEqual(this.position)?n=dde._createBefore(t.textNode):(r=dde._createBefore(t.textNode),this.position=r))),{done:!1,value:{type:e,item:t,previousPosition:n,nextPosition:r,length:o}}}}])&&cde(t.prototype,n),r&&cde(t,r),e}();function pde(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{};t.startPosition=this;var n=new tde(t);return n.skip(e),n.position}},{key:"getAncestors",value:function(){return this.parent.is("documentFragment")?[this.parent]:this.parent.getAncestors({includeSelf:!0})}},{key:"getCommonAncestor",value:function(e){for(var t=this.getAncestors(),n=e.getAncestors(),r=0;t[r]==n[r]&&t[r];)r++;return 0===r?null:t[r-1]}},{key:"is",value:function(e){return"position"===e||"view:position"===e}},{key:"isEqual",value:function(e){return this.parent==e.parent&&this.offset==e.offset}},{key:"isBefore",value:function(e){return"before"==this.compareWith(e)}},{key:"isAfter",value:function(e){return"after"==this.compareWith(e)}},{key:"compareWith",value:function(e){if(this.root!==e.root)return"different";if(this.isEqual(e))return"same";var t=this.parent.is("node")?this.parent.getPath():[],n=e.parent.is("node")?e.parent.getPath():[];t.push(this.offset),n.push(e.offset);var r=Cfe(t,n);switch(r){case"prefix":return"before";case"extension":return"after";default:return t[r]0&&void 0!==arguments[0]?arguments[0]:{};return e.startPosition=this,new tde(e)}},{key:"clone",value:function(){return new e(this.parent,this.offset)}},{key:"nodeAfter",get:function(){return this.parent.is("$text")?null:this.parent.getChild(this.offset)||null}},{key:"nodeBefore",get:function(){return this.parent.is("$text")?null:this.parent.getChild(this.offset-1)||null}},{key:"isAtStart",get:function(){return 0===this.offset}},{key:"isAtEnd",get:function(){var e=this.parent.is("$text")?this.parent.data.length:this.parent.childCount;return this.offset===e}},{key:"root",get:function(){return this.parent.root}},{key:"editableElement",get:function(){for(var e=this.parent;!(e instanceof Wpe);){if(!e.parent)return null;e=e.parent}return e}}])&&nde(t.prototype,n),r&&nde(t,r),e}();function ode(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return ide(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ide(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function ide(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:{};t.startPosition=this;var n=new fde(t);return n.skip(e),n.position}},{key:"getAncestors",value:function(){return this.parent.is("documentFragment")?[this.parent]:this.parent.getAncestors({includeSelf:!0})}},{key:"getCommonAncestor",value:function(e){for(var t=this.getAncestors(),n=e.getAncestors(),r=0;t[r]==n[r]&&t[r];)r++;return 0===r?null:t[r-1]}},{key:"is",value:function(e){return"position"===e||"view:position"===e}},{key:"isEqual",value:function(e){return this.parent==e.parent&&this.offset==e.offset}},{key:"isBefore",value:function(e){return"before"==this.compareWith(e)}},{key:"isAfter",value:function(e){return"after"==this.compareWith(e)}},{key:"compareWith",value:function(e){if(this.root!==e.root)return"different";if(this.isEqual(e))return"same";var t=this.parent.is("node")?this.parent.getPath():[],n=e.parent.is("node")?e.parent.getPath():[];t.push(this.offset),n.push(e.offset);var r=Ffe(t,n);switch(r){case"prefix":return"before";case"extension":return"after";default:return t[r]0&&void 0!==arguments[0]?arguments[0]:{};return e.startPosition=this,new fde(e)}},{key:"clone",value:function(){return new e(this.parent,this.offset)}},{key:"nodeAfter",get:function(){return this.parent.is("$text")?null:this.parent.getChild(this.offset)||null}},{key:"nodeBefore",get:function(){return this.parent.is("$text")?null:this.parent.getChild(this.offset-1)||null}},{key:"isAtStart",get:function(){return 0===this.offset}},{key:"isAtEnd",get:function(){var e=this.parent.is("$text")?this.parent.data.length:this.parent.childCount;return this.offset===e}},{key:"root",get:function(){return this.parent.root}},{key:"editableElement",get:function(){for(var e=this.parent;!(e instanceof ede);){if(!e.parent)return null;e=e.parent}return e}}])&&pde(t.prototype,n),r&&pde(t,r),e}();function hde(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return yde(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return yde(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function yde(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:null;ade(this,e),this.start=t.clone(),this.end=n?n.clone():t.clone()}var t,n,r;return t=e,n=[{key:Symbol.iterator,value:regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.delegateYield(new tde({boundaries:this,ignoreElementEnd:!0}),"t0",1);case 1:case"end":return e.stop()}}),e,this)}))},{key:"getEnlarged",value:function(){var t=this.start.getLastMatchingPosition(sde,{direction:"backward"}),n=this.end.getLastMatchingPosition(sde);return t.parent.is("$text")&&t.isAtStart&&(t=rde._createBefore(t.parent)),n.parent.is("$text")&&n.isAtEnd&&(n=rde._createAfter(n.parent)),new e(t,n)}},{key:"getTrimmed",value:function(){var t=this.start.getLastMatchingPosition(sde);if(t.isAfter(this.end)||t.isEqual(this.end))return new e(t,t);var n=this.end.getLastMatchingPosition(sde,{direction:"backward"}),r=t.nodeAfter,o=n.nodeBefore;return r&&r.is("$text")&&(t=new rde(r,0)),o&&o.is("$text")&&(n=new rde(o,o.data.length)),new e(t,n)}},{key:"isEqual",value:function(e){return this==e||this.start.isEqual(e.start)&&this.end.isEqual(e.end)}},{key:"containsPosition",value:function(e){return e.isAfter(this.start)&&e.isBefore(this.end)}},{key:"containsRange",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e.isCollapsed&&(t=!1);var n=this.containsPosition(e.start)||t&&this.start.isEqual(e.start),r=this.containsPosition(e.end)||t&&this.end.isEqual(e.end);return n&&r}},{key:"getDifference",value:function(t){var n=[];return this.isIntersecting(t)?(this.containsPosition(t.start)&&n.push(new e(this.start,t.start)),this.containsPosition(t.end)&&n.push(new e(t.end,this.end))):n.push(this.clone()),n}},{key:"getIntersection",value:function(t){if(this.isIntersecting(t)){var n=this.start,r=this.end;return this.containsPosition(t.start)&&(n=t.start),this.containsPosition(t.end)&&(r=t.end),new e(n,r)}return null}},{key:"getWalker",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.boundaries=this,new tde(e)}},{key:"getCommonAncestor",value:function(){return this.start.getCommonAncestor(this.end)}},{key:"getContainedElement",value:function(){if(this.isCollapsed)return null;var e=this.start.nodeAfter,t=this.end.nodeBefore;return this.start.parent.is("$text")&&this.start.isAtEnd&&this.start.parent.nextSibling&&(e=this.start.parent.nextSibling),this.end.parent.is("$text")&&this.end.isAtStart&&this.end.parent.previousSibling&&(t=this.end.parent.previousSibling),e&&e.is("element")&&e===t?e:null}},{key:"clone",value:function(){return new e(this.start,this.end)}},{key:"getItems",value:regeneratorRuntime.mark((function e(){var t,n,r,o,i,a=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:(t=a.length>0&&void 0!==a[0]?a[0]:{}).boundaries=this,t.ignoreElementEnd=!0,n=new tde(t),r=ode(n),e.prev=5,r.s();case 7:if((o=r.n()).done){e.next=13;break}return i=o.value,e.next=11,i.item;case 11:e.next=7;break;case 13:e.next=18;break;case 15:e.prev=15,e.t0=e.catch(5),r.e(e.t0);case 18:return e.prev=18,r.f(),e.finish(18);case 21:case"end":return e.stop()}}),e,this,[[5,15,18,21]])}))},{key:"getPositions",value:regeneratorRuntime.mark((function e(){var t,n,r,o,i,a=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(t=a.length>0&&void 0!==a[0]?a[0]:{}).boundaries=this,n=new tde(t),e.next=5,n.position;case 5:r=ode(n),e.prev=6,r.s();case 8:if((o=r.n()).done){e.next=14;break}return i=o.value,e.next=12,i.nextPosition;case 12:e.next=8;break;case 14:e.next=19;break;case 16:e.prev=16,e.t0=e.catch(6),r.e(e.t0);case 19:return e.prev=19,r.f(),e.finish(19);case 22:case"end":return e.stop()}}),e,this,[[6,16,19,22]])}))},{key:"is",value:function(e){return"range"===e||"view:range"===e}},{key:"isIntersecting",value:function(e){return this.start.isBefore(e.end)&&this.end.isAfter(e.start)}},{key:"isCollapsed",get:function(){return this.start.isEqual(this.end)}},{key:"isFlat",get:function(){return this.start.parent===this.end.parent}},{key:"root",get:function(){return this.start.root}}],r=[{key:"_createFromParentsAndOffsets",value:function(e,t,n,r){return new this(new rde(e,t),new rde(n,r))}},{key:"_createFromPositionAndShift",value:function(e,t){var n=e,r=e.getShiftedBy(t);return t>0?new this(n,r):new this(r,n)}},{key:"_createIn",value:function(e){return this._createFromParentsAndOffsets(e,0,e,e.childCount)}},{key:"_createOn",value:function(e){var t=e.is("$textProxy")?e.offsetSize:1;return this._createFromPositionAndShift(rde._createBefore(e),t)}}],n&&ude(t.prototype,n),r&&ude(t,r),e}();function sde(e){return!(!e.item.is("attributeElement")&&!e.item.is("uiElement"))}function cde(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return fde(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return fde(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function fde(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:null;mde(this,e),this.start=t.clone(),this.end=n?n.clone():t.clone()}var t,n,r;return t=e,n=[{key:Symbol.iterator,value:regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.delegateYield(new fde({boundaries:this,ignoreElementEnd:!0}),"t0",1);case 1:case"end":return e.stop()}}),e,this)}))},{key:"getEnlarged",value:function(){var t=this.start.getLastMatchingPosition(gde,{direction:"backward"}),n=this.end.getLastMatchingPosition(gde);return t.parent.is("$text")&&t.isAtStart&&(t=dde._createBefore(t.parent)),n.parent.is("$text")&&n.isAtEnd&&(n=dde._createAfter(n.parent)),new e(t,n)}},{key:"getTrimmed",value:function(){var t=this.start.getLastMatchingPosition(gde);if(t.isAfter(this.end)||t.isEqual(this.end))return new e(t,t);var n=this.end.getLastMatchingPosition(gde,{direction:"backward"}),r=t.nodeAfter,o=n.nodeBefore;return r&&r.is("$text")&&(t=new dde(r,0)),o&&o.is("$text")&&(n=new dde(o,o.data.length)),new e(t,n)}},{key:"isEqual",value:function(e){return this==e||this.start.isEqual(e.start)&&this.end.isEqual(e.end)}},{key:"containsPosition",value:function(e){return e.isAfter(this.start)&&e.isBefore(this.end)}},{key:"containsRange",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e.isCollapsed&&(t=!1);var n=this.containsPosition(e.start)||t&&this.start.isEqual(e.start),r=this.containsPosition(e.end)||t&&this.end.isEqual(e.end);return n&&r}},{key:"getDifference",value:function(t){var n=[];return this.isIntersecting(t)?(this.containsPosition(t.start)&&n.push(new e(this.start,t.start)),this.containsPosition(t.end)&&n.push(new e(t.end,this.end))):n.push(this.clone()),n}},{key:"getIntersection",value:function(t){if(this.isIntersecting(t)){var n=this.start,r=this.end;return this.containsPosition(t.start)&&(n=t.start),this.containsPosition(t.end)&&(r=t.end),new e(n,r)}return null}},{key:"getWalker",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.boundaries=this,new fde(e)}},{key:"getCommonAncestor",value:function(){return this.start.getCommonAncestor(this.end)}},{key:"getContainedElement",value:function(){if(this.isCollapsed)return null;var e=this.start.nodeAfter,t=this.end.nodeBefore;return this.start.parent.is("$text")&&this.start.isAtEnd&&this.start.parent.nextSibling&&(e=this.start.parent.nextSibling),this.end.parent.is("$text")&&this.end.isAtStart&&this.end.parent.previousSibling&&(t=this.end.parent.previousSibling),e&&e.is("element")&&e===t?e:null}},{key:"clone",value:function(){return new e(this.start,this.end)}},{key:"getItems",value:regeneratorRuntime.mark((function e(){var t,n,r,o,i,a=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:(t=a.length>0&&void 0!==a[0]?a[0]:{}).boundaries=this,t.ignoreElementEnd=!0,n=new fde(t),r=hde(n),e.prev=5,r.s();case 7:if((o=r.n()).done){e.next=13;break}return i=o.value,e.next=11,i.item;case 11:e.next=7;break;case 13:e.next=18;break;case 15:e.prev=15,e.t0=e.catch(5),r.e(e.t0);case 18:return e.prev=18,r.f(),e.finish(18);case 21:case"end":return e.stop()}}),e,this,[[5,15,18,21]])}))},{key:"getPositions",value:regeneratorRuntime.mark((function e(){var t,n,r,o,i,a=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(t=a.length>0&&void 0!==a[0]?a[0]:{}).boundaries=this,n=new fde(t),e.next=5,n.position;case 5:r=hde(n),e.prev=6,r.s();case 8:if((o=r.n()).done){e.next=14;break}return i=o.value,e.next=12,i.nextPosition;case 12:e.next=8;break;case 14:e.next=19;break;case 16:e.prev=16,e.t0=e.catch(6),r.e(e.t0);case 19:return e.prev=19,r.f(),e.finish(19);case 22:case"end":return e.stop()}}),e,this,[[6,16,19,22]])}))},{key:"is",value:function(e){return"range"===e||"view:range"===e}},{key:"isIntersecting",value:function(e){return this.start.isBefore(e.end)&&this.end.isAfter(e.start)}},{key:"isCollapsed",get:function(){return this.start.isEqual(this.end)}},{key:"isFlat",get:function(){return this.start.parent===this.end.parent}},{key:"root",get:function(){return this.start.root}}],r=[{key:"_createFromParentsAndOffsets",value:function(e,t,n,r){return new this(new dde(e,t),new dde(n,r))}},{key:"_createFromPositionAndShift",value:function(e,t){var n=e,r=e.getShiftedBy(t);return t>0?new this(n,r):new this(r,n)}},{key:"_createIn",value:function(e){return this._createFromParentsAndOffsets(e,0,e,e.childCount)}},{key:"_createOn",value:function(e){var t=e.is("$textProxy")?e.offsetSize:1;return this._createFromPositionAndShift(dde._createBefore(e),t)}}],n&&bde(t.prototype,n),r&&bde(t,r),e}();function gde(e){return!(!e.item.is("attributeElement")&&!e.item.is("uiElement"))}function wde(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return _de(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _de(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function _de(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function hde(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function kde(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;yde(this,e),this._ranges=[],this._lastRangeBackward=!1,this._isFake=!1,this._fakeSelectionLabel="",this.setTo(t,n,r)}var t,n,r;return t=e,(n=[{key:"getRanges",value:regeneratorRuntime.mark((function e(){var t,n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=dde(this._ranges),e.prev=1,t.s();case 3:if((n=t.n()).done){e.next=9;break}return r=n.value,e.next=7,r.clone();case 7:e.next=3;break;case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(1),t.e(e.t0);case 14:return e.prev=14,t.f(),e.finish(14);case 17:case"end":return e.stop()}}),e,this,[[1,11,14,17]])}))},{key:"getFirstRange",value:function(){var e,t=null,n=dde(this._ranges);try{for(n.s();!(e=n.n()).done;){var r=e.value;t&&!r.start.isBefore(t.start)||(t=r)}}catch(e){n.e(e)}finally{n.f()}return t?t.clone():null}},{key:"getLastRange",value:function(){var e,t=null,n=dde(this._ranges);try{for(n.s();!(e=n.n()).done;){var r=e.value;t&&!r.end.isAfter(t.end)||(t=r)}}catch(e){n.e(e)}finally{n.f()}return t?t.clone():null}},{key:"getFirstPosition",value:function(){var e=this.getFirstRange();return e?e.start.clone():null}},{key:"getLastPosition",value:function(){var e=this.getLastRange();return e?e.end.clone():null}},{key:"isEqual",value:function(e){if(this.isFake!=e.isFake)return!1;if(this.isFake&&this.fakeSelectionLabel!=e.fakeSelectionLabel)return!1;if(this.rangeCount!=e.rangeCount)return!1;if(0===this.rangeCount)return!0;if(!this.anchor.isEqual(e.anchor)||!this.focus.isEqual(e.focus))return!1;var t,n=dde(this._ranges);try{for(n.s();!(t=n.n()).done;){var r,o=t.value,i=!1,a=dde(e._ranges);try{for(a.s();!(r=a.n()).done;){var u=r.value;if(o.isEqual(u)){i=!0;break}}}catch(e){a.e(e)}finally{a.f()}if(!i)return!1}}catch(e){n.e(e)}finally{n.f()}return!0}},{key:"isSimilar",value:function(e){if(this.isBackward!=e.isBackward)return!1;var t=pde(this.getRanges());if(t!=pde(e.getRanges()))return!1;if(0==t)return!0;var n,r=dde(this.getRanges());try{for(r.s();!(n=r.n()).done;){var o=n.value;o=o.getTrimmed();var i,a=!1,u=dde(e.getRanges());try{for(u.s();!(i=u.n()).done;){var l=i.value;if(l=l.getTrimmed(),o.start.isEqual(l.start)&&o.end.isEqual(l.end)){a=!0;break}}}catch(e){u.e(e)}finally{u.f()}if(!a)return!1}}catch(e){r.e(e)}finally{r.f()}return!0}},{key:"getSelectedElement",value:function(){return 1!==this.rangeCount?null:this.getFirstRange().getContainedElement()}},{key:"setTo",value:function(t,n,r){if(null===t)this._setRanges([]),this._setFakeOptions(n);else if(t instanceof e||t instanceof wde)this._setRanges(t.getRanges(),t.isBackward),this._setFakeOptions({fake:t.isFake,label:t.fakeSelectionLabel});else if(t instanceof lde)this._setRanges([t],n&&n.backward),this._setFakeOptions(n);else if(t instanceof rde)this._setRanges([new lde(t)]),this._setFakeOptions(n);else if(t instanceof Dfe){var o,i=!!r&&!!r.backward;if(void 0===n)throw new moe.a("view-selection-setto-required-second-parameter",this);o="in"==n?lde._createIn(t):"on"==n?lde._createOn(t):new lde(rde._createAt(t,n)),this._setRanges([o],i),this._setFakeOptions(r)}else{if(!Tie(t))throw new moe.a("view-selection-setto-not-selectable",this);this._setRanges(t,n&&n.backward),this._setFakeOptions(n)}this.fire("change")}},{key:"setFocus",value:function(e,t){if(null===this.anchor)throw new moe.a("view-selection-setfocus-no-ranges",this);var n=rde._createAt(e,t);if("same"!=n.compareWith(this.focus)){var r=this.anchor;this._ranges.pop(),"before"==n.compareWith(r)?this._addRange(new lde(n,r),!0):this._addRange(new lde(r,n)),this.fire("change")}}},{key:"is",value:function(e){return"selection"===e||"view:selection"===e}},{key:"_setRanges",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e=Array.from(e),this._ranges=[];var n,r=dde(e);try{for(r.s();!(n=r.n()).done;){var o=n.value;this._addRange(o)}}catch(e){r.e(e)}finally{r.f()}this._lastRangeBackward=!!t}},{key:"_setFakeOptions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._isFake=!!e.fake,this._fakeSelectionLabel=e.fake&&e.label||""}},{key:"_addRange",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!(e instanceof lde))throw new moe.a("view-selection-add-range-not-range",this);this._pushRange(e),this._lastRangeBackward=!!t}},{key:"_pushRange",value:function(e){var t,n=dde(this._ranges);try{for(n.s();!(t=n.n()).done;){var r=t.value;if(e.isIntersecting(r))throw new moe.a("view-selection-range-intersects",this,{addedRange:e,intersectingRange:r})}}catch(e){n.e(e)}finally{n.f()}this._ranges.push(new lde(e.start,e.end))}},{key:"isFake",get:function(){return this._isFake}},{key:"fakeSelectionLabel",get:function(){return this._fakeSelectionLabel}},{key:"anchor",get:function(){if(!this._ranges.length)return null;var e=this._ranges[this._ranges.length-1];return(this._lastRangeBackward?e.end:e.start).clone()}},{key:"focus",get:function(){if(!this._ranges.length)return null;var e=this._ranges[this._ranges.length-1];return(this._lastRangeBackward?e.start:e.end).clone()}},{key:"isCollapsed",get:function(){return 1===this.rangeCount&&this._ranges[0].isCollapsed}},{key:"rangeCount",get:function(){return this._ranges.length}},{key:"isBackward",get:function(){return!this.isCollapsed&&this._lastRangeBackward}},{key:"editableElement",get:function(){return this.anchor?this.anchor.editableElement:null}}])&&mde(t.prototype,n),r&&mde(t,r),e}();function vde(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function gde(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;Pde(this,e),this._ranges=[],this._lastRangeBackward=!1,this._isFake=!1,this._fakeSelectionLabel="",this.setTo(t,n,r)}var t,n,r;return t=e,(n=[{key:"getRanges",value:regeneratorRuntime.mark((function e(){var t,n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=Sde(this._ranges),e.prev=1,t.s();case 3:if((n=t.n()).done){e.next=9;break}return r=n.value,e.next=7,r.clone();case 7:e.next=3;break;case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(1),t.e(e.t0);case 14:return e.prev=14,t.f(),e.finish(14);case 17:case"end":return e.stop()}}),e,this,[[1,11,14,17]])}))},{key:"getFirstRange",value:function(){var e,t=null,n=Sde(this._ranges);try{for(n.s();!(e=n.n()).done;){var r=e.value;t&&!r.start.isBefore(t.start)||(t=r)}}catch(e){n.e(e)}finally{n.f()}return t?t.clone():null}},{key:"getLastRange",value:function(){var e,t=null,n=Sde(this._ranges);try{for(n.s();!(e=n.n()).done;){var r=e.value;t&&!r.end.isAfter(t.end)||(t=r)}}catch(e){n.e(e)}finally{n.f()}return t?t.clone():null}},{key:"getFirstPosition",value:function(){var e=this.getFirstRange();return e?e.start.clone():null}},{key:"getLastPosition",value:function(){var e=this.getLastRange();return e?e.end.clone():null}},{key:"isEqual",value:function(e){if(this.isFake!=e.isFake)return!1;if(this.isFake&&this.fakeSelectionLabel!=e.fakeSelectionLabel)return!1;if(this.rangeCount!=e.rangeCount)return!1;if(0===this.rangeCount)return!0;if(!this.anchor.isEqual(e.anchor)||!this.focus.isEqual(e.focus))return!1;var t,n=Sde(this._ranges);try{for(n.s();!(t=n.n()).done;){var r,o=t.value,i=!1,a=Sde(e._ranges);try{for(a.s();!(r=a.n()).done;){var u=r.value;if(o.isEqual(u)){i=!0;break}}}catch(e){a.e(e)}finally{a.f()}if(!i)return!1}}catch(e){n.e(e)}finally{n.f()}return!0}},{key:"isSimilar",value:function(e){if(this.isBackward!=e.isBackward)return!1;var t=Ode(this.getRanges());if(t!=Ode(e.getRanges()))return!1;if(0==t)return!0;var n,r=Sde(this.getRanges());try{for(r.s();!(n=r.n()).done;){var o=n.value;o=o.getTrimmed();var i,a=!1,u=Sde(e.getRanges());try{for(u.s();!(i=u.n()).done;){var l=i.value;if(l=l.getTrimmed(),o.start.isEqual(l.start)&&o.end.isEqual(l.end)){a=!0;break}}}catch(e){u.e(e)}finally{u.f()}if(!a)return!1}}catch(e){r.e(e)}finally{r.f()}return!0}},{key:"getSelectedElement",value:function(){return 1!==this.rangeCount?null:this.getFirstRange().getContainedElement()}},{key:"setTo",value:function(t,n,r){if(null===t)this._setRanges([]),this._setFakeOptions(n);else if(t instanceof e||t instanceof Tde)this._setRanges(t.getRanges(),t.isBackward),this._setFakeOptions({fake:t.isFake,label:t.fakeSelectionLabel});else if(t instanceof vde)this._setRanges([t],n&&n.backward),this._setFakeOptions(n);else if(t instanceof dde)this._setRanges([new vde(t)]),this._setFakeOptions(n);else if(t instanceof Bfe){var o,i=!!r&&!!r.backward;if(void 0===n)throw new joe.a("view-selection-setto-required-second-parameter",this);o="in"==n?vde._createIn(t):"on"==n?vde._createOn(t):new vde(dde._createAt(t,n)),this._setRanges([o],i),this._setFakeOptions(r)}else{if(!Nie(t))throw new joe.a("view-selection-setto-not-selectable",this);this._setRanges(t,n&&n.backward),this._setFakeOptions(n)}this.fire("change")}},{key:"setFocus",value:function(e,t){if(null===this.anchor)throw new joe.a("view-selection-setfocus-no-ranges",this);var n=dde._createAt(e,t);if("same"!=n.compareWith(this.focus)){var r=this.anchor;this._ranges.pop(),"before"==n.compareWith(r)?this._addRange(new vde(n,r),!0):this._addRange(new vde(r,n)),this.fire("change")}}},{key:"is",value:function(e){return"selection"===e||"view:selection"===e}},{key:"_setRanges",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e=Array.from(e),this._ranges=[];var n,r=Sde(e);try{for(r.s();!(n=r.n()).done;){var o=n.value;this._addRange(o)}}catch(e){r.e(e)}finally{r.f()}this._lastRangeBackward=!!t}},{key:"_setFakeOptions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._isFake=!!e.fake,this._fakeSelectionLabel=e.fake&&e.label||""}},{key:"_addRange",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!(e instanceof vde))throw new joe.a("view-selection-add-range-not-range",this);this._pushRange(e),this._lastRangeBackward=!!t}},{key:"_pushRange",value:function(e){var t,n=Sde(this._ranges);try{for(n.s();!(t=n.n()).done;){var r=t.value;if(e.isIntersecting(r))throw new joe.a("view-selection-range-intersects",this,{addedRange:e,intersectingRange:r})}}catch(e){n.e(e)}finally{n.f()}this._ranges.push(new vde(e.start,e.end))}},{key:"isFake",get:function(){return this._isFake}},{key:"fakeSelectionLabel",get:function(){return this._fakeSelectionLabel}},{key:"anchor",get:function(){if(!this._ranges.length)return null;var e=this._ranges[this._ranges.length-1];return(this._lastRangeBackward?e.end:e.start).clone()}},{key:"focus",get:function(){if(!this._ranges.length)return null;var e=this._ranges[this._ranges.length-1];return(this._lastRangeBackward?e.start:e.end).clone()}},{key:"isCollapsed",get:function(){return 1===this.rangeCount&&this._ranges[0].isCollapsed}},{key:"rangeCount",get:function(){return this._ranges.length}},{key:"isBackward",get:function(){return!this.isCollapsed&&this._lastRangeBackward}},{key:"editableElement",get:function(){return this.anchor?this.anchor.editableElement:null}}])&&jde(t.prototype,n),r&&jde(t,r),e}();function Cde(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xde(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;vde(this,e),this._selection=new bde,this._selection.delegate("change").to(this),this._selection.setTo(t,n,r)}var t,n,r;return t=e,(n=[{key:"getRanges",value:regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.delegateYield(this._selection.getRanges(),"t0",1);case 1:case"end":return e.stop()}}),e,this)}))},{key:"getFirstRange",value:function(){return this._selection.getFirstRange()}},{key:"getLastRange",value:function(){return this._selection.getLastRange()}},{key:"getFirstPosition",value:function(){return this._selection.getFirstPosition()}},{key:"getLastPosition",value:function(){return this._selection.getLastPosition()}},{key:"getSelectedElement",value:function(){return this._selection.getSelectedElement()}},{key:"isEqual",value:function(e){return this._selection.isEqual(e)}},{key:"isSimilar",value:function(e){return this._selection.isSimilar(e)}},{key:"is",value:function(e){return"selection"===e||"documentSelection"==e||"view:selection"==e||"view:documentSelection"==e}},{key:"_setTo",value:function(e,t,n){this._selection.setTo(e,t,n)}},{key:"_setFocus",value:function(e,t){this._selection.setFocus(e,t)}},{key:"isFake",get:function(){return this._selection.isFake}},{key:"fakeSelectionLabel",get:function(){return this._selection.fakeSelectionLabel}},{key:"anchor",get:function(){return this._selection.anchor}},{key:"focus",get:function(){return this._selection.focus}},{key:"isCollapsed",get:function(){return this._selection.isCollapsed}},{key:"rangeCount",get:function(){return this._selection.rangeCount}},{key:"isBackward",get:function(){return this._selection.isBackward}},{key:"editableElement",get:function(){return this._selection.editableElement}},{key:"_ranges",get:function(){return this._selection._ranges}}])&&gde(t.prototype,n),r&&gde(t,r),e}();function _de(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Ode(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ode(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Ode(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;Cde(this,e),this._selection=new Ede,this._selection.delegate("change").to(this),this._selection.setTo(t,n,r)}var t,n,r;return t=e,(n=[{key:"getRanges",value:regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.delegateYield(this._selection.getRanges(),"t0",1);case 1:case"end":return e.stop()}}),e,this)}))},{key:"getFirstRange",value:function(){return this._selection.getFirstRange()}},{key:"getLastRange",value:function(){return this._selection.getLastRange()}},{key:"getFirstPosition",value:function(){return this._selection.getFirstPosition()}},{key:"getLastPosition",value:function(){return this._selection.getLastPosition()}},{key:"getSelectedElement",value:function(){return this._selection.getSelectedElement()}},{key:"isEqual",value:function(e){return this._selection.isEqual(e)}},{key:"isSimilar",value:function(e){return this._selection.isSimilar(e)}},{key:"is",value:function(e){return"selection"===e||"documentSelection"==e||"view:selection"==e||"view:documentSelection"==e}},{key:"_setTo",value:function(e,t,n){this._selection.setTo(e,t,n)}},{key:"_setFocus",value:function(e,t){this._selection.setFocus(e,t)}},{key:"isFake",get:function(){return this._selection.isFake}},{key:"fakeSelectionLabel",get:function(){return this._selection.fakeSelectionLabel}},{key:"anchor",get:function(){return this._selection.anchor}},{key:"focus",get:function(){return this._selection.focus}},{key:"isCollapsed",get:function(){return this._selection.isCollapsed}},{key:"rangeCount",get:function(){return this._selection.rangeCount}},{key:"isBackward",get:function(){return this._selection.isBackward}},{key:"editableElement",get:function(){return this._selection.editableElement}},{key:"_ranges",get:function(){return this._selection._ranges}}])&&xde(t.prototype,n),r&&xde(t,r),e}();function Dde(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Rde(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Rde(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Rde(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:"main";return this.roots.get(e)}},{key:"registerPostFixer",value:function(e){this._postFixers.add(e)}},{key:"destroy",value:function(){this.roots.map((function(e){return e.destroy()})),this.stopListening()}},{key:"_callPostFixers",value:function(e){var t=!1;do{var n,r=_de(this._postFixers);try{for(r.s();!(n=r.n()).done&&!(t=(0,n.value)(e)););}catch(e){r.e(e)}finally{r.f()}}while(t)}}])&&Sde(t.prototype,n),r&&Sde(t,r),e}();function Pde(e){return(Pde="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function jde(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:"main";return this.roots.get(e)}},{key:"registerPostFixer",value:function(e){this._postFixers.add(e)}},{key:"destroy",value:function(){this.roots.map((function(e){return e.destroy()})),this.stopListening()}},{key:"_callPostFixers",value:function(e){var t=!1;do{var n,r=Dde(this._postFixers);try{for(r.s();!(n=r.n()).done&&!(t=(0,n.value)(e)););}catch(e){r.e(e)}finally{r.f()}}while(t)}}])&&Mde(t.prototype,n),r&&Mde(t,r),e}();function Lde(e){return(Lde="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ide(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:null;return t?t===this.name&&("attributeElement"===e||"view:attributeElement"===e||"element"===e||"view:element"===e):"attributeElement"===e||"view:attributeElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e}},{key:"isSimilar",value:function(e){return null!==this.id||null!==e.id?this.id===e.id:Ede(Dde(i.prototype),"isSimilar",this).call(this,e)&&this.priority==e.priority}},{key:"_clone",value:function(e){var t=Ede(Dde(i.prototype),"_clone",this).call(this,e);return t._priority=this._priority,t._id=this._id,t}},{key:"priority",get:function(){return this._priority}},{key:"id",get:function(){return this._id}}])&&jde(t.prototype,n),r&&jde(t,r),i}(kpe);function Mde(){if(Ade(this))return null;for(var e=this.parent;e&&e.is("attributeElement");){if(Ade(e)>1)return null;e=e.parent}return!e||Ade(e)>1?null:this.childCount}function Ade(e){return Array.from(e.getChildren()).filter((function(e){return!e.is("uiElement")})).length}function Lde(e){return(Lde="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ide(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:null;return t?t===this.name&&("attributeElement"===e||"view:attributeElement"===e||"element"===e||"view:element"===e):"attributeElement"===e||"view:attributeElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e}},{key:"isSimilar",value:function(e){return null!==this.id||null!==e.id?this.id===e.id:zde(Bde(i.prototype),"isSimilar",this).call(this,e)&&this.priority==e.priority}},{key:"_clone",value:function(e){var t=zde(Bde(i.prototype),"_clone",this).call(this,e);return t._priority=this._priority,t._id=this._id,t}},{key:"priority",get:function(){return this._priority}},{key:"id",get:function(){return this._id}}])&&Ide(t.prototype,n),r&&Ide(t,r),i}(Ape);function Vde(){if(Wde(this))return null;for(var e=this.parent;e&&e.is("attributeElement");){if(Wde(e)>1)return null;e=e.parent}return!e||Wde(e)>1?null:this.childCount}function Wde(e){return Array.from(e.getChildren()).filter((function(e){return!e.is("uiElement")})).length}function Ude(e){return(Ude="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function qde(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:null;return t?t===this.name&&("emptyElement"===e||"view:emptyElement"===e||"element"===e||"view:element"===e):"emptyElement"===e||"view:emptyElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e}},{key:"_insertChild",value:function(e,t){if(t&&(t instanceof Dfe||Array.from(t).length>0))throw new moe.a("view-emptyelement-cannot-add",[this,t])}}])&&Ide(t.prototype,n),r&&Ide(t,r),i}(kpe);function Hde(){return null}function Vde(e){return(Vde="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Wde(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Ude(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ude(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Ude(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:null;return t?t===this.name&&("emptyElement"===e||"view:emptyElement"===e||"element"===e||"view:element"===e):"emptyElement"===e||"view:emptyElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e}},{key:"_insertChild",value:function(e,t){if(t&&(t instanceof Bfe||Array.from(t).length>0))throw new joe.a("view-emptyelement-cannot-add",[this,t])}}])&&qde(t.prototype,n),r&&qde(t,r),i}(Ape);function Qde(){return null}function Xde(e){return(Xde="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ehe(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return the(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return the(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function the(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:null;return t?t===this.name&&("uiElement"===e||"view:uiElement"===e||"element"===e||"view:element"===e):"uiElement"===e||"view:uiElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e}},{key:"_insertChild",value:function(e,t){if(t&&(t instanceof Dfe||Array.from(t).length>0))throw new moe.a("view-uielement-cannot-add",this)}},{key:"render",value:function(e){return this.toDomElement(e)}},{key:"toDomElement",value:function(e){var t,n=e.createElement(this.name),r=Wde(this.getAttributeKeys());try{for(r.s();!(t=r.n()).done;){var o=t.value;n.setAttribute(o,this.getAttribute(o))}}catch(e){r.e(e)}finally{r.f()}return n}}])&&qde(t.prototype,n),r&&qde(t,r),i}(kpe);function Qde(e){e.document.on("keydown",(function(t,n){return function(e,t,n){if(t.keyCode==jue.arrowright){var r=t.domTarget.ownerDocument.defaultView.getSelection(),o=1==r.rangeCount&&r.getRangeAt(0).collapsed;if(o||t.shiftKey){var i=r.focusNode,a=r.focusOffset,u=n.domPositionToView(i,a);if(null===u)return;var l=!1,s=u.getLastMatchingPosition((function(e){return e.item.is("uiElement")&&(l=!0),!(!e.item.is("uiElement")&&!e.item.is("attributeElement"))}));if(l){var c=n.viewPositionToDom(s);o?r.collapse(c.parent,c.offset):r.extend(c.parent,c.offset)}}}}(0,n,e.domConverter)}))}function Xde(){return null}function ehe(e){return(ehe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function the(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:null;return t?t===this.name&&("uiElement"===e||"view:uiElement"===e||"element"===e||"view:element"===e):"uiElement"===e||"view:uiElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e}},{key:"_insertChild",value:function(e,t){if(t&&(t instanceof Bfe||Array.from(t).length>0))throw new joe.a("view-uielement-cannot-add",this)}},{key:"render",value:function(e){return this.toDomElement(e)}},{key:"toDomElement",value:function(e){var t,n=e.createElement(this.name),r=ehe(this.getAttributeKeys());try{for(r.s();!(t=r.n()).done;){var o=t.value;n.setAttribute(o,this.getAttribute(o))}}catch(e){r.e(e)}finally{r.f()}return n}}])&&nhe(t.prototype,n),r&&nhe(t,r),i}(Ape);function lhe(e){e.document.on("keydown",(function(t,n){return function(e,t,n){if(t.keyCode==Iue.arrowright){var r=t.domTarget.ownerDocument.defaultView.getSelection(),o=1==r.rangeCount&&r.getRangeAt(0).collapsed;if(o||t.shiftKey){var i=r.focusNode,a=r.focusOffset,u=n.domPositionToView(i,a);if(null===u)return;var l=!1,s=u.getLastMatchingPosition((function(e){return e.item.is("uiElement")&&(l=!0),!(!e.item.is("uiElement")&&!e.item.is("attributeElement"))}));if(l){var c=n.viewPositionToDom(s);o?r.collapse(c.parent,c.offset):r.extend(c.parent,c.offset)}}}}(0,n,e.domConverter)}))}function she(){return null}function che(e){return(che="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function fhe(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:null;return t?t===this.name&&("rawElement"===e||"view:rawElement"===e||"element"===e||"view:element"===e):"rawElement"===e||"view:rawElement"===e||e===this.name||e==="view:"+this.name||"element"===e||"view:element"===e||"node"===e||"view:node"===e}},{key:"_insertChild",value:function(e,t){if(t&&(t instanceof Dfe||Array.from(t).length>0))throw new moe.a("view-rawelement-cannot-add",[this,t])}}])&&the(t.prototype,n),r&&the(t,r),i}(kpe);function uhe(){return null}function lhe(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return she(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return she(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function she(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:null;return t?t===this.name&&("rawElement"===e||"view:rawElement"===e||"element"===e||"view:element"===e):"rawElement"===e||"view:rawElement"===e||e===this.name||e==="view:"+this.name||"element"===e||"view:element"===e||"node"===e||"view:node"===e}},{key:"_insertChild",value:function(e,t){if(t&&(t instanceof Bfe||Array.from(t).length>0))throw new joe.a("view-rawelement-cannot-add",[this,t])}}])&&fhe(t.prototype,n),r&&fhe(t,r),i}(Ape);function bhe(){return null}function vhe(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return ghe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ghe(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function ghe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:1;this._fireChange("children",this);for(var n=e;n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function dhe(e){return function(e){if(Array.isArray(e))return yhe(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||hhe(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function hhe(e,t){if(e){if("string"==typeof e)return yhe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?yhe(e,t):void 0}}function yhe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:1;this._fireChange("children",this);for(var n=e;n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function She(e){return function(e){if(Array.isArray(e))return Phe(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||khe(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function khe(e,t){if(e){if("string"==typeof e)return Phe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Phe(e,t):void 0}}function Phe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:{},r=new Rde(this.document,e,t);return n.priority&&(r._priority=n.priority),n.id&&(r._id=n.id),r}},{key:"createContainerElement",value:function(e,t){return new Lpe(this.document,e,t)}},{key:"createEditableElement",value:function(e,t){var n=new Wpe(this.document,e,t);return n._document=this.document,n}},{key:"createEmptyElement",value:function(e,t){return new Bde(this.document,e,t)}},{key:"createUIElement",value:function(e,t,n){var r=new Jde(this.document,e,t);return n&&(r.render=n),r}},{key:"createRawElement",value:function(e,t,n){var r=new ahe(this.document,e,t);return r.render=n||function(){},r}},{key:"setAttribute",value:function(e,t,n){n._setAttribute(e,t)}},{key:"removeAttribute",value:function(e,t){t._removeAttribute(e)}},{key:"addClass",value:function(e,t){t._addClass(e)}},{key:"removeClass",value:function(e,t){t._removeClass(e)}},{key:"setStyle",value:function(e,t,n){tK(e)&&void 0===n&&(n=t),n._setStyle(e,t)}},{key:"removeStyle",value:function(e,t){t._removeStyle(e)}},{key:"setCustomProperty",value:function(e,t,n){n._setCustomProperty(e,t)}},{key:"removeCustomProperty",value:function(e,t){return t._removeCustomProperty(e)}},{key:"breakAttributes",value:function(e){return e instanceof rde?this._breakAttributes(e):this._breakAttributesRange(e)}},{key:"breakContainer",value:function(e){var t=e.parent;if(!t.is("containerElement"))throw new moe.a("view-writer-break-non-container-element",this.document);if(!t.parent)throw new moe.a("view-writer-break-root",this.document);if(e.isAtStart)return rde._createBefore(t);if(!e.isAtEnd){var n=t._clone(!1);this.insert(rde._createAfter(t),n);var r=new lde(e,rde._createAt(t,"end")),o=new rde(n,0);this.move(r,o)}return rde._createAfter(t)}},{key:"mergeAttributes",value:function(e){var t=e.offset,n=e.parent;if(n.is("$text"))return e;if(n.is("attributeElement")&&0===n.childCount){var r=n.parent,o=n.index;return n._remove(),this._removeFromClonedElementsGroup(n),this.mergeAttributes(new rde(r,o))}var i=n.getChild(t-1),a=n.getChild(t);if(!i||!a)return e;if(i.is("$text")&&a.is("$text"))return Ohe(i,a);if(i.is("attributeElement")&&a.is("attributeElement")&&i.isSimilar(a)){var u=i.childCount;return i._appendChild(a.getChildren()),a._remove(),this._removeFromClonedElementsGroup(a),this.mergeAttributes(new rde(i,u))}return e}},{key:"mergeContainers",value:function(e){var t=e.nodeBefore,n=e.nodeAfter;if(!(t&&n&&t.is("containerElement")&&n.is("containerElement")))throw new moe.a("view-writer-merge-containers-invalid-position",this.document);var r=t.getChild(t.childCount-1),o=r instanceof Ffe?rde._createAt(r,"end"):rde._createAt(t,"end");return this.move(lde._createIn(n),rde._createAt(t,"end")),this.remove(lde._createOn(n)),o}},{key:"insert",value:function(e,t){!function e(t,n){var r,o=phe(t);try{var i=function(){var t=r.value;if(!She.some((function(e){return t instanceof e})))throw new moe.a("view-writer-insert-invalid-node-type",n);t.is("$text")||e(t.getChildren(),n)};for(o.s();!(r=o.n()).done;)i()}catch(e){o.e(e)}finally{o.f()}}(t=Tie(t)?dhe(t):[t],this.document);var n=vhe(e);if(!n)throw new moe.a("view-writer-invalid-position-container",this.document);var r,o=this._breakAttributes(e,!0),i=n._insertChild(o.offset,t),a=phe(t);try{for(a.s();!(r=a.n()).done;){var u=r.value;this._addToClonedElementsGroup(u)}}catch(e){a.e(e)}finally{a.f()}var l=o.getShiftedBy(i),s=this.mergeAttributes(o);if(0===i)return new lde(s,s);s.isEqual(o)||l.offset--;var c=this.mergeAttributes(l);return new lde(s,c)}},{key:"remove",value:function(e){var t=e instanceof lde?e:lde._createOn(e);if(Phe(t,this.document),t.isCollapsed)return new fhe(this.document);var n,r=this._breakAttributesRange(t,!0),o=r.start,i=r.end,a=o.parent,u=i.offset-o.offset,l=a._removeChildren(o.offset,u),s=phe(l);try{for(s.s();!(n=s.n()).done;){var c=n.value;this._removeFromClonedElementsGroup(c)}}catch(e){s.e(e)}finally{s.f()}var f=this.mergeAttributes(o);return t.start=f,t.end=f.clone(),new fhe(this.document,l)}},{key:"clear",value:function(e,t){Phe(e,this.document);var n,r=phe(e.getWalker({direction:"backward",ignoreElementEnd:!0}));try{for(r.s();!(n=r.n()).done;){var o=n.value,i=o.item,a=void 0;if(i.is("element")&&t.isSimilar(i))a=lde._createOn(i);else if(!o.nextPosition.isAfter(e.start)&&i.is("$textProxy")){var u=i.getAncestors().find((function(e){return e.is("element")&&t.isSimilar(e)}));u&&(a=lde._createIn(u))}a&&(a.end.isAfter(e.end)&&(a.end=e.end),a.start.isBefore(e.start)&&(a.start=e.start),this.remove(a))}}catch(e){r.e(e)}finally{r.f()}}},{key:"move",value:function(e,t){var n;if(t.isAfter(e.end)){var r=(t=this._breakAttributes(t,!0)).parent,o=r.childCount;e=this._breakAttributesRange(e,!0),n=this.remove(e),t.offset+=r.childCount-o}else n=this.remove(e);return this.insert(t,n)}},{key:"wrap",value:function(e,t){if(!(t instanceof Rde))throw new moe.a("view-writer-wrap-invalid-attribute",this.document);if(Phe(e,this.document),e.isCollapsed){var n=e.start;n.parent.is("element")&&(o=n.parent,!Array.from(o.getChildren()).some((function(e){return!e.is("uiElement")})))&&(n=n.getLastMatchingPosition((function(e){return e.item.is("uiElement")}))),n=this._wrapPosition(n,t);var r=this.document.selection;return r.isCollapsed&&r.getFirstPosition().isEqual(e.start)&&this.setSelection(n),new lde(n)}return this._wrapRange(e,t);var o}},{key:"unwrap",value:function(e,t){if(!(t instanceof Rde))throw new moe.a("view-writer-unwrap-invalid-attribute",this.document);if(Phe(e,this.document),e.isCollapsed)return e;var n=this._breakAttributesRange(e,!0),r=n.start,o=n.end,i=r.parent,a=this._unwrapChildren(i,r.offset,o.offset,t),u=this.mergeAttributes(a.start);u.isEqual(a.start)||a.end.offset--;var l=this.mergeAttributes(a.end);return new lde(u,l)}},{key:"rename",value:function(e,t){var n=new Lpe(this.document,e,t.getAttributes());return this.insert(rde._createAfter(t),n),this.move(lde._createIn(t),rde._createAt(n,0)),this.remove(lde._createOn(t)),n}},{key:"clearClonedElementsGroup",value:function(e){this._cloneGroups.delete(e)}},{key:"createPositionAt",value:function(e,t){return rde._createAt(e,t)}},{key:"createPositionAfter",value:function(e){return rde._createAfter(e)}},{key:"createPositionBefore",value:function(e){return rde._createBefore(e)}},{key:"createRange",value:function(e,t){return new lde(e,t)}},{key:"createRangeOn",value:function(e){return lde._createOn(e)}},{key:"createRangeIn",value:function(e){return lde._createIn(e)}},{key:"createSelection",value:function(e,t,n){return new bde(e,t,n)}},{key:"_wrapChildren",value:function(e,t,n,r){for(var o=t,i=[];o1&&void 0!==arguments[1]&&arguments[1],n=e.start,r=e.end;if(Phe(e,this.document),e.isCollapsed){var o=this._breakAttributes(e.start,t);return new lde(o,o)}var i=this._breakAttributes(r,t),a=i.parent.childCount,u=this._breakAttributes(n,t);return i.offset+=i.parent.childCount-a,new lde(u,i)}},{key:"_breakAttributes",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.offset,r=e.parent;if(e.parent.is("emptyElement"))throw new moe.a("view-writer-cannot-break-empty-element",this.document);if(e.parent.is("uiElement"))throw new moe.a("view-writer-cannot-break-ui-element",this.document);if(e.parent.is("rawElement"))throw new moe.a("view-writer-cannot-break-raw-element",this.document);if(!t&&r.is("$text")&&khe(r.parent))return e.clone();if(khe(r))return e.clone();if(r.is("$text"))return this._breakAttributes(_he(e),t);var o=r.childCount;if(n==o){var i=new rde(r.parent,r.index+1);return this._breakAttributes(i,t)}if(0===n){var a=new rde(r.parent,r.index);return this._breakAttributes(a,t)}var u=r.index+1,l=r._clone();r.parent._insertChild(u,l),this._addToClonedElementsGroup(l);var s=r.childCount-n,c=r._removeChildren(n,s);l._appendChild(c);var f=new rde(r.parent,u);return this._breakAttributes(f,t)}},{key:"_addToClonedElementsGroup",value:function(e){if(e.root.is("rootElement")){if(e.is("element")){var t,n=phe(e.getChildren());try{for(n.s();!(t=n.n()).done;){var r=t.value;this._addToClonedElementsGroup(r)}}catch(e){n.e(e)}finally{n.f()}}var o=e.id;if(o){var i=this._cloneGroups.get(o);i||(i=new Set,this._cloneGroups.set(o,i)),i.add(e),e._clonesGroup=i}}}},{key:"_removeFromClonedElementsGroup",value:function(e){if(e.is("element")){var t,n=phe(e.getChildren());try{for(n.s();!(t=n.n()).done;){var r=t.value;this._removeFromClonedElementsGroup(r)}}catch(e){n.e(e)}finally{n.f()}}var o=e.id;if(o){var i=this._cloneGroups.get(o);i&&i.delete(e)}}}])&&mhe(t.prototype,n),r&&mhe(t,r),e}();function vhe(e){for(var t=e.parent;!khe(t);){if(!t)return;t=t.parent}return t}function ghe(e,t){return e.priorityt.priority)&&e.getIdentity()2&&void 0!==arguments[2]?arguments[2]:{},r=new Hde(this.document,e,t);return n.priority&&(r._priority=n.priority),n.id&&(r._id=n.id),r}},{key:"createContainerElement",value:function(e,t){return new Upe(this.document,e,t)}},{key:"createEditableElement",value:function(e,t){var n=new ede(this.document,e,t);return n._document=this.document,n}},{key:"createEmptyElement",value:function(e,t){return new Jde(this.document,e,t)}},{key:"createUIElement",value:function(e,t,n){var r=new uhe(this.document,e,t);return n&&(r.render=n),r}},{key:"createRawElement",value:function(e,t,n){var r=new mhe(this.document,e,t);return r.render=n||function(){},r}},{key:"setAttribute",value:function(e,t,n){n._setAttribute(e,t)}},{key:"removeAttribute",value:function(e,t){t._removeAttribute(e)}},{key:"addClass",value:function(e,t){t._addClass(e)}},{key:"removeClass",value:function(e,t){t._removeClass(e)}},{key:"setStyle",value:function(e,t,n){fK(e)&&void 0===n&&(n=t),n._setStyle(e,t)}},{key:"removeStyle",value:function(e,t){t._removeStyle(e)}},{key:"setCustomProperty",value:function(e,t,n){n._setCustomProperty(e,t)}},{key:"removeCustomProperty",value:function(e,t){return t._removeCustomProperty(e)}},{key:"breakAttributes",value:function(e){return e instanceof dde?this._breakAttributes(e):this._breakAttributesRange(e)}},{key:"breakContainer",value:function(e){var t=e.parent;if(!t.is("containerElement"))throw new joe.a("view-writer-break-non-container-element",this.document);if(!t.parent)throw new joe.a("view-writer-break-root",this.document);if(e.isAtStart)return dde._createBefore(t);if(!e.isAtEnd){var n=t._clone(!1);this.insert(dde._createAfter(t),n);var r=new vde(e,dde._createAt(t,"end")),o=new dde(n,0);this.move(r,o)}return dde._createAfter(t)}},{key:"mergeAttributes",value:function(e){var t=e.offset,n=e.parent;if(n.is("$text"))return e;if(n.is("attributeElement")&&0===n.childCount){var r=n.parent,o=n.index;return n._remove(),this._removeFromClonedElementsGroup(n),this.mergeAttributes(new dde(r,o))}var i=n.getChild(t-1),a=n.getChild(t);if(!i||!a)return e;if(i.is("$text")&&a.is("$text"))return Rhe(i,a);if(i.is("attributeElement")&&a.is("attributeElement")&&i.isSimilar(a)){var u=i.childCount;return i._appendChild(a.getChildren()),a._remove(),this._removeFromClonedElementsGroup(a),this.mergeAttributes(new dde(i,u))}return e}},{key:"mergeContainers",value:function(e){var t=e.nodeBefore,n=e.nodeAfter;if(!(t&&n&&t.is("containerElement")&&n.is("containerElement")))throw new joe.a("view-writer-merge-containers-invalid-position",this.document);var r=t.getChild(t.childCount-1),o=r instanceof $fe?dde._createAt(r,"end"):dde._createAt(t,"end");return this.move(vde._createIn(n),dde._createAt(t,"end")),this.remove(vde._createOn(n)),o}},{key:"insert",value:function(e,t){!function e(t,n){var r,o=Ohe(t);try{var i=function(){var t=r.value;if(!Mhe.some((function(e){return t instanceof e})))throw new joe.a("view-writer-insert-invalid-node-type",n);t.is("$text")||e(t.getChildren(),n)};for(o.s();!(r=o.n()).done;)i()}catch(e){o.e(e)}finally{o.f()}}(t=Nie(t)?She(t):[t],this.document);var n=Che(e);if(!n)throw new joe.a("view-writer-invalid-position-container",this.document);var r,o=this._breakAttributes(e,!0),i=n._insertChild(o.offset,t),a=Ohe(t);try{for(a.s();!(r=a.n()).done;){var u=r.value;this._addToClonedElementsGroup(u)}}catch(e){a.e(e)}finally{a.f()}var l=o.getShiftedBy(i),s=this.mergeAttributes(o);if(0===i)return new vde(s,s);s.isEqual(o)||l.offset--;var c=this.mergeAttributes(l);return new vde(s,c)}},{key:"remove",value:function(e){var t=e instanceof vde?e:vde._createOn(e);if(Lhe(t,this.document),t.isCollapsed)return new _he(this.document);var n,r=this._breakAttributesRange(t,!0),o=r.start,i=r.end,a=o.parent,u=i.offset-o.offset,l=a._removeChildren(o.offset,u),s=Ohe(l);try{for(s.s();!(n=s.n()).done;){var c=n.value;this._removeFromClonedElementsGroup(c)}}catch(e){s.e(e)}finally{s.f()}var f=this.mergeAttributes(o);return t.start=f,t.end=f.clone(),new _he(this.document,l)}},{key:"clear",value:function(e,t){Lhe(e,this.document);var n,r=Ohe(e.getWalker({direction:"backward",ignoreElementEnd:!0}));try{for(r.s();!(n=r.n()).done;){var o=n.value,i=o.item,a=void 0;if(i.is("element")&&t.isSimilar(i))a=vde._createOn(i);else if(!o.nextPosition.isAfter(e.start)&&i.is("$textProxy")){var u=i.getAncestors().find((function(e){return e.is("element")&&t.isSimilar(e)}));u&&(a=vde._createIn(u))}a&&(a.end.isAfter(e.end)&&(a.end=e.end),a.start.isBefore(e.start)&&(a.start=e.start),this.remove(a))}}catch(e){r.e(e)}finally{r.f()}}},{key:"move",value:function(e,t){var n;if(t.isAfter(e.end)){var r=(t=this._breakAttributes(t,!0)).parent,o=r.childCount;e=this._breakAttributesRange(e,!0),n=this.remove(e),t.offset+=r.childCount-o}else n=this.remove(e);return this.insert(t,n)}},{key:"wrap",value:function(e,t){if(!(t instanceof Hde))throw new joe.a("view-writer-wrap-invalid-attribute",this.document);if(Lhe(e,this.document),e.isCollapsed){var n=e.start;n.parent.is("element")&&(o=n.parent,!Array.from(o.getChildren()).some((function(e){return!e.is("uiElement")})))&&(n=n.getLastMatchingPosition((function(e){return e.item.is("uiElement")}))),n=this._wrapPosition(n,t);var r=this.document.selection;return r.isCollapsed&&r.getFirstPosition().isEqual(e.start)&&this.setSelection(n),new vde(n)}return this._wrapRange(e,t);var o}},{key:"unwrap",value:function(e,t){if(!(t instanceof Hde))throw new joe.a("view-writer-unwrap-invalid-attribute",this.document);if(Lhe(e,this.document),e.isCollapsed)return e;var n=this._breakAttributesRange(e,!0),r=n.start,o=n.end,i=r.parent,a=this._unwrapChildren(i,r.offset,o.offset,t),u=this.mergeAttributes(a.start);u.isEqual(a.start)||a.end.offset--;var l=this.mergeAttributes(a.end);return new vde(u,l)}},{key:"rename",value:function(e,t){var n=new Upe(this.document,e,t.getAttributes());return this.insert(dde._createAfter(t),n),this.move(vde._createIn(t),dde._createAt(n,0)),this.remove(vde._createOn(t)),n}},{key:"clearClonedElementsGroup",value:function(e){this._cloneGroups.delete(e)}},{key:"createPositionAt",value:function(e,t){return dde._createAt(e,t)}},{key:"createPositionAfter",value:function(e){return dde._createAfter(e)}},{key:"createPositionBefore",value:function(e){return dde._createBefore(e)}},{key:"createRange",value:function(e,t){return new vde(e,t)}},{key:"createRangeOn",value:function(e){return vde._createOn(e)}},{key:"createRangeIn",value:function(e){return vde._createIn(e)}},{key:"createSelection",value:function(e,t,n){return new Ede(e,t,n)}},{key:"_wrapChildren",value:function(e,t,n,r){for(var o=t,i=[];o1&&void 0!==arguments[1]&&arguments[1],n=e.start,r=e.end;if(Lhe(e,this.document),e.isCollapsed){var o=this._breakAttributes(e.start,t);return new vde(o,o)}var i=this._breakAttributes(r,t),a=i.parent.childCount,u=this._breakAttributes(n,t);return i.offset+=i.parent.childCount-a,new vde(u,i)}},{key:"_breakAttributes",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.offset,r=e.parent;if(e.parent.is("emptyElement"))throw new joe.a("view-writer-cannot-break-empty-element",this.document);if(e.parent.is("uiElement"))throw new joe.a("view-writer-cannot-break-ui-element",this.document);if(e.parent.is("rawElement"))throw new joe.a("view-writer-cannot-break-raw-element",this.document);if(!t&&r.is("$text")&&Ahe(r.parent))return e.clone();if(Ahe(r))return e.clone();if(r.is("$text"))return this._breakAttributes(Dhe(e),t);var o=r.childCount;if(n==o){var i=new dde(r.parent,r.index+1);return this._breakAttributes(i,t)}if(0===n){var a=new dde(r.parent,r.index);return this._breakAttributes(a,t)}var u=r.index+1,l=r._clone();r.parent._insertChild(u,l),this._addToClonedElementsGroup(l);var s=r.childCount-n,c=r._removeChildren(n,s);l._appendChild(c);var f=new dde(r.parent,u);return this._breakAttributes(f,t)}},{key:"_addToClonedElementsGroup",value:function(e){if(e.root.is("rootElement")){if(e.is("element")){var t,n=Ohe(e.getChildren());try{for(n.s();!(t=n.n()).done;){var r=t.value;this._addToClonedElementsGroup(r)}}catch(e){n.e(e)}finally{n.f()}}var o=e.id;if(o){var i=this._cloneGroups.get(o);i||(i=new Set,this._cloneGroups.set(o,i)),i.add(e),e._clonesGroup=i}}}},{key:"_removeFromClonedElementsGroup",value:function(e){if(e.is("element")){var t,n=Ohe(e.getChildren());try{for(n.s();!(t=n.n()).done;){var r=t.value;this._removeFromClonedElementsGroup(r)}}catch(e){n.e(e)}finally{n.f()}}var o=e.id;if(o){var i=this._cloneGroups.get(o);i&&i.delete(e)}}}])&&jhe(t.prototype,n),r&&jhe(t,r),e}();function Che(e){for(var t=e.parent;!Ahe(t);){if(!t)return;t=t.parent}return t}function xhe(e,t){return e.priorityt.priority)&&e.getIdentity()3&&void 0!==arguments[3]&&arguments[3];n=n||function(e,t){return e===t},Array.isArray(e)||(e=Array.prototype.slice.call(e)),Array.isArray(t)||(t=Array.prototype.slice.call(t));var o=Lhe(e,t,n);return r?Yhe(o,t.length):Fhe(t,o)}function Lhe(e,t,n){var r=Ihe(e,t,n);if(-1===r)return{firstIndex:-1,lastIndexOld:-1,lastIndexNew:-1};var o=Ihe(zhe(e,r),zhe(t,r),n);return{firstIndex:r,lastIndexOld:e.length-o,lastIndexNew:t.length-o}}function Ihe(e,t,n){for(var r=0;r0&&n.push({index:r,type:"insert",values:e.slice(r,i)}),o-r>0&&n.push({index:r+(i-r),type:"delete",howMany:o-r}),n}function Yhe(e,t){var n=e.firstIndex,r=e.lastIndexOld,o=e.lastIndexNew;if(-1===n)return Array(t).fill("equal");var i=[];return n>0&&(i=i.concat(Array(n).fill("equal"))),o-n>0&&(i=i.concat(Array(o-n).fill("insert"))),r-n>0&&(i=i.concat(Array(r-n).fill("delete"))),o3&&void 0!==arguments[3]&&arguments[3];n=n||function(e,t){return e===t},Array.isArray(e)||(e=Array.prototype.slice.call(e)),Array.isArray(t)||(t=Array.prototype.slice.call(t));var o=Uhe(e,t,n);return r?Ghe(o,t.length):$he(t,o)}function Uhe(e,t,n){var r=qhe(e,t,n);if(-1===r)return{firstIndex:-1,lastIndexOld:-1,lastIndexNew:-1};var o=qhe(Khe(e,r),Khe(t,r),n);return{firstIndex:r,lastIndexOld:e.length-o,lastIndexNew:t.length-o}}function qhe(e,t,n){for(var r=0;r0&&n.push({index:r,type:"insert",values:e.slice(r,i)}),o-r>0&&n.push({index:r+(i-r),type:"delete",howMany:o-r}),n}function Ghe(e,t){var n=e.firstIndex,r=e.lastIndexOld,o=e.lastIndexNew;if(-1===n)return Array(t).fill("equal");var i=[];return n>0&&(i=i.concat(Array(n).fill("equal"))),o-n>0&&(i=i.concat(Array(o-n).fill("insert"))),r-n>0&&(i=i.concat(Array(r-n).fill("delete"))),o200||a>200||i+a>300)return Nhe.fastDiff(e,t,n,!0);if(au?-1:1;f[i+c]&&(f[i]=f[i+c].slice(0)),f[i]||(f[i]=[]),f[i].push(a>u?r:o);for(var d=Math.max(a,u),h=d-i;hc;h--)p[h]=d(h);p[c]=d(c),y++}while(p[c]!==s);return f[c].slice(1)} + */function Zhe(e,t,n){n=n||function(e,t){return e===t};var r,o,i=e.length,a=t.length;if(i>200||a>200||i+a>300)return Zhe.fastDiff(e,t,n,!0);if(au?-1:1;f[i+c]&&(f[i]=f[i+c].slice(0)),f[i]||(f[i]=[]),f[i].push(a>u?r:o);for(var d=Math.max(a,u),h=d-i;hc;h--)p[h]=d(h);p[c]=d(c),y++}while(p[c]!==s);return f[c].slice(1)} /** * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -function Bhe(e,t,n){e.insertBefore(n,e.childNodes[t]||null)} +function Jhe(e,t,n){e.insertBefore(n,e.childNodes[t]||null)} /** * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */function Hhe(e){var t=e.parentNode;t&&t.removeChild(e)}function Vhe(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Whe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Whe(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Whe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function eye(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function eye(e,t){if(e){if("string"==typeof e)return tye(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?tye(e,t):void 0}}function tye(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function cye(e,t){if(e){if("string"==typeof e)return fye(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?fye(e,t):void 0}}function fye(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:{};nye(this,e),this.document=t,this.blockFillerMode=n.blockFillerMode||"br",this.preElements=["pre"],this.blockElements=["p","div","h1","h2","h3","h4","h5","h6","li","dd","dt","figcaption","td","th"],this._blockFiller="br"==this.blockFillerMode?Che:Ehe,this._domToViewMapping=new WeakMap,this._viewToDomMapping=new WeakMap,this._fakeSelectionMapping=new WeakMap}var t,n,r;return t=e,(n=[{key:"bindFakeSelection",value:function(e,t){this._fakeSelectionMapping.set(e,new bde(t))}},{key:"fakeSelectionToView",value:function(e){return this._fakeSelectionMapping.get(e)}},{key:"bindElements",value:function(e,t){this._domToViewMapping.set(e,t),this._viewToDomMapping.set(t,e)}},{key:"unbindDomElement",value:function(e){var t=this._domToViewMapping.get(e);if(t){this._domToViewMapping.delete(e),this._viewToDomMapping.delete(t);var n,r=Xhe(e.childNodes);try{for(r.s();!(n=r.n()).done;){var o=n.value;this.unbindDomElement(o)}}catch(e){r.e(e)}finally{r.f()}}}},{key:"bindDocumentFragments",value:function(e,t){this._domToViewMapping.set(e,t),this._viewToDomMapping.set(t,e)}},{key:"viewToDom",value:function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(e.is("$text")){var o=this._processDataFromViewText(e);return t.createTextNode(o)}if(this.mapViewToDom(e))return this.mapViewToDom(e);if(e.is("documentFragment"))n=t.createDocumentFragment(),r.bind&&this.bindDocumentFragments(n,e);else{if(e.is("uiElement"))return n=e.render(t),r.bind&&this.bindElements(n,e),n;n=e.hasAttribute("xmlns")?t.createElementNS(e.getAttribute("xmlns"),e.name):t.createElement(e.name),e.is("rawElement")&&e.render(n),r.bind&&this.bindElements(n,e);var i,a=Xhe(e.getAttributeKeys());try{for(a.s();!(i=a.n()).done;){var u=i.value;n.setAttribute(u,e.getAttribute(u))}}catch(e){a.e(e)}finally{a.f()}}if(r.withChildren||void 0===r.withChildren){var l,s=Xhe(this.viewChildrenToDom(e,t,r));try{for(s.s();!(l=s.n()).done;){var c=l.value;n.appendChild(c)}}catch(e){s.e(e)}finally{s.f()}}return n}},{key:"viewChildrenToDom",value:regeneratorRuntime.mark((function e(t,n){var r,o,i,a,u,l,s=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=s.length>2&&void 0!==s[2]?s[2]:{},o=t.getFillerOffset&&t.getFillerOffset(),i=0,a=Xhe(t.getChildren()),e.prev=4,a.s();case 6:if((u=a.n()).done){e.next=16;break}if(l=u.value,o!==i){e.next=11;break}return e.next=11,this._blockFiller(n);case 11:return e.next=13,this.viewToDom(l,n,r);case 13:i++;case 14:e.next=6;break;case 16:e.next=21;break;case 18:e.prev=18,e.t0=e.catch(4),a.e(e.t0);case 21:return e.prev=21,a.f(),e.finish(21);case 24:if(o!==i){e.next=27;break}return e.next=27,this._blockFiller(n);case 27:case"end":return e.stop()}}),e,this,[[4,18,21,24]])}))},{key:"viewRangeToDom",value:function(e){var t=this.viewPositionToDom(e.start),n=this.viewPositionToDom(e.end),r=document.createRange();return r.setStart(t.parent,t.offset),r.setEnd(n.parent,n.offset),r}},{key:"viewPositionToDom",value:function(e){var t,n,r,o=e.parent;if(o.is("$text")){var i=this.findCorrespondingDomText(o);if(!i)return null;var a=e.offset;return The(i)&&(a+=7),{parent:i,offset:a}}if(0===e.offset){if(!(t=this.mapViewToDom(o)))return null;r=t.childNodes[0]}else{var u=e.nodeBefore;if(!(n=u.is("$text")?this.findCorrespondingDomText(u):this.mapViewToDom(e.nodeBefore)))return null;t=n.parentNode,r=n.nextSibling}return tle(r)&&The(r)?{parent:r,offset:7}:{parent:t,offset:n?Zhe(n)+1:0}}},{key:"domToView",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.isBlockFiller(e,this.blockFillerMode))return null;var n,r=this.getHostViewElement(e,this._domToViewMapping);if(r)return r;if(tle(e)){if(Dhe(e))return null;var o=this._processDataFromDomText(e);return""===o?null:new Ffe(this.document,o)}if(this.isComment(e))return null;if(this.mapDomToView(e))return this.mapDomToView(e);if(this.isDocumentFragment(e))n=new fhe(this.document),t.bind&&this.bindDocumentFragments(e,n);else{var i=t.keepOriginalCase?e.tagName:e.tagName.toLowerCase();n=new kpe(this.document,i),t.bind&&this.bindElements(e,n);for(var a=e.attributes,u=a.length-1;u>=0;u--)n._setAttribute(a[u].name,a[u].value)}if(t.withChildren||void 0===t.withChildren){var l,s=Xhe(this.domChildrenToView(e,t));try{for(s.s();!(l=s.n()).done;){var c=l.value;n._appendChild(c)}}catch(e){s.e(e)}finally{s.f()}}return n}},{key:"domChildrenToView",value:regeneratorRuntime.mark((function e(t){var n,r,o,i,a=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=a.length>1&&void 0!==a[1]?a[1]:{},r=0;case 2:if(!(r1&&void 0!==arguments[1]?arguments[1]:{};pye(this,e),this.document=t,this.blockFillerMode=n.blockFillerMode||"br",this.preElements=["pre"],this.blockElements=["p","div","h1","h2","h3","h4","h5","h6","li","dd","dt","figcaption","td","th"],this._blockFiller="br"==this.blockFillerMode?Fhe:zhe,this._domToViewMapping=new WeakMap,this._viewToDomMapping=new WeakMap,this._fakeSelectionMapping=new WeakMap}var t,n,r;return t=e,(n=[{key:"bindFakeSelection",value:function(e,t){this._fakeSelectionMapping.set(e,new Ede(t))}},{key:"fakeSelectionToView",value:function(e){return this._fakeSelectionMapping.get(e)}},{key:"bindElements",value:function(e,t){this._domToViewMapping.set(e,t),this._viewToDomMapping.set(t,e)}},{key:"unbindDomElement",value:function(e){var t=this._domToViewMapping.get(e);if(t){this._domToViewMapping.delete(e),this._viewToDomMapping.delete(t);var n,r=sye(e.childNodes);try{for(r.s();!(n=r.n()).done;){var o=n.value;this.unbindDomElement(o)}}catch(e){r.e(e)}finally{r.f()}}}},{key:"bindDocumentFragments",value:function(e,t){this._domToViewMapping.set(e,t),this._viewToDomMapping.set(t,e)}},{key:"viewToDom",value:function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(e.is("$text")){var o=this._processDataFromViewText(e);return t.createTextNode(o)}if(this.mapViewToDom(e))return this.mapViewToDom(e);if(e.is("documentFragment"))n=t.createDocumentFragment(),r.bind&&this.bindDocumentFragments(n,e);else{if(e.is("uiElement"))return n=e.render(t),r.bind&&this.bindElements(n,e),n;n=e.hasAttribute("xmlns")?t.createElementNS(e.getAttribute("xmlns"),e.name):t.createElement(e.name),e.is("rawElement")&&e.render(n),r.bind&&this.bindElements(n,e);var i,a=sye(e.getAttributeKeys());try{for(a.s();!(i=a.n()).done;){var u=i.value;n.setAttribute(u,e.getAttribute(u))}}catch(e){a.e(e)}finally{a.f()}}if(r.withChildren||void 0===r.withChildren){var l,s=sye(this.viewChildrenToDom(e,t,r));try{for(s.s();!(l=s.n()).done;){var c=l.value;n.appendChild(c)}}catch(e){s.e(e)}finally{s.f()}}return n}},{key:"viewChildrenToDom",value:regeneratorRuntime.mark((function e(t,n){var r,o,i,a,u,l,s=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=s.length>2&&void 0!==s[2]?s[2]:{},o=t.getFillerOffset&&t.getFillerOffset(),i=0,a=sye(t.getChildren()),e.prev=4,a.s();case 6:if((u=a.n()).done){e.next=16;break}if(l=u.value,o!==i){e.next=11;break}return e.next=11,this._blockFiller(n);case 11:return e.next=13,this.viewToDom(l,n,r);case 13:i++;case 14:e.next=6;break;case 16:e.next=21;break;case 18:e.prev=18,e.t0=e.catch(4),a.e(e.t0);case 21:return e.prev=21,a.f(),e.finish(21);case 24:if(o!==i){e.next=27;break}return e.next=27,this._blockFiller(n);case 27:case"end":return e.stop()}}),e,this,[[4,18,21,24]])}))},{key:"viewRangeToDom",value:function(e){var t=this.viewPositionToDom(e.start),n=this.viewPositionToDom(e.end),r=document.createRange();return r.setStart(t.parent,t.offset),r.setEnd(n.parent,n.offset),r}},{key:"viewPositionToDom",value:function(e){var t,n,r,o=e.parent;if(o.is("$text")){var i=this.findCorrespondingDomText(o);if(!i)return null;var a=e.offset;return Nhe(i)&&(a+=7),{parent:i,offset:a}}if(0===e.offset){if(!(t=this.mapViewToDom(o)))return null;r=t.childNodes[0]}else{var u=e.nodeBefore;if(!(n=u.is("$text")?this.findCorrespondingDomText(u):this.mapViewToDom(e.nodeBefore)))return null;t=n.parentNode,r=n.nextSibling}return fle(r)&&Nhe(r)?{parent:r,offset:7}:{parent:t,offset:n?aye(n)+1:0}}},{key:"domToView",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.isBlockFiller(e,this.blockFillerMode))return null;var n,r=this.getHostViewElement(e,this._domToViewMapping);if(r)return r;if(fle(e)){if(Bhe(e))return null;var o=this._processDataFromDomText(e);return""===o?null:new $fe(this.document,o)}if(this.isComment(e))return null;if(this.mapDomToView(e))return this.mapDomToView(e);if(this.isDocumentFragment(e))n=new _he(this.document),t.bind&&this.bindDocumentFragments(e,n);else{var i=t.keepOriginalCase?e.tagName:e.tagName.toLowerCase();n=new Ape(this.document,i),t.bind&&this.bindElements(e,n);for(var a=e.attributes,u=a.length-1;u>=0;u--)n._setAttribute(a[u].name,a[u].value)}if(t.withChildren||void 0===t.withChildren){var l,s=sye(this.domChildrenToView(e,t));try{for(s.s();!(l=s.n()).done;){var c=l.value;n._appendChild(c)}}catch(e){s.e(e)}finally{s.f()}}return n}},{key:"domChildrenToView",value:regeneratorRuntime.mark((function e(t){var n,r,o,i,a=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=a.length>1&&void 0!==a[1]?a[1]:{},r=0;case 2:if(!(r=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function hye(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function kye(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n60))if(this.selection.isSimilar(r))this.view.forceRender();else{var o={oldSelection:this.selection,newSelection:r,domSelection:n};this.document.fire("selectionChange",o),this._fireSelectionChangeDoneDebounced(o)}}else this.view.hasDomSelection=!1}}}},{key:"_clearInfiniteLoop",value:function(){this._loopbackCounter=0}}])&&$ye(t.prototype,n),r&&$ye(t,r),i}(cye);function tme(e){return(tme="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function nme(e,t){for(var n=0;n60))if(this.selection.isSimilar(r))this.view.forceRender();else{var o={oldSelection:this.selection,newSelection:r,domSelection:n};this.document.fire("selectionChange",o),this._fireSelectionChangeDoneDebounced(o)}}else this.view.hasDomSelection=!1}}}},{key:"_clearInfiniteLoop",value:function(){this._loopbackCounter=0}}])&&ome(t.prototype,n),r&&ome(t,r),i}(wye);function fme(e){return(fme="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function pme(e,t){for(var n=0;nt.bottom}function Eme(e,t){return e.topt.right}function Tme(e){return Xue(e)?e.startContainer.ownerDocument.defaultView:e.ownerDocument.defaultView}function Dme(e){if(Xue(e)){var t=e.commonAncestorContainer;return tle(t)&&(t=t.parentNode),t}return e.parentNode}function Rme(e,t){var n=Tme(e),r=new ule(e);if(n===t)return r;for(var o=n;o!=t;){var i=o.frameElement,a=new ule(i).excludeScrollbarsAndBorders();r.moveBy(a.left,a.top),o=o.parent}return r}function Mme(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n}(e,t)||Lme(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ame(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=Lme(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Lme(e,t){if(e){if("string"==typeof e)return Ime(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ime(e,t):void 0}}function Ime(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);nt.bottom}function zme(e,t){return e.topt.right}function Nme(e){return sle(e)?e.startContainer.ownerDocument.defaultView:e.ownerDocument.defaultView}function Bme(e){if(sle(e)){var t=e.commonAncestorContainer;return fle(t)&&(t=t.parentNode),t}return e.parentNode}function Hme(e,t){var n=Nme(e),r=new ble(e);if(n===t)return r;for(var o=n;o!=t;){var i=o.frameElement,a=new ble(i).excludeScrollbarsAndBorders();r.moveBy(a.left,a.top),o=o.parent}return r}function Vme(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n}(e,t)||Ume(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Wme(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=Ume(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Ume(e,t){if(e){if("string"==typeof e)return qme(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?qme(e,t):void 0}}function qme(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:"main",r=this.document.getRoot(n);r._name=e.tagName.toLowerCase();for(var o={},i=0,a=Array.from(e.attributes);i0&&void 0!==arguments[0]?arguments[0]:"main";return this.domRoots.get(e)}},{key:"addObserver",value:function(e){var t=this._observers.get(e);if(t)return t;t=new e(this),this._observers.set(e,t);var n,r=Ame(this.domRoots);try{for(r.s();!(n=r.n()).done;){var o=Mme(n.value,2),i=o[0],a=o[1];t.observe(a,i)}}catch(e){r.e(e)}finally{r.f()}return t.enable(),t}},{key:"getObserver",value:function(e){return this._observers.get(e)}},{key:"disableObservers",value:function(){var e,t=Ame(this._observers.values());try{for(t.s();!(e=t.n()).done;)e.value.disable()}catch(e){t.e(e)}finally{t.f()}}},{key:"enableObservers",value:function(){var e,t=Ame(this._observers.values());try{for(t.s();!(e=t.n()).done;)e.value.enable()}catch(e){t.e(e)}finally{t.f()}}},{key:"scrollToTheSelection",value:function(){var e=this.document.selection.getFirstRange();e&&Sme({target:this.domConverter.viewRangeToDom(e),viewportOffset:20})}},{key:"focus",value:function(){if(!this.document.isFocused){var e=this.document.selection.editableElement;e&&(this.domConverter.focus(e),this.forceRender())}}},{key:"change",value:function(e){if(this.isRenderingInProgress||this._postFixersInProgress)throw new moe.a("cannot-change-view-tree",this);try{if(this._ongoingChange)return e(this._writer);this._ongoingChange=!0;var t=e(this._writer);return this._ongoingChange=!1,!this._renderingDisabled&&this._hasChangedSinceTheLastRendering&&(this._postFixersInProgress=!0,this.document._callPostFixers(this._writer),this._postFixersInProgress=!1,this.fire("render")),t}catch(e){moe.a.rethrowUnexpectedError(e,this)}}},{key:"forceRender",value:function(){this._hasChangedSinceTheLastRendering=!0,this.change((function(){}))}},{key:"destroy",value:function(){var e,t=Ame(this._observers.values());try{for(t.s();!(e=t.n()).done;)e.value.destroy()}catch(e){t.e(e)}finally{t.f()}this.document.destroy(),this.stopListening()}},{key:"createPositionAt",value:function(e,t){return rde._createAt(e,t)}},{key:"createPositionAfter",value:function(e){return rde._createAfter(e)}},{key:"createPositionBefore",value:function(e){return rde._createBefore(e)}},{key:"createRange",value:function(e,t){return new lde(e,t)}},{key:"createRangeOn",value:function(e){return lde._createOn(e)}},{key:"createRangeIn",value:function(e){return lde._createIn(e)}},{key:"createSelection",value:function(e,t,n){return new bde(e,t,n)}},{key:"_disableRendering",value:function(e){this._renderingDisabled=e,0==e&&this.change((function(){}))}},{key:"_render",value:function(){this.isRenderingInProgress=!0,this.disableObservers(),this._renderer.render(),this.enableObservers(),this.isRenderingInProgress=!1}}])&&zme(t.prototype,n),r&&zme(t,r),e}();function Yme(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:"main",r=this.document.getRoot(n);r._name=e.tagName.toLowerCase();for(var o={},i=0,a=Array.from(e.attributes);i0&&void 0!==arguments[0]?arguments[0]:"main";return this.domRoots.get(e)}},{key:"addObserver",value:function(e){var t=this._observers.get(e);if(t)return t;t=new e(this),this._observers.set(e,t);var n,r=Wme(this.domRoots);try{for(r.s();!(n=r.n()).done;){var o=Vme(n.value,2),i=o[0],a=o[1];t.observe(a,i)}}catch(e){r.e(e)}finally{r.f()}return t.enable(),t}},{key:"getObserver",value:function(e){return this._observers.get(e)}},{key:"disableObservers",value:function(){var e,t=Wme(this._observers.values());try{for(t.s();!(e=t.n()).done;)e.value.disable()}catch(e){t.e(e)}finally{t.f()}}},{key:"enableObservers",value:function(){var e,t=Wme(this._observers.values());try{for(t.s();!(e=t.n()).done;)e.value.enable()}catch(e){t.e(e)}finally{t.f()}}},{key:"scrollToTheSelection",value:function(){var e=this.document.selection.getFirstRange();e&&Mme({target:this.domConverter.viewRangeToDom(e),viewportOffset:20})}},{key:"focus",value:function(){if(!this.document.isFocused){var e=this.document.selection.editableElement;e&&(this.domConverter.focus(e),this.forceRender())}}},{key:"change",value:function(e){if(this.isRenderingInProgress||this._postFixersInProgress)throw new joe.a("cannot-change-view-tree",this);try{if(this._ongoingChange)return e(this._writer);this._ongoingChange=!0;var t=e(this._writer);return this._ongoingChange=!1,!this._renderingDisabled&&this._hasChangedSinceTheLastRendering&&(this._postFixersInProgress=!0,this.document._callPostFixers(this._writer),this._postFixersInProgress=!1,this.fire("render")),t}catch(e){joe.a.rethrowUnexpectedError(e,this)}}},{key:"forceRender",value:function(){this._hasChangedSinceTheLastRendering=!0,this.change((function(){}))}},{key:"destroy",value:function(){var e,t=Wme(this._observers.values());try{for(t.s();!(e=t.n()).done;)e.value.destroy()}catch(e){t.e(e)}finally{t.f()}this.document.destroy(),this.stopListening()}},{key:"createPositionAt",value:function(e,t){return dde._createAt(e,t)}},{key:"createPositionAfter",value:function(e){return dde._createAfter(e)}},{key:"createPositionBefore",value:function(e){return dde._createBefore(e)}},{key:"createRange",value:function(e,t){return new vde(e,t)}},{key:"createRangeOn",value:function(e){return vde._createOn(e)}},{key:"createRangeIn",value:function(e){return vde._createIn(e)}},{key:"createSelection",value:function(e,t,n){return new Ede(e,t,n)}},{key:"_disableRendering",value:function(e){this._renderingDisabled=e,0==e&&this.change((function(){}))}},{key:"_render",value:function(){this.isRenderingInProgress=!0,this.disableObservers(),this._renderer.render(),this.enableObservers(),this.isRenderingInProgress=!1}}])&&Kme(t.prototype,n),r&&Kme(t,r),e}();function Gme(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{includeSelf:!1,parentFirst:!1},t=[],n=e.includeSelf?this:this.parent;n;)t[e.parentFirst?"push":"unshift"](n),n=n.parent;return t}},{key:"getCommonAncestor",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getAncestors(t),r=e.getAncestors(t),o=0;n[o]==r[o]&&n[o];)o++;return 0===o?null:n[o-1]}},{key:"isBefore",value:function(e){if(this==e)return!1;if(this.root!==e.root)return!1;var t=this.getPath(),n=e.getPath(),r=Cfe(t,n);switch(r){case"prefix":return!0;case"extension":return!1;default:return t[r]0&&void 0!==arguments[0]?arguments[0]:{includeSelf:!1,parentFirst:!1},t=[],n=e.includeSelf?this:this.parent;n;)t[e.parentFirst?"push":"unshift"](n),n=n.parent;return t}},{key:"getCommonAncestor",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getAncestors(t),r=e.getAncestors(t),o=0;n[o]==r[o]&&n[o];)o++;return 0===o?null:n[o-1]}},{key:"isBefore",value:function(e){if(this==e)return!1;if(this.root!==e.root)return!1;var t=this.getPath(),n=e.getPath(),r=Ffe(t,n);switch(r){case"prefix":return!0;case"extension":return!1;default:return t[r]t.offsetSize)throw new moe.a("model-textproxy-wrong-offsetintext",this);if(r<0||n+r>t.offsetSize)throw new moe.a("model-textproxy-wrong-length",this);this.data=t.data.substring(n,n+r),this.offsetInText=n}var t,n,r;return t=e,(n=[{key:"is",value:function(e){return"$textProxy"===e||"model:$textProxy"===e||"textProxy"===e||"model:textProxy"===e}},{key:"getPath",value:function(){var e=this.textNode.getPath();return e.length>0&&(e[e.length-1]+=this.offsetInText),e}},{key:"getAncestors",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{includeSelf:!1,parentFirst:!1},t=[],n=e.includeSelf?this:this.parent;n;)t[e.parentFirst?"push":"unshift"](n),n=n.parent;return t}},{key:"hasAttribute",value:function(e){return this.textNode.hasAttribute(e)}},{key:"getAttribute",value:function(e){return this.textNode.getAttribute(e)}},{key:"getAttributes",value:function(){return this.textNode.getAttributes()}},{key:"getAttributeKeys",value:function(){return this.textNode.getAttributeKeys()}},{key:"startOffset",get:function(){return null!==this.textNode.startOffset?this.textNode.startOffset+this.offsetInText:null}},{key:"offsetSize",get:function(){return this.data.length}},{key:"endOffset",get:function(){return null!==this.startOffset?this.startOffset+this.offsetSize:null}},{key:"isPartial",get:function(){return this.offsetSize!==this.textNode.offsetSize}},{key:"parent",get:function(){return this.textNode.parent}},{key:"root",get:function(){return this.textNode.root}}])&&Gme(t.prototype,n),r&&Gme(t,r),e}();function Jme(e){return function(e){if(Array.isArray(e))return ebe(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||Xme(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Qme(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=Xme(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Xme(e,t){if(e){if("string"==typeof e)return ebe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ebe(e,t):void 0}}function ebe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);nt.offsetSize)throw new joe.a("model-textproxy-wrong-offsetintext",this);if(r<0||n+r>t.offsetSize)throw new joe.a("model-textproxy-wrong-length",this);this.data=t.data.substring(n,n+r),this.offsetInText=n}var t,n,r;return t=e,(n=[{key:"is",value:function(e){return"$textProxy"===e||"model:$textProxy"===e||"textProxy"===e||"model:textProxy"===e}},{key:"getPath",value:function(){var e=this.textNode.getPath();return e.length>0&&(e[e.length-1]+=this.offsetInText),e}},{key:"getAncestors",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{includeSelf:!1,parentFirst:!1},t=[],n=e.includeSelf?this:this.parent;n;)t[e.parentFirst?"push":"unshift"](n),n=n.parent;return t}},{key:"hasAttribute",value:function(e){return this.textNode.hasAttribute(e)}},{key:"getAttribute",value:function(e){return this.textNode.getAttribute(e)}},{key:"getAttributes",value:function(){return this.textNode.getAttributes()}},{key:"getAttributeKeys",value:function(){return this.textNode.getAttributeKeys()}},{key:"startOffset",get:function(){return null!==this.textNode.startOffset?this.textNode.startOffset+this.offsetInText:null}},{key:"offsetSize",get:function(){return this.data.length}},{key:"endOffset",get:function(){return null!==this.startOffset?this.startOffset+this.offsetSize:null}},{key:"isPartial",get:function(){return this.offsetSize!==this.textNode.offsetSize}},{key:"parent",get:function(){return this.textNode.parent}},{key:"root",get:function(){return this.textNode.root}}])&&ibe(t.prototype,n),r&&ibe(t,r),e}();function ube(e){return function(e){if(Array.isArray(e))return cbe(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||sbe(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function lbe(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=sbe(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function sbe(e,t){if(e){if("string"==typeof e)return cbe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?cbe(e,t):void 0}}function cbe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=n&&e1&&void 0!==arguments[1]?arguments[1]:1;return this._nodes.splice(e,t)}},{key:"toJSON",value:function(){return this._nodes.map((function(e){return e.toJSON()}))}},{key:"length",get:function(){return this._nodes.length}},{key:"maxOffset",get:function(){return this._nodes.reduce((function(e,t){return e+t.offsetSize}),0)}}])&&tbe(t.prototype,n),r&&tbe(t,r),e}();function rbe(e){return(rbe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function obe(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return ibe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ibe(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function ibe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=n&&e1&&void 0!==arguments[1]?arguments[1]:1;return this._nodes.splice(e,t)}},{key:"toJSON",value:function(){return this._nodes.map((function(e){return e.toJSON()}))}},{key:"length",get:function(){return this._nodes.length}},{key:"maxOffset",get:function(){return this._nodes.reduce((function(e,t){return e+t.offsetSize}),0)}}])&&fbe(t.prototype,n),r&&fbe(t,r),e}();function dbe(e){return(dbe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function hbe(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return ybe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ybe(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function ybe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:null;return t?t===this.name&&("element"===e||"model:element"===e):"element"===e||"model:element"===e||"node"===e||"model:node"===e}},{key:"getChild",value:function(e){return this._children.getNode(e)}},{key:"getChildren",value:function(){return this._children[Symbol.iterator]()}},{key:"getChildIndex",value:function(e){return this._children.getNodeIndex(e)}},{key:"getChildStartOffset",value:function(e){return this._children.getNodeStartOffset(e)}},{key:"offsetToIndex",value:function(e){return this._children.offsetToIndex(e)}},{key:"getNodeByPath",value:function(e){var t,n=this,r=obe(e);try{for(r.s();!(t=r.n()).done;){var o=t.value;n=n.getChild(n.offsetToIndex(o))}}catch(e){r.e(e)}finally{r.f()}return n}},{key:"findAncestor",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{includeSelf:!1},n=t.includeSelf?this:this.parent;n;){if(n.name===e)return n;n=n.parent}return null}},{key:"toJSON",value:function(){var e=ube(fbe(i.prototype),"toJSON",this).call(this);if(e.name=this.name,this._children.length>0){e.children=[];var t,n=obe(this._children);try{for(n.s();!(t=n.n()).done;){var r=t.value;e.children.push(r.toJSON())}}catch(e){n.e(e)}finally{n.f()}}return e}},{key:"_clone",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=e?Array.from(this._children).map((function(e){return e._clone(!0)})):null;return new i(this.name,this.getAttributes(),t)}},{key:"_appendChild",value:function(e){this._insertChild(this.childCount,e)}},{key:"_insertChild",value:function(e,t){var n,r=function(e){return"string"==typeof e?[new $me(e)]:(Tie(e)||(e=[e]),Array.from(e).map((function(e){return"string"==typeof e?new $me(e):e instanceof Zme?new $me(e.data,e.getAttributes()):e})))}(t),o=obe(r);try{for(o.s();!(n=o.n()).done;){var i=n.value;null!==i.parent&&i._remove(),i.parent=this}}catch(e){o.e(e)}finally{o.f()}this._children._insertNodes(e,r)}},{key:"_removeChildren",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=this._children._removeNodes(e,n),o=obe(r);try{for(o.s();!(t=o.n()).done;){var i=t.value;i.parent=null}}catch(e){o.e(e)}finally{o.f()}return r}},{key:"childCount",get:function(){return this._children.length}},{key:"maxOffset",get:function(){return this._children.maxOffset}},{key:"isEmpty",get:function(){return 0===this.childCount}}])&&abe(t.prototype,n),r&&abe(t,r),i}(Nme);function dbe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function hbe(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:null;return t?t===this.name&&("element"===e||"model:element"===e):"element"===e||"model:element"===e||"node"===e||"model:node"===e}},{key:"getChild",value:function(e){return this._children.getNode(e)}},{key:"getChildren",value:function(){return this._children[Symbol.iterator]()}},{key:"getChildIndex",value:function(e){return this._children.getNodeIndex(e)}},{key:"getChildStartOffset",value:function(e){return this._children.getNodeStartOffset(e)}},{key:"offsetToIndex",value:function(e){return this._children.offsetToIndex(e)}},{key:"getNodeByPath",value:function(e){var t,n=this,r=hbe(e);try{for(r.s();!(t=r.n()).done;){var o=t.value;n=n.getChild(n.offsetToIndex(o))}}catch(e){r.e(e)}finally{r.f()}return n}},{key:"findAncestor",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{includeSelf:!1},n=t.includeSelf?this:this.parent;n;){if(n.name===e)return n;n=n.parent}return null}},{key:"toJSON",value:function(){var e=bbe(_be(i.prototype),"toJSON",this).call(this);if(e.name=this.name,this._children.length>0){e.children=[];var t,n=hbe(this._children);try{for(n.s();!(t=n.n()).done;){var r=t.value;e.children.push(r.toJSON())}}catch(e){n.e(e)}finally{n.f()}}return e}},{key:"_clone",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=e?Array.from(this._children).map((function(e){return e._clone(!0)})):null;return new i(this.name,this.getAttributes(),t)}},{key:"_appendChild",value:function(e){this._insertChild(this.childCount,e)}},{key:"_insertChild",value:function(e,t){var n,r=function(e){return"string"==typeof e?[new obe(e)]:(Nie(e)||(e=[e]),Array.from(e).map((function(e){return"string"==typeof e?new obe(e):e instanceof abe?new obe(e.data,e.getAttributes()):e})))}(t),o=hbe(r);try{for(o.s();!(n=o.n()).done;){var i=n.value;null!==i.parent&&i._remove(),i.parent=this}}catch(e){o.e(e)}finally{o.f()}this._children._insertNodes(e,r)}},{key:"_removeChildren",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=this._children._removeNodes(e,n),o=hbe(r);try{for(o.s();!(t=o.n()).done;){var i=t.value;i.parent=null}}catch(e){o.e(e)}finally{o.f()}return r}},{key:"childCount",get:function(){return this._children.length}},{key:"maxOffset",get:function(){return this._children.maxOffset}},{key:"isEmpty",get:function(){return 0===this.childCount}}])&&mbe(t.prototype,n),r&&mbe(t,r),i}(Zme);function Sbe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function kbe(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};if(dbe(this,e),!t.boundaries&&!t.startPosition)throw new moe.a("model-tree-walker-no-start-position",null);var n=t.direction||"forward";if("forward"!=n&&"backward"!=n)throw new moe.a("model-tree-walker-unknown-direction",t,{direction:n});this.direction=n,this.boundaries=t.boundaries||null,t.startPosition?this.position=t.startPosition.clone():this.position=_be._createAt(this.boundaries["backward"==this.direction?"end":"start"]),this.position.stickiness="toNone",this.singleCharacters=!!t.singleCharacters,this.shallow=!!t.shallow,this.ignoreElementEnd=!!t.ignoreElementEnd,this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null,this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null,this._visitedParent=this.position.parent}var t,n,r;return t=e,(n=[{key:Symbol.iterator,value:function(){return this}},{key:"skip",value:function(e){var t,n,r,o;do{r=this.position,o=this._visitedParent;var i=this.next();t=i.done,n=i.value}while(!t&&e(n));t||(this.position=r,this._visitedParent=o)}},{key:"next",value:function(){return"forward"==this.direction?this._next():this._previous()}},{key:"_next",value:function(){var e=this.position,t=this.position.clone(),n=this._visitedParent;if(null===n.parent&&t.offset===n.maxOffset)return{done:!0};if(n===this._boundaryEndParent&&t.offset==this.boundaries.end.offset)return{done:!0};var r=t.parent,o=Obe(t,r),i=o||Sbe(t,r,o);if(i instanceof pbe)return this.shallow?t.offset++:(t.path.push(0),this._visitedParent=i),this.position=t,mbe("elementStart",i,e,t,1);if(i instanceof $me){var a;if(this.singleCharacters)a=1;else{var u=i.endOffset;this._boundaryEndParent==n&&this.boundaries.end.offsetu&&(u=this.boundaries.start.offset),a=t.offset-u}var l=t.offset-i.startOffset,s=new Zme(i,l-a,a);return t.offset-=a,this.position=t,mbe("text",s,e,t,a)}return t.path.pop(),this.position=t,this._visitedParent=n.parent,mbe("elementStart",n,e,t,1)}}])&&hbe(t.prototype,n),r&&hbe(t,r),e}();function mbe(e,t,n,r,o){return{done:!1,value:{type:e,item:t,previousPosition:n,nextPosition:r,length:o}}}function bbe(e){return function(e){if(Array.isArray(e))return vbe(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return vbe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return vbe(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function vbe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:{};if(Sbe(this,e),!t.boundaries&&!t.startPosition)throw new joe.a("model-tree-walker-no-start-position",null);var n=t.direction||"forward";if("forward"!=n&&"backward"!=n)throw new joe.a("model-tree-walker-unknown-direction",t,{direction:n});this.direction=n,this.boundaries=t.boundaries||null,t.startPosition?this.position=t.startPosition.clone():this.position=Dbe._createAt(this.boundaries["backward"==this.direction?"end":"start"]),this.position.stickiness="toNone",this.singleCharacters=!!t.singleCharacters,this.shallow=!!t.shallow,this.ignoreElementEnd=!!t.ignoreElementEnd,this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null,this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null,this._visitedParent=this.position.parent}var t,n,r;return t=e,(n=[{key:Symbol.iterator,value:function(){return this}},{key:"skip",value:function(e){var t,n,r,o;do{r=this.position,o=this._visitedParent;var i=this.next();t=i.done,n=i.value}while(!t&&e(n));t||(this.position=r,this._visitedParent=o)}},{key:"next",value:function(){return"forward"==this.direction?this._next():this._previous()}},{key:"_next",value:function(){var e=this.position,t=this.position.clone(),n=this._visitedParent;if(null===n.parent&&t.offset===n.maxOffset)return{done:!0};if(n===this._boundaryEndParent&&t.offset==this.boundaries.end.offset)return{done:!0};var r=t.parent,o=Rbe(t,r),i=o||Mbe(t,r,o);if(i instanceof Obe)return this.shallow?t.offset++:(t.path.push(0),this._visitedParent=i),this.position=t,jbe("elementStart",i,e,t,1);if(i instanceof obe){var a;if(this.singleCharacters)a=1;else{var u=i.endOffset;this._boundaryEndParent==n&&this.boundaries.end.offsetu&&(u=this.boundaries.start.offset),a=t.offset-u}var l=t.offset-i.startOffset,s=new abe(i,l-a,a);return t.offset-=a,this.position=t,jbe("text",s,e,t,a)}return t.path.pop(),this.position=t,this._visitedParent=n.parent,jbe("elementStart",n,e,t,1)}}])&&kbe(t.prototype,n),r&&kbe(t,r),e}();function jbe(e,t,n,r,o){return{done:!1,value:{type:e,item:t,previousPosition:n,nextPosition:r,length:o}}}function Ebe(e){return function(e){if(Array.isArray(e))return Cbe(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Cbe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Cbe(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Cbe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:"toNone";if(gbe(this,e),!t.is("element")&&!t.is("documentFragment"))throw new moe.a("model-position-root-invalid",t);if(!(n instanceof Array)||0===n.length)throw new moe.a("model-position-path-incorrect-format",t,{path:n});t.is("rootElement")?n=n.slice():(n=[].concat(bbe(t.getPath()),bbe(n)),t=t.root),this.root=t,this.path=n,this.stickiness=r}var t,n,r;return t=e,r=[{key:"_createAt",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"toNone";if(t instanceof e)return new e(t.root,t.path,t.stickiness);var o=t;if("end"==n)n=o.maxOffset;else{if("before"==n)return this._createBefore(o,r);if("after"==n)return this._createAfter(o,r);if(0!==n&&!n)throw new moe.a("model-createpositionat-offset-required",[this,t])}if(!o.is("element")&&!o.is("documentFragment"))throw new moe.a("model-position-parent-incorrect",[this,t]);var i=o.getPath();return i.push(n),new this(o.root,i,r)}},{key:"_createAfter",value:function(e,t){if(!e.parent)throw new moe.a("model-position-after-root",[this,e],{root:e});return this._createAt(e.parent,e.endOffset,t)}},{key:"_createBefore",value:function(e,t){if(!e.parent)throw new moe.a("model-position-before-root",e,{root:e});return this._createAt(e.parent,e.startOffset,t)}},{key:"fromJSON",value:function(t,n){if("$graveyard"===t.root){var r=new e(n.graveyard,t.path);return r.stickiness=t.stickiness,r}if(!n.getRoot(t.root))throw new moe.a("model-position-fromjson-no-root",n,{rootName:t.root});return new e(n.getRoot(t.root),t.path,t.stickiness)}}],(n=[{key:"compareWith",value:function(e){if(this.root!=e.root)return"different";var t=Cfe(this.path,e.path);switch(t){case"same":return"same";case"prefix":return"before";case"extension":return"after";default:return this.path[t]1&&void 0!==arguments[1]?arguments[1]:{};t.startPosition=this;var n=new ybe(t);return n.skip(e),n.position}},{key:"getParentPath",value:function(){return this.path.slice(0,-1)}},{key:"getAncestors",value:function(){var e=this.parent;return e.is("documentFragment")?[e]:e.getAncestors({includeSelf:!0})}},{key:"findAncestor",value:function(e){var t=this.parent;return t.is("element")?t.findAncestor(e,{includeSelf:!0}):null}},{key:"getCommonPath",value:function(e){if(this.root!=e.root)return[];var t=Cfe(this.path,e.path),n="string"==typeof t?Math.min(this.path.length,e.path.length):t;return this.path.slice(0,n)}},{key:"getCommonAncestor",value:function(e){for(var t=this.getAncestors(),n=e.getAncestors(),r=0;t[r]==n[r]&&t[r];)r++;return 0===r?null:t[r-1]}},{key:"getShiftedBy",value:function(e){var t=this.clone(),n=t.offset+e;return t.offset=n<0?0:n,t}},{key:"isAfter",value:function(e){return"after"==this.compareWith(e)}},{key:"isBefore",value:function(e){return"before"==this.compareWith(e)}},{key:"isEqual",value:function(e){return"same"==this.compareWith(e)}},{key:"isTouching",value:function(t){var n=null,r=null;switch(this.compareWith(t)){case"same":return!0;case"before":n=e._createAt(this),r=e._createAt(t);break;case"after":n=e._createAt(t),r=e._createAt(this);break;default:return!1}for(var o=n.parent;n.path.length+r.path.length;){if(n.isEqual(r))return!0;if(n.path.length>r.path.length){if(n.offset!==o.maxOffset)return!1;n.path=n.path.slice(0,-1),o=o.parent,n.offset++}else{if(0!==r.offset)return!1;r.path=r.path.slice(0,-1)}}}},{key:"is",value:function(e){return"position"===e||"model:position"===e}},{key:"hasSameParentAs",value:function(e){return this.root===e.root&&"same"==Cfe(this.getParentPath(),e.getParentPath())}},{key:"getTransformedByOperation",value:function(t){var n;switch(t.type){case"insert":n=this._getTransformedByInsertOperation(t);break;case"move":case"remove":case"reinsert":n=this._getTransformedByMoveOperation(t);break;case"split":n=this._getTransformedBySplitOperation(t);break;case"merge":n=this._getTransformedByMergeOperation(t);break;default:n=e._createAt(this)}return n}},{key:"_getTransformedByInsertOperation",value:function(e){return this._getTransformedByInsertion(e.position,e.howMany)}},{key:"_getTransformedByMoveOperation",value:function(e){return this._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany)}},{key:"_getTransformedBySplitOperation",value:function(e){var t=e.movedRange;return t.containsPosition(this)||t.start.isEqual(this)&&"toNext"==this.stickiness?this._getCombined(e.splitPosition,e.moveTargetPosition):e.graveyardPosition?this._getTransformedByMove(e.graveyardPosition,e.insertionPosition,1):this._getTransformedByInsertion(e.insertionPosition,1)}},{key:"_getTransformedByMergeOperation",value:function(t){var n,r=t.movedRange;return r.containsPosition(this)||r.start.isEqual(this)?(n=this._getCombined(t.sourcePosition,t.targetPosition),t.sourcePosition.isBefore(t.targetPosition)&&(n=n._getTransformedByDeletion(t.deletionPosition,1))):n=this.isEqual(t.deletionPosition)?e._createAt(t.deletionPosition):this._getTransformedByMove(t.deletionPosition,t.graveyardPosition,1),n}},{key:"_getTransformedByDeletion",value:function(t,n){var r=e._createAt(this);if(this.root!=t.root)return r;if("same"==Cfe(t.getParentPath(),this.getParentPath())){if(t.offsetthis.offset)return null;r.offset-=n}}else if("prefix"==Cfe(t.getParentPath(),this.getParentPath())){var o=t.path.length-1;if(t.offset<=this.path[o]){if(t.offset+n>this.path[o])return null;r.path[o]-=n}}return r}},{key:"_getTransformedByInsertion",value:function(t,n){var r=e._createAt(this);if(this.root!=t.root)return r;if("same"==Cfe(t.getParentPath(),this.getParentPath()))(t.offset=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Ebe(e,t){if(e){if("string"==typeof e)return Cbe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Cbe(e,t):void 0}}function Cbe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:"toNone";if(xbe(this,e),!t.is("element")&&!t.is("documentFragment"))throw new joe.a("model-position-root-invalid",t);if(!(n instanceof Array)||0===n.length)throw new joe.a("model-position-path-incorrect-format",t,{path:n});t.is("rootElement")?n=n.slice():(n=[].concat(Ebe(t.getPath()),Ebe(n)),t=t.root),this.root=t,this.path=n,this.stickiness=r}var t,n,r;return t=e,r=[{key:"_createAt",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"toNone";if(t instanceof e)return new e(t.root,t.path,t.stickiness);var o=t;if("end"==n)n=o.maxOffset;else{if("before"==n)return this._createBefore(o,r);if("after"==n)return this._createAfter(o,r);if(0!==n&&!n)throw new joe.a("model-createpositionat-offset-required",[this,t])}if(!o.is("element")&&!o.is("documentFragment"))throw new joe.a("model-position-parent-incorrect",[this,t]);var i=o.getPath();return i.push(n),new this(o.root,i,r)}},{key:"_createAfter",value:function(e,t){if(!e.parent)throw new joe.a("model-position-after-root",[this,e],{root:e});return this._createAt(e.parent,e.endOffset,t)}},{key:"_createBefore",value:function(e,t){if(!e.parent)throw new joe.a("model-position-before-root",e,{root:e});return this._createAt(e.parent,e.startOffset,t)}},{key:"fromJSON",value:function(t,n){if("$graveyard"===t.root){var r=new e(n.graveyard,t.path);return r.stickiness=t.stickiness,r}if(!n.getRoot(t.root))throw new joe.a("model-position-fromjson-no-root",n,{rootName:t.root});return new e(n.getRoot(t.root),t.path,t.stickiness)}}],(n=[{key:"compareWith",value:function(e){if(this.root!=e.root)return"different";var t=Ffe(this.path,e.path);switch(t){case"same":return"same";case"prefix":return"before";case"extension":return"after";default:return this.path[t]1&&void 0!==arguments[1]?arguments[1]:{};t.startPosition=this;var n=new Pbe(t);return n.skip(e),n.position}},{key:"getParentPath",value:function(){return this.path.slice(0,-1)}},{key:"getAncestors",value:function(){var e=this.parent;return e.is("documentFragment")?[e]:e.getAncestors({includeSelf:!0})}},{key:"findAncestor",value:function(e){var t=this.parent;return t.is("element")?t.findAncestor(e,{includeSelf:!0}):null}},{key:"getCommonPath",value:function(e){if(this.root!=e.root)return[];var t=Ffe(this.path,e.path),n="string"==typeof t?Math.min(this.path.length,e.path.length):t;return this.path.slice(0,n)}},{key:"getCommonAncestor",value:function(e){for(var t=this.getAncestors(),n=e.getAncestors(),r=0;t[r]==n[r]&&t[r];)r++;return 0===r?null:t[r-1]}},{key:"getShiftedBy",value:function(e){var t=this.clone(),n=t.offset+e;return t.offset=n<0?0:n,t}},{key:"isAfter",value:function(e){return"after"==this.compareWith(e)}},{key:"isBefore",value:function(e){return"before"==this.compareWith(e)}},{key:"isEqual",value:function(e){return"same"==this.compareWith(e)}},{key:"isTouching",value:function(t){var n=null,r=null;switch(this.compareWith(t)){case"same":return!0;case"before":n=e._createAt(this),r=e._createAt(t);break;case"after":n=e._createAt(t),r=e._createAt(this);break;default:return!1}for(var o=n.parent;n.path.length+r.path.length;){if(n.isEqual(r))return!0;if(n.path.length>r.path.length){if(n.offset!==o.maxOffset)return!1;n.path=n.path.slice(0,-1),o=o.parent,n.offset++}else{if(0!==r.offset)return!1;r.path=r.path.slice(0,-1)}}}},{key:"is",value:function(e){return"position"===e||"model:position"===e}},{key:"hasSameParentAs",value:function(e){return this.root===e.root&&"same"==Ffe(this.getParentPath(),e.getParentPath())}},{key:"getTransformedByOperation",value:function(t){var n;switch(t.type){case"insert":n=this._getTransformedByInsertOperation(t);break;case"move":case"remove":case"reinsert":n=this._getTransformedByMoveOperation(t);break;case"split":n=this._getTransformedBySplitOperation(t);break;case"merge":n=this._getTransformedByMergeOperation(t);break;default:n=e._createAt(this)}return n}},{key:"_getTransformedByInsertOperation",value:function(e){return this._getTransformedByInsertion(e.position,e.howMany)}},{key:"_getTransformedByMoveOperation",value:function(e){return this._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany)}},{key:"_getTransformedBySplitOperation",value:function(e){var t=e.movedRange;return t.containsPosition(this)||t.start.isEqual(this)&&"toNext"==this.stickiness?this._getCombined(e.splitPosition,e.moveTargetPosition):e.graveyardPosition?this._getTransformedByMove(e.graveyardPosition,e.insertionPosition,1):this._getTransformedByInsertion(e.insertionPosition,1)}},{key:"_getTransformedByMergeOperation",value:function(t){var n,r=t.movedRange;return r.containsPosition(this)||r.start.isEqual(this)?(n=this._getCombined(t.sourcePosition,t.targetPosition),t.sourcePosition.isBefore(t.targetPosition)&&(n=n._getTransformedByDeletion(t.deletionPosition,1))):n=this.isEqual(t.deletionPosition)?e._createAt(t.deletionPosition):this._getTransformedByMove(t.deletionPosition,t.graveyardPosition,1),n}},{key:"_getTransformedByDeletion",value:function(t,n){var r=e._createAt(this);if(this.root!=t.root)return r;if("same"==Ffe(t.getParentPath(),this.getParentPath())){if(t.offsetthis.offset)return null;r.offset-=n}}else if("prefix"==Ffe(t.getParentPath(),this.getParentPath())){var o=t.path.length-1;if(t.offset<=this.path[o]){if(t.offset+n>this.path[o])return null;r.path[o]-=n}}return r}},{key:"_getTransformedByInsertion",value:function(t,n){var r=e._createAt(this);if(this.root!=t.root)return r;if("same"==Ffe(t.getParentPath(),this.getParentPath()))(t.offset=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function zbe(e,t){if(e){if("string"==typeof e)return Fbe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Fbe(e,t):void 0}}function Fbe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:null;xbe(this,e),this.start=_be._createAt(t),this.end=n?_be._createAt(n):_be._createAt(t),this.start.stickiness=this.isCollapsed?"toNone":"toNext",this.end.stickiness=this.isCollapsed?"toNone":"toPrevious"}var t,n,r;return t=e,n=[{key:Symbol.iterator,value:regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.delegateYield(new ybe({boundaries:this,ignoreElementEnd:!0}),"t0",1);case 1:case"end":return e.stop()}}),e,this)}))},{key:"containsPosition",value:function(e){return e.isAfter(this.start)&&e.isBefore(this.end)}},{key:"containsRange",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e.isCollapsed&&(t=!1);var n=this.containsPosition(e.start)||t&&this.start.isEqual(e.start),r=this.containsPosition(e.end)||t&&this.end.isEqual(e.end);return n&&r}},{key:"containsItem",value:function(e){var t=_be._createBefore(e);return this.containsPosition(t)||this.start.isEqual(t)}},{key:"is",value:function(e){return"range"===e||"model:range"===e}},{key:"isEqual",value:function(e){return this.start.isEqual(e.start)&&this.end.isEqual(e.end)}},{key:"isIntersecting",value:function(e){return this.start.isBefore(e.end)&&this.end.isAfter(e.start)}},{key:"getDifference",value:function(t){var n=[];return this.isIntersecting(t)?(this.containsPosition(t.start)&&n.push(new e(this.start,t.start)),this.containsPosition(t.end)&&n.push(new e(t.end,this.end))):n.push(new e(this.start,this.end)),n}},{key:"getIntersection",value:function(t){if(this.isIntersecting(t)){var n=this.start,r=this.end;return this.containsPosition(t.start)&&(n=t.start),this.containsPosition(t.end)&&(r=t.end),new e(n,r)}return null}},{key:"getJoined",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.isIntersecting(t);if(r||(r=this.start.isBefore(t.start)?n?this.end.isTouching(t.start):this.end.isEqual(t.start):n?t.end.isTouching(this.start):t.end.isEqual(this.start)),!r)return null;var o=this.start,i=this.end;return t.start.isBefore(o)&&(o=t.start),t.end.isAfter(i)&&(i=t.end),new e(o,i)}},{key:"getMinimalFlatRanges",value:function(){for(var t=[],n=this.start.getCommonPath(this.end).length,r=_be._createAt(this.start),o=r.parent;r.path.length>n+1;){var i=o.maxOffset-r.offset;0!==i&&t.push(new e(r,r.getShiftedBy(i))),r.path=r.path.slice(0,-1),r.offset++,o=o.parent}for(;r.path.length<=this.end.path.length;){var a=this.end.path[r.path.length-1],u=a-r.offset;0!==u&&t.push(new e(r,r.getShiftedBy(u))),r.offset=a,r.path.push(0)}return t}},{key:"getWalker",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.boundaries=this,new ybe(e)}},{key:"getItems",value:regeneratorRuntime.mark((function e(){var t,n,r,o,i,a=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:(t=a.length>0&&void 0!==a[0]?a[0]:{}).boundaries=this,t.ignoreElementEnd=!0,n=new ybe(t),r=jbe(n),e.prev=5,r.s();case 7:if((o=r.n()).done){e.next=13;break}return i=o.value,e.next=11,i.item;case 11:e.next=7;break;case 13:e.next=18;break;case 15:e.prev=15,e.t0=e.catch(5),r.e(e.t0);case 18:return e.prev=18,r.f(),e.finish(18);case 21:case"end":return e.stop()}}),e,this,[[5,15,18,21]])}))},{key:"getPositions",value:regeneratorRuntime.mark((function e(){var t,n,r,o,i,a=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(t=a.length>0&&void 0!==a[0]?a[0]:{}).boundaries=this,n=new ybe(t),e.next=5,n.position;case 5:r=jbe(n),e.prev=6,r.s();case 8:if((o=r.n()).done){e.next=14;break}return i=o.value,e.next=12,i.nextPosition;case 12:e.next=8;break;case 14:e.next=19;break;case 16:e.prev=16,e.t0=e.catch(6),r.e(e.t0);case 19:return e.prev=19,r.f(),e.finish(19);case 22:case"end":return e.stop()}}),e,this,[[6,16,19,22]])}))},{key:"getTransformedByOperation",value:function(t){switch(t.type){case"insert":return this._getTransformedByInsertOperation(t);case"move":case"remove":case"reinsert":return this._getTransformedByMoveOperation(t);case"split":return[this._getTransformedBySplitOperation(t)];case"merge":return[this._getTransformedByMergeOperation(t)]}return[new e(this.start,this.end)]}},{key:"getTransformedByOperations",value:function(t){var n,r=[new e(this.start,this.end)],o=jbe(t);try{for(o.s();!(n=o.n()).done;)for(var i=n.value,a=0;a1&&void 0!==arguments[1]&&arguments[1];return this._getTransformedByInsertion(e.position,e.howMany,t)}},{key:"_getTransformedByMoveOperation",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.sourcePosition,r=e.howMany,o=e.targetPosition;return this._getTransformedByMove(n,o,r,t)}},{key:"_getTransformedBySplitOperation",value:function(t){var n=this.start._getTransformedBySplitOperation(t),r=this.end._getTransformedBySplitOperation(t);return this.end.isEqual(t.insertionPosition)&&(r=this.end.getShiftedBy(1)),n.root!=r.root&&(r=this.end.getShiftedBy(-1)),new e(n,r)}},{key:"_getTransformedByMergeOperation",value:function(t){if(this.start.isEqual(t.targetPosition)&&this.end.isEqual(t.deletionPosition))return new e(this.start);var n=this.start._getTransformedByMergeOperation(t),r=this.end._getTransformedByMergeOperation(t);return n.root!=r.root&&(r=this.end.getShiftedBy(-1)),n.isAfter(r)?(t.sourcePosition.isBefore(t.targetPosition)?(n=_be._createAt(r)).offset=0:(t.deletionPosition.isEqual(n)||(r=t.deletionPosition),n=t.targetPosition),new e(n,r)):new e(n,r)}},{key:"_getTransformedByInsertion",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(r&&this.containsPosition(t))return[new e(this.start,t),new e(t.getShiftedBy(n),this.end._getTransformedByInsertion(t,n))];var o=new e(this.start,this.end);return o.start=o.start._getTransformedByInsertion(t,n),o.end=o.end._getTransformedByInsertion(t,n),[o]}},{key:"_getTransformedByMove",value:function(t,n,r){var o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(this.isCollapsed){var i=this.start._getTransformedByMove(t,n,r);return[new e(i)]}var a,u=e._createFromPositionAndShift(t,r),l=n._getTransformedByDeletion(t,r);if(this.containsPosition(n)&&!o&&(u.containsPosition(this.start)||u.containsPosition(this.end))){var s=this.start._getTransformedByMove(t,n,r),c=this.end._getTransformedByMove(t,n,r);return[new e(s,c)]}var f=this.getDifference(u),p=null,d=this.getIntersection(u);if(1==f.length?p=new e(f[0].start._getTransformedByDeletion(t,r),f[0].end._getTransformedByDeletion(t,r)):2==f.length&&(p=new e(this.start,this.end._getTransformedByDeletion(t,r))),a=p?p._getTransformedByInsertion(l,r,null!==d||o):[],d){var h=new e(d.start._getCombined(u.start,l),d.end._getCombined(u.start,l));2==a.length?a.splice(1,0,h):a.push(h)}return a}},{key:"_getTransformedByDeletion",value:function(t,n){var r=this.start._getTransformedByDeletion(t,n),o=this.end._getTransformedByDeletion(t,n);return null==r&&null==o?null:(null==r&&(r=t),null==o&&(o=t),new e(r,o))}},{key:"isCollapsed",get:function(){return this.start.isEqual(this.end)}},{key:"isFlat",get:function(){return"same"==Cfe(this.start.getParentPath(),this.end.getParentPath())}},{key:"root",get:function(){return this.start.root}}],r=[{key:"_createFromPositionAndShift",value:function(e,t){var n=e,r=e.getShiftedBy(t);return t>0?new this(n,r):new this(r,n)}},{key:"_createIn",value:function(e){return new this(_be._createAt(e,0),_be._createAt(e,e.maxOffset))}},{key:"_createOn",value:function(e){return this._createFromPositionAndShift(_be._createBefore(e),e.offsetSize)}},{key:"_createFromRanges",value:function(e){if(0===e.length)throw new moe.a("range-create-from-ranges-empty-array",null);if(1==e.length)return e[0].clone();var t=e[0];e.sort((function(e,t){return e.start.isAfter(t.start)?1:-1}));var n=e.indexOf(t),r=new this(t.start,t.end);if(n>0)for(var o=n-1;e[o].end.isEqual(r.start);o++)r.start=_be._createAt(e[o].start);for(var i=n+1;i=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Mbe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:null;Ybe(this,e),this.start=Dbe._createAt(t),this.end=n?Dbe._createAt(n):Dbe._createAt(t),this.start.stickiness=this.isCollapsed?"toNone":"toNext",this.end.stickiness=this.isCollapsed?"toNone":"toPrevious"}var t,n,r;return t=e,n=[{key:Symbol.iterator,value:regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.delegateYield(new Pbe({boundaries:this,ignoreElementEnd:!0}),"t0",1);case 1:case"end":return e.stop()}}),e,this)}))},{key:"containsPosition",value:function(e){return e.isAfter(this.start)&&e.isBefore(this.end)}},{key:"containsRange",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e.isCollapsed&&(t=!1);var n=this.containsPosition(e.start)||t&&this.start.isEqual(e.start),r=this.containsPosition(e.end)||t&&this.end.isEqual(e.end);return n&&r}},{key:"containsItem",value:function(e){var t=Dbe._createBefore(e);return this.containsPosition(t)||this.start.isEqual(t)}},{key:"is",value:function(e){return"range"===e||"model:range"===e}},{key:"isEqual",value:function(e){return this.start.isEqual(e.start)&&this.end.isEqual(e.end)}},{key:"isIntersecting",value:function(e){return this.start.isBefore(e.end)&&this.end.isAfter(e.start)}},{key:"getDifference",value:function(t){var n=[];return this.isIntersecting(t)?(this.containsPosition(t.start)&&n.push(new e(this.start,t.start)),this.containsPosition(t.end)&&n.push(new e(t.end,this.end))):n.push(new e(this.start,this.end)),n}},{key:"getIntersection",value:function(t){if(this.isIntersecting(t)){var n=this.start,r=this.end;return this.containsPosition(t.start)&&(n=t.start),this.containsPosition(t.end)&&(r=t.end),new e(n,r)}return null}},{key:"getJoined",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.isIntersecting(t);if(r||(r=this.start.isBefore(t.start)?n?this.end.isTouching(t.start):this.end.isEqual(t.start):n?t.end.isTouching(this.start):t.end.isEqual(this.start)),!r)return null;var o=this.start,i=this.end;return t.start.isBefore(o)&&(o=t.start),t.end.isAfter(i)&&(i=t.end),new e(o,i)}},{key:"getMinimalFlatRanges",value:function(){for(var t=[],n=this.start.getCommonPath(this.end).length,r=Dbe._createAt(this.start),o=r.parent;r.path.length>n+1;){var i=o.maxOffset-r.offset;0!==i&&t.push(new e(r,r.getShiftedBy(i))),r.path=r.path.slice(0,-1),r.offset++,o=o.parent}for(;r.path.length<=this.end.path.length;){var a=this.end.path[r.path.length-1],u=a-r.offset;0!==u&&t.push(new e(r,r.getShiftedBy(u))),r.offset=a,r.path.push(0)}return t}},{key:"getWalker",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.boundaries=this,new Pbe(e)}},{key:"getItems",value:regeneratorRuntime.mark((function e(){var t,n,r,o,i,a=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:(t=a.length>0&&void 0!==a[0]?a[0]:{}).boundaries=this,t.ignoreElementEnd=!0,n=new Pbe(t),r=Ibe(n),e.prev=5,r.s();case 7:if((o=r.n()).done){e.next=13;break}return i=o.value,e.next=11,i.item;case 11:e.next=7;break;case 13:e.next=18;break;case 15:e.prev=15,e.t0=e.catch(5),r.e(e.t0);case 18:return e.prev=18,r.f(),e.finish(18);case 21:case"end":return e.stop()}}),e,this,[[5,15,18,21]])}))},{key:"getPositions",value:regeneratorRuntime.mark((function e(){var t,n,r,o,i,a=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(t=a.length>0&&void 0!==a[0]?a[0]:{}).boundaries=this,n=new Pbe(t),e.next=5,n.position;case 5:r=Ibe(n),e.prev=6,r.s();case 8:if((o=r.n()).done){e.next=14;break}return i=o.value,e.next=12,i.nextPosition;case 12:e.next=8;break;case 14:e.next=19;break;case 16:e.prev=16,e.t0=e.catch(6),r.e(e.t0);case 19:return e.prev=19,r.f(),e.finish(19);case 22:case"end":return e.stop()}}),e,this,[[6,16,19,22]])}))},{key:"getTransformedByOperation",value:function(t){switch(t.type){case"insert":return this._getTransformedByInsertOperation(t);case"move":case"remove":case"reinsert":return this._getTransformedByMoveOperation(t);case"split":return[this._getTransformedBySplitOperation(t)];case"merge":return[this._getTransformedByMergeOperation(t)]}return[new e(this.start,this.end)]}},{key:"getTransformedByOperations",value:function(t){var n,r=[new e(this.start,this.end)],o=Ibe(t);try{for(o.s();!(n=o.n()).done;)for(var i=n.value,a=0;a1&&void 0!==arguments[1]&&arguments[1];return this._getTransformedByInsertion(e.position,e.howMany,t)}},{key:"_getTransformedByMoveOperation",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.sourcePosition,r=e.howMany,o=e.targetPosition;return this._getTransformedByMove(n,o,r,t)}},{key:"_getTransformedBySplitOperation",value:function(t){var n=this.start._getTransformedBySplitOperation(t),r=this.end._getTransformedBySplitOperation(t);return this.end.isEqual(t.insertionPosition)&&(r=this.end.getShiftedBy(1)),n.root!=r.root&&(r=this.end.getShiftedBy(-1)),new e(n,r)}},{key:"_getTransformedByMergeOperation",value:function(t){if(this.start.isEqual(t.targetPosition)&&this.end.isEqual(t.deletionPosition))return new e(this.start);var n=this.start._getTransformedByMergeOperation(t),r=this.end._getTransformedByMergeOperation(t);return n.root!=r.root&&(r=this.end.getShiftedBy(-1)),n.isAfter(r)?(t.sourcePosition.isBefore(t.targetPosition)?(n=Dbe._createAt(r)).offset=0:(t.deletionPosition.isEqual(n)||(r=t.deletionPosition),n=t.targetPosition),new e(n,r)):new e(n,r)}},{key:"_getTransformedByInsertion",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(r&&this.containsPosition(t))return[new e(this.start,t),new e(t.getShiftedBy(n),this.end._getTransformedByInsertion(t,n))];var o=new e(this.start,this.end);return o.start=o.start._getTransformedByInsertion(t,n),o.end=o.end._getTransformedByInsertion(t,n),[o]}},{key:"_getTransformedByMove",value:function(t,n,r){var o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(this.isCollapsed){var i=this.start._getTransformedByMove(t,n,r);return[new e(i)]}var a,u=e._createFromPositionAndShift(t,r),l=n._getTransformedByDeletion(t,r);if(this.containsPosition(n)&&!o&&(u.containsPosition(this.start)||u.containsPosition(this.end))){var s=this.start._getTransformedByMove(t,n,r),c=this.end._getTransformedByMove(t,n,r);return[new e(s,c)]}var f=this.getDifference(u),p=null,d=this.getIntersection(u);if(1==f.length?p=new e(f[0].start._getTransformedByDeletion(t,r),f[0].end._getTransformedByDeletion(t,r)):2==f.length&&(p=new e(this.start,this.end._getTransformedByDeletion(t,r))),a=p?p._getTransformedByInsertion(l,r,null!==d||o):[],d){var h=new e(d.start._getCombined(u.start,l),d.end._getCombined(u.start,l));2==a.length?a.splice(1,0,h):a.push(h)}return a}},{key:"_getTransformedByDeletion",value:function(t,n){var r=this.start._getTransformedByDeletion(t,n),o=this.end._getTransformedByDeletion(t,n);return null==r&&null==o?null:(null==r&&(r=t),null==o&&(o=t),new e(r,o))}},{key:"isCollapsed",get:function(){return this.start.isEqual(this.end)}},{key:"isFlat",get:function(){return"same"==Ffe(this.start.getParentPath(),this.end.getParentPath())}},{key:"root",get:function(){return this.start.root}}],r=[{key:"_createFromPositionAndShift",value:function(e,t){var n=e,r=e.getShiftedBy(t);return t>0?new this(n,r):new this(r,n)}},{key:"_createIn",value:function(e){return new this(Dbe._createAt(e,0),Dbe._createAt(e,e.maxOffset))}},{key:"_createOn",value:function(e){return this._createFromPositionAndShift(Dbe._createBefore(e),e.offsetSize)}},{key:"_createFromRanges",value:function(e){if(0===e.length)throw new joe.a("range-create-from-ranges-empty-array",null);if(1==e.length)return e[0].clone();var t=e[0];e.sort((function(e,t){return e.start.isAfter(t.start)?1:-1}));var n=e.indexOf(t),r=new this(t.start,t.end);if(n>0)for(var o=n-1;e[o].end.isEqual(r.start);o++)r.start=Dbe._createAt(e[o].start);for(var i=n+1;i=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Vbe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:{isPhantom:!1},n={modelPosition:e,mapper:this,isPhantom:t.isPhantom};return this.fire("modelToViewPosition",n),n.viewPosition}},{key:"markerNameToElements",value:function(e){var t=this._markerNameToElements.get(e);if(!t)return null;var n,r=new Set,o=Rbe(t);try{for(o.s();!(n=o.n()).done;){var i=n.value;if(i.is("attributeElement")){var a,u=Rbe(i.getElementsWithSameId());try{for(u.s();!(a=u.n()).done;){var l=a.value;r.add(l)}}catch(e){u.e(e)}finally{u.f()}}else r.add(i)}}catch(e){o.e(e)}finally{o.f()}return r}},{key:"registerViewToModelLength",value:function(e,t){this._viewToModelLengthCallbacks.set(e,t)}},{key:"findMappedViewAncestor",value:function(e){for(var t=e.parent;!this._viewToModelMapping.has(t);)t=t.parent;return t}},{key:"_toModelOffset",value:function(e,t,n){if(n!=e)return this._toModelOffset(e.parent,e.index,n)+this._toModelOffset(e,t,e);if(e.is("$text"))return t;for(var r=0,o=0;o1&&void 0!==arguments[1]?arguments[1]:{isPhantom:!1},n={modelPosition:e,mapper:this,isPhantom:t.isPhantom};return this.fire("modelToViewPosition",n),n.viewPosition}},{key:"markerNameToElements",value:function(e){var t=this._markerNameToElements.get(e);if(!t)return null;var n,r=new Set,o=Hbe(t);try{for(o.s();!(n=o.n()).done;){var i=n.value;if(i.is("attributeElement")){var a,u=Hbe(i.getElementsWithSameId());try{for(u.s();!(a=u.n()).done;){var l=a.value;r.add(l)}}catch(e){u.e(e)}finally{u.f()}}else r.add(i)}}catch(e){o.e(e)}finally{o.f()}return r}},{key:"registerViewToModelLength",value:function(e,t){this._viewToModelLengthCallbacks.set(e,t)}},{key:"findMappedViewAncestor",value:function(e){for(var t=e.parent;!this._viewToModelMapping.has(t);)t=t.parent;return t}},{key:"_toModelOffset",value:function(e,t,n){if(n!=e)return this._toModelOffset(e.parent,e.index,n)+this._toModelOffset(e,t,e);if(e.is("$text"))return t;for(var r=0,o=0;o1?t[0]+":"+t[1]:t[0]}function Ybe(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Nbe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Nbe(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Nbe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1?t[0]+":"+t[1]:t[0]}function Gbe(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Zbe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Zbe(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Zbe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Kbe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function rve(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]&&arguments[1],r=(e=Array.from(e)).some((function(n){if(!(n instanceof Dbe))throw new moe.a("model-selection-set-ranges-not-range",[t,e]);return t._ranges.every((function(e){return!e.isEqual(n)}))}));if(e.length!==this._ranges.length||r){this._removeAllRanges();var o,i=qbe(e);try{for(i.s();!(o=i.n()).done;){var a=o.value;this._pushRange(a)}}catch(e){i.e(e)}finally{i.f()}this._lastRangeBackward=!!n,this.fire("change:range",{directChange:!0})}}},{key:"setFocus",value:function(e,t){if(null===this.anchor)throw new moe.a("model-selection-setfocus-no-ranges",[this,e]);var n=_be._createAt(e,t);if("same"!=n.compareWith(this.focus)){var r=this.anchor;this._ranges.length&&this._popRange(),"before"==n.compareWith(r)?(this._pushRange(new Dbe(n,r)),this._lastRangeBackward=!0):(this._pushRange(new Dbe(r,n)),this._lastRangeBackward=!1),this.fire("change:range",{directChange:!0})}}},{key:"getAttribute",value:function(e){return this._attrs.get(e)}},{key:"getAttributes",value:function(){return this._attrs.entries()}},{key:"getAttributeKeys",value:function(){return this._attrs.keys()}},{key:"hasAttribute",value:function(e){return this._attrs.has(e)}},{key:"removeAttribute",value:function(e){this.hasAttribute(e)&&(this._attrs.delete(e),this.fire("change:attribute",{attributeKeys:[e],directChange:!0}))}},{key:"setAttribute",value:function(e,t){this.getAttribute(e)!==t&&(this._attrs.set(e,t),this.fire("change:attribute",{attributeKeys:[e],directChange:!0}))}},{key:"getSelectedElement",value:function(){return 1!==this.rangeCount?null:this.getFirstRange().getContainedElement()}},{key:"is",value:function(e){return"selection"===e||"model:selection"===e}},{key:"getSelectedBlocks",value:regeneratorRuntime.mark((function e(){var t,n,r,o,i,a,u,l,s,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=new WeakSet,n=qbe(this.getRanges()),e.prev=2,n.s();case 4:if((r=n.n()).done){e.next=35;break}if(o=r.value,!(i=Qbe(o.start,t))||!Xbe(i,o)){e.next=10;break}return e.next=10,i;case 10:a=qbe(o.getWalker()),e.prev=11,a.s();case 13:if((u=a.n()).done){e.next=21;break}if(l=u.value,s=l.item,"elementEnd"!=l.type||!Jbe(s,t,o)){e.next=19;break}return e.next=19,s;case 19:e.next=13;break;case 21:e.next=26;break;case 23:e.prev=23,e.t0=e.catch(11),a.e(e.t0);case 26:return e.prev=26,a.f(),e.finish(26);case 29:if(!(c=Qbe(o.end,t))||o.end.isTouching(_be._createAt(c,0))||!Xbe(c,o)){e.next=33;break}return e.next=33,c;case 33:e.next=4;break;case 35:e.next=40;break;case 37:e.prev=37,e.t1=e.catch(2),n.e(e.t1);case 40:return e.prev=40,n.f(),e.finish(40);case 43:case"end":return e.stop()}}),e,this,[[2,37,40,43],[11,23,26,29]])}))},{key:"containsEntireContent",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.anchor.root,t=_be._createAt(e,0),n=_be._createAt(e,"end");return t.isTouching(this.getFirstPosition())&&n.isTouching(this.getLastPosition())}},{key:"_pushRange",value:function(e){this._checkRange(e),this._ranges.push(new Dbe(e.start,e.end))}},{key:"_checkRange",value:function(e){for(var t=0;t0;)this._popRange()}},{key:"_popRange",value:function(){this._ranges.pop()}},{key:"anchor",get:function(){if(this._ranges.length>0){var e=this._ranges[this._ranges.length-1];return this._lastRangeBackward?e.end:e.start}return null}},{key:"focus",get:function(){if(this._ranges.length>0){var e=this._ranges[this._ranges.length-1];return this._lastRangeBackward?e.start:e.end}return null}},{key:"isCollapsed",get:function(){return 1===this._ranges.length&&this._ranges[0].isCollapsed}},{key:"rangeCount",get:function(){return this._ranges.length}},{key:"isBackward",get:function(){return!this.isCollapsed&&this._lastRangeBackward}}])&&$be(t.prototype,n),r&&$be(t,r),e}();function Zbe(e,t){return!t.has(e)&&(t.add(e),e.root.document.model.schema.isBlock(e)&&e.parent)}function Jbe(e,t,n){return Zbe(e,t)&&Xbe(e,n)}function Qbe(e,t){var n=e.parent.root.document.model.schema,r=e.parent.getAncestors({parentFirst:!0,includeSelf:!0}),o=!1,i=r.find((function(e){return!o&&(!(o=n.isLimit(e))&&Zbe(e,t))}));return r.forEach((function(e){return t.add(e)})),i}function Xbe(e,t){var n=function(e){var t=e.root.document.model.schema,n=e.parent;for(;n;){if(t.isBlock(n))return n;n=n.parent}}(e);return!n||!t.containsRange(Dbe._createOn(n),!0)}function eve(e){return(eve="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function tve(e,t){for(var n=0;n1&&void 0!==arguments[1]&&arguments[1],r=(e=Array.from(e)).some((function(n){if(!(n instanceof Bbe))throw new joe.a("model-selection-set-ranges-not-range",[t,e]);return t._ranges.every((function(e){return!e.isEqual(n)}))}));if(e.length!==this._ranges.length||r){this._removeAllRanges();var o,i=nve(e);try{for(i.s();!(o=i.n()).done;){var a=o.value;this._pushRange(a)}}catch(e){i.e(e)}finally{i.f()}this._lastRangeBackward=!!n,this.fire("change:range",{directChange:!0})}}},{key:"setFocus",value:function(e,t){if(null===this.anchor)throw new joe.a("model-selection-setfocus-no-ranges",[this,e]);var n=Dbe._createAt(e,t);if("same"!=n.compareWith(this.focus)){var r=this.anchor;this._ranges.length&&this._popRange(),"before"==n.compareWith(r)?(this._pushRange(new Bbe(n,r)),this._lastRangeBackward=!0):(this._pushRange(new Bbe(r,n)),this._lastRangeBackward=!1),this.fire("change:range",{directChange:!0})}}},{key:"getAttribute",value:function(e){return this._attrs.get(e)}},{key:"getAttributes",value:function(){return this._attrs.entries()}},{key:"getAttributeKeys",value:function(){return this._attrs.keys()}},{key:"hasAttribute",value:function(e){return this._attrs.has(e)}},{key:"removeAttribute",value:function(e){this.hasAttribute(e)&&(this._attrs.delete(e),this.fire("change:attribute",{attributeKeys:[e],directChange:!0}))}},{key:"setAttribute",value:function(e,t){this.getAttribute(e)!==t&&(this._attrs.set(e,t),this.fire("change:attribute",{attributeKeys:[e],directChange:!0}))}},{key:"getSelectedElement",value:function(){return 1!==this.rangeCount?null:this.getFirstRange().getContainedElement()}},{key:"is",value:function(e){return"selection"===e||"model:selection"===e}},{key:"getSelectedBlocks",value:regeneratorRuntime.mark((function e(){var t,n,r,o,i,a,u,l,s,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=new WeakSet,n=nve(this.getRanges()),e.prev=2,n.s();case 4:if((r=n.n()).done){e.next=35;break}if(o=r.value,!(i=lve(o.start,t))||!sve(i,o)){e.next=10;break}return e.next=10,i;case 10:a=nve(o.getWalker()),e.prev=11,a.s();case 13:if((u=a.n()).done){e.next=21;break}if(l=u.value,s=l.item,"elementEnd"!=l.type||!uve(s,t,o)){e.next=19;break}return e.next=19,s;case 19:e.next=13;break;case 21:e.next=26;break;case 23:e.prev=23,e.t0=e.catch(11),a.e(e.t0);case 26:return e.prev=26,a.f(),e.finish(26);case 29:if(!(c=lve(o.end,t))||o.end.isTouching(Dbe._createAt(c,0))||!sve(c,o)){e.next=33;break}return e.next=33,c;case 33:e.next=4;break;case 35:e.next=40;break;case 37:e.prev=37,e.t1=e.catch(2),n.e(e.t1);case 40:return e.prev=40,n.f(),e.finish(40);case 43:case"end":return e.stop()}}),e,this,[[2,37,40,43],[11,23,26,29]])}))},{key:"containsEntireContent",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.anchor.root,t=Dbe._createAt(e,0),n=Dbe._createAt(e,"end");return t.isTouching(this.getFirstPosition())&&n.isTouching(this.getLastPosition())}},{key:"_pushRange",value:function(e){this._checkRange(e),this._ranges.push(new Bbe(e.start,e.end))}},{key:"_checkRange",value:function(e){for(var t=0;t0;)this._popRange()}},{key:"_popRange",value:function(){this._ranges.pop()}},{key:"anchor",get:function(){if(this._ranges.length>0){var e=this._ranges[this._ranges.length-1];return this._lastRangeBackward?e.end:e.start}return null}},{key:"focus",get:function(){if(this._ranges.length>0){var e=this._ranges[this._ranges.length-1];return this._lastRangeBackward?e.start:e.end}return null}},{key:"isCollapsed",get:function(){return 1===this._ranges.length&&this._ranges[0].isCollapsed}},{key:"rangeCount",get:function(){return this._ranges.length}},{key:"isBackward",get:function(){return!this.isCollapsed&&this._lastRangeBackward}}])&&ove(t.prototype,n),r&&ove(t,r),e}();function ave(e,t){return!t.has(e)&&(t.add(e),e.root.document.model.schema.isBlock(e)&&e.parent)}function uve(e,t,n){return ave(e,t)&&sve(e,n)}function lve(e,t){var n=e.parent.root.document.model.schema,r=e.parent.getAncestors({parentFirst:!0,includeSelf:!0}),o=!1,i=r.find((function(e){return!o&&(!(o=n.isLimit(e))&&ave(e,t))}));return r.forEach((function(e){return t.add(e)})),i}function sve(e,t){var n=function(e){var t=e.root.document.model.schema,n=e.parent;for(;n;){if(t.isBlock(n))return n;n=n.parent}}(e);return!n||!t.containsRange(Bbe._createOn(n),!0)}function cve(e){return(cve="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function fve(e,t){for(var n=0;n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function dve(e,t){if(e){if("string"==typeof e)return hve(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?hve(e,t):void 0}}function hve(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Sve(e,t){if(e){if("string"==typeof e)return kve(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?kve(e,t):void 0}}function kve(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&this.fire("change:attribute",{attributeKeys:l,directChange:!1})}},{key:"_setAttribute",value:function(e,t){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o=r?"normal":"low";if("low"==o&&"normal"==this._attributePriority.get(e))return!1;var i=yve(wve(n.prototype),"getAttribute",this).call(this,e);return i!==t&&(this._attrs.set(e,t),this._attributePriority.set(e,o),!0)}},{key:"_removeAttribute",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=t?"normal":"low";return("low"!=r||"normal"!=this._attributePriority.get(e))&&(this._attributePriority.set(e,r),!!yve(wve(n.prototype),"hasAttribute",this).call(this,e)&&(this._attrs.delete(e),!0))}},{key:"_setAttributesTo",value:function(e){var t,n=new Set,r=pve(this.getAttributes());try{for(r.s();!(t=r.n()).done;){var o=fve(t.value,2),i=o[0],a=o[1];e.get(i)!==a&&this._removeAttribute(i,!1)}}catch(e){r.e(e)}finally{r.f()}var u,l=pve(e);try{for(l.s();!(u=l.n()).done;){var s=fve(u.value,2),c=s[0],f=s[1];this._setAttribute(c,f,!1)&&n.add(c)}}catch(e){l.e(e)}finally{l.f()}return n}},{key:"_getStoredAttributes",value:regeneratorRuntime.mark((function e(){var t,n,r,o,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this.getFirstPosition().parent,!this.isCollapsed||!t.isEmpty){e.next=21;break}n=pve(t.getAttributeKeys()),e.prev=3,n.s();case 5:if((r=n.n()).done){e.next=13;break}if(!(o=r.value).startsWith("selection:")){e.next=11;break}return i=o.substr("selection:".length),e.next=11,[i,t.getAttribute(o)];case 11:e.next=5;break;case 13:e.next=18;break;case 15:e.prev=15,e.t0=e.catch(3),n.e(e.t0);case 18:return e.prev=18,n.f(),e.finish(18);case 21:case"end":return e.stop()}}),e,this,[[3,15,18,21]])}))},{key:"_getSurroundingAttributes",value:function(){var e=this.getFirstPosition(),t=this._model.schema,n=null;if(this.isCollapsed){var r=e.textNode?e.textNode:e.nodeBefore,o=e.textNode?e.textNode:e.nodeAfter;if(this.isGravityOverridden||(n=jve(r)),n||(n=jve(o)),!this.isGravityOverridden&&!n)for(var i=r;i&&!t.isInline(i)&&!n;)n=jve(i=i.previousSibling);if(!n)for(var a=o;a&&!t.isInline(a)&&!n;)n=jve(a=a.nextSibling);n||(n=this._getStoredAttributes())}else{var u,l=pve(this.getFirstRange());try{for(l.s();!(u=l.n()).done;){var s=u.value;if(s.item.is("element")&&t.isObject(s.item))break;if("text"==s.type){n=s.item.getAttributes();break}}}catch(e){l.e(e)}finally{l.f()}}return n}},{key:"_fixGraveyardSelection",value:function(e){var t=this._model.schema.getNearestSelectionRange(e);t&&this._pushRange(t)}},{key:"isCollapsed",get:function(){return 0===this._ranges.length?this._document._getDefaultRange().isCollapsed:yve(wve(n.prototype),"isCollapsed",this)}},{key:"anchor",get:function(){return yve(wve(n.prototype),"anchor",this)||this._document._getDefaultRange().start}},{key:"focus",get:function(){return yve(wve(n.prototype),"focus",this)||this._document._getDefaultRange().end}},{key:"rangeCount",get:function(){return this._ranges.length?this._ranges.length:1}},{key:"hasOwnRange",get:function(){return this._ranges.length>0}},{key:"isGravityOverridden",get:function(){return!!this._overriddenGravityRegister.size}}]),n}(Gbe);function jve(e){return e instanceof Zme||e instanceof $me?e.getAttributes():null}function Eve(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Cve(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Cve(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Cve(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&this.fire("change:attribute",{attributeKeys:l,directChange:!1})}},{key:"_setAttribute",value:function(e,t){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o=r?"normal":"low";if("low"==o&&"normal"==this._attributePriority.get(e))return!1;var i=Pve(Tve(n.prototype),"getAttribute",this).call(this,e);return i!==t&&(this._attrs.set(e,t),this._attributePriority.set(e,o),!0)}},{key:"_removeAttribute",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=t?"normal":"low";return("low"!=r||"normal"!=this._attributePriority.get(e))&&(this._attributePriority.set(e,r),!!Pve(Tve(n.prototype),"hasAttribute",this).call(this,e)&&(this._attrs.delete(e),!0))}},{key:"_setAttributesTo",value:function(e){var t,n=new Set,r=Ove(this.getAttributes());try{for(r.s();!(t=r.n()).done;){var o=_ve(t.value,2),i=o[0],a=o[1];e.get(i)!==a&&this._removeAttribute(i,!1)}}catch(e){r.e(e)}finally{r.f()}var u,l=Ove(e);try{for(l.s();!(u=l.n()).done;){var s=_ve(u.value,2),c=s[0],f=s[1];this._setAttribute(c,f,!1)&&n.add(c)}}catch(e){l.e(e)}finally{l.f()}return n}},{key:"_getStoredAttributes",value:regeneratorRuntime.mark((function e(){var t,n,r,o,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this.getFirstPosition().parent,!this.isCollapsed||!t.isEmpty){e.next=21;break}n=Ove(t.getAttributeKeys()),e.prev=3,n.s();case 5:if((r=n.n()).done){e.next=13;break}if(!(o=r.value).startsWith("selection:")){e.next=11;break}return i=o.substr("selection:".length),e.next=11,[i,t.getAttribute(o)];case 11:e.next=5;break;case 13:e.next=18;break;case 15:e.prev=15,e.t0=e.catch(3),n.e(e.t0);case 18:return e.prev=18,n.f(),e.finish(18);case 21:case"end":return e.stop()}}),e,this,[[3,15,18,21]])}))},{key:"_getSurroundingAttributes",value:function(){var e=this.getFirstPosition(),t=this._model.schema,n=null;if(this.isCollapsed){var r=e.textNode?e.textNode:e.nodeBefore,o=e.textNode?e.textNode:e.nodeAfter;if(this.isGravityOverridden||(n=Ive(r)),n||(n=Ive(o)),!this.isGravityOverridden&&!n)for(var i=r;i&&!t.isInline(i)&&!n;)n=Ive(i=i.previousSibling);if(!n)for(var a=o;a&&!t.isInline(a)&&!n;)n=Ive(a=a.nextSibling);n||(n=this._getStoredAttributes())}else{var u,l=Ove(this.getFirstRange());try{for(l.s();!(u=l.n()).done;){var s=u.value;if(s.item.is("element")&&t.isObject(s.item))break;if("text"==s.type){n=s.item.getAttributes();break}}}catch(e){l.e(e)}finally{l.f()}}return n}},{key:"_fixGraveyardSelection",value:function(e){var t=this._model.schema.getNearestSelectionRange(e);t&&this._pushRange(t)}},{key:"isCollapsed",get:function(){return 0===this._ranges.length?this._document._getDefaultRange().isCollapsed:Pve(Tve(n.prototype),"isCollapsed",this)}},{key:"anchor",get:function(){return Pve(Tve(n.prototype),"anchor",this)||this._document._getDefaultRange().start}},{key:"focus",get:function(){return Pve(Tve(n.prototype),"focus",this)||this._document._getDefaultRange().end}},{key:"rangeCount",get:function(){return this._ranges.length?this._ranges.length:1}},{key:"hasOwnRange",get:function(){return this._ranges.length>0}},{key:"isGravityOverridden",get:function(){return!!this._overriddenGravityRegister.size}}]),n}(ive);function Ive(e){return e instanceof abe||e instanceof obe?e.getAttributes():null}function zve(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Fve(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Fve(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Fve(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Mve(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Vve(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Gve(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function ige(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function tge(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function fge(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:null,n=null===t||function(e){return e.getAttribute(t)},r="object"!=nge(e.model)?e.model:e.model.key,o="object"!=nge(e.model)||void 0===e.model.value?n:e.model.value;e.model={key:r,value:o}}function hge(e,t){var n=new qfe(e.view);return function(r,o,i){var a=n.match(o.viewItem);if(a){var u=e.model.key,l="function"==typeof e.model.value?e.model.value(o.viewItem,i):e.model.value;if(null!==l)if(!function(e,t){var n="function"==typeof e?e(t):e;if("object"==nge(n)&&!fge(n))return!1;return!n.classes&&!n.attributes&&!n.styles}(e.view,o.viewItem)?delete a.match.name:a.match.name=!0,i.consumable.test(o.viewItem,a.match))o.modelRange||(o=Object.assign(o,i.convertChildren(o.viewItem,o.modelCursor))),function(e,t,n,r){for(var o=!1,i=0,a=Array.from(e.getItems({shallow:n}));i1&&void 0!==arguments[1]?arguments[1]:null,n=null===t||function(e){return e.getAttribute(t)},r="object"!=pge(e.model)?e.model:e.model.key,o="object"!=pge(e.model)||void 0===e.model.value?n:e.model.value;e.model={key:r,value:o}}function kge(e,t){var n=new npe(e.view);return function(r,o,i){var a=n.match(o.viewItem);if(a){var u=e.model.key,l="function"==typeof e.model.value?e.model.value(o.viewItem,i):e.model.value;if(null!==l)if(!function(e,t){var n="function"==typeof e?e(t):e;if("object"==pge(n)&&!_ge(n))return!1;return!n.classes&&!n.attributes&&!n.styles}(e.view,o.viewItem)?delete a.match.name:a.match.name=!0,i.consumable.test(o.viewItem,a.match))o.modelRange||(o=Object.assign(o,i.convertChildren(o.viewItem,o.modelCursor))),function(e,t,n,r){for(var o=!1,i=0,a=Array.from(e.getItems({shallow:n}));i=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function gge(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function xge(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1?n-1:0),o=1;o=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function kge(e,t){if(e){if("string"==typeof e)return Pge(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Pge(e,t):void 0}}function Pge(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1?n-1:0),o=1;o=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Age(e,t){if(e){if("string"==typeof e)return Lge(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Lge(e,t):void 0}}function Lge(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Ige(e,t){if(e){if("string"==typeof e)return zge(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?zge(e,t):void 0}}function zge(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function qge(e,t){if(e){if("string"==typeof e)return Kge(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Kge(e,t):void 0}}function Kge(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:null;if(e instanceof _be){var n=e.nodeBefore,r=e.nodeAfter;if(!(n instanceof pbe))throw new moe.a("schema-check-merge-no-element-before",this);if(!(r instanceof pbe))throw new moe.a("schema-check-merge-no-element-after",this);return this.checkMerge(n,r)}var o,i=Lge(t.getChildren());try{for(i.s();!(o=i.n()).done;){var a=o.value;if(!this.checkChild(e,a))return!1}}catch(e){i.e(e)}finally{i.f()}return!0}},{key:"addChildCheck",value:function(e){this.on("checkChild",(function(t,n){var r=Age(n,2),o=r[0],i=r[1];if(i){var a=e(o,i);"boolean"==typeof a&&(t.stop(),t.return=a)}}),{priority:"high"})}},{key:"addAttributeCheck",value:function(e){this.on("checkAttribute",(function(t,n){var r=Age(n,2),o=r[0],i=r[1],a=e(o,i);"boolean"==typeof a&&(t.stop(),t.return=a)}),{priority:"high"})}},{key:"setAttributeProperties",value:function(e,t){this._attributeProperties[e]=Object.assign(this.getAttributeProperties(e),t)}},{key:"getAttributeProperties",value:function(e){return this._attributeProperties[e]||{}}},{key:"getLimitElement",value:function(e){var t;e instanceof _be?t=e.parent:t=(e instanceof Dbe?[e]:Array.from(e.getRanges())).reduce((function(e,t){var n=t.getCommonAncestor();return e?e.getCommonAncestor(n,{includeSelf:!0}):n}),null);for(;!this.isLimit(t)&&t.parent;)t=t.parent;return t}},{key:"checkAttributeInSelection",value:function(e,t){if(e.isCollapsed){var n=e.getFirstPosition(),r=[].concat(Mge(n.getAncestors()),[new $me("",e.getAttributes())]);return this.checkAttribute(r,t)}var o,i=Lge(e.getRanges());try{for(i.s();!(o=i.n()).done;){var a,u=Lge(o.value);try{for(u.s();!(a=u.n()).done;){var l=a.value;if(this.checkAttribute(l.item,t))return!0}}catch(e){u.e(e)}finally{u.f()}}}catch(e){i.e(e)}finally{i.f()}return!1}},{key:"getValidRanges",value:regeneratorRuntime.mark((function e(t,n){var r,o,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=ewe(t),r=Lge(t),e.prev=2,r.s();case 4:if((o=r.n()).done){e.next=9;break}return i=o.value,e.delegateYield(this._getValidRangesForRange(i,n),"t0",7);case 7:e.next=4;break;case 9:e.next=14;break;case 11:e.prev=11,e.t1=e.catch(2),r.e(e.t1);case 14:return e.prev=14,r.f(),e.finish(14);case 17:case"end":return e.stop()}}),e,this,[[2,11,14,17]])}))},{key:"getNearestSelectionRange",value:function(e){var t,n,r=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"both";if(this.checkChild(e,"$text"))return new Dbe(e);var i=e.getAncestors().reverse().find((function(e){return r.isLimit(e)}))||e.root;"both"!=o&&"backward"!=o||(t=new ybe({boundaries:Dbe._createIn(i),startPosition:e,direction:"backward"})),"both"!=o&&"forward"!=o||(n=new ybe({boundaries:Dbe._createIn(i),startPosition:e}));var a,u=Lge(Xge(t,n));try{for(u.s();!(a=u.n()).done;){var l=a.value,s=l.walker==t?"elementEnd":"elementStart",c=l.value;if(c.type==s&&this.isObject(c.item))return Dbe._createOn(c.item);if(this.checkChild(c.nextPosition,"$text"))return new Dbe(c.nextPosition)}}catch(e){u.e(e)}finally{u.f()}return null}},{key:"findAllowedParent",value:function(e,t){for(var n=e.parent;n;){if(this.checkChild(n,t))return n;if(this.isLimit(n))return null;n=n.parent}return null}},{key:"removeDisallowedAttributes",value:function(e,t){var n,r=Lge(e);try{for(r.s();!(n=r.n()).done;){var o=n.value;if(o.is("$text"))twe(this,o,t);else{var i,a=Lge(Dbe._createIn(o).getPositions());try{for(a.s();!(i=a.n()).done;){var u=i.value;twe(this,u.nodeBefore||u.parent,t)}}catch(e){a.e(e)}finally{a.f()}}}}catch(e){r.e(e)}finally{r.f()}}},{key:"createContext",value:function(e){return new Hge(e)}},{key:"_clearCache",value:function(){this._compiledDefinitions=null}},{key:"_compile",value:function(){for(var e={},t=this._sourceDefinitions,n=Object.keys(t),r=0,o=n;r2&&void 0!==arguments[2]?arguments[2]:t.length-1,r=t.getItem(n);if(e.allowIn.includes(r.name)){if(0==n)return!0;var o=this.getDefinition(r);return this._checkContextMatch(o,t,n-1)}return!1}},{key:"_getValidRangesForRange",value:regeneratorRuntime.mark((function e(t,n){var r,o,i,a,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=t.start,o=t.start,i=Lge(t.getItems({shallow:!0})),e.prev=3,i.s();case 5:if((a=i.n()).done){e.next=17;break}if(!(u=a.value).is("element")){e.next=9;break}return e.delegateYield(this._getValidRangesForRange(Dbe._createIn(u),n),"t0",9);case 9:if(this.checkAttribute(u,n)){e.next=14;break}if(r.isEqual(o)){e.next=13;break}return e.next=13,new Dbe(r,o);case 13:r=_be._createAfter(u);case 14:o=_be._createAfter(u);case 15:e.next=5;break;case 17:e.next=22;break;case 19:e.prev=19,e.t1=e.catch(3),i.e(e.t1);case 22:return e.prev=22,i.f(),e.finish(22);case 25:if(r.isEqual(o)){e.next=28;break}return e.next=28,new Dbe(r,o);case 28:case"end":return e.stop()}}),e,this,[[3,19,22,25]])}))}]),e}();Zoe(Bge,Boe);var Hge=function(){function e(t){if(Fge(this,e),t instanceof e)return t;"string"==typeof t?t=[t]:Array.isArray(t)||(t=t.getAncestors({includeSelf:!0})),t[0]&&"string"!=typeof t[0]&&t[0].is("documentFragment")&&t.shift(),this._items=t.map(Qge)}return Nge(e,[{key:Symbol.iterator,value:function(){return this._items[Symbol.iterator]()}},{key:"push",value:function(t){var n=new e([t]);return n._items=[].concat(Mge(this._items),Mge(n._items)),n}},{key:"getItem",value:function(e){return this._items[e]}},{key:"getNames",value:regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.delegateYield(this._items.map((function(e){return e.name})),"t0",1);case 1:case"end":return e.stop()}}),e,this)}))},{key:"endsWith",value:function(e){return Array.from(this.getNames()).join(" ").endsWith(e)}},{key:"startsWith",value:function(e){return Array.from(this.getNames()).join(" ").startsWith(e)}},{key:"length",get:function(){return this._items.length}},{key:"last",get:function(){return this._items[this._items.length-1]}}]),e}();function Vge(e,t){var n={name:t,allowIn:[],allowContentOf:[],allowWhere:[],allowAttributes:[],allowAttributesOf:[],inheritTypesFrom:[]};return function(e,t){var n,r=Lge(e);try{for(r.s();!(n=r.n()).done;){var o,i=n.value,a=Lge(Object.keys(i).filter((function(e){return e.startsWith("is")})));try{for(a.s();!(o=a.n()).done;){var u=o.value;t[u]=i[u]}}catch(e){a.e(e)}finally{a.f()}}}catch(e){r.e(e)}finally{r.f()}}(e,n),Zge(e,n,"allowIn"),Zge(e,n,"allowContentOf"),Zge(e,n,"allowWhere"),Zge(e,n,"allowAttributes"),Zge(e,n,"allowAttributesOf"),Zge(e,n,"inheritTypesFrom"),function(e,t){var n,r=Lge(e);try{for(r.s();!(n=r.n()).done;){var o=n.value.inheritAllFrom;o&&(t.allowContentOf.push(o),t.allowWhere.push(o),t.allowAttributesOf.push(o),t.inheritTypesFrom.push(o))}}catch(e){r.e(e)}finally{r.f()}}(e,n),n}function Wge(e,t){var n,r=Lge(e[t].allowContentOf);try{for(r.s();!(n=r.n()).done;){var o=n.value;if(e[o])Jge(e,o).forEach((function(e){e.allowIn.push(t)}))}}catch(e){r.e(e)}finally{r.f()}delete e[t].allowContentOf}function Uge(e,t){var n,r=Lge(e[t].allowWhere);try{for(r.s();!(n=r.n()).done;){var o=e[n.value];if(o){var i,a=o.allowIn;(i=e[t].allowIn).push.apply(i,Mge(a))}}}catch(e){r.e(e)}finally{r.f()}delete e[t].allowWhere}function qge(e,t){var n,r=Lge(e[t].allowAttributesOf);try{for(r.s();!(n=r.n()).done;){var o=e[n.value];if(o){var i,a=o.allowAttributes;(i=e[t].allowAttributes).push.apply(i,Mge(a))}}}catch(e){r.e(e)}finally{r.f()}delete e[t].allowAttributesOf}function Kge(e,t){var n,r=e[t],o=Lge(r.inheritTypesFrom);try{for(o.s();!(n=o.n()).done;){var i=e[n.value];if(i){var a,u=Lge(Object.keys(i).filter((function(e){return e.startsWith("is")})));try{for(u.s();!(a=u.n()).done;){var l=a.value;l in r||(r[l]=i[l])}}catch(e){u.e(e)}finally{u.f()}}}}catch(e){o.e(e)}finally{o.f()}delete r.inheritTypesFrom}function $ge(e,t){var n=e[t],r=n.allowIn.filter((function(t){return e[t]}));n.allowIn=Array.from(new Set(r))}function Gge(e,t){var n=e[t];n.allowAttributes=Array.from(new Set(n.allowAttributes))}function Zge(e,t,n){var r,o=Lge(e);try{for(o.s();!(r=o.n()).done;){var i=r.value;if("string"==typeof i[n])t[n].push(i[n]);else if(Array.isArray(i[n])){var a;(a=t[n]).push.apply(a,Mge(i[n]))}}}catch(e){o.e(e)}finally{o.f()}}function Jge(e,t){var n,r=e[t];return(n=e,Object.keys(n).map((function(e){return n[e]}))).filter((function(e){return e.allowIn.includes(r.name)}))}function Qge(e){return"string"==typeof e?{name:e,getAttributeKeys:regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})),getAttribute:function(){}}:{name:e.is("element")?e.name:"$text",getAttributeKeys:regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.delegateYield(e.getAttributeKeys(),"t0",1);case 1:case"end":return t.stop()}}),t)})),getAttribute:function(t){return e.getAttribute(t)}}}function Xge(e,t){var n,r,o;return regeneratorRuntime.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:n=!1;case 1:if(n){i.next=17;break}if(n=!0,!e){i.next=9;break}if((r=e.next()).done){i.next=9;break}return n=!1,i.next=9,{walker:e,value:r.value};case 9:if(!t){i.next=15;break}if((o=t.next()).done){i.next=15;break}return n=!1,i.next=15,{walker:t,value:o.value};case 15:i.next=1;break;case 17:case"end":return i.stop()}}),Dge)}function ewe(e){var t,n,r;return regeneratorRuntime.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:t=Lge(e),o.prev=1,t.s();case 3:if((n=t.n()).done){o.next=8;break}return r=n.value,o.delegateYield(r.getMinimalFlatRanges(),"t0",6);case 6:o.next=3;break;case 8:o.next=13;break;case 10:o.prev=10,o.t1=o.catch(1),t.e(o.t1);case 13:return o.prev=13,t.f(),o.finish(13);case 16:case"end":return o.stop()}}),Rge,null,[[1,10,13,16]])}function twe(e,t,n){var r,o=Lge(t.getAttributeKeys());try{for(o.s();!(r=o.n()).done;){var i=r.value;e.checkAttribute(t,i)||n.removeAttribute(i,t)}}catch(e){o.e(e)}finally{o.f()}}function nwe(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return rwe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return rwe(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function rwe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:null;if(e instanceof Dbe){var n=e.nodeBefore,r=e.nodeAfter;if(!(n instanceof Obe))throw new joe.a("schema-check-merge-no-element-before",this);if(!(r instanceof Obe))throw new joe.a("schema-check-merge-no-element-after",this);return this.checkMerge(n,r)}var o,i=Uge(t.getChildren());try{for(i.s();!(o=i.n()).done;){var a=o.value;if(!this.checkChild(e,a))return!1}}catch(e){i.e(e)}finally{i.f()}return!0}},{key:"addChildCheck",value:function(e){this.on("checkChild",(function(t,n){var r=Wge(n,2),o=r[0],i=r[1];if(i){var a=e(o,i);"boolean"==typeof a&&(t.stop(),t.return=a)}}),{priority:"high"})}},{key:"addAttributeCheck",value:function(e){this.on("checkAttribute",(function(t,n){var r=Wge(n,2),o=r[0],i=r[1],a=e(o,i);"boolean"==typeof a&&(t.stop(),t.return=a)}),{priority:"high"})}},{key:"setAttributeProperties",value:function(e,t){this._attributeProperties[e]=Object.assign(this.getAttributeProperties(e),t)}},{key:"getAttributeProperties",value:function(e){return this._attributeProperties[e]||{}}},{key:"getLimitElement",value:function(e){var t;e instanceof Dbe?t=e.parent:t=(e instanceof Bbe?[e]:Array.from(e.getRanges())).reduce((function(e,t){var n=t.getCommonAncestor();return e?e.getCommonAncestor(n,{includeSelf:!0}):n}),null);for(;!this.isLimit(t)&&t.parent;)t=t.parent;return t}},{key:"checkAttributeInSelection",value:function(e,t){if(e.isCollapsed){var n=e.getFirstPosition(),r=[].concat(Vge(n.getAncestors()),[new obe("",e.getAttributes())]);return this.checkAttribute(r,t)}var o,i=Uge(e.getRanges());try{for(i.s();!(o=i.n()).done;){var a,u=Uge(o.value);try{for(u.s();!(a=u.n()).done;){var l=a.value;if(this.checkAttribute(l.item,t))return!0}}catch(e){u.e(e)}finally{u.f()}}}catch(e){i.e(e)}finally{i.f()}return!1}},{key:"getValidRanges",value:regeneratorRuntime.mark((function e(t,n){var r,o,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=cwe(t),r=Uge(t),e.prev=2,r.s();case 4:if((o=r.n()).done){e.next=9;break}return i=o.value,e.delegateYield(this._getValidRangesForRange(i,n),"t0",7);case 7:e.next=4;break;case 9:e.next=14;break;case 11:e.prev=11,e.t1=e.catch(2),r.e(e.t1);case 14:return e.prev=14,r.f(),e.finish(14);case 17:case"end":return e.stop()}}),e,this,[[2,11,14,17]])}))},{key:"getNearestSelectionRange",value:function(e){var t,n,r=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"both";if(this.checkChild(e,"$text"))return new Bbe(e);var i=e.getAncestors().reverse().find((function(e){return r.isLimit(e)}))||e.root;"both"!=o&&"backward"!=o||(t=new Pbe({boundaries:Bbe._createIn(i),startPosition:e,direction:"backward"})),"both"!=o&&"forward"!=o||(n=new Pbe({boundaries:Bbe._createIn(i),startPosition:e}));var a,u=Uge(swe(t,n));try{for(u.s();!(a=u.n()).done;){var l=a.value,s=l.walker==t?"elementEnd":"elementStart",c=l.value;if(c.type==s&&this.isObject(c.item))return Bbe._createOn(c.item);if(this.checkChild(c.nextPosition,"$text"))return new Bbe(c.nextPosition)}}catch(e){u.e(e)}finally{u.f()}return null}},{key:"findAllowedParent",value:function(e,t){for(var n=e.parent;n;){if(this.checkChild(n,t))return n;if(this.isLimit(n))return null;n=n.parent}return null}},{key:"removeDisallowedAttributes",value:function(e,t){var n,r=Uge(e);try{for(r.s();!(n=r.n()).done;){var o=n.value;if(o.is("$text"))fwe(this,o,t);else{var i,a=Uge(Bbe._createIn(o).getPositions());try{for(a.s();!(i=a.n()).done;){var u=i.value;fwe(this,u.nodeBefore||u.parent,t)}}catch(e){a.e(e)}finally{a.f()}}}}catch(e){r.e(e)}finally{r.f()}}},{key:"createContext",value:function(e){return new Qge(e)}},{key:"_clearCache",value:function(){this._compiledDefinitions=null}},{key:"_compile",value:function(){for(var e={},t=this._sourceDefinitions,n=Object.keys(t),r=0,o=n;r2&&void 0!==arguments[2]?arguments[2]:t.length-1,r=t.getItem(n);if(e.allowIn.includes(r.name)){if(0==n)return!0;var o=this.getDefinition(r);return this._checkContextMatch(o,t,n-1)}return!1}},{key:"_getValidRangesForRange",value:regeneratorRuntime.mark((function e(t,n){var r,o,i,a,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=t.start,o=t.start,i=Uge(t.getItems({shallow:!0})),e.prev=3,i.s();case 5:if((a=i.n()).done){e.next=17;break}if(!(u=a.value).is("element")){e.next=9;break}return e.delegateYield(this._getValidRangesForRange(Bbe._createIn(u),n),"t0",9);case 9:if(this.checkAttribute(u,n)){e.next=14;break}if(r.isEqual(o)){e.next=13;break}return e.next=13,new Bbe(r,o);case 13:r=Dbe._createAfter(u);case 14:o=Dbe._createAfter(u);case 15:e.next=5;break;case 17:e.next=22;break;case 19:e.prev=19,e.t1=e.catch(3),i.e(e.t1);case 22:return e.prev=22,i.f(),e.finish(22);case 25:if(r.isEqual(o)){e.next=28;break}return e.next=28,new Bbe(r,o);case 28:case"end":return e.stop()}}),e,this,[[3,19,22,25]])}))}]),e}();aie(Jge,Joe);var Qge=function(){function e(t){if($ge(this,e),t instanceof e)return t;"string"==typeof t?t=[t]:Array.isArray(t)||(t=t.getAncestors({includeSelf:!0})),t[0]&&"string"!=typeof t[0]&&t[0].is("documentFragment")&&t.shift(),this._items=t.map(lwe)}return Zge(e,[{key:Symbol.iterator,value:function(){return this._items[Symbol.iterator]()}},{key:"push",value:function(t){var n=new e([t]);return n._items=[].concat(Vge(this._items),Vge(n._items)),n}},{key:"getItem",value:function(e){return this._items[e]}},{key:"getNames",value:regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.delegateYield(this._items.map((function(e){return e.name})),"t0",1);case 1:case"end":return e.stop()}}),e,this)}))},{key:"endsWith",value:function(e){return Array.from(this.getNames()).join(" ").endsWith(e)}},{key:"startsWith",value:function(e){return Array.from(this.getNames()).join(" ").startsWith(e)}},{key:"length",get:function(){return this._items.length}},{key:"last",get:function(){return this._items[this._items.length-1]}}]),e}();function Xge(e,t){var n={name:t,allowIn:[],allowContentOf:[],allowWhere:[],allowAttributes:[],allowAttributesOf:[],inheritTypesFrom:[]};return function(e,t){var n,r=Uge(e);try{for(r.s();!(n=r.n()).done;){var o,i=n.value,a=Uge(Object.keys(i).filter((function(e){return e.startsWith("is")})));try{for(a.s();!(o=a.n()).done;){var u=o.value;t[u]=i[u]}}catch(e){a.e(e)}finally{a.f()}}}catch(e){r.e(e)}finally{r.f()}}(e,n),awe(e,n,"allowIn"),awe(e,n,"allowContentOf"),awe(e,n,"allowWhere"),awe(e,n,"allowAttributes"),awe(e,n,"allowAttributesOf"),awe(e,n,"inheritTypesFrom"),function(e,t){var n,r=Uge(e);try{for(r.s();!(n=r.n()).done;){var o=n.value.inheritAllFrom;o&&(t.allowContentOf.push(o),t.allowWhere.push(o),t.allowAttributesOf.push(o),t.inheritTypesFrom.push(o))}}catch(e){r.e(e)}finally{r.f()}}(e,n),n}function ewe(e,t){var n,r=Uge(e[t].allowContentOf);try{for(r.s();!(n=r.n()).done;){var o=n.value;if(e[o])uwe(e,o).forEach((function(e){e.allowIn.push(t)}))}}catch(e){r.e(e)}finally{r.f()}delete e[t].allowContentOf}function twe(e,t){var n,r=Uge(e[t].allowWhere);try{for(r.s();!(n=r.n()).done;){var o=e[n.value];if(o){var i,a=o.allowIn;(i=e[t].allowIn).push.apply(i,Vge(a))}}}catch(e){r.e(e)}finally{r.f()}delete e[t].allowWhere}function nwe(e,t){var n,r=Uge(e[t].allowAttributesOf);try{for(r.s();!(n=r.n()).done;){var o=e[n.value];if(o){var i,a=o.allowAttributes;(i=e[t].allowAttributes).push.apply(i,Vge(a))}}}catch(e){r.e(e)}finally{r.f()}delete e[t].allowAttributesOf}function rwe(e,t){var n,r=e[t],o=Uge(r.inheritTypesFrom);try{for(o.s();!(n=o.n()).done;){var i=e[n.value];if(i){var a,u=Uge(Object.keys(i).filter((function(e){return e.startsWith("is")})));try{for(u.s();!(a=u.n()).done;){var l=a.value;l in r||(r[l]=i[l])}}catch(e){u.e(e)}finally{u.f()}}}}catch(e){o.e(e)}finally{o.f()}delete r.inheritTypesFrom}function owe(e,t){var n=e[t],r=n.allowIn.filter((function(t){return e[t]}));n.allowIn=Array.from(new Set(r))}function iwe(e,t){var n=e[t];n.allowAttributes=Array.from(new Set(n.allowAttributes))}function awe(e,t,n){var r,o=Uge(e);try{for(o.s();!(r=o.n()).done;){var i=r.value;if("string"==typeof i[n])t[n].push(i[n]);else if(Array.isArray(i[n])){var a;(a=t[n]).push.apply(a,Vge(i[n]))}}}catch(e){o.e(e)}finally{o.f()}}function uwe(e,t){var n,r=e[t];return(n=e,Object.keys(n).map((function(e){return n[e]}))).filter((function(e){return e.allowIn.includes(r.name)}))}function lwe(e){return"string"==typeof e?{name:e,getAttributeKeys:regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})),getAttribute:function(){}}:{name:e.is("element")?e.name:"$text",getAttributeKeys:regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.delegateYield(e.getAttributeKeys(),"t0",1);case 1:case"end":return t.stop()}}),t)})),getAttribute:function(t){return e.getAttribute(t)}}}function swe(e,t){var n,r,o;return regeneratorRuntime.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:n=!1;case 1:if(n){i.next=17;break}if(n=!0,!e){i.next=9;break}if((r=e.next()).done){i.next=9;break}return n=!1,i.next=9,{walker:e,value:r.value};case 9:if(!t){i.next=15;break}if((o=t.next()).done){i.next=15;break}return n=!1,i.next=15,{walker:t,value:o.value};case 15:i.next=1;break;case 17:case"end":return i.stop()}}),Bge)}function cwe(e){var t,n,r;return regeneratorRuntime.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:t=Uge(e),o.prev=1,t.s();case 3:if((n=t.n()).done){o.next=8;break}return r=n.value,o.delegateYield(r.getMinimalFlatRanges(),"t0",6);case 6:o.next=3;break;case 8:o.next=13;break;case 10:o.prev=10,o.t1=o.catch(1),t.e(o.t1);case 13:return o.prev=13,t.f(),o.finish(13);case 16:case"end":return o.stop()}}),Hge,null,[[1,10,13,16]])}function fwe(e,t,n){var r,o=Uge(t.getAttributeKeys());try{for(o.s();!(r=o.n()).done;){var i=r.value;e.checkAttribute(t,i)||n.removeAttribute(i,t)}}catch(e){o.e(e)}finally{o.f()}}function pwe(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return dwe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return dwe(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function dwe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:{};owe(this,e),this._splitParts=new Map,this._cursorParents=new Map,this._modelCursor=null,this.conversionApi=Object.assign({},t),this.conversionApi.convertItem=this._convertItem.bind(this),this.conversionApi.convertChildren=this._convertChildren.bind(this),this.conversionApi.safeInsert=this._safeInsert.bind(this),this.conversionApi.updateConversionResult=this._updateConversionResult.bind(this),this.conversionApi.splitToAllowedParent=this._splitToAllowedParent.bind(this),this.conversionApi.getSplitParts=this._getSplitParts.bind(this)}var t,n,r;return t=e,(n=[{key:"convert",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:["$root"];this.fire("viewCleanup",e),this._modelCursor=lwe(n,t),this.conversionApi.writer=t,this.conversionApi.consumable=xge.createFrom(e),this.conversionApi.store={};var r=this._convertItem(e,this._modelCursor),o=r.modelRange,i=t.createDocumentFragment();if(o){this._removeEmptyElements();for(var a=0,u=Array.from(this._modelCursor.parent.getChildren());a=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function fwe(e,t){if(e){if("string"==typeof e)return pwe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?pwe(e,t):void 0}}function pwe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:{};hwe(this,e),this._splitParts=new Map,this._cursorParents=new Map,this._modelCursor=null,this.conversionApi=Object.assign({},t),this.conversionApi.convertItem=this._convertItem.bind(this),this.conversionApi.convertChildren=this._convertChildren.bind(this),this.conversionApi.safeInsert=this._safeInsert.bind(this),this.conversionApi.updateConversionResult=this._updateConversionResult.bind(this),this.conversionApi.splitToAllowedParent=this._splitToAllowedParent.bind(this),this.conversionApi.getSplitParts=this._getSplitParts.bind(this)}var t,n,r;return t=e,(n=[{key:"convert",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:["$root"];this.fire("viewCleanup",e),this._modelCursor=vwe(n,t),this.conversionApi.writer=t,this.conversionApi.consumable=Yge.createFrom(e),this.conversionApi.store={};var r=this._convertItem(e,this._modelCursor),o=r.modelRange,i=t.createDocumentFragment();if(o){this._removeEmptyElements();for(var a=0,u=Array.from(this._modelCursor.parent.getChildren());a=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function _we(e,t){if(e){if("string"==typeof e)return Owe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Owe(e,t):void 0}}function Owe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:{},t=e.rootName,n=void 0===t?"main":t,r=e.trim,o=void 0===r?"empty":r;if(!this._checkIfRootsExists([n]))throw new moe.a("datacontroller-get-non-existent-root",this);var i=this.model.document.getRoot(n);return"empty"!==o||this.model.hasContent(i,{ignoreWhitespaces:!0})?this.stringify(i,e):""}},{key:"stringify",value:function(e,t){var n=this.toView(e,t);return this.processor.toData(n)}},{key:"toView",value:function(e,t){var n=this.viewDocument,r=this._viewWriter;this.mapper.clearBindings();var o=Dbe._createIn(e),i=new fhe(n);if(this.mapper.bindElements(e,i),this.downcastDispatcher.conversionApi.options=t,this.downcastDispatcher.convertInsert(o,r),!e.is("documentFragment")){var a,u=function(e){var t=[],n=e.root.document;if(!n)return[];var r,o=Dbe._createIn(e),i=cwe(n.model.markers);try{for(i.s();!(r=i.n()).done;){var a=r.value,u=o.getIntersection(a.getRange());u&&t.push([a.name,u])}}catch(e){i.e(e)}finally{i.f()}return t}(e),l=cwe(u);try{for(l.s();!(a=l.n()).done;){var s=swe(a.value,2),c=s[0],f=s[1];this.downcastDispatcher.convertMarkerAdd(c,f,r)}}catch(e){l.e(e)}finally{l.f()}}return delete this.downcastDispatcher.conversionApi.options,i}},{key:"init",value:function(e){var t=this;if(this.model.document.version)throw new moe.a("datacontroller-init-document-not-empty",this);var n={};if("string"==typeof e?n.main=e:n=e,!this._checkIfRootsExists(Object.keys(n)))throw new moe.a("datacontroller-init-non-existent-root",this);return this.model.enqueueChange("transparent",(function(e){for(var r=0,o=Object.keys(n);r1&&void 0!==arguments[1]?arguments[1]:"$root",n=this.processor.toView(e);return this.toModel(n,t)}},{key:"toModel",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"$root";return this.model.change((function(r){return t.upcastDispatcher.convert(e,r,n)}))}},{key:"addStyleProcessorRules",value:function(e){e(this.stylesProcessor)}},{key:"destroy",value:function(){this.stopListening()}},{key:"_checkIfRootsExists",value:function(e){var t,n=cwe(e);try{for(n.s();!(t=n.n()).done;){var r=t.value;if(!this.model.document.getRootNames().includes(r))return!1}}catch(e){n.e(e)}finally{n.f()}return!0}}])&&dwe(t.prototype,n),r&&dwe(t,r),e}();Zoe(hwe,Boe);var ywe=regeneratorRuntime.mark(_we),mwe=regeneratorRuntime.mark(Owe);function bwe(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return vwe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return vwe(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function vwe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:{},t=e.rootName,n=void 0===t?"main":t,r=e.trim,o=void 0===r?"empty":r;if(!this._checkIfRootsExists([n]))throw new joe.a("datacontroller-get-non-existent-root",this);var i=this.model.document.getRoot(n);return"empty"!==o||this.model.hasContent(i,{ignoreWhitespaces:!0})?this.stringify(i,e):""}},{key:"stringify",value:function(e,t){var n=this.toView(e,t);return this.processor.toData(n)}},{key:"toView",value:function(e,t){var n=this.viewDocument,r=this._viewWriter;this.mapper.clearBindings();var o=Bbe._createIn(e),i=new _he(n);if(this.mapper.bindElements(e,i),this.downcastDispatcher.conversionApi.options=t,this.downcastDispatcher.convertInsert(o,r),!e.is("documentFragment")){var a,u=function(e){var t=[],n=e.root.document;if(!n)return[];var r,o=Bbe._createIn(e),i=wwe(n.model.markers);try{for(i.s();!(r=i.n()).done;){var a=r.value,u=o.getIntersection(a.getRange());u&&t.push([a.name,u])}}catch(e){i.e(e)}finally{i.f()}return t}(e),l=wwe(u);try{for(l.s();!(a=l.n()).done;){var s=gwe(a.value,2),c=s[0],f=s[1];this.downcastDispatcher.convertMarkerAdd(c,f,r)}}catch(e){l.e(e)}finally{l.f()}}return delete this.downcastDispatcher.conversionApi.options,i}},{key:"init",value:function(e){var t=this;if(this.model.document.version)throw new joe.a("datacontroller-init-document-not-empty",this);var n={};if("string"==typeof e?n.main=e:n=e,!this._checkIfRootsExists(Object.keys(n)))throw new joe.a("datacontroller-init-non-existent-root",this);return this.model.enqueueChange("transparent",(function(e){for(var r=0,o=Object.keys(n);r1&&void 0!==arguments[1]?arguments[1]:"$root",n=this.processor.toView(e);return this.toModel(n,t)}},{key:"toModel",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"$root";return this.model.change((function(r){return t.upcastDispatcher.convert(e,r,n)}))}},{key:"addStyleProcessorRules",value:function(e){e(this.stylesProcessor)}},{key:"destroy",value:function(){this.stopListening()}},{key:"_checkIfRootsExists",value:function(e){var t,n=wwe(e);try{for(n.s();!(t=n.n()).done;){var r=t.value;if(!this.model.document.getRootNames().includes(r))return!1}}catch(e){n.e(e)}finally{n.f()}return!0}}])&&Swe(t.prototype,n),r&&Swe(t,r),e}();aie(kwe,Joe);var Pwe=regeneratorRuntime.mark(Dwe),jwe=regeneratorRuntime.mark(Rwe);function Ewe(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Cwe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Cwe(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Cwe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function kwe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Awe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:"default";Pwe(this,e),this.operations=[],this.type=t}var t,n,r;return t=e,(n=[{key:"addOperation",value:function(e){return e.batch=this,this.operations.push(e),e}},{key:"baseVersion",get:function(){var e,t=Swe(this.operations);try{for(t.s();!(e=t.n()).done;){var n=e.value;if(null!==n.baseVersion)return n.baseVersion}}catch(e){t.e(e)}finally{t.f()}return null}}])&&jwe(t.prototype,n),r&&jwe(t,r),e}();function Cwe(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:"default";Lwe(this,e),this.operations=[],this.type=t}var t,n,r;return t=e,(n=[{key:"addOperation",value:function(e){return e.batch=this,this.operations.push(e),e}},{key:"baseVersion",get:function(){var e,t=Mwe(this.operations);try{for(t.s();!(e=t.n()).done;){var n=e.value;if(null!==n.baseVersion)return n.baseVersion}}catch(e){t.e(e)}finally{t.f()}return null}}])&&Iwe(t.prototype,n),r&&Iwe(t,r),e}();function Fwe(e,t){for(var n=0;n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Dwe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Bwe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:1,r=this._children._removeNodes(e,n),o=Twe(r);try{for(o.s();!(t=o.n()).done;){var i=t.value;i.parent=null}}catch(e){o.e(e)}finally{o.f()}return r}},{key:"childCount",get:function(){return this._children.length}},{key:"maxOffset",get:function(){return this._children.maxOffset}},{key:"isEmpty",get:function(){return 0===this.childCount}},{key:"root",get:function(){return this}},{key:"parent",get:function(){return null}}],r=[{key:"fromJSON",value:function(t){var n,r=[],o=Twe(t);try{for(o.s();!(n=o.n()).done;){var i=n.value;i.name?r.push(pbe.fromJSON(i)):r.push($me.fromJSON(i))}}catch(e){o.e(e)}finally{o.f()}return new e(r)}}],n&&Rwe(t.prototype,n),r&&Rwe(t,r),e}();function Awe(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Lwe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Lwe(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Lwe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:1,r=this._children._removeNodes(e,n),o=Nwe(r);try{for(o.s();!(t=o.n()).done;){var i=t.value;i.parent=null}}catch(e){o.e(e)}finally{o.f()}return r}},{key:"childCount",get:function(){return this._children.length}},{key:"maxOffset",get:function(){return this._children.maxOffset}},{key:"isEmpty",get:function(){return 0===this.childCount}},{key:"root",get:function(){return this}},{key:"parent",get:function(){return null}}],r=[{key:"fromJSON",value:function(t){var n,r=[],o=Nwe(t);try{for(o.s();!(n=o.n()).done;){var i=n.value;i.name?r.push(Obe.fromJSON(i)):r.push(obe.fromJSON(i))}}catch(e){o.e(e)}finally{o.f()}return new e(r)}}],n&&Hwe(t.prototype,n),r&&Hwe(t,r),e}();function Wwe(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Uwe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Uwe(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Uwe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function qwe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function n_e(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.maxOffset)throw new moe.a("move-operation-nodes-do-not-exist",this);if(e===t&&n=n&&this.targetPosition.path[o]e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.maxOffset)throw new joe.a("move-operation-nodes-do-not-exist",this);if(e===t&&n=n&&this.targetPosition.path[o]e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}(e.nodes);try{for(o.s();!(n=o.n()).done;){var a=n.value;a.name?r.push(pbe.fromJSON(a)):r.push($me.fromJSON(a))}}catch(e){o.e(e)}finally{o.f()}var u=new i(_be.fromJSON(e.position,t),r,e.baseVersion);return u.shouldReceiveAttributes=e.shouldReceiveAttributes,u}},{key:"className",get:function(){return"InsertOperation"}}],(n=[{key:"clone",value:function(){var e=new nbe(b_e(this.nodes).map((function(e){return e._clone(!0)}))),t=new i(this.position,e,this.baseVersion);return t.shouldReceiveAttributes=this.shouldReceiveAttributes,t}},{key:"getReversed",value:function(){var e=this.position.root.document.graveyard,t=new _be(e,[0]);return new y_e(this.position,this.nodes.maxOffset,t,this.baseVersion+1)}},{key:"_validate",value:function(){var e=this.position.parent;if(!e||e.maxOffset=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}(e.nodes);try{for(o.s();!(n=o.n()).done;){var a=n.value;a.name?r.push(Obe.fromJSON(a)):r.push(obe.fromJSON(a))}}catch(e){o.e(e)}finally{o.f()}var u=new i(Dbe.fromJSON(e.position,t),r,e.baseVersion);return u.shouldReceiveAttributes=e.shouldReceiveAttributes,u}},{key:"className",get:function(){return"InsertOperation"}}],(n=[{key:"clone",value:function(){var e=new pbe(E_e(this.nodes).map((function(e){return e._clone(!0)}))),t=new i(this.position,e,this.baseVersion);return t.shouldReceiveAttributes=this.shouldReceiveAttributes,t}},{key:"getReversed",value:function(){var e=this.position.root.document.graveyard,t=new Dbe(e,[0]);return new P_e(this.position,this.nodes.maxOffset,t,this.baseVersion+1)}},{key:"_validate",value:function(){var e=this.position.parent;if(!e||e.maxOffset2&&void 0!==arguments[2]?arguments[2]:"main";return hOe(this,i),(n=o.call(this,t))._document=e,n.rootName=r,n}return t=i,(n=[{key:"is",value:function(e,t){return t?t===this.name&&("rootElement"===e||"model:rootElement"===e||"element"===e||"model:element"===e):"rootElement"===e||"model:rootElement"===e||"element"===e||"model:element"===e||"node"===e||"model:node"===e}},{key:"toJSON",value:function(){return this.rootName}},{key:"document",get:function(){return this._document}}])&&yOe(t.prototype,n),r&&yOe(t,r),i}(pbe);function _Oe(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n}(e,t)||SOe(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function OOe(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=SOe(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function SOe(e,t){if(e){if("string"==typeof e)return kOe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?kOe(e,t):void 0}}function kOe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:"main";return kOe(this,i),(n=o.call(this,t))._document=e,n.rootName=r,n}return t=i,(n=[{key:"is",value:function(e,t){return t?t===this.name&&("rootElement"===e||"model:rootElement"===e||"element"===e||"model:element"===e):"rootElement"===e||"model:rootElement"===e||"element"===e||"model:element"===e||"node"===e||"model:node"===e}},{key:"toJSON",value:function(){return this.rootName}},{key:"document",get:function(){return this._document}}])&&POe(t.prototype,n),r&&POe(t,r),i}(Obe);function DOe(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n}(e,t)||MOe(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ROe(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=MOe(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function MOe(e,t){if(e){if("string"==typeof e)return AOe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?AOe(e,t):void 0}}function AOe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1])||arguments[1];return e._clone(t)}},{key:"insert",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(this._assertWriterUsedCorrectly(),!(e instanceof $me&&""==e.data)){var r=_be._createAt(t,n);if(e.parent){if(DOe(e.root,r.root))return void this.move(Dbe._createOn(e),r);if(e.root.document)throw new moe.a("model-writer-insert-forbidden-move",this);this.remove(e)}var o=r.root.document?r.root.document.version:null,i=new j_e(r,e,o);if(e instanceof $me&&(i.shouldReceiveAttributes=!0),this.batch.addOperation(i),this.model.applyOperation(i),e instanceof Mwe){var a,u=OOe(e.markers);try{for(u.s();!(a=u.n()).done;){var l=_Oe(a.value,2),s=l[0],c=l[1],f=_be._createAt(c.root,0),p=new Dbe(c.start._getCombined(f,r),c.end._getCombined(f,r)),d={range:p,usingOperation:!0,affectsData:!0};this.model.markers.has(s)?this.updateMarker(s,d):this.addMarker(s,d)}}catch(e){u.e(e)}finally{u.f()}}}}},{key:"insertText",value:function(e,t,n,r){t instanceof Mwe||t instanceof pbe||t instanceof _be?this.insert(this.createText(e),t,n):this.insert(this.createText(e,t),n,r)}},{key:"insertElement",value:function(e,t,n,r){t instanceof Mwe||t instanceof pbe||t instanceof _be?this.insert(this.createElement(e),t,n):this.insert(this.createElement(e,t),n,r)}},{key:"append",value:function(e,t){this.insert(e,t,"end")}},{key:"appendText",value:function(e,t,n){t instanceof Mwe||t instanceof pbe?this.insert(this.createText(e),t,"end"):this.insert(this.createText(e,t),n,"end")}},{key:"appendElement",value:function(e,t,n){t instanceof Mwe||t instanceof pbe?this.insert(this.createElement(e),t,"end"):this.insert(this.createElement(e,t),n,"end")}},{key:"setAttribute",value:function(e,t,n){if(this._assertWriterUsedCorrectly(),n instanceof Dbe){var r,o=OOe(n.getMinimalFlatRanges());try{for(o.s();!(r=o.n()).done;)EOe(this,e,t,r.value)}catch(e){o.e(e)}finally{o.f()}}else COe(this,e,t,n)}},{key:"setAttributes",value:function(e,t){var n,r=OOe(Bfe(e));try{for(r.s();!(n=r.n()).done;){var o=_Oe(n.value,2),i=o[0],a=o[1];this.setAttribute(i,a,t)}}catch(e){r.e(e)}finally{r.f()}}},{key:"removeAttribute",value:function(e,t){if(this._assertWriterUsedCorrectly(),t instanceof Dbe){var n,r=OOe(t.getMinimalFlatRanges());try{for(r.s();!(n=r.n()).done;)EOe(this,e,null,n.value)}catch(e){r.e(e)}finally{r.f()}}else COe(this,e,null,t)}},{key:"clearAttributes",value:function(e){var t=this;this._assertWriterUsedCorrectly();var n=function(e){var n,r=OOe(e.getAttributeKeys());try{for(r.s();!(n=r.n()).done;){var o=n.value;t.removeAttribute(o,e)}}catch(e){r.e(e)}finally{r.f()}};if(e instanceof Dbe){var r,o=OOe(e.getItems());try{for(o.s();!(r=o.n()).done;)n(r.value)}catch(e){o.e(e)}finally{o.f()}}else n(e)}},{key:"move",value:function(e,t,n){if(this._assertWriterUsedCorrectly(),!(e instanceof Dbe))throw new moe.a("writer-move-invalid-range",this);if(!e.isFlat)throw new moe.a("writer-move-range-not-flat",this);var r=_be._createAt(t,n);if(!r.isEqual(e.start)){if(this._addOperationForAffectedMarkers("move",e),!DOe(e.root,r.root))throw new moe.a("writer-move-different-document",this);var o=e.root.document?e.root.document.version:null,i=new y_e(e.start,e.end.offset-e.start.offset,r,o);this.batch.addOperation(i),this.model.applyOperation(i)}}},{key:"remove",value:function(e){this._assertWriterUsedCorrectly();var t,n=OOe((e instanceof Dbe?e:Dbe._createOn(e)).getMinimalFlatRanges().reverse());try{for(n.s();!(t=n.n()).done;){var r=t.value;this._addOperationForAffectedMarkers("move",r),TOe(r.start,r.end.offset-r.start.offset,this.batch,this.model)}}catch(e){n.e(e)}finally{n.f()}}},{key:"merge",value:function(e){this._assertWriterUsedCorrectly();var t=e.nodeBefore,n=e.nodeAfter;if(this._addOperationForAffectedMarkers("merge",e),!(t instanceof pbe))throw new moe.a("writer-merge-no-element-before",this);if(!(n instanceof pbe))throw new moe.a("writer-merge-no-element-after",this);e.root.document?this._merge(e):this._mergeDetached(e)}},{key:"createPositionFromPath",value:function(e,t,n){return this.model.createPositionFromPath(e,t,n)}},{key:"createPositionAt",value:function(e,t){return this.model.createPositionAt(e,t)}},{key:"createPositionAfter",value:function(e){return this.model.createPositionAfter(e)}},{key:"createPositionBefore",value:function(e){return this.model.createPositionBefore(e)}},{key:"createRange",value:function(e,t){return this.model.createRange(e,t)}},{key:"createRangeIn",value:function(e){return this.model.createRangeIn(e)}},{key:"createRangeOn",value:function(e){return this.model.createRangeOn(e)}},{key:"createSelection",value:function(e,t,n){return this.model.createSelection(e,t,n)}},{key:"_mergeDetached",value:function(e){var t=e.nodeBefore,n=e.nodeAfter;this.move(Dbe._createIn(n),_be._createAt(t,"end")),this.remove(n)}},{key:"_merge",value:function(e){var t=_be._createAt(e.nodeBefore,"end"),n=_be._createAt(e.nodeAfter,0),r=e.root.document.graveyard,o=new _be(r,[0]),i=e.root.document.version,a=new oOe(n,e.nodeAfter.maxOffset,t,o,i);this.batch.addOperation(a),this.model.applyOperation(a)}},{key:"rename",value:function(e,t){if(this._assertWriterUsedCorrectly(),!(e instanceof pbe))throw new moe.a("writer-rename-not-element-instance",this);var n=e.root.document?e.root.document.version:null,r=new H_e(_be._createBefore(e),e.name,t,n);this.batch.addOperation(r),this.model.applyOperation(r)}},{key:"split",value:function(e,t){this._assertWriterUsedCorrectly();var n,r,o=e.parent;if(!o.parent)throw new moe.a("writer-split-element-no-parent",this);if(t||(t=o.parent),!e.parent.getAncestors({includeSelf:!0}).includes(t))throw new moe.a("writer-split-invalid-limit-element",this);do{var i=o.root.document?o.root.document.version:null,a=o.maxOffset-e.offset,u=new pOe(e,a,null,i);this.batch.addOperation(u),this.model.applyOperation(u),n||r||(n=o,r=e.parent.nextSibling),o=(e=this.createPositionAfter(e.parent)).parent}while(o!==t);return{position:e,range:new Dbe(_be._createAt(n,"end"),_be._createAt(r,0))}}},{key:"wrap",value:function(e,t){if(this._assertWriterUsedCorrectly(),!e.isFlat)throw new moe.a("writer-wrap-range-not-flat",this);var n=t instanceof pbe?t:new pbe(t);if(n.childCount>0)throw new moe.a("writer-wrap-element-not-empty",this);if(null!==n.parent)throw new moe.a("writer-wrap-element-attached",this);this.insert(n,e.start);var r=new Dbe(e.start.getShiftedBy(1),e.end.getShiftedBy(1));this.move(r,_be._createAt(n,0))}},{key:"unwrap",value:function(e){if(this._assertWriterUsedCorrectly(),null===e.parent)throw new moe.a("writer-unwrap-element-no-parent",this);this.move(Dbe._createIn(e),this.createPositionAfter(e)),this.remove(e)}},{key:"addMarker",value:function(e,t){if(this._assertWriterUsedCorrectly(),!t||"boolean"!=typeof t.usingOperation)throw new moe.a("writer-addmarker-no-usingoperation",this);var n=t.usingOperation,r=t.range,o=void 0!==t.affectsData&&t.affectsData;if(this.model.markers.has(e))throw new moe.a("writer-addmarker-marker-exists",this);if(!r)throw new moe.a("writer-addmarker-no-range",this);return n?(xOe(this,e,null,r,o),this.model.markers.get(e)):this.model.markers._set(e,r,n,o)}},{key:"updateMarker",value:function(e,t){this._assertWriterUsedCorrectly();var n="string"==typeof e?e:e.name,r=this.model.markers.get(n);if(!r)throw new moe.a("writer-updatemarker-marker-not-exists",this);if(t){var o="boolean"==typeof t.usingOperation,i="boolean"==typeof t.affectsData,a=i?t.affectsData:r.affectsData;if(!o&&!t.range&&!i)throw new moe.a("writer-updatemarker-wrong-options",this);var u=r.getRange(),l=t.range?t.range:u;o&&t.usingOperation!==r.managedUsingOperations?t.usingOperation?xOe(this,n,null,l,a):(xOe(this,n,u,null,a),this.model.markers._set(n,l,void 0,a)):r.managedUsingOperations?xOe(this,n,u,l,a):this.model.markers._set(n,l,void 0,a)}else this.model.markers._refresh(r)}},{key:"removeMarker",value:function(e){this._assertWriterUsedCorrectly();var t="string"==typeof e?e:e.name;if(!this.model.markers.has(t))throw new moe.a("writer-removemarker-no-marker",this);var n=this.model.markers.get(t);n.managedUsingOperations?xOe(this,t,n.getRange(),null,n.affectsData):this.model.markers._remove(t)}},{key:"setSelection",value:function(e,t,n){this._assertWriterUsedCorrectly(),this.model.document.selection._setTo(e,t,n)}},{key:"setSelectionFocus",value:function(e,t){this._assertWriterUsedCorrectly(),this.model.document.selection._setFocus(e,t)}},{key:"setSelectionAttribute",value:function(e,t){if(this._assertWriterUsedCorrectly(),"string"==typeof e)this._setSelectionAttribute(e,t);else{var n,r=OOe(Bfe(e));try{for(r.s();!(n=r.n()).done;){var o=_Oe(n.value,2),i=o[0],a=o[1];this._setSelectionAttribute(i,a)}}catch(e){r.e(e)}finally{r.f()}}}},{key:"removeSelectionAttribute",value:function(e){if(this._assertWriterUsedCorrectly(),"string"==typeof e)this._removeSelectionAttribute(e);else{var t,n=OOe(e);try{for(n.s();!(t=n.n()).done;){var r=t.value;this._removeSelectionAttribute(r)}}catch(e){n.e(e)}finally{n.f()}}}},{key:"overrideSelectionGravity",value:function(){return this.model.document.selection._overrideGravity()}},{key:"restoreSelectionGravity",value:function(e){this.model.document.selection._restoreGravity(e)}},{key:"_setSelectionAttribute",value:function(e,t){var n=this.model.document.selection;if(n.isCollapsed&&n.anchor.parent.isEmpty){var r=kve._getStoreAttributeKey(e);this.setAttribute(r,t,n.anchor.parent)}n._setAttribute(e,t)}},{key:"_removeSelectionAttribute",value:function(e){var t=this.model.document.selection;if(t.isCollapsed&&t.anchor.parent.isEmpty){var n=kve._getStoreAttributeKey(e);this.removeAttribute(n,t.anchor.parent)}t._removeAttribute(e)}},{key:"_assertWriterUsedCorrectly",value:function(){if(this.model._currentWriter!==this)throw new moe.a("writer-incorrect-use",this)}},{key:"_addOperationForAffectedMarkers",value:function(e,t){var n,r=OOe(this.model.markers);try{for(r.s();!(n=r.n()).done;){var o=n.value;if(o.managedUsingOperations){var i=o.getRange(),a=!1;if("move"===e)a=t.containsPosition(i.start)||t.start.isEqual(i.start)||t.containsPosition(i.end)||t.end.isEqual(i.end);else{var u=t.nodeBefore,l=t.nodeAfter,s=i.start.parent==u&&i.start.isAtEnd,c=i.end.parent==l&&0==i.end.offset,f=i.end.nodeAfter==l,p=i.start.nodeAfter==l;a=s||c||f||p}a&&this.updateMarker(o.name,{range:i})}}}catch(e){r.e(e)}finally{r.f()}}}])&&POe(t.prototype,n),r&&POe(t,r),e}();function EOe(e,t,n,r){var o,i,a,u,l=e.model,s=l.document,c=r.start,f=OOe(r.getWalker({shallow:!0}));try{for(f.s();!(u=f.n()).done;){var p=u.value;a=p.item.getAttribute(t),o&&i!=a&&(i!=n&&d(),c=o),o=p.nextPosition,i=a}}catch(e){f.e(e)}finally{f.f()}function d(){var r=new Dbe(c,o),a=r.root.document?s.version:null,u=new Xwe(r,t,i,n,a);e.batch.addOperation(u),l.applyOperation(u)}o instanceof _be&&o!=c&&i!=n&&d()}function COe(e,t,n,r){var o,i,a=e.model,u=a.document,l=r.getAttribute(t);if(l!=n){if(r.root===r){var s=r.document?u.version:null;i=new Z_e(r,t,l,n,s)}else{var c=(o=new Dbe(_be._createBefore(r),e.createPositionAfter(r))).root.document?u.version:null;i=new Xwe(o,t,l,n,c)}e.batch.addOperation(i),a.applyOperation(i)}}function xOe(e,t,n,r,o){var i=e.model,a=i.document,u=new A_e(t,n,r,i.markers,o,a.version);e.batch.addOperation(u),i.applyOperation(u)}function TOe(e,t,n,r){var o;if(e.root.document){var i=r.document,a=new _be(i.graveyard,[0]);o=new y_e(e,t,a,i.version)}else o=new u_e(e,t);n.addOperation(o),r.applyOperation(o)}function DOe(e,t){return e===t||e instanceof wOe&&t instanceof wOe}function ROe(e){return function(e){if(Array.isArray(e))return IOe(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||LOe(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function MOe(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n}(e,t)||LOe(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function AOe(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=LOe(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function LOe(e,t){if(e){if("string"==typeof e)return IOe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?IOe(e,t):void 0}}function IOe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1])||arguments[1];return e._clone(t)}},{key:"insert",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(this._assertWriterUsedCorrectly(),!(e instanceof obe&&""==e.data)){var r=Dbe._createAt(t,n);if(e.parent){if(BOe(e.root,r.root))return void this.move(Bbe._createOn(e),r);if(e.root.document)throw new joe.a("model-writer-insert-forbidden-move",this);this.remove(e)}var o=r.root.document?r.root.document.version:null,i=new I_e(r,e,o);if(e instanceof obe&&(i.shouldReceiveAttributes=!0),this.batch.addOperation(i),this.model.applyOperation(i),e instanceof Vwe){var a,u=ROe(e.markers);try{for(u.s();!(a=u.n()).done;){var l=DOe(a.value,2),s=l[0],c=l[1],f=Dbe._createAt(c.root,0),p=new Bbe(c.start._getCombined(f,r),c.end._getCombined(f,r)),d={range:p,usingOperation:!0,affectsData:!0};this.model.markers.has(s)?this.updateMarker(s,d):this.addMarker(s,d)}}catch(e){u.e(e)}finally{u.f()}}}}},{key:"insertText",value:function(e,t,n,r){t instanceof Vwe||t instanceof Obe||t instanceof Dbe?this.insert(this.createText(e),t,n):this.insert(this.createText(e,t),n,r)}},{key:"insertElement",value:function(e,t,n,r){t instanceof Vwe||t instanceof Obe||t instanceof Dbe?this.insert(this.createElement(e),t,n):this.insert(this.createElement(e,t),n,r)}},{key:"append",value:function(e,t){this.insert(e,t,"end")}},{key:"appendText",value:function(e,t,n){t instanceof Vwe||t instanceof Obe?this.insert(this.createText(e),t,"end"):this.insert(this.createText(e,t),n,"end")}},{key:"appendElement",value:function(e,t,n){t instanceof Vwe||t instanceof Obe?this.insert(this.createElement(e),t,"end"):this.insert(this.createElement(e,t),n,"end")}},{key:"setAttribute",value:function(e,t,n){if(this._assertWriterUsedCorrectly(),n instanceof Bbe){var r,o=ROe(n.getMinimalFlatRanges());try{for(o.s();!(r=o.n()).done;)zOe(this,e,t,r.value)}catch(e){o.e(e)}finally{o.f()}}else FOe(this,e,t,n)}},{key:"setAttributes",value:function(e,t){var n,r=ROe(Jfe(e));try{for(r.s();!(n=r.n()).done;){var o=DOe(n.value,2),i=o[0],a=o[1];this.setAttribute(i,a,t)}}catch(e){r.e(e)}finally{r.f()}}},{key:"removeAttribute",value:function(e,t){if(this._assertWriterUsedCorrectly(),t instanceof Bbe){var n,r=ROe(t.getMinimalFlatRanges());try{for(r.s();!(n=r.n()).done;)zOe(this,e,null,n.value)}catch(e){r.e(e)}finally{r.f()}}else FOe(this,e,null,t)}},{key:"clearAttributes",value:function(e){var t=this;this._assertWriterUsedCorrectly();var n=function(e){var n,r=ROe(e.getAttributeKeys());try{for(r.s();!(n=r.n()).done;){var o=n.value;t.removeAttribute(o,e)}}catch(e){r.e(e)}finally{r.f()}};if(e instanceof Bbe){var r,o=ROe(e.getItems());try{for(o.s();!(r=o.n()).done;)n(r.value)}catch(e){o.e(e)}finally{o.f()}}else n(e)}},{key:"move",value:function(e,t,n){if(this._assertWriterUsedCorrectly(),!(e instanceof Bbe))throw new joe.a("writer-move-invalid-range",this);if(!e.isFlat)throw new joe.a("writer-move-range-not-flat",this);var r=Dbe._createAt(t,n);if(!r.isEqual(e.start)){if(this._addOperationForAffectedMarkers("move",e),!BOe(e.root,r.root))throw new joe.a("writer-move-different-document",this);var o=e.root.document?e.root.document.version:null,i=new P_e(e.start,e.end.offset-e.start.offset,r,o);this.batch.addOperation(i),this.model.applyOperation(i)}}},{key:"remove",value:function(e){this._assertWriterUsedCorrectly();var t,n=ROe((e instanceof Bbe?e:Bbe._createOn(e)).getMinimalFlatRanges().reverse());try{for(n.s();!(t=n.n()).done;){var r=t.value;this._addOperationForAffectedMarkers("move",r),NOe(r.start,r.end.offset-r.start.offset,this.batch,this.model)}}catch(e){n.e(e)}finally{n.f()}}},{key:"merge",value:function(e){this._assertWriterUsedCorrectly();var t=e.nodeBefore,n=e.nodeAfter;if(this._addOperationForAffectedMarkers("merge",e),!(t instanceof Obe))throw new joe.a("writer-merge-no-element-before",this);if(!(n instanceof Obe))throw new joe.a("writer-merge-no-element-after",this);e.root.document?this._merge(e):this._mergeDetached(e)}},{key:"createPositionFromPath",value:function(e,t,n){return this.model.createPositionFromPath(e,t,n)}},{key:"createPositionAt",value:function(e,t){return this.model.createPositionAt(e,t)}},{key:"createPositionAfter",value:function(e){return this.model.createPositionAfter(e)}},{key:"createPositionBefore",value:function(e){return this.model.createPositionBefore(e)}},{key:"createRange",value:function(e,t){return this.model.createRange(e,t)}},{key:"createRangeIn",value:function(e){return this.model.createRangeIn(e)}},{key:"createRangeOn",value:function(e){return this.model.createRangeOn(e)}},{key:"createSelection",value:function(e,t,n){return this.model.createSelection(e,t,n)}},{key:"_mergeDetached",value:function(e){var t=e.nodeBefore,n=e.nodeAfter;this.move(Bbe._createIn(n),Dbe._createAt(t,"end")),this.remove(n)}},{key:"_merge",value:function(e){var t=Dbe._createAt(e.nodeBefore,"end"),n=Dbe._createAt(e.nodeAfter,0),r=e.root.document.graveyard,o=new Dbe(r,[0]),i=e.root.document.version,a=new hOe(n,e.nodeAfter.maxOffset,t,o,i);this.batch.addOperation(a),this.model.applyOperation(a)}},{key:"rename",value:function(e,t){if(this._assertWriterUsedCorrectly(),!(e instanceof Obe))throw new joe.a("writer-rename-not-element-instance",this);var n=e.root.document?e.root.document.version:null,r=new Q_e(Dbe._createBefore(e),e.name,t,n);this.batch.addOperation(r),this.model.applyOperation(r)}},{key:"split",value:function(e,t){this._assertWriterUsedCorrectly();var n,r,o=e.parent;if(!o.parent)throw new joe.a("writer-split-element-no-parent",this);if(t||(t=o.parent),!e.parent.getAncestors({includeSelf:!0}).includes(t))throw new joe.a("writer-split-invalid-limit-element",this);do{var i=o.root.document?o.root.document.version:null,a=o.maxOffset-e.offset,u=new OOe(e,a,null,i);this.batch.addOperation(u),this.model.applyOperation(u),n||r||(n=o,r=e.parent.nextSibling),o=(e=this.createPositionAfter(e.parent)).parent}while(o!==t);return{position:e,range:new Bbe(Dbe._createAt(n,"end"),Dbe._createAt(r,0))}}},{key:"wrap",value:function(e,t){if(this._assertWriterUsedCorrectly(),!e.isFlat)throw new joe.a("writer-wrap-range-not-flat",this);var n=t instanceof Obe?t:new Obe(t);if(n.childCount>0)throw new joe.a("writer-wrap-element-not-empty",this);if(null!==n.parent)throw new joe.a("writer-wrap-element-attached",this);this.insert(n,e.start);var r=new Bbe(e.start.getShiftedBy(1),e.end.getShiftedBy(1));this.move(r,Dbe._createAt(n,0))}},{key:"unwrap",value:function(e){if(this._assertWriterUsedCorrectly(),null===e.parent)throw new joe.a("writer-unwrap-element-no-parent",this);this.move(Bbe._createIn(e),this.createPositionAfter(e)),this.remove(e)}},{key:"addMarker",value:function(e,t){if(this._assertWriterUsedCorrectly(),!t||"boolean"!=typeof t.usingOperation)throw new joe.a("writer-addmarker-no-usingoperation",this);var n=t.usingOperation,r=t.range,o=void 0!==t.affectsData&&t.affectsData;if(this.model.markers.has(e))throw new joe.a("writer-addmarker-marker-exists",this);if(!r)throw new joe.a("writer-addmarker-no-range",this);return n?(YOe(this,e,null,r,o),this.model.markers.get(e)):this.model.markers._set(e,r,n,o)}},{key:"updateMarker",value:function(e,t){this._assertWriterUsedCorrectly();var n="string"==typeof e?e:e.name,r=this.model.markers.get(n);if(!r)throw new joe.a("writer-updatemarker-marker-not-exists",this);if(t){var o="boolean"==typeof t.usingOperation,i="boolean"==typeof t.affectsData,a=i?t.affectsData:r.affectsData;if(!o&&!t.range&&!i)throw new joe.a("writer-updatemarker-wrong-options",this);var u=r.getRange(),l=t.range?t.range:u;o&&t.usingOperation!==r.managedUsingOperations?t.usingOperation?YOe(this,n,null,l,a):(YOe(this,n,u,null,a),this.model.markers._set(n,l,void 0,a)):r.managedUsingOperations?YOe(this,n,u,l,a):this.model.markers._set(n,l,void 0,a)}else this.model.markers._refresh(r)}},{key:"removeMarker",value:function(e){this._assertWriterUsedCorrectly();var t="string"==typeof e?e:e.name;if(!this.model.markers.has(t))throw new joe.a("writer-removemarker-no-marker",this);var n=this.model.markers.get(t);n.managedUsingOperations?YOe(this,t,n.getRange(),null,n.affectsData):this.model.markers._remove(t)}},{key:"setSelection",value:function(e,t,n){this._assertWriterUsedCorrectly(),this.model.document.selection._setTo(e,t,n)}},{key:"setSelectionFocus",value:function(e,t){this._assertWriterUsedCorrectly(),this.model.document.selection._setFocus(e,t)}},{key:"setSelectionAttribute",value:function(e,t){if(this._assertWriterUsedCorrectly(),"string"==typeof e)this._setSelectionAttribute(e,t);else{var n,r=ROe(Jfe(e));try{for(r.s();!(n=r.n()).done;){var o=DOe(n.value,2),i=o[0],a=o[1];this._setSelectionAttribute(i,a)}}catch(e){r.e(e)}finally{r.f()}}}},{key:"removeSelectionAttribute",value:function(e){if(this._assertWriterUsedCorrectly(),"string"==typeof e)this._removeSelectionAttribute(e);else{var t,n=ROe(e);try{for(n.s();!(t=n.n()).done;){var r=t.value;this._removeSelectionAttribute(r)}}catch(e){n.e(e)}finally{n.f()}}}},{key:"overrideSelectionGravity",value:function(){return this.model.document.selection._overrideGravity()}},{key:"restoreSelectionGravity",value:function(e){this.model.document.selection._restoreGravity(e)}},{key:"_setSelectionAttribute",value:function(e,t){var n=this.model.document.selection;if(n.isCollapsed&&n.anchor.parent.isEmpty){var r=Ave._getStoreAttributeKey(e);this.setAttribute(r,t,n.anchor.parent)}n._setAttribute(e,t)}},{key:"_removeSelectionAttribute",value:function(e){var t=this.model.document.selection;if(t.isCollapsed&&t.anchor.parent.isEmpty){var n=Ave._getStoreAttributeKey(e);this.removeAttribute(n,t.anchor.parent)}t._removeAttribute(e)}},{key:"_assertWriterUsedCorrectly",value:function(){if(this.model._currentWriter!==this)throw new joe.a("writer-incorrect-use",this)}},{key:"_addOperationForAffectedMarkers",value:function(e,t){var n,r=ROe(this.model.markers);try{for(r.s();!(n=r.n()).done;){var o=n.value;if(o.managedUsingOperations){var i=o.getRange(),a=!1;if("move"===e)a=t.containsPosition(i.start)||t.start.isEqual(i.start)||t.containsPosition(i.end)||t.end.isEqual(i.end);else{var u=t.nodeBefore,l=t.nodeAfter,s=i.start.parent==u&&i.start.isAtEnd,c=i.end.parent==l&&0==i.end.offset,f=i.end.nodeAfter==l,p=i.start.nodeAfter==l;a=s||c||f||p}a&&this.updateMarker(o.name,{range:i})}}}catch(e){r.e(e)}finally{r.f()}}}])&&LOe(t.prototype,n),r&&LOe(t,r),e}();function zOe(e,t,n,r){var o,i,a,u,l=e.model,s=l.document,c=r.start,f=ROe(r.getWalker({shallow:!0}));try{for(f.s();!(u=f.n()).done;){var p=u.value;a=p.item.getAttribute(t),o&&i!=a&&(i!=n&&d(),c=o),o=p.nextPosition,i=a}}catch(e){f.e(e)}finally{f.f()}function d(){var r=new Bbe(c,o),a=r.root.document?s.version:null,u=new s_e(r,t,i,n,a);e.batch.addOperation(u),l.applyOperation(u)}o instanceof Dbe&&o!=c&&i!=n&&d()}function FOe(e,t,n,r){var o,i,a=e.model,u=a.document,l=r.getAttribute(t);if(l!=n){if(r.root===r){var s=r.document?u.version:null;i=new aOe(r,t,l,n,s)}else{var c=(o=new Bbe(Dbe._createBefore(r),e.createPositionAfter(r))).root.document?u.version:null;i=new s_e(o,t,l,n,c)}e.batch.addOperation(i),a.applyOperation(i)}}function YOe(e,t,n,r,o){var i=e.model,a=i.document,u=new W_e(t,n,r,i.markers,o,a.version);e.batch.addOperation(u),i.applyOperation(u)}function NOe(e,t,n,r){var o;if(e.root.document){var i=r.document,a=new Dbe(i.graveyard,[0]);o=new P_e(e,t,a,i.version)}else o=new b_e(e,t);n.addOperation(o),r.applyOperation(o)}function BOe(e,t){return e===t||e instanceof TOe&&t instanceof TOe}function HOe(e){return function(e){if(Array.isArray(e))return qOe(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||UOe(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function VOe(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n}(e,t)||UOe(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function WOe(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=UOe(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function UOe(e,t){if(e){if("string"==typeof e)return qOe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?qOe(e,t):void 0}}function qOe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0}},{key:"getChanges",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{includeChangesInGraveyard:!1};if(this._cachedChanges)return e.includeChangesInGraveyard?this._cachedChangesWithGraveyard.slice():this._cachedChanges.slice();var t,n=[],r=AOe(this._changesInElement.keys());try{for(r.s();!(t=r.n()).done;){var o,i=t.value,a=this._changesInElement.get(i).sort((function(e,t){return e.offset===t.offset?e.type!=t.type?"remove"==e.type?-1:1:0:e.offseto.offset){if(i>a){var d={type:"attribute",offset:a,howMany:i-a,count:this._changeCount++};this._handleChange(d,t),t.push(d)}e.nodesToHandle=o.offset-e.offset,e.howMany=e.nodesToHandle}else e.offset>=o.offset&&e.offseta?(e.nodesToHandle=i-a,e.offset=a):e.nodesToHandle=0);if("remove"==o.type&&e.offseto.offset){var h={type:"attribute",offset:o.offset,howMany:i-o.offset,count:this._changeCount++};this._handleChange(h,t),t.push(h),e.nodesToHandle=o.offset-e.offset,e.howMany=e.nodesToHandle}"attribute"==o.type&&(e.offset>=o.offset&&i<=a?(e.nodesToHandle=0,e.howMany=0,e.offset=0):e.offset<=o.offset&&i>=a&&(o.howMany=0))}}}catch(e){r.e(e)}finally{r.f()}e.howMany=e.nodesToHandle,delete e.nodesToHandle}},{key:"_getInsertDiff",value:function(e,t,n){return{type:"insert",position:_be._createAt(e,t),name:n,length:1,changeCount:this._changeCount++}}},{key:"_getRemoveDiff",value:function(e,t,n){return{type:"remove",position:_be._createAt(e,t),name:n,length:1,changeCount:this._changeCount++}}},{key:"_getAttributesDiff",value:function(e,t,n){var r=[];n=new Map(n);var o,i=AOe(t);try{for(i.s();!(o=i.n()).done;){var a=MOe(o.value,2),u=a[0],l=a[1],s=n.has(u)?n.get(u):null;s!==l&&r.push({type:"attribute",position:e.start,range:e.clone(),length:1,attributeKey:u,attributeOldValue:l,attributeNewValue:s,changeCount:this._changeCount++}),n.delete(u)}}catch(e){i.e(e)}finally{i.f()}var c,f=AOe(n);try{for(f.s();!(c=f.n()).done;){var p=MOe(c.value,2),d=p[0],h=p[1];r.push({type:"attribute",position:e.start,range:e.clone(),length:1,attributeKey:d,attributeOldValue:null,attributeNewValue:h,changeCount:this._changeCount++})}}catch(e){f.e(e)}finally{f.f()}return r}},{key:"_isInInsertedElement",value:function(e){var t=e.parent;if(!t)return!1;var n=this._changesInElement.get(t),r=e.startOffset;if(n){var o,i=AOe(n);try{for(i.s();!(o=i.n()).done;){var a=o.value;if("insert"==a.type&&r>=a.offset&&ro){for(var l=0;l=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function VOe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0}},{key:"getChanges",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{includeChangesInGraveyard:!1};if(this._cachedChanges)return e.includeChangesInGraveyard?this._cachedChangesWithGraveyard.slice():this._cachedChanges.slice();var t,n=[],r=WOe(this._changesInElement.keys());try{for(r.s();!(t=r.n()).done;){var o,i=t.value,a=this._changesInElement.get(i).sort((function(e,t){return e.offset===t.offset?e.type!=t.type?"remove"==e.type?-1:1:0:e.offseto.offset){if(i>a){var d={type:"attribute",offset:a,howMany:i-a,count:this._changeCount++};this._handleChange(d,t),t.push(d)}e.nodesToHandle=o.offset-e.offset,e.howMany=e.nodesToHandle}else e.offset>=o.offset&&e.offseta?(e.nodesToHandle=i-a,e.offset=a):e.nodesToHandle=0);if("remove"==o.type&&e.offseto.offset){var h={type:"attribute",offset:o.offset,howMany:i-o.offset,count:this._changeCount++};this._handleChange(h,t),t.push(h),e.nodesToHandle=o.offset-e.offset,e.howMany=e.nodesToHandle}"attribute"==o.type&&(e.offset>=o.offset&&i<=a?(e.nodesToHandle=0,e.howMany=0,e.offset=0):e.offset<=o.offset&&i>=a&&(o.howMany=0))}}}catch(e){r.e(e)}finally{r.f()}e.howMany=e.nodesToHandle,delete e.nodesToHandle}},{key:"_getInsertDiff",value:function(e,t,n){return{type:"insert",position:Dbe._createAt(e,t),name:n,length:1,changeCount:this._changeCount++}}},{key:"_getRemoveDiff",value:function(e,t,n){return{type:"remove",position:Dbe._createAt(e,t),name:n,length:1,changeCount:this._changeCount++}}},{key:"_getAttributesDiff",value:function(e,t,n){var r=[];n=new Map(n);var o,i=WOe(t);try{for(i.s();!(o=i.n()).done;){var a=VOe(o.value,2),u=a[0],l=a[1],s=n.has(u)?n.get(u):null;s!==l&&r.push({type:"attribute",position:e.start,range:e.clone(),length:1,attributeKey:u,attributeOldValue:l,attributeNewValue:s,changeCount:this._changeCount++}),n.delete(u)}}catch(e){i.e(e)}finally{i.f()}var c,f=WOe(n);try{for(f.s();!(c=f.n()).done;){var p=VOe(c.value,2),d=p[0],h=p[1];r.push({type:"attribute",position:e.start,range:e.clone(),length:1,attributeKey:d,attributeOldValue:null,attributeNewValue:h,changeCount:this._changeCount++})}}catch(e){f.e(e)}finally{f.f()}return r}},{key:"_isInInsertedElement",value:function(e){var t=e.parent;if(!t)return!1;var n=this._changesInElement.get(t),r=e.startOffset;if(n){var o,i=WOe(n);try{for(i.s();!(o=i.n()).done;){var a=o.value;if("insert"==a.type&&r>=a.offset&&ro){for(var l=0;l=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function XOe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:Number.NEGATIVE_INFINITY,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.POSITIVE_INFINITY,r=[],o=HOe(this._operations);try{for(o.s();!(e=o.n()).done;){var i=e.value;i.baseVersion>=t&&i.baseVersion0&&void 0!==arguments[0]?arguments[0]:Number.NEGATIVE_INFINITY,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.POSITIVE_INFINITY,r=[],o=QOe(this._operations);try{for(o.s();!(e=o.n()).done;){var i=e.value;i.baseVersion>=t&&i.baseVersion=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function GOe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function iSe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:"$root",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"main";if(this.roots.get(t))throw new moe.a("model-document-createroot-name-exists",this,{name:t});var n=new wOe(this,e,t);return this.roots.add(n),n}},{key:"destroy",value:function(){this.selection.destroy(),this.stopListening()}},{key:"getRoot",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"main";return this.roots.get(e)}},{key:"getRootNames",value:function(){return Array.from(this.roots,(function(e){return e.rootName})).filter((function(e){return"$graveyard"!=e}))}},{key:"registerPostFixer",value:function(e){this._postFixers.add(e)}},{key:"toJSON",value:function(){var e=xfe(this);return e.selection="[engine.model.DocumentSelection]",e.model="[engine.model.Model]",e}},{key:"_handleChangeBlock",value:function(e){this._hasDocumentChangedFromTheLastChangeBlock()&&(this._callPostFixers(e),this.selection.refresh(),this.differ.hasDataChanges()?this.fire("change:data",e.batch):this.fire("change",e.batch),this.selection.refresh(),this.differ.reset()),this._hasSelectionChangedFromTheLastChangeBlock=!1}},{key:"_hasDocumentChangedFromTheLastChangeBlock",value:function(){return!this.differ.isEmpty||this._hasSelectionChangedFromTheLastChangeBlock}},{key:"_getDefaultRoot",value:function(){var e,t=$Oe(this.roots);try{for(t.s();!(e=t.n()).done;){var n=e.value;if(n!==this.graveyard)return n}}catch(e){t.e(e)}finally{t.f()}return this.graveyard}},{key:"_getDefaultRange",value:function(){var e=this._getDefaultRoot(),t=this.model,n=t.schema,r=t.createPositionFromPath(e,[0]);return n.getNearestSelectionRange(r)||t.createRange(r)}},{key:"_validateSelectionRange",value:function(e){return QOe(e.start)&&QOe(e.end)}},{key:"_callPostFixers",value:function(e){var t=!1;do{var n,r=$Oe(this._postFixers);try{for(r.s();!(n=r.n()).done;){var o=n.value;if(this.selection.refresh(),t=o(e))break}}catch(e){r.e(e)}finally{r.f()}}while(t)}},{key:"graveyard",get:function(){return this.getRoot("$graveyard")}}])&&ZOe(t.prototype,n),r&&ZOe(t,r),e}();function QOe(e){var t=e.textNode;if(t){var n=t.data,r=e.offset-t.startOffset;return!qOe(n,r)&&!KOe(n,r)}return!0}function XOe(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return eSe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return eSe(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function eSe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:"$root",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"main";if(this.roots.get(t))throw new joe.a("model-document-createroot-name-exists",this,{name:t});var n=new TOe(this,e,t);return this.roots.add(n),n}},{key:"destroy",value:function(){this.selection.destroy(),this.stopListening()}},{key:"getRoot",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"main";return this.roots.get(e)}},{key:"getRootNames",value:function(){return Array.from(this.roots,(function(e){return e.rootName})).filter((function(e){return"$graveyard"!=e}))}},{key:"registerPostFixer",value:function(e){this._postFixers.add(e)}},{key:"toJSON",value:function(){var e=Yfe(this);return e.selection="[engine.model.DocumentSelection]",e.model="[engine.model.Model]",e}},{key:"_handleChangeBlock",value:function(e){this._hasDocumentChangedFromTheLastChangeBlock()&&(this._callPostFixers(e),this.selection.refresh(),this.differ.hasDataChanges()?this.fire("change:data",e.batch):this.fire("change",e.batch),this.selection.refresh(),this.differ.reset()),this._hasSelectionChangedFromTheLastChangeBlock=!1}},{key:"_hasDocumentChangedFromTheLastChangeBlock",value:function(){return!this.differ.isEmpty||this._hasSelectionChangedFromTheLastChangeBlock}},{key:"_getDefaultRoot",value:function(){var e,t=oSe(this.roots);try{for(t.s();!(e=t.n()).done;){var n=e.value;if(n!==this.graveyard)return n}}catch(e){t.e(e)}finally{t.f()}return this.graveyard}},{key:"_getDefaultRange",value:function(){var e=this._getDefaultRoot(),t=this.model,n=t.schema,r=t.createPositionFromPath(e,[0]);return n.getNearestSelectionRange(r)||t.createRange(r)}},{key:"_validateSelectionRange",value:function(e){return lSe(e.start)&&lSe(e.end)}},{key:"_callPostFixers",value:function(e){var t=!1;do{var n,r=oSe(this._postFixers);try{for(r.s();!(n=r.n()).done;){var o=n.value;if(this.selection.refresh(),t=o(e))break}}catch(e){r.e(e)}finally{r.f()}}while(t)}},{key:"graveyard",get:function(){return this.getRoot("$graveyard")}}])&&aSe(t.prototype,n),r&&aSe(t,r),e}();function lSe(e){var t=e.textNode;if(t){var n=t.data,r=e.offset-t.startOffset;return!nSe(n,r)&&!rSe(n,r)}return!0}function sSe(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return cSe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return cSe(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function cSe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=e instanceof iSe?e.name:e;if(o.includes(","))throw new moe.a("markercollection-incorrect-marker-name",this);var i=this._markers.get(o);if(i){var a=i.getRange(),u=!1;return a.isEqual(t)||(i._attachLiveRange(uve.fromRange(t)),u=!0),n!=i.managedUsingOperations&&(i._managedUsingOperations=n,u=!0),"boolean"==typeof r&&r!=i.affectsData&&(i._affectsData=r,u=!0),u&&this.fire("update:"+o,i,a,t),i}var l=uve.fromRange(t),s=new iSe(o,l,n,r);return this._markers.set(o,s),this.fire("update:"+o,s,null,t),s}},{key:"_remove",value:function(e){var t=e instanceof iSe?e.name:e,n=this._markers.get(t);return!!n&&(this._markers.delete(t),this.fire("update:"+t,n,n.getRange(),null),this._destroyMarker(n),!0)}},{key:"_refresh",value:function(e){var t=e instanceof iSe?e.name:e,n=this._markers.get(t);if(!n)throw new moe.a("markercollection-refresh-marker-not-exists",this);var r=n.getRange();this.fire("update:"+t,n,r,r,n.managedUsingOperations,n.affectsData)}},{key:"getMarkersAtPosition",value:regeneratorRuntime.mark((function e(t){var n,r,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=XOe(this),e.prev=1,n.s();case 3:if((r=n.n()).done){e.next=10;break}if(!(o=r.value).getRange().containsPosition(t)){e.next=8;break}return e.next=8,o;case 8:e.next=3;break;case 10:e.next=15;break;case 12:e.prev=12,e.t0=e.catch(1),n.e(e.t0);case 15:return e.prev=15,n.f(),e.finish(15);case 18:case"end":return e.stop()}}),e,this,[[1,12,15,18]])}))},{key:"getMarkersIntersectingRange",value:regeneratorRuntime.mark((function e(t){var n,r,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=XOe(this),e.prev=1,n.s();case 3:if((r=n.n()).done){e.next=10;break}if(null===(o=r.value).getRange().getIntersection(t)){e.next=8;break}return e.next=8,o;case 8:e.next=3;break;case 10:e.next=15;break;case 12:e.prev=12,e.t0=e.catch(1),n.e(e.t0);case 15:return e.prev=15,n.f(),e.finish(15);case 18:case"end":return e.stop()}}),e,this,[[1,12,15,18]])}))},{key:"destroy",value:function(){var e,t=XOe(this._markers.values());try{for(t.s();!(e=t.n()).done;){var n=e.value;this._destroyMarker(n)}}catch(e){t.e(e)}finally{t.f()}this._markers=null,this.stopListening()}},{key:"getMarkersGroup",value:regeneratorRuntime.mark((function e(t){var n,r,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=XOe(this._markers.values()),e.prev=1,n.s();case 3:if((r=n.n()).done){e.next=10;break}if(!(o=r.value).name.startsWith(t+":")){e.next=8;break}return e.next=8,o;case 8:e.next=3;break;case 10:e.next=15;break;case 12:e.prev=12,e.t0=e.catch(1),n.e(e.t0);case 15:return e.prev=15,n.f(),e.finish(15);case 18:case"end":return e.stop()}}),e,this,[[1,12,15,18]])}))},{key:"_destroyMarker",value:function(e){e.stopListening(),e._detachLiveRange()}}]),e}();Zoe(oSe,koe);var iSe=function(){function e(t,n,r,o){tSe(this,e),this.name=t,this._liveRange=this._attachLiveRange(n),this._managedUsingOperations=r,this._affectsData=o}return rSe(e,[{key:"getStart",value:function(){if(!this._liveRange)throw new moe.a("marker-destroyed",this);return this._liveRange.start.clone()}},{key:"getEnd",value:function(){if(!this._liveRange)throw new moe.a("marker-destroyed",this);return this._liveRange.end.clone()}},{key:"getRange",value:function(){if(!this._liveRange)throw new moe.a("marker-destroyed",this);return this._liveRange.toRange()}},{key:"is",value:function(e){return"marker"===e||"model:marker"===e}},{key:"_attachLiveRange",value:function(e){return this._liveRange&&this._detachLiveRange(),e.delegate("change:range").to(this),e.delegate("change:content").to(this),this._liveRange=e,e}},{key:"_detachLiveRange",value:function(){this._liveRange.stopDelegating("change:range",this),this._liveRange.stopDelegating("change:content",this),this._liveRange.detach(),this._liveRange=null}},{key:"managedUsingOperations",get:function(){if(!this._liveRange)throw new moe.a("marker-destroyed",this);return this._managedUsingOperations}},{key:"affectsData",get:function(){if(!this._liveRange)throw new moe.a("marker-destroyed",this);return this._affectsData}}]),e}();function aSe(e){return(aSe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function uSe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function lSe(e,t){for(var n=0;n2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=e instanceof ySe?e.name:e;if(o.includes(","))throw new joe.a("markercollection-incorrect-marker-name",this);var i=this._markers.get(o);if(i){var a=i.getRange(),u=!1;return a.isEqual(t)||(i._attachLiveRange(bve.fromRange(t)),u=!0),n!=i.managedUsingOperations&&(i._managedUsingOperations=n,u=!0),"boolean"==typeof r&&r!=i.affectsData&&(i._affectsData=r,u=!0),u&&this.fire("update:"+o,i,a,t),i}var l=bve.fromRange(t),s=new ySe(o,l,n,r);return this._markers.set(o,s),this.fire("update:"+o,s,null,t),s}},{key:"_remove",value:function(e){var t=e instanceof ySe?e.name:e,n=this._markers.get(t);return!!n&&(this._markers.delete(t),this.fire("update:"+t,n,n.getRange(),null),this._destroyMarker(n),!0)}},{key:"_refresh",value:function(e){var t=e instanceof ySe?e.name:e,n=this._markers.get(t);if(!n)throw new joe.a("markercollection-refresh-marker-not-exists",this);var r=n.getRange();this.fire("update:"+t,n,r,r,n.managedUsingOperations,n.affectsData)}},{key:"getMarkersAtPosition",value:regeneratorRuntime.mark((function e(t){var n,r,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=sSe(this),e.prev=1,n.s();case 3:if((r=n.n()).done){e.next=10;break}if(!(o=r.value).getRange().containsPosition(t)){e.next=8;break}return e.next=8,o;case 8:e.next=3;break;case 10:e.next=15;break;case 12:e.prev=12,e.t0=e.catch(1),n.e(e.t0);case 15:return e.prev=15,n.f(),e.finish(15);case 18:case"end":return e.stop()}}),e,this,[[1,12,15,18]])}))},{key:"getMarkersIntersectingRange",value:regeneratorRuntime.mark((function e(t){var n,r,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=sSe(this),e.prev=1,n.s();case 3:if((r=n.n()).done){e.next=10;break}if(null===(o=r.value).getRange().getIntersection(t)){e.next=8;break}return e.next=8,o;case 8:e.next=3;break;case 10:e.next=15;break;case 12:e.prev=12,e.t0=e.catch(1),n.e(e.t0);case 15:return e.prev=15,n.f(),e.finish(15);case 18:case"end":return e.stop()}}),e,this,[[1,12,15,18]])}))},{key:"destroy",value:function(){var e,t=sSe(this._markers.values());try{for(t.s();!(e=t.n()).done;){var n=e.value;this._destroyMarker(n)}}catch(e){t.e(e)}finally{t.f()}this._markers=null,this.stopListening()}},{key:"getMarkersGroup",value:regeneratorRuntime.mark((function e(t){var n,r,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=sSe(this._markers.values()),e.prev=1,n.s();case 3:if((r=n.n()).done){e.next=10;break}if(!(o=r.value).name.startsWith(t+":")){e.next=8;break}return e.next=8,o;case 8:e.next=3;break;case 10:e.next=15;break;case 12:e.prev=12,e.t0=e.catch(1),n.e(e.t0);case 15:return e.prev=15,n.f(),e.finish(15);case 18:case"end":return e.stop()}}),e,this,[[1,12,15,18]])}))},{key:"_destroyMarker",value:function(e){e.stopListening(),e._detachLiveRange()}}]),e}();aie(hSe,Aoe);var ySe=function(){function e(t,n,r,o){fSe(this,e),this.name=t,this._liveRange=this._attachLiveRange(n),this._managedUsingOperations=r,this._affectsData=o}return dSe(e,[{key:"getStart",value:function(){if(!this._liveRange)throw new joe.a("marker-destroyed",this);return this._liveRange.start.clone()}},{key:"getEnd",value:function(){if(!this._liveRange)throw new joe.a("marker-destroyed",this);return this._liveRange.end.clone()}},{key:"getRange",value:function(){if(!this._liveRange)throw new joe.a("marker-destroyed",this);return this._liveRange.toRange()}},{key:"is",value:function(e){return"marker"===e||"model:marker"===e}},{key:"_attachLiveRange",value:function(e){return this._liveRange&&this._detachLiveRange(),e.delegate("change:range").to(this),e.delegate("change:content").to(this),this._liveRange=e,e}},{key:"_detachLiveRange",value:function(){this._liveRange.stopDelegating("change:range",this),this._liveRange.stopDelegating("change:content",this),this._liveRange.detach(),this._liveRange=null}},{key:"managedUsingOperations",get:function(){if(!this._liveRange)throw new joe.a("marker-destroyed",this);return this._managedUsingOperations}},{key:"affectsData",get:function(){if(!this._liveRange)throw new joe.a("marker-destroyed",this);return this._affectsData}}]),e}();function mSe(e){return(mSe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function bSe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function vSe(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:"toNone";if(vSe(this,i),!(n=o.call(this,e,t,r)).root.is("rootElement"))throw new moe.a("model-liveposition-root-not-rootelement",e);return jSe.call(SSe(n)),n}return t=i,r=[{key:"fromPosition",value:function(e,t){return new this(e.root,e.path.slice(),t||e.stickiness)}}],(n=[{key:"detach",value:function(){this.stopListening()}},{key:"is",value:function(e){return"livePosition"===e||"model:livePosition"===e||"position"==e||"model:position"===e}},{key:"toPosition",value:function(){return new _be(this.root,this.path.slice(),this.stickiness)}}])&&gSe(t.prototype,n),r&&gSe(t,r),i}(_be);function jSe(){var e=this;this.listenTo(this.root.document.model,"applyOperation",(function(t,n){var r=n[0];r.isDocumentOperation&&ESe.call(e,r)}),{priority:"low"})}function ESe(e){var t=this.getTransformedByOperation(e);if(!this.isEqual(t)){var n=this.toPosition();this.path=t.path,this.root=t.root,this.fire("change",n)}}function CSe(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:"toNone";if(CSe(this,i),!(n=o.call(this,e,t,r)).root.is("rootElement"))throw new joe.a("model-liveposition-root-not-rootelement",e);return ISe.call(MSe(n)),n}return t=i,r=[{key:"fromPosition",value:function(e,t){return new this(e.root,e.path.slice(),t||e.stickiness)}}],(n=[{key:"detach",value:function(){this.stopListening()}},{key:"is",value:function(e){return"livePosition"===e||"model:livePosition"===e||"position"==e||"model:position"===e}},{key:"toPosition",value:function(){return new Dbe(this.root,this.path.slice(),this.stickiness)}}])&&xSe(t.prototype,n),r&&xSe(t,r),i}(Dbe);function ISe(){var e=this;this.listenTo(this.root.document.model,"applyOperation",(function(t,n){var r=n[0];r.isDocumentOperation&&zSe.call(e,r)}),{priority:"low"})}function zSe(e){var t=this.getTransformedByOperation(e);if(!this.isEqual(t)){var n=this.toPosition();this.path=t.path,this.root=t.root,this.fire("change",n)}}function FSe(e,t){for(var n=0;n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function DSe(e,t){return function(e){if(Array.isArray(e))return e} + */return t=e,(n=[{key:"handleNodes",value:function(e,t){e=Array.from(e);for(var n=0;n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function BSe(e,t){return function(e){if(Array.isArray(e))return e} /** * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n}(e,t)||RSe(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function RSe(e,t){if(e){if("string"==typeof e)return MSe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?MSe(e,t):void 0}}function MSe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function $Se(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function oke(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function JSe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function uke(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function rke(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function dke(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:{};if(!t.isCollapsed){var r=t.getFirstRange();if("$graveyard"!=r.root.rootName){var o=e.schema;e.change((function(e){if(n.doNotResetEntireContent||!NSe(o,t)){var i=DSe(ASe(r),2),a=i[0],u=i[1];a.isTouching(u)||e.remove(e.createRange(a,u)),n.leaveUnmerged||(LSe(e,a,u),o.removeDisallowedAttributes(a.parent.getChildren(),e)),BSe(e,t,a),!n.doNotAutoparagraph&&zSe(o,a)&&FSe(e,a,t),a.detach(),u.detach()}else YSe(e,t)}))}}}(this,e,t)}},{key:"modifySelection",value:function(e,t){!function(e,t){for(var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=e.schema,i="backward"!=r.direction,a=r.unit?r.unit:"character",u=t.focus,l=new ybe({boundaries:WSe(u,i),singleCharacters:!0,direction:i?"forward":"backward"}),s={walker:l,schema:o,isForward:i,unit:a},c=function(){if(n.done)return{v:void 0};var r=VSe(s,n.value);return r?(t instanceof kve?e.change((function(e){e.setSelectionFocus(r)})):t.setFocus(r),{v:void 0}):void 0};n=l.next();){var f=c();if("object"===HSe(f))return f.v}}(this,e,t)}},{key:"getSelectedContent",value:function(e){return function(e,t){return e.change((function(e){var n=e.createDocumentFragment(),r=t.getFirstRange();if(!r||r.isCollapsed)return n;var o,i,a=r.start.root,u=r.start.getCommonPath(r.end),l=a.getNodeByPath(u),s=(o=r.start.parent==r.end.parent?r:e.createRange(e.createPositionAt(l,r.start.path[u.length]),e.createPositionAt(l,r.end.path[u.length]+1))).end.offset-o.start.offset,c=KSe(o.getItems({shallow:!0}));try{for(c.s();!(i=c.n()).done;){var f=i.value;f.is("$textProxy")?e.appendText(f.data,f.getAttributes(),n):e.append(e.cloneElement(f,!0),n)}}catch(e){c.e(e)}finally{c.f()}if(o!=r){var p=r._getTransformedByMove(o.start,e.createPositionAt(n,0),s)[0],d=e.createRange(e.createPositionAt(n,0),p.start);GSe(e.createRange(p.end,e.createPositionAt(n,"end")),e),GSe(d,e)}return n}))}(this,e)}},{key:"hasContent",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e instanceof pbe?Dbe._createIn(e):e;if(n.isCollapsed)return!1;var r=t.ignoreWhitespaces,o=void 0!==r&&r,i=t.ignoreMarkers,a=void 0!==i&&i;if(!a){var u,l=nke(this.markers.getMarkersIntersectingRange(n));try{for(l.s();!(u=l.n()).done;){var s=u.value;if(s.affectsData)return!0}}catch(e){l.e(e)}finally{l.f()}}var c,f=nke(n.getItems());try{for(f.s();!(c=f.n()).done;){var p=c.value;if(this.schema.isContent(p)){if(!p.is("$textProxy"))return!0;if(!o)return!0;if(-1!==p.data.search(/\S/))return!0}}}catch(e){f.e(e)}finally{f.f()}return!1}},{key:"createPositionFromPath",value:function(e,t,n){return new _be(e,t,n)}},{key:"createPositionAt",value:function(e,t){return _be._createAt(e,t)}},{key:"createPositionAfter",value:function(e){return _be._createAfter(e)}},{key:"createPositionBefore",value:function(e){return _be._createBefore(e)}},{key:"createRange",value:function(e,t){return new Dbe(e,t)}},{key:"createRangeIn",value:function(e){return Dbe._createIn(e)}},{key:"createRangeOn",value:function(e){return Dbe._createOn(e)}},{key:"createSelection",value:function(e,t,n){return new Gbe(e,t,n)}},{key:"createBatch",value:function(e){return new Ewe(e)}},{key:"createOperationFromJSON",value:function(e){return mSe.fromJSON(e,this.document)}},{key:"destroy",value:function(){this.document.destroy(),this.stopListening()}},{key:"_runPendingChanges",value:function(){var e=[];for(this.fire("_beforeChanges");this._pendingChanges.length;){var t=this._pendingChanges[0].batch;this._currentWriter=new jOe(this,t);var n=this._pendingChanges[0].callback(this._currentWriter);e.push(n),this.document._handleChangeBlock(this._currentWriter),this._pendingChanges.shift(),this._currentWriter=null}return this.fire("_afterChanges"),e}}])&&oke(t.prototype,n),r&&oke(t,r),e}();function ake(e){return(ake="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function uke(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};if(!t.isCollapsed){var r=t.getFirstRange();if("$graveyard"!=r.root.rootName){var o=e.schema;e.change((function(e){if(n.doNotResetEntireContent||!ZSe(o,t)){var i=BSe(WSe(r),2),a=i[0],u=i[1];a.isTouching(u)||e.remove(e.createRange(a,u)),n.leaveUnmerged||(USe(e,a,u),o.removeDisallowedAttributes(a.parent.getChildren(),e)),JSe(e,t,a),!n.doNotAutoparagraph&&KSe(o,a)&&$Se(e,a,t),a.detach(),u.detach()}else GSe(e,t)}))}}}(this,e,t)}},{key:"modifySelection",value:function(e,t){!function(e,t){for(var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=e.schema,i="backward"!=r.direction,a=r.unit?r.unit:"character",u=t.focus,l=new Pbe({boundaries:eke(u,i),singleCharacters:!0,direction:i?"forward":"backward"}),s={walker:l,schema:o,isForward:i,unit:a},c=function(){if(n.done)return{v:void 0};var r=XSe(s,n.value);return r?(t instanceof Ave?e.change((function(e){e.setSelectionFocus(r)})):t.setFocus(r),{v:void 0}):void 0};n=l.next();){var f=c();if("object"===QSe(f))return f.v}}(this,e,t)}},{key:"getSelectedContent",value:function(e){return function(e,t){return e.change((function(e){var n=e.createDocumentFragment(),r=t.getFirstRange();if(!r||r.isCollapsed)return n;var o,i,a=r.start.root,u=r.start.getCommonPath(r.end),l=a.getNodeByPath(u),s=(o=r.start.parent==r.end.parent?r:e.createRange(e.createPositionAt(l,r.start.path[u.length]),e.createPositionAt(l,r.end.path[u.length]+1))).end.offset-o.start.offset,c=rke(o.getItems({shallow:!0}));try{for(c.s();!(i=c.n()).done;){var f=i.value;f.is("$textProxy")?e.appendText(f.data,f.getAttributes(),n):e.append(e.cloneElement(f,!0),n)}}catch(e){c.e(e)}finally{c.f()}if(o!=r){var p=r._getTransformedByMove(o.start,e.createPositionAt(n,0),s)[0],d=e.createRange(e.createPositionAt(n,0),p.start);ike(e.createRange(p.end,e.createPositionAt(n,"end")),e),ike(d,e)}return n}))}(this,e)}},{key:"hasContent",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e instanceof Obe?Bbe._createIn(e):e;if(n.isCollapsed)return!1;var r=t.ignoreWhitespaces,o=void 0!==r&&r,i=t.ignoreMarkers,a=void 0!==i&&i;if(!a){var u,l=pke(this.markers.getMarkersIntersectingRange(n));try{for(l.s();!(u=l.n()).done;){var s=u.value;if(s.affectsData)return!0}}catch(e){l.e(e)}finally{l.f()}}var c,f=pke(n.getItems());try{for(f.s();!(c=f.n()).done;){var p=c.value;if(this.schema.isContent(p)){if(!p.is("$textProxy"))return!0;if(!o)return!0;if(-1!==p.data.search(/\S/))return!0}}}catch(e){f.e(e)}finally{f.f()}return!1}},{key:"createPositionFromPath",value:function(e,t,n){return new Dbe(e,t,n)}},{key:"createPositionAt",value:function(e,t){return Dbe._createAt(e,t)}},{key:"createPositionAfter",value:function(e){return Dbe._createAfter(e)}},{key:"createPositionBefore",value:function(e){return Dbe._createBefore(e)}},{key:"createRange",value:function(e,t){return new Bbe(e,t)}},{key:"createRangeIn",value:function(e){return Bbe._createIn(e)}},{key:"createRangeOn",value:function(e){return Bbe._createOn(e)}},{key:"createSelection",value:function(e,t,n){return new ive(e,t,n)}},{key:"createBatch",value:function(e){return new zwe(e)}},{key:"createOperationFromJSON",value:function(e){return jSe.fromJSON(e,this.document)}},{key:"destroy",value:function(){this.document.destroy(),this.stopListening()}},{key:"_runPendingChanges",value:function(){var e=[];for(this.fire("_beforeChanges");this._pendingChanges.length;){var t=this._pendingChanges[0].batch;this._currentWriter=new IOe(this,t);var n=this._pendingChanges[0].callback(this._currentWriter);e.push(n),this.document._handleChangeBlock(this._currentWriter),this._pendingChanges.shift(),this._currentWriter=null}return this.fire("_afterChanges"),e}}])&&hke(t.prototype,n),r&&hke(t,r),e}();function mke(e){return(mke="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function bke(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};if("string"==typeof t){var o=t;t=function(e,t){n.editor.execute(o),t()}}lke(pke(i.prototype),"set",this).call(this,e,t,r)}}])&&uke(t.prototype,n),r&&uke(t,r),i}(Jue);function hke(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function yke(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};if("string"==typeof t){var o=t;t=function(e,t){n.editor.execute(o),t()}}vke(Oke(i.prototype),"set",this).call(this,e,t,r)}}])&&bke(t.prototype,n),r&&bke(t,r),i}(ule);function kke(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Pke(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};hke(this,e),this._context=n.context||new Efe({language:n.language}),this._context._addEditor(this,!n.context);var r=Array.from(this.constructor.builtinPlugins||[]);this.config=new ife(n,this.constructor.defaultConfig),this.config.define("plugins",r),this.config.define(this._context._getEditorConfig()),this.plugins=new hfe(this,r,this._context.plugins),this.locale=this._context.locale,this.t=this.locale.t,this.commands=new _ge,this.set("state","initializing"),this.once("ready",(function(){return t.state="ready"}),{priority:"high"}),this.once("destroy",(function(){return t.state="destroyed"}),{priority:"high"}),this.set("isReadOnly",!1),this.model=new ike;var o=new spe;this.data=new hwe(this.model,o),this.editing=new bge(this.model,o),this.editing.view.document.bind("isReadOnly").to(this),this.conversion=new wwe([this.editing.downcastDispatcher,this.data.downcastDispatcher],this.data.upcastDispatcher),this.conversion.addAlias("dataDowncast",this.data.downcastDispatcher),this.conversion.addAlias("editingDowncast",this.editing.downcastDispatcher),this.keystrokes=new dke(this),this.keystrokes.listenTo(this.editing.view.document)}var t,n,r;return t=e,(n=[{key:"initPlugins",value:function(){var e=this.config,t=e.get("plugins"),n=e.get("removePlugins")||[],r=e.get("extraPlugins")||[];return this.plugins.init(t.concat(r),n)}},{key:"destroy",value:function(){var e=this,t=Promise.resolve();return"initializing"==this.state&&(t=new Promise((function(t){return e.once("ready",t)}))),t.then((function(){e.fire("destroy"),e.stopListening(),e.commands.destroy()})).then((function(){return e.plugins.destroy()})).then((function(){e.model.destroy(),e.data.destroy(),e.editing.destroy(),e.keystrokes.destroy()})).then((function(){return e._context._removeEditor(e)}))}},{key:"execute",value:function(){try{var e;return(e=this.commands).execute.apply(e,arguments)}catch(e){moe.a.rethrowUnexpectedError(e,this)}}}])&&yke(t.prototype,n),r&&yke(t,r),e}();Zoe(mke,Boe); +var jke=function(){function e(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};kke(this,e),this._context=n.context||new zfe({language:n.language}),this._context._addEditor(this,!n.context);var r=Array.from(this.constructor.builtinPlugins||[]);this.config=new yfe(n,this.constructor.defaultConfig),this.config.define("plugins",r),this.config.define(this._context._getEditorConfig()),this.plugins=new kfe(this,r,this._context.plugins),this.locale=this._context.locale,this.t=this.locale.t,this.commands=new Dge,this.set("state","initializing"),this.once("ready",(function(){return t.state="ready"}),{priority:"high"}),this.once("destroy",(function(){return t.state="destroyed"}),{priority:"high"}),this.set("isReadOnly",!1),this.model=new yke;var o=new gpe;this.data=new kwe(this.model,o),this.editing=new Ege(this.model,o),this.editing.view.document.bind("isReadOnly").to(this),this.conversion=new Twe([this.editing.downcastDispatcher,this.data.downcastDispatcher],this.data.upcastDispatcher),this.conversion.addAlias("dataDowncast",this.data.downcastDispatcher),this.conversion.addAlias("editingDowncast",this.editing.downcastDispatcher),this.keystrokes=new Ske(this),this.keystrokes.listenTo(this.editing.view.document)}var t,n,r;return t=e,(n=[{key:"initPlugins",value:function(){var e=this.config,t=e.get("plugins"),n=e.get("removePlugins")||[],r=e.get("extraPlugins")||[];return this.plugins.init(t.concat(r),n)}},{key:"destroy",value:function(){var e=this,t=Promise.resolve();return"initializing"==this.state&&(t=new Promise((function(t){return e.once("ready",t)}))),t.then((function(){e.fire("destroy"),e.stopListening(),e.commands.destroy()})).then((function(){return e.plugins.destroy()})).then((function(){e.model.destroy(),e.data.destroy(),e.editing.destroy(),e.keystrokes.destroy()})).then((function(){return e._context._removeEditor(e)}))}},{key:"execute",value:function(){try{var e;return(e=this.commands).execute.apply(e,arguments)}catch(e){joe.a.rethrowUnexpectedError(e,this)}}}])&&Pke(t.prototype,n),r&&Pke(t,r),e}();aie(jke,Joe); /** * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -var bke={setData:function(e){this.data.set(e)},getData:function(e){return this.data.get(e)}}; +var Eke={setData:function(e){this.data.set(e)},getData:function(e){return this.data.get(e)}}; /** * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -var vke={updateSourceElement:function(){if(!this.sourceElement)throw new moe.a("editor-missing-sourceelement",this); +var Cke={updateSourceElement:function(){if(!this.sourceElement)throw new joe.a("editor-missing-sourceelement",this); /** * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -var e,t;e=this.sourceElement,t=this.data.get(),e instanceof HTMLTextAreaElement&&(e.value=t),e.innerHTML=t}};function gke(e,t){for(var n=0;n0;)n.appendChild(r[0]);return n}}])&&_ke(t.prototype,n),r&&_ke(t,r),e}();function Ske(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return kke(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return kke(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function kke(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0;)n.appendChild(r[0]);return n}}])&&Dke(t.prototype,n),r&&Dke(t,r),e}();function Mke(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Ake(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ake(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Ake(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function xke(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Yke(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:"main";return this._editableElementsMap.get(e)}},{key:"getEditableElementsNames",value:function(){return this._editableElementsMap.keys()}},{key:"element",get:function(){return null}},{key:"_editableElements",get:function(){return console.warn("editor-ui-deprecated-editable-elements: The EditorUI#_editableElements property has been deprecated and will be removed in the near future.",{editorUI:this}),this._editableElementsMap}}])&&Tke(t.prototype,n),r&&Tke(t,r),e}();Zoe(Dke,koe);n(662);function Rke(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n}(e,t)||Mke(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Mke(e,t){if(e){if("string"==typeof e)return Ake(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ake(e,t):void 0}}function Ake(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:"main";return this._editableElementsMap.get(e)}},{key:"getEditableElementsNames",value:function(){return this._editableElementsMap.keys()}},{key:"element",get:function(){return null}},{key:"_editableElements",get:function(){return console.warn("editor-ui-deprecated-editable-elements: The EditorUI#_editableElements property has been deprecated and will be removed in the near future.",{editorUI:this}),this._editableElementsMap}}])&&Nke(t.prototype,n),r&&Nke(t,r),e}();aie(Bke,Aoe);n(662);function Hke(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n}(e,t)||Vke(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Vke(e,t){if(e){if("string"==typeof e)return Wke(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Wke(e,t):void 0}}function Wke(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}(Lke.get(e));try{for(o.s();!(n=o.n()).done;){var i=Rke(n.value,2);Fke(t,i[0],i[1])&&(r=!0)}}catch(e){o.e(e)}finally{o.f()}return r}function Fke(e,t,n){var r=n.text,o=n.isDirectHost?t:function(e){if(1===e.childCount){var t=e.getChild(0);if(t.is("element")&&!t.is("uiElement"))return t}return null}(t),i=!1;return!!o&&(n.hostElement=o,o.getAttribute("data-placeholder")!==r&&(e.setAttribute("data-placeholder",r,o),i=!0),!function(e){if(!e.isAttached())return!1;var t=!Array.from(e.getChildren()).some((function(e){return!e.is("uiElement")})),n=e.document;if(!n.isFocused&&t)return!0;var r=n.selection.anchor;return!(!t||!r||r.parent===e)}(o)?Ike(e,o)&&(i=!0):function(e,t){return!t.hasClass("ck-placeholder")&&(e.addClass("ck-placeholder",t),!0)}(e,o)&&(i=!0),i)}function Yke(e,t){for(var n=0;n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}(Uke.get(e));try{for(o.s();!(n=o.n()).done;){var i=Hke(n.value,2);$ke(t,i[0],i[1])&&(r=!0)}}catch(e){o.e(e)}finally{o.f()}return r}function $ke(e,t,n){var r=n.text,o=n.isDirectHost?t:function(e){if(1===e.childCount){var t=e.getChild(0);if(t.is("element")&&!t.is("uiElement"))return t}return null}(t),i=!1;return!!o&&(n.hostElement=o,o.getAttribute("data-placeholder")!==r&&(e.setAttribute("data-placeholder",r,o),i=!0),!function(e){if(!e.isAttached())return!1;var t=!Array.from(e.getChildren()).some((function(e){return!e.is("uiElement")})),n=e.document;if(!n.isFocused&&t)return!0;var r=n.selection.anchor;return!(!t||!r||r.parent===e)}(o)?qke(e,o)&&(i=!0):function(e,t){return!t.hasClass("ck-placeholder")&&(e.addClass("ck-placeholder",t),!0)}(e,o)&&(i=!0),i)}function Gke(e,t){for(var n=0;n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Jke(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function uPe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:[];return Xke(this,i),(t=o.call(this,n)).locale=e,t}return t=i,(n=[{key:"attachToDom",value:function(){this._bodyCollectionContainer=new Lae({tag:"div",attributes:{class:["ck","ck-reset_all","ck-body","ck-rounded-corners"],dir:this.locale.uiLanguageDirection},children:this}).render();var e=document.querySelector(".ck-body-wrapper");e||(e=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],o=n&&n.xmlns,i=o?e.createElementNS(o,t):e.createElement(t);for(var a in n)i.setAttribute(a,n[a]);!Gke(r)&&Tie(r)||(r=[r]);var u,l=Zke(r);try{for(l.s();!(u=l.n()).done;){var s=u.value;Gke(s)&&(s=e.createTextNode(s)),i.appendChild(s)}}catch(e){l.e(e)}finally{l.f()}return i}(document,"div",{class:"ck-body-wrapper"}),document.body.appendChild(e)),e.appendChild(this._bodyCollectionContainer)}},{key:"detachFromDom",value:function(){tPe(iPe(i.prototype),"destroy",this).call(this),this._bodyCollectionContainer&&this._bodyCollectionContainer.remove();var e=document.querySelector(".ck-body-wrapper");e&&0==e.childElementCount&&e.remove()}}])&&ePe(t.prototype,n),r&&ePe(t,r),i}(Kie);n(663);function uPe(e){return(uPe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function lPe(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:[];return sPe(this,i),(t=o.call(this,n)).locale=e,t}return t=i,(n=[{key:"attachToDom",value:function(){this._bodyCollectionContainer=new Uae({tag:"div",attributes:{class:["ck","ck-reset_all","ck-body","ck-rounded-corners"],dir:this.locale.uiLanguageDirection},children:this}).render();var e=document.querySelector(".ck-body-wrapper");e||(e=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],o=n&&n.xmlns,i=o?e.createElementNS(o,t):e.createElement(t);for(var a in n)i.setAttribute(a,n[a]);!iPe(r)&&Nie(r)||(r=[r]);var u,l=aPe(r);try{for(l.s();!(u=l.n()).done;){var s=u.value;iPe(s)&&(s=e.createTextNode(s)),i.appendChild(s)}}catch(e){l.e(e)}finally{l.f()}return i}(document,"div",{class:"ck-body-wrapper"}),document.body.appendChild(e)),e.appendChild(this._bodyCollectionContainer)}},{key:"detachFromDom",value:function(){fPe(yPe(i.prototype),"destroy",this).call(this),this._bodyCollectionContainer&&this._bodyCollectionContainer.remove();var e=document.querySelector(".ck-body-wrapper");e&&0==e.childElementCount&&e.remove()}}])&&cPe(t.prototype,n),r&&cPe(t,r),i}(rae);n(663);function bPe(e){return(bPe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function vPe(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};return eje(this,i),(n=o.call(this,e)).stickyPanel=new QPe(e),n.toolbar=new yse(e,{shouldGroupWhenFull:r.shouldToolbarGroupWhenFull}),n.editable=new HPe(e,t),n}return t=i,(n=[{key:"render",value:function(){nje(aje(i.prototype),"render",this).call(this),this.stickyPanel.content.add(this.toolbar),this.top.add(this.stickyPanel),this.main.add(this.editable)}}])&&tje(t.prototype,n),r&&tje(t,r),i}(EPe); + */var bje=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&dje(e,t)}(i,e);var t,n,r,o=hje(i);function i(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return cje(this,i),(n=o.call(this,e)).stickyPanel=new lje(e),n.toolbar=new Pse(e,{shouldGroupWhenFull:r.shouldToolbarGroupWhenFull}),n.editable=new QPe(e,t),n}return t=i,(n=[{key:"render",value:function(){pje(mje(i.prototype),"render",this).call(this),this.stickyPanel.content.add(this.toolbar),this.top.add(this.stickyPanel),this.main.add(this.editable)}}])&&fje(t.prototype,n),r&&fje(t,r),i}(zPe); /** * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */function lje(e){return(lje="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function sje(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((function(r){var o=new t(e,n);r(o.initPlugins().then((function(){return o.ui.init(nle(e)?e:null)})).then((function(){if(!nle(e)&&n.initialData)throw new moe.a("editor-create-initial-data",null);var t=n.initialData||bje(e);return o.data.init(t)})).then((function(){return o.fire("ready")})).then((function(){return o})))}))}}],(n=[{key:"destroy",value:function(){return this.sourceElement&&this.updateSourceElement(),this.ui.destroy(),cje(yje(i.prototype),"destroy",this).call(this)}}])&&sje(t.prototype,n),r&&sje(t,r),i}(mke);function bje(e){return nle(e)?(t=e)instanceof HTMLTextAreaElement?t.value:t.innerHTML:e;var t}function vje(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((function(r){var o=new t(e,n);r(o.initPlugins().then((function(){return o.ui.init(ple(e)?e:null)})).then((function(){if(!ple(e)&&n.initialData)throw new joe.a("editor-create-initial-data",null);var t=n.initialData||Eje(e);return o.data.init(t)})).then((function(){return o.fire("ready")})).then((function(){return o})))}))}}],(n=[{key:"destroy",value:function(){return this.sourceElement&&this.updateSourceElement(),this.ui.destroy(),wje(Pje(i.prototype),"destroy",this).call(this)}}])&&gje(t.prototype,n),r&&gje(t,r),i}(jke);function Eje(e){return ple(e)?(t=e)instanceof HTMLTextAreaElement?t.value:t.innerHTML:e;var t}function Cje(e,t){for(var n=0;n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Ije(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function qje(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n(\s+)<\/span>/g,(function(e,t){return 1==t.length?" ":t}))}(i.getData("text/html")):i.getData("text/plain")&&(((o=(o=i.getData("text/plain")).replace(//g,">").replace(/\r?\n\r?\n/g,"

").replace(/\r?\n/g,"
").replace(/^\s/," ").replace(/\s$/," ").replace(/\s\s/g,"  ")).includes("

")||o.includes("
"))&&(o="

".concat(o,"

")),a=o),a=e._htmlDataProcessor.toView(a);var u=new poe(e,"inputTransformation");e.fire(u,{content:a,dataTransfer:i,asPlainText:n.asPlainText}),u.stop.called&&t.stop(),r.scrollToTheSelection()}),{priority:"low"}),this.listenTo(this,"inputTransformation",(function(r,o){if(!o.content.isEmpty){var i=e.editor.data,a=e.editor.model,u=i.toModel(o.content,"$clipboardHolder");if(0==u.childCount)return;if(o.asPlainText||!((s=u).childCount>1)&&0==Fje(s.getChild(0).getAttributeKeys()).length){var l=new Map(Array.from(n.selection.getAttributes()).filter((function(e){return t.model.schema.getAttributeProperties(e[0]).isFormatting})));a.change((function(e){var t,n=function(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=Nje(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}(e.createRangeIn(u).getItems());try{for(n.s();!(t=n.n()).done;){var r=t.value;(r.is("$text")||r.is("$textProxy"))&&e.setAttributes(l,r)}}catch(e){n.e(e)}finally{n.f()}}))}a.insertContent(u),r.stop()}var s}),{priority:"low"}),this.listenTo(o,"copy",i,{priority:"low"}),this.listenTo(o,"cut",(function(e,n){t.isReadOnly?n.preventDefault():i(e,n)}),{priority:"low"}),this.listenTo(o,"clipboardOutput",(function(r,o){o.content.isEmpty||(o.dataTransfer.setData("text/html",e._htmlDataProcessor.toData(o.content)),o.dataTransfer.setData("text/plain",function e(t){var n="";if(t.is("$text")||t.is("$textProxy"))n=t.data;else if(t.is("element","img")&&t.hasAttribute("alt"))n=t.getAttribute("alt");else if(t.is("element","br"))n="\n";else{var r,o=null,i=Lje(t.getChildren());try{for(i.s();!(r=i.n()).done;){var a=r.value,u=e(a);o&&(o.is("containerElement")||a.is("containerElement"))&&(zje.includes(o.name)||zje.includes(a.name)?n+="\n":n+="\n\n"),n+=u,o=a}}catch(e){i.e(e)}finally{i.f()}}return n}(o.content))),"cut"==o.method&&t.model.deleteContent(n.selection)}),{priority:"low"})}}])&&Vje(t.prototype,n),r&&Vje(t,r),i}(Qoe);var Gje=regeneratorRuntime.mark(Qje);function Zje(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Jje(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Jje(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Jje(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n(\s+)<\/span>/g,(function(e,t){return 1==t.length?" ":t}))}(i.getData("text/html")):i.getData("text/plain")&&(((o=(o=i.getData("text/plain")).replace(//g,">").replace(/\r?\n\r?\n/g,"

").replace(/\r?\n/g,"
").replace(/^\s/," ").replace(/\s$/," ").replace(/\s\s/g,"  ")).includes("

")||o.includes("
"))&&(o="

".concat(o,"

")),a=o),a=e._htmlDataProcessor.toView(a);var u=new Ooe(e,"inputTransformation");e.fire(u,{content:a,dataTransfer:i,asPlainText:n.asPlainText}),u.stop.called&&t.stop(),r.scrollToTheSelection()}),{priority:"low"}),this.listenTo(this,"inputTransformation",(function(r,o){if(!o.content.isEmpty){var i=e.editor.data,a=e.editor.model,u=i.toModel(o.content,"$clipboardHolder");if(0==u.childCount)return;if(o.asPlainText||!((s=u).childCount>1)&&0==$je(s.getChild(0).getAttributeKeys()).length){var l=new Map(Array.from(n.selection.getAttributes()).filter((function(e){return t.model.schema.getAttributeProperties(e[0]).isFormatting})));a.change((function(e){var t,n=function(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=Zje(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}(e.createRangeIn(u).getItems());try{for(n.s();!(t=n.n()).done;){var r=t.value;(r.is("$text")||r.is("$textProxy"))&&e.setAttributes(l,r)}}catch(e){n.e(e)}finally{n.f()}}))}a.insertContent(u),r.stop()}var s}),{priority:"low"}),this.listenTo(o,"copy",i,{priority:"low"}),this.listenTo(o,"cut",(function(e,n){t.isReadOnly?n.preventDefault():i(e,n)}),{priority:"low"}),this.listenTo(o,"clipboardOutput",(function(r,o){o.content.isEmpty||(o.dataTransfer.setData("text/html",e._htmlDataProcessor.toData(o.content)),o.dataTransfer.setData("text/plain",function e(t){var n="";if(t.is("$text")||t.is("$textProxy"))n=t.data;else if(t.is("element","img")&&t.hasAttribute("alt"))n=t.getAttribute("alt");else if(t.is("element","br"))n="\n";else{var r,o=null,i=Uje(t.getChildren());try{for(i.s();!(r=i.n()).done;){var a=r.value,u=e(a);o&&(o.is("containerElement")||a.is("containerElement"))&&(Kje.includes(o.name)||Kje.includes(a.name)?n+="\n":n+="\n\n"),n+=u,o=a}}catch(e){i.e(e)}finally{i.f()}}return n}(o.content))),"cut"==o.method&&t.model.deleteContent(n.selection)}),{priority:"low"})}}])&&Xje(t.prototype,n),r&&Xje(t,r),i}(lie);var iEe=regeneratorRuntime.mark(lEe);function aEe(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return uEe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return uEe(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function uEe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1)return!1;var n=t.anchor;if(!n||!e.checkChild(n,"softBreak"))return!1;var r=t.getFirstRange(),o=r.start.parent,i=r.end.parent;return!REe(o,e)&&!REe(i,e)||o===i}(e.schema,t.selection)}}])&&PEe(t.prototype,n),r&&PEe(t,r),i}(tie);function DEe(e,t,n){var r=t.createElement("softBreak");e.insertContent(r,n),t.setSelection(r,"after")}function REe(e,t){return!e.is("rootElement")&&(t.isLimit(e)||REe(e.parent,t))}function MEe(e){return(MEe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function AEe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function LEe(e,t){for(var n=0;n1)return!1;var n=t.anchor;if(!n||!e.checkChild(n,"softBreak"))return!1;var r=t.getFirstRange(),o=r.start.parent,i=r.end.parent;return!HEe(o,e)&&!HEe(i,e)||o===i}(e.schema,t.selection)}}])&&LEe(t.prototype,n),r&&LEe(t,r),i}(fie);function BEe(e,t,n){var r=t.createElement("softBreak");e.insertContent(r,n),t.setSelection(r,"after")}function HEe(e,t){return!e.is("rootElement")&&(t.isLimit(e)||HEe(e.parent,t))}function VEe(e){return(VEe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function WEe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function UEe(e,t){for(var n=0;n',keystroke:"Ctrl+A",tooltip:!0}),o.bind("isOn","isEnabled").to(r,"value","isEnabled"),e.listenTo(o,"execute",(function(){t.execute("selectAll"),t.editing.view.focus()})),o}))}}])&&uCe(t.prototype,n),r&&uCe(t,r),i}(Qoe);function dCe(e){return(dCe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function hCe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function yCe(e,t){for(var n=0;n',keystroke:"Ctrl+A",tooltip:!0}),o.bind("isOn","isEnabled").to(r,"value","isEnabled"),e.listenTo(o,"execute",(function(){t.execute("selectAll"),t.editing.view.focus()})),o}))}}])&&bCe(t.prototype,n),r&&bCe(t,r),i}(lie);function SCe(e){return(SCe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function kCe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function PCe(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:20;_Ce(this,e),this.model=t,this.size=0,this.limit=r,this.isLocked=!1,this._changeCallback=function(e,t){"transparent"!=t.type&&t!==n._batch&&n._reset(!0)},this._selectionChangeCallback=function(){n._reset()},this.model.document.on("change",this._changeCallback),this.model.document.selection.on("change:range",this._selectionChangeCallback),this.model.document.selection.on("change:attribute",this._selectionChangeCallback)}var t,n,r;return t=e,(n=[{key:"input",value:function(e){this.size+=e,this.size>=this.limit&&this._reset(!0)}},{key:"lock",value:function(){this.isLocked=!0}},{key:"unlock",value:function(){this.isLocked=!1}},{key:"destroy",value:function(){this.model.document.off("change",this._changeCallback),this.model.document.selection.off("change:range",this._selectionChangeCallback),this.model.document.selection.off("change:attribute",this._selectionChangeCallback)}},{key:"_reset",value:function(e){this.isLocked&&!e||(this._batch=null,this.size=0)}},{key:"batch",get:function(){return this._batch||(this._batch=this.model.createBatch()),this._batch}}])&&OCe(t.prototype,n),r&&OCe(t,r),e}();function kCe(e){return(kCe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function PCe(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:20;DCe(this,e),this.model=t,this.size=0,this.limit=r,this.isLocked=!1,this._changeCallback=function(e,t){"transparent"!=t.type&&t!==n._batch&&n._reset(!0)},this._selectionChangeCallback=function(){n._reset()},this.model.document.on("change",this._changeCallback),this.model.document.selection.on("change:range",this._selectionChangeCallback),this.model.document.selection.on("change:attribute",this._selectionChangeCallback)}var t,n,r;return t=e,(n=[{key:"input",value:function(e){this.size+=e,this.size>=this.limit&&this._reset(!0)}},{key:"lock",value:function(){this.isLocked=!0}},{key:"unlock",value:function(){this.isLocked=!1}},{key:"destroy",value:function(){this.model.document.off("change",this._changeCallback),this.model.document.selection.off("change:range",this._selectionChangeCallback),this.model.document.selection.off("change:attribute",this._selectionChangeCallback)}},{key:"_reset",value:function(e){this.isLocked&&!e||(this._batch=null,this.size=0)}},{key:"batch",get:function(){return this._batch||(this._batch=this.model.createBatch()),this._batch}}])&&RCe(t.prototype,n),r&&RCe(t,r),e}();function ACe(e){return(ACe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function LCe(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{},n=this.editor.model,r=n.document,o=t.text||"",i=o.length,a=t.range?n.createSelection(t.range):r.selection,u=t.resultRange;n.enqueueChange(this._buffer.batch,(function(t){e._buffer.lock(),e._batches.add(e._buffer.batch),n.deleteContent(a),o&&n.insertContent(t.createText(o,r.selection.getAttributes()),a),u?t.setSelection(u):a.is("documentSelection")||t.setSelection(a),e._buffer.unlock(),e._buffer.input(i)}))}},{key:"buffer",get:function(){return this._buffer}}])&&PCe(t.prototype,n),r&&PCe(t,r),i}(tie); + */var BCe=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&zCe(e,t)}(i,e);var t,n,r,o=FCe(i);function i(e,t){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(n=o.call(this,e))._buffer=new MCe(e.model,t),n._batches=new WeakSet,n}return t=i,(n=[{key:"destroy",value:function(){ICe(NCe(i.prototype),"destroy",this).call(this),this._buffer.destroy()}},{key:"execute",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this.editor.model,r=n.document,o=t.text||"",i=o.length,a=t.range?n.createSelection(t.range):r.selection,u=t.resultRange;n.enqueueChange(this._buffer.batch,(function(t){e._buffer.lock(),e._batches.add(e._buffer.batch),n.deleteContent(a),o&&n.insertContent(t.createText(o,r.selection.getAttributes()),a),u?t.setSelection(u):a.is("documentSelection")||t.setSelection(a),e._buffer.unlock(),e._buffer.input(i)}))}},{key:"buffer",get:function(){return this._buffer}}])&&LCe(t.prototype,n),r&&LCe(t,r),i}(fie); /** * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */for(var RCe=[Eue("arrowUp"),Eue("arrowRight"),Eue("arrowDown"),Eue("arrowLeft"),9,16,17,18,19,20,27,33,34,35,36,45,91,93,144,145,173,174,175,176,177,178,179,255],MCe=112;MCe<=135;MCe++)RCe.push(MCe);function ACe(e){return!!e.ctrlKey||RCe.includes(e.keyCode)} + */for(var HCe=[zue("arrowUp"),zue("arrowRight"),zue("arrowDown"),zue("arrowLeft"),9,16,17,18,19,20,27,33,34,35,36,45,91,93,144,145,173,174,175,176,177,178,179,255],VCe=112;VCe<=135;VCe++)HCe.push(VCe);function WCe(e){return!!e.ctrlKey||HCe.includes(e.keyCode)} /** * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */function LCe(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return ICe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ICe(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function ICe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function qCe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1)){var n=t[0];if(n.values[0]&&n.values[0].is("$text"))return n}}}function FCe(e,t){return e&&e.is("$text")&&t&&t.is("$text")?e.data===t.data:e===t}function YCe(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return NCe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return NCe(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function NCe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1)){var n=t[0];if(n.values[0]&&n.values[0].is("$text"))return n}}}function $Ce(e,t){return e&&e.is("$text")&&t&&t.is("$text")?e.data===t.data:e===t}function GCe(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return ZCe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ZCe(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function ZCe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:{},n=this.editor.model,r=n.document;n.enqueueChange(this._buffer.batch,(function(o){e._buffer.lock();var i=o.createSelection(t.selection||r.selection),a=i.isCollapsed;if(i.isCollapsed&&n.modifySelection(i,{direction:e.direction,unit:t.unit}),e._shouldEntireContentBeReplacedWithParagraph(t.sequence||1))e._replaceEntireContentWithParagraph(o);else if(!i.isCollapsed){var u=0;i.getFirstRange().getMinimalFlatRanges().forEach((function(e){u+=pde(e.getWalker({singleCharacters:!0,ignoreElementEnd:!0,shallow:!0}))})),n.deleteContent(i,{doNotResetEntireContent:a,direction:e.direction}),e._buffer.input(u),o.setSelection(i),e._buffer.unlock()}}))}},{key:"_shouldEntireContentBeReplacedWithParagraph",value:function(e){if(e>1)return!1;var t=this.editor.model,n=t.document.selection,r=t.schema.getLimitElement(n);if(!n.isCollapsed||!n.containsEntireContent(r))return!1;if(!t.schema.checkChild(r,"paragraph"))return!1;var o=r.getChild(0);return!o||"paragraph"!==o.name}},{key:"_replaceEntireContentWithParagraph",value:function(e){var t=this.editor.model,n=t.document.selection,r=t.schema.getLimitElement(n),o=e.createElement("paragraph");e.remove(e.createRangeIn(r)),e.insert(o,r),e.setSelection(o,0)}},{key:"buffer",get:function(){return this._buffer}}])&&exe(t.prototype,n),r&&exe(t,r),i}(tie);function axe(e){return(axe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function uxe(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{},n=this.editor.model,r=n.document;n.enqueueChange(this._buffer.batch,(function(o){e._buffer.lock();var i=o.createSelection(t.selection||r.selection),a=i.isCollapsed;if(i.isCollapsed&&n.modifySelection(i,{direction:e.direction,unit:t.unit}),e._shouldEntireContentBeReplacedWithParagraph(t.sequence||1))e._replaceEntireContentWithParagraph(o);else if(!i.isCollapsed){var u=0;i.getFirstRange().getMinimalFlatRanges().forEach((function(e){u+=Ode(e.getWalker({singleCharacters:!0,ignoreElementEnd:!0,shallow:!0}))})),n.deleteContent(i,{doNotResetEntireContent:a,direction:e.direction}),e._buffer.input(u),o.setSelection(i),e._buffer.unlock()}}))}},{key:"_shouldEntireContentBeReplacedWithParagraph",value:function(e){if(e>1)return!1;var t=this.editor.model,n=t.document.selection,r=t.schema.getLimitElement(n);if(!n.isCollapsed||!n.containsEntireContent(r))return!1;if(!t.schema.checkChild(r,"paragraph"))return!1;var o=r.getChild(0);return!o||"paragraph"!==o.name}},{key:"_replaceEntireContentWithParagraph",value:function(e){var t=this.editor.model,n=t.document.selection,r=t.schema.getLimitElement(n),o=e.createElement("paragraph");e.remove(e.createRangeIn(r)),e.insert(o,r),e.setSelection(o,0)}},{key:"buffer",get:function(){return this._buffer}}])&&cxe(t.prototype,n),r&&cxe(t,r),i}(fie);function mxe(e){return(mxe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function bxe(e,t){for(var n=0;n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function yxe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Pxe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Lxe(e,t){if(e){if("string"==typeof e)return Ixe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ixe(e,t):void 0}}function Ixe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Uxe(e,t){if(e){if("string"==typeof e)return qxe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?qxe(e,t):void 0}}function qxe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:{},r=Yxe(e.constructor,t.constructor);try{return r(e=e.clone(),t,n)}catch(e){throw e}}function Hxe(e,t,n){e=e.slice(),t=t.slice();var r=new Vxe(n.document,n.useRelations,n.forceWeakRemove);r.setOriginalOperations(e),r.setOriginalOperations(t);var o=r.originalOperations;if(0==e.length||0==t.length)return{operationsA:e,operationsB:t,originalOperations:o};var i,a=new WeakMap,u=Axe(e);try{for(u.s();!(i=u.n()).done;){var l=i.value;a.set(l,0)}}catch(e){u.e(e)}finally{u.f()}for(var s={nextBaseVersionA:e[e.length-1].baseVersion+1,nextBaseVersionB:t[t.length-1].baseVersion+1,originalOperationsACount:e.length,originalOperationsBCount:t.length},c=0;c2&&void 0!==arguments[2]&&arguments[2];Dxe(this,e),this.originalOperations=new Map,this._history=t.history,this._useRelations=n,this._forceWeakRemove=!!r,this._relations=new Map}var t,n,r;return t=e,(n=[{key:"setOriginalOperations",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=n?this.originalOperations.get(n):null,o=Axe(e);try{for(o.s();!(t=o.n()).done;){var i=t.value;this.originalOperations.set(i,r||i)}}catch(e){o.e(e)}finally{o.f()}}},{key:"updateRelation",value:function(e,t){switch(e.constructor){case y_e:switch(t.constructor){case oOe:e.targetPosition.isEqual(t.sourcePosition)||t.movedRange.containsPosition(e.targetPosition)?this._setRelation(e,t,"insertAtSource"):e.targetPosition.isEqual(t.deletionPosition)?this._setRelation(e,t,"insertBetween"):e.targetPosition.isAfter(t.sourcePosition)&&this._setRelation(e,t,"moveTargetAfter");break;case y_e:e.targetPosition.isEqual(t.sourcePosition)||e.targetPosition.isBefore(t.sourcePosition)?this._setRelation(e,t,"insertBefore"):this._setRelation(e,t,"insertAfter")}break;case pOe:switch(t.constructor){case oOe:e.splitPosition.isBefore(t.sourcePosition)&&this._setRelation(e,t,"splitBefore");break;case y_e:(e.splitPosition.isEqual(t.sourcePosition)||e.splitPosition.isBefore(t.sourcePosition))&&this._setRelation(e,t,"splitBefore")}break;case oOe:switch(t.constructor){case oOe:e.targetPosition.isEqual(t.sourcePosition)||this._setRelation(e,t,"mergeTargetNotMoved"),e.sourcePosition.isEqual(t.targetPosition)&&this._setRelation(e,t,"mergeSourceNotMoved"),e.sourcePosition.isEqual(t.sourcePosition)&&this._setRelation(e,t,"mergeSameElement");break;case pOe:e.sourcePosition.isEqual(t.splitPosition)&&this._setRelation(e,t,"splitAtSource")}break;case A_e:var n=e.newRange;if(!n)return;switch(t.constructor){case y_e:var r=Dbe._createFromPositionAndShift(t.sourcePosition,t.howMany),o=r.containsPosition(n.start)||r.start.isEqual(n.start),i=r.containsPosition(n.end)||r.end.isEqual(n.end);!o&&!i||r.containsRange(n)||this._setRelation(e,t,{side:o?"left":"right",path:o?n.start.path.slice():n.end.path.slice()});break;case oOe:var a=n.start.isEqual(t.targetPosition),u=n.start.isEqual(t.deletionPosition),l=n.end.isEqual(t.deletionPosition),s=n.end.isEqual(t.sourcePosition);(a||u||l||s)&&this._setRelation(e,t,{wasInLeftElement:a,wasStartBeforeMergedElement:u,wasEndBeforeMergedElement:l,wasInRightElement:s})}}}},{key:"getContext",value:function(e,t,n){return{aIsStrong:n,aWasUndone:this._wasUndone(e),bWasUndone:this._wasUndone(t),abRelation:this._useRelations?this._getRelation(e,t):null,baRelation:this._useRelations?this._getRelation(t,e):null,forceWeakRemove:this._forceWeakRemove}}},{key:"_wasUndone",value:function(e){var t=this.originalOperations.get(e);return t.wasUndone||this._history.isUndoneOperation(t)}},{key:"_getRelation",value:function(e,t){var n=this.originalOperations.get(t),r=this._history.getUndoneOperation(n);if(!r)return null;var o=this.originalOperations.get(e),i=this._relations.get(o);return i&&i.get(r)||null}},{key:"_setRelation",value:function(e,t,n){var r=this.originalOperations.get(e),o=this.originalOperations.get(t),i=this._relations.get(r);i||(i=new Map,this._relations.set(r,i)),i.set(o,n)}}])&&Rxe(t.prototype,n),r&&Rxe(t,r),e}();function Wxe(e,t){var n,r=Axe(e);try{for(r.s();!(n=r.n()).done;){n.value.baseVersion=t++}}catch(e){r.e(e)}finally{r.f()}}function Uxe(e,t){for(var n=0;n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Jxe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:{},r=Gxe(e.constructor,t.constructor);try{return r(e=e.clone(),t,n)}catch(e){throw e}}function Qxe(e,t,n){e=e.slice(),t=t.slice();var r=new Xxe(n.document,n.useRelations,n.forceWeakRemove);r.setOriginalOperations(e),r.setOriginalOperations(t);var o=r.originalOperations;if(0==e.length||0==t.length)return{operationsA:e,operationsB:t,originalOperations:o};var i,a=new WeakMap,u=Wxe(e);try{for(u.s();!(i=u.n()).done;){var l=i.value;a.set(l,0)}}catch(e){u.e(e)}finally{u.f()}for(var s={nextBaseVersionA:e[e.length-1].baseVersion+1,nextBaseVersionB:t[t.length-1].baseVersion+1,originalOperationsACount:e.length,originalOperationsBCount:t.length},c=0;c2&&void 0!==arguments[2]&&arguments[2];Bxe(this,e),this.originalOperations=new Map,this._history=t.history,this._useRelations=n,this._forceWeakRemove=!!r,this._relations=new Map}var t,n,r;return t=e,(n=[{key:"setOriginalOperations",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=n?this.originalOperations.get(n):null,o=Wxe(e);try{for(o.s();!(t=o.n()).done;){var i=t.value;this.originalOperations.set(i,r||i)}}catch(e){o.e(e)}finally{o.f()}}},{key:"updateRelation",value:function(e,t){switch(e.constructor){case P_e:switch(t.constructor){case hOe:e.targetPosition.isEqual(t.sourcePosition)||t.movedRange.containsPosition(e.targetPosition)?this._setRelation(e,t,"insertAtSource"):e.targetPosition.isEqual(t.deletionPosition)?this._setRelation(e,t,"insertBetween"):e.targetPosition.isAfter(t.sourcePosition)&&this._setRelation(e,t,"moveTargetAfter");break;case P_e:e.targetPosition.isEqual(t.sourcePosition)||e.targetPosition.isBefore(t.sourcePosition)?this._setRelation(e,t,"insertBefore"):this._setRelation(e,t,"insertAfter")}break;case OOe:switch(t.constructor){case hOe:e.splitPosition.isBefore(t.sourcePosition)&&this._setRelation(e,t,"splitBefore");break;case P_e:(e.splitPosition.isEqual(t.sourcePosition)||e.splitPosition.isBefore(t.sourcePosition))&&this._setRelation(e,t,"splitBefore")}break;case hOe:switch(t.constructor){case hOe:e.targetPosition.isEqual(t.sourcePosition)||this._setRelation(e,t,"mergeTargetNotMoved"),e.sourcePosition.isEqual(t.targetPosition)&&this._setRelation(e,t,"mergeSourceNotMoved"),e.sourcePosition.isEqual(t.sourcePosition)&&this._setRelation(e,t,"mergeSameElement");break;case OOe:e.sourcePosition.isEqual(t.splitPosition)&&this._setRelation(e,t,"splitAtSource")}break;case W_e:var n=e.newRange;if(!n)return;switch(t.constructor){case P_e:var r=Bbe._createFromPositionAndShift(t.sourcePosition,t.howMany),o=r.containsPosition(n.start)||r.start.isEqual(n.start),i=r.containsPosition(n.end)||r.end.isEqual(n.end);!o&&!i||r.containsRange(n)||this._setRelation(e,t,{side:o?"left":"right",path:o?n.start.path.slice():n.end.path.slice()});break;case hOe:var a=n.start.isEqual(t.targetPosition),u=n.start.isEqual(t.deletionPosition),l=n.end.isEqual(t.deletionPosition),s=n.end.isEqual(t.sourcePosition);(a||u||l||s)&&this._setRelation(e,t,{wasInLeftElement:a,wasStartBeforeMergedElement:u,wasEndBeforeMergedElement:l,wasInRightElement:s})}}}},{key:"getContext",value:function(e,t,n){return{aIsStrong:n,aWasUndone:this._wasUndone(e),bWasUndone:this._wasUndone(t),abRelation:this._useRelations?this._getRelation(e,t):null,baRelation:this._useRelations?this._getRelation(t,e):null,forceWeakRemove:this._forceWeakRemove}}},{key:"_wasUndone",value:function(e){var t=this.originalOperations.get(e);return t.wasUndone||this._history.isUndoneOperation(t)}},{key:"_getRelation",value:function(e,t){var n=this.originalOperations.get(t),r=this._history.getUndoneOperation(n);if(!r)return null;var o=this.originalOperations.get(e),i=this._relations.get(o);return i&&i.get(r)||null}},{key:"_setRelation",value:function(e,t,n){var r=this.originalOperations.get(e),o=this.originalOperations.get(t),i=this._relations.get(r);i||(i=new Map,this._relations.set(r,i)),i.set(o,n)}}])&&Hxe(t.prototype,n),r&&Hxe(t,r),e}();function eTe(e,t){var n,r=Wxe(e);try{for(r.s();!(n=r.n()).done;){n.value.baseVersion=t++}}catch(e){r.e(e)}finally{r.f()}}function tTe(e,t){for(var n=0;n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function uTe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0)return e.sourcePosition=t.moveTargetPosition.clone(),e.targetPosition=e.targetPosition._getTransformedBySplitOperation(t),[e]}return e.sourcePosition.hasSameParentAs(t.splitPosition)&&(e.howMany=t.splitPosition.offset),e.sourcePosition=e.sourcePosition._getTransformedBySplitOperation(t),e.targetPosition=e.targetPosition._getTransformedBySplitOperation(t),[e]})),Fxe(y_e,j_e,(function(e,t){var n=Dbe._createFromPositionAndShift(e.sourcePosition,e.howMany)._getTransformedByInsertOperation(t,!1)[0];return e.sourcePosition=n.start,e.howMany=n.end.offset-n.start.offset,e.targetPosition.isEqual(t.position)||(e.targetPosition=e.targetPosition._getTransformedByInsertOperation(t)),[e]})),Fxe(y_e,y_e,(function(e,t,n){var r,o=Dbe._createFromPositionAndShift(e.sourcePosition,e.howMany),i=Dbe._createFromPositionAndShift(t.sourcePosition,t.howMany),a=n.aIsStrong,u=!n.aIsStrong;if("insertBefore"==n.abRelation||"insertAfter"==n.baRelation?u=!0:"insertAfter"!=n.abRelation&&"insertBefore"!=n.baRelation||(u=!1),r=e.targetPosition.isEqual(t.targetPosition)&&u?e.targetPosition._getTransformedByDeletion(t.sourcePosition,t.howMany):e.targetPosition._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),Kxe(e,t)&&Kxe(t,e))return[t.getReversed()];if(o.containsPosition(t.targetPosition)&&o.containsRange(i,!0))return o.start=o.start._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),o.end=o.end._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),$xe([o],r);if(i.containsPosition(e.targetPosition)&&i.containsRange(o,!0))return o.start=o.start._getCombined(t.sourcePosition,t.getMovedRangeStart()),o.end=o.end._getCombined(t.sourcePosition,t.getMovedRangeStart()),$xe([o],r);var l=Cfe(e.sourcePosition.getParentPath(),t.sourcePosition.getParentPath());if("prefix"==l||"extension"==l)return o.start=o.start._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),o.end=o.end._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),$xe([o],r);"remove"!=e.type||"remove"==t.type||n.aWasUndone||n.forceWeakRemove?"remove"==e.type||"remove"!=t.type||n.bWasUndone||n.forceWeakRemove||(a=!1):a=!0;var s,c=[],f=Axe(o.getDifference(i));try{for(f.s();!(s=f.n()).done;){var p=s.value;p.start=p.start._getTransformedByDeletion(t.sourcePosition,t.howMany),p.end=p.end._getTransformedByDeletion(t.sourcePosition,t.howMany);var d="same"==Cfe(p.start.getParentPath(),t.getMovedRangeStart().getParentPath()),h=p._getTransformedByInsertion(t.getMovedRangeStart(),t.howMany,d);c.push.apply(c,Mxe(h))}}catch(e){f.e(e)}finally{f.f()}var y=o.getIntersection(i);return null!==y&&a&&(y.start=y.start._getCombined(t.sourcePosition,t.getMovedRangeStart()),y.end=y.end._getCombined(t.sourcePosition,t.getMovedRangeStart()),0===c.length?c.push(y):1==c.length?i.start.isBefore(o.start)||i.start.isEqual(o.start)?c.unshift(y):c.push(y):c.splice(1,0,y)),0===c.length?[new dSe(e.baseVersion)]:$xe(c,r)})),Fxe(y_e,pOe,(function(e,t,n){var r=e.targetPosition.clone();e.targetPosition.isEqual(t.insertionPosition)&&t.graveyardPosition&&"moveTargetAfter"!=n.abRelation||(r=e.targetPosition._getTransformedBySplitOperation(t));var o=Dbe._createFromPositionAndShift(e.sourcePosition,e.howMany);if(o.end.isEqual(t.insertionPosition))return t.graveyardPosition||e.howMany++,e.targetPosition=r,[e];if(o.start.hasSameParentAs(t.splitPosition)&&o.containsPosition(t.splitPosition)){var i=new Dbe(t.splitPosition,o.end);return i=i._getTransformedBySplitOperation(t),$xe([new Dbe(o.start,t.splitPosition),i],r)}e.targetPosition.isEqual(t.splitPosition)&&"insertAtSource"==n.abRelation&&(r=t.moveTargetPosition),e.targetPosition.isEqual(t.insertionPosition)&&"insertBetween"==n.abRelation&&(r=e.targetPosition);var a=[o._getTransformedBySplitOperation(t)];if(t.graveyardPosition){var u=o.start.isEqual(t.graveyardPosition)||o.containsPosition(t.graveyardPosition);e.howMany>1&&u&&!n.aWasUndone&&a.push(Dbe._createFromPositionAndShift(t.insertionPosition,1))}return $xe(a,r)})),Fxe(y_e,oOe,(function(e,t,n){var r=Dbe._createFromPositionAndShift(e.sourcePosition,e.howMany);if(t.deletionPosition.hasSameParentAs(e.sourcePosition)&&r.containsPosition(t.sourcePosition))if("remove"!=e.type||n.forceWeakRemove){if(1==e.howMany)return n.bWasUndone?(e.sourcePosition=t.graveyardPosition.clone(),e.targetPosition=e.targetPosition._getTransformedByMergeOperation(t),[e]):[new dSe(0)]}else if(!n.aWasUndone){var o=[],i=t.graveyardPosition.clone(),a=t.targetPosition._getTransformedByMergeOperation(t);e.howMany>1&&(o.push(new y_e(e.sourcePosition,e.howMany-1,e.targetPosition,0)),i=i._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany-1),a=a._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany-1));var u=t.deletionPosition._getCombined(e.sourcePosition,e.targetPosition),l=new y_e(i,1,u,0),s=l.getMovedRangeStart().path.slice();s.push(0);var c=new _be(l.targetPosition.root,s);a=a._getTransformedByMove(i,u,1);var f=new y_e(a,t.howMany,c,0);return o.push(l),o.push(f),o}var p=Dbe._createFromPositionAndShift(e.sourcePosition,e.howMany)._getTransformedByMergeOperation(t);return e.sourcePosition=p.start,e.howMany=p.end.offset-p.start.offset,e.targetPosition=e.targetPosition._getTransformedByMergeOperation(t),[e]})),Fxe(H_e,j_e,(function(e,t){return e.position=e.position._getTransformedByInsertOperation(t),[e]})),Fxe(H_e,oOe,(function(e,t){return e.position.isEqual(t.deletionPosition)?(e.position=t.graveyardPosition.clone(),e.position.stickiness="toNext",[e]):(e.position=e.position._getTransformedByMergeOperation(t),[e])})),Fxe(H_e,y_e,(function(e,t){return e.position=e.position._getTransformedByMoveOperation(t),[e]})),Fxe(H_e,H_e,(function(e,t,n){if(e.position.isEqual(t.position)){if(!n.aIsStrong)return[new dSe(0)];e.oldName=t.newName}return[e]})),Fxe(H_e,pOe,(function(e,t){if("same"==Cfe(e.position.path,t.splitPosition.getParentPath())&&!t.graveyardPosition){var n=new H_e(e.position.getShiftedBy(1),e.oldName,e.newName,0);return[e,n]}return e.position=e.position._getTransformedBySplitOperation(t),[e]})),Fxe(Z_e,Z_e,(function(e,t,n){if(e.root===t.root&&e.key===t.key){if(!n.aIsStrong||e.newValue===t.newValue)return[new dSe(0)];e.oldValue=t.newValue}return[e]})),Fxe(pOe,j_e,(function(e,t){return e.splitPosition.hasSameParentAs(t.position)&&e.splitPosition.offset0}},{key:"addBatch",value:function(e){var t=this.editor.model.document.selection,n={ranges:t.hasOwnRange?Array.from(t.getRanges()):[],isBackward:t.isBackward};this._stack.push({batch:e,selection:n}),this.refresh()}},{key:"clearStack",value:function(){this._stack=[],this.refresh()}},{key:"_restoreSelection",value:function(e,t,n){var r,o=this.editor.model,i=o.document,a=[],u=e.map((function(e){return e.getTransformedByOperations(n)})),l=u.flat(),s=Zxe(u);try{for(s.s();!(r=s.n()).done;){var c=r.value.filter((function(e){return!iTe(e,l)}));oTe(c);var f=c.find((function(e){return e.root!=i.graveyard}));f&&a.push(f)}}catch(e){s.e(e)}finally{s.f()}a.length&&o.change((function(e){e.setSelection(a,{backward:t})}))}},{key:"_undo",value:function(e,t){var n=this.editor.model,r=n.document;this._createdBatches.add(t);var o=e.operations.slice().filter((function(e){return e.isDocumentOperation}));o.reverse();var i,a=Zxe(o);try{for(a.s();!(i=a.n()).done;){var u,l=i.value,s=l.baseVersion+1,c=Array.from(r.history.getOperations(s)),f=Zxe(Hxe([l.getReversed()],c,{useRelations:!0,document:this.editor.model.document,padWithNoOps:!1,forceWeakRemove:!0}).operationsA);try{for(f.s();!(u=f.n()).done;){var p=u.value;t.addOperation(p),n.applyOperation(p),r.history.setOperationAsUndone(l,p)}}catch(e){f.e(e)}finally{f.f()}}}catch(e){a.e(e)}finally{a.f()}}}])&&Qxe(t.prototype,n),r&&Qxe(t,r),i}(tie);function oTe(e){e.sort((function(e,t){return e.start.isBefore(t.start)?-1:1}));for(var t=1;t0)return e.sourcePosition=t.moveTargetPosition.clone(),e.targetPosition=e.targetPosition._getTransformedBySplitOperation(t),[e]}return e.sourcePosition.hasSameParentAs(t.splitPosition)&&(e.howMany=t.splitPosition.offset),e.sourcePosition=e.sourcePosition._getTransformedBySplitOperation(t),e.targetPosition=e.targetPosition._getTransformedBySplitOperation(t),[e]})),$xe(P_e,I_e,(function(e,t){var n=Bbe._createFromPositionAndShift(e.sourcePosition,e.howMany)._getTransformedByInsertOperation(t,!1)[0];return e.sourcePosition=n.start,e.howMany=n.end.offset-n.start.offset,e.targetPosition.isEqual(t.position)||(e.targetPosition=e.targetPosition._getTransformedByInsertOperation(t)),[e]})),$xe(P_e,P_e,(function(e,t,n){var r,o=Bbe._createFromPositionAndShift(e.sourcePosition,e.howMany),i=Bbe._createFromPositionAndShift(t.sourcePosition,t.howMany),a=n.aIsStrong,u=!n.aIsStrong;if("insertBefore"==n.abRelation||"insertAfter"==n.baRelation?u=!0:"insertAfter"!=n.abRelation&&"insertBefore"!=n.baRelation||(u=!1),r=e.targetPosition.isEqual(t.targetPosition)&&u?e.targetPosition._getTransformedByDeletion(t.sourcePosition,t.howMany):e.targetPosition._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),rTe(e,t)&&rTe(t,e))return[t.getReversed()];if(o.containsPosition(t.targetPosition)&&o.containsRange(i,!0))return o.start=o.start._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),o.end=o.end._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),oTe([o],r);if(i.containsPosition(e.targetPosition)&&i.containsRange(o,!0))return o.start=o.start._getCombined(t.sourcePosition,t.getMovedRangeStart()),o.end=o.end._getCombined(t.sourcePosition,t.getMovedRangeStart()),oTe([o],r);var l=Ffe(e.sourcePosition.getParentPath(),t.sourcePosition.getParentPath());if("prefix"==l||"extension"==l)return o.start=o.start._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),o.end=o.end._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),oTe([o],r);"remove"!=e.type||"remove"==t.type||n.aWasUndone||n.forceWeakRemove?"remove"==e.type||"remove"!=t.type||n.bWasUndone||n.forceWeakRemove||(a=!1):a=!0;var s,c=[],f=Wxe(o.getDifference(i));try{for(f.s();!(s=f.n()).done;){var p=s.value;p.start=p.start._getTransformedByDeletion(t.sourcePosition,t.howMany),p.end=p.end._getTransformedByDeletion(t.sourcePosition,t.howMany);var d="same"==Ffe(p.start.getParentPath(),t.getMovedRangeStart().getParentPath()),h=p._getTransformedByInsertion(t.getMovedRangeStart(),t.howMany,d);c.push.apply(c,Vxe(h))}}catch(e){f.e(e)}finally{f.f()}var y=o.getIntersection(i);return null!==y&&a&&(y.start=y.start._getCombined(t.sourcePosition,t.getMovedRangeStart()),y.end=y.end._getCombined(t.sourcePosition,t.getMovedRangeStart()),0===c.length?c.push(y):1==c.length?i.start.isBefore(o.start)||i.start.isEqual(o.start)?c.unshift(y):c.push(y):c.splice(1,0,y)),0===c.length?[new SSe(e.baseVersion)]:oTe(c,r)})),$xe(P_e,OOe,(function(e,t,n){var r=e.targetPosition.clone();e.targetPosition.isEqual(t.insertionPosition)&&t.graveyardPosition&&"moveTargetAfter"!=n.abRelation||(r=e.targetPosition._getTransformedBySplitOperation(t));var o=Bbe._createFromPositionAndShift(e.sourcePosition,e.howMany);if(o.end.isEqual(t.insertionPosition))return t.graveyardPosition||e.howMany++,e.targetPosition=r,[e];if(o.start.hasSameParentAs(t.splitPosition)&&o.containsPosition(t.splitPosition)){var i=new Bbe(t.splitPosition,o.end);return i=i._getTransformedBySplitOperation(t),oTe([new Bbe(o.start,t.splitPosition),i],r)}e.targetPosition.isEqual(t.splitPosition)&&"insertAtSource"==n.abRelation&&(r=t.moveTargetPosition),e.targetPosition.isEqual(t.insertionPosition)&&"insertBetween"==n.abRelation&&(r=e.targetPosition);var a=[o._getTransformedBySplitOperation(t)];if(t.graveyardPosition){var u=o.start.isEqual(t.graveyardPosition)||o.containsPosition(t.graveyardPosition);e.howMany>1&&u&&!n.aWasUndone&&a.push(Bbe._createFromPositionAndShift(t.insertionPosition,1))}return oTe(a,r)})),$xe(P_e,hOe,(function(e,t,n){var r=Bbe._createFromPositionAndShift(e.sourcePosition,e.howMany);if(t.deletionPosition.hasSameParentAs(e.sourcePosition)&&r.containsPosition(t.sourcePosition))if("remove"!=e.type||n.forceWeakRemove){if(1==e.howMany)return n.bWasUndone?(e.sourcePosition=t.graveyardPosition.clone(),e.targetPosition=e.targetPosition._getTransformedByMergeOperation(t),[e]):[new SSe(0)]}else if(!n.aWasUndone){var o=[],i=t.graveyardPosition.clone(),a=t.targetPosition._getTransformedByMergeOperation(t);e.howMany>1&&(o.push(new P_e(e.sourcePosition,e.howMany-1,e.targetPosition,0)),i=i._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany-1),a=a._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany-1));var u=t.deletionPosition._getCombined(e.sourcePosition,e.targetPosition),l=new P_e(i,1,u,0),s=l.getMovedRangeStart().path.slice();s.push(0);var c=new Dbe(l.targetPosition.root,s);a=a._getTransformedByMove(i,u,1);var f=new P_e(a,t.howMany,c,0);return o.push(l),o.push(f),o}var p=Bbe._createFromPositionAndShift(e.sourcePosition,e.howMany)._getTransformedByMergeOperation(t);return e.sourcePosition=p.start,e.howMany=p.end.offset-p.start.offset,e.targetPosition=e.targetPosition._getTransformedByMergeOperation(t),[e]})),$xe(Q_e,I_e,(function(e,t){return e.position=e.position._getTransformedByInsertOperation(t),[e]})),$xe(Q_e,hOe,(function(e,t){return e.position.isEqual(t.deletionPosition)?(e.position=t.graveyardPosition.clone(),e.position.stickiness="toNext",[e]):(e.position=e.position._getTransformedByMergeOperation(t),[e])})),$xe(Q_e,P_e,(function(e,t){return e.position=e.position._getTransformedByMoveOperation(t),[e]})),$xe(Q_e,Q_e,(function(e,t,n){if(e.position.isEqual(t.position)){if(!n.aIsStrong)return[new SSe(0)];e.oldName=t.newName}return[e]})),$xe(Q_e,OOe,(function(e,t){if("same"==Ffe(e.position.path,t.splitPosition.getParentPath())&&!t.graveyardPosition){var n=new Q_e(e.position.getShiftedBy(1),e.oldName,e.newName,0);return[e,n]}return e.position=e.position._getTransformedBySplitOperation(t),[e]})),$xe(aOe,aOe,(function(e,t,n){if(e.root===t.root&&e.key===t.key){if(!n.aIsStrong||e.newValue===t.newValue)return[new SSe(0)];e.oldValue=t.newValue}return[e]})),$xe(OOe,I_e,(function(e,t){return e.splitPosition.hasSameParentAs(t.position)&&e.splitPosition.offset0}},{key:"addBatch",value:function(e){var t=this.editor.model.document.selection,n={ranges:t.hasOwnRange?Array.from(t.getRanges()):[],isBackward:t.isBackward};this._stack.push({batch:e,selection:n}),this.refresh()}},{key:"clearStack",value:function(){this._stack=[],this.refresh()}},{key:"_restoreSelection",value:function(e,t,n){var r,o=this.editor.model,i=o.document,a=[],u=e.map((function(e){return e.getTransformedByOperations(n)})),l=u.flat(),s=aTe(u);try{for(s.s();!(r=s.n()).done;){var c=r.value.filter((function(e){return!yTe(e,l)}));hTe(c);var f=c.find((function(e){return e.root!=i.graveyard}));f&&a.push(f)}}catch(e){s.e(e)}finally{s.f()}a.length&&o.change((function(e){e.setSelection(a,{backward:t})}))}},{key:"_undo",value:function(e,t){var n=this.editor.model,r=n.document;this._createdBatches.add(t);var o=e.operations.slice().filter((function(e){return e.isDocumentOperation}));o.reverse();var i,a=aTe(o);try{for(a.s();!(i=a.n()).done;){var u,l=i.value,s=l.baseVersion+1,c=Array.from(r.history.getOperations(s)),f=aTe(Qxe([l.getReversed()],c,{useRelations:!0,document:this.editor.model.document,padWithNoOps:!1,forceWeakRemove:!0}).operationsA);try{for(f.s();!(u=f.n()).done;){var p=u.value;t.addOperation(p),n.applyOperation(p),r.history.setOperationAsUndone(l,p)}}catch(e){f.e(e)}finally{f.f()}}}catch(e){a.e(e)}finally{a.f()}}}])&&lTe(t.prototype,n),r&&lTe(t,r),i}(fie);function hTe(e){e.sort((function(e,t){return e.start.isBefore(t.start)?-1:1}));for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:null,n=t?this._stack.findIndex((function(e){return e.batch==t})):this._stack.length-1,r=this._stack.splice(n,1)[0],o=this.editor.model.createBatch("transparent");this.editor.model.enqueueChange(o,(function(){e._undo(r.batch,o);var t=e.editor.model.document.history.getOperations(r.batch.baseVersion);e._restoreSelection(r.selection.ranges,r.selection.isBackward,t),e.fire("revert",r.batch,o)})),this.refresh()}}])&&lTe(t.prototype,n),r&&lTe(t,r),i}(rTe);function hTe(e){return(hTe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function yTe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function mTe(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:null,n=t?this._stack.findIndex((function(e){return e.batch==t})):this._stack.length-1,r=this._stack.splice(n,1)[0],o=this.editor.model.createBatch("transparent");this.editor.model.enqueueChange(o,(function(){e._undo(r.batch,o);var t=e.editor.model.document.history.getOperations(r.batch.baseVersion);e._restoreSelection(r.selection.ranges,r.selection.isBackward,t),e.fire("revert",r.batch,o)})),this.refresh()}}])&&vTe(t.prototype,n),r&&vTe(t,r),i}(dTe);function kTe(e){return(kTe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function PTe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function jTe(e,t){for(var n=0;n',DTe='';function RTe(e){return(RTe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function MTe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ATe(e,t){for(var n=0;n',BTe='';function HTe(e){return(HTe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function VTe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function WTe(e,t){for(var n=0;n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function oDe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function hDe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:{},t=this.editor.model,n=t.document;t.change((function(r){var o,i=rDe((e.selection||n.selection).getSelectedBlocks());try{for(i.s();!(o=i.n()).done;){var a=o.value;!a.is("element","paragraph")&&pDe(a,t.schema)&&r.rename(a,"paragraph")}}catch(e){i.e(e)}finally{i.f()}}))}}])&&aDe(t.prototype,n),r&&aDe(t,r),i}(tie);function pDe(e,t){return t.checkChild(e.parent,"paragraph")&&!t.isObject(e)}function dDe(e){return(dDe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function hDe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function yDe(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{},t=this.editor.model,n=t.document;t.change((function(r){var o,i=dDe((e.selection||n.selection).getSelectedBlocks());try{for(i.s();!(o=i.n()).done;){var a=o.value;!a.is("element","paragraph")&&ODe(a,t.schema)&&r.rename(a,"paragraph")}}catch(e){i.e(e)}finally{i.f()}}))}}])&&mDe(t.prototype,n),r&&mDe(t,r),i}(fie);function ODe(e,t){return t.checkChild(e.parent,"paragraph")&&!t.isObject(e)}function SDe(e){return(SDe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function kDe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function PDe(e,t){for(var n=0;n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function DDe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function BDe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function BDe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function JDe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function QDe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function lRe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n',keystroke:"CTRL+I",tooltip:!0,isToggleable:!0}),i.bind("isOn","isEnabled").to(o,"value","isEnabled"),e.listenTo(i,"execute",(function(){t.execute("italic"),t.editing.view.focus()})),i}))}}])&&kRe(t.prototype,n),r&&kRe(t,r),i}(Qoe);function TRe(e){return(TRe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function DRe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function RRe(e,t){for(var n=0;n',keystroke:"CTRL+I",tooltip:!0,isToggleable:!0}),i.bind("isOn","isEnabled").to(o,"value","isEnabled"),e.listenTo(i,"execute",(function(){t.execute("italic"),t.editing.view.focus()})),i}))}}])&&ARe(t.prototype,n),r&&ARe(t,r),i}(lie);function NRe(e){return(NRe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function BRe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function HRe(e,t){for(var n=0;n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function NRe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function ZRe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=n;)i>o.getAttribute("listIndent")&&(i=o.getAttribute("listIndent")),o.getAttribute("listIndent")==i&&e[t?"unshift":"push"](o),o=o[t?"previousSibling":"nextSibling"]}function $Re(e,t){return t.checkChild(e.parent,"listItem")&&!t.isObject(e)}function GRe(e){return(GRe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ZRe(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return JRe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return JRe(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function JRe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=n;)i>o.getAttribute("listIndent")&&(i=o.getAttribute("listIndent")),o.getAttribute("listIndent")==i&&e[t?"unshift":"push"](o),o=o[t?"previousSibling":"nextSibling"]}function oMe(e,t){return t.checkChild(e.parent,"listItem")&&!t.isObject(e)}function iMe(e){return(iMe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function aMe(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return uMe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return uMe(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function uMe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);nn.getAttribute("listIndent");)r.push(o),o=o.nextSibling;e._indentBy<0&&(r=r.reverse());var i,a=ZRe(r);try{for(a.s();!(i=a.n()).done;){var u=i.value,l=u.getAttribute("listIndent")+e._indentBy;l<0?t.rename(u,"paragraph"):t.setAttribute("listIndent",l,u)}}catch(e){a.e(e)}finally{a.f()}e.fire("_executeCleanup",r)}))}},{key:"_checkEnabled",value:function(){var e=rie(this.editor.model.document.selection.getSelectedBlocks());if(!e||!e.is("element","listItem"))return!1;if(this._indentBy>0){for(var t=e.getAttribute("listIndent"),n=e.getAttribute("listType"),r=e.previousSibling;r&&r.is("element","listItem")&&r.getAttribute("listIndent")>=t;){if(r.getAttribute("listIndent")==t)return r.getAttribute("listType")==n;r=r.previousSibling}return!1}return!0}}])&&QRe(t.prototype,n),r&&QRe(t,r),i}(tie);function oMe(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=iMe(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function iMe(e,t){if(e){if("string"==typeof e)return aMe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?aMe(e,t):void 0}}function aMe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);nn.getAttribute("listIndent");)r.push(o),o=o.nextSibling;e._indentBy<0&&(r=r.reverse());var i,a=aMe(r);try{for(a.s();!(i=a.n()).done;){var u=i.value,l=u.getAttribute("listIndent")+e._indentBy;l<0?t.rename(u,"paragraph"):t.setAttribute("listIndent",l,u)}}catch(e){a.e(e)}finally{a.f()}e.fire("_executeCleanup",r)}))}},{key:"_checkEnabled",value:function(){var e=die(this.editor.model.document.selection.getSelectedBlocks());if(!e||!e.is("element","listItem"))return!1;if(this._indentBy>0){for(var t=e.getAttribute("listIndent"),n=e.getAttribute("listType"),r=e.previousSibling;r&&r.is("element","listItem")&&r.getAttribute("listIndent")>=t;){if(r.getAttribute("listIndent")==t)return r.getAttribute("listType")==n;r=r.previousSibling}return!1}return!0}}])&&lMe(t.prototype,n),r&&lMe(t,r),i}(fie);function hMe(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=yMe(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function yMe(e,t){if(e){if("string"==typeof e)return mMe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?mMe(e,t):void 0}}function mMe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.getAttribute("listIndent")))break;S=P}}catch(e){k.e(e)}finally{k.f()}S&&(a.breakContainer(a.createPositionAfter(S)),a.move(a.createRangeOn(S.parent),a.createPositionAt(t,"end")))}}sMe(a,o,o.nextSibling),sMe(a,o.previousSibling,o)}function sMe(e,t,n){return!t||!n||"ul"!=t.name&&"ol"!=t.name||t.name!=n.name||t.getAttribute("class")!==n.getAttribute("class")?null:e.mergeContainers(e.createPositionAfter(t))}function cMe(e){return e.getLastMatchingPosition((function(e){return e.item.is("uiElement")}))}function fMe(e,t){for(var n=!!t.sameIndent,r=!!t.smallerIndent,o=t.listIndent,i=e;i&&"listItem"==i.name;){var a=i.getAttribute("listIndent");if(n&&o==a||r&&o>a)return i;i="forward"===t.direction?i.nextSibling:i.previousSibling}return null}function pMe(e,t,n,r){e.ui.componentFactory.add(t,(function(o){var i=e.commands.get(t),a=new Hue(o);return a.set({label:n,icon:r,tooltip:!0,isToggleable:!0}),a.bind("isOn","isEnabled").to(i,"value","isEnabled"),a.on("execute",(function(){e.execute(t),e.editing.view.focus()})),a}))}function dMe(){var e=!this.isEmpty&&("ul"==this.getChild(0).name||"ol"==this.getChild(0).name);return this.isEmpty||e?0:Ipe.call(this)}function hMe(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n}(e,t)||bMe(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function yMe(e){return function(e){if(Array.isArray(e))return vMe(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||bMe(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function mMe(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=bMe(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function bMe(e,t){if(e){if("string"==typeof e)return vMe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?vMe(e,t):void 0}}function vMe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.getAttribute("listIndent")))break;S=P}}catch(e){k.e(e)}finally{k.f()}S&&(a.breakContainer(a.createPositionAfter(S)),a.move(a.createRangeOn(S.parent),a.createPositionAt(t,"end")))}}gMe(a,o,o.nextSibling),gMe(a,o.previousSibling,o)}function gMe(e,t,n){return!t||!n||"ul"!=t.name&&"ol"!=t.name||t.name!=n.name||t.getAttribute("class")!==n.getAttribute("class")?null:e.mergeContainers(e.createPositionAfter(t))}function wMe(e){return e.getLastMatchingPosition((function(e){return e.item.is("uiElement")}))}function _Me(e,t){for(var n=!!t.sameIndent,r=!!t.smallerIndent,o=t.listIndent,i=e;i&&"listItem"==i.name;){var a=i.getAttribute("listIndent");if(n&&o==a||r&&o>a)return i;i="forward"===t.direction?i.nextSibling:i.previousSibling}return null}function OMe(e,t,n,r){e.ui.componentFactory.add(t,(function(o){var i=e.commands.get(t),a=new Que(o);return a.set({label:n,icon:r,tooltip:!0,isToggleable:!0}),a.bind("isOn","isEnabled").to(i,"value","isEnabled"),a.on("execute",(function(){e.execute(t),e.editing.view.focus()})),a}))}function SMe(){var e=!this.isEmpty&&("ul"==this.getChild(0).name||"ol"==this.getChild(0).name);return this.isEmpty||e?0:qpe.call(this)}function kMe(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n}(e,t)||EMe(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function PMe(e){return function(e){if(Array.isArray(e))return CMe(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||EMe(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function jMe(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=EMe(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function EMe(e,t){if(e){if("string"==typeof e)return CMe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?CMe(e,t):void 0}}function CMe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0){for(var s=0;s0){var f=sMe(o,c,c.nextSibling);f&&f.parent==c&&r.offset--}}sMe(o,r.nodeBefore,r.nodeAfter)}}}function SMe(e,t,n){var r=n.mapper.toViewPosition(t.position),o=r.nodeBefore,i=r.nodeAfter;sMe(n.writer,o,i)}function kMe(e,t,n){if(n.consumable.consume(t.viewItem,{name:!0})){var r=n.writer,o=r.createElement("listItem"),i=function(e){var t=0,n=e.parent;for(;n;){if(n.is("element","li"))t++;else{var r=n.previousSibling;r&&r.is("element","li")&&t++}n=n.parent}return t}(t.viewItem);r.setAttribute("listIndent",i,o);var a=t.viewItem.parent&&"ol"==t.viewItem.parent.name?"numbered":"bulleted";if(r.setAttribute("listType",a,o),!n.safeInsert(o,t.modelCursor))return;var u=function(e,t,n){var r,o=n.writer,i=n.schema,a=o.createPositionAfter(e),u=mMe(t);try{for(u.s();!(r=u.n()).done;){var l=r.value;if("ul"==l.name||"ol"==l.name)a=n.convertItem(l,a).modelCursor;else{var s=n.convertItem(l,o.createPositionAt(e,"end")),c=s.modelRange.start.nodeAfter;c&&c.is("element")&&!i.checkChild(e,c.name)&&(e=s.modelCursor.parent.is("element","listItem")?s.modelCursor.parent:xMe(s.modelCursor),a=o.createPositionAfter(e))}}}catch(e){u.e(e)}finally{u.f()}return a}(o,t.viewItem.getChildren(),n);t.modelRange=r.createRange(t.modelCursor,u),n.updateConversionResult(o,t)}}function PMe(e,t,n){if(n.consumable.test(t.viewItem,{name:!0}))for(var r=0,o=Array.from(t.viewItem.getChildren());r0)for(;a&&a.is("element","listItem");)a._setAttribute("listIndent",a.getAttribute("listIndent")+s),a=a.nextSibling}}}function xMe(e){var t,n=new ybe({startPosition:e});do{t=n.next()}while(!t.value.item.is("element","listItem"));return t.value.item}function TMe(e,t,n,r,o,i){var a,u=fMe(t.nodeBefore,{sameIndent:!0,smallerIndent:!0,listIndent:e,foo:"b"}),l=o.mapper,s=o.writer,c=u?u.getAttribute("listIndent"):null;if(u)if(c==e){var f=l.toViewElement(u).parent;a=s.createPositionAfter(f)}else{var p=i.createPositionAt(u,"end");a=l.toViewPosition(p)}else a=n;a=cMe(a);for(var d=0,h=yMe(r.getChildren());d=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function MMe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0){for(var s=0;s0){var f=gMe(o,c,c.nextSibling);f&&f.parent==c&&r.offset--}}gMe(o,r.nodeBefore,r.nodeAfter)}}}function MMe(e,t,n){var r=n.mapper.toViewPosition(t.position),o=r.nodeBefore,i=r.nodeAfter;gMe(n.writer,o,i)}function AMe(e,t,n){if(n.consumable.consume(t.viewItem,{name:!0})){var r=n.writer,o=r.createElement("listItem"),i=function(e){var t=0,n=e.parent;for(;n;){if(n.is("element","li"))t++;else{var r=n.previousSibling;r&&r.is("element","li")&&t++}n=n.parent}return t}(t.viewItem);r.setAttribute("listIndent",i,o);var a=t.viewItem.parent&&"ol"==t.viewItem.parent.name?"numbered":"bulleted";if(r.setAttribute("listType",a,o),!n.safeInsert(o,t.modelCursor))return;var u=function(e,t,n){var r,o=n.writer,i=n.schema,a=o.createPositionAfter(e),u=jMe(t);try{for(u.s();!(r=u.n()).done;){var l=r.value;if("ul"==l.name||"ol"==l.name)a=n.convertItem(l,a).modelCursor;else{var s=n.convertItem(l,o.createPositionAt(e,"end")),c=s.modelRange.start.nodeAfter;c&&c.is("element")&&!i.checkChild(e,c.name)&&(e=s.modelCursor.parent.is("element","listItem")?s.modelCursor.parent:YMe(s.modelCursor),a=o.createPositionAfter(e))}}}catch(e){u.e(e)}finally{u.f()}return a}(o,t.viewItem.getChildren(),n);t.modelRange=r.createRange(t.modelCursor,u),n.updateConversionResult(o,t)}}function LMe(e,t,n){if(n.consumable.test(t.viewItem,{name:!0}))for(var r=0,o=Array.from(t.viewItem.getChildren());r0)for(;a&&a.is("element","listItem");)a._setAttribute("listIndent",a.getAttribute("listIndent")+s),a=a.nextSibling}}}function YMe(e){var t,n=new Pbe({startPosition:e});do{t=n.next()}while(!t.value.item.is("element","listItem"));return t.value.item}function NMe(e,t,n,r,o,i){var a,u=_Me(t.nodeBefore,{sameIndent:!0,smallerIndent:!0,listIndent:e,foo:"b"}),l=o.mapper,s=o.writer,c=u?u.getAttribute("listIndent"):null;if(u)if(c==e){var f=l.toViewElement(u).parent;a=s.createPositionAfter(f)}else{var p=i.createPositionAt(u,"end");a=l.toViewPosition(p)}else a=n;a=wMe(a);for(var d=0,h=PMe(r.getChildren());d=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function VMe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);nn){var a=void 0;null===r?(r=o-n,a=n):(r>o&&(r=o),a=o-r),t.setAttribute("listIndent",a,e),i=!0}else r=null,n=e.getAttribute("listIndent")+1;e=e.nextSibling}}function m(e){for(var n=[],r=null;e&&e.is("element","listItem");){var o=e.getAttribute("listIndent");if(r&&r.getAttribute("listIndent")>o&&(n=n.slice(0,o+1)),0!=o)if(n[o]){var a=n[o];e.getAttribute("listType")!=a&&(t.setAttribute("listType",a,e),i=!0)}else n[o]=e.getAttribute("listType");r=e,e=e.nextSibling}}}(t.model,e)})),o.mapper.registerViewToModelLength("li",HMe),r.mapper.registerViewToModelLength("li",HMe),o.mapper.on("modelToViewPosition",EMe(o.view)),o.mapper.on("viewToModelPosition",(n=t.model,function(e,t){var r=t.viewPosition,o=r.parent,i=t.mapper;if("ul"==o.name||"ol"==o.name){if(r.isAtEnd){var a=i.toModelElement(r.nodeBefore),u=i.getModelLength(r.nodeBefore);t.modelPosition=n.createPositionBefore(a).getShiftedBy(u)}else{var l=i.toModelElement(r.nodeAfter);t.modelPosition=n.createPositionBefore(l)}e.stop()}else if("li"==o.name&&r.nodeBefore&&("ul"==r.nodeBefore.name||"ol"==r.nodeBefore.name)){for(var s=i.toModelElement(o),c=1,f=r.nodeBefore;f&&DMe(f);)c+=i.getModelLength(f),f=f.previousSibling;t.modelPosition=n.createPositionBefore(s).getShiftedBy(c),e.stop()}})),r.mapper.on("modelToViewPosition",EMe(o.view)),t.conversion.for("editingDowncast").add((function(e){e.on("insert",OMe,{priority:"high"}),e.on("insert:listItem",gMe(t.model)),e.on("attribute:listType:listItem",wMe,{priority:"high"}),e.on("attribute:listType:listItem",_Me,{priority:"low"}),e.on("attribute:listIndent:listItem",function(e){return function(t,n,r){if(r.consumable.consume(n.item,"attribute:listIndent")){var o=r.mapper.toViewElement(n.item),i=r.writer;i.breakContainer(i.createPositionBefore(o)),i.breakContainer(i.createPositionAfter(o));var a=o.parent,u=a.previousSibling,l=i.createRangeOn(a);i.remove(l),u&&u.nextSibling&&sMe(i,u,u.nextSibling),TMe(n.attributeOldValue+1,n.range.start,l.start,o,r,e),lMe(n.item,o,r,e);var s,c=mMe(n.item.getChildren());try{for(c.s();!(s=c.n()).done;){var f=s.value;r.consumable.consume(f,"insert")}}catch(e){c.e(e)}finally{c.f()}}}}(t.model)),e.on("remove:listItem",function(e){return function(t,n,r){var o=r.mapper.toViewPosition(n.position).getLastMatchingPosition((function(e){return!e.item.is("element","li")})).nodeAfter,i=r.writer;i.breakContainer(i.createPositionBefore(o)),i.breakContainer(i.createPositionAfter(o));var a=o.parent,u=a.previousSibling,l=i.createRangeOn(a),s=i.remove(l);u&&u.nextSibling&&sMe(i,u,u.nextSibling),TMe(r.mapper.toModelElement(o).getAttribute("listIndent")+1,n.position,l.start,o,r,e);var c,f=mMe(i.createRangeIn(s).getItems());try{for(f.s();!(c=f.n()).done;){var p=c.value;r.mapper.unbindViewElement(p)}}catch(e){f.e(e)}finally{f.f()}t.stop()}}(t.model)),e.on("remove",SMe,{priority:"low"})})),t.conversion.for("dataDowncast").add((function(e){e.on("insert",OMe,{priority:"high"}),e.on("insert:listItem",gMe(t.model))})),t.conversion.for("upcast").add((function(e){e.on("element:ul",PMe,{priority:"high"}),e.on("element:ol",PMe,{priority:"high"}),e.on("element:li",jMe,{priority:"high"}),e.on("element:li",kMe)})),t.model.on("insertContent",CMe,{priority:"high"}),t.commands.add("numberedList",new qRe(t,"numbered")),t.commands.add("bulletedList",new qRe(t,"bulleted")),t.commands.add("indentList",new rMe(t,"forward")),t.commands.add("outdentList",new rMe(t,"backward"));var i=o.view.document;this.listenTo(i,"enter",(function(t,n){var r=e.editor.model.document,o=r.selection.getLastPosition().parent;r.selection.isCollapsed&&"listItem"==o.name&&o.isEmpty&&(e.editor.execute("outdentList"),n.preventDefault(),t.stop())})),this.listenTo(i,"delete",(function(t,n){if("backward"===n.direction){var r=e.editor.model.document.selection;if(r.isCollapsed){var o=r.getFirstPosition();if(o.isAtStart){var i=o.parent;"listItem"===i.name&&(i.previousSibling&&"listItem"===i.previousSibling.name||(e.editor.execute("outdentList"),n.preventDefault(),t.stop()))}}}}),{priority:"high"});var a=function(t){return function(n,r){e.editor.commands.get(t).isEnabled&&(e.editor.execute(t),r())}};t.keystrokes.set("Tab",a("indentList")),t.keystrokes.set("Shift+Tab",a("outdentList"))}},{key:"afterInit",value:function(){var e=this.editor.commands,t=e.get("indent"),n=e.get("outdent");t&&t.registerChildCommand(e.get("indentList")),n&&n.registerChildCommand(e.get("outdentList"))}}])&&IMe(t.prototype,n),r&&IMe(t,r),i}(Qoe);function HMe(e){var t,n=1,r=RMe(e.getChildren());try{for(r.s();!(t=r.n()).done;){var o=t.value;if("ul"==o.name||"ol"==o.name){var i,a=RMe(o.getChildren());try{for(a.s();!(i=a.n()).done;){n+=HMe(i.value)}}catch(e){a.e(e)}finally{a.f()}}}}catch(e){r.e(e)}finally{r.f()}return n}function VMe(e){return(VMe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function WMe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function UMe(e,t){for(var n=0;nn){var a=void 0;null===r?(r=o-n,a=n):(r>o&&(r=o),a=o-r),t.setAttribute("listIndent",a,e),i=!0}else r=null,n=e.getAttribute("listIndent")+1;e=e.nextSibling}}function m(e){for(var n=[],r=null;e&&e.is("element","listItem");){var o=e.getAttribute("listIndent");if(r&&r.getAttribute("listIndent")>o&&(n=n.slice(0,o+1)),0!=o)if(n[o]){var a=n[o];e.getAttribute("listType")!=a&&(t.setAttribute("listType",a,e),i=!0)}else n[o]=e.getAttribute("listType");r=e,e=e.nextSibling}}}(t.model,e)})),o.mapper.registerViewToModelLength("li",QMe),r.mapper.registerViewToModelLength("li",QMe),o.mapper.on("modelToViewPosition",zMe(o.view)),o.mapper.on("viewToModelPosition",(n=t.model,function(e,t){var r=t.viewPosition,o=r.parent,i=t.mapper;if("ul"==o.name||"ol"==o.name){if(r.isAtEnd){var a=i.toModelElement(r.nodeBefore),u=i.getModelLength(r.nodeBefore);t.modelPosition=n.createPositionBefore(a).getShiftedBy(u)}else{var l=i.toModelElement(r.nodeAfter);t.modelPosition=n.createPositionBefore(l)}e.stop()}else if("li"==o.name&&r.nodeBefore&&("ul"==r.nodeBefore.name||"ol"==r.nodeBefore.name)){for(var s=i.toModelElement(o),c=1,f=r.nodeBefore;f&&BMe(f);)c+=i.getModelLength(f),f=f.previousSibling;t.modelPosition=n.createPositionBefore(s).getShiftedBy(c),e.stop()}})),r.mapper.on("modelToViewPosition",zMe(o.view)),t.conversion.for("editingDowncast").add((function(e){e.on("insert",RMe,{priority:"high"}),e.on("insert:listItem",xMe(t.model)),e.on("attribute:listType:listItem",TMe,{priority:"high"}),e.on("attribute:listType:listItem",DMe,{priority:"low"}),e.on("attribute:listIndent:listItem",function(e){return function(t,n,r){if(r.consumable.consume(n.item,"attribute:listIndent")){var o=r.mapper.toViewElement(n.item),i=r.writer;i.breakContainer(i.createPositionBefore(o)),i.breakContainer(i.createPositionAfter(o));var a=o.parent,u=a.previousSibling,l=i.createRangeOn(a);i.remove(l),u&&u.nextSibling&&gMe(i,u,u.nextSibling),NMe(n.attributeOldValue+1,n.range.start,l.start,o,r,e),vMe(n.item,o,r,e);var s,c=jMe(n.item.getChildren());try{for(c.s();!(s=c.n()).done;){var f=s.value;r.consumable.consume(f,"insert")}}catch(e){c.e(e)}finally{c.f()}}}}(t.model)),e.on("remove:listItem",function(e){return function(t,n,r){var o=r.mapper.toViewPosition(n.position).getLastMatchingPosition((function(e){return!e.item.is("element","li")})).nodeAfter,i=r.writer;i.breakContainer(i.createPositionBefore(o)),i.breakContainer(i.createPositionAfter(o));var a=o.parent,u=a.previousSibling,l=i.createRangeOn(a),s=i.remove(l);u&&u.nextSibling&&gMe(i,u,u.nextSibling),NMe(r.mapper.toModelElement(o).getAttribute("listIndent")+1,n.position,l.start,o,r,e);var c,f=jMe(i.createRangeIn(s).getItems());try{for(f.s();!(c=f.n()).done;){var p=c.value;r.mapper.unbindViewElement(p)}}catch(e){f.e(e)}finally{f.f()}t.stop()}}(t.model)),e.on("remove",MMe,{priority:"low"})})),t.conversion.for("dataDowncast").add((function(e){e.on("insert",RMe,{priority:"high"}),e.on("insert:listItem",xMe(t.model))})),t.conversion.for("upcast").add((function(e){e.on("element:ul",LMe,{priority:"high"}),e.on("element:ol",LMe,{priority:"high"}),e.on("element:li",IMe,{priority:"high"}),e.on("element:li",AMe)})),t.model.on("insertContent",FMe,{priority:"high"}),t.commands.add("numberedList",new nMe(t,"numbered")),t.commands.add("bulletedList",new nMe(t,"bulleted")),t.commands.add("indentList",new dMe(t,"forward")),t.commands.add("outdentList",new dMe(t,"backward"));var i=o.view.document;this.listenTo(i,"enter",(function(t,n){var r=e.editor.model.document,o=r.selection.getLastPosition().parent;r.selection.isCollapsed&&"listItem"==o.name&&o.isEmpty&&(e.editor.execute("outdentList"),n.preventDefault(),t.stop())})),this.listenTo(i,"delete",(function(t,n){if("backward"===n.direction){var r=e.editor.model.document.selection;if(r.isCollapsed){var o=r.getFirstPosition();if(o.isAtStart){var i=o.parent;"listItem"===i.name&&(i.previousSibling&&"listItem"===i.previousSibling.name||(e.editor.execute("outdentList"),n.preventDefault(),t.stop()))}}}}),{priority:"high"});var a=function(t){return function(n,r){e.editor.commands.get(t).isEnabled&&(e.editor.execute(t),r())}};t.keystrokes.set("Tab",a("indentList")),t.keystrokes.set("Shift+Tab",a("outdentList"))}},{key:"afterInit",value:function(){var e=this.editor.commands,t=e.get("indent"),n=e.get("outdent");t&&t.registerChildCommand(e.get("indentList")),n&&n.registerChildCommand(e.get("outdentList"))}}])&&qMe(t.prototype,n),r&&qMe(t,r),i}(lie);function QMe(e){var t,n=1,r=HMe(e.getChildren());try{for(r.s();!(t=r.n()).done;){var o=t.value;if("ul"==o.name||"ol"==o.name){var i,a=HMe(o.getChildren());try{for(a.s();!(i=a.n()).done;){n+=QMe(i.value)}}catch(e){a.e(e)}finally{a.f()}}}}catch(e){r.e(e)}finally{r.f()}return n}function XMe(e){return(XMe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function eAe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function tAe(e,t){for(var n=0;n'),pMe(this.editor,"bulletedList",e("Bulleted List"),'')}}])&&UMe(t.prototype,n),r&&UMe(t,r),i}(Qoe);function JMe(e){return(JMe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function QMe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function XMe(e,t){for(var n=0;n'),OMe(this.editor,"bulletedList",e("Bulleted List"),'')}}])&&tAe(t.prototype,n),r&&tAe(t,r),i}(lie);function uAe(e){return(uAe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function lAe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function sAe(e,t){for(var n=0;n',keystroke:"CTRL+SHIFT+X",tooltip:!0,isToggleable:!0}),i.bind("isOn","isEnabled").to(o,"value","isEnabled"),e.listenTo(i,"execute",(function(){t.execute("strikethrough"),t.editing.view.focus()})),i}))}}])&&yAe(t.prototype,n),r&&yAe(t,r),i}(Qoe);function _Ae(e){return(_Ae="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function OAe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function SAe(e,t){for(var n=0;n',keystroke:"CTRL+SHIFT+X",tooltip:!0,isToggleable:!0}),i.bind("isOn","isEnabled").to(o,"value","isEnabled"),e.listenTo(i,"execute",(function(){t.execute("strikethrough"),t.editing.view.focus()})),i}))}}])&&PAe(t.prototype,n),r&&PAe(t,r),i}(lie);function DAe(e){return(DAe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function RAe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function MAe(e,t){for(var n=0;n',keystroke:"CTRL+U",tooltip:!0,isToggleable:!0}),i.bind("isOn","isEnabled").to(o,"value","isEnabled"),e.listenTo(i,"execute",(function(){t.execute("underline"),t.editing.view.focus()})),i}))}}])&&YAe(t.prototype,n),r&&YAe(t,r),i}(Qoe);function UAe(e){return(UAe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function qAe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function KAe(e,t){for(var n=0;n',keystroke:"CTRL+U",tooltip:!0,isToggleable:!0}),i.bind("isOn","isEnabled").to(o,"value","isEnabled"),e.listenTo(i,"execute",(function(){t.execute("underline"),t.editing.view.focus()})),i}))}}])&&GAe(t.prototype,n),r&&GAe(t,r),i}(lie);function tLe(e){return(tLe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function nLe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rLe(e,t){for(var n=0;n4&&void 0!==arguments[4]?arguments[4]:1;t>o?r.setAttribute(e,t,n):r.removeAttribute(e,n)}function eLe(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=e.createElement("tableCell",n);return e.insertElement("paragraph",r),e.insert(r,t),r}function tLe(e,t){var n=t.parent.parent,r=parseInt(n.getAttribute("headingColumns")||0),o=e.getCellLocation(t).column;return!!r&&o=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function rLe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n4&&void 0!==arguments[4]?arguments[4]:1;t>o?r.setAttribute(e,t,n):r.removeAttribute(e,n)}function cLe(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=e.createElement("tableCell",n);return e.insertElement("paragraph",r),e.insert(r,t),r}function fLe(e,t){var n=t.parent.parent,r=parseInt(n.getAttribute("headingColumns")||0),o=e.getCellLocation(t).column;return!!r&&o=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function dLe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);nn.headingColumns&&(n.headingColumns=f)}}}catch(e){s.e(e)}finally{s.f()}}}return n.rows=[].concat(r,o),n}(r),i=o.rows,a=o.headingRows,u=o.headingColumns,l={};u&&(l.headingColumns=u),a&&(l.headingRows=a);var s=n.writer.createElement("table",l);if(n.safeInsert(s,t.modelCursor)){if(n.consumable.consume(r,{name:!0}),i.forEach((function(e){return n.convertItem(e,n.writer.createPositionAt(s,"end"))})),s.isEmpty){var c=n.writer.createElement("tableRow");n.writer.insert(c,n.writer.createPositionAt(s,"end")),eLe(n.writer,n.writer.createPositionAt(c,"end"))}n.updateConversionResult(s,t)}}}))}}function iLe(e){for(var t=0,n=0,r=Array.from(e.getChildren()).filter((function(e){return"th"===e.name||"td"===e.name}));nn.headingColumns&&(n.headingColumns=f)}}}catch(e){s.e(e)}finally{s.f()}}}return n.rows=[].concat(r,o),n}(r),i=o.rows,a=o.headingRows,u=o.headingColumns,l={};u&&(l.headingColumns=u),a&&(l.headingRows=a);var s=n.writer.createElement("table",l);if(n.safeInsert(s,t.modelCursor)){if(n.consumable.consume(r,{name:!0}),i.forEach((function(e){return n.convertItem(e,n.writer.createPositionAt(s,"end"))})),s.isEmpty){var c=n.writer.createElement("tableRow");n.writer.insert(c,n.writer.createPositionAt(s,"end")),cLe(n.writer,n.writer.createPositionAt(c,"end"))}n.updateConversionResult(s,t)}}}))}}function yLe(e){for(var t=0,n=0,r=Array.from(e.getChildren()).filter((function(e){return"th"===e.name||"td"===e.name}));n1&&void 0!==arguments[1]?arguments[1]:{};aLe(this,e),this._table=t,this._startRow=void 0!==n.row?n.row:n.startRow||0,this._endRow=void 0!==n.row?n.row:n.endRow,this._startColumn=void 0!==n.column?n.column:n.startColumn||0,this._endColumn=void 0!==n.column?n.column:n.endColumn,this._includeAllSlots=!!n.includeAllSlots,this._skipRows=new Set,this._row=0,this._column=0,this._cellIndex=0,this._spannedCells=new Map,this._nextCellAtColumn=-1}return lLe(e,[{key:Symbol.iterator,value:function(){return this}},{key:"next",value:function(){var e=this._table.getChild(this._row);if(!e||this._isOverEndRow())return{done:!0};if(this._isOverEndColumn())return this._advanceToNextRow();var t=null,n=this._getSpanned();if(n)this._includeAllSlots&&!this._shouldSkipSlot()&&(t=this._formatOutValue(n.cell,n.row,n.column));else{var r=e.getChild(this._cellIndex);if(!r)return this._advanceToNextRow();var o=parseInt(r.getAttribute("colspan")||1),i=parseInt(r.getAttribute("rowspan")||1);(o>1||i>1)&&this._recordSpans(r,i,o),this._shouldSkipSlot()||(t=this._formatOutValue(r)),this._nextCellAtColumn=this._column+o}return this._column++,this._column==this._nextCellAtColumn&&this._cellIndex++,t||this.next()}},{key:"skipRow",value:function(e){this._skipRows.add(e)}},{key:"_advanceToNextRow",value:function(){return this._row++,this._column=0,this._cellIndex=0,this._nextCellAtColumn=-1,this.next()}},{key:"_isOverEndRow",value:function(){return void 0!==this._endRow&&this._row>this._endRow}},{key:"_isOverEndColumn",value:function(){return void 0!==this._endColumn&&this._column>this._endColumn}},{key:"_formatOutValue",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._row,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this._column;return{done:!1,value:new cLe(this,e,t,n)}}},{key:"_shouldSkipSlot",value:function(){var e=this._skipRows.has(this._row),t=this._rowthis._endColumn;return e||t||n||r}},{key:"_getSpanned",value:function(){var e=this._spannedCells.get(this._row);return e&&e.get(this._column)||null}},{key:"_recordSpans",value:function(e,t,n){for(var r={cell:e,row:this._row,column:this._column},o=this._row;o1&&void 0!==arguments[1]?arguments[1]:{};mLe(this,e),this._table=t,this._startRow=void 0!==n.row?n.row:n.startRow||0,this._endRow=void 0!==n.row?n.row:n.endRow,this._startColumn=void 0!==n.column?n.column:n.startColumn||0,this._endColumn=void 0!==n.column?n.column:n.endColumn,this._includeAllSlots=!!n.includeAllSlots,this._skipRows=new Set,this._row=0,this._column=0,this._cellIndex=0,this._spannedCells=new Map,this._nextCellAtColumn=-1}return vLe(e,[{key:Symbol.iterator,value:function(){return this}},{key:"next",value:function(){var e=this._table.getChild(this._row);if(!e||this._isOverEndRow())return{done:!0};if(this._isOverEndColumn())return this._advanceToNextRow();var t=null,n=this._getSpanned();if(n)this._includeAllSlots&&!this._shouldSkipSlot()&&(t=this._formatOutValue(n.cell,n.row,n.column));else{var r=e.getChild(this._cellIndex);if(!r)return this._advanceToNextRow();var o=parseInt(r.getAttribute("colspan")||1),i=parseInt(r.getAttribute("rowspan")||1);(o>1||i>1)&&this._recordSpans(r,i,o),this._shouldSkipSlot()||(t=this._formatOutValue(r)),this._nextCellAtColumn=this._column+o}return this._column++,this._column==this._nextCellAtColumn&&this._cellIndex++,t||this.next()}},{key:"skipRow",value:function(e){this._skipRows.add(e)}},{key:"_advanceToNextRow",value:function(){return this._row++,this._column=0,this._cellIndex=0,this._nextCellAtColumn=-1,this.next()}},{key:"_isOverEndRow",value:function(){return void 0!==this._endRow&&this._row>this._endRow}},{key:"_isOverEndColumn",value:function(){return void 0!==this._endColumn&&this._column>this._endColumn}},{key:"_formatOutValue",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._row,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this._column;return{done:!1,value:new wLe(this,e,t,n)}}},{key:"_shouldSkipSlot",value:function(){var e=this._skipRows.has(this._row),t=this._rowthis._endColumn;return e||t||n||r}},{key:"_getSpanned",value:function(){var e=this._spannedCells.get(this._row);return e&&e.get(this._column)||null}},{key:"_recordSpans",value:function(e,t,n){for(var r={cell:e,row:this._row,column:this._column},o=this._row;o-1&&t.splice(n,1);for(var r=0;t[r]&&hLe(t[r],e);)r++;t.splice(r,0,e)}}},{key:"_removeDescriptor",value:function(e){var t=this._stack,n=t.findIndex((function(t){return t.id===e}));n>-1&&t.splice(n,1)}}])&&fLe(t.prototype,n),r&&fLe(t,r),e}();function dLe(e,t){return e&&t&&e.priority==t.priority&&yLe(e.classes)==yLe(t.classes)}function hLe(e,t){return e.priority>t.priority||!(e.priorityyLe(t.classes)}function yLe(e){return Array.isArray(e)?e.sort().join(","):e}Zoe(pLe,koe);n(667);function mLe(e){return(mLe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function bLe(e,t){for(var n=0;n-1&&t.splice(n,1);for(var r=0;t[r]&&kLe(t[r],e);)r++;t.splice(r,0,e)}}},{key:"_removeDescriptor",value:function(e){var t=this._stack,n=t.findIndex((function(t){return t.id===e}));n>-1&&t.splice(n,1)}}])&&_Le(t.prototype,n),r&&_Le(t,r),e}();function SLe(e,t){return e&&t&&e.priority==t.priority&&PLe(e.classes)==PLe(t.classes)}function kLe(e,t){return e.priority>t.priority||!(e.priorityPLe(t.classes)}function PLe(e){return Array.isArray(e)?e.sort().join(","):e}aie(OLe,Aoe);n(667);function jLe(e){return(jLe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ELe(e,t){for(var n=0;nn.top||e.bottom+o'),n.render(),t.appendChild(n.element),t}));t.insert(t.createPositionAt(e,0),n),t.addClass(["ck-widget_with-selection-handle"],e)}function FLe(e){return function(e){if(Array.isArray(e))return BLe(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||NLe(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function YLe(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=NLe(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function NLe(e,t){if(e){if("string"==typeof e)return BLe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?BLe(e,t):void 0}}function BLe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);nn.top||e.bottom+o'),n.render(),t.appendChild(n.element),t}));t.insert(t.createPositionAt(e,0),n),t.addClass(["ck-widget_with-selection-handle"],e)}function $Le(e){return function(e){if(Array.isArray(e))return JLe(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||ZLe(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function GLe(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=ZLe(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function ZLe(e,t){if(e){if("string"==typeof e)return JLe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?JLe(e,t):void 0}}function JLe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:{};return function(t){return t.on("insert:table",(function(t,n,r){var o=n.item;if(r.consumable.consume(o,"insert")){r.consumable.consume(o,"attribute:headingRows:table"),r.consumable.consume(o,"attribute:headingColumns:table");var i,a=e&&e.asWidget,u=r.writer.createContainerElement("figure",{class:"table"}),l=r.writer.createContainerElement("table");r.writer.insert(r.writer.createPositionAt(u,0),l),a&&(i=qLe(u,r.writer));var s,c=new sLe(o),f={headingRows:o.getAttribute("headingRows")||0,headingColumns:o.getAttribute("headingColumns")||0},p=new Map,d=YLe(c);try{for(d.s();!(s=d.n()).done;){var h=s.value,y=h.row,m=h.cell,b=o.getChild(y),v=p.get(y)||GLe(l,b,y,f,r);p.set(y,v),r.consumable.consume(m,"insert"),$Le(h,f,r.writer.createPositionAt(v,"end"),r,e)}}catch(e){d.e(e)}finally{d.f()}var g,w=YLe(o.getChildren());try{for(w.s();!(g=w.n()).done;){var _=g.value,O=_.index;p.has(O)||p.set(O,GLe(l,_,O,f,r))}}catch(e){w.e(e)}finally{w.f()}var S=r.mapper.toViewPosition(n.range.start);r.mapper.bindElements(o,a?i:u),r.writer.insert(S,a?i:u)}}))}}function VLe(){return function(e){return e.on("insert:tableRow",(function(e,t,n){var r=t.item;if(n.consumable.consume(r,"insert")){var o,i=r.parent,a=function(e){var t,n=YLe(e.getChildren());try{for(n.s();!(t=n.n()).done;){var r=t.value;if("table"===r.name)return r}}catch(e){n.e(e)}finally{n.f()}}(n.mapper.toViewElement(i)),u=i.getChildIndex(r),l=new sLe(i,{row:u}),s={headingRows:i.getAttribute("headingRows")||0,headingColumns:i.getAttribute("headingColumns")||0},c=new Map,f=YLe(l);try{for(f.s();!(o=f.n()).done;){var p=o.value,d=c.get(u)||GLe(a,r,u,s,n);c.set(u,d),n.consumable.consume(p.cell,"insert"),$Le(p,s,n.writer.createPositionAt(d,"end"),n,{asWidget:!0})}}catch(e){f.e(e)}finally{f.f()}}}))}}function WLe(e,t){var n=t.writer;if(e.parent.is("element","tableCell"))return ULe(e)?n.createContainerElement("span",{style:"display:inline-block"}):n.createContainerElement("p")}function ULe(e){return 1===e.parent.childCount&&!XLe(e)}function qLe(e,t){return t.setCustomProperty("table",!0,e),function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!e.is("containerElement"))throw new moe.a("widget-to-widget-wrong-element-type",null,{element:e});return t.setAttribute("contenteditable","false",e),t.addClass("ck-widget",e),t.setCustomProperty("widget",!0,e),e.getFillerOffset=ILe,n.label&&RLe(e,n.label,t),n.hasSelectionHandle&&zLe(e,t),DLe(e,t,(function(e,t,n){return n.addClass(r(t.classes),e)}),(function(e,t,n){return n.removeClass(r(t.classes),e)})),e;function r(e){return Array.isArray(e)?e:[e]}}(e,t,{hasSelectionHandle:!0})}function KLe(e,t,n){var r=e.cell,o=ZLe(e,t),i=n.mapper.toViewElement(r);i&&i.name!==o&&function(e,t,n){var r=n.writer,o=n.mapper.toViewElement(e),i=MLe(r.createEditableElement(t,o.getAttributes()),r);DLe(i,r,(function(e,t,n){return n.addClass(eIe(t.classes),e)}),(function(e,t,n){return n.removeClass(eIe(t.classes),e)})),r.insert(r.createPositionAfter(o),i),r.move(r.createRangeIn(o),r.createPositionAt(i,0)),r.remove(r.createRangeOn(o)),n.mapper.unbindViewElement(o),n.mapper.bindElements(e,i)}(r,o,n)}function $Le(e,t,n,r,o){var i=o&&o.asWidget,a=ZLe(e,t),u=i?MLe(r.writer.createEditableElement(a),r.writer):r.writer.createContainerElement(a);i&&DLe(u,r.writer,(function(e,t,n){return n.addClass(eIe(t.classes),e)}),(function(e,t,n){return n.removeClass(eIe(t.classes),e)}));var l=e.cell,s=l.getChild(0),c=1===l.childCount&&"paragraph"===s.name;if(r.writer.insert(n,u),r.mapper.bindElements(l,u),!i&&!XLe(s)&&c){var f=l.getChild(0);r.consumable.consume(f,"insert"),r.mapper.bindElements(f,u)}}function GLe(e,t,n,r,o){o.consumable.consume(t,"insert");var i=t.isEmpty?o.writer.createEmptyElement("tr"):o.writer.createContainerElement("tr");o.mapper.bindElements(t,i);var a=r.headingRows,u=function(e,t,n){var r=JLe(e,t);return r||function(e,t,n){var r=n.writer.createContainerElement(e),o=n.writer.createPositionAt(t,"tbody"==e?"end":0);return n.writer.insert(o,r),r}(e,t,n)}(function(e,t){return e0&&n>=a?n-a:n,s=o.writer.createPositionAt(u,l);return o.writer.insert(s,i),i}function ZLe(e,t){var n=e.row,r=e.column,o=t.headingColumns,i=t.headingRows;return i&&i>n||o&&o>r?"th":"td"}function JLe(e,t){var n,r=YLe(t.getChildren());try{for(r.s();!(n=r.n()).done;){var o=n.value;if(o.name==e)return o}}catch(e){r.e(e)}finally{r.f()}}function QLe(e,t,n){var r=JLe(e,t);r&&0===r.childCount&&n.writer.remove(n.writer.createRangeOn(r))}function XLe(e){return!!FLe(e.getAttributeKeys()).length}function eIe(e){return Array.isArray(e)?e:[e]}function tIe(e){return(tIe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function nIe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rIe(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};return function(t){return t.on("insert:table",(function(t,n,r){var o=n.item;if(r.consumable.consume(o,"insert")){r.consumable.consume(o,"attribute:headingRows:table"),r.consumable.consume(o,"attribute:headingColumns:table");var i,a=e&&e.asWidget,u=r.writer.createContainerElement("figure",{class:"table"}),l=r.writer.createContainerElement("table");r.writer.insert(r.writer.createPositionAt(u,0),l),a&&(i=nIe(u,r.writer));var s,c=new gLe(o),f={headingRows:o.getAttribute("headingRows")||0,headingColumns:o.getAttribute("headingColumns")||0},p=new Map,d=GLe(c);try{for(d.s();!(s=d.n()).done;){var h=s.value,y=h.row,m=h.cell,b=o.getChild(y),v=p.get(y)||iIe(l,b,y,f,r);p.set(y,v),r.consumable.consume(m,"insert"),oIe(h,f,r.writer.createPositionAt(v,"end"),r,e)}}catch(e){d.e(e)}finally{d.f()}var g,w=GLe(o.getChildren());try{for(w.s();!(g=w.n()).done;){var _=g.value,O=_.index;p.has(O)||p.set(O,iIe(l,_,O,f,r))}}catch(e){w.e(e)}finally{w.f()}var S=r.mapper.toViewPosition(n.range.start);r.mapper.bindElements(o,a?i:u),r.writer.insert(S,a?i:u)}}))}}function XLe(){return function(e){return e.on("insert:tableRow",(function(e,t,n){var r=t.item;if(n.consumable.consume(r,"insert")){var o,i=r.parent,a=function(e){var t,n=GLe(e.getChildren());try{for(n.s();!(t=n.n()).done;){var r=t.value;if("table"===r.name)return r}}catch(e){n.e(e)}finally{n.f()}}(n.mapper.toViewElement(i)),u=i.getChildIndex(r),l=new gLe(i,{row:u}),s={headingRows:i.getAttribute("headingRows")||0,headingColumns:i.getAttribute("headingColumns")||0},c=new Map,f=GLe(l);try{for(f.s();!(o=f.n()).done;){var p=o.value,d=c.get(u)||iIe(a,r,u,s,n);c.set(u,d),n.consumable.consume(p.cell,"insert"),oIe(p,s,n.writer.createPositionAt(d,"end"),n,{asWidget:!0})}}catch(e){f.e(e)}finally{f.f()}}}))}}function eIe(e,t){var n=t.writer;if(e.parent.is("element","tableCell"))return tIe(e)?n.createContainerElement("span",{style:"display:inline-block"}):n.createContainerElement("p")}function tIe(e){return 1===e.parent.childCount&&!sIe(e)}function nIe(e,t){return t.setCustomProperty("table",!0,e),function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!e.is("containerElement"))throw new joe.a("widget-to-widget-wrong-element-type",null,{element:e});return t.setAttribute("contenteditable","false",e),t.addClass("ck-widget",e),t.setCustomProperty("widget",!0,e),e.getFillerOffset=qLe,n.label&&HLe(e,n.label,t),n.hasSelectionHandle&&KLe(e,t),BLe(e,t,(function(e,t,n){return n.addClass(r(t.classes),e)}),(function(e,t,n){return n.removeClass(r(t.classes),e)})),e;function r(e){return Array.isArray(e)?e:[e]}}(e,t,{hasSelectionHandle:!0})}function rIe(e,t,n){var r=e.cell,o=aIe(e,t),i=n.mapper.toViewElement(r);i&&i.name!==o&&function(e,t,n){var r=n.writer,o=n.mapper.toViewElement(e),i=VLe(r.createEditableElement(t,o.getAttributes()),r);BLe(i,r,(function(e,t,n){return n.addClass(cIe(t.classes),e)}),(function(e,t,n){return n.removeClass(cIe(t.classes),e)})),r.insert(r.createPositionAfter(o),i),r.move(r.createRangeIn(o),r.createPositionAt(i,0)),r.remove(r.createRangeOn(o)),n.mapper.unbindViewElement(o),n.mapper.bindElements(e,i)}(r,o,n)}function oIe(e,t,n,r,o){var i=o&&o.asWidget,a=aIe(e,t),u=i?VLe(r.writer.createEditableElement(a),r.writer):r.writer.createContainerElement(a);i&&BLe(u,r.writer,(function(e,t,n){return n.addClass(cIe(t.classes),e)}),(function(e,t,n){return n.removeClass(cIe(t.classes),e)}));var l=e.cell,s=l.getChild(0),c=1===l.childCount&&"paragraph"===s.name;if(r.writer.insert(n,u),r.mapper.bindElements(l,u),!i&&!sIe(s)&&c){var f=l.getChild(0);r.consumable.consume(f,"insert"),r.mapper.bindElements(f,u)}}function iIe(e,t,n,r,o){o.consumable.consume(t,"insert");var i=t.isEmpty?o.writer.createEmptyElement("tr"):o.writer.createContainerElement("tr");o.mapper.bindElements(t,i);var a=r.headingRows,u=function(e,t,n){var r=uIe(e,t);return r||function(e,t,n){var r=n.writer.createContainerElement(e),o=n.writer.createPositionAt(t,"tbody"==e?"end":0);return n.writer.insert(o,r),r}(e,t,n)}(function(e,t){return e0&&n>=a?n-a:n,s=o.writer.createPositionAt(u,l);return o.writer.insert(s,i),i}function aIe(e,t){var n=e.row,r=e.column,o=t.headingColumns,i=t.headingRows;return i&&i>n||o&&o>r?"th":"td"}function uIe(e,t){var n,r=GLe(t.getChildren());try{for(r.s();!(n=r.n()).done;){var o=n.value;if(o.name==e)return o}}catch(e){r.e(e)}finally{r.f()}}function lIe(e,t,n){var r=uIe(e,t);r&&0===r.childCount&&n.writer.remove(n.writer.createRangeOn(r))}function sIe(e){return!!$Le(e.getAttributeKeys()).length}function cIe(e){return Array.isArray(e)?e:[e]}function fIe(e){return(fIe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function pIe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function dIe(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{},t=this.editor.model,n=t.document.selection,r=this.editor.plugins.get("TableUtils"),o=ALe(n,t);t.change((function(n){var i=r.createTable(n,e);t.insertContent(i,o),n.setSelection(n.createPositionAt(i.getNodeByPath([0,0,0]),0))}))}}])&&rIe(t.prototype,n),r&&rIe(t,r),i}(tie);function sIe(e){return function(e){if(Array.isArray(e))return pIe(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||fIe(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function cIe(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=fIe(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function fIe(e,t){if(e){if("string"==typeof e)return pIe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?pIe(e,t):void 0}}function pIe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:{},t=this.editor.model,n=t.document.selection,r=this.editor.plugins.get("TableUtils"),o=WLe(n,t);t.change((function(n){var i=r.createTable(n,e);t.insertContent(i,o),n.setSelection(n.createPositionAt(i.getNodeByPath([0,0,0]),0))}))}}])&&dIe(t.prototype,n),r&&dIe(t,r),i}(fie);function gIe(e){return function(e){if(Array.isArray(e))return OIe(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||_Ie(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function wIe(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=_Ie(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function _Ie(e,t){if(e){if("string"==typeof e)return OIe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?OIe(e,t):void 0}}function OIe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&r.add(s+f-1),p>1&&o.add(c+p-1),i+=f*p}}catch(e){a.e(e)}finally{a.f()}return function(e,t){var n=Array.from(e.values()),r=Array.from(t.values()),o=Math.max.apply(Math,sIe(n)),i=Math.min.apply(Math,sIe(n)),a=Math.max.apply(Math,sIe(r)),u=Math.min.apply(Math,sIe(r));return(o-i+1)*(a-u+1)}(r,o)==i}function gIe(e){return Array.from(e).sort(_Ie)}function wIe(e){var t=e.sort((function(e,t){return e-t}));return{first:t[0],last:t[t.length-1]}}function _Ie(e,t){var n=e.start,r=t.start;return n.isBefore(r)?-1:1}function OIe(e,t){return e.first1&&r.add(s+f-1),p>1&&o.add(c+p-1),i+=f*p}}catch(e){a.e(e)}finally{a.f()}return function(e,t){var n=Array.from(e.values()),r=Array.from(t.values()),o=Math.max.apply(Math,gIe(n)),i=Math.min.apply(Math,gIe(n)),a=Math.max.apply(Math,gIe(r)),u=Math.min.apply(Math,gIe(r));return(o-i+1)*(a-u+1)}(r,o)==i}function xIe(e){return Array.from(e).sort(DIe)}function TIe(e){var t=e.sort((function(e,t){return e-t}));return{first:t[0],last:t[t.length-1]}}function DIe(e,t){var n=e.start,r=t.start;return n.isBefore(r)?-1:1}function RIe(e,t){return e.first1&&void 0!==arguments[1]?arguments[1]:{};return kIe(this,i),(t=o.call(this,e)).order=n.order||"below",t}return t=i,(n=[{key:"refresh",value:function(){var e=this.editor.model.document.selection.getFirstPosition().findAncestor("table");this.isEnabled=!!e}},{key:"execute",value:function(){var e=this.editor,t=e.model.document.selection,n=e.plugins.get("TableUtils"),r="above"===this.order,o=yIe(t),i=mIe(o),a=r?i.first:i.last,u=o[0].findAncestor("table");n.insertRows(u,{at:r?a:a+1,copyStructureFromAbove:!r})}}])&&PIe(t.prototype,n),r&&PIe(t,r),i}(tie);function DIe(e){return(DIe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function RIe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function MIe(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{};return AIe(this,i),(t=o.call(this,e)).order=n.order||"below",t}return t=i,(n=[{key:"refresh",value:function(){var e=this.editor.model.document.selection.getFirstPosition().findAncestor("table");this.isEnabled=!!e}},{key:"execute",value:function(){var e=this.editor,t=e.model.document.selection,n=e.plugins.get("TableUtils"),r="above"===this.order,o=PIe(t),i=jIe(o),a=r?i.first:i.last,u=o[0].findAncestor("table");n.insertRows(u,{at:r?a:a+1,copyStructureFromAbove:!r})}}])&&LIe(t.prototype,n),r&&LIe(t,r),i}(fie);function BIe(e){return(BIe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function HIe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function VIe(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{};return RIe(this,i),(t=o.call(this,e)).order=n.order||"right",t}return t=i,(n=[{key:"refresh",value:function(){var e=this.editor.model.document.selection.getFirstPosition().findAncestor("table");this.isEnabled=!!e}},{key:"execute",value:function(){var e=this.editor,t=e.model.document.selection,n=e.plugins.get("TableUtils"),r="left"===this.order,o=yIe(t),i=bIe(o),a=r?i.first:i.last,u=o[0].findAncestor("table");n.insertColumns(u,{columns:1,at:r?a:a+1})}}])&&MIe(t.prototype,n),r&&MIe(t,r),i}(tie);function YIe(e){return(YIe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function NIe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function BIe(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{};return HIe(this,i),(t=o.call(this,e)).order=n.order||"right",t}return t=i,(n=[{key:"refresh",value:function(){var e=this.editor.model.document.selection.getFirstPosition().findAncestor("table");this.isEnabled=!!e}},{key:"execute",value:function(){var e=this.editor,t=e.model.document.selection,n=e.plugins.get("TableUtils"),r="left"===this.order,o=PIe(t),i=EIe(o),a=r?i.first:i.last,u=o[0].findAncestor("table");n.insertColumns(u,{columns:1,at:r?a:a+1})}}])&&VIe(t.prototype,n),r&&VIe(t,r),i}(fie);function GIe(e){return(GIe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ZIe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function JIe(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{};return NIe(this,i),(t=o.call(this,e)).direction=n.direction||"horizontally",t}return t=i,(n=[{key:"refresh",value:function(){var e=yIe(this.editor.model.document.selection);this.isEnabled=1===e.length}},{key:"execute",value:function(){var e=yIe(this.editor.model.document.selection)[0],t="horizontally"===this.direction,n=this.editor.plugins.get("TableUtils");t?n.splitCellHorizontally(e,2):n.splitCellVertically(e,2)}}])&&BIe(t.prototype,n),r&&BIe(t,r),i}(tie);function KIe(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=GIe(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function $Ie(e){return function(e){if(Array.isArray(e))return ZIe(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||GIe(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function GIe(e,t){if(e){if("string"==typeof e)return ZIe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ZIe(e,t):void 0}}function ZIe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:{};return ZIe(this,i),(t=o.call(this,e)).direction=n.direction||"horizontally",t}return t=i,(n=[{key:"refresh",value:function(){var e=PIe(this.editor.model.document.selection);this.isEnabled=1===e.length}},{key:"execute",value:function(){var e=PIe(this.editor.model.document.selection)[0],t="horizontally"===this.direction,n=this.editor.plugins.get("TableUtils");t?n.splitCellHorizontally(e,2):n.splitCellVertically(e,2)}}])&&JIe(t.prototype,n),r&&JIe(t,r),i}(fie);function rze(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=ize(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function oze(e){return function(e){if(Array.isArray(e))return aze(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||ize(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ize(e,t){if(e){if("string"==typeof e)return aze(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?aze(e,t):void 0}}function aze(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0){XAe("headingRows",i-n,e,o,0)}var a=parseInt(t.getAttribute("headingColumns")||0);if(a>0){XAe("headingColumns",a-r,e,o,0)}}(u,e,r,o,n),u}function QIe(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=[],i=new sLe(e,{startRow:r,endRow:t-1}),a=KIe(i);try{for(a.s();!(n=a.n()).done;){var u=n.value,l=u.row,s=u.cellHeight,c=l+s-1;l1&&(u.rowspan=l);var s=parseInt(e.getAttribute("colspan")||1);s>1&&(u.colspan=s);var c,f,p=i+a,d=null,h=KIe($Ie(new sLe(o,{startRow:i,endRow:p,includeAllSlots:!0})));try{for(h.s();!(f=h.n()).done;){var y=f.value,m=y.row,b=y.column;y.cell===e&&void 0===c&&(c=b),void 0!==c&&c===b&&m===p&&(d=eLe(n,y.getPositionBefore(),u))}}catch(e){h.e(e)}finally{h.f()}return XAe("rowspan",a,e,n),d}function eze(e,t){var n,r=[],o=KIe(new sLe(e));try{for(o.s();!(n=o.n()).done;){var i=n.value,a=i.column,u=i.cellWidth;a1&&(i.colspan=a);var u=parseInt(e.getAttribute("rowspan")||1);u>1&&(i.rowspan=u);var l=eLe(r,r.createPositionAfter(e),i);return XAe("colspan",o,e,r),l}function nze(e,t,n,r,o,i){var a=parseInt(e.getAttribute("colspan")||1),u=parseInt(e.getAttribute("rowspan")||1);n+a-1>o&&XAe("colspan",o-n+1,e,i,1);t+u-1>r&&XAe("rowspan",r-t+1,e,i,1)}function rze(e,t){var n,r=t.getColumns(e),o=new Array(r).fill(0),i=KIe(new sLe(e));try{for(i.s();!(n=i.n()).done;){o[n.value.column]++}}catch(e){i.e(e)}finally{i.f()}var a=o.reduce((function(e,t,n){return t?e:[].concat($Ie(e),[n])}),[]);if(a.length>0){var u=a[a.length-1];return t.removeColumns(e,{at:u}),!0}return!1}function oze(e,t){for(var n=[],r=0;r0){var o=n[n.length-1];return t.removeRows(e,{at:o}),!0}return!1}function ize(e,t){rze(e,t)||oze(e,t)}function aze(e,t){var n=Array.from(new sLe(e,{startColumn:t.firstColumn,endColumn:t.lastColumn,row:t.lastRow}));if(n.every((function(e){return 1===e.cellHeight})))return t.lastRow;var r=n[0].cellHeight-1;return t.lastRow+r}function uze(e,t){var n=Array.from(new sLe(e,{startRow:t.firstRow,endRow:t.lastRow,column:t.lastColumn}));if(n.every((function(e){return 1===e.cellWidth})))return t.lastColumn;var r=n[0].cellWidth-1;return t.lastColumn+r}function lze(e){return function(e){if(Array.isArray(e))return sze(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return sze(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return sze(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function sze(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0){sLe("headingRows",i-n,e,o,0)}var a=parseInt(t.getAttribute("headingColumns")||0);if(a>0){sLe("headingColumns",a-r,e,o,0)}}(u,e,r,o,n),u}function lze(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=[],i=new gLe(e,{startRow:r,endRow:t-1}),a=rze(i);try{for(a.s();!(n=a.n()).done;){var u=n.value,l=u.row,s=u.cellHeight,c=l+s-1;l1&&(u.rowspan=l);var s=parseInt(e.getAttribute("colspan")||1);s>1&&(u.colspan=s);var c,f,p=i+a,d=null,h=rze(oze(new gLe(o,{startRow:i,endRow:p,includeAllSlots:!0})));try{for(h.s();!(f=h.n()).done;){var y=f.value,m=y.row,b=y.column;y.cell===e&&void 0===c&&(c=b),void 0!==c&&c===b&&m===p&&(d=cLe(n,y.getPositionBefore(),u))}}catch(e){h.e(e)}finally{h.f()}return sLe("rowspan",a,e,n),d}function cze(e,t){var n,r=[],o=rze(new gLe(e));try{for(o.s();!(n=o.n()).done;){var i=n.value,a=i.column,u=i.cellWidth;a1&&(i.colspan=a);var u=parseInt(e.getAttribute("rowspan")||1);u>1&&(i.rowspan=u);var l=cLe(r,r.createPositionAfter(e),i);return sLe("colspan",o,e,r),l}function pze(e,t,n,r,o,i){var a=parseInt(e.getAttribute("colspan")||1),u=parseInt(e.getAttribute("rowspan")||1);n+a-1>o&&sLe("colspan",o-n+1,e,i,1);t+u-1>r&&sLe("rowspan",r-t+1,e,i,1)}function dze(e,t){var n,r=t.getColumns(e),o=new Array(r).fill(0),i=rze(new gLe(e));try{for(i.s();!(n=i.n()).done;){o[n.value.column]++}}catch(e){i.e(e)}finally{i.f()}var a=o.reduce((function(e,t,n){return t?e:[].concat(oze(e),[n])}),[]);if(a.length>0){var u=a[a.length-1];return t.removeColumns(e,{at:u}),!0}return!1}function hze(e,t){for(var n=[],r=0;r0){var o=n[n.length-1];return t.removeRows(e,{at:o}),!0}return!1}function yze(e,t){dze(e,t)||hze(e,t)}function mze(e,t){var n=Array.from(new gLe(e,{startColumn:t.firstColumn,endColumn:t.lastColumn,row:t.lastRow}));if(n.every((function(e){return 1===e.cellHeight})))return t.lastRow;var r=n[0].cellHeight-1;return t.lastRow+r}function bze(e,t){var n=Array.from(new gLe(e,{startRow:t.firstRow,endRow:t.lastRow,column:t.lastColumn}));if(n.every((function(e){return 1===e.cellWidth})))return t.lastColumn;var r=n[0].cellWidth-1;return t.lastColumn+r}function vze(e){return function(e){if(Array.isArray(e))return gze(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return gze(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return gze(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function gze(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0;if(o){var a="right"==t?e:o,u="right"==t?o:e,l=n.getCellLocation(a).column,s=n.getCellLocation(u).column,c=parseInt(a.getAttribute("colspan")||1),f=tLe(n,a),p=tLe(n,u);if(!i||f==p)return l+c===s?o:void 0}}(e,this.direction,t):function(e,t){var n=e.parent,r=n.parent,o=r.getChildIndex(n);if(!("down"==t&&o===r.childCount-1||"up"==t&&0===o)){var i=parseInt(e.getAttribute("rowspan")||1),a=r.getAttribute("headingRows")||0,u="down"==t&&o+i===a,l="up"==t&&o===a;if(!a||!u&&!l){var s=parseInt(e.getAttribute("rowspan")||1),c="down"==t?o+s:o,f=lze(new sLe(r,{endRow:c})),p=f.find((function(t){return t.cell===e})).column,d=f.find((function(e){var n=e.row,r=e.cellHeight;return e.column===p&&("down"==t?n===c:c===n+r)}));return d&&d.cell}}}(e,this.direction);if(n){var r=this.isHorizontal?"rowspan":"colspan",o=parseInt(e.getAttribute(r)||1);return parseInt(n.getAttribute(r)||1)===o?n:void 0}}}}])&&fze(t.prototype,n),r&&fze(t,r),i}(tie);function bze(e){return 1==e.childCount&&e.getChild(0).is("element","paragraph")&&e.getChild(0).isEmpty}function vze(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return gze(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return gze(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function gze(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0;if(o){var a="right"==t?e:o,u="right"==t?o:e,l=n.getCellLocation(a).column,s=n.getCellLocation(u).column,c=parseInt(a.getAttribute("colspan")||1),f=fLe(n,a),p=fLe(n,u);if(!i||f==p)return l+c===s?o:void 0}}(e,this.direction,t):function(e,t){var n=e.parent,r=n.parent,o=r.getChildIndex(n);if(!("down"==t&&o===r.childCount-1||"up"==t&&0===o)){var i=parseInt(e.getAttribute("rowspan")||1),a=r.getAttribute("headingRows")||0,u="down"==t&&o+i===a,l="up"==t&&o===a;if(!a||!u&&!l){var s=parseInt(e.getAttribute("rowspan")||1),c="down"==t?o+s:o,f=vze(new gLe(r,{endRow:c})),p=f.find((function(t){return t.cell===e})).column,d=f.find((function(e){var n=e.row,r=e.cellHeight;return e.column===p&&("down"==t?n===c:c===n+r)}));return d&&d.cell}}}(e,this.direction);if(n){var r=this.isHorizontal?"rowspan":"colspan",o=parseInt(e.getAttribute(r)||1);return parseInt(n.getAttribute(r)||1)===o?n:void 0}}}}])&&_ze(t.prototype,n),r&&_ze(t,r),i}(fie);function Eze(e){return 1==e.childCount&&e.getChild(0).is("element","paragraph")&&e.getChild(0).isEmpty}function Cze(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return xze(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return xze(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function xze(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);nn)return i;i=l,a+=parseInt(l.getAttribute("colspan")||1)}}catch(e){u.e(e)}finally{u.f()}return i}(i,r.first,a);t.setSelection(t.createPositionAt(o,0))}))}}])&&Oze(t.prototype,n),r&&Oze(t,r),i}(tie);function Cze(e){return(Cze="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function xze(e){return function(e){if(Array.isArray(e))return Rze(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||Dze(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Tze(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n}(e,t)||Dze(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Dze(e,t){if(e){if("string"==typeof e)return Rze(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Rze(e,t):void 0}}function Rze(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);nn)return i;i=l,a+=parseInt(l.getAttribute("colspan")||1)}}catch(e){u.e(e)}finally{u.f()}return i}(i,r.first,a);t.setSelection(t.createPositionAt(o,0))}))}}])&&Rze(t.prototype,n),r&&Rze(t,r),i}(fie);function Fze(e){return(Fze="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Yze(e){return function(e){if(Array.isArray(e))return Hze(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||Bze(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Nze(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n}(e,t)||Bze(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Bze(e,t){if(e){if("string"==typeof e)return Hze(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Hze(e,t):void 0}}function Hze(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1?n:t.previousSibling||n.nextSibling?n.nextSibling||t.previousSibling:r.first?e.reverse().find((function(e){return e.columnr.last})).cell}(i,n,r,a);this.editor.model.change((function(t){var n=a.last-a.first+1;e.editor.plugins.get("TableUtils").removeColumns(o,{at:a.first,columns:n}),t.setSelection(t.createPositionAt(u,0))}))}}])&&Aze(t.prototype,n),r&&Aze(t,r),i}(tie);function Nze(e){return(Nze="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Bze(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Hze(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Hze(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Hze(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1?n:t.previousSibling||n.nextSibling?n.nextSibling||t.previousSibling:r.first?e.reverse().find((function(e){return e.columnr.last})).cell}(i,n,r,a);this.editor.model.change((function(t){var n=a.last-a.first+1;e.editor.plugins.get("TableUtils").removeColumns(o,{at:a.first,columns:n}),t.setSelection(t.createPositionAt(u,0))}))}}])&&Wze(t.prototype,n),r&&Wze(t,r),i}(fie);function Zze(e){return(Zze="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Jze(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Qze(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Qze(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Qze(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0;this.isEnabled=n,this.value=n&&t.every((function(t){return e._isInHeading(t,t.parent.parent)}))}},{key:"execute",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(e.forceValue!==this.value){var t=this.editor.model,n=yIe(t.document.selection),r=n[0].findAncestor("table"),o=mIe(n),i=o.first,a=o.last,u=this.value?i:a+1,l=r.getAttribute("headingRows")||0;t.change((function(e){if(u){var t,n=Bze(QIe(r,u,u>l?l:0));try{for(n.s();!(t=n.n()).done;)XIe(t.value.cell,u,e)}catch(e){n.e(e)}finally{n.f()}}XAe("headingRows",u,r,e,0)}))}}},{key:"_isInHeading",value:function(e,t){var n=parseInt(t.getAttribute("headingRows")||0);return!!n&&e.parent.index=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Qze(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0;this.isEnabled=n,this.value=n&&t.every((function(t){return e._isInHeading(t,t.parent.parent)}))}},{key:"execute",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(e.forceValue!==this.value){var t=this.editor.model,n=PIe(t.document.selection),r=n[0].findAncestor("table"),o=jIe(n),i=o.first,a=o.last,u=this.value?i:a+1,l=r.getAttribute("headingRows")||0;t.change((function(e){if(u){var t,n=Jze(lze(r,u,u>l?l:0));try{for(n.s();!(t=n.n()).done;)sze(t.value.cell,u,e)}catch(e){n.e(e)}finally{n.f()}}sLe("headingRows",u,r,e,0)}))}}},{key:"_isInHeading",value:function(e,t){var n=parseInt(t.getAttribute("headingRows")||0);return!!n&&e.parent.index=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function lFe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0;this.isEnabled=n,this.value=n&&e.every((function(e){return tLe(t,e)}))}},{key:"execute",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(e.forceValue!==this.value){var t=this.editor.model,n=yIe(t.document.selection),r=n[0].findAncestor("table"),o=bIe(n),i=o.first,a=o.last,u=this.value?i:a+1;t.change((function(e){if(u){var t,n=Jze(eze(r,u));try{for(n.s();!(t=n.n()).done;){var o=t.value;tze(o.cell,o.column,u,e)}}catch(e){n.e(e)}finally{n.f()}}XAe("headingColumns",u,r,e,0)}))}}}])&&eFe(t.prototype,n),r&&eFe(t,r),i}(tie);function aFe(e){return(aFe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function uFe(e){return function(e){if(Array.isArray(e))return cFe(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||sFe(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function lFe(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=sFe(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function sFe(e,t){if(e){if("string"==typeof e)return cFe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?cFe(e,t):void 0}}function cFe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0;this.isEnabled=n,this.value=n&&e.every((function(e){return fLe(t,e)}))}},{key:"execute",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(e.forceValue!==this.value){var t=this.editor.model,n=PIe(t.document.selection),r=n[0].findAncestor("table"),o=EIe(n),i=o.first,a=o.last,u=this.value?i:a+1;t.change((function(e){if(u){var t,n=uFe(cze(r,u));try{for(n.s();!(t=n.n()).done;){var o=t.value;fze(o.cell,o.column,u,e)}}catch(e){n.e(e)}finally{n.f()}}sLe("headingColumns",u,r,e,0)}))}}}])&&cFe(t.prototype,n),r&&cFe(t,r),i}(fie);function mFe(e){return(mFe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function bFe(e){return function(e){if(Array.isArray(e))return wFe(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||gFe(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function vFe(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=gFe(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function gFe(e,t){if(e){if("string"==typeof e)return wFe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?wFe(e,t):void 0}}function wFe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:{},n=this.editor.model,r=t.at||0,o=t.rows||1,i=void 0!==t.copyStructureFromAbove,a=t.copyStructureFromAbove?r-1:r,u=this.getRows(e),l=this.getColumns(e);n.change((function(t){var n=e.getAttribute("headingRows")||0;if(n>r&&XAe("headingRows",n+o,e,t,0),i||0!==r&&r!==u){var s,c=i?Math.max(r,a):r,f=new sLe(e,{endRow:c}),p=new Array(l).fill(1),d=lFe(f);try{for(d.s();!(s=d.n()).done;){var h=s.value,y=h.row,m=h.column,b=h.cellHeight,v=h.cellWidth,g=h.cell,w=y+b-1,_=y<=a&&a<=w;y0&&eLe(t,j,P>1?{colspan:P}:null),k+=Math.abs(P)-1}}}else vFe(t,e,r,o,l)}))}},{key:"insertColumns",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.editor.model,o=n.at||0,i=n.columns||1;r.change((function(n){var r=e.getAttribute("headingColumns");o=t&&l<=n&&p>n){var d=c-(n-l+1);o.set(s,{cell:f,rowspan:d})}if(l=t){var h=void 0;h=p>=n?n-t+1:p-t+1,i.push({cell:f,rowspan:c-h})}}}catch(e){a.e(e)}finally{a.f()}return{cellsToMove:o,cellsToTrim:i}}(e,i,a),o=r.cellsToMove,u=r.cellsToTrim;o.size&&function(e,t,n,r){var o,i,a=uFe(new sLe(e,{includeAllSlots:!0,row:t})),u=e.getChild(t),l=lFe(a);try{for(l.s();!(i=l.n()).done;){var s=i.value,c=s.column,f=s.cell,p=s.isAnchor;if(n.has(c)){var d=n.get(c),h=d.cell,y=d.rowspan,m=o?r.createPositionAfter(o):r.createPositionAt(u,0);r.move(r.createRangeOn(h),m),XAe("rowspan",y,h,r),o=h}else p&&(o=f)}}catch(e){l.e(e)}finally{l.f()}}(e,a+1,o,t);for(var l=a;l>=i;l--)t.remove(e.getChild(l));var s,c=lFe(u);try{for(c.s();!(s=c.n()).done;){var f=s.value;XAe("rowspan",f.rowspan,f.cell,t)}}catch(e){c.e(e)}finally{c.f()}!function(e,t,n,r){var o=e.getAttribute("headingRows")||0;t=o;r--)for(var i=0,u=uFe(new sLe(e));i1&&c+f>r?XAe("colspan",f-1,s,t):c===r&&t.remove(s)}oze(e,n)||rze(e,n)}))}},{key:"splitCellVertically",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,n=this.editor.model,r=e.parent,o=r.parent,i=parseInt(e.getAttribute("rowspan")||1),a=parseInt(e.getAttribute("colspan")||1);n.change((function(n){if(a>1){var r=wFe(a,t),u=r.newCellsSpan;XAe("colspan",r.updatedSpan,e,n);var l={};u>1&&(l.colspan=u),i>1&&(l.rowspan=i),gFe(a>t?t-1:a-1,n,n.createPositionAfter(e),l)}if(ap})));try{for(d.s();!(s=d.n()).done;){var h=s.value,y=h.cell,m=h.cellWidth;n.setAttribute("colspan",m+c,y)}}catch(e){d.e(e)}finally{d.f()}var b={};i>1&&(b.rowspan=i),gFe(c,n,n.createPositionAfter(e),b);var v=o.getAttribute("headingColumns")||0;v>p&&XAe("headingColumns",v+c,o,n)}}))}},{key:"splitCellHorizontally",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,n=this.editor.model,r=e.parent,o=r.parent,i=o.getChildIndex(r),a=parseInt(e.getAttribute("rowspan")||1),u=parseInt(e.getAttribute("colspan")||1);n.change((function(n){if(a>1){var r=uFe(new sLe(o,{startRow:i,endRow:i+a-1,includeAllSlots:!0})),l=wFe(a,t),s=l.newCellsSpan,c=l.updatedSpan;XAe("rowspan",c,e,n);var f=r.find((function(t){return t.cell===e})).column,p={};s>1&&(p.rowspan=s),u>1&&(p.colspan=u);var d,h=lFe(r);try{for(h.s();!(d=h.n()).done;){var y=d.value,m=y.column,b=y.row;b>=i+c&&m===f&&(b+i+c)%s==0&&gFe(1,n,y.getPositionBefore(),p)}}catch(e){h.e(e)}finally{h.f()}}if(ai){var P=S+g;n.setAttribute("rowspan",P,O)}}}catch(e){w.e(e)}finally{w.f()}var j={};u>1&&(j.colspan=u),vFe(n,o,i+1,g,1,j);var E=o.getAttribute("headingRows")||0;E>i&&XAe("headingRows",E+g,o,n)}}))}},{key:"getColumns",value:function(e){return uFe(e.getChild(0).getChildren()).reduce((function(e,t){return e+parseInt(t.getAttribute("colspan")||1)}),0)}},{key:"getRows",value:function(e){return e.childCount}}])&&pFe(t.prototype,n),r&&pFe(t,r),i}(Qoe);function vFe(e,t,n,r,o){for(var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},a=0;a3&&void 0!==arguments[3]?arguments[3]:{},o=0;o=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function SFe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:{},n=this.editor.model,r=t.at||0,o=t.rows||1,i=void 0!==t.copyStructureFromAbove,a=t.copyStructureFromAbove?r-1:r,u=this.getRows(e),l=this.getColumns(e);n.change((function(t){var n=e.getAttribute("headingRows")||0;if(n>r&&sLe("headingRows",n+o,e,t,0),i||0!==r&&r!==u){var s,c=i?Math.max(r,a):r,f=new gLe(e,{endRow:c}),p=new Array(l).fill(1),d=vFe(f);try{for(d.s();!(s=d.n()).done;){var h=s.value,y=h.row,m=h.column,b=h.cellHeight,v=h.cellWidth,g=h.cell,w=y+b-1,_=y<=a&&a<=w;y0&&cLe(t,j,P>1?{colspan:P}:null),k+=Math.abs(P)-1}}}else CFe(t,e,r,o,l)}))}},{key:"insertColumns",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.editor.model,o=n.at||0,i=n.columns||1;r.change((function(n){var r=e.getAttribute("headingColumns");o=t&&l<=n&&p>n){var d=c-(n-l+1);o.set(s,{cell:f,rowspan:d})}if(l=t){var h=void 0;h=p>=n?n-t+1:p-t+1,i.push({cell:f,rowspan:c-h})}}}catch(e){a.e(e)}finally{a.f()}return{cellsToMove:o,cellsToTrim:i}}(e,i,a),o=r.cellsToMove,u=r.cellsToTrim;o.size&&function(e,t,n,r){var o,i,a=bFe(new gLe(e,{includeAllSlots:!0,row:t})),u=e.getChild(t),l=vFe(a);try{for(l.s();!(i=l.n()).done;){var s=i.value,c=s.column,f=s.cell,p=s.isAnchor;if(n.has(c)){var d=n.get(c),h=d.cell,y=d.rowspan,m=o?r.createPositionAfter(o):r.createPositionAt(u,0);r.move(r.createRangeOn(h),m),sLe("rowspan",y,h,r),o=h}else p&&(o=f)}}catch(e){l.e(e)}finally{l.f()}}(e,a+1,o,t);for(var l=a;l>=i;l--)t.remove(e.getChild(l));var s,c=vFe(u);try{for(c.s();!(s=c.n()).done;){var f=s.value;sLe("rowspan",f.rowspan,f.cell,t)}}catch(e){c.e(e)}finally{c.f()}!function(e,t,n,r){var o=e.getAttribute("headingRows")||0;t=o;r--)for(var i=0,u=bFe(new gLe(e));i1&&c+f>r?sLe("colspan",f-1,s,t):c===r&&t.remove(s)}hze(e,n)||dze(e,n)}))}},{key:"splitCellVertically",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,n=this.editor.model,r=e.parent,o=r.parent,i=parseInt(e.getAttribute("rowspan")||1),a=parseInt(e.getAttribute("colspan")||1);n.change((function(n){if(a>1){var r=TFe(a,t),u=r.newCellsSpan;sLe("colspan",r.updatedSpan,e,n);var l={};u>1&&(l.colspan=u),i>1&&(l.rowspan=i),xFe(a>t?t-1:a-1,n,n.createPositionAfter(e),l)}if(ap})));try{for(d.s();!(s=d.n()).done;){var h=s.value,y=h.cell,m=h.cellWidth;n.setAttribute("colspan",m+c,y)}}catch(e){d.e(e)}finally{d.f()}var b={};i>1&&(b.rowspan=i),xFe(c,n,n.createPositionAfter(e),b);var v=o.getAttribute("headingColumns")||0;v>p&&sLe("headingColumns",v+c,o,n)}}))}},{key:"splitCellHorizontally",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,n=this.editor.model,r=e.parent,o=r.parent,i=o.getChildIndex(r),a=parseInt(e.getAttribute("rowspan")||1),u=parseInt(e.getAttribute("colspan")||1);n.change((function(n){if(a>1){var r=bFe(new gLe(o,{startRow:i,endRow:i+a-1,includeAllSlots:!0})),l=TFe(a,t),s=l.newCellsSpan,c=l.updatedSpan;sLe("rowspan",c,e,n);var f=r.find((function(t){return t.cell===e})).column,p={};s>1&&(p.rowspan=s),u>1&&(p.colspan=u);var d,h=vFe(r);try{for(h.s();!(d=h.n()).done;){var y=d.value,m=y.column,b=y.row;b>=i+c&&m===f&&(b+i+c)%s==0&&xFe(1,n,y.getPositionBefore(),p)}}catch(e){h.e(e)}finally{h.f()}}if(ai){var P=S+g;n.setAttribute("rowspan",P,O)}}}catch(e){w.e(e)}finally{w.f()}var j={};u>1&&(j.colspan=u),CFe(n,o,i+1,g,1,j);var E=o.getAttribute("headingRows")||0;E>i&&sLe("headingRows",E+g,o,n)}}))}},{key:"getColumns",value:function(e){return bFe(e.getChild(0).getChildren()).reduce((function(e,t){return e+parseInt(t.getAttribute("colspan")||1)}),0)}},{key:"getRows",value:function(e){return e.childCount}}])&&OFe(t.prototype,n),r&&OFe(t,r),i}(lie);function CFe(e,t,n,r,o){for(var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},a=0;a3&&void 0!==arguments[3]?arguments[3]:{},o=0;o=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function MFe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function IFe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function qFe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0}},{key:"execute",value:function(){for(var e=this.editor.model,t=yIe(e.document.selection),n=mIe(t),r=t[0].findAncestor("table"),o=[],i=n.first;i<=n.last;i++){var a,u=LFe(r.getChild(i).getChildren());try{for(u.s();!(a=u.n()).done;){var l=a.value;o.push(e.createRangeOn(l))}}catch(e){u.e(e)}finally{u.f()}}e.change((function(e){e.setSelection(o)}))}}])&&FFe(t.prototype,n),r&&FFe(t,r),i}(tie);function WFe(e){return(WFe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function UFe(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return qFe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return qFe(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function qFe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0}},{key:"execute",value:function(){for(var e=this.editor.model,t=PIe(e.document.selection),n=jIe(t),r=t[0].findAncestor("table"),o=[],i=n.first;i<=n.last;i++){var a,u=UFe(r.getChild(i).getChildren());try{for(u.s();!(a=u.n()).done;){var l=a.value;o.push(e.createRangeOn(l))}}catch(e){u.e(e)}finally{u.f()}}e.change((function(e){e.setSelection(o)}))}}])&&$Fe(t.prototype,n),r&&$Fe(t,r),i}(fie);function eYe(e){return(eYe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function tYe(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return nYe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return nYe(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function nYe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0}},{key:"execute",value:function(){var e,t=this.editor.model,n=yIe(t.document.selection),r=n[0],o=n.pop(),i=r.findAncestor("table"),a=this.editor.plugins.get("TableUtils"),u=a.getCellLocation(r),l=a.getCellLocation(o),s=Math.min(u.column,l.column),c=Math.max(u.column,l.column),f=[],p=UFe(new sLe(i,{startColumn:s,endColumn:c}));try{for(p.s();!(e=p.n()).done;){var d=e.value;f.push(t.createRangeOn(d.cell))}}catch(e){p.e(e)}finally{p.f()}t.change((function(e){e.setSelection(f)}))}}])&&$Fe(t.prototype,n),r&&$Fe(t,r),i}(tie);function eYe(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n}(e,t)||nYe(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function tYe(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=nYe(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function nYe(e,t){if(e){if("string"==typeof e)return rYe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?rYe(e,t):void 0}}function rYe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0}},{key:"execute",value:function(){var e,t=this.editor.model,n=PIe(t.document.selection),r=n[0],o=n.pop(),i=r.findAncestor("table"),a=this.editor.plugins.get("TableUtils"),u=a.getCellLocation(r),l=a.getCellLocation(o),s=Math.min(u.column,l.column),c=Math.max(u.column,l.column),f=[],p=tYe(new gLe(i,{startColumn:s,endColumn:c}));try{for(p.s();!(e=p.n()).done;){var d=e.value;f.push(t.createRangeOn(d.cell))}}catch(e){p.e(e)}finally{p.f()}t.change((function(e){e.setSelection(f)}))}}])&&oYe(t.prototype,n),r&&oYe(t,r),i}(fie);function cYe(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n}(e,t)||pYe(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function fYe(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=pYe(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function pYe(e,t){if(e){if("string"==typeof e)return dYe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?dYe(e,t):void 0}}function dYe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);nc){var f=c-u;o.push({cell:l,rowspan:f})}}}}catch(e){i.e(e)}finally{i.f()}return o}(e);if(r.length){n=!0;var o,i=tYe(r);try{for(i.s();!(o=i.n()).done;){var a=o.value;XAe("rowspan",a.rowspan,a.cell,t,1)}}catch(e){i.e(e)}finally{i.f()}}return n}function aYe(e,t){var n,r=!1,o=function(e){var t,n=new Array(e.childCount).fill(0),r=tYe(new sLe(e,{includeAllSlots:!0}));try{for(r.s();!(t=r.n()).done;){var o=t.value.row;n[o]++}}catch(e){r.e(e)}finally{r.f()}return n}(e),i=[],a=tYe(o.entries());try{for(a.s();!(n=a.n()).done;){var u=eYe(n.value,2),l=u[0];u[1]||i.push(l)}}catch(e){a.e(e)}finally{a.f()}if(i.length){r=!0;var s,c=tYe(i.reverse());try{for(c.s();!(s=c.n()).done;){var f=s.value;t.remove(e.getChild(f)),o.splice(f,1)}}catch(e){c.e(e)}finally{c.f()}}var p=o[0];if(!o.every((function(e){return e===p}))){var d,h=o.reduce((function(e,t){return t>e?t:e}),0),y=tYe(o.entries());try{for(y.s();!(d=y.n()).done;){var m=eYe(d.value,2),b=m[0],v=h-m[1];if(v){for(var g=0;g=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function sYe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);nc){var f=c-u;o.push({cell:l,rowspan:f})}}}}catch(e){i.e(e)}finally{i.f()}return o}(e);if(r.length){n=!0;var o,i=fYe(r);try{for(i.s();!(o=i.n()).done;){var a=o.value;sLe("rowspan",a.rowspan,a.cell,t,1)}}catch(e){i.e(e)}finally{i.f()}}return n}function mYe(e,t){var n,r=!1,o=function(e){var t,n=new Array(e.childCount).fill(0),r=fYe(new gLe(e,{includeAllSlots:!0}));try{for(r.s();!(t=r.n()).done;){var o=t.value.row;n[o]++}}catch(e){r.e(e)}finally{r.f()}return n}(e),i=[],a=fYe(o.entries());try{for(a.s();!(n=a.n()).done;){var u=cYe(n.value,2),l=u[0];u[1]||i.push(l)}}catch(e){a.e(e)}finally{a.f()}if(i.length){r=!0;var s,c=fYe(i.reverse());try{for(c.s();!(s=c.n()).done;){var f=s.value;t.remove(e.getChild(f)),o.splice(f,1)}}catch(e){c.e(e)}finally{c.f()}}var p=o[0];if(!o.every((function(e){return e===p}))){var d,h=o.reduce((function(e,t){return t>e?t:e}),0),y=fYe(o.entries());try{for(y.s();!(d=y.n()).done;){var m=cYe(d.value,2),b=m[0],v=h-m[1];if(v){for(var g=0;g=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function gYe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function bYe(e,t){if(e){if("string"==typeof e)return vYe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?vYe(e,t):void 0}}function vYe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function EYe(e,t){if(e){if("string"==typeof e)return CYe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?CYe(e,t):void 0}}function CYe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function OYe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function RYe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);nu?a:u)-1}));try{for(l.s();!(o=l.n()).done;)KLe(o.value,i,n)}catch(e){l.e(e)}finally{l.f()}}}))})),e.commands.add("insertTable",new lIe(e)),e.commands.add("insertTableRowAbove",new TIe(e,{order:"above"})),e.commands.add("insertTableRowBelow",new TIe(e,{order:"below"})),e.commands.add("insertTableColumnLeft",new FIe(e,{order:"left"})),e.commands.add("insertTableColumnRight",new FIe(e,{order:"right"})),e.commands.add("removeTableRow",new Eze(e)),e.commands.add("removeTableColumn",new Yze(e)),e.commands.add("splitTableCellVertically",new qIe(e,{direction:"vertically"})),e.commands.add("splitTableCellHorizontally",new qIe(e,{direction:"horizontally"})),e.commands.add("mergeTableCells",new TFe(e)),e.commands.add("mergeTableCellRight",new mze(e,{direction:"right"})),e.commands.add("mergeTableCellLeft",new mze(e,{direction:"left"})),e.commands.add("mergeTableCellDown",new mze(e,{direction:"down"})),e.commands.add("mergeTableCellUp",new mze(e,{direction:"up"})),e.commands.add("setTableColumnHeader",new iFe(e)),e.commands.add("setTableRowHeader",new Gze(e)),e.commands.add("selectTableRow",new VFe(e)),e.commands.add("selectTableColumn",new XFe(e)),SYe(t),oYe(t),gYe(t,e.editing.mapper),cYe(t)}}])&&jYe(t.prototype,n),r&&jYe(t,r),i}(Qoe);n(669);function RYe(e){return(RYe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function MYe(e,t){for(var n=0;nu?a:u)-1}));try{for(l.s();!(o=l.n()).done;)rIe(o.value,i,n)}catch(e){l.e(e)}finally{l.f()}}}))})),e.commands.add("insertTable",new vIe(e)),e.commands.add("insertTableRowAbove",new NIe(e,{order:"above"})),e.commands.add("insertTableRowBelow",new NIe(e,{order:"below"})),e.commands.add("insertTableColumnLeft",new $Ie(e,{order:"left"})),e.commands.add("insertTableColumnRight",new $Ie(e,{order:"right"})),e.commands.add("removeTableRow",new zze(e)),e.commands.add("removeTableColumn",new Gze(e)),e.commands.add("splitTableCellVertically",new nze(e,{direction:"vertically"})),e.commands.add("splitTableCellHorizontally",new nze(e,{direction:"horizontally"})),e.commands.add("mergeTableCells",new NFe(e)),e.commands.add("mergeTableCellRight",new jze(e,{direction:"right"})),e.commands.add("mergeTableCellLeft",new jze(e,{direction:"left"})),e.commands.add("mergeTableCellDown",new jze(e,{direction:"down"})),e.commands.add("mergeTableCellUp",new jze(e,{direction:"up"})),e.commands.add("setTableColumnHeader",new yFe(e)),e.commands.add("setTableRowHeader",new iFe(e)),e.commands.add("selectTableRow",new XFe(e)),e.commands.add("selectTableColumn",new sYe(e)),MYe(t),hYe(t),xYe(t,e.editing.mapper),wYe(t)}}])&&IYe(t.prototype,n),r&&IYe(t,r),i}(lie);n(669);function HYe(e){return(HYe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function VYe(e,t){for(var n=0;n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function XYe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function sNe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n',label:n("Insert table"),tooltip:!0}),i.on("change:isOpen",(function(){r||(r=new GYe(e),i.panelView.children.add(r),r.delegate("execute").to(i),i.buttonView.on("open",(function(){r.rows=0,r.columns=0})),i.on("execute",(function(){t.execute("insertTable",{rows:r.rows,columns:r.columns}),t.editing.view.focus()})))})),i})),t.ui.componentFactory.add("tableColumn",(function(t){var o=[{type:"switchbutton",model:{commandName:"setTableColumnHeader",label:n("Header column"),bindIsOn:!0}},{type:"separator"},{type:"button",model:{commandName:r?"insertTableColumnLeft":"insertTableColumnRight",label:n("Insert column left")}},{type:"button",model:{commandName:r?"insertTableColumnRight":"insertTableColumnLeft",label:n("Insert column right")}},{type:"button",model:{commandName:"removeTableColumn",label:n("Delete column")}},{type:"button",model:{commandName:"selectTableColumn",label:n("Select column")}}];return e._prepareDropdown(n("Column"),'',o,t)})),t.ui.componentFactory.add("tableRow",(function(t){var r=[{type:"switchbutton",model:{commandName:"setTableRowHeader",label:n("Header row"),bindIsOn:!0}},{type:"separator"},{type:"button",model:{commandName:"insertTableRowAbove",label:n("Insert row above")}},{type:"button",model:{commandName:"insertTableRowBelow",label:n("Insert row below")}},{type:"button",model:{commandName:"removeTableRow",label:n("Delete row")}},{type:"button",model:{commandName:"selectTableRow",label:n("Select row")}}];return e._prepareDropdown(n("Row"),'',r,t)})),t.ui.componentFactory.add("mergeTableCells",(function(t){var o=[{type:"button",model:{commandName:"mergeTableCellUp",label:n("Merge cell up")}},{type:"button",model:{commandName:r?"mergeTableCellRight":"mergeTableCellLeft",label:n("Merge cell right")}},{type:"button",model:{commandName:"mergeTableCellDown",label:n("Merge cell down")}},{type:"button",model:{commandName:r?"mergeTableCellLeft":"mergeTableCellRight",label:n("Merge cell left")}},{type:"separator"},{type:"button",model:{commandName:"splitTableCellVertically",label:n("Split cell vertically")}},{type:"button",model:{commandName:"splitTableCellHorizontally",label:n("Split cell horizontally")}}];return e._prepareMergeSplitButtonDropdown(n("Merge cells"),'',o,t)}))}},{key:"_prepareDropdown",value:function(e,t,n,r){var o=this.editor,i=ece(r),a=this._fillDropdownWithListOptions(i,n);return i.buttonView.set({label:e,icon:t,tooltip:!0}),i.bind("isEnabled").toMany(a,"isEnabled",(function(){for(var e=arguments.length,t=new Array(e),n=0;n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function fNe(e){return function(e){if(Array.isArray(e))return dNe(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||pNe(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function pNe(e,t){if(e){if("string"==typeof e)return dNe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?dNe(e,t):void 0}}function dNe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n',label:n("Insert table"),tooltip:!0}),i.on("change:isOpen",(function(){r||(r=new iNe(e),i.panelView.children.add(r),r.delegate("execute").to(i),i.buttonView.on("open",(function(){r.rows=0,r.columns=0})),i.on("execute",(function(){t.execute("insertTable",{rows:r.rows,columns:r.columns}),t.editing.view.focus()})))})),i})),t.ui.componentFactory.add("tableColumn",(function(t){var o=[{type:"switchbutton",model:{commandName:"setTableColumnHeader",label:n("Header column"),bindIsOn:!0}},{type:"separator"},{type:"button",model:{commandName:r?"insertTableColumnLeft":"insertTableColumnRight",label:n("Insert column left")}},{type:"button",model:{commandName:r?"insertTableColumnRight":"insertTableColumnLeft",label:n("Insert column right")}},{type:"button",model:{commandName:"removeTableColumn",label:n("Delete column")}},{type:"button",model:{commandName:"selectTableColumn",label:n("Select column")}}];return e._prepareDropdown(n("Column"),'',o,t)})),t.ui.componentFactory.add("tableRow",(function(t){var r=[{type:"switchbutton",model:{commandName:"setTableRowHeader",label:n("Header row"),bindIsOn:!0}},{type:"separator"},{type:"button",model:{commandName:"insertTableRowAbove",label:n("Insert row above")}},{type:"button",model:{commandName:"insertTableRowBelow",label:n("Insert row below")}},{type:"button",model:{commandName:"removeTableRow",label:n("Delete row")}},{type:"button",model:{commandName:"selectTableRow",label:n("Select row")}}];return e._prepareDropdown(n("Row"),'',r,t)})),t.ui.componentFactory.add("mergeTableCells",(function(t){var o=[{type:"button",model:{commandName:"mergeTableCellUp",label:n("Merge cell up")}},{type:"button",model:{commandName:r?"mergeTableCellRight":"mergeTableCellLeft",label:n("Merge cell right")}},{type:"button",model:{commandName:"mergeTableCellDown",label:n("Merge cell down")}},{type:"button",model:{commandName:r?"mergeTableCellLeft":"mergeTableCellRight",label:n("Merge cell left")}},{type:"separator"},{type:"button",model:{commandName:"splitTableCellVertically",label:n("Split cell vertically")}},{type:"button",model:{commandName:"splitTableCellHorizontally",label:n("Split cell horizontally")}}];return e._prepareMergeSplitButtonDropdown(n("Merge cells"),'',o,t)}))}},{key:"_prepareDropdown",value:function(e,t,n,r){var o=this.editor,i=cce(r),a=this._fillDropdownWithListOptions(i,n);return i.buttonView.set({label:e,icon:t,tooltip:!0}),i.bind("isEnabled").toMany(a,"isEnabled",(function(){for(var e=arguments.length,t=new Array(e),n=0;n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function _Ne(e){return function(e){if(Array.isArray(e))return SNe(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||ONe(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ONe(e,t){if(e){if("string"==typeof e)return SNe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?SNe(e,t):void 0}}function SNe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function SNe(e){return function(e){if(Array.isArray(e))return PNe(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||kNe(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function kNe(e,t){if(e){if("string"==typeof e)return PNe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?PNe(e,t):void 0}}function PNe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function MNe(e){return function(e){if(Array.isArray(e))return LNe(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||ANe(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ANe(e,t){if(e){if("string"==typeof e)return LNe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?LNe(e,t):void 0}}function LNe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);no&&r.insertColumns(e,{at:o,columns:n-o}),t>i&&r.insertRows(e,{at:i,rows:t-i})}(o,u.lastRow+1,u.lastColumn+1,r)),l||!vIe(e,r)?function(e,t,n){var r=t.firstRow,o=t.lastRow,i=t.firstColumn,a=t.lastColumn,u={first:r,last:o},l={first:i,last:a};ANe(e,i,u,n),ANe(e,a+1,u,n),MNe(e,r,l,n),MNe(e,o+1,l,n,r)}(o,u,n):(u.lastRow=aze(o,u),u.lastColumn=uze(o,u)),u}(u,t,e,i),o=n.lastRow-n.firstRow+1,l=n.lastColumn-n.firstColumn+1,s={startRow:0,startColumn:0,endRow:Math.min(o,t.height)-1,endColumn:Math.min(l,t.width)-1};a=JIe(a,s,e);var c=u[0].findAncestor("table"),f=r._replaceSelectedCellsWithPasted(a,t,c,n,e);if(r.editor.plugins.get("TableSelection").isEnabled){var p=gIe(f.map((function(t){return e.createRangeOn(t)})));e.setSelection(p)}else e.setSelection(f[0],0)}))):ize(a,i)}}}},{key:"_replaceSelectedCellsWithPasted",value:function(e,t,n,r,o){var i,a,u=t.width,l=t.height,s=function(e,t,n){var r,o=new Array(n).fill(null).map((function(){return new Array(t).fill(null)})),i=ONe(new sLe(e));try{for(i.s();!(r=i.n()).done;){var a=r.value,u=a.column,l=a.row,s=a.cell;o[l][u]=s}}catch(e){i.e(e)}finally{i.f()}return o}(e,u,l),c=[],f=ONe(SNe(new sLe(n,{startRow:r.firstRow,endRow:r.lastRow,startColumn:r.firstColumn,endColumn:r.lastColumn,includeAllSlots:!0})));try{for(f.s();!(a=f.n()).done;){var p=a.value,d=p.row,h=p.column;h===r.firstColumn&&(i=p.getPositionBefore());var y=d-r.firstRow,m=h-r.firstColumn,b=s[y%l][m%u],v=b?o.cloneElement(b):null,g=this._replaceTableSlotCell(p,v,i,o);g&&(nze(g,d,h,r.lastRow,r.lastColumn,o),c.push(g),i=o.createPositionAfter(g))}}catch(e){f.e(e)}finally{f.f()}var w=parseInt(n.getAttribute("headingRows")||0),_=parseInt(n.getAttribute("headingColumns")||0),O=r.firstRow4&&void 0!==arguments[4]?arguments[4]:0;if(!(t<1)){var i=QIe(e,t,o),a=i.filter((function(e){return LNe(e.column,e.cellWidth,n)}));return a.map((function(e){return XIe(e.cell,t,r)}))}}function ANe(e,t,n,r){if(!(t<1))return eze(e,t).filter((function(e){return LNe(e.row,e.cellHeight,n)})).map((function(e){return tze(e.cell,e.column,t,r)}))}function LNe(e,t,n){var r=e+t-1,o=n.first,i=n.last;return e>=o&&e<=i||e=o}function INe(e){return(INe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function zNe(e){return function(e){if(Array.isArray(e))return FNe(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return FNe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return FNe(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function FNe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);no&&r.insertColumns(e,{at:o,columns:n-o}),t>i&&r.insertRows(e,{at:i,rows:t-i})}(o,u.lastRow+1,u.lastColumn+1,r)),l||!CIe(e,r)?function(e,t,n){var r=t.firstRow,o=t.lastRow,i=t.firstColumn,a=t.lastColumn,u={first:r,last:o},l={first:i,last:a};WNe(e,i,u,n),WNe(e,a+1,u,n),VNe(e,r,l,n),VNe(e,o+1,l,n,r)}(o,u,n):(u.lastRow=mze(o,u),u.lastColumn=bze(o,u)),u}(u,t,e,i),o=n.lastRow-n.firstRow+1,l=n.lastColumn-n.firstColumn+1,s={startRow:0,startColumn:0,endRow:Math.min(o,t.height)-1,endColumn:Math.min(l,t.width)-1};a=uze(a,s,e);var c=u[0].findAncestor("table"),f=r._replaceSelectedCellsWithPasted(a,t,c,n,e);if(r.editor.plugins.get("TableSelection").isEnabled){var p=xIe(f.map((function(t){return e.createRangeOn(t)})));e.setSelection(p)}else e.setSelection(f[0],0)}))):yze(a,i)}}}},{key:"_replaceSelectedCellsWithPasted",value:function(e,t,n,r,o){var i,a,u=t.width,l=t.height,s=function(e,t,n){var r,o=new Array(n).fill(null).map((function(){return new Array(t).fill(null)})),i=RNe(new gLe(e));try{for(i.s();!(r=i.n()).done;){var a=r.value,u=a.column,l=a.row,s=a.cell;o[l][u]=s}}catch(e){i.e(e)}finally{i.f()}return o}(e,u,l),c=[],f=RNe(MNe(new gLe(n,{startRow:r.firstRow,endRow:r.lastRow,startColumn:r.firstColumn,endColumn:r.lastColumn,includeAllSlots:!0})));try{for(f.s();!(a=f.n()).done;){var p=a.value,d=p.row,h=p.column;h===r.firstColumn&&(i=p.getPositionBefore());var y=d-r.firstRow,m=h-r.firstColumn,b=s[y%l][m%u],v=b?o.cloneElement(b):null,g=this._replaceTableSlotCell(p,v,i,o);g&&(pze(g,d,h,r.lastRow,r.lastColumn,o),c.push(g),i=o.createPositionAfter(g))}}catch(e){f.e(e)}finally{f.f()}var w=parseInt(n.getAttribute("headingRows")||0),_=parseInt(n.getAttribute("headingColumns")||0),O=r.firstRow4&&void 0!==arguments[4]?arguments[4]:0;if(!(t<1)){var i=lze(e,t,o),a=i.filter((function(e){return UNe(e.column,e.cellWidth,n)}));return a.map((function(e){return sze(e.cell,t,r)}))}}function WNe(e,t,n,r){if(!(t<1))return cze(e,t).filter((function(e){return UNe(e.row,e.cellHeight,n)})).map((function(e){return fze(e.cell,e.column,t,r)}))}function UNe(e,t,n){var r=e+t-1,o=n.first,i=n.last;return e>=o&&e<=i||e=o}function qNe(e){return(qNe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function KNe(e){return function(e){if(Array.isArray(e))return $Ne(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return $Ne(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return $Ne(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $Ne(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]&&arguments[2],r=this.editor.model,o=e.findAncestor("table"),i=zNe(new sLe(o,{includeAllSlots:!0})),a=i[i.length-1],u=a.row,l=a.column,s=i.find((function(t){return t.cell==e})),c=s.row,f=s.column;switch(t){case"left":f--;break;case"up":c--;break;case"right":f+=s.cellWidth;break;case"down":c+=s.cellHeight}var p=c<0||c>u,d=f<0&&c<=0,h=f>l&&c>=u;if(p||d||h)r.change((function(e){e.setSelection(e.createRangeOn(o))}));else{f<0?(f=n?0:l,c--):f>l&&(f=n?l:0,c++);var y=i.find((function(e){return e.row==c&&e.column==f})).cell,m=["right","down"].includes(t),b=this.editor.plugins.get("TableSelection");if(n&&b.isEnabled){var v=b.getAnchorCell()||e;b.setCellSelection(v,y)}else{var g=r.createPositionAt(y,m?0:"end");r.change((function(e){e.setSelection(g)}))}}}}])&&NNe(t.prototype,n),r&&NNe(t,r),i}(Qoe);function qNe(e){return(qNe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function KNe(e,t){for(var n=0;n2&&void 0!==arguments[2]&&arguments[2],r=this.editor.model,o=e.findAncestor("table"),i=KNe(new gLe(o,{includeAllSlots:!0})),a=i[i.length-1],u=a.row,l=a.column,s=i.find((function(t){return t.cell==e})),c=s.row,f=s.column;switch(t){case"left":f--;break;case"up":c--;break;case"right":f+=s.cellWidth;break;case"down":c+=s.cellHeight}var p=c<0||c>u,d=f<0&&c<=0,h=f>l&&c>=u;if(p||d||h)r.change((function(e){e.setSelection(e.createRangeOn(o))}));else{f<0?(f=n?0:l,c--):f>l&&(f=n?l:0,c++);var y=i.find((function(e){return e.row==c&&e.column==f})).cell,m=["right","down"].includes(t),b=this.editor.plugins.get("TableSelection");if(n&&b.isEnabled){var v=b.getAnchorCell()||e;b.setCellSelection(v,y)}else{var g=r.createPositionAt(y,m?0:"end");r.change((function(e){e.setSelection(g)}))}}}}])&&ZNe(t.prototype,n),r&&ZNe(t,r),i}(lie);function nBe(e){return(nBe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function rBe(e,t){for(var n=0;n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function vBe(e,t){if(e){if("string"==typeof e)return gBe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?gBe(e,t):void 0}}function gBe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function CBe(e,t){if(e){if("string"==typeof e)return xBe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?xBe(e,t):void 0}}function xBe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n',"image/svg+xml").firstChild,CBe=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&OBe(e,t)}(n,e);var t=SBe(n);function n(e){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),(r=t.call(this,e))._currentFakeCaretModelElement=null,r}return _Be(n,null,[{key:"pluginName",get:function(){return"WidgetTypeAround"}}]),_Be(n,[{key:"init",value:function(){var e=this.editor,t=e.editing.view;this.on("change:isEnabled",(function(n,r,o){t.change((function(e){var n,r=bBe(t.document.roots);try{for(r.s();!(n=r.n()).done;){var i=n.value;o?e.removeClass("ck-widget__type-around_disabled",i):e.addClass("ck-widget__type-around_disabled",i)}}catch(e){r.e(e)}finally{r.f()}})),o||e.model.change((function(e){e.removeSelectionAttribute("widget-type-around")}))})),this._enableTypeAroundUIInjection(),this._enableInsertingParagraphsOnButtonClick(),this._enableInsertingParagraphsOnEnterKeypress(),this._enableInsertingParagraphsOnTypingKeystroke(),this._enableTypeAroundFakeCaretActivationUsingKeyboardArrows(),this._enableDeleteIntegration(),this._enableInsertContentIntegration()}},{key:"destroy",value:function(){this._currentFakeCaretModelElement=null}},{key:"_insertParagraph",value:function(e,t){var n=this.editor,r=n.editing.view;n.execute("insertParagraph",{position:n.model.createPositionAt(e,t)}),r.focus(),r.scrollToTheSelection()}},{key:"_listenToIfEnabled",value:function(e,t,n,r){var o=this;this.listenTo(e,t,(function(){o.isEnabled&&n.apply(void 0,arguments)}),r)}},{key:"_insertParagraphAccordingToFakeCaretPosition",value:function(){var e=this.editor.model.document.selection,t=xLe(e);if(!t)return!1;var n=e.getSelectedElement();return this._insertParagraph(n,t),!0}},{key:"_enableTypeAroundUIInjection",value:function(){var e=this.editor,t=e.model.schema,n=e.locale.t,r={before:n("Insert paragraph before block"),after:n("Insert paragraph after block")};e.editing.downcastDispatcher.on("insert",(function(e,n,o){var i=o.mapper.toViewElement(n.item);CLe(i,n.item,t)&&function(e,t,n){var r=e.createUIElement("div",{class:"ck ck-reset_all ck-widget__type-around"},(function(e){var n=this.toDomElement(e);return function(e,t){var n,r=bBe(jBe);try{for(r.s();!(n=r.n()).done;){var o=n.value,i=new Lae({tag:"div",attributes:{class:["ck","ck-widget__type-around__button","ck-widget__type-around__button_".concat(o)],title:t[o]},children:[e.ownerDocument.importNode(EBe,!0)]});e.appendChild(i.render())}}catch(e){r.e(e)}finally{r.f()}}(n,t),function(e){var t=new Lae({tag:"div",attributes:{class:["ck","ck-widget__type-around__fake-caret"]}});e.appendChild(t.render())}(n),n}));e.insert(e.createPositionAt(n,"end"),r)}(o.writer,r,i)}),{priority:"low"})}},{key:"_enableTypeAroundFakeCaretActivationUsingKeyboardArrows",value:function(){var e=this,t=this.editor,n=t.model,r=n.document.selection,o=n.schema,i=t.editing.view;function a(e){return"ck-widget_type-around_show-fake-caret_".concat(e)}this._listenToIfEnabled(i.document,"keydown",(function(t,n){Tue(n.keyCode)&&e._handleArrowKeyPress(t,n)}),{priority:yoe.get("high")+10}),this._listenToIfEnabled(r,"change:range",(function(e,n){n.directChange&&t.model.change((function(e){e.removeSelectionAttribute("widget-type-around")}))})),this._listenToIfEnabled(n.document,"change:data",(function(){var e=r.getSelectedElement();if(e&&CLe(t.editing.mapper.toViewElement(e),e,o))return;t.model.change((function(e){e.removeSelectionAttribute("widget-type-around")}))})),this._listenToIfEnabled(t.editing.downcastDispatcher,"selection",(function(t,n,r){var i=r.writer;if(e._currentFakeCaretModelElement){var u=r.mapper.toViewElement(e._currentFakeCaretModelElement);u&&(i.removeClass(jBe.map(a),u),e._currentFakeCaretModelElement=null)}var l=n.selection.getSelectedElement();if(l){var s=r.mapper.toViewElement(l);if(CLe(s,l,o)){var c=xLe(n.selection);c&&(i.addClass(a(c),s),e._currentFakeCaretModelElement=l)}}})),this._listenToIfEnabled(t.ui.focusTracker,"change:isFocused",(function(e,n,r){r||t.model.change((function(e){e.removeSelectionAttribute("widget-type-around")}))}))}},{key:"_handleArrowKeyPress",value:function(e,t){var n,r=this.editor,o=r.model,i=o.document.selection,a=o.schema,u=r.editing.view,l=Rue(t.keyCode,r.locale.contentLanguageDirection),s=u.document.selection.getSelectedElement();CLe(s,r.editing.mapper.toModelElement(s),a)?n=this._handleArrowKeyPressOnSelectedWidget(l):i.isCollapsed&&(n=this._handleArrowKeyPressWhenSelectionNextToAWidget(l)),n&&(t.preventDefault(),e.stop())}},{key:"_handleArrowKeyPressOnSelectedWidget",value:function(e){var t=this.editor.model,n=xLe(t.document.selection);return t.change((function(t){return n?n!==(e?"after":"before")&&(t.removeSelectionAttribute("widget-type-around"),!0):(t.setSelectionAttribute("widget-type-around",e?"after":"before"),!0)}))}},{key:"_handleArrowKeyPressWhenSelectionNextToAWidget",value:function(e){var t=this.editor,n=t.model,r=n.schema,o=t.plugins.get("Widget"),i=o._getObjectElementNextToSelection(e);return!!CLe(t.editing.mapper.toViewElement(i),i,r)&&(n.change((function(t){o._setSelectionOverElement(i),t.setSelectionAttribute("widget-type-around",e?"before":"after")})),!0)}},{key:"_enableInsertingParagraphsOnButtonClick",value:function(){var e=this,t=this.editor,n=t.editing.view;this._listenToIfEnabled(n.document,"mousedown",(function(r,o){var i=o.domTarget.closest(".ck-widget__type-around__button");if(i){var a=function(e){return e.classList.contains("ck-widget__type-around__button_before")?"before":"after"}(i),u=function(e,t){var n=e.closest(".ck-widget");return t.mapDomToView(n)}(i,n.domConverter),l=t.editing.mapper.toModelElement(u);e._insertParagraph(l,a),o.preventDefault(),r.stop()}}))}},{key:"_enableInsertingParagraphsOnEnterKeypress",value:function(){var e=this,t=this.editor,n=t.editing.view;this._listenToIfEnabled(n.document,"enter",(function(r,o){var i,a=n.document.selection.getSelectedElement(),u=t.editing.mapper.toModelElement(a),l=t.model.schema;e._insertParagraphAccordingToFakeCaretPosition()?i=!0:CLe(a,u,l)&&(e._insertParagraph(u,o.isSoft?"before":"after"),i=!0),i&&(o.preventDefault(),r.stop())}))}},{key:"_enableInsertingParagraphsOnTypingKeystroke",value:function(){var e=this,t=this.editor.editing.view,n=[jue.enter,jue.delete,jue.backspace];this._listenToIfEnabled(t.document,"keydown",(function(t,r){n.includes(r.keyCode)||ACe(r)||e._insertParagraphAccordingToFakeCaretPosition()}),{priority:yoe.get("high")+1})}},{key:"_enableDeleteIntegration",value:function(){var e=this.editor,t=e.editing.view,n=e.model,r=n.schema;this._listenToIfEnabled(t.document,"delete",(function(t,o){var i=xLe(n.document.selection);if(i){var a=o.direction,u=n.document.selection.getSelectedElement(),l="forward"==a;if("before"===i===l)e.execute("delete",{selection:n.createSelection(u,"on")});else{var s=r.getNearestSelectionRange(n.createPositionAt(u,i),a);if(s)if(s.isCollapsed){var c=n.createSelection(s.start);if(n.modifySelection(c,{direction:a}),c.focus.isEqual(s.start)){var f=function(e,t){var n,r=t,o=bBe(t.getAncestors({parentFirst:!0}));try{for(o.s();!(n=o.n()).done;){var i=n.value;if(i.childCount>1||e.isLimit(i))break;r=i}}catch(e){o.e(e)}finally{o.f()}return r}(r,s.start.parent);n.deleteContent(n.createSelection(f,"on"),{doNotAutoparagraph:!0})}else n.change((function(t){t.setSelection(s),e.execute(l?"forwardDelete":"delete")}))}else n.change((function(t){t.setSelection(s),e.execute(l?"forwardDelete":"delete")}))}o.preventDefault(),t.stop()}}),{priority:yoe.get("high")+1})}},{key:"_enableInsertContentIntegration",value:function(){var e=this.editor,t=this.editor.model,n=t.document.selection;this._listenToIfEnabled(e.model,"insertContent",(function(e,r){var o=mBe(r,2),i=o[0],a=o[1];if(!a||a.is("documentSelection")){var u=xLe(n);if(u)return e.stop(),t.change((function(e){var r=n.getSelectedElement(),o=t.createPositionAt(r,u),a=e.createSelection(o),l=t.insertContent(i,a);return e.setSelection(a),l}))}}),{priority:"high"})}}]),n}(Qoe);n(673);function xBe(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return TBe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return TBe(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function TBe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n',"image/svg+xml").firstChild,FBe=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&RBe(e,t)}(n,e);var t=MBe(n);function n(e){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),(r=t.call(this,e))._currentFakeCaretModelElement=null,r}return DBe(n,null,[{key:"pluginName",get:function(){return"WidgetTypeAround"}}]),DBe(n,[{key:"init",value:function(){var e=this.editor,t=e.editing.view;this.on("change:isEnabled",(function(n,r,o){t.change((function(e){var n,r=EBe(t.document.roots);try{for(r.s();!(n=r.n()).done;){var i=n.value;o?e.removeClass("ck-widget__type-around_disabled",i):e.addClass("ck-widget__type-around_disabled",i)}}catch(e){r.e(e)}finally{r.f()}})),o||e.model.change((function(e){e.removeSelectionAttribute("widget-type-around")}))})),this._enableTypeAroundUIInjection(),this._enableInsertingParagraphsOnButtonClick(),this._enableInsertingParagraphsOnEnterKeypress(),this._enableInsertingParagraphsOnTypingKeystroke(),this._enableTypeAroundFakeCaretActivationUsingKeyboardArrows(),this._enableDeleteIntegration(),this._enableInsertContentIntegration()}},{key:"destroy",value:function(){this._currentFakeCaretModelElement=null}},{key:"_insertParagraph",value:function(e,t){var n=this.editor,r=n.editing.view;n.execute("insertParagraph",{position:n.model.createPositionAt(e,t)}),r.focus(),r.scrollToTheSelection()}},{key:"_listenToIfEnabled",value:function(e,t,n,r){var o=this;this.listenTo(e,t,(function(){o.isEnabled&&n.apply(void 0,arguments)}),r)}},{key:"_insertParagraphAccordingToFakeCaretPosition",value:function(){var e=this.editor.model.document.selection,t=YLe(e);if(!t)return!1;var n=e.getSelectedElement();return this._insertParagraph(n,t),!0}},{key:"_enableTypeAroundUIInjection",value:function(){var e=this.editor,t=e.model.schema,n=e.locale.t,r={before:n("Insert paragraph before block"),after:n("Insert paragraph after block")};e.editing.downcastDispatcher.on("insert",(function(e,n,o){var i=o.mapper.toViewElement(n.item);FLe(i,n.item,t)&&function(e,t,n){var r=e.createUIElement("div",{class:"ck ck-reset_all ck-widget__type-around"},(function(e){var n=this.toDomElement(e);return function(e,t){var n,r=EBe(IBe);try{for(r.s();!(n=r.n()).done;){var o=n.value,i=new Uae({tag:"div",attributes:{class:["ck","ck-widget__type-around__button","ck-widget__type-around__button_".concat(o)],title:t[o]},children:[e.ownerDocument.importNode(zBe,!0)]});e.appendChild(i.render())}}catch(e){r.e(e)}finally{r.f()}}(n,t),function(e){var t=new Uae({tag:"div",attributes:{class:["ck","ck-widget__type-around__fake-caret"]}});e.appendChild(t.render())}(n),n}));e.insert(e.createPositionAt(n,"end"),r)}(o.writer,r,i)}),{priority:"low"})}},{key:"_enableTypeAroundFakeCaretActivationUsingKeyboardArrows",value:function(){var e=this,t=this.editor,n=t.model,r=n.document.selection,o=n.schema,i=t.editing.view;function a(e){return"ck-widget_type-around_show-fake-caret_".concat(e)}this._listenToIfEnabled(i.document,"keydown",(function(t,n){Nue(n.keyCode)&&e._handleArrowKeyPress(t,n)}),{priority:Poe.get("high")+10}),this._listenToIfEnabled(r,"change:range",(function(e,n){n.directChange&&t.model.change((function(e){e.removeSelectionAttribute("widget-type-around")}))})),this._listenToIfEnabled(n.document,"change:data",(function(){var e=r.getSelectedElement();if(e&&FLe(t.editing.mapper.toViewElement(e),e,o))return;t.model.change((function(e){e.removeSelectionAttribute("widget-type-around")}))})),this._listenToIfEnabled(t.editing.downcastDispatcher,"selection",(function(t,n,r){var i=r.writer;if(e._currentFakeCaretModelElement){var u=r.mapper.toViewElement(e._currentFakeCaretModelElement);u&&(i.removeClass(IBe.map(a),u),e._currentFakeCaretModelElement=null)}var l=n.selection.getSelectedElement();if(l){var s=r.mapper.toViewElement(l);if(FLe(s,l,o)){var c=YLe(n.selection);c&&(i.addClass(a(c),s),e._currentFakeCaretModelElement=l)}}})),this._listenToIfEnabled(t.ui.focusTracker,"change:isFocused",(function(e,n,r){r||t.model.change((function(e){e.removeSelectionAttribute("widget-type-around")}))}))}},{key:"_handleArrowKeyPress",value:function(e,t){var n,r=this.editor,o=r.model,i=o.document.selection,a=o.schema,u=r.editing.view,l=Hue(t.keyCode,r.locale.contentLanguageDirection),s=u.document.selection.getSelectedElement();FLe(s,r.editing.mapper.toModelElement(s),a)?n=this._handleArrowKeyPressOnSelectedWidget(l):i.isCollapsed&&(n=this._handleArrowKeyPressWhenSelectionNextToAWidget(l)),n&&(t.preventDefault(),e.stop())}},{key:"_handleArrowKeyPressOnSelectedWidget",value:function(e){var t=this.editor.model,n=YLe(t.document.selection);return t.change((function(t){return n?n!==(e?"after":"before")&&(t.removeSelectionAttribute("widget-type-around"),!0):(t.setSelectionAttribute("widget-type-around",e?"after":"before"),!0)}))}},{key:"_handleArrowKeyPressWhenSelectionNextToAWidget",value:function(e){var t=this.editor,n=t.model,r=n.schema,o=t.plugins.get("Widget"),i=o._getObjectElementNextToSelection(e);return!!FLe(t.editing.mapper.toViewElement(i),i,r)&&(n.change((function(t){o._setSelectionOverElement(i),t.setSelectionAttribute("widget-type-around",e?"before":"after")})),!0)}},{key:"_enableInsertingParagraphsOnButtonClick",value:function(){var e=this,t=this.editor,n=t.editing.view;this._listenToIfEnabled(n.document,"mousedown",(function(r,o){var i=o.domTarget.closest(".ck-widget__type-around__button");if(i){var a=function(e){return e.classList.contains("ck-widget__type-around__button_before")?"before":"after"}(i),u=function(e,t){var n=e.closest(".ck-widget");return t.mapDomToView(n)}(i,n.domConverter),l=t.editing.mapper.toModelElement(u);e._insertParagraph(l,a),o.preventDefault(),r.stop()}}))}},{key:"_enableInsertingParagraphsOnEnterKeypress",value:function(){var e=this,t=this.editor,n=t.editing.view;this._listenToIfEnabled(n.document,"enter",(function(r,o){var i,a=n.document.selection.getSelectedElement(),u=t.editing.mapper.toModelElement(a),l=t.model.schema;e._insertParagraphAccordingToFakeCaretPosition()?i=!0:FLe(a,u,l)&&(e._insertParagraph(u,o.isSoft?"before":"after"),i=!0),i&&(o.preventDefault(),r.stop())}))}},{key:"_enableInsertingParagraphsOnTypingKeystroke",value:function(){var e=this,t=this.editor.editing.view,n=[Iue.enter,Iue.delete,Iue.backspace];this._listenToIfEnabled(t.document,"keydown",(function(t,r){n.includes(r.keyCode)||WCe(r)||e._insertParagraphAccordingToFakeCaretPosition()}),{priority:Poe.get("high")+1})}},{key:"_enableDeleteIntegration",value:function(){var e=this.editor,t=e.editing.view,n=e.model,r=n.schema;this._listenToIfEnabled(t.document,"delete",(function(t,o){var i=YLe(n.document.selection);if(i){var a=o.direction,u=n.document.selection.getSelectedElement(),l="forward"==a;if("before"===i===l)e.execute("delete",{selection:n.createSelection(u,"on")});else{var s=r.getNearestSelectionRange(n.createPositionAt(u,i),a);if(s)if(s.isCollapsed){var c=n.createSelection(s.start);if(n.modifySelection(c,{direction:a}),c.focus.isEqual(s.start)){var f=function(e,t){var n,r=t,o=EBe(t.getAncestors({parentFirst:!0}));try{for(o.s();!(n=o.n()).done;){var i=n.value;if(i.childCount>1||e.isLimit(i))break;r=i}}catch(e){o.e(e)}finally{o.f()}return r}(r,s.start.parent);n.deleteContent(n.createSelection(f,"on"),{doNotAutoparagraph:!0})}else n.change((function(t){t.setSelection(s),e.execute(l?"forwardDelete":"delete")}))}else n.change((function(t){t.setSelection(s),e.execute(l?"forwardDelete":"delete")}))}o.preventDefault(),t.stop()}}),{priority:Poe.get("high")+1})}},{key:"_enableInsertContentIntegration",value:function(){var e=this.editor,t=this.editor.model,n=t.document.selection;this._listenToIfEnabled(e.model,"insertContent",(function(e,r){var o=jBe(r,2),i=o[0],a=o[1];if(!a||a.is("documentSelection")){var u=YLe(n);if(u)return e.stop(),t.change((function(e){var r=n.getSelectedElement(),o=t.createPositionAt(r,u),a=e.createSelection(o),l=t.insertContent(i,a);return e.setSelection(a),l}))}}),{priority:"high"})}}]),n}(lie);n(673);function YBe(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return NBe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return NBe(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function NBe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=a)return!1;a=Math.max(a,Math.round(f.bottom))}else a=Math.round(f.bottom)}}catch(e){c.e(e)}finally{c.f()}return!0}(e,s,l)&&(t.change((function(e){var n=l?s.end:s.start;if(a){var r=t.createSelection(u.anchor);r.setFocus(n),e.setSelection(r)}else e.setSelection(n)})),n.stop(),r.preventDefault(),r.stopPropagation())}}}}function RBe(e,t,n){var r,o=e.schema,i="forward"==n?"elementStart":"elementEnd",a=xBe(e.createRangeIn(t.root).getWalker({startPosition:t,direction:n}));try{for(a.s();!(r=a.n()).done;){var u=r.value,l=u.previousPosition,s=u.item,c=u.type;if(o.isLimit(s)&&!o.isInline(s))return l;if(c==i&&o.isBlock(s))return null}}catch(e){a.e(e)}finally{a.f()}return null}function MBe(e,t,n){var r="backward"==n?t.end:t.start;if(e.checkChild(r,"$text"))return r;var o,i=xBe(t.getWalker({direction:n}));try{for(i.s();!(o=i.n()).done;){var a=o.value.nextPosition;if(e.checkChild(a,"$text"))return a}}catch(e){i.e(e)}finally{i.f()}}function ABe(e){return(ABe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function LBe(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return IBe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return IBe(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function IBe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=a)return!1;a=Math.max(a,Math.round(f.bottom))}else a=Math.round(f.bottom)}}catch(e){c.e(e)}finally{c.f()}return!0}(e,s,l)&&(t.change((function(e){var n=l?s.end:s.start;if(a){var r=t.createSelection(u.anchor);r.setFocus(n),e.setSelection(r)}else e.setSelection(n)})),n.stop(),r.preventDefault(),r.stopPropagation())}}}}function HBe(e,t,n){var r,o=e.schema,i="forward"==n?"elementStart":"elementEnd",a=YBe(e.createRangeIn(t.root).getWalker({startPosition:t,direction:n}));try{for(a.s();!(r=a.n()).done;){var u=r.value,l=u.previousPosition,s=u.item,c=u.type;if(o.isLimit(s)&&!o.isInline(s))return l;if(c==i&&o.isBlock(s))return null}}catch(e){a.e(e)}finally{a.f()}return null}function VBe(e,t,n){var r="backward"==n?t.end:t.start;if(e.checkChild(r,"$text"))return r;var o,i=YBe(t.getWalker({direction:n}));try{for(i.s();!(o=i.n()).done;){var a=o.value.nextPosition;if(e.checkChild(a,"$text"))return a}}catch(e){i.e(e)}finally{i.f()}}function WBe(e){return(WBe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function UBe(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return qBe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return qBe(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function qBe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=3){var a=n.editing.mapper,u=i.is("attributeElement")?i.findAncestor((function(e){return!e.is("attributeElement")})):i,l=a.toModelElement(u);t.preventDefault(),this.editor.model.change((function(e){e.setSelection(l,"in")}))}}else if(TLe(i)||(i=i.findAncestor(TLe))){t.preventDefault(),o.isFocused||r.focus();var s=n.editing.mapper.toModelElement(i);this._setSelectionOverElement(s)}}},{key:"_handleSelectionChangeOnArrowKeyPress",value:function(e,t){var n=t.keyCode;if(Tue(n)){var r=this.editor.model,o=r.schema,i=r.document.selection,a=i.getSelectedElement(),u=Rue(n,this.editor.locale.contentLanguageDirection);if(a&&o.isObject(a)){var l=u?i.getLastPosition():i.getFirstPosition(),s=o.getNearestSelectionRange(l,u?"forward":"backward");s&&(r.change((function(e){e.setSelection(s)})),t.preventDefault(),e.stop())}else if(i.isCollapsed){var c=this._getObjectElementNextToSelection(u);c&&o.isObject(c)&&(this._setSelectionOverElement(c),t.preventDefault(),e.stop())}}}},{key:"_preventDefaultOnArrowKeyPress",value:function(e,t){if(Tue(t.keyCode)){var n=this.editor.model,r=n.schema,o=n.document.selection.getSelectedElement();o&&r.isObject(o)&&(t.preventDefault(),e.stop())}}},{key:"_handleDelete",value:function(e){var t=this;if(!this.editor.isReadOnly){var n=this.editor.model.document.selection;if(n.isCollapsed){var r=this._getObjectElementNextToSelection(e);return r?(this.editor.model.change((function(e){for(var o=n.anchor.parent;o.isEmpty;){var i=o;o=i.parent,e.remove(i)}t._setSelectionOverElement(r)})),!0):void 0}}}},{key:"_setSelectionOverElement",value:function(e){this.editor.model.change((function(t){t.setSelection(t.createRangeOn(e))}))}},{key:"_getObjectElementNextToSelection",value:function(e){var t=this.editor.model,n=t.schema,r=t.document.selection,o=t.createSelection(r);t.modifySelection(o,{direction:e?"forward":"backward"});var i=e?o.focus.nodeBefore:o.focus.nodeAfter;return i&&n.isObject(i)?i:null}},{key:"_clearPreviouslySelectedWidgets",value:function(e){var t,n=LBe(this._previouslySelected);try{for(n.s();!(t=n.n()).done;){var r=t.value;e.removeClass("ck-widget_selected",r)}}catch(e){n.e(e)}finally{n.f()}this._previouslySelected.clear()}}])&&FBe(t.prototype,n),r&&FBe(t,r),i}(Qoe);function WBe(e,t){return!!t&&Array.from(e.getAncestors()).includes(t)}n(674);function UBe(e){return(UBe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function qBe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function KBe(e,t){for(var n=0;n=3){var a=n.editing.mapper,u=i.is("attributeElement")?i.findAncestor((function(e){return!e.is("attributeElement")})):i,l=a.toModelElement(u);t.preventDefault(),this.editor.model.change((function(e){e.setSelection(l,"in")}))}}else if(NLe(i)||(i=i.findAncestor(NLe))){t.preventDefault(),o.isFocused||r.focus();var s=n.editing.mapper.toModelElement(i);this._setSelectionOverElement(s)}}},{key:"_handleSelectionChangeOnArrowKeyPress",value:function(e,t){var n=t.keyCode;if(Nue(n)){var r=this.editor.model,o=r.schema,i=r.document.selection,a=i.getSelectedElement(),u=Hue(n,this.editor.locale.contentLanguageDirection);if(a&&o.isObject(a)){var l=u?i.getLastPosition():i.getFirstPosition(),s=o.getNearestSelectionRange(l,u?"forward":"backward");s&&(r.change((function(e){e.setSelection(s)})),t.preventDefault(),e.stop())}else if(i.isCollapsed){var c=this._getObjectElementNextToSelection(u);c&&o.isObject(c)&&(this._setSelectionOverElement(c),t.preventDefault(),e.stop())}}}},{key:"_preventDefaultOnArrowKeyPress",value:function(e,t){if(Nue(t.keyCode)){var n=this.editor.model,r=n.schema,o=n.document.selection.getSelectedElement();o&&r.isObject(o)&&(t.preventDefault(),e.stop())}}},{key:"_handleDelete",value:function(e){var t=this;if(!this.editor.isReadOnly){var n=this.editor.model.document.selection;if(n.isCollapsed){var r=this._getObjectElementNextToSelection(e);return r?(this.editor.model.change((function(e){for(var o=n.anchor.parent;o.isEmpty;){var i=o;o=i.parent,e.remove(i)}t._setSelectionOverElement(r)})),!0):void 0}}}},{key:"_setSelectionOverElement",value:function(e){this.editor.model.change((function(t){t.setSelection(t.createRangeOn(e))}))}},{key:"_getObjectElementNextToSelection",value:function(e){var t=this.editor.model,n=t.schema,r=t.document.selection,o=t.createSelection(r);t.modifySelection(o,{direction:e?"forward":"backward"});var i=e?o.focus.nodeBefore:o.focus.nodeAfter;return i&&n.isObject(i)?i:null}},{key:"_clearPreviouslySelectedWidgets",value:function(e){var t,n=UBe(this._previouslySelected);try{for(n.s();!(t=n.n()).done;){var r=t.value;e.removeClass("ck-widget_selected",r)}}catch(e){n.e(e)}finally{n.f()}this._previouslySelected.clear()}}])&&$Be(t.prototype,n),r&&$Be(t,r),i}(lie);function eHe(e,t){return!!t&&Array.from(e.getAncestors()).includes(t)}n(674);function tHe(e){return(tHe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function nHe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rHe(e,t){for(var n=0;n1?this._showNextStack():(this.view.hide(),this.visibleView=null,this._rotatorView.hideView()):this._showView(Array.from(t.values())[t.size-2])),1===t.size?(this._idToStack.delete(this._getStackId(t)),this._numberOfStacks=this._idToStack.size):t.delete(e),this._viewToStack.delete(e)}},{key:"updatePosition",value:function(e){e&&(this._visibleStack.get(this.visibleView).position=e),this.view.pin(this._getBalloonPosition()),this._fakePanelsView.updatePosition()}},{key:"showStack",value:function(e){this.visibleStack=e;var t=this._idToStack.get(e);if(!t)throw new moe.a("contextualballoon-showstack-stack-not-exist",this);this._visibleStack!==t&&this._showView(Array.from(t.values()).pop())}},{key:"_getStackId",value:function(e){return Array.from(this._idToStack.entries()).find((function(t){return t[1]===e}))[0]}},{key:"_showNextStack",value:function(){var e=Array.from(this._idToStack.values()),t=e.indexOf(this._visibleStack)+1;e[t]||(t=0),this.showStack(this._getStackId(e[t]))}},{key:"_showPrevStack",value:function(){var e=Array.from(this._idToStack.values()),t=e.indexOf(this._visibleStack)-1;e[t]||(t=e.length-1),this.showStack(this._getStackId(e[t]))}},{key:"_createRotatorView",value:function(){var e=this,t=new fHe(this.editor.locale),n=this.editor.locale.t;return this.view.content.add(t),t.bind("isNavigationVisible").to(this,"_numberOfStacks",this,"_singleViewMode",(function(e,t){return!t&&e>1})),t.on("change:isNavigationVisible",(function(){return e.updatePosition()}),{priority:"low"}),t.bind("counter").to(this,"visibleView",this,"_numberOfStacks",(function(t,r){if(r<2)return"";var o=Array.from(e._idToStack.values()).indexOf(e._visibleStack)+1;return n("%0 of %1",[o,r])})),t.buttonNextView.on("execute",(function(){t.focusTracker.isFocused&&e.editor.editing.view.focus(),e._showNextStack()})),t.buttonPrevView.on("execute",(function(){t.focusTracker.isFocused&&e.editor.editing.view.focus(),e._showPrevStack()})),t}},{key:"_createFakePanelsView",value:function(){var e=new pHe(this.editor.locale,this.view);return e.bind("numberOfPanels").to(this,"_numberOfStacks",this,"_singleViewMode",(function(e,t){return!t&&e>=2?Math.min(e-1,2):0})),e.listenTo(this.view,"change:top",(function(){return e.updatePosition()})),e.listenTo(this.view,"change:left",(function(){return e.updatePosition()})),this.editor.ui.view.body.add(e),e}},{key:"_showView",value:function(e){var t=e.view,n=e.balloonClassName,r=void 0===n?"":n,o=e.withArrow,i=void 0===o||o,a=e.singleViewMode,u=void 0!==a&&a;this.view.class=r,this.view.withArrow=i,this._rotatorView.showView(t),this.visibleView=t,this.view.pin(this._getBalloonPosition()),this._fakePanelsView.updatePosition(),u&&(this._singleViewMode=!0)}},{key:"_getBalloonPosition",value:function(){var e=Array.from(this._visibleStack.values()).pop().position;return e&&!e.limiter&&(e=Object.assign({},e,{limiter:this.positionLimiter})),e}},{key:"_visibleStack",get:function(){return this._viewToStack.get(this.visibleView)}}]),n}(Qoe),fHe=function(e){oHe(n,e);var t=aHe(n);function n(e){var r;tHe(this,n),r=t.call(this,e);var o=e.t,i=r.bindTemplate;return r.set("isNavigationVisible",!0),r.focusTracker=new zle,r.buttonPrevView=r._createButtonView(o("Previous"),''),r.buttonNextView=r._createButtonView(o("Next"),''),r.content=r.createCollection(),r.setTemplate({tag:"div",attributes:{class:["ck","ck-balloon-rotator"],"z-index":"-1"},children:[{tag:"div",attributes:{class:["ck-balloon-rotator__navigation",i.to("isNavigationVisible",(function(e){return e?"":"ck-hidden"}))]},children:[r.buttonPrevView,{tag:"span",attributes:{class:["ck-balloon-rotator__counter"]},children:[{text:i.to("counter")}]},r.buttonNextView]},{tag:"div",attributes:{class:"ck-balloon-rotator__content"},children:r.content}]}),r}return rHe(n,[{key:"render",value:function(){XBe(lHe(n.prototype),"render",this).call(this),this.focusTracker.add(this.element)}},{key:"showView",value:function(e){this.hideView(),this.content.add(e)}},{key:"hideView",value:function(){this.content.clear()}},{key:"_createButtonView",value:function(e,t){var n=new Hue(this.locale);return n.set({label:e,icon:t,tooltip:!0}),n}}]),n}(uue),pHe=function(e){oHe(n,e);var t=aHe(n);function n(e,r){var o;tHe(this,n);var i=(o=t.call(this,e)).bindTemplate;return o.set("top",0),o.set("left",0),o.set("height",0),o.set("width",0),o.set("numberOfPanels",0),o.content=o.createCollection(),o._balloonPanelView=r,o.setTemplate({tag:"div",attributes:{class:["ck-fake-panel",i.to("numberOfPanels",(function(e){return e?"":"ck-hidden"}))],style:{top:i.to("top",sHe),left:i.to("left",sHe),width:i.to("width",sHe),height:i.to("height",sHe)}},children:o.content}),o.on("change:numberOfPanels",(function(e,t,n,r){n>r?o._addPanels(n-r):o._removePanels(r-n),o.updatePosition()})),o}return rHe(n,[{key:"_addPanels",value:function(e){for(;e--;){var t=new uue;t.setTemplate({tag:"div"}),this.content.add(t),this.registerChild(t)}}},{key:"_removePanels",value:function(e){for(;e--;){var t=this.content.last;this.content.remove(t),this.deregisterChild(t),t.destroy()}}},{key:"updatePosition",value:function(){if(this.numberOfPanels){var e=this._balloonPanelView,t=e.top,n=e.left,r=new ule(this._balloonPanelView.element),o=r.width,i=r.height;Object.assign(this,{top:t,left:n,width:o,height:i})}}}]),n}(uue);function dHe(e){return(dHe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function hHe(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return yHe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return yHe(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function yHe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1?this._showNextStack():(this.view.hide(),this.visibleView=null,this._rotatorView.hideView()):this._showView(Array.from(t.values())[t.size-2])),1===t.size?(this._idToStack.delete(this._getStackId(t)),this._numberOfStacks=this._idToStack.size):t.delete(e),this._viewToStack.delete(e)}},{key:"updatePosition",value:function(e){e&&(this._visibleStack.get(this.visibleView).position=e),this.view.pin(this._getBalloonPosition()),this._fakePanelsView.updatePosition()}},{key:"showStack",value:function(e){this.visibleStack=e;var t=this._idToStack.get(e);if(!t)throw new joe.a("contextualballoon-showstack-stack-not-exist",this);this._visibleStack!==t&&this._showView(Array.from(t.values()).pop())}},{key:"_getStackId",value:function(e){return Array.from(this._idToStack.entries()).find((function(t){return t[1]===e}))[0]}},{key:"_showNextStack",value:function(){var e=Array.from(this._idToStack.values()),t=e.indexOf(this._visibleStack)+1;e[t]||(t=0),this.showStack(this._getStackId(e[t]))}},{key:"_showPrevStack",value:function(){var e=Array.from(this._idToStack.values()),t=e.indexOf(this._visibleStack)-1;e[t]||(t=e.length-1),this.showStack(this._getStackId(e[t]))}},{key:"_createRotatorView",value:function(){var e=this,t=new _He(this.editor.locale),n=this.editor.locale.t;return this.view.content.add(t),t.bind("isNavigationVisible").to(this,"_numberOfStacks",this,"_singleViewMode",(function(e,t){return!t&&e>1})),t.on("change:isNavigationVisible",(function(){return e.updatePosition()}),{priority:"low"}),t.bind("counter").to(this,"visibleView",this,"_numberOfStacks",(function(t,r){if(r<2)return"";var o=Array.from(e._idToStack.values()).indexOf(e._visibleStack)+1;return n("%0 of %1",[o,r])})),t.buttonNextView.on("execute",(function(){t.focusTracker.isFocused&&e.editor.editing.view.focus(),e._showNextStack()})),t.buttonPrevView.on("execute",(function(){t.focusTracker.isFocused&&e.editor.editing.view.focus(),e._showPrevStack()})),t}},{key:"_createFakePanelsView",value:function(){var e=new OHe(this.editor.locale,this.view);return e.bind("numberOfPanels").to(this,"_numberOfStacks",this,"_singleViewMode",(function(e,t){return!t&&e>=2?Math.min(e-1,2):0})),e.listenTo(this.view,"change:top",(function(){return e.updatePosition()})),e.listenTo(this.view,"change:left",(function(){return e.updatePosition()})),this.editor.ui.view.body.add(e),e}},{key:"_showView",value:function(e){var t=e.view,n=e.balloonClassName,r=void 0===n?"":n,o=e.withArrow,i=void 0===o||o,a=e.singleViewMode,u=void 0!==a&&a;this.view.class=r,this.view.withArrow=i,this._rotatorView.showView(t),this.visibleView=t,this.view.pin(this._getBalloonPosition()),this._fakePanelsView.updatePosition(),u&&(this._singleViewMode=!0)}},{key:"_getBalloonPosition",value:function(){var e=Array.from(this._visibleStack.values()).pop().position;return e&&!e.limiter&&(e=Object.assign({},e,{limiter:this.positionLimiter})),e}},{key:"_visibleStack",get:function(){return this._viewToStack.get(this.visibleView)}}]),n}(lie),_He=function(e){hHe(n,e);var t=mHe(n);function n(e){var r;fHe(this,n),r=t.call(this,e);var o=e.t,i=r.bindTemplate;return r.set("isNavigationVisible",!0),r.focusTracker=new Kle,r.buttonPrevView=r._createButtonView(o("Previous"),''),r.buttonNextView=r._createButtonView(o("Next"),''),r.content=r.createCollection(),r.setTemplate({tag:"div",attributes:{class:["ck","ck-balloon-rotator"],"z-index":"-1"},children:[{tag:"div",attributes:{class:["ck-balloon-rotator__navigation",i.to("isNavigationVisible",(function(e){return e?"":"ck-hidden"}))]},children:[r.buttonPrevView,{tag:"span",attributes:{class:["ck-balloon-rotator__counter"]},children:[{text:i.to("counter")}]},r.buttonNextView]},{tag:"div",attributes:{class:"ck-balloon-rotator__content"},children:r.content}]}),r}return dHe(n,[{key:"render",value:function(){sHe(vHe(n.prototype),"render",this).call(this),this.focusTracker.add(this.element)}},{key:"showView",value:function(e){this.hideView(),this.content.add(e)}},{key:"hideView",value:function(){this.content.clear()}},{key:"_createButtonView",value:function(e,t){var n=new Que(this.locale);return n.set({label:e,icon:t,tooltip:!0}),n}}]),n}(bue),OHe=function(e){hHe(n,e);var t=mHe(n);function n(e,r){var o;fHe(this,n);var i=(o=t.call(this,e)).bindTemplate;return o.set("top",0),o.set("left",0),o.set("height",0),o.set("width",0),o.set("numberOfPanels",0),o.content=o.createCollection(),o._balloonPanelView=r,o.setTemplate({tag:"div",attributes:{class:["ck-fake-panel",i.to("numberOfPanels",(function(e){return e?"":"ck-hidden"}))],style:{top:i.to("top",gHe),left:i.to("left",gHe),width:i.to("width",gHe),height:i.to("height",gHe)}},children:o.content}),o.on("change:numberOfPanels",(function(e,t,n,r){n>r?o._addPanels(n-r):o._removePanels(r-n),o.updatePosition()})),o}return dHe(n,[{key:"_addPanels",value:function(e){for(;e--;){var t=new bue;t.setTemplate({tag:"div"}),this.content.add(t),this.registerChild(t)}}},{key:"_removePanels",value:function(e){for(;e--;){var t=this.content.last;this.content.remove(t),this.deregisterChild(t),t.destroy()}}},{key:"updatePosition",value:function(){if(this.numberOfPanels){var e=this._balloonPanelView,t=e.top,n=e.left,r=new ble(this._balloonPanelView.element),o=r.width,i=r.height;Object.assign(this,{top:t,left:n,width:o,height:i})}}}]),n}(bue);function SHe(e){return(SHe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function kHe(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return PHe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return PHe(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function PHe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);nt&&(t=u,n=a,r=i)}else this._isToolbarVisible(i)&&this._hideToolbar(i);else this._isToolbarInBalloon(i)&&this._hideToolbar(i)}}catch(e){o.e(e)}finally{o.f()}r&&this._showToolbar(r,n)}},{key:"_hideToolbar",value:function(e){this._balloon.remove(e.view),this.stopListening(this._balloon,"change:visibleView")}},{key:"_showToolbar",value:function(e,t){var n=this;this._isToolbarVisible(e)?kHe(this.editor,t):this._isToolbarInBalloon(e)||(this._balloon.add({view:e.view,position:PHe(this.editor,t),balloonClassName:e.balloonClassName}),this.listenTo(this._balloon,"change:visibleView",(function(){var e,t=hHe(n._toolbarDefinitions.values());try{for(t.s();!(e=t.n()).done;){var r=e.value;if(n._isToolbarVisible(r)){var o=r.getRelatedElement(n.editor.editing.view.document.selection);kHe(n.editor,o)}}}catch(e){t.e(e)}finally{t.f()}})))}},{key:"_isToolbarVisible",value:function(e){return this._balloon.visibleView===e.view}},{key:"_isToolbarInBalloon",value:function(e){return this._balloon.hasView(e.view)}}])&&bHe(t.prototype,n),r&&bHe(t,r),i}(Qoe);function kHe(e,t){var n=e.plugins.get("ContextualBalloon"),r=PHe(e,t);n.updatePosition(r)}function PHe(e,t){var n=e.editing.view,r=kLe.defaultPositions;return{target:n.domConverter.mapViewToDom(t),positions:[r.northArrowSouth,r.northArrowSouthWest,r.northArrowSouthEast,r.southArrowNorth,r.southArrowNorthWest,r.southArrowNorthEast,LLe]}}function jHe(e){var t=e.getSelectedElement();return t&&CHe(t)?t:null}function EHe(e){var t=function(e,t){var n=t.parent;for(;n;){if(n.name===e)return n;n=n.parent}}("table",e.getFirstPosition());return t&&CHe(t.parent)?t.parent:null}function CHe(e){return!!e.getCustomProperty("table")&&TLe(e)}function xHe(e){return(xHe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function THe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function DHe(e,t){for(var n=0;nt&&(t=u,n=a,r=i)}else this._isToolbarVisible(i)&&this._hideToolbar(i);else this._isToolbarInBalloon(i)&&this._hideToolbar(i)}}catch(e){o.e(e)}finally{o.f()}r&&this._showToolbar(r,n)}},{key:"_hideToolbar",value:function(e){this._balloon.remove(e.view),this.stopListening(this._balloon,"change:visibleView")}},{key:"_showToolbar",value:function(e,t){var n=this;this._isToolbarVisible(e)?AHe(this.editor,t):this._isToolbarInBalloon(e)||(this._balloon.add({view:e.view,position:LHe(this.editor,t),balloonClassName:e.balloonClassName}),this.listenTo(this._balloon,"change:visibleView",(function(){var e,t=kHe(n._toolbarDefinitions.values());try{for(t.s();!(e=t.n()).done;){var r=e.value;if(n._isToolbarVisible(r)){var o=r.getRelatedElement(n.editor.editing.view.document.selection);AHe(n.editor,o)}}}catch(e){t.e(e)}finally{t.f()}})))}},{key:"_isToolbarVisible",value:function(e){return this._balloon.visibleView===e.view}},{key:"_isToolbarInBalloon",value:function(e){return this._balloon.hasView(e.view)}}])&&EHe(t.prototype,n),r&&EHe(t,r),i}(lie);function AHe(e,t){var n=e.plugins.get("ContextualBalloon"),r=LHe(e,t);n.updatePosition(r)}function LHe(e,t){var n=e.editing.view,r=ALe.defaultPositions;return{target:n.domConverter.mapViewToDom(t),positions:[r.northArrowSouth,r.northArrowSouthWest,r.northArrowSouthEast,r.southArrowNorth,r.southArrowNorthWest,r.southArrowNorthEast,ULe]}}function IHe(e){var t=e.getSelectedElement();return t&&FHe(t)?t:null}function zHe(e){var t=function(e,t){var n=t.parent;for(;n;){if(n.name===e)return n;n=n.parent}}("table",e.getFirstPosition());return t&&FHe(t.parent)?t.parent:null}function FHe(e){return!!e.getCustomProperty("table")&&NLe(e)}function YHe(e){return(YHe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function NHe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function BHe(e,t){for(var n=0;n1&&void 0!==arguments[1]&&arguments[1];ZHe(this,n),r=t.call(this,e);var i=[];if(o){var a=new Hue(r.locale);a.set({class:"ck-preview-button",withText:!0}),a.extendTemplate({attributes:{href:r.bindTemplate.to("href"),target:"_blank"}}),a.bind("label").to(eVe(r),"href"),a.template.tag="a",a.template.eventListeners={},i.push(a)}var u=new Hue(r.locale);u.set({icon:KHe}),u.delegate("execute").to(eVe(r),"link"),i.push(u);var l=new Hue(r.locale);return l.set({icon:$He}),l.delegate("execute").to(eVe(r),"unlink"),i.push(l),r.setTemplate({tag:"div",children:i}),r}return n}(uue);function rVe(e){return(rVe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function oVe(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return iVe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return iVe(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function iVe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0?"?"+l.toString().replace(/\+/g,"%20"):""))}else r(void 0)},t.handleUrlBlur=t.callUrlChange,DVe(t,"handleUrlChange",kVe,IVe(t)),t.handleMailSubjectBlur=t.callUrlChange,DVe(t,"handleProtocolChange",PVe,IVe(t)),DVe(t,"handleMailSubjectChange",jVe,IVe(t)),t.handleMailBodyBlur=t.callUrlChange,DVe(t,"handleMailBodyChange",EVe,IVe(t)),t.updateUrl(),t}return t=i,(n=[{key:"componentDidUpdate",value:function(e){!1===e.open&&!0===this.props.open&&this.updateUrl()}},{key:"updateUrl",value:function(){var e=this.props.url;if(e){var t=e.split("?");this.url=t[0];var n=new URLSearchParams(t[1]),r=n.get("subject"),o=n.get("body");this.mailSubject=r||void 0,this.mailBody=o||void 0}else this.url=void 0}},{key:"render",value:function(){var e=this.props,t=e.onCancel,n=e.onConfirm,r=e.onTargetChange,o=e.onTitleChange,i=e.open,a=e.target,u=e.title,l=e.url;return y.a.createElement(Td,{cancelText:Nr("sulu_admin.cancel"),confirmDisabled:!l,confirmText:Nr("sulu_admin.confirm"),onCancel:t,onConfirm:n,open:i,title:Nr("sulu_admin.link")},y.a.createElement(Cp,null,y.a.createElement(Cp.Field,{label:Nr("sulu_admin.link_url"),required:!0},y.a.createElement(t4,{defaultProtocol:"https://",onBlur:this.handleUrlBlur,onChange:this.handleUrlChange,onProtocolChange:this.handleProtocolChange,valid:!0,value:this.url})),this.protocol&&"mailto:"!==this.protocol&&y.a.createElement(Cp.Field,{label:Nr("sulu_admin.link_target"),required:!0},y.a.createElement(em,{onChange:r,value:a},y.a.createElement(em.Option,{value:"_blank"},"_blank"),y.a.createElement(em.Option,{value:"_self"},"_self"),y.a.createElement(em.Option,{value:"_parent"},"_parent"),y.a.createElement(em.Option,{value:"_top"},"_top"))),this.protocol&&"mailto:"===this.protocol&&y.a.createElement(h.Fragment,null,y.a.createElement(Cp.Field,{label:Nr("sulu_admin.mail_subject")},y.a.createElement(ha,{onBlur:this.handleMailSubjectBlur,onChange:this.handleMailSubjectChange,value:this.mailSubject})),y.a.createElement(Cp.Field,{label:Nr("sulu_admin.mail_body")},y.a.createElement(r5,{onBlur:this.handleMailBodyBlur,onChange:this.handleMailBodyChange,value:this.mailBody}))),y.a.createElement(Cp.Field,{label:Nr("sulu_admin.link_title")},y.a.createElement(ha,{onChange:o,value:u}))))}}])&&RVe(t.prototype,n),r&&RVe(t,r),i}(y.a.Component),wVe=FVe((gVe=CVe).prototype,"protocol",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){}}),_Ve=FVe(gVe.prototype,"url",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){}}),OVe=FVe(gVe.prototype,"mailSubject",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){}}),SVe=FVe(gVe.prototype,"mailBody",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){}}),FVe(gVe.prototype,"componentDidUpdate",[v.d],Object.getOwnPropertyDescriptor(gVe.prototype,"componentDidUpdate"),gVe.prototype),kVe=FVe(gVe.prototype,"handleUrlChange",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){e.url=t}}}),PVe=FVe(gVe.prototype,"handleProtocolChange",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){e.protocol=t}}}),jVe=FVe(gVe.prototype,"handleMailSubjectChange",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){e.mailSubject=t}}}),EVe=FVe(gVe.prototype,"handleMailBodyChange",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){e.mailBody=t}}}),vVe=gVe))||vVe;function ZVe(e){return(ZVe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function JVe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function QVe(e,t,n,r){n&&Object.defineProperty(e,t,{enumerable:n.enumerable,configurable:n.configurable,writable:n.writable,value:n.initializer?n.initializer.call(r):void 0})}function XVe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function eWe(e,t){for(var n=0;n\n'}),n.on("execute",Object(v.d)((function(){t.selection=t.editor.model.document.selection,t.open=!0,t.target="_self",t.title=void 0,t.url=void 0}))),n})),WHe(this.editor,"a","externalLinkTarget","target"),WHe(this.editor,"a","externalLinkHref","href"),WHe(this.editor,"a","externalLinkTitle","title");var n=this.editor.editing.view;n.addObserver(VHe),this.listenTo(n.document,"click",(function(){var e=qHe(t.editor,"a");t.hideBalloon(),e&&(t.set("href",e.getAttribute("href")),t.balloon.add({position:{target:n.domConverter.mapViewToDom(e)},view:t.balloonView}))})),this.listenTo(n.document,"blur",(function(){t.hideBalloon()}))}},{key:"hideBalloon",value:function(){this.balloon.hasView(this.balloonView)&&this.balloon.remove(this.balloonView)}},{key:"destroy",value:function(){Object(m.unmountComponentAtNode)(this.externalLinkOverlayElement),this.externalLinkOverlayElement.remove(),this.externalLinkOverlayElement=void 0}}])&&eWe(t.prototype,n),r&&eWe(t,r),i}(Qoe)).prototype,"open",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),BVe=aWe(YVe.prototype,"target",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return"_self"}}),HVe=aWe(YVe.prototype,"title",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),VVe=aWe(YVe.prototype,"url",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),WVe=aWe(YVe.prototype,"handleOverlayConfirm",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){var t;e.editor.execute("externalLink",(JVe(t={selection:e.selection},"target",e.target),JVe(t,"title",e.title),JVe(t,"url",e.url),t)),e.open=!1}}}),UVe=aWe(YVe.prototype,"handleOverlayClose",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){e.open=!1}}}),qVe=aWe(YVe.prototype,"handleTargetChange",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){e.target=t}}}),KVe=aWe(YVe.prototype,"handleTitleChange",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){e.title=t}}}),$Ve=aWe(YVe.prototype,"handleUrlChange",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){e.url=t}}}),YVe);function lWe(e,t){for(var n=0;n\n'}),gWe.getKeys().forEach((function(n){var o=new Hue(e);o.set({class:"ck-link-button",label:gWe.getTitle(n),withText:!0});var i=new Lse(e);i.children.add(o),o.delegate("execute").to(i),o.on("execute",Object(v.d)((function(){t.selection=t.editor.model.document.selection,t.openOverlay=n,t.target="_self",t.title=void 0,t.id=void 0}))),r.items.add(i)})),r.items.delegate("execute").to(n),n.panelView.children.add(r),n})),WHe(this.editor,"sulu-link","validationState","sulu-validation-state"),WHe(this.editor,"sulu-link","internalLinkProvider","provider"),WHe(this.editor,"sulu-link","internalLinkTarget","target"),WHe(this.editor,"sulu-link","internalLinkTitle","title"),WHe(this.editor,"sulu-link","internalLinkHref","href");var r=this.editor.editing.view;r.addObserver(VHe),this.listenTo(r.document,"click",(function(){var e=qHe(t.editor,"sulu-link");t.hideBalloon(),e&&t.balloon.add({position:{target:r.domConverter.mapViewToDom(e)},view:t.balloonView})})),this.listenTo(r.document,"blur",(function(){t.hideBalloon()}))}},{key:"hideBalloon",value:function(){this.balloon.hasView(this.balloonView)&&this.balloon.remove(this.balloonView)}},{key:"destroy",value:function(){Object(m.unmountComponentAtNode)(this.internalLinkElement),this.internalLinkElement.remove(),this.internalLinkElement=void 0}}])&&kWe(t.prototype,n),r&&kWe(t,r),i}(Qoe)).prototype,"openOverlay",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){}}),fWe=TWe(sWe.prototype,"target",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return"_self"}}),pWe=TWe(sWe.prototype,"id",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){}}),dWe=TWe(sWe.prototype,"title",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),hWe=TWe(sWe.prototype,"handleOverlayConfirm",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){var t;e.editor.execute("internalLink",(_We(t={},"id",e.id),_We(t,"provider",e.openOverlay),_We(t,"selection",e.selection),_We(t,"target",e.target),_We(t,"title",e.title),_We(t,"defaultText",e.defaultText),t)),e.openOverlay=void 0}}}),yWe=TWe(sWe.prototype,"handleOverlayClose",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){e.openOverlay=void 0}}}),mWe=TWe(sWe.prototype,"handleTargetChange",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){e.target=t}}}),bWe=TWe(sWe.prototype,"handleTitleChange",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){e.title=t}}}),vWe=TWe(sWe.prototype,"handleResourceChange",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t,n){e.id=t,e.defaultText=n?n.title:void 0}}}),sWe);function RWe(e){return(RWe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function MWe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function AWe(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&i(e.getEditorData())}))})).catch((function(e){d.a.error(e)}))}},{key:"componentWillUnmount",value:function(){var e=this;this.editorInstance&&this.editorInstance.destroy().then((function(){return e.editorInstance=null}))}},{key:"getEditorData",value:function(){var e=this.editorInstance.getData();return""===e?void 0:e}},{key:"render",value:function(){return y.a.createElement("div",{ref:this.setContainerRef})}}])&&JWe(t.prototype,n),r&&JWe(t,r),i}(y.a.Component);nUe.defaultProps={disabled:!1,formats:["h2","h3","h4","h5","h6"],value:""};var rUe=nUe;function oUe(e){return(oUe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function iUe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function aUe(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:0;if(e in this.blockPreviewTransformers)throw new Error('The key "'+e+'" has already been used for another BlockPreviewTransformer');this.blockPreviewTransformers[e]=t,this.priority[e]=n}},{key:"get",value:function(e){if(!(e in this.blockPreviewTransformers))throw new Error('The BlockPreviewTransformer with the key "'+e+'" is not defined. You probably forgot to add it to the registry using the "add" method.');return this.blockPreviewTransformers[e]}},{key:"blockPreviewTransformerKeysByPriority",get:function(){var e=this;return Object.keys(this.priority).sort((function(t,n){return e.priority[n]-e.priority[t]}))}}])&&mUe(t.prototype,n),r&&mUe(t,r),e}()).prototype,"blockPreviewTransformers",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),dUe=bUe(fUe.prototype,"priority",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),bUe(fUe.prototype,"blockPreviewTransformerKeysByPriority",[v.g],Object.getOwnPropertyDescriptor(fUe.prototype,"blockPreviewTransformerKeysByPriority"),fUe.prototype),fUe),gUe=n(27),wUe=n.n(gUe);function _Ue(e){return(_Ue="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function OUe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function SUe(e,t){for(var n=0;n1&&y.a.createElement("div",{className:wUe.a.types},y.a.createElement(em,{onChange:this.handleTypeChange,value:t},Object.keys(l).map((function(e){return y.a.createElement(em.Option,{key:e,value:e},l[e])})))),i&&y.a.createElement("div",{className:wUe.a.icons},i.map((function(e){return y.a.createElement(yn,{key:e,name:e})}))),y.a.createElement("div",{className:wUe.a.iconButtons},a&&y.a.createElement(yn,{name:"su-cog",onClick:a}),u&&y.a.createElement(yn,{name:"su-trash-alt",onClick:u}),y.a.createElement(yn,{name:"su-angle-up",onClick:this.handleCollapse}))):y.a.createElement(h.Fragment,null,i&&y.a.createElement("div",{className:wUe.a.icons},i.map((function(e){return y.a.createElement(yn,{key:e,name:e})}))),l&&t&&y.a.createElement("div",{className:wUe.a.type},l[t]),y.a.createElement(yn,{name:"su-angle-down"}))),y.a.createElement("article",{className:wUe.a.children},n)))}}])&&SUe(t.prototype,n),r&&SUe(t,r),i}(y.a.Component),xUe=n(414),TUe=n.n(xUe),DUe=jS((function(){return y.a.createElement(yn,{className:TUe.a.sortableHandle,name:"su-more"})}));function RUe(e){return(RUe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function MUe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function AUe(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);na.length&&l.splice(a.length),s.length>a.length&&s.splice(a.length),l.push.apply(l,hqe(new Array(a.length-l.length).fill(!1))),s.push.apply(s,hqe(new Array(a.length-s.length).fill(!1).map((function(){return++i.idCounter})))),o&&a.length=t}},{key:"hasMinimumReached",value:function(){var e=this.props,t=e.minOccurs,n=e.value;return!!t&&n.length<=t}},{key:"render",value:function(){var e=this.props,t=e.addButtonText,n=e.disabled,r=e.icons,o=e.onSettingsClick,i=e.renderBlockContent,a=e.types,u=e.value;return y.a.createElement("section",{className:pqe.a.blockCollection},y.a.createElement(cqe,{disabled:n,expandedBlocks:this.expandedBlocks,generatedBlockIds:this.generatedBlockIds,icons:r,lockAxis:"y",onCollapse:this.handleCollapse,onExpand:this.handleExpand,onRemove:this.hasMinimumReached()?void 0:this.handleRemoveBlock,onSettingsClick:o?this.handleSettingsClick:void 0,onSortEnd:this.handleSortEnd,onTypeChange:this.handleTypeChange,renderBlockContent:i,types:a,useDragHandle:!0,value:u}),y.a.createElement(Ii,{disabled:n||this.hasMaximumReached(),icon:"su-plus",onClick:this.handleAddBlock,skin:"secondary"},t||Nr("sulu_admin.add_block")))}}])&&bqe(t.prototype,n),r&&bqe(t,r),i}(y.a.Component),lqe.idCounter=0,lqe.defaultProps={disabled:!1,value:[]},eqe=Sqe((XUe=sqe).prototype,"generatedBlockIds",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),tqe=Sqe(XUe.prototype,"expandedBlocks",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),nqe=Sqe(XUe.prototype,"handleAddBlock",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){var t=e.props,n=t.defaultType,r=t.onChange,o=t.value;if(e.hasMaximumReached())throw new Error("The maximum amount of blocks has already been reached!");o&&(e.expandedBlocks.push(!0),e.generatedBlockIds.push(++kqe.idCounter),r([].concat(hqe(o),[{type:n}])))}}}),rqe=Sqe(XUe.prototype,"handleRemoveBlock",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){var n=e.props,r=n.onChange,o=n.value;if(e.hasMinimumReached())throw new Error("The minimum amount of blocks has already been reached!");o&&(e.expandedBlocks.splice(t,1),e.generatedBlockIds.splice(t,1),r(o.filter((function(e,n){return n!=t}))))}}}),oqe=Sqe(XUe.prototype,"handleSortEnd",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){var n=t.newIndex,r=t.oldIndex,o=e.props,i=o.onChange,a=o.onSortEnd,u=o.value;e.expandedBlocks=Si()(e.expandedBlocks,r,n),e.generatedBlockIds=Si()(e.generatedBlockIds,r,n),i(Si()(u,r,n)),a&&a(r,n)}}}),iqe=Sqe(XUe.prototype,"handleCollapse",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){e.expandedBlocks[t]=!1}}}),aqe=Sqe(XUe.prototype,"handleExpand",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){e.expandedBlocks[t]=!0}}}),uqe=Sqe(XUe.prototype,"handleTypeChange",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t,n){var r=e.props,o=r.onChange,i=r.value,a=Object(v.u)(i);a[n].type=t,o(a)}}}),QUe=XUe))||QUe,Pqe=kqe;function jqe(e){return(jqe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Eqe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Cqe(e,t){for(var n=0;n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Jqe(e,t){if(e){if("string"==typeof e)return Qqe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Qqe(e,t):void 0}}function Qqe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);nr&&h[r]?h[r]:void 0,formInspector:u,index:r,onChange:e.handleBlockChange,onFieldFinish:l,onSuccess:s,router:c,schema:d.form,schemaPath:f+"/types/"+n+"/form",showAllErrors:p})},e.renderCollapsedBlockContent=function(t,n,r){var o=e.getBlockSchemaType(n).form,i=Object.keys(o).filter((function(e){var t=o[e].tags;return t&&t.some((function(e){return"sulu.block_preview"===e.name}))})).sort((function(e,t){var n=o[e].tags,r=o[t].tags;if(!n||!r)throw new Error("All properties without any tag should have been filtered before. This should not happen and is likely a bug.");var i=n.find((function(e){return"sulu.block_preview"===e.name})),a=r.find((function(e){return"sulu.block_preview"===e.name}));if(!i||!a)throw new Error('All properties not having the "sulu.block_preview" tag should have been filtered before. This should not happen and is likely a bug.');return(a.priority||0)-(i.priority||0)}));if(0===i.length){var a,u=Zqe(vUe.blockPreviewTransformerKeysByPriority);try{for(u.s();!(a=u.n()).done;){for(var l=a.value,s=0,c=Object.keys(o);s=3)break}}catch(e){u.e(e)}finally{u.f()}}return y.a.createElement(h.Fragment,null,i.map((function(e){return vUe.has(o[e].type)&&t[e]&&y.a.createElement(h.Fragment,{key:e},vUe.get(o[e].type).transform(t[e],o[e]))})))},Xqe(e,"handleSettingsClick",Fqe,iKe(e)),Xqe(e,"handleSettingsOverlayClose",Yqe,iKe(e)),Xqe(e,"handleSettingsOverlayConfirm",Nqe,iKe(e)),Xqe(e,"closeSettingsOverlay",Bqe,iKe(e)),e.handleSettingsSubmit=function(){var t=e.props,n=t.onChange,r=t.value,o=void 0===r?[]:r,i=iKe(e),a=i.blockSettingsFormStore,u=i.blockSettingsOpen;a&&void 0!==u&&o&&n([].concat(Gqe(o.slice(0,u)),[Kqe(Kqe({},o[u]),{},$qe({},"settings",a.data))],Gqe(o.slice(u+1))))},e}return t=i,(n=[{key:"componentDidMount",value:function(){if(this.settingsFormKey){var e=this.props.formInspector;this.blockSettingsFormStore=cv.createFromFormKey(this.settingsFormKey,{},e.locale,void 0,e.options)}}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.defaultType,r=t.onChange,o=t.types,i=t.value,a=e.types;if(!o||!a)throw new Error(lKe);var u=Object(v.u)(i);if(u&&o!==a){if(!n)throw new Error("It is impossible that a block has no defaultType. This should not happen and is likely a bug.");u=u.map((function(e){return o[e.type]?e:Kqe(Kqe({},e),{},{type:n})}))}J()(Object(v.u)(i),u)||r(u)}},{key:"componentWillUnmount",value:function(){var e;null===(e=this.blockSettingsFormStore)||void 0===e||e.destroy()}},{key:"render",value:function(){var e=this.props,t=e.defaultType,n=e.disabled,r=e.maxOccurs,o=e.minOccurs,i=e.onChange,a=e.types,u=e.value;if(!t)throw new Error('The "block" field type needs a defaultType!');if(!a)throw new Error(lKe);var l=Object.keys(a).reduce((function(e,t){return e[t]=a[t].title,e}),{});return y.a.createElement(y.a.Fragment,null,y.a.createElement(Pqe,{addButtonText:this.addButtonText,defaultType:t,disabled:!!n,icons:this.icons,maxOccurs:r,minOccurs:o,onChange:i,onSettingsClick:this.settingsFormKey?this.handleSettingsClick:void 0,onSortEnd:this.handleSortEnd,renderBlockContent:this.renderBlockContent,types:l,value:u||[]}),this.settingsFormKey&&y.a.createElement(Zl,{confirmText:Nr("sulu_admin.apply"),onClose:this.handleSettingsOverlayClose,onConfirm:this.handleSettingsOverlayConfirm,open:void 0!==this.blockSettingsOpen,size:"small",title:Nr("sulu_admin.block_settings")},!!this.blockSettingsFormStore&&y.a.createElement("div",{className:Wqe.a.settingsOverlay},y.a.createElement(h4,{onSubmit:this.handleSettingsSubmit,ref:this.setFormRef,store:this.blockSettingsFormStore}))))}},{key:"settingsFormKey",get:function(){var e=this.props.schemaOptions.settings_form_key,t=(e=void 0===e?{}:e).value;if(void 0!==t&&"string"!=typeof t)throw new Error('The "block" field types only accepts strings as "settings_form_key" schema option!');return t}},{key:"addButtonText",get:function(){var e=this.props.schemaOptions.add_button_text,t=(e=void 0===e?{}:e).title;if(void 0!==t&&"string"!=typeof t)throw new Error('The "block" field types only accepts strings as "add_button_text" schema option!');return t}},{key:"iconsMapping",get:function(){var e,t=null===(e=this.blockSettingsFormStore)||void 0===e?void 0:e.schema;return t?Object.keys(t).reduce(function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return function(r,o){var i="/"+n+o;if(!ls.a.has(t,i))return r;var a=ls.a.get(t,i);if(a.items)return Object.keys(a.items).reduce(e(o+"/items/"),r);var u=a.tags.find((function(e){return"sulu.block_setting_icon"===e.name}));return u&&!1!==a.visible&&(r["/settings/"+o]=u.attributes.icon),r}}(),{}):{}}},{key:"icons",get:function(){var e=this,t=this.props.value;return t?t.map((function(t){return Object.keys(e.iconsMapping).reduce((function(n,r){return ls.a.has(t,r)&&ls.a.get(t,r)&&n.push(e.iconsMapping[r]),n}),[])})):[]}}])&&tKe(t.prototype,n),r&&tKe(t,r),i}(y.a.Component),Iqe=uKe((Lqe=Hqe).prototype,"blockSettingsOpen",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){}}),zqe=uKe(Lqe.prototype,"blockSettingsFormStore",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),uKe(Lqe.prototype,"componentDidMount",[v.d],Object.getOwnPropertyDescriptor(Lqe.prototype,"componentDidMount"),Lqe.prototype),uKe(Lqe.prototype,"settingsFormKey",[v.g],Object.getOwnPropertyDescriptor(Lqe.prototype,"settingsFormKey"),Lqe.prototype),uKe(Lqe.prototype,"addButtonText",[v.g],Object.getOwnPropertyDescriptor(Lqe.prototype,"addButtonText"),Lqe.prototype),uKe(Lqe.prototype,"iconsMapping",[v.g],Object.getOwnPropertyDescriptor(Lqe.prototype,"iconsMapping"),Lqe.prototype),uKe(Lqe.prototype,"icons",[v.g],Object.getOwnPropertyDescriptor(Lqe.prototype,"icons"),Lqe.prototype),Fqe=uKe(Lqe.prototype,"handleSettingsClick",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){var n,r=e.props.value;e.settingsFormKey&&r&&(e.blockSettingsOpen=t,e.blockSettingsFormStore.setMultiple(null!==(n=r[t].settings)&&void 0!==n?n:{}),e.blockSettingsFormStore.dirty=!1)}}}),Yqe=uKe(Lqe.prototype,"handleSettingsOverlayClose",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){e.closeSettingsOverlay()}}}),Nqe=uKe(Lqe.prototype,"handleSettingsOverlayConfirm",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){var t;null===(t=e.formRef)||void 0===t||t.submit(),e.closeSettingsOverlay()}}}),Bqe=uKe(Lqe.prototype,"closeSettingsOverlay",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){e.blockSettingsOpen=void 0}}}),Aqe=Lqe))||Aqe;function cKe(e,t){for(var n=0;n50?e.substring(0,50)+"...":e)}}])&&vKe(t.prototype,n),r&&vKe(t,r),e}(),wKe=n(417),_Ke=n.n(wKe);function OKe(e,t){for(var n=0;n50?t.substring(0,50)+"...":t)}}])&&OKe(t.prototype,n),r&&OKe(t,r),e}();function kKe(e,t){for(var n=0;n0&&p.push([Nr("sulu_admin.form_used_by"),this.collaborationStore.collaborations.map((function(e){return e.fullName})).join(", ")].join(" ")),{backButton:i,errors:n,locale:a,items:u,icons:l,showSuccess:o,warnings:p}})),b$e=n(419),v$e=n.n(b$e);function g$e(e){return(g$e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function w$e(e,t,n,r){n&&Object.defineProperty(e,t,{enumerable:n.enumerable,configurable:n.configurable,writable:n.writable,value:n.initializer?n.initializer.call(r):void 0})}function _$e(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:qJe.a.container,u=Ht((i=function(t){tQe(i,t);var n=rQe(i);function i(){var e;QJe(this,i);for(var t=arguments.length,a=new Array(t),u=0;u2&&void 0!==arguments[2]?arguments[2]:void 0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0;UQe(this,e),this.maxRadius=this.getComputedMaxRadius(r,t,n),this.minRadius=this.getComputedMinRadius(o,this.maxRadius)}var t,n,r;return t=e,(n=[{key:"getComputedMaxRadius",value:function(e,t,n){var r=Math.sqrt(Math.pow(t,2)+Math.pow(n,2));return void 0===e?r:Math.min(e,r)}},{key:"getComputedMinRadius",value:function(e,t){return void 0===e?0:Math.min(e,t)}},{key:"normalize",value:function(e){var t=e.radius,n=void 0===t?0:t;return n=Math.min(this.maxRadius,n),n=Math.max(this.minRadius,n),VQe(VQe({},e),{},{radius:n})}}])&&qQe(t.prototype,n),r&&qQe(t,r),e}();function $Qe(e){return($Qe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function GQe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ZQe(e){for(var t=1;t1&&void 0!==arguments[1]&&arguments[1];aVe(this,n),r=t.call(this,e);var i=[];if(o){var a=new Que(r.locale);a.set({class:"ck-preview-button",withText:!0}),a.extendTemplate({attributes:{href:r.bindTemplate.to("href"),target:"_blank"}}),a.bind("label").to(cVe(r),"href"),a.template.tag="a",a.template.eventListeners={},i.push(a)}var u=new Que(r.locale);u.set({icon:rVe}),u.delegate("execute").to(cVe(r),"link"),i.push(u);var l=new Que(r.locale);return l.set({icon:oVe}),l.delegate("execute").to(cVe(r),"unlink"),i.push(l),r.setTemplate({tag:"div",children:i}),r}return n}(bue);function dVe(e){return(dVe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function hVe(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return yVe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return yVe(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function yVe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0?"?"+l.toString().replace(/\+/g,"%20"):""))}else r(void 0)},t.handleUrlBlur=t.callUrlChange,BVe(t,"handleUrlChange",AVe,qVe(t)),t.handleMailSubjectBlur=t.callUrlChange,BVe(t,"handleProtocolChange",LVe,qVe(t)),BVe(t,"handleMailSubjectChange",IVe,qVe(t)),t.handleMailBodyBlur=t.callUrlChange,BVe(t,"handleMailBodyChange",zVe,qVe(t)),t.updateUrl(),t}return t=i,(n=[{key:"componentDidUpdate",value:function(e){!1===e.open&&!0===this.props.open&&this.updateUrl()}},{key:"updateUrl",value:function(){var e=this.props.url;if(e){var t=e.split("?");this.url=t[0];var n=new URLSearchParams(t[1]),r=n.get("subject"),o=n.get("body");this.mailSubject=r||void 0,this.mailBody=o||void 0}else this.url=void 0}},{key:"render",value:function(){var e=this.props,t=e.onCancel,n=e.onConfirm,r=e.onTargetChange,o=e.onTitleChange,i=e.open,a=e.target,u=e.title,l=e.url;return y.a.createElement(Td,{cancelText:Nr("sulu_admin.cancel"),confirmDisabled:!l,confirmText:Nr("sulu_admin.confirm"),onCancel:t,onConfirm:n,open:i,title:Nr("sulu_admin.link")},y.a.createElement(Cp,null,y.a.createElement(Cp.Field,{label:Nr("sulu_admin.link_url"),required:!0},y.a.createElement(f4,{defaultProtocol:"https://",onBlur:this.handleUrlBlur,onChange:this.handleUrlChange,onProtocolChange:this.handleProtocolChange,valid:!0,value:this.url})),this.protocol&&"mailto:"!==this.protocol&&y.a.createElement(Cp.Field,{label:Nr("sulu_admin.link_target"),required:!0},y.a.createElement(cm,{onChange:r,value:a},y.a.createElement(cm.Option,{value:"_blank"},"_blank"),y.a.createElement(cm.Option,{value:"_self"},"_self"),y.a.createElement(cm.Option,{value:"_parent"},"_parent"),y.a.createElement(cm.Option,{value:"_top"},"_top"))),this.protocol&&"mailto:"===this.protocol&&y.a.createElement(h.Fragment,null,y.a.createElement(Cp.Field,{label:Nr("sulu_admin.mail_subject")},y.a.createElement(ha,{onBlur:this.handleMailSubjectBlur,onChange:this.handleMailSubjectChange,value:this.mailSubject})),y.a.createElement(Cp.Field,{label:Nr("sulu_admin.mail_body")},y.a.createElement(d5,{onBlur:this.handleMailBodyBlur,onChange:this.handleMailBodyChange,value:this.mailBody}))),y.a.createElement(Cp.Field,{label:Nr("sulu_admin.link_title")},y.a.createElement(ha,{onChange:o,value:u}))))}}])&&HVe(t.prototype,n),r&&HVe(t,r),i}(y.a.Component),TVe=$Ve((xVe=FVe).prototype,"protocol",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){}}),DVe=$Ve(xVe.prototype,"url",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){}}),RVe=$Ve(xVe.prototype,"mailSubject",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){}}),MVe=$Ve(xVe.prototype,"mailBody",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){}}),$Ve(xVe.prototype,"componentDidUpdate",[v.d],Object.getOwnPropertyDescriptor(xVe.prototype,"componentDidUpdate"),xVe.prototype),AVe=$Ve(xVe.prototype,"handleUrlChange",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){e.url=t}}}),LVe=$Ve(xVe.prototype,"handleProtocolChange",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){e.protocol=t}}}),IVe=$Ve(xVe.prototype,"handleMailSubjectChange",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){e.mailSubject=t}}}),zVe=$Ve(xVe.prototype,"handleMailBodyChange",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){e.mailBody=t}}}),CVe=xVe))||CVe;function aWe(e){return(aWe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function uWe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lWe(e,t,n,r){n&&Object.defineProperty(e,t,{enumerable:n.enumerable,configurable:n.configurable,writable:n.writable,value:n.initializer?n.initializer.call(r):void 0})}function sWe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function cWe(e,t){for(var n=0;n\n'}),n.on("execute",Object(v.d)((function(){t.selection=t.editor.model.document.selection,t.open=!0,t.target="_self",t.title=void 0,t.url=void 0}))),n})),eVe(this.editor,"a","externalLinkTarget","target"),eVe(this.editor,"a","externalLinkHref","href"),eVe(this.editor,"a","externalLinkTitle","title");var n=this.editor.editing.view;n.addObserver(XHe),this.listenTo(n.document,"click",(function(){var e=nVe(t.editor,"a");t.hideBalloon(),e&&(t.set("href",e.getAttribute("href")),t.balloon.add({position:{target:n.domConverter.mapViewToDom(e)},view:t.balloonView}))})),this.listenTo(n.document,"blur",(function(){t.hideBalloon()}))}},{key:"hideBalloon",value:function(){this.balloon.hasView(this.balloonView)&&this.balloon.remove(this.balloonView)}},{key:"destroy",value:function(){Object(m.unmountComponentAtNode)(this.externalLinkOverlayElement),this.externalLinkOverlayElement.remove(),this.externalLinkOverlayElement=void 0}}])&&cWe(t.prototype,n),r&&cWe(t,r),i}(lie)).prototype,"open",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),JVe=mWe(GVe.prototype,"target",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return"_self"}}),QVe=mWe(GVe.prototype,"title",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),XVe=mWe(GVe.prototype,"url",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),eWe=mWe(GVe.prototype,"handleOverlayConfirm",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){var t;e.editor.execute("externalLink",(uWe(t={selection:e.selection},"target",e.target),uWe(t,"title",e.title),uWe(t,"url",e.url),t)),e.open=!1}}}),tWe=mWe(GVe.prototype,"handleOverlayClose",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){e.open=!1}}}),nWe=mWe(GVe.prototype,"handleTargetChange",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){e.target=t}}}),rWe=mWe(GVe.prototype,"handleTitleChange",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){e.title=t}}}),oWe=mWe(GVe.prototype,"handleUrlChange",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){e.url=t}}}),GVe);function vWe(e,t){for(var n=0;n\n'}),xWe.getKeys().forEach((function(n){var o=new Que(e);o.set({class:"ck-link-button",label:xWe.getTitle(n),withText:!0});var i=new Use(e);i.children.add(o),o.delegate("execute").to(i),o.on("execute",Object(v.d)((function(){t.selection=t.editor.model.document.selection,t.openOverlay=n,t.target="_self",t.title=void 0,t.id=void 0}))),r.items.add(i)})),r.items.delegate("execute").to(n),n.panelView.children.add(r),n})),eVe(this.editor,"sulu-link","validationState","sulu-validation-state"),eVe(this.editor,"sulu-link","internalLinkProvider","provider"),eVe(this.editor,"sulu-link","internalLinkTarget","target"),eVe(this.editor,"sulu-link","internalLinkTitle","title"),eVe(this.editor,"sulu-link","internalLinkHref","href");var r=this.editor.editing.view;r.addObserver(XHe),this.listenTo(r.document,"click",(function(){var e=nVe(t.editor,"sulu-link");t.hideBalloon(),e&&t.balloon.add({position:{target:r.domConverter.mapViewToDom(e)},view:t.balloonView})})),this.listenTo(r.document,"blur",(function(){t.hideBalloon()}))}},{key:"hideBalloon",value:function(){this.balloon.hasView(this.balloonView)&&this.balloon.remove(this.balloonView)}},{key:"destroy",value:function(){Object(m.unmountComponentAtNode)(this.internalLinkElement),this.internalLinkElement.remove(),this.internalLinkElement=void 0}}])&&AWe(t.prototype,n),r&&AWe(t,r),i}(lie)).prototype,"openOverlay",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){}}),_We=NWe(gWe.prototype,"target",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return"_self"}}),OWe=NWe(gWe.prototype,"id",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){}}),SWe=NWe(gWe.prototype,"title",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),kWe=NWe(gWe.prototype,"handleOverlayConfirm",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){var t;e.editor.execute("internalLink",(DWe(t={},"id",e.id),DWe(t,"provider",e.openOverlay),DWe(t,"selection",e.selection),DWe(t,"target",e.target),DWe(t,"title",e.title),DWe(t,"defaultText",e.defaultText),t)),e.openOverlay=void 0}}}),PWe=NWe(gWe.prototype,"handleOverlayClose",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){e.openOverlay=void 0}}}),jWe=NWe(gWe.prototype,"handleTargetChange",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){e.target=t}}}),EWe=NWe(gWe.prototype,"handleTitleChange",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){e.title=t}}}),CWe=NWe(gWe.prototype,"handleResourceChange",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t,n){e.id=t,e.defaultText=n?n.title:void 0}}}),gWe);function HWe(e){return(HWe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function VWe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function WWe(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&i(e.getEditorData())}))})).catch((function(e){d.a.error(e)}))}},{key:"componentWillUnmount",value:function(){var e=this;this.editorInstance&&this.editorInstance.destroy().then((function(){return e.editorInstance=null}))}},{key:"getEditorData",value:function(){var e=this.editorInstance.getData();return""===e?void 0:e}},{key:"render",value:function(){return y.a.createElement("div",{ref:this.setContainerRef})}}])&&uUe(t.prototype,n),r&&uUe(t,r),i}(y.a.Component);pUe.defaultProps={disabled:!1,formats:["h2","h3","h4","h5","h6"],value:""};var dUe=pUe;function hUe(e){return(hUe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function yUe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function mUe(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:0;if(e in this.blockPreviewTransformers)throw new Error('The key "'+e+'" has already been used for another BlockPreviewTransformer');this.blockPreviewTransformers[e]=t,this.priority[e]=n}},{key:"get",value:function(e){if(!(e in this.blockPreviewTransformers))throw new Error('The BlockPreviewTransformer with the key "'+e+'" is not defined. You probably forgot to add it to the registry using the "add" method.');return this.blockPreviewTransformers[e]}},{key:"blockPreviewTransformerKeysByPriority",get:function(){var e=this;return Object.keys(this.priority).sort((function(t,n){return e.priority[n]-e.priority[t]}))}}])&&jUe(t.prototype,n),r&&jUe(t,r),e}()).prototype,"blockPreviewTransformers",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),SUe=EUe(_Ue.prototype,"priority",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),EUe(_Ue.prototype,"blockPreviewTransformerKeysByPriority",[v.g],Object.getOwnPropertyDescriptor(_Ue.prototype,"blockPreviewTransformerKeysByPriority"),_Ue.prototype),_Ue),xUe=n(27),TUe=n.n(xUe);function DUe(e){return(DUe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function RUe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function MUe(e,t){for(var n=0;n1&&y.a.createElement("div",{className:TUe.a.types},y.a.createElement(cm,{onChange:this.handleTypeChange,value:t},Object.keys(l).map((function(e){return y.a.createElement(cm.Option,{key:e,value:e},l[e])})))),i&&y.a.createElement("div",{className:TUe.a.icons},i.map((function(e){return y.a.createElement(yn,{key:e,name:e})}))),y.a.createElement("div",{className:TUe.a.iconButtons},a&&y.a.createElement(yn,{name:"su-cog",onClick:a}),u&&y.a.createElement(yn,{name:"su-trash-alt",onClick:u}),y.a.createElement(yn,{name:"su-angle-up",onClick:this.handleCollapse}))):y.a.createElement(h.Fragment,null,i&&y.a.createElement("div",{className:TUe.a.icons},i.map((function(e){return y.a.createElement(yn,{key:e,name:e})}))),l&&t&&y.a.createElement("div",{className:TUe.a.type},l[t]),y.a.createElement(yn,{name:"su-angle-down"}))),y.a.createElement("article",{className:TUe.a.children},n)))}}])&&MUe(t.prototype,n),r&&MUe(t,r),i}(y.a.Component),YUe=n(414),NUe=n.n(YUe),BUe=IS((function(){return y.a.createElement(yn,{className:NUe.a.sortableHandle,name:"su-more"})}));function HUe(e){return(HUe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function VUe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function WUe(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);na.length&&l.splice(a.length),s.length>a.length&&s.splice(a.length),l.push.apply(l,kqe(new Array(a.length-l.length).fill(!1))),s.push.apply(s,kqe(new Array(a.length-s.length).fill(!1).map((function(){return++i.idCounter})))),o&&a.length=t}},{key:"hasMinimumReached",value:function(){var e=this.props,t=e.minOccurs,n=e.value;return!!t&&n.length<=t}},{key:"render",value:function(){var e=this.props,t=e.addButtonText,n=e.disabled,r=e.icons,o=e.onSettingsClick,i=e.renderBlockContent,a=e.types,u=e.value;return y.a.createElement("section",{className:Oqe.a.blockCollection},y.a.createElement(wqe,{disabled:n,expandedBlocks:this.expandedBlocks,generatedBlockIds:this.generatedBlockIds,icons:r,lockAxis:"y",onCollapse:this.handleCollapse,onExpand:this.handleExpand,onRemove:this.hasMinimumReached()?void 0:this.handleRemoveBlock,onSettingsClick:o?this.handleSettingsClick:void 0,onSortEnd:this.handleSortEnd,onTypeChange:this.handleTypeChange,renderBlockContent:i,types:a,useDragHandle:!0,value:u}),y.a.createElement(Ii,{disabled:n||this.hasMaximumReached(),icon:"su-plus",onClick:this.handleAddBlock,skin:"secondary"},t||Nr("sulu_admin.add_block")))}}])&&Eqe(t.prototype,n),r&&Eqe(t,r),i}(y.a.Component),vqe.idCounter=0,vqe.defaultProps={disabled:!1,value:[]},cqe=Mqe((sqe=gqe).prototype,"generatedBlockIds",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),fqe=Mqe(sqe.prototype,"expandedBlocks",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),pqe=Mqe(sqe.prototype,"handleAddBlock",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){var t=e.props,n=t.defaultType,r=t.onChange,o=t.value;if(e.hasMaximumReached())throw new Error("The maximum amount of blocks has already been reached!");o&&(e.expandedBlocks.push(!0),e.generatedBlockIds.push(++Aqe.idCounter),r([].concat(kqe(o),[{type:n}])))}}}),dqe=Mqe(sqe.prototype,"handleRemoveBlock",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){var n=e.props,r=n.onChange,o=n.value;if(e.hasMinimumReached())throw new Error("The minimum amount of blocks has already been reached!");o&&(e.expandedBlocks.splice(t,1),e.generatedBlockIds.splice(t,1),r(o.filter((function(e,n){return n!=t}))))}}}),hqe=Mqe(sqe.prototype,"handleSortEnd",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){var n=t.newIndex,r=t.oldIndex,o=e.props,i=o.onChange,a=o.onSortEnd,u=o.value;e.expandedBlocks=Si()(e.expandedBlocks,r,n),e.generatedBlockIds=Si()(e.generatedBlockIds,r,n),i(Si()(u,r,n)),a&&a(r,n)}}}),yqe=Mqe(sqe.prototype,"handleCollapse",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){e.expandedBlocks[t]=!1}}}),mqe=Mqe(sqe.prototype,"handleExpand",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){e.expandedBlocks[t]=!0}}}),bqe=Mqe(sqe.prototype,"handleTypeChange",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t,n){var r=e.props,o=r.onChange,i=r.value,a=Object(v.u)(i);a[n].type=t,o(a)}}}),lqe=sqe))||lqe,Lqe=Aqe;function Iqe(e){return(Iqe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function zqe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Fqe(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);nr&&h[r]?h[r]:void 0,formInspector:u,index:r,onChange:t.handleBlockChange,onFieldFinish:l,onSuccess:s,router:c,schema:d.form,schemaPath:f+"/types/"+n+"/form",showAllErrors:p})},t.renderCollapsedBlockContent=function(e,n,r){var o=t.getBlockSchemaType(n).form,i=Object.keys(o).filter((function(e){var t=o[e].tags;return t&&t.some((function(e){return"sulu.block_preview"===e.name}))})).sort((function(e,t){var n=o[e].tags,r=o[t].tags;if(!n||!r)throw new Error("All properties without any tag should have been filtered before. This should not happen and is likely a bug.");var i=n.find((function(e){return"sulu.block_preview"===e.name})),a=r.find((function(e){return"sulu.block_preview"===e.name}));if(!i||!a)throw new Error('All properties not having the "sulu.block_preview" tag should have been filtered before. This should not happen and is likely a bug.');return(a.priority||0)-(i.priority||0)}));if(0===i.length){var a,u=function(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=lKe(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}(CUe.blockPreviewTransformerKeysByPriority);try{for(u.s();!(a=u.n()).done;){for(var l=a.value,s=0,c=Object.keys(o);s=3)break}}catch(e){u.e(e)}finally{u.f()}}return y.a.createElement(h.Fragment,null,i.map((function(t){return CUe.has(o[t].type)&&e[t]&&y.a.createElement(h.Fragment,{key:t},CUe.get(o[t].type).transform(e[t],o[t]))})))},cKe(t,"handleSettingsClick",Zqe,yKe(t)),cKe(t,"handleSettingsOverlayClose",Jqe,yKe(t)),cKe(t,"handleSettingsOverlayConfirm",Qqe,yKe(t)),cKe(t,"closeSettingsOverlay",Xqe,yKe(t)),t.handleSettingsSubmit=function(){var e=t.props,n=e.onChange,r=e.value,o=void 0===r?[]:r,i=yKe(t),a=i.blockSettingsFormStore,u=i.blockSettingsOpen;a&&void 0!==u&&o&&n([].concat(uKe(o.slice(0,u)),[iKe(iKe({},o[u]),{},aKe({},"settings",a.data))],uKe(o.slice(u+1))))},t.value=t.props.value,t}return t=i,(n=[{key:"componentDidMount",value:function(){if(this.settingsFormKey){var e=this.props.formInspector;this.blockSettingsFormStore=wv.createFromFormKey(this.settingsFormKey,{},e.locale,void 0,e.options)}}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.defaultType,r=t.onChange,o=t.types,i=t.value,a=e.types;if(J()(e.value,i)||this.updateValue(i),!o||!a)throw new Error(vKe);var u=Object(v.u)(i);if(u&&o!==a){if(!n)throw new Error("It is impossible that a block has no defaultType. This should not happen and is likely a bug.");u=u.map((function(e){return o[e.type]?e:iKe(iKe({},e),{},{type:n})}))}J()(Object(v.u)(i),u)||r(u)}},{key:"componentWillUnmount",value:function(){var e;null===(e=this.blockSettingsFormStore)||void 0===e||e.destroy()}},{key:"render",value:function(){var e=this.props,t=e.defaultType,n=e.disabled,r=e.maxOccurs,o=e.minOccurs,i=e.types,a=this.value||[];if(!t)throw new Error('The "block" field type needs a defaultType!');if(!i)throw new Error(vKe);var u=Object.keys(i).reduce((function(e,t){return e[t]=i[t].title,e}),{});return y.a.createElement(y.a.Fragment,null,y.a.createElement(Lqe,{addButtonText:this.addButtonText,defaultType:t,disabled:!!n,icons:this.icons,maxOccurs:r,minOccurs:o,onChange:this.handleBlocksChange,onSettingsClick:this.settingsFormKey?this.handleSettingsClick:void 0,onSortEnd:this.handleSortEnd,renderBlockContent:this.renderBlockContent,types:u,value:a||[]}),this.settingsFormKey&&y.a.createElement(Zl,{confirmText:Nr("sulu_admin.apply"),onClose:this.handleSettingsOverlayClose,onConfirm:this.handleSettingsOverlayConfirm,open:void 0!==this.blockSettingsOpen,size:"small",title:Nr("sulu_admin.block_settings")},!!this.blockSettingsFormStore&&y.a.createElement("div",{className:nKe.a.settingsOverlay},y.a.createElement(k4,{onSubmit:this.handleSettingsSubmit,ref:this.setFormRef,store:this.blockSettingsFormStore}))))}},{key:"settingsFormKey",get:function(){var e=this.props.schemaOptions.settings_form_key,t=(e=void 0===e?{}:e).value;if(void 0!==t&&"string"!=typeof t)throw new Error('The "block" field types only accepts strings as "settings_form_key" schema option!');return t}},{key:"addButtonText",get:function(){var e=this.props.schemaOptions.add_button_text,t=(e=void 0===e?{}:e).title;if(void 0!==t&&"string"!=typeof t)throw new Error('The "block" field types only accepts strings as "add_button_text" schema option!');return t}},{key:"iconsMapping",get:function(){var e,t=null===(e=this.blockSettingsFormStore)||void 0===e?void 0:e.schema;return t?Object.keys(t).reduce(function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return function(r,o){var i="/"+n+o;if(!ls.a.has(t,i))return r;var a=ls.a.get(t,i);if(a.items)return Object.keys(a.items).reduce(e(o+"/items/"),r);var u=a.tags.find((function(e){return"sulu.block_setting_icon"===e.name}));return u&&!1!==a.visible&&(r["/settings/"+o]=u.attributes.icon),r}}(),{}):{}}},{key:"icons",get:function(){var e=this,t=this.props.value;return t?t.map((function(t){return Object.keys(e.iconsMapping).reduce((function(n,r){return ls.a.has(t,r)&&ls.a.get(t,r)&&n.push(e.iconsMapping[r]),n}),[])})):[]}}])&&fKe(t.prototype,n),r&&fKe(t,r),i}(y.a.Component),qqe=bKe((Uqe=eKe).prototype,"blockSettingsOpen",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){}}),Kqe=bKe(Uqe.prototype,"blockSettingsFormStore",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),$qe=bKe(Uqe.prototype,"value",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),bKe(Uqe.prototype,"componentDidMount",[v.d],Object.getOwnPropertyDescriptor(Uqe.prototype,"componentDidMount"),Uqe.prototype),bKe(Uqe.prototype,"settingsFormKey",[v.g],Object.getOwnPropertyDescriptor(Uqe.prototype,"settingsFormKey"),Uqe.prototype),bKe(Uqe.prototype,"addButtonText",[v.g],Object.getOwnPropertyDescriptor(Uqe.prototype,"addButtonText"),Uqe.prototype),bKe(Uqe.prototype,"iconsMapping",[v.g],Object.getOwnPropertyDescriptor(Uqe.prototype,"iconsMapping"),Uqe.prototype),bKe(Uqe.prototype,"icons",[v.g],Object.getOwnPropertyDescriptor(Uqe.prototype,"icons"),Uqe.prototype),Gqe=bKe(Uqe.prototype,"updateValue",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){e.value=t}}}),Zqe=bKe(Uqe.prototype,"handleSettingsClick",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){var n,r=e.props.value;e.settingsFormKey&&r&&(e.blockSettingsOpen=t,e.blockSettingsFormStore.setMultiple(null!==(n=r[t].settings)&&void 0!==n?n:{}),e.blockSettingsFormStore.dirty=!1)}}}),Jqe=bKe(Uqe.prototype,"handleSettingsOverlayClose",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){e.closeSettingsOverlay()}}}),Qqe=bKe(Uqe.prototype,"handleSettingsOverlayConfirm",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){var t;null===(t=e.formRef)||void 0===t||t.submit(),e.closeSettingsOverlay()}}}),Xqe=bKe(Uqe.prototype,"closeSettingsOverlay",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){e.blockSettingsOpen=void 0}}}),Wqe=Uqe))||Wqe;function wKe(e,t){for(var n=0;n50?e.substring(0,50)+"...":e)}}])&&CKe(t.prototype,n),r&&CKe(t,r),e}(),TKe=n(417),DKe=n.n(TKe);function RKe(e,t){for(var n=0;n50?t.substring(0,50)+"...":t)}}])&&RKe(t.prototype,n),r&&RKe(t,r),e}();function AKe(e,t){for(var n=0;n0&&p.push([Nr("sulu_admin.form_used_by"),this.collaborationStore.collaborations.map((function(e){return e.fullName})).join(", ")].join(" ")),{backButton:i,errors:n,locale:a,items:u,icons:l,showSuccess:o,warnings:p}})),E$e=n(419),C$e=n.n(E$e);function x$e(e){return(x$e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function T$e(e,t,n,r){n&&Object.defineProperty(e,t,{enumerable:n.enumerable,configurable:n.configurable,writable:n.writable,value:n.initializer?n.initializer.call(r):void 0})}function D$e(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:nQe.a.container,u=Ht((i=function(t){fQe(i,t);var n=dQe(i);function i(){var e;lQe(this,i);for(var t=arguments.length,a=new Array(t),u=0;u2&&void 0!==arguments[2]?arguments[2]:void 0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0;tXe(this,e),this.maxRadius=this.getComputedMaxRadius(r,t,n),this.minRadius=this.getComputedMinRadius(o,this.maxRadius)}var t,n,r;return t=e,(n=[{key:"getComputedMaxRadius",value:function(e,t,n){var r=Math.sqrt(Math.pow(t,2)+Math.pow(n,2));return void 0===e?r:Math.min(e,r)}},{key:"getComputedMinRadius",value:function(e,t){return void 0===e?0:Math.min(e,t)}},{key:"normalize",value:function(e){var t=e.radius,n=void 0===t?0:t;return n=Math.min(this.maxRadius,n),n=Math.max(this.minRadius,n),XQe(XQe({},e),{},{radius:n})}}])&&nXe(t.prototype,n),r&&nXe(t,r),e}();function oXe(e){return(oXe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function iXe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function aXe(e){for(var t=1;t0?r:e.name,writable:!1,configurable:!1,enumerable:!0})}return n}var GXe=[".DS_Store","Thumbs.db"];function ZXe(e){return!!e.dataTransfer}function JXe(e){return(function(e){return null!==e}(e.target)&&e.target.files?e0e(e.target.files):[]).map((function(e){return $Xe(e)}))}function QXe(e,t){return Xn(this,void 0,void 0,(function(){var n;return er(this,(function(r){switch(r.label){case 0:return e.items?(n=e0e(e.items).filter((function(e){return"file"===e.kind})),"drop"!==t?[2,n]:[4,Promise.all(n.map(t0e))]):[3,2];case 1:return[2,XXe(n0e(r.sent()))];case 2:return[2,XXe(e0e(e.files).map((function(e){return $Xe(e)})))]}}))}))}function XXe(e){return e.filter((function(e){return-1===GXe.indexOf(e.name)}))}function e0e(e){for(var t=[],n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);nn)return[!1,p0e(n)];if(e.sizen)return[!1,p0e(n)]}return[!0,null]}function b0e(e){return null!=e}function v0e(e){var t=e.files,n=e.accept,r=e.minSize,o=e.maxSize,i=e.multiple,a=e.maxFiles;return!(!i&&t.length>1||i&&a>=1&&t.length>a)&&t.every((function(e){var t=s0e(y0e(e,n),1)[0],i=s0e(m0e(e,r,o),1)[0];return t&&i}))}function g0e(e){return"function"==typeof e.isPropagationStopped?e.isPropagationStopped():void 0!==e.cancelBubble&&e.cancelBubble}function w0e(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 _0e(e){e.preventDefault()}function O0e(e){return-1!==e.indexOf("MSIE")||-1!==e.indexOf("Trident/")}function S0e(e){return-1!==e.indexOf("Edge/")}function k0e(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.navigator.userAgent;return O0e(e)||S0e(e)}function P0e(){for(var e=arguments.length,t=new Array(e),n=0;n1?n-1:0),o=1;oe.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var A0e=Object(h.forwardRef)((function(e,t){var n=e.children,r=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=D0e(D0e({},L0e),e),n=t.accept,r=t.disabled,o=t.getFilesFromEvent,i=t.maxSize,a=t.minSize,u=t.multiple,l=t.maxFiles,s=t.onDragEnter,c=t.onDragLeave,f=t.onDragOver,p=t.onDrop,d=t.onDropAccepted,y=t.onDropRejected,m=t.onFileDialogCancel,b=t.preventDropOnDocument,v=t.noClick,g=t.noKeyboard,w=t.noDrag,_=t.noDragEventsBubbling,O=Object(h.useRef)(null),S=Object(h.useRef)(null),k=Object(h.useReducer)(F0e,z0e),P=E0e(k,2),j=P[0],E=P[1],C=j.isFocused,x=j.isFileDialogActive,T=j.draggedFiles,D=Object(h.useCallback)((function(){S.current&&(E({type:"openDialog"}),S.current.value=null,S.current.click())}),[E]),R=function(){x&&setTimeout((function(){S.current&&(S.current.files.length||(E({type:"closeDialog"}),"function"==typeof m&&m()))}),300)};Object(h.useEffect)((function(){return window.addEventListener("focus",R,!1),function(){window.removeEventListener("focus",R,!1)}}),[S,x,m]);var M=Object(h.useCallback)((function(e){O.current&&O.current.isEqualNode(e.target)&&(32!==e.keyCode&&13!==e.keyCode||(e.preventDefault(),D()))}),[O,S]),A=Object(h.useCallback)((function(){E({type:"focus"})}),[]),L=Object(h.useCallback)((function(){E({type:"blur"})}),[]),I=Object(h.useCallback)((function(){v||(k0e()?setTimeout(D,0):D())}),[S,v]),z=Object(h.useRef)([]),F=function(e){O.current&&O.current.contains(e.target)||(e.preventDefault(),z.current=[])};Object(h.useEffect)((function(){return b&&(document.addEventListener("dragover",_0e,!1),document.addEventListener("drop",F,!1)),function(){b&&(document.removeEventListener("dragover",_0e),document.removeEventListener("drop",F))}}),[O,b]);var Y=Object(h.useCallback)((function(e){e.preventDefault(),e.persist(),q(e),z.current=[].concat(j0e(z.current),[e.target]),w0e(e)&&Promise.resolve(o(e)).then((function(t){g0e(e)&&!_||(E({draggedFiles:t,isDragActive:!0,type:"setDraggedFiles"}),s&&s(e))}))}),[o,s,_]),N=Object(h.useCallback)((function(e){if(e.preventDefault(),e.persist(),q(e),e.dataTransfer)try{e.dataTransfer.dropEffect="copy"}catch(e){}return w0e(e)&&f&&f(e),!1}),[f,_]),B=Object(h.useCallback)((function(e){e.preventDefault(),e.persist(),q(e);var t=z.current.filter((function(e){return O.current&&O.current.contains(e)})),n=t.indexOf(e.target);-1!==n&&t.splice(n,1),z.current=t,t.length>0||(E({isDragActive:!1,type:"setDraggedFiles",draggedFiles:[]}),w0e(e)&&c&&c(e))}),[O,c,_]),H=Object(h.useCallback)((function(e){e.preventDefault(),e.persist(),q(e),z.current=[],w0e(e)&&Promise.resolve(o(e)).then((function(t){if(!g0e(e)||_){var r=[],o=[];t.forEach((function(e){var t=E0e(y0e(e,n),2),u=t[0],l=t[1],s=E0e(m0e(e,a,i),2),c=s[0],f=s[1];if(u&&c)r.push(e);else{var p=[l,f].filter((function(e){return e}));o.push({file:e,errors:p})}})),(!u&&r.length>1||u&&l>=1&&r.length>l)&&(r.forEach((function(e){o.push({file:e,errors:[h0e]})})),r.splice(0)),E({acceptedFiles:r,fileRejections:o,type:"setFiles"}),p&&p(r,o,e),o.length>0&&y&&y(o,e),r.length>0&&d&&d(r,e)}})),E({type:"reset"})}),[u,n,a,i,l,o,p,d,y,_]),V=function(e){return r?null:e},W=function(e){return g?null:V(e)},U=function(e){return w?null:V(e)},q=function(e){_&&e.stopPropagation()},K=Object(h.useMemo)((function(){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.refKey,n=void 0===t?"ref":t,o=e.onKeyDown,i=e.onFocus,a=e.onBlur,u=e.onClick,l=e.onDragEnter,s=e.onDragOver,c=e.onDragLeave,f=e.onDrop,p=M0e(e,["refKey","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"]);return D0e(D0e(R0e({onKeyDown:W(P0e(o,M)),onFocus:W(P0e(i,A)),onBlur:W(P0e(a,L)),onClick:V(P0e(u,I)),onDragEnter:U(P0e(l,Y)),onDragOver:U(P0e(s,N)),onDragLeave:U(P0e(c,B)),onDrop:U(P0e(f,H))},n,O),r||g?{}:{tabIndex:0}),p)}}),[O,M,A,L,I,Y,N,B,H,g,w,r]),$=Object(h.useCallback)((function(e){e.stopPropagation()}),[]),G=Object(h.useMemo)((function(){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.refKey,r=void 0===t?"ref":t,o=e.onChange,i=e.onClick,a=M0e(e,["refKey","onChange","onClick"]),l=R0e({accept:n,multiple:u,type:"file",style:{display:"none"},onChange:V(P0e(o,H)),onClick:V(P0e(i,$)),autoComplete:"off",tabIndex:-1},r,S);return D0e(D0e({},l),a)}}),[S,n,u,H,r]),Z=T.length,J=Z>0&&v0e({files:T,accept:n,minSize:a,maxSize:i,multiple:u,maxFiles:l}),Q=Z>0&&!J;return D0e(D0e({},j),{},{isDragAccept:J,isDragReject:Q,isFocused:C&&!r,getRootProps:K,getInputProps:G,rootRef:O,inputRef:S,open:V(D)})}(M0e(e,["children"])),o=r.open,i=M0e(r,["open"]);return Object(h.useImperativeHandle)(t,(function(){return{open:o}}),[o]),y.a.createElement(h.Fragment,null,n(D0e(D0e({},i),{},{open:o})))}));A0e.displayName="Dropzone";var L0e={disabled:!1,getFilesFromEvent:function(e){return Xn(this,void 0,void 0,(function(){return er(this,(function(t){return[2,ZXe(e)&&e.dataTransfer?QXe(e.dataTransfer,e.type):JXe(e)]}))}))},maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1};A0e.defaultProps=L0e,A0e.propTypes={children:ul.a.func,accept:ul.a.oneOfType([ul.a.string,ul.a.arrayOf(ul.a.string)]),multiple:ul.a.bool,preventDropOnDocument:ul.a.bool,noClick:ul.a.bool,noKeyboard:ul.a.bool,noDrag:ul.a.bool,noDragEventsBubbling:ul.a.bool,minSize:ul.a.number,maxSize:ul.a.number,maxFiles:ul.a.number,disabled:ul.a.bool,getFilesFromEvent:ul.a.func,onFileDialogCancel:ul.a.func,onDragEnter:ul.a.func,onDragLeave:ul.a.func,onDragOver:ul.a.func,onDrop:ul.a.func,onDropAccepted:ul.a.func,onDropRejected:ul.a.func};var I0e=A0e,z0e={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,draggedFiles:[],acceptedFiles:[],fileRejections:[]};function F0e(e,t){switch(t.type){case"focus":return D0e(D0e({},e),{},{isFocused:!0});case"blur":return D0e(D0e({},e),{},{isFocused:!1});case"openDialog":return D0e(D0e({},e),{},{isFileDialogActive:!0});case"closeDialog":return D0e(D0e({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":var n=t.isDragActive,r=t.draggedFiles;return D0e(D0e({},e),{},{draggedFiles:r,isDragActive:n});case"setFiles":return D0e(D0e({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return D0e(D0e({},e),{},{isFileDialogActive:!1,isDragActive:!1,draggedFiles:[],acceptedFiles:[],fileRejections:[]});default:return e}}function Y0e(e){return(Y0e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function N0e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function B0e(e,t){for(var n=0;nthis.containerWidth?n=(t=this.containerWidth)*(this.minHeight/this.minWidth):t=r,P1e(P1e({},e),{},{width:t,height:n})}}])&&E1e(t.prototype,n),r&&E1e(t,r),e}();function x1e(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;A1e(this,e),this.containerWidth=t,this.containerHeight=n,this.minWidth=r,this.minHeight=o}var t,n,r;return t=e,(n=[{key:"normalize",value:function(e){var t=Math.max(this.minWidth,e.width),n=Math.max(this.minHeight,e.height);return t=Math.min(this.containerWidth,t),n=Math.min(this.containerHeight,n),R1e(R1e({},e),{},{width:t,height:n})}}])&&L1e(t.prototype,n),r&&L1e(t,r),e}();function z1e(e){return(z1e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function F1e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Y1e(e){for(var t=1;tthis.props.containerHeight/this.props.containerWidth}},{key:"render",value:function(){if(!this.imageLoaded||!this.props.containerWidth||!this.props.containerHeight)return null;var e=this.props.value?this.naturalDataToScaled(this.props.value):void 0;return y.a.createElement(w2e,{minHeight:this.scaledMinHeight,minWidth:this.scaledMinWidth,onChange:this.handleRectangleSelectionChange,round:!1,value:e},y.a.createElement("img",{height:this.scaledImageHeight,src:this.props.image,width:this.scaledImageWidth}))}},{key:"scaledImageHeight",get:function(){return this.imageFillsContainerHeight()?Math.min(this.image.naturalHeight,this.props.containerHeight):this.scaledImageWidth*this.image.naturalHeight/this.image.naturalWidth}},{key:"scaledImageWidth",get:function(){return this.imageFillsContainerHeight()?this.scaledImageHeight*this.image.naturalWidth/this.image.naturalHeight:Math.min(this.image.naturalWidth,this.props.containerWidth)}},{key:"scaledMinDimensions",get:function(){var e=this.props,t=e.minHeight,n=e.minWidth,r=e.containerHeight,o=e.containerWidth,i=t?this.naturalVerticalToScaled(t):void 0,a=n?this.naturalHorizontalToScaled(n):void 0;return i&&i>r&&(i=r,a=n&&t?i*n/t:void 0),a&&a>o&&(a=o,i=t&&n?a*t/n:void 0),{width:a,height:i}}},{key:"scaledMinWidth",get:function(){return this.scaledMinDimensions.width}},{key:"scaledMinHeight",get:function(){return this.scaledMinDimensions.height}}]),n}(y.a.Component),v2e=D2e((b2e=g2e).prototype,"imageLoaded",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),D2e(b2e.prototype,"scaledImageHeight",[v.g],Object.getOwnPropertyDescriptor(b2e.prototype,"scaledImageHeight"),b2e.prototype),D2e(b2e.prototype,"scaledImageWidth",[v.g],Object.getOwnPropertyDescriptor(b2e.prototype,"scaledImageWidth"),b2e.prototype),D2e(b2e.prototype,"scaledMinDimensions",[v.g],Object.getOwnPropertyDescriptor(b2e.prototype,"scaledMinDimensions"),b2e.prototype),D2e(b2e.prototype,"scaledMinWidth",[v.g],Object.getOwnPropertyDescriptor(b2e.prototype,"scaledMinWidth"),b2e.prototype),D2e(b2e.prototype,"scaledMinHeight",[v.g],Object.getOwnPropertyDescriptor(b2e.prototype,"scaledMinHeight"),b2e.prototype),m2e=b2e))||m2e,O2e.a.container),M2e=n(425),A2e=n.n(M2e);function L2e(e){return(L2e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function I2e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function z2e(e,t){for(var n=0;n=n||(this.scrollContainer.addEventListener("resize",this.scrollListener,!1),this.scrollContainer.addEventListener("scroll",this.scrollListener,!1))}},{key:"unbindScrollListener",value:function(){this.scrollContainer.removeEventListener("resize",this.scrollListener,!1),this.scrollContainer.removeEventListener("scroll",this.scrollListener,!1)}},{key:"render",value:function(){var e=this.props,t=e.totalPages,n=e.currentPage,r=e.loading,o=e.children,i=null;return r?i=y.a.createElement(_i,null):n===t&&(i=Nr("sulu_admin.reached_end_of_list")),y.a.createElement("section",{ref:this.setRef},y.a.createElement("div",null,o),y.a.createElement("div",{className:A2e.a.indicator},i))}}])&&z2e(t.prototype,n),r&&z2e(t,r),i}(y.a.PureComponent);V2e.defaultProps={loading:!1};var W2e=V2e,U2e=n(426),q2e=n.n(U2e),K2e=n(427),$2e=n.n(K2e),G2e=n(428),Z2e=n.n(G2e);function J2e(e){return(J2e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Q2e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function X2e(e,t){for(var n=0;n0&&this.masonry.remove(o),u.length>0&&this.masonry.appended(u),a.length>0&&this.masonry.prepended(a),this.layoutedChildNodes=t,(o.length>0||u.length>0||a.length>0)&&this.masonry.reloadItems(),this.masonry.layout()}},{key:"handleImagesLoading",value:function(){var e=this;q2e()(this.layoutedChildNodes).once("always",(function(){e.masonry&&e.masonry.layout()}))}},{key:"render",value:function(){var e=this.props.children,t=this.cloneItems(e);return y.a.createElement("div",{className:Z2e.a.masonry,ref:this.setMasonryRef},t)}}])&&X2e(t.prototype,n),r&&X2e(t,r),i}(y.a.PureComponent),a3e=n(133),u3e=n.n(a3e);function l3e(e){return(l3e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s3e(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c3e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f3e(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1,disabled:!0})}}])&&g6e(t.prototype,n),r&&g6e(t,r),e}();zj.add("category_keywords_multiple_usage",new w6e);var _6e=n(134),O6e=n.n(_6e);function S6e(e){return(S6e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function k6e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function P6e(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0?no.getList("contacts",{ids:o.join(","),limit:void 0,page:1}):Promise.resolve({_embedded:{contacts:[]}}),a=r.length>0?no.getList("accounts",{ids:r.join(","),limit:void 0,page:1}):Promise.resolve({_embedded:{accounts:[]}});Promise.all([i,a]).then(Object(v.d)((function(r){var o=m7e(r,2),i=o[0],a=o[1],u=i._embedded.contacts,l=a._embedded.accounts;n.items=t.reduce((function(t,n){if(n.startsWith(e.contactPrefix)){var r=u.find((function(t){return t.id==n.substring(e.contactPrefix.length)}));r&&t.push(h7e(h7e({},r),{},{id:e.contactPrefix+r.id}))}if(n.startsWith(e.accountPrefix)){var o=l.find((function(t){return t.id==n.substring(e.accountPrefix.length)}));o&&t.push(h7e(h7e({},o),{},{id:e.accountPrefix+o.id}))}return t}),[]),n.setLoading(!1)})))}},{key:"remove",value:function(e){this.items=this.items.filter((function(t){return t.id!==e}))}},{key:"move",value:function(e,t){this.items=Si()(this.items,e,t)}},{key:"setLoading",value:function(e){this.loading=e}},{key:"contactItems",get:function(){return this.items.filter((function(t){return t.id.startsWith(e.contactPrefix)})).map((function(t){return h7e(h7e({},t),{},{id:parseInt(t.id.substring(e.contactPrefix.length))})}))}},{key:"accountItems",get:function(){return this.items.filter((function(t){return t.id.startsWith(e.accountPrefix)})).map((function(t){return h7e(h7e({},t),{},{id:parseInt(t.id.substring(e.contactPrefix.length))})}))}}])&&g7e(t.prototype,n),r&&g7e(t,r),e}(),c7e.contactPrefix="c",c7e.accountPrefix="a",l7e=w7e((u7e=f7e).prototype,"items",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),s7e=w7e(u7e.prototype,"loading",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),w7e(u7e.prototype,"contactItems",[v.g],Object.getOwnPropertyDescriptor(u7e.prototype,"contactItems"),u7e.prototype),w7e(u7e.prototype,"accountItems",[v.g],Object.getOwnPropertyDescriptor(u7e.prototype,"accountItems"),u7e.prototype),w7e(u7e.prototype,"remove",[v.d],Object.getOwnPropertyDescriptor(u7e.prototype,"remove"),u7e.prototype),w7e(u7e.prototype,"move",[v.d],Object.getOwnPropertyDescriptor(u7e.prototype,"move"),u7e.prototype),w7e(u7e.prototype,"setLoading",[v.d],Object.getOwnPropertyDescriptor(u7e.prototype,"setLoading"),u7e.prototype),u7e),D7e=n(432),R7e=n.n(D7e);function M7e(e){return(M7e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function A7e(e){return function(e){if(Array.isArray(e))return L7e(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return L7e(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return L7e(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function L7e(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0?r:e.name,writable:!1,configurable:!1,enumerable:!0})}return n}var Uet=[".DS_Store","Thumbs.db"];function qet(e){return!!e.dataTransfer}function Ket(e){return(function(e){return null!==e}(e.target)&&e.target.files?Zet(e.target.files):[]).map((function(e){return Wet(e)}))}function $et(e,t){return Xn(this,void 0,void 0,(function(){var n;return er(this,(function(r){switch(r.label){case 0:return e.items?(n=Zet(e.items).filter((function(e){return"file"===e.kind})),"drop"!==t?[2,n]:[4,Promise.all(n.map(Jet))]):[3,2];case 1:return[2,Get(Qet(r.sent()))];case 2:return[2,Get(Zet(e.files).map((function(e){return Wet(e)})))]}}))}))}function Get(e){return e.filter((function(e){return-1===Uet.indexOf(e.name)}))}function Zet(e){for(var t=[],n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);nn)return[!1,ltt(n)];if(e.sizen)return[!1,ltt(n)]}return[!0,null]}function dtt(e){return null!=e}function htt(e){var t=e.files,n=e.accept,r=e.minSize,o=e.maxSize,i=e.multiple,a=e.maxFiles;return!(!i&&t.length>1||i&&a>=1&&t.length>a)&&t.every((function(e){var t=itt(ftt(e,n),1)[0],i=itt(ptt(e,r,o),1)[0];return t&&i}))}function ytt(e){return"function"==typeof e.isPropagationStopped?e.isPropagationStopped():void 0!==e.cancelBubble&&e.cancelBubble}function mtt(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 btt(e){e.preventDefault()}function vtt(e){return-1!==e.indexOf("MSIE")||-1!==e.indexOf("Trident/")}function gtt(e){return-1!==e.indexOf("Edge/")}function wtt(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.navigator.userAgent;return vtt(e)||gtt(e)}function _tt(){for(var e=arguments.length,t=new Array(e),n=0;n1?n-1:0),o=1;oe.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var Ttt=Object(h.forwardRef)((function(e,t){var n=e.children,r=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Ett(Ett({},Dtt),e),n=t.accept,r=t.disabled,o=t.getFilesFromEvent,i=t.maxSize,a=t.minSize,u=t.multiple,l=t.maxFiles,s=t.onDragEnter,c=t.onDragLeave,f=t.onDragOver,p=t.onDrop,d=t.onDropAccepted,y=t.onDropRejected,m=t.onFileDialogCancel,b=t.preventDropOnDocument,v=t.noClick,g=t.noKeyboard,w=t.noDrag,_=t.noDragEventsBubbling,O=Object(h.useRef)(null),S=Object(h.useRef)(null),k=Object(h.useReducer)(Ytt,Ftt),P=Stt(k,2),j=P[0],E=P[1],C=j.isFocused,x=j.isFileDialogActive,T=j.draggedFiles,D=Object(h.useCallback)((function(){S.current&&(E({type:"openDialog"}),S.current.value=null,S.current.click())}),[E]),R=function(){x&&setTimeout((function(){S.current&&(S.current.files.length||(E({type:"closeDialog"}),"function"==typeof m&&m()))}),300)};Object(h.useEffect)((function(){return window.addEventListener("focus",R,!1),function(){window.removeEventListener("focus",R,!1)}}),[S,x,m]);var M=Object(h.useCallback)((function(e){O.current&&O.current.isEqualNode(e.target)&&(32!==e.keyCode&&13!==e.keyCode||(e.preventDefault(),D()))}),[O,S]),A=Object(h.useCallback)((function(){E({type:"focus"})}),[]),L=Object(h.useCallback)((function(){E({type:"blur"})}),[]),I=Object(h.useCallback)((function(){v||(wtt()?setTimeout(D,0):D())}),[S,v]),z=Object(h.useRef)([]),F=function(e){O.current&&O.current.contains(e.target)||(e.preventDefault(),z.current=[])};Object(h.useEffect)((function(){return b&&(document.addEventListener("dragover",btt,!1),document.addEventListener("drop",F,!1)),function(){b&&(document.removeEventListener("dragover",btt),document.removeEventListener("drop",F))}}),[O,b]);var Y=Object(h.useCallback)((function(e){e.preventDefault(),e.persist(),q(e),z.current=[].concat(Ott(z.current),[e.target]),mtt(e)&&Promise.resolve(o(e)).then((function(t){ytt(e)&&!_||(E({draggedFiles:t,isDragActive:!0,type:"setDraggedFiles"}),s&&s(e))}))}),[o,s,_]),N=Object(h.useCallback)((function(e){if(e.preventDefault(),e.persist(),q(e),e.dataTransfer)try{e.dataTransfer.dropEffect="copy"}catch(e){}return mtt(e)&&f&&f(e),!1}),[f,_]),B=Object(h.useCallback)((function(e){e.preventDefault(),e.persist(),q(e);var t=z.current.filter((function(e){return O.current&&O.current.contains(e)})),n=t.indexOf(e.target);-1!==n&&t.splice(n,1),z.current=t,t.length>0||(E({isDragActive:!1,type:"setDraggedFiles",draggedFiles:[]}),mtt(e)&&c&&c(e))}),[O,c,_]),H=Object(h.useCallback)((function(e){e.preventDefault(),e.persist(),q(e),z.current=[],mtt(e)&&Promise.resolve(o(e)).then((function(t){if(!ytt(e)||_){var r=[],o=[];t.forEach((function(e){var t=Stt(ftt(e,n),2),u=t[0],l=t[1],s=Stt(ptt(e,a,i),2),c=s[0],f=s[1];if(u&&c)r.push(e);else{var p=[l,f].filter((function(e){return e}));o.push({file:e,errors:p})}})),(!u&&r.length>1||u&&l>=1&&r.length>l)&&(r.forEach((function(e){o.push({file:e,errors:[ctt]})})),r.splice(0)),E({acceptedFiles:r,fileRejections:o,type:"setFiles"}),p&&p(r,o,e),o.length>0&&y&&y(o,e),r.length>0&&d&&d(r,e)}})),E({type:"reset"})}),[u,n,a,i,l,o,p,d,y,_]),V=function(e){return r?null:e},W=function(e){return g?null:V(e)},U=function(e){return w?null:V(e)},q=function(e){_&&e.stopPropagation()},K=Object(h.useMemo)((function(){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.refKey,n=void 0===t?"ref":t,o=e.onKeyDown,i=e.onFocus,a=e.onBlur,u=e.onClick,l=e.onDragEnter,s=e.onDragOver,c=e.onDragLeave,f=e.onDrop,p=xtt(e,["refKey","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"]);return Ett(Ett(Ctt({onKeyDown:W(_tt(o,M)),onFocus:W(_tt(i,A)),onBlur:W(_tt(a,L)),onClick:V(_tt(u,I)),onDragEnter:U(_tt(l,Y)),onDragOver:U(_tt(s,N)),onDragLeave:U(_tt(c,B)),onDrop:U(_tt(f,H))},n,O),r||g?{}:{tabIndex:0}),p)}}),[O,M,A,L,I,Y,N,B,H,g,w,r]),$=Object(h.useCallback)((function(e){e.stopPropagation()}),[]),G=Object(h.useMemo)((function(){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.refKey,r=void 0===t?"ref":t,o=e.onChange,i=e.onClick,a=xtt(e,["refKey","onChange","onClick"]),l=Ctt({accept:n,multiple:u,type:"file",style:{display:"none"},onChange:V(_tt(o,H)),onClick:V(_tt(i,$)),autoComplete:"off",tabIndex:-1},r,S);return Ett(Ett({},l),a)}}),[S,n,u,H,r]),Z=T.length,J=Z>0&&htt({files:T,accept:n,minSize:a,maxSize:i,multiple:u,maxFiles:l}),Q=Z>0&&!J;return Ett(Ett({},j),{},{isDragAccept:J,isDragReject:Q,isFocused:C&&!r,getRootProps:K,getInputProps:G,rootRef:O,inputRef:S,open:V(D)})}(xtt(e,["children"])),o=r.open,i=xtt(r,["open"]);return Object(h.useImperativeHandle)(t,(function(){return{open:o}}),[o]),y.a.createElement(h.Fragment,null,n(Ett(Ett({},i),{},{open:o})))}));Ttt.displayName="Dropzone";var Dtt={disabled:!1,getFilesFromEvent:function(e){return Xn(this,void 0,void 0,(function(){return er(this,(function(t){return[2,qet(e)&&e.dataTransfer?$et(e.dataTransfer,e.type):Ket(e)]}))}))},maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1};Ttt.defaultProps=Dtt,Ttt.propTypes={children:ul.a.func,accept:ul.a.oneOfType([ul.a.string,ul.a.arrayOf(ul.a.string)]),multiple:ul.a.bool,preventDropOnDocument:ul.a.bool,noClick:ul.a.bool,noKeyboard:ul.a.bool,noDrag:ul.a.bool,noDragEventsBubbling:ul.a.bool,minSize:ul.a.number,maxSize:ul.a.number,maxFiles:ul.a.number,disabled:ul.a.bool,getFilesFromEvent:ul.a.func,onFileDialogCancel:ul.a.func,onDragEnter:ul.a.func,onDragLeave:ul.a.func,onDragOver:ul.a.func,onDrop:ul.a.func,onDropAccepted:ul.a.func,onDropRejected:ul.a.func};var Rtt,Mtt,Att,Ltt,Itt,ztt=Ttt,Ftt={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,draggedFiles:[],acceptedFiles:[],fileRejections:[]};function Ytt(e,t){switch(t.type){case"focus":return Ett(Ett({},e),{},{isFocused:!0});case"blur":return Ett(Ett({},e),{},{isFocused:!1});case"openDialog":return Ett(Ett({},e),{},{isFileDialogActive:!0});case"closeDialog":return Ett(Ett({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":var n=t.isDragActive,r=t.draggedFiles;return Ett(Ett({},e),{},{draggedFiles:r,isDragActive:n});case"setFiles":return Ett(Ett({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return Ett(Ett({},e),{},{isFileDialogActive:!1,isDragActive:!1,draggedFiles:[],acceptedFiles:[],fileRejections:[]});default:return e}}function Ntt(e,t,n,r){n&&Object.defineProperty(e,t,{enumerable:n.enumerable,configurable:n.configurable,writable:n.writable,value:n.initializer?n.initializer.call(r):void 0})}function Btt(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&(o.types=r.join(",")),new Kw("media","media","media_selection_overlay",{page:v.q.box(),collection:e,excludedIds:t,locale:n},o)}}]),Kot(n,[{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.mediaListStore,r=t.open;!0===e.open&&!1===r&&n.clearSelection()}},{key:"componentWillUnmount",value:function(){this.collectionStore&&this.collectionStore.destroy(),this.updateCollectionStoreDisposer&&this.updateCollectionStoreDisposer()}},{key:"updateCollectionStore",value:function(e){this.collectionStore&&this.collectionStore.destroy(),this.collectionStore=new Het(e,this.props.locale)}},{key:"render",value:function(){var e=this.props,t=e.collectionListStore,n=e.confirmLoading,r=e.mediaListStore,o=e.open,i=e.locale,a=[{title:Nr("sulu_media.reset_selection"),onClick:this.handleSelectionReset}];return y.a.createElement(Zl,{actions:a,confirmDisabled:!r.selections.length,confirmLoading:n,confirmText:Nr("sulu_admin.confirm"),onClose:this.handleClose,onConfirm:this.handleConfirm,open:o,title:Nr("sulu_media.select_media_plural")},y.a.createElement("div",{className:Vot.a.overlay},y.a.createElement(Bot,{collectionListStore:t,collectionStore:this.collectionStore,locale:i,mediaListAdapters:["media_card_selection","table"],mediaListStore:r,onCollectionNavigate:this.handleCollectionNavigate,onUploadOverlayClose:this.handleUploadOverlayClose,onUploadOverlayOpen:this.handleUploadOverlayOpen,overlayType:"dialog",uploadOverlayOpen:this.showMediaUploadOverlay})))}}]),n}(y.a.Component),Yot.defaultProps={confirmLoading:!1},Aot=Xot((Mot=Not).prototype,"collectionStore",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Lot=Xot(Mot.prototype,"showMediaUploadOverlay",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),Xot(Mot.prototype,"updateCollectionStore",[v.d],Object.getOwnPropertyDescriptor(Mot.prototype,"updateCollectionStore"),Mot.prototype),Iot=Xot(Mot.prototype,"handleCollectionNavigate",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){e.props.collectionId.set(t),e.props.collectionListStore.clear(),e.props.collectionListStore.setPage(1),e.props.mediaListStore.clear(),e.props.mediaListStore.setPage(1)}}}),zot=Xot(Mot.prototype,"handleUploadOverlayOpen",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){e.showMediaUploadOverlay=!0}}}),Fot=Xot(Mot.prototype,"handleUploadOverlayClose",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){e.showMediaUploadOverlay=!1}}}),Rot=Mot))||Rot;function oit(e){return(oit="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function iit(e,t){for(var n=0;n1)throw new Error("The SingleMediaSelectionOverlay can only handle single selection.This should not happen and is likely a bug.");t.props.onConfirm(t.mediaListStore.selections[0])};var n=Object(v.g)((function(){return t.props.excludedIds.length?t.props.excludedIds:void 0}));return t.excludedIdsDisposer=n.observe((function(){return t.mediaListStore.clear()})),t.mediaListStore=rit.createMediaListStore(t.collectionId,n,t.props.locale,t.props.types),t.collectionListStore=rit.createCollectionListStore(t.collectionId,t.props.locale),t.mediaSelectionDisposer=Object(v.e)((function(){var e=t.mediaListStore.selections;if(!(e.length<=1)){var n=e[e.length-1];n&&(t.mediaListStore.clearSelection(),t.mediaListStore.select(n))}})),t}return t=i,(n=[{key:"componentWillUnmount",value:function(){this.mediaListStore.destroy(),this.collectionListStore.destroy(),this.excludedIdsDisposer(),this.mediaSelectionDisposer()}},{key:"render",value:function(){var e=this.props,t=e.onClose,n=e.open,r=e.locale;return y.a.createElement(rit,{collectionId:this.collectionId,collectionListStore:this.collectionListStore,locale:r,mediaListStore:this.mediaListStore,onClose:t,onConfirm:this.handleConfirm,open:n})}}])&&yit(t.prototype,n),r&&yit(t,r),i}(y.a.Component),fit.defaultProps={excludedIds:[],types:[]},cit=pit))||cit;function jit(e){return(jit="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Eit(e,t,n,r){n&&Object.defineProperty(e,t,{enumerable:n.enumerable,configurable:n.configurable,writable:n.writable,value:n.initializer?n.initializer.call(r):void 0})}function Cit(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xit(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&function(e,t){mut(t).forEach((function(t){nut.DomUtil.removeClass(e,t)}))}(e,t),null!=n&&n.length>0&&function(e,t){mut(t).forEach((function(t){nut.DomUtil.addClass(e,t)}))}(e,n))};function vut(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r=0||(o[n]=e[n]);return o}(e,["viewport"]);return t&&(t.center&&(n.center=t.center),"number"==typeof t.zoom&&(n.zoom=t.zoom)),new nut.Map(this.container,n)},n.updateLeafletElement=function(e,t){this._updating=!0;var n=t.bounds,r=t.boundsOptions,o=t.boxZoom,i=t.center,a=t.className,u=t.doubleClickZoom,l=t.dragging,s=t.keyboard,c=t.maxBounds,f=t.scrollWheelZoom,p=t.tap,d=t.touchZoom,h=t.useFlyTo,y=t.viewport,m=t.zoom;if(but(this.container,e.className,a),y&&y!==e.viewport){var b=y.center?y.center:i,v=null==y.zoom?m:y.zoom;!0===h?this.leafletElement.flyTo(b,v,this.getZoomPanOptions(t)):this.leafletElement.setView(b,v,this.getZoomPanOptions(t))}else i&&this.shouldUpdateCenter(i,e.center)?!0===h?this.leafletElement.flyTo(i,m,this.getZoomPanOptions(t)):this.leafletElement.setView(i,m,this.getZoomPanOptions(t)):"number"==typeof m&&m!==e.zoom&&(null==e.zoom?this.leafletElement.setView(i,m,this.getZoomPanOptions(t)):this.leafletElement.setZoom(m,this.getZoomPanOptions(t)));c&&this.shouldUpdateBounds(c,e.maxBounds)&&this.leafletElement.setMaxBounds(c),n&&(this.shouldUpdateBounds(n,e.bounds)||r!==e.boundsOptions)&&(!0===h?this.leafletElement.flyToBounds(n,this.getFitBoundsOptions(t)):this.leafletElement.fitBounds(n,this.getFitBoundsOptions(t))),o!==e.boxZoom&&(!0===o?this.leafletElement.boxZoom.enable():this.leafletElement.boxZoom.disable()),u!==e.doubleClickZoom&&(!0===u||"string"==typeof u?(this.leafletElement.options.doubleClickZoom=u,this.leafletElement.doubleClickZoom.enable()):this.leafletElement.doubleClickZoom.disable()),l!==e.dragging&&(!0===l?this.leafletElement.dragging.enable():this.leafletElement.dragging.disable()),s!==e.keyboard&&(!0===s?this.leafletElement.keyboard.enable():this.leafletElement.keyboard.disable()),f!==e.scrollWheelZoom&&(!0===f||"string"==typeof f?(this.leafletElement.options.scrollWheelZoom=f,this.leafletElement.scrollWheelZoom.enable()):this.leafletElement.scrollWheelZoom.disable()),p!==e.tap&&(!0===p?this.leafletElement.tap.enable():this.leafletElement.tap.disable()),d!==e.touchZoom&&(!0===d||"string"==typeof d?(this.leafletElement.options.touchZoom=d,this.leafletElement.touchZoom.enable()):this.leafletElement.touchZoom.disable()),this._updating=!1},n.getZoomPanOptions=function(e){return{animate:e.animate,duration:e.duration,easeLinearity:e.easeLinearity,noMoveStart:e.noMoveStart}},n.getFitBoundsOptions=function(e){return r({},this.getZoomPanOptions(e),e.boundsOptions)},n.componentDidMount=function(){var t=vut.apply(void 0,[this.props].concat(gut));this.leafletElement=this.createLeafletElement(t),this.leafletElement.on("move",this.onViewportChange),this.leafletElement.on("moveend",this.onViewportChanged),null!=t.bounds&&this.leafletElement.fitBounds(t.bounds,this.getFitBoundsOptions(t)),this.contextValue={layerContainer:this.leafletElement,map:this.leafletElement},e.prototype.componentDidMount.call(this),this.forceUpdate()},n.componentDidUpdate=function(t){!1===this._ready&&(this._ready=!0,this.props.whenReady&&this.leafletElement.whenReady(this.props.whenReady)),e.prototype.componentDidUpdate.call(this,t),this.updateLeafletElement(t,this.props)},n.componentWillUnmount=function(){e.prototype.componentWillUnmount.call(this),this.leafletElement.off("move",this.onViewportChange),this.leafletElement.off("moveend",this.onViewportChanged),!0===this.props.preferCanvas?(this.leafletElement._initEvents(!0),this.leafletElement._stop()):this.leafletElement.remove()},n.shouldUpdateCenter=function(e,t){return!t||(e=wut(e),t=wut(t),e[0]!==t[0]||e[1]!==t[1])},n.shouldUpdateBounds=function(e,t){return!t||!Object(nut.latLngBounds)(e).equals(Object(nut.latLngBounds)(t))},n.render=function(){return y.a.createElement("div",{className:this.className,id:this.props.id,ref:this.bindContainer,style:this.props.style},this.contextValue?y.a.createElement(put,{value:this.contextValue},this.props.children):null)},t}(yut),Out=function(e){function t(){return e.apply(this,arguments)||this}return uut(t,e),t.prototype.getOptions=function(e){return null!=e.pane?e:null!=e.leaflet&&null!=e.leaflet.pane?r({},e,{pane:e.leaflet.pane}):e},t}(yut),Sut=function(e){function t(t){var n;return TO(IO(n=e.call(this,t)||this),"contextValue",void 0),TO(IO(n),"leafletElement",void 0),n.leafletElement=n.createLeafletElement(t),n}uut(t,e);var n=t.prototype;return n.createLeafletElement=function(e){throw new Error("createLeafletElement() must be implemented")},n.updateLeafletElement=function(e,t){},n.componentDidMount=function(){e.prototype.componentDidMount.call(this),this.layerContainer.addLayer(this.leafletElement)},n.componentDidUpdate=function(t){if(e.prototype.componentDidUpdate.call(this,t),this.props.attribution!==t.attribution){var n=this.props.leaflet.map;null!=n&&null!=n.attributionControl&&(n.attributionControl.removeAttribution(t.attribution),n.attributionControl.addAttribution(this.props.attribution))}this.updateLeafletElement(t,this.props)},n.componentWillUnmount=function(){e.prototype.componentWillUnmount.call(this),this.layerContainer.removeLayer(this.leafletElement)},n.render=function(){var e=this.props.children;return null==e?null:null==this.contextValue?y.a.createElement(h.Fragment,null,e):y.a.createElement(put,{value:this.contextValue},e)},AO(t,[{key:"layerContainer",get:function(){return this.props.leaflet.layerContainer||this.props.leaflet.map}}]),t}(Out),kut=dut(function(e){function t(){return e.apply(this,arguments)||this}uut(t,e);var n=t.prototype;return n.createLeafletElement=function(e){return new nut.TileLayer(e.url,this.getOptions(e))},n.updateLeafletElement=function(t,n){e.prototype.updateLeafletElement.call(this,t,n),n.url!==t.url&&this.leafletElement.setUrl(n.url)},t}(function(e){function t(){return e.apply(this,arguments)||this}uut(t,e);var n=t.prototype;return n.createLeafletElement=function(e){return new nut.GridLayer(this.getOptions(e))},n.updateLeafletElement=function(e,t){var n=t.opacity,r=t.zIndex;n!==e.opacity&&this.leafletElement.setOpacity(n),r!==e.zIndex&&this.leafletElement.setZIndex(r)},n.getOptions=function(t){var n=r({},e.prototype.getOptions.call(this,t)),o=t.leaflet.map;return null!=o&&(null==n.maxZoom&&null!=o.options.maxZoom&&(n.maxZoom=o.options.maxZoom),null==n.minZoom&&null!=o.options.minZoom&&(n.minZoom=o.options.minZoom)),n},n.render=function(){return null},t}(Sut))),Put=dut(function(e){function t(){return e.apply(this,arguments)||this}uut(t,e);var n=t.prototype;return n.createLeafletElement=function(e){var t=new nut.Marker(e.position,this.getOptions(e));return this.contextValue=r({},e.leaflet,{popupContainer:t}),t},n.updateLeafletElement=function(e,t){t.position!==e.position&&this.leafletElement.setLatLng(t.position),t.icon!==e.icon&&this.leafletElement.setIcon(t.icon),t.zIndexOffset!==e.zIndexOffset&&this.leafletElement.setZIndexOffset(t.zIndexOffset),t.opacity!==e.opacity&&this.leafletElement.setOpacity(t.opacity),t.draggable!==e.draggable&&(!0===t.draggable?this.leafletElement.dragging.enable():this.leafletElement.dragging.disable())},n.render=function(){var e=this.props.children;return null==e||null==this.contextValue?null:y.a.createElement(put,{value:this.contextValue},e)},t}(Sut)),jut=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;oe.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0?{icon:Sft(u.displayOption),onClick:this.handleDisplayOptionClick,options:r.map((function(e){return{icon:Sft(e),label:kft(e),value:e}}))}:void 0;return y.a.createElement(h.Fragment,null,y.a.createElement(vV,{className:t,disabled:n,emptyText:Nr("sulu_media.select_media_singular"),id:c&&c.id,leftButton:{icon:"su-image",onClick:this.handleOverlayOpen},loading:s,onItemClick:this.handleItemClick,onRemove:c?this.handleRemove:void 0,rightButton:f,valid:a,value:c},c&&y.a.createElement("div",{className:Dft.a.mediaItem},c.thumbnails&&c.thumbnails["sulu-25x25"]?y.a.createElement("img",{alt:c.title,className:Dft.a.thumbnailImage,src:c.thumbnails["sulu-25x25"]}):y.a.createElement(Ost,{height:19,iconSize:14,mimeType:c.mimeType,width:19}),y.a.createElement("div",{className:Dft.a.mediaTitle},c.title))),y.a.createElement(Pit,{excludedIds:c?[c.id]:[],locale:o,onClose:this.handleOverlayClose,onConfirm:this.handleOverlayConfirm,open:this.overlayOpen,types:i}))}}])&&Ift(t.prototype,n),r&&Ift(t,r),i}(y.a.Component),Cft.defaultProps={disabled:!1,displayOptions:[],types:[],valid:!0,value:{displayOption:void 0,id:void 0}},Eft=Hft((jft=xft).prototype,"overlayOpen",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),Hft(jft.prototype,"openOverlay",[v.d],Object.getOwnPropertyDescriptor(jft.prototype,"openOverlay"),jft.prototype),Hft(jft.prototype,"closeOverlay",[v.d],Object.getOwnPropertyDescriptor(jft.prototype,"closeOverlay"),jft.prototype),Pft=jft))||Pft;function Wft(e){return(Wft="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Uft(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function qft(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1e6?"".concat((e/1e6).toFixed(2)," MB"):"".concat((e/1e3).toFixed(2)," KB")}}],(n=[{key:"getDownloadDropdownProps",value:function(e){var t=window.location.origin,n=e.thumbnails,r=[];return r.push({url:t+e.adminUrl,label:Nr("sulu_media.copy_masterfile_url")}),r.push({url:t+e.url,label:Nr("sulu_media.copy_masterfile_url_website")}),n&&r.push.apply(r,tpt(Object.keys(n).map((function(n){return{url:t+e.thumbnails[n],label:n}})))),{imageSizes:r,onDownload:this.handleDownload,downloadCopyText:Nr("sulu_media.copy_url"),downloadUrl:t+e.adminUrl,downloadText:Nr("sulu_media.download_masterfile")}}},{key:"render",value:function(){var e=this,t=this.props,n=t.data,r=t.icon,o=t.loading,a=t.onItemClick,u=t.onItemSelectionChange,l=t.onPageChange,s=t.page,c=t.pageCount,f=t.selections,p=t.showCoverWhenSelected;return y.a.createElement(W2e,{currentPage:s,loading:o,onPageChange:l,totalPages:c},y.a.createElement(i3e,null,n.map((function(t){var n="".concat(t.mimeType," ").concat(i.formatFileSize(t.size)),o=e.getDownloadDropdownProps(t),l=f.includes(t.id),s=t.thumbnails?t.thumbnails["sulu-240x"]:null;return y.a.createElement(mct,ept({},o,{ghostLocale:t.ghostLocale,icon:r,id:t.id,image:s,key:t.id,meta:n,mimeType:t.mimeType,onClick:a,onSelectionChange:u,selected:l,showCover:p&&l,title:t.title}))}))))}}])&&opt(t.prototype,n),r&&opt(t,r),i}(y.a.Component))||Jft;function dpt(e){return(dpt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function hpt(){return(hpt=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n1?"".concat(e," ").concat(Nr("sulu_media.media_selected_plural")):Nr("sulu_media.select_media_plural")}},{key:"render",value:function(){var e=this.props,t=e.locale,n=e.disabled,r=e.displayOptions,o=e.types,i=e.value,a=this.mediaSelectionStore,u=a.loading,l=a.items,s=u?"":this.getLabel(l.length),c=r.length>0?{icon:Sft(i.displayOption),onClick:this.handleDisplayOptionClick,options:r.map((function(e){return{icon:Sft(e),label:kft(e),value:e}}))}:void 0;return y.a.createElement(h.Fragment,null,y.a.createElement(mN,{disabled:!!n,label:s,leftButton:{icon:"su-image",onClick:this.handleOverlayOpen},loading:u,onItemClick:this.handleItemClick,onItemRemove:this.handleRemove,onItemsSorted:this.handleSorted,rightButton:c},l.map((function(e,t){return y.a.createElement(mN.Item,{id:e.id,index:t+1,key:e.id,value:e},y.a.createElement("div",{className:Npt.a.mediaItem},e.thumbnails&&e.thumbnails["sulu-25x25"]?y.a.createElement("img",{alt:e.title,className:Npt.a.thumbnailImage,src:e.thumbnails["sulu-25x25"]}):y.a.createElement(Ost,{height:25,iconSize:16,mimeType:e.mimeType,width:25}),y.a.createElement("div",{className:Npt.a.mediaTitle},y.a.createElement(ay,null,e.title))))}))),y.a.createElement(dit,{excludedIds:l.map((function(e){return e.id})),locale:t,onClose:this.handleOverlayClose,onConfirm:this.handleOverlayConfirm,open:this.overlayOpen,types:o}))}}])&&Kpt(t.prototype,n),r&&Kpt(t,r),i}(y.a.Component),Ipt.defaultProps={disabled:!1,displayOptions:[],types:[],value:{displayOption:void 0,ids:[]}},Lpt=Xpt((Apt=zpt).prototype,"overlayOpen",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),Xpt(Apt.prototype,"openMediaOverlay",[v.d],Object.getOwnPropertyDescriptor(Apt.prototype,"openMediaOverlay"),Apt.prototype),Xpt(Apt.prototype,"closeMediaOverlay",[v.d],Object.getOwnPropertyDescriptor(Apt.prototype,"closeMediaOverlay"),Apt.prototype),Mpt=Apt))||Mpt;function ndt(e){return(ndt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function rdt(e,t){for(var n=0;n0?e.availableFormats[0].key:void 0})))}},{key:"convertSelectionToFormatOptions",value:function(e){return e?{cropX:e.left,cropY:e.top,cropWidth:e.width,cropHeight:e.height}:{}}},{key:"convertFormatOptionsToSelection",value:function(e){if(e)return{left:e.cropX,top:e.cropY,width:e.cropWidth,height:e.cropHeight}}},{key:"render",value:function(){var e=this.availableFormats,t=this.mediaFormatStore,n=this.selectedFormat,r=this.props,o=r.image,i=r.open;return y.a.createElement(Zl,{confirmDisabled:this.changedFormatCroppings.size<=0,confirmLoading:this.mediaFormatStore.saving,confirmText:Nr("sulu_admin.save"),onClose:this.handleClose,onConfirm:this.handleConfirm,open:i,size:"large",title:Nr("sulu_media.define_crops")},e?y.a.createElement("div",{className:kht.a.cropOverlayContainer},y.a.createElement("div",{className:kht.a.formatSelect},y.a.createElement(em,{onChange:this.handleFormatChange,value:this.formatKey},e.map((function(e){return y.a.createElement(em.Option,{key:e.key,value:e.key},e.title+(t.getFormatOptions(e.key)?" ("+Nr("sulu_media.cropped")+")":""))})))),n&&!t.loading&&y.a.createElement(h.Fragment,null,y.a.createElement(R2e,{image:o,minHeight:n.scale.y,minWidth:n.scale.x,onChange:this.handleSelectionChange,value:this.currentSelection}),y.a.createElement("p",null,"(",Nr("sulu_media.double_click_crop_and_maximize"),")"))):y.a.createElement(_i,null))}},{key:"currentSelection",get:function(){var e=this.formatKey;if(e)return this.changedFormatCroppings.has(e)?this.changedFormatCroppings.get(e):this.convertFormatOptionsToSelection(this.mediaFormatStore.getFormatOptions(e))}},{key:"availableFormats",get:function(){return this.rawFormats?this.rawFormats.filter((function(e){return!e.internal})):[]}},{key:"selectedFormat",get:function(){var e=this;if(!this.availableFormats)throw new Error("Cannot access format as long as formats have not finished loading!");var t=this.availableFormats.find((function(t){return t.key===e.formatKey}));if(t)return t}}])&&Eht(t.prototype,n),r&&Eht(t,r),i}(y.a.Component),hht=Mht((dht=_ht).prototype,"rawFormats",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),yht=Mht(dht.prototype,"formatKey",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),mht=Mht(dht.prototype,"changedFormatCroppings",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return new Map}}),bht=Mht(dht.prototype,"dirty",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Mht(dht.prototype,"currentSelection",[v.g],Object.getOwnPropertyDescriptor(dht.prototype,"currentSelection"),dht.prototype),Mht(dht.prototype,"availableFormats",[v.g],Object.getOwnPropertyDescriptor(dht.prototype,"availableFormats"),dht.prototype),Mht(dht.prototype,"selectedFormat",[v.g],Object.getOwnPropertyDescriptor(dht.prototype,"selectedFormat"),dht.prototype),vht=Mht(dht.prototype,"handleClose",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){e.props.onClose(),e.changedFormatCroppings.clear()}}}),ght=Mht(dht.prototype,"handleFormatChange",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){e.formatKey=t}}}),wht=Mht(dht.prototype,"handleSelectionChange",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){var n=e.formatKey;if(!n)throw new Error("It is not possible to change the selection without a selected format. This should not happen and is likely a bug.");e.changedFormatCroppings.set(n,t)}}}),pht=dht))||pht,Lht=n(198),Iht=n.n(Lht);function zht(e){return(zht="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Fht(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Yht(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&y.a.createElement(Cp.Field,{colSpan:5,label:Nr("sulu_media.form_type"),required:!1,spaceAfter:1},y.a.createElement(em,{disabled:n,onChange:this.handleTypeChange,value:this.selectedHotspot.type},Object.entries(a).map((function(e){var t=hbt(e,2),n=t[0],r=t[1];return y.a.createElement(em.Option,{key:n,value:n},r)})))))),y.a.createElement("button",{className:pbt.a.removeButton,disabled:n,onClick:this.handleHotspotRemove},y.a.createElement(yn,{name:"su-trash-alt"}))),t))))}},{key:"selectedHotspot",get:function(){var e=this.props;return e.value[e.selectedIndex]}}])&&bbt(t.prototype,n),r&&bbt(t,r),i}(y.a.Component)).prototype,"selectedHotspot",[v.g],Object.getOwnPropertyDescriptor(sbt.prototype,"selectedHotspot"),sbt.prototype),lbt=sbt))||lbt,Mbt=n(104),Abt=n.n(Mbt);function Lbt(e){return(Lbt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ibt(e){return function(e){if(Array.isArray(e))return zbt(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return zbt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return zbt(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function zbt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);nr&&h[r]?h[r]:void 0,formInspector:u,index:r,onChange:e.handleHotspotFormChange,onFieldFinish:l,onSuccess:s,router:c,schema:d.form,schemaPath:f+"/types/"+n+"/form",showAllErrors:p})},e}return t=i,(n=[{key:"render",value:function(){var e=this.props,t=e.defaultType,n=e.disabled,r=e.error,o=e.formInspector,i=e.onFinish,a=e.types,u=e.value,l=o.locale?o.locale:v.q.box(zo.contentLocale);if(!t)throw new Error('The "image_map" field type needs a defaultType!');if(!a)throw new Error(dvt);var s=Object.keys(a).reduce((function(e,t){return e[t]=a[t].title,e}),{});return y.a.createElement(Jbt,{defaultFormType:t,disabled:!!n,locale:l,onChange:this.handleChange,onFinish:i,renderHotspotForm:this.renderHotspotForm,types:s,valid:!r,value:u||void 0})}}])&&lvt(t.prototype,n),r&&lvt(t,r),i}(y.a.Component),yvt=n(453),mvt=n.n(yvt);function bvt(e,t){for(var n=0;n1})})))}},{key:"visibleWebspaces",get:function(){var e=this.props.webspace;return(e?[zat.getWebspace(e)]:zat.grantedWebspaces).filter((function(e){return e.segments.length>0}))}}])&&Owt(t.prototype,n),r&&Owt(t,r),i}(y.a.Component)).prototype,"visibleWebspaces",[v.g],Object.getOwnPropertyDescriptor(ywt.prototype,"visibleWebspaces"),ywt.prototype),ywt);function Cwt(e){return(Cwt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function xwt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Twt(e,t){for(var n=0;n0?s:void 0,value:null===i?void 0:i})}},{key:"locale",get:function(){var e=this.props.formInspector;return e.locale?e.locale:v.q.box(zo.contentLocale)}}])&&Hwt(t.prototype,n),r&&Hwt(t,r),i}(y.a.Component)).prototype,"locale",[v.g],Object.getOwnPropertyDescriptor(Iwt.prototype,"locale"),Iwt.prototype),Lwt=Iwt))||Lwt;function Zwt(e){return(Zwt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Jwt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Qwt(e,t){for(var n=0;n0&&a.map((function(e){if("string"!=typeof e)throw new Error('All entries in the "contentLocales" array must be strings!');return y.a.createElement(em.Option,{key:e,value:e},e)})))}}])&&a_t(t.prototype,n),r&&a_t(t,r),i}(y.a.Component);function __t(e){return(__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})(e)}function O_t(e,t,n,r){n&&Object.defineProperty(e,t,{enumerable:n.enumerable,configurable:n.configurable,writable:n.writable,value:n.initializer?n.initializer.call(r):void 0})}function S_t(e,t){for(var n=0;n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function fOt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&y.a.createElement($7.Select,{icon:"su-focus",onChange:this.handleSegmentChange,options:this.segments.map((function(e){return{label:e.title,value:e.key}})),value:this.previewStore&&this.previewStore.segment}),y.a.createElement($7.Button,{icon:"su-sync",onClick:this.handleRefreshClick},Nr("sulu_preview.reload")),y.a.createElement($7.Button,{icon:"su-link",onClick:this.handlePreviewWindowClick},Nr("sulu_preview.open_in_window"))))))}}]),n}(y.a.Component),USt.debounceDelay=250,USt.mode="auto",USt.audienceTargeting=!1,DSt=akt((TSt=qSt).prototype,"iframeRef",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),RSt=akt(TSt.prototype,"started",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),MSt=akt(TSt.prototype,"selectedDeviceOption",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return this.availableDeviceOptions[0].value}}),ASt=akt(TSt.prototype,"targetGroupsStore",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),LSt=akt(TSt.prototype,"previewStore",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ISt=akt(TSt.prototype,"previewWindow",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),zSt=akt(TSt.prototype,"webspaceOptions",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),FSt=akt(TSt.prototype,"reloadCounter",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),akt(TSt.prototype,"webspaceKey",[v.g],Object.getOwnPropertyDescriptor(TSt.prototype,"webspaceKey"),TSt.prototype),akt(TSt.prototype,"segments",[v.g],Object.getOwnPropertyDescriptor(TSt.prototype,"segments"),TSt.prototype),YSt=akt(TSt.prototype,"setStarted",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){e.started=t}}}),NSt=akt(TSt.prototype,"setIframe",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){e.iframeRef=t}}}),BSt=akt(TSt.prototype,"handleDeviceSelectChange",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){e.selectedDeviceOption=t}}}),HSt=akt(TSt.prototype,"handleWebspaceChange",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){e.previewStore.setWebspace(t)}}}),VSt=akt(TSt.prototype,"handleRefreshClick",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){++e.reloadCounter}}}),WSt=akt(TSt.prototype,"handlePreviewWindowClick",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){e.previewWindow=window.open(e.previewStore.renderRoute),e.previewWindow.addEventListener("beforeunload",Object(v.d)((function(){e.previewWindow=void 0})))}}}),xSt=TSt))||xSt;function pkt(e){return(pkt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function dkt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function hkt(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{path:null},r=t.props.onFinish,o=e&&e.toString()||null,i=n&&n.url||null;t.handleChange(hkt(hkt({},t.props.value),{},{page:{uuid:o,path:i}})),r()},t.handleSuffixChange=function(e){t.handleChange(hkt(hkt({},t.props.value),{},{suffix:e}))},t.handleChange=function(e){(0,t.props.onChange)(e)};var n=e.fieldTypeOptions.modeResolver;if(!n)throw new Error('The "modeResolver" must be a function returning a promise with the desired mode');return n(e).then(Object(v.d)((function(e){return t.mode=e}))),t}return t=i,(n=[{key:"render",value:function(){if(!this.mode)return null;var e=this.props,t=e.dataPath,n=e.defaultType,r=e.disabled,o=e.fieldTypeOptions,i=e.formInspector,a=e.onFinish,u=e.onSuccess,l=e.router,s=e.schemaOptions,c=e.schemaPath,f=e.types;return y.a.createElement(h.Fragment,null,y.a.createElement(Xs,null,y.a.createElement(Xs.Item,{colSpan:5},y.a.createElement(GV,{adapter:"column_list",disabled:!!r,displayProperties:["url"],emptyText:Nr("sulu_page.no_page_selected"),icon:"su-document",listKey:"pages",locale:this.locale,onChange:this.handlePageChange,overlayTitle:Nr("sulu_page.single_selection_overlay_title"),resourceKey:"pages",value:this.pageValue})),y.a.createElement(Xs.Item,{colSpan:7},y.a.createElement(M1,{dataPath:t,defaultType:n,disabled:r,error:void 0,fieldTypeOptions:hkt({historyResourceKey:"routes",options:{history:!0}},o),formInspector:i,label:void 0,maxOccurs:1,minOccurs:1,onChange:this.handleSuffixChange,onFinish:a,onSuccess:u,router:l,schemaOptions:s,schemaPath:c,showAllErrors:!1,types:f,value:this.suffixValue}))))}},{key:"locale",get:function(){var e=this.props.formInspector;return e.locale?e.locale:v.q.box(zo.contentLocale)}},{key:"pageValue",get:function(){var e=this.props.value;return e&&e.page&&e.page.uuid?e.page.uuid:null}},{key:"suffixValue",get:function(){var e=this.props.value;return e&&e.suffix?e.suffix:null}}])&&mkt(t.prototype,n),r&&mkt(t,r),i}(h.Component),skt=function(e,t,n,r,o){var i={};return Object.keys(r).forEach((function(e){i[e]=r[e]})),i.enumerable=!!i.enumerable,i.configurable=!!i.configurable,("value"in i||i.initializer)&&(i.writable=!0),i=n.slice().reverse().reduce((function(n,r){return r(e,t,n)||n}),i),o&&void 0!==i.initializer&&(i.value=i.initializer?i.initializer.call(o):void 0,i.initializer=void 0),void 0===i.initializer&&(Object.defineProperty(e,t,i),i=null),i}((lkt=ckt).prototype,"mode",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ukt=lkt))||ukt;po.addUpdateConfigHook("sulu_admin",(function(){var e=qr.getListUrl("routes",{action:"generate"});Dp.add("route",M1,{historyResourceKey:"routes",modeResolver:function(){return Promise.resolve("full")},generationUrl:e,options:{history:!0}}),Dp.add("page_tree_route",Okt,{modeResolver:function(){return Promise.resolve("leaf")}})}));var Skt,kkt,Pkt,jkt,Ekt,Ckt=n(464),xkt=n.n(Ckt);function Tkt(e,t,n,r){n&&Object.defineProperty(e,t,{enumerable:n.enumerable,configurable:n.configurable,writable:n.writable,value:n.initializer?n.initializer.call(r):void 0})}function Dkt(e,t){for(var n=0;n0&&Mkt.result.map((function(n,r){return y.a.createElement(OPt,{description:n.document.description,icon:t[n.document.index].icon,image:n.document.imageUrl,index:r,key:n.document.index+"_"+n.document.id+"_"+n.document.locale,locale:n.document.locale,onClick:e.handleResultClick,resource:t[n.document.index]?t[n.document.index].name:"",title:n.document.title})}))):y.a.createElement(_i,null)}}])&&CPt(t.prototype,n),r&&CPt(t,r),i}(y.a.Component),mPt=APt((yPt=_Pt).prototype,"query",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){}}),bPt=APt(yPt.prototype,"indexes",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){}}),vPt=APt(yPt.prototype,"indexName",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){}}),APt(yPt.prototype,"componentDidMount",[v.d],Object.getOwnPropertyDescriptor(yPt.prototype,"componentDidMount"),yPt.prototype),gPt=APt(yPt.prototype,"handleIndexChange",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){e.indexName=t}}}),wPt=APt(yPt.prototype,"handleQueryChange",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){e.query=t}}}),hPt=yPt))||hPt;function IPt(e){return(IPt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function zPt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function FPt(e,t){for(var n=0;n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function njt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function vjt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function fEt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:[],o=[],i=cEt(e.props.value);try{for(i.s();!(n=i.n()).done;){var a=n.value;t.includes(a.role.id)&&o.push(a)}}catch(e){i.e(e)}finally{i.f()}var u,l=r.filter((function(t){return!e.selectedRoles.includes(t.id)})),s=cEt(l);try{for(s.s();!(u=s.n()).done;){var c=u.value;o.push({locales:[],role:c})}}catch(e){s.e(e)}finally{s.f()}e.props.onChange(o)},e.handleRoleAssignmentChange=function(t){var n,r=[],o=cEt(e.props.value);try{for(o.s();!(n=o.n()).done;){var i=n.value;i.role.id!==t.role.id?r.push(i):r.push(t)}}catch(e){o.e(e)}finally{o.f()}e.props.onChange(r)},e}return t=i,(n=[{key:"render",value:function(){var e=this,t=this.props,n=t.disabled,r=t.value;return y.a.createElement(Xs,null,y.a.createElement(Xs.Item,{colSpan:6},y.a.createElement(SJe,{disabled:n,displayProperty:"name",onChange:this.handleRoleChange,requestParameters:{sortBy:"name"},resourceKey:"roles",values:this.selectedRoles})),this.selectedRoles.length>0&&y.a.createElement(Xs.Item,{colSpan:12},y.a.createElement("table",{className:lEt.a.roleAssignments},y.a.createElement("tbody",null,r.map((function(t,r){return y.a.createElement(aEt,{disabled:n,key:r,localizations:xo.localizations,onChange:e.handleRoleAssignmentChange,value:t})}))))))}},{key:"selectedRoles",get:function(){var e,t=[],n=cEt(this.props.value);try{for(n.s();!(e=n.n()).done;){var r=e.value;t.push(r.role.id)}}catch(e){n.e(e)}finally{n.f()}return t.sort()}}])&&dEt(t.prototype,n),r&&dEt(t,r),i}(y.a.Component),oEt.defaultProps={disabled:!1},function(e,t,n,r,o){var i={};Object.keys(r).forEach((function(e){i[e]=r[e]})),i.enumerable=!!i.enumerable,i.configurable=!!i.configurable,("value"in i||i.initializer)&&(i.writable=!0),i=n.slice().reverse().reduce((function(n,r){return r(e,t,n)||n}),i),o&&void 0!==i.initializer&&(i.value=i.initializer?i.initializer.call(o):void 0,i.initializer=void 0),void 0===i.initializer&&(Object.defineProperty(e,t,i),i=null)}((rEt=iEt).prototype,"selectedRoles",[v.g],Object.getOwnPropertyDescriptor(rEt.prototype,"selectedRoles"),rEt.prototype),nEt=rEt))||nEt;function gEt(e){return(gEt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function wEt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _Et(e,t){for(var n=0;n0}}])&&FEt(t.prototype,n),r&&FEt(t,r),i}(y.a.Component),TEt.webspacePlaceholder="#webspace#",CEt=WEt((EEt=DEt).prototype,"active",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),WEt(EEt.prototype,"componentDidMount",[v.d],Object.getOwnPropertyDescriptor(EEt.prototype,"componentDidMount"),EEt.prototype),xEt=WEt(EEt.prototype,"handleActiveChange",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){if(e.active=t,!e.active){var n=e.props;(0,n.onChange)({},n.system)}}}}),WEt(EEt.prototype,"defaultValue",[v.g],Object.getOwnPropertyDescriptor(EEt.prototype,"defaultValue"),EEt.prototype),WEt(EEt.prototype,"hasValues",[v.g],Object.getOwnPropertyDescriptor(EEt.prototype,"hasValues"),EEt.prototype),jEt=EEt))||jEt;function JEt(e){return(JEt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function QEt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function XEt(e){for(var t=1;t0?r:e.name,writable:!1,configurable:!1,enumerable:!0})}return n}var i0e=[".DS_Store","Thumbs.db"];function a0e(e){return!!e.dataTransfer}function u0e(e){return(function(e){return null!==e}(e.target)&&e.target.files?c0e(e.target.files):[]).map((function(e){return o0e(e)}))}function l0e(e,t){return Xn(this,void 0,void 0,(function(){var n;return er(this,(function(r){switch(r.label){case 0:return e.items?(n=c0e(e.items).filter((function(e){return"file"===e.kind})),"drop"!==t?[2,n]:[4,Promise.all(n.map(f0e))]):[3,2];case 1:return[2,s0e(p0e(r.sent()))];case 2:return[2,s0e(c0e(e.files).map((function(e){return o0e(e)})))]}}))}))}function s0e(e){return e.filter((function(e){return-1===i0e.indexOf(e.name)}))}function c0e(e){for(var t=[],n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);nn)return[!1,O0e(n)];if(e.sizen)return[!1,O0e(n)]}return[!0,null]}function E0e(e){return null!=e}function C0e(e){var t=e.files,n=e.accept,r=e.minSize,o=e.maxSize,i=e.multiple,a=e.maxFiles;return!(!i&&t.length>1||i&&a>=1&&t.length>a)&&t.every((function(e){var t=g0e(P0e(e,n),1)[0],i=g0e(j0e(e,r,o),1)[0];return t&&i}))}function x0e(e){return"function"==typeof e.isPropagationStopped?e.isPropagationStopped():void 0!==e.cancelBubble&&e.cancelBubble}function T0e(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 D0e(e){e.preventDefault()}function R0e(e){return-1!==e.indexOf("MSIE")||-1!==e.indexOf("Trident/")}function M0e(e){return-1!==e.indexOf("Edge/")}function A0e(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.navigator.userAgent;return R0e(e)||M0e(e)}function L0e(){for(var e=arguments.length,t=new Array(e),n=0;n1?n-1:0),o=1;oe.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var W0e=Object(h.forwardRef)((function(e,t){var n=e.children,r=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=B0e(B0e({},U0e),e),n=t.accept,r=t.disabled,o=t.getFilesFromEvent,i=t.maxSize,a=t.minSize,u=t.multiple,l=t.maxFiles,s=t.onDragEnter,c=t.onDragLeave,f=t.onDragOver,p=t.onDrop,d=t.onDropAccepted,y=t.onDropRejected,m=t.onFileDialogCancel,b=t.preventDropOnDocument,v=t.noClick,g=t.noKeyboard,w=t.noDrag,_=t.noDragEventsBubbling,O=Object(h.useRef)(null),S=Object(h.useRef)(null),k=Object(h.useReducer)($0e,K0e),P=z0e(k,2),j=P[0],E=P[1],C=j.isFocused,x=j.isFileDialogActive,T=j.draggedFiles,D=Object(h.useCallback)((function(){S.current&&(E({type:"openDialog"}),S.current.value=null,S.current.click())}),[E]),R=function(){x&&setTimeout((function(){S.current&&(S.current.files.length||(E({type:"closeDialog"}),"function"==typeof m&&m()))}),300)};Object(h.useEffect)((function(){return window.addEventListener("focus",R,!1),function(){window.removeEventListener("focus",R,!1)}}),[S,x,m]);var M=Object(h.useCallback)((function(e){O.current&&O.current.isEqualNode(e.target)&&(32!==e.keyCode&&13!==e.keyCode||(e.preventDefault(),D()))}),[O,S]),A=Object(h.useCallback)((function(){E({type:"focus"})}),[]),L=Object(h.useCallback)((function(){E({type:"blur"})}),[]),I=Object(h.useCallback)((function(){v||(A0e()?setTimeout(D,0):D())}),[S,v]),z=Object(h.useRef)([]),F=function(e){O.current&&O.current.contains(e.target)||(e.preventDefault(),z.current=[])};Object(h.useEffect)((function(){return b&&(document.addEventListener("dragover",D0e,!1),document.addEventListener("drop",F,!1)),function(){b&&(document.removeEventListener("dragover",D0e),document.removeEventListener("drop",F))}}),[O,b]);var Y=Object(h.useCallback)((function(e){e.preventDefault(),e.persist(),q(e),z.current=[].concat(I0e(z.current),[e.target]),T0e(e)&&Promise.resolve(o(e)).then((function(t){x0e(e)&&!_||(E({draggedFiles:t,isDragActive:!0,type:"setDraggedFiles"}),s&&s(e))}))}),[o,s,_]),N=Object(h.useCallback)((function(e){if(e.preventDefault(),e.persist(),q(e),e.dataTransfer)try{e.dataTransfer.dropEffect="copy"}catch(e){}return T0e(e)&&f&&f(e),!1}),[f,_]),B=Object(h.useCallback)((function(e){e.preventDefault(),e.persist(),q(e);var t=z.current.filter((function(e){return O.current&&O.current.contains(e)})),n=t.indexOf(e.target);-1!==n&&t.splice(n,1),z.current=t,t.length>0||(E({isDragActive:!1,type:"setDraggedFiles",draggedFiles:[]}),T0e(e)&&c&&c(e))}),[O,c,_]),H=Object(h.useCallback)((function(e){e.preventDefault(),e.persist(),q(e),z.current=[],T0e(e)&&Promise.resolve(o(e)).then((function(t){if(!x0e(e)||_){var r=[],o=[];t.forEach((function(e){var t=z0e(P0e(e,n),2),u=t[0],l=t[1],s=z0e(j0e(e,a,i),2),c=s[0],f=s[1];if(u&&c)r.push(e);else{var p=[l,f].filter((function(e){return e}));o.push({file:e,errors:p})}})),(!u&&r.length>1||u&&l>=1&&r.length>l)&&(r.forEach((function(e){o.push({file:e,errors:[k0e]})})),r.splice(0)),E({acceptedFiles:r,fileRejections:o,type:"setFiles"}),p&&p(r,o,e),o.length>0&&y&&y(o,e),r.length>0&&d&&d(r,e)}})),E({type:"reset"})}),[u,n,a,i,l,o,p,d,y,_]),V=function(e){return r?null:e},W=function(e){return g?null:V(e)},U=function(e){return w?null:V(e)},q=function(e){_&&e.stopPropagation()},K=Object(h.useMemo)((function(){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.refKey,n=void 0===t?"ref":t,o=e.onKeyDown,i=e.onFocus,a=e.onBlur,u=e.onClick,l=e.onDragEnter,s=e.onDragOver,c=e.onDragLeave,f=e.onDrop,p=V0e(e,["refKey","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"]);return B0e(B0e(H0e({onKeyDown:W(L0e(o,M)),onFocus:W(L0e(i,A)),onBlur:W(L0e(a,L)),onClick:V(L0e(u,I)),onDragEnter:U(L0e(l,Y)),onDragOver:U(L0e(s,N)),onDragLeave:U(L0e(c,B)),onDrop:U(L0e(f,H))},n,O),r||g?{}:{tabIndex:0}),p)}}),[O,M,A,L,I,Y,N,B,H,g,w,r]),$=Object(h.useCallback)((function(e){e.stopPropagation()}),[]),G=Object(h.useMemo)((function(){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.refKey,r=void 0===t?"ref":t,o=e.onChange,i=e.onClick,a=V0e(e,["refKey","onChange","onClick"]),l=H0e({accept:n,multiple:u,type:"file",style:{display:"none"},onChange:V(L0e(o,H)),onClick:V(L0e(i,$)),autoComplete:"off",tabIndex:-1},r,S);return B0e(B0e({},l),a)}}),[S,n,u,H,r]),Z=T.length,J=Z>0&&C0e({files:T,accept:n,minSize:a,maxSize:i,multiple:u,maxFiles:l}),Q=Z>0&&!J;return B0e(B0e({},j),{},{isDragAccept:J,isDragReject:Q,isFocused:C&&!r,getRootProps:K,getInputProps:G,rootRef:O,inputRef:S,open:V(D)})}(V0e(e,["children"])),o=r.open,i=V0e(r,["open"]);return Object(h.useImperativeHandle)(t,(function(){return{open:o}}),[o]),y.a.createElement(h.Fragment,null,n(B0e(B0e({},i),{},{open:o})))}));W0e.displayName="Dropzone";var U0e={disabled:!1,getFilesFromEvent:function(e){return Xn(this,void 0,void 0,(function(){return er(this,(function(t){return[2,a0e(e)&&e.dataTransfer?l0e(e.dataTransfer,e.type):u0e(e)]}))}))},maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1};W0e.defaultProps=U0e,W0e.propTypes={children:ul.a.func,accept:ul.a.oneOfType([ul.a.string,ul.a.arrayOf(ul.a.string)]),multiple:ul.a.bool,preventDropOnDocument:ul.a.bool,noClick:ul.a.bool,noKeyboard:ul.a.bool,noDrag:ul.a.bool,noDragEventsBubbling:ul.a.bool,minSize:ul.a.number,maxSize:ul.a.number,maxFiles:ul.a.number,disabled:ul.a.bool,getFilesFromEvent:ul.a.func,onFileDialogCancel:ul.a.func,onDragEnter:ul.a.func,onDragLeave:ul.a.func,onDragOver:ul.a.func,onDrop:ul.a.func,onDropAccepted:ul.a.func,onDropRejected:ul.a.func};var q0e=W0e,K0e={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,draggedFiles:[],acceptedFiles:[],fileRejections:[]};function $0e(e,t){switch(t.type){case"focus":return B0e(B0e({},e),{},{isFocused:!0});case"blur":return B0e(B0e({},e),{},{isFocused:!1});case"openDialog":return B0e(B0e({},e),{},{isFileDialogActive:!0});case"closeDialog":return B0e(B0e({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":var n=t.isDragActive,r=t.draggedFiles;return B0e(B0e({},e),{},{draggedFiles:r,isDragActive:n});case"setFiles":return B0e(B0e({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return B0e(B0e({},e),{},{isFileDialogActive:!1,isDragActive:!1,draggedFiles:[],acceptedFiles:[],fileRejections:[]});default:return e}}function G0e(e){return(G0e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Z0e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function J0e(e,t){for(var n=0;nthis.containerWidth?n=(t=this.containerWidth)*(this.minHeight/this.minWidth):t=r,L1e(L1e({},e),{},{width:t,height:n})}}])&&z1e(t.prototype,n),r&&z1e(t,r),e}();function Y1e(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;W1e(this,e),this.containerWidth=t,this.containerHeight=n,this.minWidth=r,this.minHeight=o}var t,n,r;return t=e,(n=[{key:"normalize",value:function(e){var t=Math.max(this.minWidth,e.width),n=Math.max(this.minHeight,e.height);return t=Math.min(this.containerWidth,t),n=Math.min(this.containerHeight,n),H1e(H1e({},e),{},{width:t,height:n})}}])&&U1e(t.prototype,n),r&&U1e(t,r),e}();function K1e(e){return(K1e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function $1e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function G1e(e){for(var t=1;tthis.props.containerHeight/this.props.containerWidth}},{key:"render",value:function(){if(!this.imageLoaded||!this.props.containerWidth||!this.props.containerHeight)return null;var e=this.props.value?this.naturalDataToScaled(this.props.value):void 0;return y.a.createElement(T2e,{minHeight:this.scaledMinHeight,minWidth:this.scaledMinWidth,onChange:this.handleRectangleSelectionChange,round:!1,value:e},y.a.createElement("img",{height:this.scaledImageHeight,src:this.props.image,width:this.scaledImageWidth}))}},{key:"scaledImageHeight",get:function(){return this.imageFillsContainerHeight()?Math.min(this.image.naturalHeight,this.props.containerHeight):this.scaledImageWidth*this.image.naturalHeight/this.image.naturalWidth}},{key:"scaledImageWidth",get:function(){return this.imageFillsContainerHeight()?this.scaledImageHeight*this.image.naturalWidth/this.image.naturalHeight:Math.min(this.image.naturalWidth,this.props.containerWidth)}},{key:"scaledMinDimensions",get:function(){var e=this.props,t=e.minHeight,n=e.minWidth,r=e.containerHeight,o=e.containerWidth,i=t?this.naturalVerticalToScaled(t):void 0,a=n?this.naturalHorizontalToScaled(n):void 0;return i&&i>r&&(i=r,a=n&&t?i*n/t:void 0),a&&a>o&&(a=o,i=t&&n?a*t/n:void 0),{width:a,height:i}}},{key:"scaledMinWidth",get:function(){return this.scaledMinDimensions.width}},{key:"scaledMinHeight",get:function(){return this.scaledMinDimensions.height}}]),n}(y.a.Component),C2e=B2e((E2e=x2e).prototype,"imageLoaded",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),B2e(E2e.prototype,"scaledImageHeight",[v.g],Object.getOwnPropertyDescriptor(E2e.prototype,"scaledImageHeight"),E2e.prototype),B2e(E2e.prototype,"scaledImageWidth",[v.g],Object.getOwnPropertyDescriptor(E2e.prototype,"scaledImageWidth"),E2e.prototype),B2e(E2e.prototype,"scaledMinDimensions",[v.g],Object.getOwnPropertyDescriptor(E2e.prototype,"scaledMinDimensions"),E2e.prototype),B2e(E2e.prototype,"scaledMinWidth",[v.g],Object.getOwnPropertyDescriptor(E2e.prototype,"scaledMinWidth"),E2e.prototype),B2e(E2e.prototype,"scaledMinHeight",[v.g],Object.getOwnPropertyDescriptor(E2e.prototype,"scaledMinHeight"),E2e.prototype),j2e=E2e))||j2e,R2e.a.container),V2e=n(425),W2e=n.n(V2e);function U2e(e){return(U2e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function q2e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function K2e(e,t){for(var n=0;n=n||(this.scrollContainer.addEventListener("resize",this.scrollListener,!1),this.scrollContainer.addEventListener("scroll",this.scrollListener,!1))}},{key:"unbindScrollListener",value:function(){this.scrollContainer.removeEventListener("resize",this.scrollListener,!1),this.scrollContainer.removeEventListener("scroll",this.scrollListener,!1)}},{key:"render",value:function(){var e=this.props,t=e.totalPages,n=e.currentPage,r=e.loading,o=e.children,i=null;return r?i=y.a.createElement(_i,null):n===t&&(i=Nr("sulu_admin.reached_end_of_list")),y.a.createElement("section",{ref:this.setRef},y.a.createElement("div",null,o),y.a.createElement("div",{className:W2e.a.indicator},i))}}])&&K2e(t.prototype,n),r&&K2e(t,r),i}(y.a.PureComponent);X2e.defaultProps={loading:!1};var e3e=X2e,t3e=n(426),n3e=n.n(t3e),r3e=n(427),o3e=n.n(r3e),i3e=n(428),a3e=n.n(i3e);function u3e(e){return(u3e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function l3e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s3e(e,t){for(var n=0;n0&&this.masonry.remove(o),u.length>0&&this.masonry.appended(u),a.length>0&&this.masonry.prepended(a),this.layoutedChildNodes=t,(o.length>0||u.length>0||a.length>0)&&this.masonry.reloadItems(),this.masonry.layout()}},{key:"handleImagesLoading",value:function(){var e=this;n3e()(this.layoutedChildNodes).once("always",(function(){e.masonry&&e.masonry.layout()}))}},{key:"render",value:function(){var e=this.props.children,t=this.cloneItems(e);return y.a.createElement("div",{className:a3e.a.masonry,ref:this.setMasonryRef},t)}}])&&s3e(t.prototype,n),r&&s3e(t,r),i}(y.a.PureComponent),m3e=n(133),b3e=n.n(m3e);function v3e(e){return(v3e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function g3e(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function w3e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _3e(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1,disabled:!0})}}])&&x6e(t.prototype,n),r&&x6e(t,r),e}();Kj.add("category_keywords_multiple_usage",new T6e);var D6e=n(134),R6e=n.n(D6e);function M6e(e){return(M6e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function A6e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function L6e(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0?no.getList("contacts",{ids:o.join(","),limit:void 0,page:1}):Promise.resolve({_embedded:{contacts:[]}}),a=r.length>0?no.getList("accounts",{ids:r.join(","),limit:void 0,page:1}):Promise.resolve({_embedded:{accounts:[]}});Promise.all([i,a]).then(Object(v.d)((function(r){var o=j7e(r,2),i=o[0],a=o[1],u=i._embedded.contacts,l=a._embedded.accounts;n.items=t.reduce((function(t,n){if(n.startsWith(e.contactPrefix)){var r=u.find((function(t){return t.id==n.substring(e.contactPrefix.length)}));r&&t.push(k7e(k7e({},r),{},{id:e.contactPrefix+r.id}))}if(n.startsWith(e.accountPrefix)){var o=l.find((function(t){return t.id==n.substring(e.accountPrefix.length)}));o&&t.push(k7e(k7e({},o),{},{id:e.accountPrefix+o.id}))}return t}),[]),n.setLoading(!1)})))}},{key:"remove",value:function(e){this.items=this.items.filter((function(t){return t.id!==e}))}},{key:"move",value:function(e,t){this.items=Si()(this.items,e,t)}},{key:"setLoading",value:function(e){this.loading=e}},{key:"contactItems",get:function(){return this.items.filter((function(t){return t.id.startsWith(e.contactPrefix)})).map((function(t){return k7e(k7e({},t),{},{id:parseInt(t.id.substring(e.contactPrefix.length))})}))}},{key:"accountItems",get:function(){return this.items.filter((function(t){return t.id.startsWith(e.accountPrefix)})).map((function(t){return k7e(k7e({},t),{},{id:parseInt(t.id.substring(e.contactPrefix.length))})}))}}])&&x7e(t.prototype,n),r&&x7e(t,r),e}(),w7e.contactPrefix="c",w7e.accountPrefix="a",v7e=T7e((b7e=_7e).prototype,"items",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),g7e=T7e(b7e.prototype,"loading",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),T7e(b7e.prototype,"contactItems",[v.g],Object.getOwnPropertyDescriptor(b7e.prototype,"contactItems"),b7e.prototype),T7e(b7e.prototype,"accountItems",[v.g],Object.getOwnPropertyDescriptor(b7e.prototype,"accountItems"),b7e.prototype),T7e(b7e.prototype,"remove",[v.d],Object.getOwnPropertyDescriptor(b7e.prototype,"remove"),b7e.prototype),T7e(b7e.prototype,"move",[v.d],Object.getOwnPropertyDescriptor(b7e.prototype,"move"),b7e.prototype),T7e(b7e.prototype,"setLoading",[v.d],Object.getOwnPropertyDescriptor(b7e.prototype,"setLoading"),b7e.prototype),b7e),B7e=n(432),H7e=n.n(B7e);function V7e(e){return(V7e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function W7e(e){return function(e){if(Array.isArray(e))return U7e(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return U7e(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return U7e(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function U7e(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0?r:e.name,writable:!1,configurable:!1,enumerable:!0})}return n}var ttt=[".DS_Store","Thumbs.db"];function ntt(e){return!!e.dataTransfer}function rtt(e){return(function(e){return null!==e}(e.target)&&e.target.files?att(e.target.files):[]).map((function(e){return ett(e)}))}function ott(e,t){return Xn(this,void 0,void 0,(function(){var n;return er(this,(function(r){switch(r.label){case 0:return e.items?(n=att(e.items).filter((function(e){return"file"===e.kind})),"drop"!==t?[2,n]:[4,Promise.all(n.map(utt))]):[3,2];case 1:return[2,itt(ltt(r.sent()))];case 2:return[2,itt(att(e.files).map((function(e){return ett(e)})))]}}))}))}function itt(e){return e.filter((function(e){return-1===ttt.indexOf(e.name)}))}function att(e){for(var t=[],n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);nn)return[!1,vtt(n)];if(e.sizen)return[!1,vtt(n)]}return[!0,null]}function Stt(e){return null!=e}function ktt(e){var t=e.files,n=e.accept,r=e.minSize,o=e.maxSize,i=e.multiple,a=e.maxFiles;return!(!i&&t.length>1||i&&a>=1&&t.length>a)&&t.every((function(e){var t=ytt(_tt(e,n),1)[0],i=ytt(Ott(e,r,o),1)[0];return t&&i}))}function Ptt(e){return"function"==typeof e.isPropagationStopped?e.isPropagationStopped():void 0!==e.cancelBubble&&e.cancelBubble}function jtt(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 Ett(e){e.preventDefault()}function Ctt(e){return-1!==e.indexOf("MSIE")||-1!==e.indexOf("Trident/")}function xtt(e){return-1!==e.indexOf("Edge/")}function Ttt(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.navigator.userAgent;return Ctt(e)||xtt(e)}function Dtt(){for(var e=arguments.length,t=new Array(e),n=0;n1?n-1:0),o=1;oe.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var Ntt=Object(h.forwardRef)((function(e,t){var n=e.children,r=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=ztt(ztt({},Btt),e),n=t.accept,r=t.disabled,o=t.getFilesFromEvent,i=t.maxSize,a=t.minSize,u=t.multiple,l=t.maxFiles,s=t.onDragEnter,c=t.onDragLeave,f=t.onDragOver,p=t.onDrop,d=t.onDropAccepted,y=t.onDropRejected,m=t.onFileDialogCancel,b=t.preventDropOnDocument,v=t.noClick,g=t.noKeyboard,w=t.noDrag,_=t.noDragEventsBubbling,O=Object(h.useRef)(null),S=Object(h.useRef)(null),k=Object(h.useReducer)(Gtt,$tt),P=Mtt(k,2),j=P[0],E=P[1],C=j.isFocused,x=j.isFileDialogActive,T=j.draggedFiles,D=Object(h.useCallback)((function(){S.current&&(E({type:"openDialog"}),S.current.value=null,S.current.click())}),[E]),R=function(){x&&setTimeout((function(){S.current&&(S.current.files.length||(E({type:"closeDialog"}),"function"==typeof m&&m()))}),300)};Object(h.useEffect)((function(){return window.addEventListener("focus",R,!1),function(){window.removeEventListener("focus",R,!1)}}),[S,x,m]);var M=Object(h.useCallback)((function(e){O.current&&O.current.isEqualNode(e.target)&&(32!==e.keyCode&&13!==e.keyCode||(e.preventDefault(),D()))}),[O,S]),A=Object(h.useCallback)((function(){E({type:"focus"})}),[]),L=Object(h.useCallback)((function(){E({type:"blur"})}),[]),I=Object(h.useCallback)((function(){v||(Ttt()?setTimeout(D,0):D())}),[S,v]),z=Object(h.useRef)([]),F=function(e){O.current&&O.current.contains(e.target)||(e.preventDefault(),z.current=[])};Object(h.useEffect)((function(){return b&&(document.addEventListener("dragover",Ett,!1),document.addEventListener("drop",F,!1)),function(){b&&(document.removeEventListener("dragover",Ett),document.removeEventListener("drop",F))}}),[O,b]);var Y=Object(h.useCallback)((function(e){e.preventDefault(),e.persist(),q(e),z.current=[].concat(Rtt(z.current),[e.target]),jtt(e)&&Promise.resolve(o(e)).then((function(t){Ptt(e)&&!_||(E({draggedFiles:t,isDragActive:!0,type:"setDraggedFiles"}),s&&s(e))}))}),[o,s,_]),N=Object(h.useCallback)((function(e){if(e.preventDefault(),e.persist(),q(e),e.dataTransfer)try{e.dataTransfer.dropEffect="copy"}catch(e){}return jtt(e)&&f&&f(e),!1}),[f,_]),B=Object(h.useCallback)((function(e){e.preventDefault(),e.persist(),q(e);var t=z.current.filter((function(e){return O.current&&O.current.contains(e)})),n=t.indexOf(e.target);-1!==n&&t.splice(n,1),z.current=t,t.length>0||(E({isDragActive:!1,type:"setDraggedFiles",draggedFiles:[]}),jtt(e)&&c&&c(e))}),[O,c,_]),H=Object(h.useCallback)((function(e){e.preventDefault(),e.persist(),q(e),z.current=[],jtt(e)&&Promise.resolve(o(e)).then((function(t){if(!Ptt(e)||_){var r=[],o=[];t.forEach((function(e){var t=Mtt(_tt(e,n),2),u=t[0],l=t[1],s=Mtt(Ott(e,a,i),2),c=s[0],f=s[1];if(u&&c)r.push(e);else{var p=[l,f].filter((function(e){return e}));o.push({file:e,errors:p})}})),(!u&&r.length>1||u&&l>=1&&r.length>l)&&(r.forEach((function(e){o.push({file:e,errors:[wtt]})})),r.splice(0)),E({acceptedFiles:r,fileRejections:o,type:"setFiles"}),p&&p(r,o,e),o.length>0&&y&&y(o,e),r.length>0&&d&&d(r,e)}})),E({type:"reset"})}),[u,n,a,i,l,o,p,d,y,_]),V=function(e){return r?null:e},W=function(e){return g?null:V(e)},U=function(e){return w?null:V(e)},q=function(e){_&&e.stopPropagation()},K=Object(h.useMemo)((function(){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.refKey,n=void 0===t?"ref":t,o=e.onKeyDown,i=e.onFocus,a=e.onBlur,u=e.onClick,l=e.onDragEnter,s=e.onDragOver,c=e.onDragLeave,f=e.onDrop,p=Ytt(e,["refKey","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"]);return ztt(ztt(Ftt({onKeyDown:W(Dtt(o,M)),onFocus:W(Dtt(i,A)),onBlur:W(Dtt(a,L)),onClick:V(Dtt(u,I)),onDragEnter:U(Dtt(l,Y)),onDragOver:U(Dtt(s,N)),onDragLeave:U(Dtt(c,B)),onDrop:U(Dtt(f,H))},n,O),r||g?{}:{tabIndex:0}),p)}}),[O,M,A,L,I,Y,N,B,H,g,w,r]),$=Object(h.useCallback)((function(e){e.stopPropagation()}),[]),G=Object(h.useMemo)((function(){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.refKey,r=void 0===t?"ref":t,o=e.onChange,i=e.onClick,a=Ytt(e,["refKey","onChange","onClick"]),l=Ftt({accept:n,multiple:u,type:"file",style:{display:"none"},onChange:V(Dtt(o,H)),onClick:V(Dtt(i,$)),autoComplete:"off",tabIndex:-1},r,S);return ztt(ztt({},l),a)}}),[S,n,u,H,r]),Z=T.length,J=Z>0&&ktt({files:T,accept:n,minSize:a,maxSize:i,multiple:u,maxFiles:l}),Q=Z>0&&!J;return ztt(ztt({},j),{},{isDragAccept:J,isDragReject:Q,isFocused:C&&!r,getRootProps:K,getInputProps:G,rootRef:O,inputRef:S,open:V(D)})}(Ytt(e,["children"])),o=r.open,i=Ytt(r,["open"]);return Object(h.useImperativeHandle)(t,(function(){return{open:o}}),[o]),y.a.createElement(h.Fragment,null,n(ztt(ztt({},i),{},{open:o})))}));Ntt.displayName="Dropzone";var Btt={disabled:!1,getFilesFromEvent:function(e){return Xn(this,void 0,void 0,(function(){return er(this,(function(t){return[2,ntt(e)&&e.dataTransfer?ott(e.dataTransfer,e.type):rtt(e)]}))}))},maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1};Ntt.defaultProps=Btt,Ntt.propTypes={children:ul.a.func,accept:ul.a.oneOfType([ul.a.string,ul.a.arrayOf(ul.a.string)]),multiple:ul.a.bool,preventDropOnDocument:ul.a.bool,noClick:ul.a.bool,noKeyboard:ul.a.bool,noDrag:ul.a.bool,noDragEventsBubbling:ul.a.bool,minSize:ul.a.number,maxSize:ul.a.number,maxFiles:ul.a.number,disabled:ul.a.bool,getFilesFromEvent:ul.a.func,onFileDialogCancel:ul.a.func,onDragEnter:ul.a.func,onDragLeave:ul.a.func,onDragOver:ul.a.func,onDrop:ul.a.func,onDropAccepted:ul.a.func,onDropRejected:ul.a.func};var Htt,Vtt,Wtt,Utt,qtt,Ktt=Ntt,$tt={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,draggedFiles:[],acceptedFiles:[],fileRejections:[]};function Gtt(e,t){switch(t.type){case"focus":return ztt(ztt({},e),{},{isFocused:!0});case"blur":return ztt(ztt({},e),{},{isFocused:!1});case"openDialog":return ztt(ztt({},e),{},{isFileDialogActive:!0});case"closeDialog":return ztt(ztt({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":var n=t.isDragActive,r=t.draggedFiles;return ztt(ztt({},e),{},{draggedFiles:r,isDragActive:n});case"setFiles":return ztt(ztt({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return ztt(ztt({},e),{},{isFileDialogActive:!1,isDragActive:!1,draggedFiles:[],acceptedFiles:[],fileRejections:[]});default:return e}}function Ztt(e,t,n,r){n&&Object.defineProperty(e,t,{enumerable:n.enumerable,configurable:n.configurable,writable:n.writable,value:n.initializer?n.initializer.call(r):void 0})}function Jtt(e,t){for(var n=0;n=200&&e.target.status<=299?o(JSON.parse(e.target.response)):i(e.target.response)},a.onerror=function(e){return i(e.target.response)},a.upload&&(a.upload.onprogress=function(e){return r.setProgress(e.loaded/e.total*100)}),u.append(n,e),a.send(u)}))}},{key:"id",get:function(){var e=this.media;if(e)return e.id}},{key:"downloadUrl",get:function(){var e=this.media;if(e)return e.adminUrl?e.adminUrl:e.url}},{key:"mimeType",get:function(){var e=this.media;if(e)return e.mimeType}}])&&Jtt(t.prototype,n),r&&Jtt(t,r),e}()).prototype,"uploading",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Wtt=Qtt(Htt.prototype,"progress",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Utt=Qtt(Htt.prototype,"media",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Qtt(Htt.prototype,"id",[v.g],Object.getOwnPropertyDescriptor(Htt.prototype,"id"),Htt.prototype),Qtt(Htt.prototype,"downloadUrl",[v.g],Object.getOwnPropertyDescriptor(Htt.prototype,"downloadUrl"),Htt.prototype),Qtt(Htt.prototype,"mimeType",[v.g],Object.getOwnPropertyDescriptor(Htt.prototype,"mimeType"),Htt.prototype),Qtt(Htt.prototype,"setUploading",[v.d],Object.getOwnPropertyDescriptor(Htt.prototype,"setUploading"),Htt.prototype),Qtt(Htt.prototype,"setProgress",[v.d],Object.getOwnPropertyDescriptor(Htt.prototype,"setProgress"),Htt.prototype),Qtt(Htt.prototype,"delete",[v.d],Object.getOwnPropertyDescriptor(Htt.prototype,"delete"),Htt.prototype),qtt=Qtt(Htt.prototype,"handleResponse",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){return e.setUploading(!1),e.setProgress(0),e.media=Object.assign(e.media||{},t),t}}}),Htt),tnt=n(194),nnt=n.n(tnt);function rnt(e){return(rnt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ont(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function int(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&(o.types=r.join(",")),new r_("media","media","media_selection_overlay",{page:v.q.box(),collection:e,excludedIds:t,locale:n},o)}}]),iit(n,[{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.mediaListStore,r=t.open;!0===e.open&&!1===r&&n.clearSelection()}},{key:"componentWillUnmount",value:function(){this.collectionStore&&this.collectionStore.destroy(),this.updateCollectionStoreDisposer&&this.updateCollectionStoreDisposer()}},{key:"updateCollectionStore",value:function(e){this.collectionStore&&this.collectionStore.destroy(),this.collectionStore=new Qet(e,this.props.locale)}},{key:"render",value:function(){var e=this.props,t=e.collectionListStore,n=e.confirmLoading,r=e.mediaListStore,o=e.open,i=e.locale,a=[{title:Nr("sulu_media.reset_selection"),onClick:this.handleSelectionReset}];return y.a.createElement(Zl,{actions:a,confirmDisabled:!r.selections.length,confirmLoading:n,confirmText:Nr("sulu_admin.confirm"),onClose:this.handleClose,onConfirm:this.handleConfirm,open:o,title:Nr("sulu_media.select_media_plural")},y.a.createElement("div",{className:tit.a.overlay},y.a.createElement(Xot,{collectionListStore:t,collectionStore:this.collectionStore,locale:i,mediaListAdapters:["media_card_selection","table"],mediaListStore:r,onCollectionNavigate:this.handleCollectionNavigate,onUploadOverlayClose:this.handleUploadOverlayClose,onUploadOverlayOpen:this.handleUploadOverlayOpen,overlayType:"dialog",uploadOverlayOpen:this.showMediaUploadOverlay})))}}]),n}(y.a.Component),Jot.defaultProps={confirmLoading:!1},qot=fit((Uot=Qot).prototype,"collectionStore",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Kot=fit(Uot.prototype,"showMediaUploadOverlay",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),fit(Uot.prototype,"updateCollectionStore",[v.d],Object.getOwnPropertyDescriptor(Uot.prototype,"updateCollectionStore"),Uot.prototype),$ot=fit(Uot.prototype,"handleCollectionNavigate",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){e.props.collectionId.set(t),e.props.collectionListStore.clear(),e.props.collectionListStore.setPage(1),e.props.mediaListStore.clear(),e.props.mediaListStore.setPage(1)}}}),Got=fit(Uot.prototype,"handleUploadOverlayOpen",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){e.showMediaUploadOverlay=!0}}}),Zot=fit(Uot.prototype,"handleUploadOverlayClose",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){e.showMediaUploadOverlay=!1}}}),Wot=Uot))||Wot;function mit(e){return(mit="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function bit(e,t){for(var n=0;n1)throw new Error("The SingleMediaSelectionOverlay can only handle single selection.This should not happen and is likely a bug.");t.props.onConfirm(t.mediaListStore.selections[0])};var n=Object(v.g)((function(){return t.props.excludedIds.length?t.props.excludedIds:void 0}));return t.excludedIdsDisposer=n.observe((function(){return t.mediaListStore.clear()})),t.mediaListStore=yit.createMediaListStore(t.collectionId,n,t.props.locale,t.props.types),t.collectionListStore=yit.createCollectionListStore(t.collectionId,t.props.locale),t.mediaSelectionDisposer=Object(v.e)((function(){var e=t.mediaListStore.selections;if(!(e.length<=1)){var n=e[e.length-1];n&&(t.mediaListStore.clearSelection(),t.mediaListStore.select(n))}})),t}return t=i,(n=[{key:"componentWillUnmount",value:function(){this.mediaListStore.destroy(),this.collectionListStore.destroy(),this.excludedIdsDisposer(),this.mediaSelectionDisposer()}},{key:"render",value:function(){var e=this.props,t=e.onClose,n=e.open,r=e.locale;return y.a.createElement(yit,{collectionId:this.collectionId,collectionListStore:this.collectionListStore,locale:r,mediaListStore:this.mediaListStore,onClose:t,onConfirm:this.handleConfirm,open:n})}}])&&Eit(t.prototype,n),r&&Eit(t,r),i}(y.a.Component),Sit.defaultProps={excludedIds:[],types:[]},Oit=kit))||Oit;function Fit(e){return(Fit="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Yit(e,t,n,r){n&&Object.defineProperty(e,t,{enumerable:n.enumerable,configurable:n.configurable,writable:n.writable,value:n.initializer?n.initializer.call(r):void 0})}function Nit(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Bit(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&function(e,t){Cut(t).forEach((function(t){hut.DomUtil.removeClass(e,t)}))}(e,t),null!=n&&n.length>0&&function(e,t){Cut(t).forEach((function(t){hut.DomUtil.addClass(e,t)}))}(e,n))};function Tut(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r=0||(o[n]=e[n]);return o}(e,["viewport"]);return t&&(t.center&&(n.center=t.center),"number"==typeof t.zoom&&(n.zoom=t.zoom)),new hut.Map(this.container,n)},n.updateLeafletElement=function(e,t){this._updating=!0;var n=t.bounds,r=t.boundsOptions,o=t.boxZoom,i=t.center,a=t.className,u=t.doubleClickZoom,l=t.dragging,s=t.keyboard,c=t.maxBounds,f=t.scrollWheelZoom,p=t.tap,d=t.touchZoom,h=t.useFlyTo,y=t.viewport,m=t.zoom;if(xut(this.container,e.className,a),y&&y!==e.viewport){var b=y.center?y.center:i,v=null==y.zoom?m:y.zoom;!0===h?this.leafletElement.flyTo(b,v,this.getZoomPanOptions(t)):this.leafletElement.setView(b,v,this.getZoomPanOptions(t))}else i&&this.shouldUpdateCenter(i,e.center)?!0===h?this.leafletElement.flyTo(i,m,this.getZoomPanOptions(t)):this.leafletElement.setView(i,m,this.getZoomPanOptions(t)):"number"==typeof m&&m!==e.zoom&&(null==e.zoom?this.leafletElement.setView(i,m,this.getZoomPanOptions(t)):this.leafletElement.setZoom(m,this.getZoomPanOptions(t)));c&&this.shouldUpdateBounds(c,e.maxBounds)&&this.leafletElement.setMaxBounds(c),n&&(this.shouldUpdateBounds(n,e.bounds)||r!==e.boundsOptions)&&(!0===h?this.leafletElement.flyToBounds(n,this.getFitBoundsOptions(t)):this.leafletElement.fitBounds(n,this.getFitBoundsOptions(t))),o!==e.boxZoom&&(!0===o?this.leafletElement.boxZoom.enable():this.leafletElement.boxZoom.disable()),u!==e.doubleClickZoom&&(!0===u||"string"==typeof u?(this.leafletElement.options.doubleClickZoom=u,this.leafletElement.doubleClickZoom.enable()):this.leafletElement.doubleClickZoom.disable()),l!==e.dragging&&(!0===l?this.leafletElement.dragging.enable():this.leafletElement.dragging.disable()),s!==e.keyboard&&(!0===s?this.leafletElement.keyboard.enable():this.leafletElement.keyboard.disable()),f!==e.scrollWheelZoom&&(!0===f||"string"==typeof f?(this.leafletElement.options.scrollWheelZoom=f,this.leafletElement.scrollWheelZoom.enable()):this.leafletElement.scrollWheelZoom.disable()),p!==e.tap&&(!0===p?this.leafletElement.tap.enable():this.leafletElement.tap.disable()),d!==e.touchZoom&&(!0===d||"string"==typeof d?(this.leafletElement.options.touchZoom=d,this.leafletElement.touchZoom.enable()):this.leafletElement.touchZoom.disable()),this._updating=!1},n.getZoomPanOptions=function(e){return{animate:e.animate,duration:e.duration,easeLinearity:e.easeLinearity,noMoveStart:e.noMoveStart}},n.getFitBoundsOptions=function(e){return r({},this.getZoomPanOptions(e),e.boundsOptions)},n.componentDidMount=function(){var t=Tut.apply(void 0,[this.props].concat(Dut));this.leafletElement=this.createLeafletElement(t),this.leafletElement.on("move",this.onViewportChange),this.leafletElement.on("moveend",this.onViewportChanged),null!=t.bounds&&this.leafletElement.fitBounds(t.bounds,this.getFitBoundsOptions(t)),this.contextValue={layerContainer:this.leafletElement,map:this.leafletElement},e.prototype.componentDidMount.call(this),this.forceUpdate()},n.componentDidUpdate=function(t){!1===this._ready&&(this._ready=!0,this.props.whenReady&&this.leafletElement.whenReady(this.props.whenReady)),e.prototype.componentDidUpdate.call(this,t),this.updateLeafletElement(t,this.props)},n.componentWillUnmount=function(){e.prototype.componentWillUnmount.call(this),this.leafletElement.off("move",this.onViewportChange),this.leafletElement.off("moveend",this.onViewportChanged),!0===this.props.preferCanvas?(this.leafletElement._initEvents(!0),this.leafletElement._stop()):this.leafletElement.remove()},n.shouldUpdateCenter=function(e,t){return!t||(e=Rut(e),t=Rut(t),e[0]!==t[0]||e[1]!==t[1])},n.shouldUpdateBounds=function(e,t){return!t||!Object(hut.latLngBounds)(e).equals(Object(hut.latLngBounds)(t))},n.render=function(){return y.a.createElement("div",{className:this.className,id:this.props.id,ref:this.bindContainer,style:this.props.style},this.contextValue?y.a.createElement(kut,{value:this.contextValue},this.props.children):null)},t}(Eut),Aut=function(e){function t(){return e.apply(this,arguments)||this}return gut(t,e),t.prototype.getOptions=function(e){return null!=e.pane?e:null!=e.leaflet&&null!=e.leaflet.pane?r({},e,{pane:e.leaflet.pane}):e},t}(Eut),Lut=function(e){function t(t){var n;return NO(qO(n=e.call(this,t)||this),"contextValue",void 0),NO(qO(n),"leafletElement",void 0),n.leafletElement=n.createLeafletElement(t),n}gut(t,e);var n=t.prototype;return n.createLeafletElement=function(e){throw new Error("createLeafletElement() must be implemented")},n.updateLeafletElement=function(e,t){},n.componentDidMount=function(){e.prototype.componentDidMount.call(this),this.layerContainer.addLayer(this.leafletElement)},n.componentDidUpdate=function(t){if(e.prototype.componentDidUpdate.call(this,t),this.props.attribution!==t.attribution){var n=this.props.leaflet.map;null!=n&&null!=n.attributionControl&&(n.attributionControl.removeAttribution(t.attribution),n.attributionControl.addAttribution(this.props.attribution))}this.updateLeafletElement(t,this.props)},n.componentWillUnmount=function(){e.prototype.componentWillUnmount.call(this),this.layerContainer.removeLayer(this.leafletElement)},n.render=function(){var e=this.props.children;return null==e?null:null==this.contextValue?y.a.createElement(h.Fragment,null,e):y.a.createElement(kut,{value:this.contextValue},e)},WO(t,[{key:"layerContainer",get:function(){return this.props.leaflet.layerContainer||this.props.leaflet.map}}]),t}(Aut),Iut=Put(function(e){function t(){return e.apply(this,arguments)||this}gut(t,e);var n=t.prototype;return n.createLeafletElement=function(e){return new hut.TileLayer(e.url,this.getOptions(e))},n.updateLeafletElement=function(t,n){e.prototype.updateLeafletElement.call(this,t,n),n.url!==t.url&&this.leafletElement.setUrl(n.url)},t}(function(e){function t(){return e.apply(this,arguments)||this}gut(t,e);var n=t.prototype;return n.createLeafletElement=function(e){return new hut.GridLayer(this.getOptions(e))},n.updateLeafletElement=function(e,t){var n=t.opacity,r=t.zIndex;n!==e.opacity&&this.leafletElement.setOpacity(n),r!==e.zIndex&&this.leafletElement.setZIndex(r)},n.getOptions=function(t){var n=r({},e.prototype.getOptions.call(this,t)),o=t.leaflet.map;return null!=o&&(null==n.maxZoom&&null!=o.options.maxZoom&&(n.maxZoom=o.options.maxZoom),null==n.minZoom&&null!=o.options.minZoom&&(n.minZoom=o.options.minZoom)),n},n.render=function(){return null},t}(Lut))),zut=Put(function(e){function t(){return e.apply(this,arguments)||this}gut(t,e);var n=t.prototype;return n.createLeafletElement=function(e){var t=new hut.Marker(e.position,this.getOptions(e));return this.contextValue=r({},e.leaflet,{popupContainer:t}),t},n.updateLeafletElement=function(e,t){t.position!==e.position&&this.leafletElement.setLatLng(t.position),t.icon!==e.icon&&this.leafletElement.setIcon(t.icon),t.zIndexOffset!==e.zIndexOffset&&this.leafletElement.setZIndexOffset(t.zIndexOffset),t.opacity!==e.opacity&&this.leafletElement.setOpacity(t.opacity),t.draggable!==e.draggable&&(!0===t.draggable?this.leafletElement.dragging.enable():this.leafletElement.dragging.disable())},n.render=function(){var e=this.props.children;return null==e||null==this.contextValue?null:y.a.createElement(kut,{value:this.contextValue},e)},t}(Lut)),Fut=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;oe.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0?{icon:Lft(u.displayOption),onClick:this.handleDisplayOptionClick,options:r.map((function(e){return{icon:Lft(e),label:Ift(e),value:e}}))}:void 0;return y.a.createElement(h.Fragment,null,y.a.createElement(CV,{className:t,disabled:n,emptyText:Nr("sulu_media.select_media_singular"),id:c&&c.id,leftButton:{icon:"su-image",onClick:this.handleOverlayOpen},loading:s,onItemClick:this.handleItemClick,onRemove:c?this.handleRemove:void 0,rightButton:f,valid:a,value:c},c&&y.a.createElement("div",{className:Vft.a.mediaItem},c.thumbnails&&c.thumbnails["sulu-25x25"]?y.a.createElement("img",{alt:c.title,className:Vft.a.thumbnailImage,src:c.thumbnails["sulu-25x25"]}):y.a.createElement(Ast,{height:19,iconSize:14,mimeType:c.mimeType,width:19}),y.a.createElement("div",{className:Vft.a.mediaTitle},c.title))),y.a.createElement(zit,{excludedIds:c?[c.id]:[],locale:o,onClose:this.handleOverlayClose,onConfirm:this.handleOverlayConfirm,open:this.overlayOpen,types:i}))}}])&&$ft(t.prototype,n),r&&$ft(t,r),i}(y.a.Component),Nft.defaultProps={disabled:!1,displayOptions:[],types:[],valid:!0,value:{displayOption:void 0,id:void 0}},Yft=ept((Fft=Bft).prototype,"overlayOpen",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),ept(Fft.prototype,"openOverlay",[v.d],Object.getOwnPropertyDescriptor(Fft.prototype,"openOverlay"),Fft.prototype),ept(Fft.prototype,"closeOverlay",[v.d],Object.getOwnPropertyDescriptor(Fft.prototype,"closeOverlay"),Fft.prototype),zft=Fft))||zft;function npt(e){return(npt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function rpt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function opt(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1e6?"".concat((e/1e6).toFixed(2)," MB"):"".concat((e/1e3).toFixed(2)," KB")}}],(n=[{key:"getDownloadDropdownProps",value:function(e){var t=window.location.origin,n=e.thumbnails,r=[];return r.push({url:t+e.adminUrl,label:Nr("sulu_media.copy_masterfile_url")}),r.push({url:t+e.url,label:Nr("sulu_media.copy_masterfile_url_website")}),n&&r.push.apply(r,dpt(Object.keys(n).map((function(n){return{url:t+e.thumbnails[n],label:n}})))),{imageSizes:r,onDownload:this.handleDownload,downloadCopyText:Nr("sulu_media.copy_url"),downloadUrl:t+e.adminUrl,downloadText:Nr("sulu_media.download_masterfile")}}},{key:"render",value:function(){var e=this,t=this.props,n=t.data,r=t.icon,o=t.loading,a=t.onItemClick,u=t.onItemSelectionChange,l=t.onPageChange,s=t.page,c=t.pageCount,f=t.selections,p=t.showCoverWhenSelected;return y.a.createElement(e3e,{currentPage:s,loading:o,onPageChange:l,totalPages:c},y.a.createElement(y3e,null,n.map((function(t){var n="".concat(t.mimeType," ").concat(i.formatFileSize(t.size)),o=e.getDownloadDropdownProps(t),l=f.includes(t.id),s=t.thumbnails?t.thumbnails["sulu-240x"]:null;return y.a.createElement(Cct,ppt({},o,{ghostLocale:t.ghostLocale,icon:r,id:t.id,image:s,key:t.id,meta:n,mimeType:t.mimeType,onClick:a,onSelectionChange:u,selected:l,showCover:p&&l,title:t.title}))}))))}}])&&mpt(t.prototype,n),r&&mpt(t,r),i}(y.a.Component))||spt;function Ppt(e){return(Ppt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function jpt(){return(jpt=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n1?"".concat(e," ").concat(Nr("sulu_media.media_selected_plural")):Nr("sulu_media.select_media_plural")}},{key:"render",value:function(){var e=this.props,t=e.locale,n=e.disabled,r=e.displayOptions,o=e.types,i=e.value,a=this.mediaSelectionStore,u=a.loading,l=a.items,s=u?"":this.getLabel(l.length),c=r.length>0?{icon:Lft(i.displayOption),onClick:this.handleDisplayOptionClick,options:r.map((function(e){return{icon:Lft(e),label:Ift(e),value:e}}))}:void 0;return y.a.createElement(h.Fragment,null,y.a.createElement(jN,{disabled:!!n,label:s,leftButton:{icon:"su-image",onClick:this.handleOverlayOpen},loading:u,onItemClick:this.handleItemClick,onItemRemove:this.handleRemove,onItemsSorted:this.handleSorted,rightButton:c},l.map((function(e,t){return y.a.createElement(jN.Item,{id:e.id,index:t+1,key:e.id,value:e},y.a.createElement("div",{className:Qpt.a.mediaItem},e.thumbnails&&e.thumbnails["sulu-25x25"]?y.a.createElement("img",{alt:e.title,className:Qpt.a.thumbnailImage,src:e.thumbnails["sulu-25x25"]}):y.a.createElement(Ast,{height:25,iconSize:16,mimeType:e.mimeType,width:25}),y.a.createElement("div",{className:Qpt.a.mediaTitle},y.a.createElement(ay,null,e.title))))}))),y.a.createElement(Pit,{excludedIds:l.map((function(e){return e.id})),locale:t,onClose:this.handleOverlayClose,onConfirm:this.handleOverlayConfirm,open:this.overlayOpen,types:o}))}}])&&idt(t.prototype,n),r&&idt(t,r),i}(y.a.Component),$pt.defaultProps={disabled:!1,displayOptions:[],types:[],value:{displayOption:void 0,ids:[]}},Kpt=fdt((qpt=Gpt).prototype,"overlayOpen",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),fdt(qpt.prototype,"openMediaOverlay",[v.d],Object.getOwnPropertyDescriptor(qpt.prototype,"openMediaOverlay"),qpt.prototype),fdt(qpt.prototype,"closeMediaOverlay",[v.d],Object.getOwnPropertyDescriptor(qpt.prototype,"closeMediaOverlay"),qpt.prototype),Upt=qpt))||Upt;function hdt(e){return(hdt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ydt(e,t){for(var n=0;n0?e.availableFormats[0].key:void 0})))}},{key:"convertSelectionToFormatOptions",value:function(e){return e?{cropX:e.left,cropY:e.top,cropWidth:e.width,cropHeight:e.height}:{}}},{key:"convertFormatOptionsToSelection",value:function(e){if(e)return{left:e.cropX,top:e.cropY,width:e.cropWidth,height:e.cropHeight}}},{key:"render",value:function(){var e=this.availableFormats,t=this.mediaFormatStore,n=this.selectedFormat,r=this.props,o=r.image,i=r.open;return y.a.createElement(Zl,{confirmDisabled:this.changedFormatCroppings.size<=0,confirmLoading:this.mediaFormatStore.saving,confirmText:Nr("sulu_admin.save"),onClose:this.handleClose,onConfirm:this.handleConfirm,open:i,size:"large",title:Nr("sulu_media.define_crops")},e?y.a.createElement("div",{className:Iht.a.cropOverlayContainer},y.a.createElement("div",{className:Iht.a.formatSelect},y.a.createElement(cm,{onChange:this.handleFormatChange,value:this.formatKey},e.map((function(e){return y.a.createElement(cm.Option,{key:e.key,value:e.key},e.title+(t.getFormatOptions(e.key)?" ("+Nr("sulu_media.cropped")+")":""))})))),n&&!t.loading&&y.a.createElement(h.Fragment,null,y.a.createElement(H2e,{image:o,minHeight:n.scale.y,minWidth:n.scale.x,onChange:this.handleSelectionChange,value:this.currentSelection}),y.a.createElement("p",null,"(",Nr("sulu_media.double_click_crop_and_maximize"),")"))):y.a.createElement(_i,null))}},{key:"currentSelection",get:function(){var e=this.formatKey;if(e)return this.changedFormatCroppings.has(e)?this.changedFormatCroppings.get(e):this.convertFormatOptionsToSelection(this.mediaFormatStore.getFormatOptions(e))}},{key:"availableFormats",get:function(){return this.rawFormats?this.rawFormats.filter((function(e){return!e.internal})):[]}},{key:"selectedFormat",get:function(){var e=this;if(!this.availableFormats)throw new Error("Cannot access format as long as formats have not finished loading!");var t=this.availableFormats.find((function(t){return t.key===e.formatKey}));if(t)return t}}])&&Yht(t.prototype,n),r&&Yht(t,r),i}(y.a.Component),jht=Uht((Pht=Mht).prototype,"rawFormats",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Eht=Uht(Pht.prototype,"formatKey",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Cht=Uht(Pht.prototype,"changedFormatCroppings",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return new Map}}),xht=Uht(Pht.prototype,"dirty",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Uht(Pht.prototype,"currentSelection",[v.g],Object.getOwnPropertyDescriptor(Pht.prototype,"currentSelection"),Pht.prototype),Uht(Pht.prototype,"availableFormats",[v.g],Object.getOwnPropertyDescriptor(Pht.prototype,"availableFormats"),Pht.prototype),Uht(Pht.prototype,"selectedFormat",[v.g],Object.getOwnPropertyDescriptor(Pht.prototype,"selectedFormat"),Pht.prototype),Tht=Uht(Pht.prototype,"handleClose",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){e.props.onClose(),e.changedFormatCroppings.clear()}}}),Dht=Uht(Pht.prototype,"handleFormatChange",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){e.formatKey=t}}}),Rht=Uht(Pht.prototype,"handleSelectionChange",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){var n=e.formatKey;if(!n)throw new Error("It is not possible to change the selection without a selected format. This should not happen and is likely a bug.");e.changedFormatCroppings.set(n,t)}}}),kht=Pht))||kht,Kht=n(198),$ht=n.n(Kht);function Ght(e){return(Ght="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Zht(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Jht(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&y.a.createElement(Cp.Field,{colSpan:5,label:Nr("sulu_media.form_type"),required:!1,spaceAfter:1},y.a.createElement(cm,{disabled:n,onChange:this.handleTypeChange,value:this.selectedHotspot.type},Object.entries(a).map((function(e){var t=jbt(e,2),n=t[0],r=t[1];return y.a.createElement(cm.Option,{key:n,value:n},r)})))))),y.a.createElement("button",{className:kbt.a.removeButton,disabled:n,onClick:this.handleHotspotRemove},y.a.createElement(yn,{name:"su-trash-alt"}))),t))))}},{key:"selectedHotspot",get:function(){var e=this.props;return e.value[e.selectedIndex]}}])&&xbt(t.prototype,n),r&&xbt(t,r),i}(y.a.Component)).prototype,"selectedHotspot",[v.g],Object.getOwnPropertyDescriptor(_bt.prototype,"selectedHotspot"),_bt.prototype),wbt=_bt))||wbt,Ubt=n(104),qbt=n.n(Ubt);function Kbt(e){return(Kbt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function $bt(e){return function(e){if(Array.isArray(e))return Gbt(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Gbt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Gbt(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Gbt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);nr&&h[r]?h[r]:void 0,formInspector:u,index:r,onChange:e.handleHotspotFormChange,onFieldFinish:l,onSuccess:s,router:c,schema:d.form,schemaPath:f+"/types/"+n+"/form",showAllErrors:p})},e}return t=i,(n=[{key:"render",value:function(){var e=this.props,t=e.defaultType,n=e.disabled,r=e.error,o=e.formInspector,i=e.onFinish,a=e.types,u=e.value,l=o.locale?o.locale:v.q.box(zo.contentLocale);if(!t)throw new Error('The "image_map" field type needs a defaultType!');if(!a)throw new Error(Pvt);var s=Object.keys(a).reduce((function(e,t){return e[t]=a[t].title,e}),{});return y.a.createElement(svt,{defaultFormType:t,disabled:!!n,locale:l,onChange:this.handleChange,onFinish:i,renderHotspotForm:this.renderHotspotForm,types:s,valid:!r,value:u||void 0})}}])&&wvt(t.prototype,n),r&&wvt(t,r),i}(y.a.Component),Evt=n(453),Cvt=n.n(Evt);function xvt(e,t){for(var n=0;n1})})))}},{key:"visibleWebspaces",get:function(){var e=this.props.webspace;return(e?[Gat.getWebspace(e)]:Gat.grantedWebspaces).filter((function(e){return e.segments.length>0}))}}])&&Iwt(t.prototype,n),r&&Iwt(t,r),i}(y.a.Component)).prototype,"visibleWebspaces",[v.g],Object.getOwnPropertyDescriptor(xwt.prototype,"visibleWebspaces"),xwt.prototype),xwt);function Hwt(e){return(Hwt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Vwt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Wwt(e,t){for(var n=0;n0?s:void 0,value:null===i?void 0:i})}},{key:"locale",get:function(){var e=this.props.formInspector;return e.locale?e.locale:v.q.box(zo.contentLocale)}}])&&n_t(t.prototype,n),r&&n_t(t,r),i}(y.a.Component)).prototype,"locale",[v.g],Object.getOwnPropertyDescriptor(Zwt.prototype,"locale"),Zwt.prototype),Gwt=Zwt))||Gwt;function c_t(e){return(c_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})(e)}function f_t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p_t(e,t){for(var n=0;n0&&a.map((function(e){if("string"!=typeof e)throw new Error('All entries in the "contentLocales" array must be strings!');return y.a.createElement(cm.Option,{key:e,value:e},e)})))}}])&&w_t(t.prototype,n),r&&w_t(t,r),i}(y.a.Component);function L_t(e){return(L_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})(e)}function I_t(e,t,n,r){n&&Object.defineProperty(e,t,{enumerable:n.enumerable,configurable:n.configurable,writable:n.writable,value:n.initializer?n.initializer.call(r):void 0})}function z_t(e,t){for(var n=0;n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function POt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&y.a.createElement(o9.Select,{icon:"su-focus",onChange:this.handleSegmentChange,options:this.segments.map((function(e){return{label:e.title,value:e.key}})),value:this.previewStore&&this.previewStore.segment}),y.a.createElement(o9.Button,{icon:"su-sync",onClick:this.handleRefreshClick},Nr("sulu_preview.reload")),y.a.createElement(o9.Button,{icon:"su-link",onClick:this.handlePreviewWindowClick},Nr("sulu_preview.open_in_window"))))))}}]),n}(y.a.Component),ikt.debounceDelay=250,ikt.mode="auto",ikt.audienceTargeting=!1,USt=wkt((WSt=akt).prototype,"iframeRef",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),qSt=wkt(WSt.prototype,"started",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),KSt=wkt(WSt.prototype,"selectedDeviceOption",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return this.availableDeviceOptions[0].value}}),$St=wkt(WSt.prototype,"targetGroupsStore",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),GSt=wkt(WSt.prototype,"previewStore",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ZSt=wkt(WSt.prototype,"previewWindow",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),JSt=wkt(WSt.prototype,"webspaceOptions",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),QSt=wkt(WSt.prototype,"reloadCounter",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),wkt(WSt.prototype,"webspaceKey",[v.g],Object.getOwnPropertyDescriptor(WSt.prototype,"webspaceKey"),WSt.prototype),wkt(WSt.prototype,"segments",[v.g],Object.getOwnPropertyDescriptor(WSt.prototype,"segments"),WSt.prototype),XSt=wkt(WSt.prototype,"setStarted",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){e.started=t}}}),ekt=wkt(WSt.prototype,"setIframe",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){e.iframeRef=t}}}),tkt=wkt(WSt.prototype,"handleDeviceSelectChange",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){e.selectedDeviceOption=t}}}),nkt=wkt(WSt.prototype,"handleWebspaceChange",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){e.previewStore.setWebspace(t)}}}),rkt=wkt(WSt.prototype,"handleRefreshClick",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){++e.reloadCounter}}}),okt=wkt(WSt.prototype,"handlePreviewWindowClick",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){e.previewWindow=window.open(e.previewStore.renderRoute),e.previewWindow.addEventListener("beforeunload",Object(v.d)((function(){e.previewWindow=void 0})))}}}),VSt=WSt))||VSt;function jkt(e){return(jkt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ekt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ckt(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{path:null},r=t.props.onFinish,o=e&&e.toString()||null,i=n&&n.url||null;t.handleChange(Ckt(Ckt({},t.props.value),{},{page:{uuid:o,path:i}})),r()},t.handleSuffixChange=function(e){t.handleChange(Ckt(Ckt({},t.props.value),{},{suffix:e}))},t.handleChange=function(e){(0,t.props.onChange)(e)};var n=e.fieldTypeOptions.modeResolver;if(!n)throw new Error('The "modeResolver" must be a function returning a promise with the desired mode');return n(e).then(Object(v.d)((function(e){return t.mode=e}))),t}return t=i,(n=[{key:"render",value:function(){if(!this.mode)return null;var e=this.props,t=e.dataPath,n=e.defaultType,r=e.disabled,o=e.fieldTypeOptions,i=e.formInspector,a=e.onFinish,u=e.onSuccess,l=e.router,s=e.schemaOptions,c=e.schemaPath,f=e.types;return y.a.createElement(h.Fragment,null,y.a.createElement(Xs,null,y.a.createElement(Xs.Item,{colSpan:5},y.a.createElement(iW,{adapter:"column_list",disabled:!!r,displayProperties:["url"],emptyText:Nr("sulu_page.no_page_selected"),icon:"su-document",listKey:"pages",locale:this.locale,onChange:this.handlePageChange,overlayTitle:Nr("sulu_page.single_selection_overlay_title"),resourceKey:"pages",value:this.pageValue})),y.a.createElement(Xs.Item,{colSpan:7},y.a.createElement(V1,{dataPath:t,defaultType:n,disabled:r,error:void 0,fieldTypeOptions:Ckt({historyResourceKey:"routes",options:{history:!0}},o),formInspector:i,label:void 0,maxOccurs:1,minOccurs:1,onChange:this.handleSuffixChange,onFinish:a,onSuccess:u,router:l,schemaOptions:s,schemaPath:c,showAllErrors:!1,types:f,value:this.suffixValue}))))}},{key:"locale",get:function(){var e=this.props.formInspector;return e.locale?e.locale:v.q.box(zo.contentLocale)}},{key:"pageValue",get:function(){var e=this.props.value;return e&&e.page&&e.page.uuid?e.page.uuid:null}},{key:"suffixValue",get:function(){var e=this.props.value;return e&&e.suffix?e.suffix:null}}])&&Tkt(t.prototype,n),r&&Tkt(t,r),i}(h.Component),Skt=function(e,t,n,r,o){var i={};return Object.keys(r).forEach((function(e){i[e]=r[e]})),i.enumerable=!!i.enumerable,i.configurable=!!i.configurable,("value"in i||i.initializer)&&(i.writable=!0),i=n.slice().reverse().reduce((function(n,r){return r(e,t,n)||n}),i),o&&void 0!==i.initializer&&(i.value=i.initializer?i.initializer.call(o):void 0,i.initializer=void 0),void 0===i.initializer&&(Object.defineProperty(e,t,i),i=null),i}((Okt=kkt).prototype,"mode",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),_kt=Okt))||_kt;po.addUpdateConfigHook("sulu_admin",(function(e,t){if(!t){var n=qr.getListUrl("routes",{action:"generate"});Dp.add("route",V1,{historyResourceKey:"routes",modeResolver:function(){return Promise.resolve("full")},generationUrl:n,options:{history:!0}}),Dp.add("page_tree_route",Ikt,{modeResolver:function(){return Promise.resolve("leaf")}})}}));var zkt,Fkt,Ykt,Nkt,Bkt,Hkt=n(464),Vkt=n.n(Hkt);function Wkt(e,t,n,r){n&&Object.defineProperty(e,t,{enumerable:n.enumerable,configurable:n.configurable,writable:n.writable,value:n.initializer?n.initializer.call(r):void 0})}function Ukt(e,t){for(var n=0;n0&&Kkt.result.map((function(n,r){return y.a.createElement(IPt,{description:n.document.description,icon:t[n.document.index].icon,image:n.document.imageUrl,index:r,key:n.document.index+"_"+n.document.id+"_"+n.document.locale,locale:n.document.locale,onClick:e.handleResultClick,resource:t[n.document.index]?t[n.document.index].name:"",title:n.document.title})}))):y.a.createElement(_i,null)}}])&&HPt(t.prototype,n),r&&HPt(t,r),i}(y.a.Component),TPt=$Pt((xPt=LPt).prototype,"query",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){}}),DPt=$Pt(xPt.prototype,"indexes",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){}}),RPt=$Pt(xPt.prototype,"indexName",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){}}),$Pt(xPt.prototype,"componentDidMount",[v.d],Object.getOwnPropertyDescriptor(xPt.prototype,"componentDidMount"),xPt.prototype),MPt=$Pt(xPt.prototype,"handleIndexChange",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){e.indexName=t}}}),APt=$Pt(xPt.prototype,"handleQueryChange",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){e.query=t}}}),CPt=xPt))||CPt;function ZPt(e){return(ZPt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function JPt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function QPt(e,t){for(var n=0;n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function mjt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Rjt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function PEt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:[],o=[],i=kEt(e.props.value);try{for(i.s();!(n=i.n()).done;){var a=n.value;t.includes(a.role.id)&&o.push(a)}}catch(e){i.e(e)}finally{i.f()}var u,l=r.filter((function(t){return!e.selectedRoles.includes(t.id)})),s=kEt(l);try{for(s.s();!(u=s.n()).done;){var c=u.value;o.push({locales:[],role:c})}}catch(e){s.e(e)}finally{s.f()}e.props.onChange(o)},e.handleRoleAssignmentChange=function(t){var n,r=[],o=kEt(e.props.value);try{for(o.s();!(n=o.n()).done;){var i=n.value;i.role.id!==t.role.id?r.push(i):r.push(t)}}catch(e){o.e(e)}finally{o.f()}e.props.onChange(r)},e}return t=i,(n=[{key:"render",value:function(){var e=this,t=this.props,n=t.disabled,r=t.value;return y.a.createElement(Xs,null,y.a.createElement(Xs.Item,{colSpan:6},y.a.createElement(MJe,{disabled:n,displayProperty:"name",onChange:this.handleRoleChange,requestParameters:{sortBy:"name"},resourceKey:"roles",values:this.selectedRoles})),this.selectedRoles.length>0&&y.a.createElement(Xs.Item,{colSpan:12},y.a.createElement("table",{className:OEt.a.roleAssignments},y.a.createElement("tbody",null,r.map((function(t,r){return y.a.createElement(wEt,{disabled:n,key:r,localizations:xo.localizations,onChange:e.handleRoleAssignmentChange,value:t})}))))))}},{key:"selectedRoles",get:function(){var e,t=[],n=kEt(this.props.value);try{for(n.s();!(e=n.n()).done;){var r=e.value;t.push(r.role.id)}}catch(e){n.e(e)}finally{n.f()}return t.sort()}}])&&EEt(t.prototype,n),r&&EEt(t,r),i}(y.a.Component),vEt.defaultProps={disabled:!1},function(e,t,n,r,o){var i={};Object.keys(r).forEach((function(e){i[e]=r[e]})),i.enumerable=!!i.enumerable,i.configurable=!!i.configurable,("value"in i||i.initializer)&&(i.writable=!0),i=n.slice().reverse().reduce((function(n,r){return r(e,t,n)||n}),i),o&&void 0!==i.initializer&&(i.value=i.initializer?i.initializer.call(o):void 0,i.initializer=void 0),void 0===i.initializer&&(Object.defineProperty(e,t,i),i=null)}((bEt=gEt).prototype,"selectedRoles",[v.g],Object.getOwnPropertyDescriptor(bEt.prototype,"selectedRoles"),bEt.prototype),mEt=bEt))||mEt;function MEt(e){return(MEt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function AEt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function LEt(e,t){for(var n=0;n0}}])&&QEt(t.prototype,n),r&&QEt(t,r),i}(y.a.Component),WEt.webspacePlaceholder="#webspace#",HEt=oCt((BEt=UEt).prototype,"active",[v.q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),oCt(BEt.prototype,"componentDidMount",[v.d],Object.getOwnPropertyDescriptor(BEt.prototype,"componentDidMount"),BEt.prototype),VEt=oCt(BEt.prototype,"handleActiveChange",[v.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){if(e.active=t,!e.active){var n=e.props;(0,n.onChange)({},n.system)}}}}),oCt(BEt.prototype,"defaultValue",[v.g],Object.getOwnPropertyDescriptor(BEt.prototype,"defaultValue"),BEt.prototype),oCt(BEt.prototype,"hasValues",[v.g],Object.getOwnPropertyDescriptor(BEt.prototype,"hasValues"),BEt.prototype),NEt=BEt))||NEt;function fCt(e){return(fCt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function pCt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function dCt(e){for(var t=1;t 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\nfunction __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}\n\nvar enumerableDescriptorCache = {};\nvar nonEnumerableDescriptorCache = {};\nfunction createPropertyInitializerDescriptor(prop, enumerable) {\n var cache = enumerable ? enumerableDescriptorCache : nonEnumerableDescriptorCache;\n return (cache[prop] ||\n (cache[prop] = {\n configurable: true,\n enumerable: enumerable,\n get: function () {\n initializeInstance(this);\n return this[prop];\n },\n set: function (value) {\n initializeInstance(this);\n this[prop] = value;\n }\n }));\n}\nfunction initializeInstance(target) {\n if (target.__mobxDidRunLazyInitializers === true)\n return;\n var decorators = target.__mobxDecorators;\n if (decorators) {\n addHiddenProp(target, \"__mobxDidRunLazyInitializers\", true);\n for (var key in decorators) {\n var d = decorators[key];\n d.propertyCreator(target, d.prop, d.descriptor, d.decoratorTarget, d.decoratorArguments);\n }\n }\n}\nfunction createPropDecorator(propertyInitiallyEnumerable, propertyCreator) {\n return function decoratorFactory() {\n var decoratorArguments;\n var decorator = function decorate(target, prop, descriptor, applyImmediately\n // This is a special parameter to signal the direct application of a decorator, allow extendObservable to skip the entire type decoration part,\n // as the instance to apply the decorator to equals the target\n ) {\n if (applyImmediately === true) {\n propertyCreator(target, prop, descriptor, target, decoratorArguments);\n return null;\n }\n if (process.env.NODE_ENV !== \"production\" && !quacksLikeADecorator(arguments))\n fail(\"This function is a decorator, but it wasn't invoked like a decorator\");\n if (!Object.prototype.hasOwnProperty.call(target, \"__mobxDecorators\")) {\n var inheritedDecorators = target.__mobxDecorators;\n addHiddenProp(target, \"__mobxDecorators\", __assign({}, inheritedDecorators));\n }\n target.__mobxDecorators[prop] = {\n prop: prop,\n propertyCreator: propertyCreator,\n descriptor: descriptor,\n decoratorTarget: target,\n decoratorArguments: decoratorArguments\n };\n return createPropertyInitializerDescriptor(prop, propertyInitiallyEnumerable);\n };\n if (quacksLikeADecorator(arguments)) {\n // @decorator\n decoratorArguments = EMPTY_ARRAY;\n return decorator.apply(null, arguments);\n }\n else {\n // @decorator(args)\n decoratorArguments = Array.prototype.slice.call(arguments);\n return decorator;\n }\n };\n}\nfunction quacksLikeADecorator(args) {\n return (((args.length === 2 || args.length === 3) && typeof args[1] === \"string\") ||\n (args.length === 4 && args[3] === true));\n}\n\nfunction deepEnhancer(v, _, name) {\n // it is an observable already, done\n if (isObservable(v))\n return v;\n // something that can be converted and mutated?\n if (Array.isArray(v))\n return observable.array(v, { name: name });\n if (isPlainObject(v))\n return observable.object(v, undefined, { name: name });\n if (isES6Map(v))\n return observable.map(v, { name: name });\n if (isES6Set(v))\n return observable.set(v, { name: name });\n return v;\n}\nfunction shallowEnhancer(v, _, name) {\n if (v === undefined || v === null)\n return v;\n if (isObservableObject(v) || isObservableArray(v) || isObservableMap(v) || isObservableSet(v))\n return v;\n if (Array.isArray(v))\n return observable.array(v, { name: name, deep: false });\n if (isPlainObject(v))\n return observable.object(v, undefined, { name: name, deep: false });\n if (isES6Map(v))\n return observable.map(v, { name: name, deep: false });\n if (isES6Set(v))\n return observable.set(v, { name: name, deep: false });\n return fail(process.env.NODE_ENV !== \"production\" &&\n \"The shallow modifier / decorator can only used in combination with arrays, objects, maps and sets\");\n}\nfunction referenceEnhancer(newValue) {\n // never turn into an observable\n return newValue;\n}\nfunction refStructEnhancer(v, oldValue, name) {\n if (process.env.NODE_ENV !== \"production\" && isObservable(v))\n throw \"observable.struct should not be used with observable values\";\n if (deepEqual(v, oldValue))\n return oldValue;\n return v;\n}\n\nfunction createDecoratorForEnhancer(enhancer) {\n invariant(enhancer);\n var decorator = createPropDecorator(true, function (target, propertyName, descriptor, _decoratorTarget, decoratorArgs) {\n if (process.env.NODE_ENV !== \"production\") {\n invariant(!descriptor || !descriptor.get, \"@observable cannot be used on getter (property \\\"\" + propertyName + \"\\\"), use @computed instead.\");\n }\n var initialValue = descriptor\n ? descriptor.initializer\n ? descriptor.initializer.call(target)\n : descriptor.value\n : undefined;\n defineObservableProperty(target, propertyName, initialValue, enhancer);\n });\n var res = \n // Extra process checks, as this happens during module initialization\n typeof process !== \"undefined\" && process.env && process.env.NODE_ENV !== \"production\"\n ? function observableDecorator() {\n // This wrapper function is just to detect illegal decorator invocations, deprecate in a next version\n // and simply return the created prop decorator\n if (arguments.length < 2)\n return fail(\"Incorrect decorator invocation. @observable decorator doesn't expect any arguments\");\n return decorator.apply(null, arguments);\n }\n : decorator;\n res.enhancer = enhancer;\n return res;\n}\n\n// Predefined bags of create observable options, to avoid allocating temporarily option objects\n// in the majority of cases\nvar defaultCreateObservableOptions = {\n deep: true,\n name: undefined,\n defaultDecorator: undefined\n};\nvar shallowCreateObservableOptions = {\n deep: false,\n name: undefined,\n defaultDecorator: undefined\n};\nObject.freeze(defaultCreateObservableOptions);\nObject.freeze(shallowCreateObservableOptions);\nfunction assertValidOption(key) {\n if (!/^(deep|name|equals|defaultDecorator)$/.test(key))\n fail(\"invalid option for (extend)observable: \" + key);\n}\nfunction asCreateObservableOptions(thing) {\n if (thing === null || thing === undefined)\n return defaultCreateObservableOptions;\n if (typeof thing === \"string\")\n return { name: thing, deep: true };\n if (process.env.NODE_ENV !== \"production\") {\n if (typeof thing !== \"object\")\n return fail(\"expected options object\");\n Object.keys(thing).forEach(assertValidOption);\n }\n return thing;\n}\nfunction getEnhancerFromOptions(options) {\n return options.defaultDecorator\n ? options.defaultDecorator.enhancer\n : options.deep === false\n ? referenceEnhancer\n : deepEnhancer;\n}\nvar deepDecorator = createDecoratorForEnhancer(deepEnhancer);\nvar shallowDecorator = createDecoratorForEnhancer(shallowEnhancer);\nvar refDecorator = createDecoratorForEnhancer(referenceEnhancer);\nvar refStructDecorator = createDecoratorForEnhancer(refStructEnhancer);\n/**\n * Turns an object, array or function into a reactive structure.\n * @param v the value which should become observable.\n */\nfunction createObservable(v, arg2, arg3) {\n // @observable someProp;\n if (typeof arguments[1] === \"string\") {\n return deepDecorator.apply(null, arguments);\n }\n // it is an observable already, done\n if (isObservable(v))\n return v;\n // something that can be converted and mutated?\n var res = isPlainObject(v)\n ? observable.object(v, arg2, arg3)\n : Array.isArray(v)\n ? observable.array(v, arg2)\n : isES6Map(v)\n ? observable.map(v, arg2)\n : isES6Set(v)\n ? observable.set(v, arg2)\n : v;\n // this value could be converted to a new observable data structure, return it\n if (res !== v)\n return res;\n // otherwise, just box it\n fail(process.env.NODE_ENV !== \"production\" &&\n \"The provided value could not be converted into an observable. If you want just create an observable reference to the object use 'observable.box(value)'\");\n}\nvar observableFactories = {\n box: function (value, options) {\n if (arguments.length > 2)\n incorrectlyUsedAsDecorator(\"box\");\n var o = asCreateObservableOptions(options);\n return new ObservableValue(value, getEnhancerFromOptions(o), o.name, true, o.equals);\n },\n shallowBox: function (value, name) {\n if (arguments.length > 2)\n incorrectlyUsedAsDecorator(\"shallowBox\");\n deprecated(\"observable.shallowBox\", \"observable.box(value, { deep: false })\");\n return observable.box(value, { name: name, deep: false });\n },\n array: function (initialValues, options) {\n if (arguments.length > 2)\n incorrectlyUsedAsDecorator(\"array\");\n var o = asCreateObservableOptions(options);\n return new ObservableArray(initialValues, getEnhancerFromOptions(o), o.name);\n },\n shallowArray: function (initialValues, name) {\n if (arguments.length > 2)\n incorrectlyUsedAsDecorator(\"shallowArray\");\n deprecated(\"observable.shallowArray\", \"observable.array(values, { deep: false })\");\n return observable.array(initialValues, { name: name, deep: false });\n },\n map: function (initialValues, options) {\n if (arguments.length > 2)\n incorrectlyUsedAsDecorator(\"map\");\n var o = asCreateObservableOptions(options);\n return new ObservableMap(initialValues, getEnhancerFromOptions(o), o.name);\n },\n shallowMap: function (initialValues, name) {\n if (arguments.length > 2)\n incorrectlyUsedAsDecorator(\"shallowMap\");\n deprecated(\"observable.shallowMap\", \"observable.map(values, { deep: false })\");\n return observable.map(initialValues, { name: name, deep: false });\n },\n set: function (initialValues, options) {\n if (arguments.length > 2)\n incorrectlyUsedAsDecorator(\"set\");\n var o = asCreateObservableOptions(options);\n return new ObservableSet(initialValues, getEnhancerFromOptions(o), o.name);\n },\n object: function (props, decorators, options) {\n if (typeof arguments[1] === \"string\")\n incorrectlyUsedAsDecorator(\"object\");\n var o = asCreateObservableOptions(options);\n return extendObservable({}, props, decorators, o);\n },\n shallowObject: function (props, name) {\n if (typeof arguments[1] === \"string\")\n incorrectlyUsedAsDecorator(\"shallowObject\");\n deprecated(\"observable.shallowObject\", \"observable.object(values, {}, { deep: false })\");\n return observable.object(props, {}, { name: name, deep: false });\n },\n ref: refDecorator,\n shallow: shallowDecorator,\n deep: deepDecorator,\n struct: refStructDecorator\n};\nvar observable = createObservable;\n// weird trick to keep our typings nicely with our funcs, and still extend the observable function\nObject.keys(observableFactories).forEach(function (name) { return (observable[name] = observableFactories[name]); });\nfunction incorrectlyUsedAsDecorator(methodName) {\n fail(\n // process.env.NODE_ENV !== \"production\" &&\n \"Expected one or two arguments to observable.\" + methodName + \". Did you accidentally try to use observable.\" + methodName + \" as decorator?\");\n}\n\nvar computedDecorator = createPropDecorator(false, function (instance, propertyName, descriptor, decoratorTarget, decoratorArgs) {\n if (process.env.NODE_ENV !== \"production\") {\n invariant(descriptor && descriptor.get, \"Trying to declare a computed value for unspecified getter '\" + propertyName + \"'\");\n }\n var get = descriptor.get, set = descriptor.set; // initialValue is the descriptor for get / set props\n // Optimization: faster on decorator target or instance? Assuming target\n // Optimization: find out if declaring on instance isn't just faster. (also makes the property descriptor simpler). But, more memory usage..\n // Forcing instance now, fixes hot reloadig issues on React Native:\n var options = decoratorArgs[0] || {};\n defineComputedProperty(instance, propertyName, __assign({ get: get, set: set }, options));\n});\nvar computedStructDecorator = computedDecorator({ equals: comparer.structural });\n/**\n * Decorator for class properties: @computed get value() { return expr; }.\n * For legacy purposes also invokable as ES5 observable created: `computed(() => expr)`;\n */\nvar computed = function computed(arg1, arg2, arg3) {\n if (typeof arg2 === \"string\") {\n // @computed\n return computedDecorator.apply(null, arguments);\n }\n if (arg1 !== null && typeof arg1 === \"object\" && arguments.length === 1) {\n // @computed({ options })\n return computedDecorator.apply(null, arguments);\n }\n // computed(expr, options?)\n if (process.env.NODE_ENV !== \"production\") {\n invariant(typeof arg1 === \"function\", \"First argument to `computed` should be an expression.\");\n invariant(arguments.length < 3, \"Computed takes one or two arguments if used as function\");\n }\n var opts = typeof arg2 === \"object\" ? arg2 : {};\n opts.get = arg1;\n opts.set = typeof arg2 === \"function\" ? arg2 : opts.set;\n opts.name = opts.name || arg1.name || \"\"; /* for generated name */\n return new ComputedValue(opts);\n};\ncomputed.struct = computedStructDecorator;\n\nvar IDerivationState;\n(function (IDerivationState) {\n // before being run or (outside batch and not being observed)\n // at this point derivation is not holding any data about dependency tree\n IDerivationState[IDerivationState[\"NOT_TRACKING\"] = -1] = \"NOT_TRACKING\";\n // no shallow dependency changed since last computation\n // won't recalculate derivation\n // this is what makes mobx fast\n IDerivationState[IDerivationState[\"UP_TO_DATE\"] = 0] = \"UP_TO_DATE\";\n // some deep dependency changed, but don't know if shallow dependency changed\n // will require to check first if UP_TO_DATE or POSSIBLY_STALE\n // currently only ComputedValue will propagate POSSIBLY_STALE\n //\n // having this state is second big optimization:\n // don't have to recompute on every dependency change, but only when it's needed\n IDerivationState[IDerivationState[\"POSSIBLY_STALE\"] = 1] = \"POSSIBLY_STALE\";\n // A shallow dependency has changed since last computation and the derivation\n // will need to recompute when it's needed next.\n IDerivationState[IDerivationState[\"STALE\"] = 2] = \"STALE\";\n})(IDerivationState || (IDerivationState = {}));\nvar TraceMode;\n(function (TraceMode) {\n TraceMode[TraceMode[\"NONE\"] = 0] = \"NONE\";\n TraceMode[TraceMode[\"LOG\"] = 1] = \"LOG\";\n TraceMode[TraceMode[\"BREAK\"] = 2] = \"BREAK\";\n})(TraceMode || (TraceMode = {}));\nvar CaughtException = /** @class */ (function () {\n function CaughtException(cause) {\n this.cause = cause;\n // Empty\n }\n return CaughtException;\n}());\nfunction isCaughtException(e) {\n return e instanceof CaughtException;\n}\n/**\n * Finds out whether any dependency of the derivation has actually changed.\n * If dependenciesState is 1 then it will recalculate dependencies,\n * if any dependency changed it will propagate it by changing dependenciesState to 2.\n *\n * By iterating over the dependencies in the same order that they were reported and\n * stopping on the first change, all the recalculations are only called for ComputedValues\n * that will be tracked by derivation. That is because we assume that if the first x\n * dependencies of the derivation doesn't change then the derivation should run the same way\n * up until accessing x-th dependency.\n */\nfunction shouldCompute(derivation) {\n switch (derivation.dependenciesState) {\n case IDerivationState.UP_TO_DATE:\n return false;\n case IDerivationState.NOT_TRACKING:\n case IDerivationState.STALE:\n return true;\n case IDerivationState.POSSIBLY_STALE: {\n // state propagation can occur outside of action/reactive context #2195\n var prevAllowStateReads = allowStateReadsStart(true);\n var prevUntracked = untrackedStart(); // no need for those computeds to be reported, they will be picked up in trackDerivedFunction.\n var obs = derivation.observing, l = obs.length;\n for (var i = 0; i < l; i++) {\n var obj = obs[i];\n if (isComputedValue(obj)) {\n if (globalState.disableErrorBoundaries) {\n obj.get();\n }\n else {\n try {\n obj.get();\n }\n catch (e) {\n // we are not interested in the value *or* exception at this moment, but if there is one, notify all\n untrackedEnd(prevUntracked);\n allowStateReadsEnd(prevAllowStateReads);\n return true;\n }\n }\n // if ComputedValue `obj` actually changed it will be computed and propagated to its observers.\n // and `derivation` is an observer of `obj`\n // invariantShouldCompute(derivation)\n if (derivation.dependenciesState === IDerivationState.STALE) {\n untrackedEnd(prevUntracked);\n allowStateReadsEnd(prevAllowStateReads);\n return true;\n }\n }\n }\n changeDependenciesStateTo0(derivation);\n untrackedEnd(prevUntracked);\n allowStateReadsEnd(prevAllowStateReads);\n return false;\n }\n }\n}\n// function invariantShouldCompute(derivation: IDerivation) {\n// const newDepState = (derivation as any).dependenciesState\n// if (\n// process.env.NODE_ENV === \"production\" &&\n// (newDepState === IDerivationState.POSSIBLY_STALE ||\n// newDepState === IDerivationState.NOT_TRACKING)\n// )\n// fail(\"Illegal dependency state\")\n// }\nfunction isComputingDerivation() {\n return globalState.trackingDerivation !== null; // filter out actions inside computations\n}\nfunction checkIfStateModificationsAreAllowed(atom) {\n var hasObservers = atom.observers.length > 0;\n // Should never be possible to change an observed observable from inside computed, see #798\n if (globalState.computationDepth > 0 && hasObservers)\n fail(process.env.NODE_ENV !== \"production\" &&\n \"Computed values are not allowed to cause side effects by changing observables that are already being observed. Tried to modify: \" + atom.name);\n // Should not be possible to change observed state outside strict mode, except during initialization, see #563\n if (!globalState.allowStateChanges && (hasObservers || globalState.enforceActions === \"strict\"))\n fail(process.env.NODE_ENV !== \"production\" &&\n (globalState.enforceActions\n ? \"Since strict-mode is enabled, changing observed observable values outside actions is not allowed. Please wrap the code in an `action` if this change is intended. Tried to modify: \"\n : \"Side effects like changing state are not allowed at this point. Are you trying to modify state from, for example, the render function of a React component? Tried to modify: \") +\n atom.name);\n}\nfunction checkIfStateReadsAreAllowed(observable) {\n if (process.env.NODE_ENV !== \"production\" &&\n !globalState.allowStateReads &&\n globalState.observableRequiresReaction) {\n console.warn(\"[mobx] Observable \" + observable.name + \" being read outside a reactive context\");\n }\n}\n/**\n * Executes the provided function `f` and tracks which observables are being accessed.\n * The tracking information is stored on the `derivation` object and the derivation is registered\n * as observer of any of the accessed observables.\n */\nfunction trackDerivedFunction(derivation, f, context) {\n var prevAllowStateReads = allowStateReadsStart(true);\n // pre allocate array allocation + room for variation in deps\n // array will be trimmed by bindDependencies\n changeDependenciesStateTo0(derivation);\n derivation.newObserving = new Array(derivation.observing.length + 100);\n derivation.unboundDepsCount = 0;\n derivation.runId = ++globalState.runId;\n var prevTracking = globalState.trackingDerivation;\n globalState.trackingDerivation = derivation;\n var result;\n if (globalState.disableErrorBoundaries === true) {\n result = f.call(context);\n }\n else {\n try {\n result = f.call(context);\n }\n catch (e) {\n result = new CaughtException(e);\n }\n }\n globalState.trackingDerivation = prevTracking;\n bindDependencies(derivation);\n if (derivation.observing.length === 0) {\n warnAboutDerivationWithoutDependencies(derivation);\n }\n allowStateReadsEnd(prevAllowStateReads);\n return result;\n}\nfunction warnAboutDerivationWithoutDependencies(derivation) {\n if (process.env.NODE_ENV === \"production\")\n return;\n if (globalState.reactionRequiresObservable || derivation.requiresObservable) {\n console.warn(\"[mobx] Derivation \" + derivation.name + \" is created/updated without reading any observable value\");\n }\n}\n/**\n * diffs newObserving with observing.\n * update observing to be newObserving with unique observables\n * notify observers that become observed/unobserved\n */\nfunction bindDependencies(derivation) {\n // invariant(derivation.dependenciesState !== IDerivationState.NOT_TRACKING, \"INTERNAL ERROR bindDependencies expects derivation.dependenciesState !== -1\");\n var prevObserving = derivation.observing;\n var observing = (derivation.observing = derivation.newObserving);\n var lowestNewObservingDerivationState = IDerivationState.UP_TO_DATE;\n // Go through all new observables and check diffValue: (this list can contain duplicates):\n // 0: first occurrence, change to 1 and keep it\n // 1: extra occurrence, drop it\n var i0 = 0, l = derivation.unboundDepsCount;\n for (var i = 0; i < l; i++) {\n var dep = observing[i];\n if (dep.diffValue === 0) {\n dep.diffValue = 1;\n if (i0 !== i)\n observing[i0] = dep;\n i0++;\n }\n // Upcast is 'safe' here, because if dep is IObservable, `dependenciesState` will be undefined,\n // not hitting the condition\n if (dep.dependenciesState > lowestNewObservingDerivationState) {\n lowestNewObservingDerivationState = dep.dependenciesState;\n }\n }\n observing.length = i0;\n derivation.newObserving = null; // newObserving shouldn't be needed outside tracking (statement moved down to work around FF bug, see #614)\n // Go through all old observables and check diffValue: (it is unique after last bindDependencies)\n // 0: it's not in new observables, unobserve it\n // 1: it keeps being observed, don't want to notify it. change to 0\n l = prevObserving.length;\n while (l--) {\n var dep = prevObserving[l];\n if (dep.diffValue === 0) {\n removeObserver(dep, derivation);\n }\n dep.diffValue = 0;\n }\n // Go through all new observables and check diffValue: (now it should be unique)\n // 0: it was set to 0 in last loop. don't need to do anything.\n // 1: it wasn't observed, let's observe it. set back to 0\n while (i0--) {\n var dep = observing[i0];\n if (dep.diffValue === 1) {\n dep.diffValue = 0;\n addObserver(dep, derivation);\n }\n }\n // Some new observed derivations may become stale during this derivation computation\n // so they have had no chance to propagate staleness (#916)\n if (lowestNewObservingDerivationState !== IDerivationState.UP_TO_DATE) {\n derivation.dependenciesState = lowestNewObservingDerivationState;\n derivation.onBecomeStale();\n }\n}\nfunction clearObserving(derivation) {\n // invariant(globalState.inBatch > 0, \"INTERNAL ERROR clearObserving should be called only inside batch\");\n var obs = derivation.observing;\n derivation.observing = [];\n var i = obs.length;\n while (i--)\n removeObserver(obs[i], derivation);\n derivation.dependenciesState = IDerivationState.NOT_TRACKING;\n}\nfunction untracked(action) {\n var prev = untrackedStart();\n var res = action();\n untrackedEnd(prev);\n return res;\n}\nfunction untrackedStart() {\n var prev = globalState.trackingDerivation;\n globalState.trackingDerivation = null;\n return prev;\n}\nfunction untrackedEnd(prev) {\n globalState.trackingDerivation = prev;\n}\nfunction allowStateReadsStart(allowStateReads) {\n var prev = globalState.allowStateReads;\n globalState.allowStateReads = allowStateReads;\n return prev;\n}\nfunction allowStateReadsEnd(prev) {\n globalState.allowStateReads = prev;\n}\n/**\n * needed to keep `lowestObserverState` correct. when changing from (2 or 1) to 0\n *\n */\nfunction changeDependenciesStateTo0(derivation) {\n if (derivation.dependenciesState === IDerivationState.UP_TO_DATE)\n return;\n derivation.dependenciesState = IDerivationState.UP_TO_DATE;\n var obs = derivation.observing;\n var i = obs.length;\n while (i--)\n obs[i].lowestObserverState = IDerivationState.UP_TO_DATE;\n}\n\n// we don't use globalState for these in order to avoid possible issues with multiple\n// mobx versions\nvar currentActionId = 0;\nvar nextActionId = 1;\nvar functionNameDescriptor = Object.getOwnPropertyDescriptor(function () { }, \"name\");\nvar isFunctionNameConfigurable = functionNameDescriptor && functionNameDescriptor.configurable;\nfunction createAction(actionName, fn) {\n if (process.env.NODE_ENV !== \"production\") {\n invariant(typeof fn === \"function\", \"`action` can only be invoked on functions\");\n if (typeof actionName !== \"string\" || !actionName)\n fail(\"actions should have valid names, got: '\" + actionName + \"'\");\n }\n var res = function () {\n return executeAction(actionName, fn, this, arguments);\n };\n if (process.env.NODE_ENV !== \"production\") {\n if (isFunctionNameConfigurable) {\n Object.defineProperty(res, \"name\", { value: actionName });\n }\n }\n res.isMobxAction = true;\n return res;\n}\nfunction executeAction(actionName, fn, scope, args) {\n var runInfo = _startAction(actionName, scope, args);\n try {\n return fn.apply(scope, args);\n }\n catch (err) {\n runInfo.error = err;\n throw err;\n }\n finally {\n _endAction(runInfo);\n }\n}\nfunction _startAction(actionName, scope, args) {\n var notifySpy = isSpyEnabled() && !!actionName;\n var startTime = 0;\n if (notifySpy) {\n startTime = Date.now();\n var l = (args && args.length) || 0;\n var flattendArgs = new Array(l);\n if (l > 0)\n for (var i = 0; i < l; i++)\n flattendArgs[i] = args[i];\n spyReportStart({\n type: \"action\",\n name: actionName,\n object: scope,\n arguments: flattendArgs\n });\n }\n var prevDerivation = untrackedStart();\n startBatch();\n var prevAllowStateChanges = allowStateChangesStart(true);\n var prevAllowStateReads = allowStateReadsStart(true);\n var runInfo = {\n prevDerivation: prevDerivation,\n prevAllowStateChanges: prevAllowStateChanges,\n prevAllowStateReads: prevAllowStateReads,\n notifySpy: notifySpy,\n startTime: startTime,\n actionId: nextActionId++,\n parentActionId: currentActionId\n };\n currentActionId = runInfo.actionId;\n return runInfo;\n}\nfunction _endAction(runInfo) {\n if (currentActionId !== runInfo.actionId) {\n fail(\"invalid action stack. did you forget to finish an action?\");\n }\n currentActionId = runInfo.parentActionId;\n if (runInfo.error !== undefined) {\n globalState.suppressReactionErrors = true;\n }\n allowStateChangesEnd(runInfo.prevAllowStateChanges);\n allowStateReadsEnd(runInfo.prevAllowStateReads);\n endBatch();\n untrackedEnd(runInfo.prevDerivation);\n if (runInfo.notifySpy) {\n spyReportEnd({ time: Date.now() - runInfo.startTime });\n }\n globalState.suppressReactionErrors = false;\n}\nfunction allowStateChanges(allowStateChanges, func) {\n var prev = allowStateChangesStart(allowStateChanges);\n var res;\n try {\n res = func();\n }\n finally {\n allowStateChangesEnd(prev);\n }\n return res;\n}\nfunction allowStateChangesStart(allowStateChanges) {\n var prev = globalState.allowStateChanges;\n globalState.allowStateChanges = allowStateChanges;\n return prev;\n}\nfunction allowStateChangesEnd(prev) {\n globalState.allowStateChanges = prev;\n}\nfunction allowStateChangesInsideComputed(func) {\n var prev = globalState.computationDepth;\n globalState.computationDepth = 0;\n var res;\n try {\n res = func();\n }\n finally {\n globalState.computationDepth = prev;\n }\n return res;\n}\n\nvar ObservableValue = /** @class */ (function (_super) {\n __extends(ObservableValue, _super);\n function ObservableValue(value, enhancer, name, notifySpy, equals) {\n if (name === void 0) { name = \"ObservableValue@\" + getNextId(); }\n if (notifySpy === void 0) { notifySpy = true; }\n if (equals === void 0) { equals = comparer.default; }\n var _this = _super.call(this, name) || this;\n _this.enhancer = enhancer;\n _this.name = name;\n _this.equals = equals;\n _this.hasUnreportedChange = false;\n _this.value = enhancer(value, undefined, name);\n if (notifySpy && isSpyEnabled()) {\n // only notify spy if this is a stand-alone observable\n spyReport({ type: \"create\", name: _this.name, newValue: \"\" + _this.value });\n }\n return _this;\n }\n ObservableValue.prototype.dehanceValue = function (value) {\n if (this.dehancer !== undefined)\n return this.dehancer(value);\n return value;\n };\n ObservableValue.prototype.set = function (newValue) {\n var oldValue = this.value;\n newValue = this.prepareNewValue(newValue);\n if (newValue !== globalState.UNCHANGED) {\n var notifySpy = isSpyEnabled();\n if (notifySpy) {\n spyReportStart({\n type: \"update\",\n name: this.name,\n newValue: newValue,\n oldValue: oldValue\n });\n }\n this.setNewValue(newValue);\n if (notifySpy)\n spyReportEnd();\n }\n };\n ObservableValue.prototype.prepareNewValue = function (newValue) {\n checkIfStateModificationsAreAllowed(this);\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this,\n type: \"update\",\n newValue: newValue\n });\n if (!change)\n return globalState.UNCHANGED;\n newValue = change.newValue;\n }\n // apply modifier\n newValue = this.enhancer(newValue, this.value, this.name);\n return this.equals(this.value, newValue) ? globalState.UNCHANGED : newValue;\n };\n ObservableValue.prototype.setNewValue = function (newValue) {\n var oldValue = this.value;\n this.value = newValue;\n this.reportChanged();\n if (hasListeners(this)) {\n notifyListeners(this, {\n type: \"update\",\n object: this,\n newValue: newValue,\n oldValue: oldValue\n });\n }\n };\n ObservableValue.prototype.get = function () {\n this.reportObserved();\n return this.dehanceValue(this.value);\n };\n ObservableValue.prototype.intercept = function (handler) {\n return registerInterceptor(this, handler);\n };\n ObservableValue.prototype.observe = function (listener, fireImmediately) {\n if (fireImmediately)\n listener({\n object: this,\n type: \"update\",\n newValue: this.value,\n oldValue: undefined\n });\n return registerListener(this, listener);\n };\n ObservableValue.prototype.toJSON = function () {\n return this.get();\n };\n ObservableValue.prototype.toString = function () {\n return this.name + \"[\" + this.value + \"]\";\n };\n ObservableValue.prototype.valueOf = function () {\n return toPrimitive(this.get());\n };\n return ObservableValue;\n}(Atom));\nObservableValue.prototype[primitiveSymbol()] = ObservableValue.prototype.valueOf;\nvar isObservableValue = createInstanceofPredicate(\"ObservableValue\", ObservableValue);\n\n/**\n * A node in the state dependency root that observes other nodes, and can be observed itself.\n *\n * ComputedValue will remember the result of the computation for the duration of the batch, or\n * while being observed.\n *\n * During this time it will recompute only when one of its direct dependencies changed,\n * but only when it is being accessed with `ComputedValue.get()`.\n *\n * Implementation description:\n * 1. First time it's being accessed it will compute and remember result\n * give back remembered result until 2. happens\n * 2. First time any deep dependency change, propagate POSSIBLY_STALE to all observers, wait for 3.\n * 3. When it's being accessed, recompute if any shallow dependency changed.\n * if result changed: propagate STALE to all observers, that were POSSIBLY_STALE from the last step.\n * go to step 2. either way\n *\n * If at any point it's outside batch and it isn't observed: reset everything and go to 1.\n */\nvar ComputedValue = /** @class */ (function () {\n /**\n * Create a new computed value based on a function expression.\n *\n * The `name` property is for debug purposes only.\n *\n * The `equals` property specifies the comparer function to use to determine if a newly produced\n * value differs from the previous value. Two comparers are provided in the library; `defaultComparer`\n * compares based on identity comparison (===), and `structualComparer` deeply compares the structure.\n * Structural comparison can be convenient if you always produce a new aggregated object and\n * don't want to notify observers if it is structurally the same.\n * This is useful for working with vectors, mouse coordinates etc.\n */\n function ComputedValue(options) {\n this.dependenciesState = IDerivationState.NOT_TRACKING;\n this.observing = []; // nodes we are looking at. Our value depends on these nodes\n this.newObserving = null; // during tracking it's an array with new observed observers\n this.isBeingObserved = false;\n this.isPendingUnobservation = false;\n this.observers = [];\n this.observersIndexes = {};\n this.diffValue = 0;\n this.runId = 0;\n this.lastAccessedBy = 0;\n this.lowestObserverState = IDerivationState.UP_TO_DATE;\n this.unboundDepsCount = 0;\n this.__mapid = \"#\" + getNextId();\n this.value = new CaughtException(null);\n this.isComputing = false; // to check for cycles\n this.isRunningSetter = false;\n this.isTracing = TraceMode.NONE;\n invariant(options.get, \"missing option for computed: get\");\n this.derivation = options.get;\n this.name = options.name || \"ComputedValue@\" + getNextId();\n if (options.set)\n this.setter = createAction(this.name + \"-setter\", options.set);\n this.equals =\n options.equals ||\n (options.compareStructural || options.struct\n ? comparer.structural\n : comparer.default);\n this.scope = options.context;\n this.requiresReaction = !!options.requiresReaction;\n this.keepAlive = !!options.keepAlive;\n }\n ComputedValue.prototype.onBecomeStale = function () {\n propagateMaybeChanged(this);\n };\n ComputedValue.prototype.onBecomeUnobserved = function () { };\n ComputedValue.prototype.onBecomeObserved = function () { };\n /**\n * Returns the current value of this computed value.\n * Will evaluate its computation first if needed.\n */\n ComputedValue.prototype.get = function () {\n if (this.isComputing)\n fail(\"Cycle detected in computation \" + this.name + \": \" + this.derivation);\n if (globalState.inBatch === 0 && this.observers.length === 0 && !this.keepAlive) {\n if (shouldCompute(this)) {\n this.warnAboutUntrackedRead();\n startBatch(); // See perf test 'computed memoization'\n this.value = this.computeValue(false);\n endBatch();\n }\n }\n else {\n reportObserved(this);\n if (shouldCompute(this))\n if (this.trackAndCompute())\n propagateChangeConfirmed(this);\n }\n var result = this.value;\n if (isCaughtException(result))\n throw result.cause;\n return result;\n };\n ComputedValue.prototype.peek = function () {\n var res = this.computeValue(false);\n if (isCaughtException(res))\n throw res.cause;\n return res;\n };\n ComputedValue.prototype.set = function (value) {\n if (this.setter) {\n invariant(!this.isRunningSetter, \"The setter of computed value '\" + this.name + \"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?\");\n this.isRunningSetter = true;\n try {\n this.setter.call(this.scope, value);\n }\n finally {\n this.isRunningSetter = false;\n }\n }\n else\n invariant(false, process.env.NODE_ENV !== \"production\" &&\n \"[ComputedValue '\" + this.name + \"'] It is not possible to assign a new value to a computed value.\");\n };\n ComputedValue.prototype.trackAndCompute = function () {\n if (isSpyEnabled()) {\n spyReport({\n object: this.scope,\n type: \"compute\",\n name: this.name\n });\n }\n var oldValue = this.value;\n var wasSuspended = \n /* see #1208 */ this.dependenciesState === IDerivationState.NOT_TRACKING;\n var newValue = this.computeValue(true);\n var changed = wasSuspended ||\n isCaughtException(oldValue) ||\n isCaughtException(newValue) ||\n !this.equals(oldValue, newValue);\n if (changed) {\n this.value = newValue;\n }\n return changed;\n };\n ComputedValue.prototype.computeValue = function (track) {\n this.isComputing = true;\n globalState.computationDepth++;\n var res;\n if (track) {\n res = trackDerivedFunction(this, this.derivation, this.scope);\n }\n else {\n if (globalState.disableErrorBoundaries === true) {\n res = this.derivation.call(this.scope);\n }\n else {\n try {\n res = this.derivation.call(this.scope);\n }\n catch (e) {\n res = new CaughtException(e);\n }\n }\n }\n globalState.computationDepth--;\n this.isComputing = false;\n return res;\n };\n ComputedValue.prototype.suspend = function () {\n if (!this.keepAlive) {\n clearObserving(this);\n this.value = undefined; // don't hold on to computed value!\n }\n };\n ComputedValue.prototype.observe = function (listener, fireImmediately) {\n var _this = this;\n var firstTime = true;\n var prevValue = undefined;\n return autorun(function () {\n var newValue = _this.get();\n if (!firstTime || fireImmediately) {\n var prevU = untrackedStart();\n listener({\n type: \"update\",\n object: _this,\n newValue: newValue,\n oldValue: prevValue\n });\n untrackedEnd(prevU);\n }\n firstTime = false;\n prevValue = newValue;\n });\n };\n ComputedValue.prototype.warnAboutUntrackedRead = function () {\n if (process.env.NODE_ENV === \"production\")\n return;\n if (this.requiresReaction === true) {\n fail(\"[mobx] Computed value \" + this.name + \" is read outside a reactive context\");\n }\n if (this.isTracing !== TraceMode.NONE) {\n console.log(\"[mobx.trace] '\" + this.name + \"' is being read outside a reactive context. Doing a full recompute\");\n }\n if (globalState.computedRequiresReaction) {\n console.warn(\"[mobx] Computed value \" + this.name + \" is being read outside a reactive context. Doing a full recompute\");\n }\n };\n ComputedValue.prototype.toJSON = function () {\n return this.get();\n };\n ComputedValue.prototype.toString = function () {\n return this.name + \"[\" + this.derivation.toString() + \"]\";\n };\n ComputedValue.prototype.valueOf = function () {\n return toPrimitive(this.get());\n };\n return ComputedValue;\n}());\nComputedValue.prototype[primitiveSymbol()] = ComputedValue.prototype.valueOf;\nvar isComputedValue = createInstanceofPredicate(\"ComputedValue\", ComputedValue);\n\n/**\n * These values will persist if global state is reset\n */\nvar persistentKeys = [\n \"mobxGuid\",\n \"spyListeners\",\n \"enforceActions\",\n \"computedRequiresReaction\",\n \"reactionRequiresObservable\",\n \"observableRequiresReaction\",\n \"allowStateReads\",\n \"disableErrorBoundaries\",\n \"runId\",\n \"UNCHANGED\"\n];\nvar MobXGlobals = /** @class */ (function () {\n function MobXGlobals() {\n /**\n * MobXGlobals version.\n * MobX compatiblity with other versions loaded in memory as long as this version matches.\n * It indicates that the global state still stores similar information\n *\n * N.B: this version is unrelated to the package version of MobX, and is only the version of the\n * internal state storage of MobX, and can be the same across many different package versions\n */\n this.version = 5;\n /**\n * globally unique token to signal unchanged\n */\n this.UNCHANGED = {};\n /**\n * Currently running derivation\n */\n this.trackingDerivation = null;\n /**\n * Are we running a computation currently? (not a reaction)\n */\n this.computationDepth = 0;\n /**\n * Each time a derivation is tracked, it is assigned a unique run-id\n */\n this.runId = 0;\n /**\n * 'guid' for general purpose. Will be persisted amongst resets.\n */\n this.mobxGuid = 0;\n /**\n * Are we in a batch block? (and how many of them)\n */\n this.inBatch = 0;\n /**\n * Observables that don't have observers anymore, and are about to be\n * suspended, unless somebody else accesses it in the same batch\n *\n * @type {IObservable[]}\n */\n this.pendingUnobservations = [];\n /**\n * List of scheduled, not yet executed, reactions.\n */\n this.pendingReactions = [];\n /**\n * Are we currently processing reactions?\n */\n this.isRunningReactions = false;\n /**\n * Is it allowed to change observables at this point?\n * In general, MobX doesn't allow that when running computations and React.render.\n * To ensure that those functions stay pure.\n */\n this.allowStateChanges = true;\n /**\n * Is it allowed to read observables at this point?\n * Used to hold the state needed for `observableRequiresReaction`\n */\n this.allowStateReads = true;\n /**\n * If strict mode is enabled, state changes are by default not allowed\n */\n this.enforceActions = false;\n /**\n * Spy callbacks\n */\n this.spyListeners = [];\n /**\n * Globally attached error handlers that react specifically to errors in reactions\n */\n this.globalReactionErrorHandlers = [];\n /**\n * Warn if computed values are accessed outside a reactive context\n */\n this.computedRequiresReaction = false;\n /**\n * (Experimental)\n * Warn if you try to create to derivation / reactive context without accessing any observable.\n */\n this.reactionRequiresObservable = false;\n /**\n * (Experimental)\n * Warn if observables are accessed outside a reactive context\n */\n this.observableRequiresReaction = false;\n /**\n * Allows overwriting of computed properties, useful in tests but not prod as it can cause\n * memory leaks. See https://github.com/mobxjs/mobx/issues/1867\n */\n this.computedConfigurable = false;\n /*\n * Don't catch and rethrow exceptions. This is useful for inspecting the state of\n * the stack when an exception occurs while debugging.\n */\n this.disableErrorBoundaries = false;\n /*\n * If true, we are already handling an exception in an action. Any errors in reactions should be supressed, as\n * they are not the cause, see: https://github.com/mobxjs/mobx/issues/1836\n */\n this.suppressReactionErrors = false;\n }\n return MobXGlobals;\n}());\nvar canMergeGlobalState = true;\nvar isolateCalled = false;\nvar globalState = (function () {\n var global = getGlobal();\n if (global.__mobxInstanceCount > 0 && !global.__mobxGlobals)\n canMergeGlobalState = false;\n if (global.__mobxGlobals && global.__mobxGlobals.version !== new MobXGlobals().version)\n canMergeGlobalState = false;\n if (!canMergeGlobalState) {\n setTimeout(function () {\n if (!isolateCalled) {\n fail(\"There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`\");\n }\n }, 1);\n return new MobXGlobals();\n }\n else if (global.__mobxGlobals) {\n global.__mobxInstanceCount += 1;\n if (!global.__mobxGlobals.UNCHANGED)\n global.__mobxGlobals.UNCHANGED = {}; // make merge backward compatible\n return global.__mobxGlobals;\n }\n else {\n global.__mobxInstanceCount = 1;\n return (global.__mobxGlobals = new MobXGlobals());\n }\n})();\nfunction isolateGlobalState() {\n if (globalState.pendingReactions.length ||\n globalState.inBatch ||\n globalState.isRunningReactions)\n fail(\"isolateGlobalState should be called before MobX is running any reactions\");\n isolateCalled = true;\n if (canMergeGlobalState) {\n if (--getGlobal().__mobxInstanceCount === 0)\n getGlobal().__mobxGlobals = undefined;\n globalState = new MobXGlobals();\n }\n}\nfunction getGlobalState() {\n return globalState;\n}\n/**\n * For testing purposes only; this will break the internal state of existing observables,\n * but can be used to get back at a stable state after throwing errors\n */\nfunction resetGlobalState() {\n var defaultGlobals = new MobXGlobals();\n for (var key in defaultGlobals)\n if (persistentKeys.indexOf(key) === -1)\n globalState[key] = defaultGlobals[key];\n globalState.allowStateChanges = !globalState.enforceActions;\n}\n\nfunction hasObservers(observable) {\n return observable.observers && observable.observers.length > 0;\n}\nfunction getObservers(observable) {\n return observable.observers;\n}\n// function invariantObservers(observable: IObservable) {\n// const list = observable.observers\n// const map = observable.observersIndexes\n// const l = list.length\n// for (let i = 0; i < l; i++) {\n// const id = list[i].__mapid\n// if (i) {\n// invariant(map[id] === i, \"INTERNAL ERROR maps derivation.__mapid to index in list\") // for performance\n// } else {\n// invariant(!(id in map), \"INTERNAL ERROR observer on index 0 shouldn't be held in map.\") // for performance\n// }\n// }\n// invariant(\n// list.length === 0 || Object.keys(map).length === list.length - 1,\n// \"INTERNAL ERROR there is no junk in map\"\n// )\n// }\nfunction addObserver(observable, node) {\n // invariant(node.dependenciesState !== -1, \"INTERNAL ERROR, can add only dependenciesState !== -1\");\n // invariant(observable._observers.indexOf(node) === -1, \"INTERNAL ERROR add already added node\");\n // invariantObservers(observable);\n var l = observable.observers.length;\n if (l) {\n // because object assignment is relatively expensive, let's not store data about index 0.\n observable.observersIndexes[node.__mapid] = l;\n }\n observable.observers[l] = node;\n if (observable.lowestObserverState > node.dependenciesState)\n observable.lowestObserverState = node.dependenciesState;\n // invariantObservers(observable);\n // invariant(observable._observers.indexOf(node) !== -1, \"INTERNAL ERROR didn't add node\");\n}\nfunction removeObserver(observable, node) {\n // invariant(globalState.inBatch > 0, \"INTERNAL ERROR, remove should be called only inside batch\");\n // invariant(observable._observers.indexOf(node) !== -1, \"INTERNAL ERROR remove already removed node\");\n // invariantObservers(observable);\n if (observable.observers.length === 1) {\n // deleting last observer\n observable.observers.length = 0;\n queueForUnobservation(observable);\n }\n else {\n // deleting from _observersIndexes is straight forward, to delete from _observers, let's swap `node` with last element\n var list = observable.observers;\n var map = observable.observersIndexes;\n var filler = list.pop(); // get last element, which should fill the place of `node`, so the array doesn't have holes\n if (filler !== node) {\n // otherwise node was the last element, which already got removed from array\n var index = map[node.__mapid] || 0; // getting index of `node`. this is the only place we actually use map.\n if (index) {\n // map store all indexes but 0, see comment in `addObserver`\n map[filler.__mapid] = index;\n }\n else {\n delete map[filler.__mapid];\n }\n list[index] = filler;\n }\n delete map[node.__mapid];\n }\n // invariantObservers(observable);\n // invariant(observable._observers.indexOf(node) === -1, \"INTERNAL ERROR remove already removed node2\");\n}\nfunction queueForUnobservation(observable) {\n if (observable.isPendingUnobservation === false) {\n // invariant(observable._observers.length === 0, \"INTERNAL ERROR, should only queue for unobservation unobserved observables\");\n observable.isPendingUnobservation = true;\n globalState.pendingUnobservations.push(observable);\n }\n}\n/**\n * Batch starts a transaction, at least for purposes of memoizing ComputedValues when nothing else does.\n * During a batch `onBecomeUnobserved` will be called at most once per observable.\n * Avoids unnecessary recalculations.\n */\nfunction startBatch() {\n globalState.inBatch++;\n}\nfunction endBatch() {\n if (--globalState.inBatch === 0) {\n runReactions();\n // the batch is actually about to finish, all unobserving should happen here.\n var list = globalState.pendingUnobservations;\n for (var i = 0; i < list.length; i++) {\n var observable = list[i];\n observable.isPendingUnobservation = false;\n if (observable.observers.length === 0) {\n if (observable.isBeingObserved) {\n // if this observable had reactive observers, trigger the hooks\n observable.isBeingObserved = false;\n observable.onBecomeUnobserved();\n }\n if (observable instanceof ComputedValue) {\n // computed values are automatically teared down when the last observer leaves\n // this process happens recursively, this computed might be the last observable of another, etc..\n observable.suspend();\n }\n }\n }\n globalState.pendingUnobservations = [];\n }\n}\nfunction reportObserved(observable) {\n checkIfStateReadsAreAllowed(observable);\n var derivation = globalState.trackingDerivation;\n if (derivation !== null) {\n /**\n * Simple optimization, give each derivation run an unique id (runId)\n * Check if last time this observable was accessed the same runId is used\n * if this is the case, the relation is already known\n */\n if (derivation.runId !== observable.lastAccessedBy) {\n observable.lastAccessedBy = derivation.runId;\n derivation.newObserving[derivation.unboundDepsCount++] = observable;\n if (!observable.isBeingObserved) {\n observable.isBeingObserved = true;\n observable.onBecomeObserved();\n }\n }\n return true;\n }\n else if (observable.observers.length === 0 && globalState.inBatch > 0) {\n queueForUnobservation(observable);\n }\n return false;\n}\n// function invariantLOS(observable: IObservable, msg: string) {\n// // it's expensive so better not run it in produciton. but temporarily helpful for testing\n// const min = getObservers(observable).reduce((a, b) => Math.min(a, b.dependenciesState), 2)\n// if (min >= observable.lowestObserverState) return // <- the only assumption about `lowestObserverState`\n// throw new Error(\n// \"lowestObserverState is wrong for \" +\n// msg +\n// \" because \" +\n// min +\n// \" < \" +\n// observable.lowestObserverState\n// )\n// }\n/**\n * NOTE: current propagation mechanism will in case of self reruning autoruns behave unexpectedly\n * It will propagate changes to observers from previous run\n * It's hard or maybe impossible (with reasonable perf) to get it right with current approach\n * Hopefully self reruning autoruns aren't a feature people should depend on\n * Also most basic use cases should be ok\n */\n// Called by Atom when its value changes\nfunction propagateChanged(observable) {\n // invariantLOS(observable, \"changed start\");\n if (observable.lowestObserverState === IDerivationState.STALE)\n return;\n observable.lowestObserverState = IDerivationState.STALE;\n var observers = observable.observers;\n var i = observers.length;\n while (i--) {\n var d = observers[i];\n if (d.dependenciesState === IDerivationState.UP_TO_DATE) {\n if (d.isTracing !== TraceMode.NONE) {\n logTraceInfo(d, observable);\n }\n d.onBecomeStale();\n }\n d.dependenciesState = IDerivationState.STALE;\n }\n // invariantLOS(observable, \"changed end\");\n}\n// Called by ComputedValue when it recalculate and its value changed\nfunction propagateChangeConfirmed(observable) {\n // invariantLOS(observable, \"confirmed start\");\n if (observable.lowestObserverState === IDerivationState.STALE)\n return;\n observable.lowestObserverState = IDerivationState.STALE;\n var observers = observable.observers;\n var i = observers.length;\n while (i--) {\n var d = observers[i];\n if (d.dependenciesState === IDerivationState.POSSIBLY_STALE)\n d.dependenciesState = IDerivationState.STALE;\n else if (d.dependenciesState === IDerivationState.UP_TO_DATE // this happens during computing of `d`, just keep lowestObserverState up to date.\n )\n observable.lowestObserverState = IDerivationState.UP_TO_DATE;\n }\n // invariantLOS(observable, \"confirmed end\");\n}\n// Used by computed when its dependency changed, but we don't wan't to immediately recompute.\nfunction propagateMaybeChanged(observable) {\n // invariantLOS(observable, \"maybe start\");\n if (observable.lowestObserverState !== IDerivationState.UP_TO_DATE)\n return;\n observable.lowestObserverState = IDerivationState.POSSIBLY_STALE;\n var observers = observable.observers;\n var i = observers.length;\n while (i--) {\n var d = observers[i];\n if (d.dependenciesState === IDerivationState.UP_TO_DATE) {\n d.dependenciesState = IDerivationState.POSSIBLY_STALE;\n if (d.isTracing !== TraceMode.NONE) {\n logTraceInfo(d, observable);\n }\n d.onBecomeStale();\n }\n }\n // invariantLOS(observable, \"maybe end\");\n}\nfunction logTraceInfo(derivation, observable) {\n console.log(\"[mobx.trace] '\" + derivation.name + \"' is invalidated due to a change in: '\" + observable.name + \"'\");\n if (derivation.isTracing === TraceMode.BREAK) {\n var lines = [];\n printDepTree(getDependencyTree(derivation), lines, 1);\n // prettier-ignore\n new Function(\"debugger;\\n/*\\nTracing '\" + derivation.name + \"'\\n\\nYou are entering this break point because derivation '\" + derivation.name + \"' is being traced and '\" + observable.name + \"' is now forcing it to update.\\nJust follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update\\nThe stackframe you are looking for is at least ~6-8 stack-frames up.\\n\\n\" + (derivation instanceof ComputedValue ? derivation.derivation.toString().replace(/[*]\\//g, \"/\") : \"\") + \"\\n\\nThe dependencies for this derivation are:\\n\\n\" + lines.join(\"\\n\") + \"\\n*/\\n \")();\n }\n}\nfunction printDepTree(tree, lines, depth) {\n if (lines.length >= 1000) {\n lines.push(\"(and many more)\");\n return;\n }\n lines.push(\"\" + new Array(depth).join(\"\\t\") + tree.name); // MWE: not the fastest, but the easiest way :)\n if (tree.dependencies)\n tree.dependencies.forEach(function (child) { return printDepTree(child, lines, depth + 1); });\n}\n\nvar Reaction = /** @class */ (function () {\n function Reaction(name, onInvalidate, errorHandler, requiresObservable) {\n if (name === void 0) { name = \"Reaction@\" + getNextId(); }\n if (requiresObservable === void 0) { requiresObservable = false; }\n this.name = name;\n this.onInvalidate = onInvalidate;\n this.errorHandler = errorHandler;\n this.requiresObservable = requiresObservable;\n this.observing = []; // nodes we are looking at. Our value depends on these nodes\n this.newObserving = [];\n this.dependenciesState = IDerivationState.NOT_TRACKING;\n this.diffValue = 0;\n this.runId = 0;\n this.unboundDepsCount = 0;\n this.__mapid = \"#\" + getNextId();\n this.isDisposed = false;\n this._isScheduled = false;\n this._isTrackPending = false;\n this._isRunning = false;\n this.isTracing = TraceMode.NONE;\n }\n Reaction.prototype.onBecomeStale = function () {\n this.schedule();\n };\n Reaction.prototype.schedule = function () {\n if (!this._isScheduled) {\n this._isScheduled = true;\n globalState.pendingReactions.push(this);\n runReactions();\n }\n };\n Reaction.prototype.isScheduled = function () {\n return this._isScheduled;\n };\n /**\n * internal, use schedule() if you intend to kick off a reaction\n */\n Reaction.prototype.runReaction = function () {\n if (!this.isDisposed) {\n startBatch();\n this._isScheduled = false;\n if (shouldCompute(this)) {\n this._isTrackPending = true;\n try {\n this.onInvalidate();\n if (this._isTrackPending && isSpyEnabled()) {\n // onInvalidate didn't trigger track right away..\n spyReport({\n name: this.name,\n type: \"scheduled-reaction\"\n });\n }\n }\n catch (e) {\n this.reportExceptionInDerivation(e);\n }\n }\n endBatch();\n }\n };\n Reaction.prototype.track = function (fn) {\n startBatch();\n var notify = isSpyEnabled();\n var startTime;\n if (notify) {\n startTime = Date.now();\n spyReportStart({\n name: this.name,\n type: \"reaction\"\n });\n }\n this._isRunning = true;\n var result = trackDerivedFunction(this, fn, undefined);\n this._isRunning = false;\n this._isTrackPending = false;\n if (this.isDisposed) {\n // disposed during last run. Clean up everything that was bound after the dispose call.\n clearObserving(this);\n }\n if (isCaughtException(result))\n this.reportExceptionInDerivation(result.cause);\n if (notify) {\n spyReportEnd({\n time: Date.now() - startTime\n });\n }\n endBatch();\n };\n Reaction.prototype.reportExceptionInDerivation = function (error) {\n var _this = this;\n if (this.errorHandler) {\n this.errorHandler(error, this);\n return;\n }\n if (globalState.disableErrorBoundaries)\n throw error;\n var message = \"[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '\" + this + \"'\";\n if (globalState.suppressReactionErrors) {\n console.warn(\"[mobx] (error in reaction '\" + this.name + \"' suppressed, fix error of causing action below)\"); // prettier-ignore\n }\n else {\n console.error(message, error);\n /** If debugging brought you here, please, read the above message :-). Tnx! */\n }\n if (isSpyEnabled()) {\n spyReport({\n type: \"error\",\n name: this.name,\n message: message,\n error: \"\" + error\n });\n }\n globalState.globalReactionErrorHandlers.forEach(function (f) { return f(error, _this); });\n };\n Reaction.prototype.dispose = function () {\n if (!this.isDisposed) {\n this.isDisposed = true;\n if (!this._isRunning) {\n // if disposed while running, clean up later. Maybe not optimal, but rare case\n startBatch();\n clearObserving(this);\n endBatch();\n }\n }\n };\n Reaction.prototype.getDisposer = function () {\n var r = this.dispose.bind(this);\n r.$mobx = this;\n return r;\n };\n Reaction.prototype.toString = function () {\n return \"Reaction[\" + this.name + \"]\";\n };\n Reaction.prototype.trace = function (enterBreakPoint) {\n if (enterBreakPoint === void 0) { enterBreakPoint = false; }\n trace(this, enterBreakPoint);\n };\n return Reaction;\n}());\nfunction onReactionError(handler) {\n globalState.globalReactionErrorHandlers.push(handler);\n return function () {\n var idx = globalState.globalReactionErrorHandlers.indexOf(handler);\n if (idx >= 0)\n globalState.globalReactionErrorHandlers.splice(idx, 1);\n };\n}\n/**\n * Magic number alert!\n * Defines within how many times a reaction is allowed to re-trigger itself\n * until it is assumed that this is gonna be a never ending loop...\n */\nvar MAX_REACTION_ITERATIONS = 100;\nvar reactionScheduler = function (f) { return f(); };\nfunction runReactions() {\n // Trampolining, if runReactions are already running, new reactions will be picked up\n if (globalState.inBatch > 0 || globalState.isRunningReactions)\n return;\n reactionScheduler(runReactionsHelper);\n}\nfunction runReactionsHelper() {\n globalState.isRunningReactions = true;\n var allReactions = globalState.pendingReactions;\n var iterations = 0;\n // While running reactions, new reactions might be triggered.\n // Hence we work with two variables and check whether\n // we converge to no remaining reactions after a while.\n while (allReactions.length > 0) {\n if (++iterations === MAX_REACTION_ITERATIONS) {\n console.error(\"Reaction doesn't converge to a stable state after \" + MAX_REACTION_ITERATIONS + \" iterations.\" +\n (\" Probably there is a cycle in the reactive function: \" + allReactions[0]));\n allReactions.splice(0); // clear reactions\n }\n var remainingReactions = allReactions.splice(0);\n for (var i = 0, l = remainingReactions.length; i < l; i++)\n remainingReactions[i].runReaction();\n }\n globalState.isRunningReactions = false;\n}\nvar isReaction = createInstanceofPredicate(\"Reaction\", Reaction);\nfunction setReactionScheduler(fn) {\n var baseScheduler = reactionScheduler;\n reactionScheduler = function (f) { return fn(function () { return baseScheduler(f); }); };\n}\n\nfunction isSpyEnabled() {\n return !!globalState.spyListeners.length;\n}\nfunction spyReport(event) {\n if (!globalState.spyListeners.length)\n return;\n var listeners = globalState.spyListeners;\n for (var i = 0, l = listeners.length; i < l; i++)\n listeners[i](event);\n}\nfunction spyReportStart(event) {\n var change = __assign(__assign({}, event), { spyReportStart: true });\n spyReport(change);\n}\nvar END_EVENT = { spyReportEnd: true };\nfunction spyReportEnd(change) {\n if (change)\n spyReport(__assign(__assign({}, change), { spyReportEnd: true }));\n else\n spyReport(END_EVENT);\n}\nfunction spy(listener) {\n globalState.spyListeners.push(listener);\n return once(function () {\n globalState.spyListeners = globalState.spyListeners.filter(function (l) { return l !== listener; });\n });\n}\n\nfunction dontReassignFields() {\n fail(process.env.NODE_ENV !== \"production\" && \"@action fields are not reassignable\");\n}\nfunction namedActionDecorator(name) {\n return function (target, prop, descriptor) {\n if (descriptor) {\n if (process.env.NODE_ENV !== \"production\" && descriptor.get !== undefined) {\n return fail(\"@action cannot be used with getters\");\n }\n // babel / typescript\n // @action method() { }\n if (descriptor.value) {\n // typescript\n return {\n value: createAction(name, descriptor.value),\n enumerable: false,\n configurable: true,\n writable: true // for typescript, this must be writable, otherwise it cannot inherit :/ (see inheritable actions test)\n };\n }\n // babel only: @action method = () => {}\n var initializer_1 = descriptor.initializer;\n return {\n enumerable: false,\n configurable: true,\n writable: true,\n initializer: function () {\n // N.B: we can't immediately invoke initializer; this would be wrong\n return createAction(name, initializer_1.call(this));\n }\n };\n }\n // bound instance methods\n return actionFieldDecorator(name).apply(this, arguments);\n };\n}\nfunction actionFieldDecorator(name) {\n // Simple property that writes on first invocation to the current instance\n return function (target, prop, descriptor) {\n Object.defineProperty(target, prop, {\n configurable: true,\n enumerable: false,\n get: function () {\n return undefined;\n },\n set: function (value) {\n addHiddenProp(this, prop, action(name, value));\n }\n });\n };\n}\nfunction boundActionDecorator(target, propertyName, descriptor, applyToInstance) {\n if (applyToInstance === true) {\n defineBoundAction(target, propertyName, descriptor.value);\n return null;\n }\n if (descriptor) {\n // if (descriptor.value)\n // Typescript / Babel: @action.bound method() { }\n // also: babel @action.bound method = () => {}\n return {\n configurable: true,\n enumerable: false,\n get: function () {\n defineBoundAction(this, propertyName, descriptor.value || descriptor.initializer.call(this));\n return this[propertyName];\n },\n set: dontReassignFields\n };\n }\n // field decorator Typescript @action.bound method = () => {}\n return {\n enumerable: false,\n configurable: true,\n set: function (v) {\n defineBoundAction(this, propertyName, v);\n },\n get: function () {\n return undefined;\n }\n };\n}\n\nvar action = function action(arg1, arg2, arg3, arg4) {\n // action(fn() {})\n if (arguments.length === 1 && typeof arg1 === \"function\")\n return createAction(arg1.name || \"\", arg1);\n // action(\"name\", fn() {})\n if (arguments.length === 2 && typeof arg2 === \"function\")\n return createAction(arg1, arg2);\n // @action(\"name\") fn() {}\n if (arguments.length === 1 && typeof arg1 === \"string\")\n return namedActionDecorator(arg1);\n // @action fn() {}\n if (arg4 === true) {\n // apply to instance immediately\n arg1[arg2] = createAction(arg1.name || arg2, arg3.value);\n }\n else {\n return namedActionDecorator(arg2).apply(null, arguments);\n }\n};\naction.bound = boundActionDecorator;\nfunction runInAction(arg1, arg2) {\n // TODO: deprecate?\n var actionName = typeof arg1 === \"string\" ? arg1 : arg1.name || \"\";\n var fn = typeof arg1 === \"function\" ? arg1 : arg2;\n if (process.env.NODE_ENV !== \"production\") {\n invariant(typeof fn === \"function\" && fn.length === 0, \"`runInAction` expects a function without arguments\");\n if (typeof actionName !== \"string\" || !actionName)\n fail(\"actions should have valid names, got: '\" + actionName + \"'\");\n }\n return executeAction(actionName, fn, this, undefined);\n}\nfunction isAction(thing) {\n return typeof thing === \"function\" && thing.isMobxAction === true;\n}\nfunction defineBoundAction(target, propertyName, fn) {\n addHiddenProp(target, propertyName, createAction(propertyName, fn.bind(target)));\n}\n\n/**\n * Creates a named reactive view and keeps it alive, so that the view is always\n * updated if one of the dependencies changes, even when the view is not further used by something else.\n * @param view The reactive view\n * @returns disposer function, which can be used to stop the view from being updated in the future.\n */\nfunction autorun(view, opts) {\n if (opts === void 0) { opts = EMPTY_OBJECT; }\n if (process.env.NODE_ENV !== \"production\") {\n invariant(typeof view === \"function\", \"Autorun expects a function as first argument\");\n invariant(isAction(view) === false, \"Autorun does not accept actions since actions are untrackable\");\n }\n var name = (opts && opts.name) || view.name || \"Autorun@\" + getNextId();\n var runSync = !opts.scheduler && !opts.delay;\n var reaction;\n if (runSync) {\n // normal autorun\n reaction = new Reaction(name, function () {\n this.track(reactionRunner);\n }, opts.onError, opts.requiresObservable);\n }\n else {\n var scheduler_1 = createSchedulerFromOptions(opts);\n // debounced autorun\n var isScheduled_1 = false;\n reaction = new Reaction(name, function () {\n if (!isScheduled_1) {\n isScheduled_1 = true;\n scheduler_1(function () {\n isScheduled_1 = false;\n if (!reaction.isDisposed)\n reaction.track(reactionRunner);\n });\n }\n }, opts.onError, opts.requiresObservable);\n }\n function reactionRunner() {\n view(reaction);\n }\n reaction.schedule();\n return reaction.getDisposer();\n}\nvar run = function (f) { return f(); };\nfunction createSchedulerFromOptions(opts) {\n return opts.scheduler\n ? opts.scheduler\n : opts.delay\n ? function (f) { return setTimeout(f, opts.delay); }\n : run;\n}\nfunction reaction(expression, effect, opts) {\n if (opts === void 0) { opts = EMPTY_OBJECT; }\n if (typeof opts === \"boolean\") {\n opts = { fireImmediately: opts };\n deprecated(\"Using fireImmediately as argument is deprecated. Use '{ fireImmediately: true }' instead\");\n }\n if (process.env.NODE_ENV !== \"production\") {\n invariant(typeof expression === \"function\", \"First argument to reaction should be a function\");\n invariant(typeof opts === \"object\", \"Third argument of reactions should be an object\");\n }\n var name = opts.name || \"Reaction@\" + getNextId();\n var effectAction = action(name, opts.onError ? wrapErrorHandler(opts.onError, effect) : effect);\n var runSync = !opts.scheduler && !opts.delay;\n var scheduler = createSchedulerFromOptions(opts);\n var firstTime = true;\n var isScheduled = false;\n var value;\n var equals = opts.compareStructural\n ? comparer.structural\n : opts.equals || comparer.default;\n var r = new Reaction(name, function () {\n if (firstTime || runSync) {\n reactionRunner();\n }\n else if (!isScheduled) {\n isScheduled = true;\n scheduler(reactionRunner);\n }\n }, opts.onError, opts.requiresObservable);\n function reactionRunner() {\n isScheduled = false; // Q: move into reaction runner?\n if (r.isDisposed)\n return;\n var changed = false;\n r.track(function () {\n var nextValue = expression(r);\n changed = firstTime || !equals(value, nextValue);\n value = nextValue;\n });\n if (firstTime && opts.fireImmediately)\n effectAction(value, r);\n if (!firstTime && changed === true)\n effectAction(value, r);\n if (firstTime)\n firstTime = false;\n }\n r.schedule();\n return r.getDisposer();\n}\nfunction wrapErrorHandler(errorHandler, baseFn) {\n return function () {\n try {\n return baseFn.apply(this, arguments);\n }\n catch (e) {\n errorHandler.call(this, e);\n }\n };\n}\n\nfunction onBecomeObserved(thing, arg2, arg3) {\n return interceptHook(\"onBecomeObserved\", thing, arg2, arg3);\n}\nfunction onBecomeUnobserved(thing, arg2, arg3) {\n return interceptHook(\"onBecomeUnobserved\", thing, arg2, arg3);\n}\nfunction interceptHook(hook, thing, arg2, arg3) {\n var atom = typeof arg3 === \"function\" ? getAtom(thing, arg2) : getAtom(thing);\n var cb = typeof arg3 === \"function\" ? arg3 : arg2;\n var orig = atom[hook];\n if (typeof orig !== \"function\")\n return fail(process.env.NODE_ENV !== \"production\" && \"Not an atom that can be (un)observed\");\n atom[hook] = function () {\n orig.call(this);\n cb.call(this);\n };\n return function () {\n atom[hook] = orig;\n };\n}\n\nfunction configure(options) {\n var enforceActions = options.enforceActions, computedRequiresReaction = options.computedRequiresReaction, computedConfigurable = options.computedConfigurable, disableErrorBoundaries = options.disableErrorBoundaries, arrayBuffer = options.arrayBuffer, reactionScheduler = options.reactionScheduler, reactionRequiresObservable = options.reactionRequiresObservable, observableRequiresReaction = options.observableRequiresReaction;\n if (options.isolateGlobalState === true) {\n isolateGlobalState();\n }\n if (enforceActions !== undefined) {\n if (typeof enforceActions === \"boolean\" || enforceActions === \"strict\")\n deprecated(\"Deprecated value for 'enforceActions', use 'false' => '\\\"never\\\"', 'true' => '\\\"observed\\\"', '\\\"strict\\\"' => \\\"'always'\\\" instead\");\n var ea = void 0;\n switch (enforceActions) {\n case true:\n case \"observed\":\n ea = true;\n break;\n case false:\n case \"never\":\n ea = false;\n break;\n case \"strict\":\n case \"always\":\n ea = \"strict\";\n break;\n default:\n fail(\"Invalid value for 'enforceActions': '\" + enforceActions + \"', expected 'never', 'always' or 'observed'\");\n }\n globalState.enforceActions = ea;\n globalState.allowStateChanges = ea === true || ea === \"strict\" ? false : true;\n }\n if (computedRequiresReaction !== undefined) {\n globalState.computedRequiresReaction = !!computedRequiresReaction;\n }\n if (reactionRequiresObservable !== undefined) {\n globalState.reactionRequiresObservable = !!reactionRequiresObservable;\n }\n if (observableRequiresReaction !== undefined) {\n globalState.observableRequiresReaction = !!observableRequiresReaction;\n globalState.allowStateReads = !globalState.observableRequiresReaction;\n }\n if (computedConfigurable !== undefined) {\n globalState.computedConfigurable = !!computedConfigurable;\n }\n if (disableErrorBoundaries !== undefined) {\n if (disableErrorBoundaries === true)\n console.warn(\"WARNING: Debug feature only. MobX will NOT recover from errors if this is on.\");\n globalState.disableErrorBoundaries = !!disableErrorBoundaries;\n }\n if (typeof arrayBuffer === \"number\") {\n reserveArrayBuffer(arrayBuffer);\n }\n if (reactionScheduler) {\n setReactionScheduler(reactionScheduler);\n }\n}\n\nfunction decorate(thing, decorators) {\n if (process.env.NODE_ENV !== \"production\" && !isPlainObject(decorators))\n fail(\"Decorators should be a key value map\");\n var target = typeof thing === \"function\" ? thing.prototype : thing;\n var _loop_1 = function (prop) {\n var propertyDecorators = decorators[prop];\n if (!Array.isArray(propertyDecorators)) {\n propertyDecorators = [propertyDecorators];\n }\n // prettier-ignore\n if (process.env.NODE_ENV !== \"production\" && !propertyDecorators.every(function (decorator) { return typeof decorator === \"function\"; }))\n fail(\"Decorate: expected a decorator function or array of decorator functions for '\" + prop + \"'\");\n var descriptor = Object.getOwnPropertyDescriptor(target, prop);\n var newDescriptor = propertyDecorators.reduce(function (accDescriptor, decorator) { return decorator(target, prop, accDescriptor); }, descriptor);\n if (newDescriptor)\n Object.defineProperty(target, prop, newDescriptor);\n };\n for (var prop in decorators) {\n _loop_1(prop);\n }\n return thing;\n}\n\nfunction extendShallowObservable(target, properties, decorators) {\n deprecated(\"'extendShallowObservable' is deprecated, use 'extendObservable(target, props, { deep: false })' instead\");\n return extendObservable(target, properties, decorators, shallowCreateObservableOptions);\n}\nfunction extendObservable(target, properties, decorators, options) {\n if (process.env.NODE_ENV !== \"production\") {\n invariant(arguments.length >= 2 && arguments.length <= 4, \"'extendObservable' expected 2-4 arguments\");\n invariant(typeof target === \"object\", \"'extendObservable' expects an object as first argument\");\n invariant(!isObservableMap(target), \"'extendObservable' should not be used on maps, use map.merge instead\");\n invariant(!isObservable(properties), \"Extending an object with another observable (object) is not supported. Please construct an explicit propertymap, using `toJS` if need. See issue #540\");\n if (decorators)\n for (var key in decorators)\n if (!(key in properties))\n fail(\"Trying to declare a decorator for unspecified property '\" + key + \"'\");\n }\n options = asCreateObservableOptions(options);\n var defaultDecorator = options.defaultDecorator || (options.deep === false ? refDecorator : deepDecorator);\n initializeInstance(target);\n asObservableObject(target, options.name, defaultDecorator.enhancer); // make sure object is observable, even without initial props\n startBatch();\n try {\n var keys = Object.getOwnPropertyNames(properties);\n for (var i = 0, l = keys.length; i < l; i++) {\n var key = keys[i];\n var descriptor = Object.getOwnPropertyDescriptor(properties, key);\n if (process.env.NODE_ENV !== \"production\") {\n if (isComputed(descriptor.value))\n fail(\"Passing a 'computed' as initial property value is no longer supported by extendObservable. Use a getter or decorator instead\");\n }\n var decorator = decorators && key in decorators\n ? decorators[key]\n : descriptor.get\n ? computedDecorator\n : defaultDecorator;\n if (process.env.NODE_ENV !== \"production\" && typeof decorator !== \"function\")\n return fail(\"Not a valid decorator for '\" + key + \"', got: \" + decorator);\n var resultDescriptor = decorator(target, key, descriptor, true);\n if (resultDescriptor // otherwise, assume already applied, due to `applyToInstance`\n )\n Object.defineProperty(target, key, resultDescriptor);\n }\n }\n finally {\n endBatch();\n }\n return target;\n}\n\nfunction getDependencyTree(thing, property) {\n return nodeToDependencyTree(getAtom(thing, property));\n}\nfunction nodeToDependencyTree(node) {\n var result = {\n name: node.name\n };\n if (node.observing && node.observing.length > 0)\n result.dependencies = unique(node.observing).map(nodeToDependencyTree);\n return result;\n}\nfunction getObserverTree(thing, property) {\n return nodeToObserverTree(getAtom(thing, property));\n}\nfunction nodeToObserverTree(node) {\n var result = {\n name: node.name\n };\n if (hasObservers(node))\n result.observers = getObservers(node).map(nodeToObserverTree);\n return result;\n}\n\nvar generatorId = 0;\nfunction FlowCancellationError() {\n this.message = \"FLOW_CANCELLED\";\n}\nFlowCancellationError.prototype = Object.create(Error.prototype);\nfunction isFlowCancellationError(error) {\n return error instanceof FlowCancellationError;\n}\nfunction flow(generator) {\n if (arguments.length !== 1)\n fail(!!process.env.NODE_ENV && \"Flow expects one 1 argument and cannot be used as decorator\");\n var name = generator.name || \"\";\n // Implementation based on https://github.com/tj/co/blob/master/index.js\n return function () {\n var ctx = this;\n var args = arguments;\n var runId = ++generatorId;\n var gen = action(name + \" - runid: \" + runId + \" - init\", generator).apply(ctx, args);\n var rejector;\n var pendingPromise = undefined;\n var res = new Promise(function (resolve, reject) {\n var stepId = 0;\n rejector = reject;\n function onFulfilled(res) {\n pendingPromise = undefined;\n var ret;\n try {\n ret = action(name + \" - runid: \" + runId + \" - yield \" + stepId++, gen.next).call(gen, res);\n }\n catch (e) {\n return reject(e);\n }\n next(ret);\n }\n function onRejected(err) {\n pendingPromise = undefined;\n var ret;\n try {\n ret = action(name + \" - runid: \" + runId + \" - yield \" + stepId++, gen.throw).call(gen, err);\n }\n catch (e) {\n return reject(e);\n }\n next(ret);\n }\n function next(ret) {\n if (ret && typeof ret.then === \"function\") {\n // an async iterator\n ret.then(next, reject);\n return;\n }\n if (ret.done)\n return resolve(ret.value);\n pendingPromise = Promise.resolve(ret.value);\n return pendingPromise.then(onFulfilled, onRejected);\n }\n onFulfilled(undefined); // kick off the process\n });\n res.cancel = action(name + \" - runid: \" + runId + \" - cancel\", function () {\n try {\n if (pendingPromise)\n cancelPromise(pendingPromise);\n // Finally block can return (or yield) stuff..\n var res_1 = gen.return(undefined);\n // eat anything that promise would do, it's cancelled!\n var yieldedPromise = Promise.resolve(res_1.value);\n yieldedPromise.then(noop, noop);\n cancelPromise(yieldedPromise); // maybe it can be cancelled :)\n // reject our original promise\n rejector(new FlowCancellationError());\n }\n catch (e) {\n rejector(e); // there could be a throwing finally block\n }\n });\n return res;\n };\n}\nfunction cancelPromise(promise) {\n if (typeof promise.cancel === \"function\")\n promise.cancel();\n}\n\nfunction interceptReads(thing, propOrHandler, handler) {\n var target;\n if (isObservableMap(thing) || isObservableArray(thing) || isObservableValue(thing)) {\n target = getAdministration(thing);\n }\n else if (isObservableObject(thing)) {\n if (typeof propOrHandler !== \"string\")\n return fail(process.env.NODE_ENV !== \"production\" &&\n \"InterceptReads can only be used with a specific property, not with an object in general\");\n target = getAdministration(thing, propOrHandler);\n }\n else {\n return fail(process.env.NODE_ENV !== \"production\" &&\n \"Expected observable map, object or array as first array\");\n }\n if (target.dehancer !== undefined)\n return fail(process.env.NODE_ENV !== \"production\" && \"An intercept reader was already established\");\n target.dehancer = typeof propOrHandler === \"function\" ? propOrHandler : handler;\n return function () {\n target.dehancer = undefined;\n };\n}\n\nfunction intercept(thing, propOrHandler, handler) {\n if (typeof handler === \"function\")\n return interceptProperty(thing, propOrHandler, handler);\n else\n return interceptInterceptable(thing, propOrHandler);\n}\nfunction interceptInterceptable(thing, handler) {\n return getAdministration(thing).intercept(handler);\n}\nfunction interceptProperty(thing, property, handler) {\n return getAdministration(thing, property).intercept(handler);\n}\n\nfunction _isComputed(value, property) {\n if (value === null || value === undefined)\n return false;\n if (property !== undefined) {\n if (isObservableObject(value) === false)\n return false;\n if (!value.$mobx.values[property])\n return false;\n var atom = getAtom(value, property);\n return isComputedValue(atom);\n }\n return isComputedValue(value);\n}\nfunction isComputed(value) {\n if (arguments.length > 1)\n return fail(process.env.NODE_ENV !== \"production\" &&\n \"isComputed expects only 1 argument. Use isObservableProp to inspect the observability of a property\");\n return _isComputed(value);\n}\nfunction isComputedProp(value, propName) {\n if (typeof propName !== \"string\")\n return fail(process.env.NODE_ENV !== \"production\" &&\n \"isComputed expected a property name as second argument\");\n return _isComputed(value, propName);\n}\n\nfunction _isObservable(value, property) {\n if (value === null || value === undefined)\n return false;\n if (property !== undefined) {\n if (process.env.NODE_ENV !== \"production\" &&\n (isObservableMap(value) || isObservableArray(value)))\n return fail(\"isObservable(object, propertyName) is not supported for arrays and maps. Use map.has or array.length instead.\");\n if (isObservableObject(value)) {\n var o = value.$mobx;\n return o.values && !!o.values[property];\n }\n return false;\n }\n // For first check, see #701\n return (isObservableObject(value) ||\n !!value.$mobx ||\n isAtom(value) ||\n isReaction(value) ||\n isComputedValue(value));\n}\nfunction isObservable(value) {\n if (arguments.length !== 1)\n fail(process.env.NODE_ENV !== \"production\" &&\n \"isObservable expects only 1 argument. Use isObservableProp to inspect the observability of a property\");\n return _isObservable(value);\n}\nfunction isObservableProp(value, propName) {\n if (typeof propName !== \"string\")\n return fail(process.env.NODE_ENV !== \"production\" && \"expected a property name as second argument\");\n return _isObservable(value, propName);\n}\n\nfunction keys(obj) {\n if (isObservableObject(obj)) {\n return obj.$mobx.getKeys();\n }\n if (isObservableMap(obj)) {\n return iteratorToArray(obj.keys());\n }\n if (isObservableSet(obj)) {\n return iteratorToArray(obj.keys());\n }\n if (isObservableArray(obj)) {\n return obj.map(function (_, index) { return index; });\n }\n return fail(process.env.NODE_ENV !== \"production\" &&\n \"'keys()' can only be used on observable objects, arrays, sets and maps\");\n}\nfunction values(obj) {\n if (isObservableObject(obj)) {\n return keys(obj).map(function (key) { return obj[key]; });\n }\n if (isObservableMap(obj)) {\n return keys(obj).map(function (key) { return obj.get(key); });\n }\n if (isObservableSet(obj)) {\n return iteratorToArray(obj.values());\n }\n if (isObservableArray(obj)) {\n return obj.slice();\n }\n return fail(process.env.NODE_ENV !== \"production\" &&\n \"'values()' can only be used on observable objects, arrays, sets and maps\");\n}\nfunction entries(obj) {\n if (isObservableObject(obj)) {\n return keys(obj).map(function (key) { return [key, obj[key]]; });\n }\n if (isObservableMap(obj)) {\n return keys(obj).map(function (key) { return [key, obj.get(key)]; });\n }\n if (isObservableSet(obj)) {\n return iteratorToArray(obj.entries());\n }\n if (isObservableArray(obj)) {\n return obj.map(function (key, index) { return [index, key]; });\n }\n return fail(process.env.NODE_ENV !== \"production\" &&\n \"'entries()' can only be used on observable objects, arrays and maps\");\n}\nfunction set(obj, key, value) {\n if (arguments.length === 2 && !isObservableSet(obj)) {\n startBatch();\n var values_1 = key;\n try {\n for (var key_1 in values_1)\n set(obj, key_1, values_1[key_1]);\n }\n finally {\n endBatch();\n }\n return;\n }\n if (isObservableObject(obj)) {\n var adm = obj.$mobx;\n var existingObservable = adm.values[key];\n if (existingObservable) {\n adm.write(obj, key, value);\n }\n else {\n defineObservableProperty(obj, key, value, adm.defaultEnhancer);\n }\n }\n else if (isObservableMap(obj)) {\n obj.set(key, value);\n }\n else if (isObservableSet(obj)) {\n obj.add(key);\n }\n else if (isObservableArray(obj)) {\n if (typeof key !== \"number\")\n key = parseInt(key, 10);\n invariant(key >= 0, \"Not a valid index: '\" + key + \"'\");\n startBatch();\n if (key >= obj.length)\n obj.length = key + 1;\n obj[key] = value;\n endBatch();\n }\n else {\n return fail(process.env.NODE_ENV !== \"production\" &&\n \"'set()' can only be used on observable objects, arrays and maps\");\n }\n}\nfunction remove(obj, key) {\n if (isObservableObject(obj)) {\n obj.$mobx.remove(key);\n }\n else if (isObservableMap(obj)) {\n obj.delete(key);\n }\n else if (isObservableSet(obj)) {\n obj.delete(key);\n }\n else if (isObservableArray(obj)) {\n if (typeof key !== \"number\")\n key = parseInt(key, 10);\n invariant(key >= 0, \"Not a valid index: '\" + key + \"'\");\n obj.splice(key, 1);\n }\n else {\n return fail(process.env.NODE_ENV !== \"production\" &&\n \"'remove()' can only be used on observable objects, arrays and maps\");\n }\n}\nfunction has(obj, key) {\n if (isObservableObject(obj)) {\n // return keys(obj).indexOf(key) >= 0\n var adm = getAdministration(obj);\n adm.getKeys(); // make sure we get notified of key changes, but for performance, use the values map to look up existence\n return !!adm.values[key];\n }\n else if (isObservableMap(obj)) {\n return obj.has(key);\n }\n else if (isObservableSet(obj)) {\n return obj.has(key);\n }\n else if (isObservableArray(obj)) {\n return key >= 0 && key < obj.length;\n }\n else {\n return fail(process.env.NODE_ENV !== \"production\" &&\n \"'has()' can only be used on observable objects, arrays and maps\");\n }\n}\nfunction get(obj, key) {\n if (!has(obj, key))\n return undefined;\n if (isObservableObject(obj)) {\n return obj[key];\n }\n else if (isObservableMap(obj)) {\n return obj.get(key);\n }\n else if (isObservableArray(obj)) {\n return obj[key];\n }\n else {\n return fail(process.env.NODE_ENV !== \"production\" &&\n \"'get()' can only be used on observable objects, arrays and maps\");\n }\n}\n\nfunction observe(thing, propOrCb, cbOrFire, fireImmediately) {\n if (typeof cbOrFire === \"function\")\n return observeObservableProperty(thing, propOrCb, cbOrFire, fireImmediately);\n else\n return observeObservable(thing, propOrCb, cbOrFire);\n}\nfunction observeObservable(thing, listener, fireImmediately) {\n return getAdministration(thing).observe(listener, fireImmediately);\n}\nfunction observeObservableProperty(thing, property, listener, fireImmediately) {\n return getAdministration(thing, property).observe(listener, fireImmediately);\n}\n\nvar defaultOptions = {\n detectCycles: true,\n exportMapsAsObjects: true,\n recurseEverything: false\n};\nfunction cache(map, key, value, options) {\n if (options.detectCycles)\n map.set(key, value);\n return value;\n}\nfunction toJSHelper(source, options, __alreadySeen) {\n if (!options.recurseEverything && !isObservable(source))\n return source;\n if (typeof source !== \"object\")\n return source;\n // Directly return null if source is null\n if (source === null)\n return null;\n // Directly return the Date object itself if contained in the observable\n if (source instanceof Date)\n return source;\n if (isObservableValue(source))\n return toJSHelper(source.get(), options, __alreadySeen);\n // make sure we track the keys of the object\n if (isObservable(source))\n keys(source);\n var detectCycles = options.detectCycles === true;\n if (detectCycles && source !== null && __alreadySeen.has(source)) {\n return __alreadySeen.get(source);\n }\n if (isObservableArray(source) || Array.isArray(source)) {\n var res_1 = cache(__alreadySeen, source, [], options);\n var toAdd = source.map(function (value) { return toJSHelper(value, options, __alreadySeen); });\n res_1.length = toAdd.length;\n for (var i = 0, l = toAdd.length; i < l; i++)\n res_1[i] = toAdd[i];\n return res_1;\n }\n if (isObservableSet(source) || Object.getPrototypeOf(source) === Set.prototype) {\n if (options.exportMapsAsObjects === false) {\n var res_2 = cache(__alreadySeen, source, new Set(), options);\n source.forEach(function (value) {\n res_2.add(toJSHelper(value, options, __alreadySeen));\n });\n return res_2;\n }\n else {\n var res_3 = cache(__alreadySeen, source, [], options);\n source.forEach(function (value) {\n res_3.push(toJSHelper(value, options, __alreadySeen));\n });\n return res_3;\n }\n }\n if (isObservableMap(source) || Object.getPrototypeOf(source) === Map.prototype) {\n if (options.exportMapsAsObjects === false) {\n var res_4 = cache(__alreadySeen, source, new Map(), options);\n source.forEach(function (value, key) {\n res_4.set(key, toJSHelper(value, options, __alreadySeen));\n });\n return res_4;\n }\n else {\n var res_5 = cache(__alreadySeen, source, {}, options);\n source.forEach(function (value, key) {\n res_5[key] = toJSHelper(value, options, __alreadySeen);\n });\n return res_5;\n }\n }\n // Fallback to the situation that source is an ObservableObject or a plain object\n var res = cache(__alreadySeen, source, {}, options);\n for (var key in source) {\n res[key] = toJSHelper(source[key], options, __alreadySeen);\n }\n return res;\n}\nfunction toJS(source, options) {\n // backward compatibility\n if (typeof options === \"boolean\")\n options = { detectCycles: options };\n if (!options)\n options = defaultOptions;\n options.detectCycles =\n options.detectCycles === undefined\n ? options.recurseEverything === true\n : options.detectCycles === true;\n var __alreadySeen;\n if (options.detectCycles)\n __alreadySeen = new Map();\n return toJSHelper(source, options, __alreadySeen);\n}\n\nfunction trace() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var enterBreakPoint = false;\n if (typeof args[args.length - 1] === \"boolean\")\n enterBreakPoint = args.pop();\n var derivation = getAtomFromArgs(args);\n if (!derivation) {\n return fail(process.env.NODE_ENV !== \"production\" &&\n \"'trace(break?)' can only be used inside a tracked computed value or a Reaction. Consider passing in the computed value or reaction explicitly\");\n }\n if (derivation.isTracing === TraceMode.NONE) {\n console.log(\"[mobx.trace] '\" + derivation.name + \"' tracing enabled\");\n }\n derivation.isTracing = enterBreakPoint ? TraceMode.BREAK : TraceMode.LOG;\n}\nfunction getAtomFromArgs(args) {\n switch (args.length) {\n case 0:\n return globalState.trackingDerivation;\n case 1:\n return getAtom(args[0]);\n case 2:\n return getAtom(args[0], args[1]);\n }\n}\n\n/**\n * During a transaction no views are updated until the end of the transaction.\n * The transaction will be run synchronously nonetheless.\n *\n * @param action a function that updates some reactive state\n * @returns any value that was returned by the 'action' parameter.\n */\nfunction transaction(action, thisArg) {\n if (thisArg === void 0) { thisArg = undefined; }\n startBatch();\n try {\n return action.apply(thisArg);\n }\n finally {\n endBatch();\n }\n}\n\nfunction when(predicate, arg1, arg2) {\n if (arguments.length === 1 || (arg1 && typeof arg1 === \"object\"))\n return whenPromise(predicate, arg1);\n return _when(predicate, arg1, arg2 || {});\n}\nfunction _when(predicate, effect, opts) {\n var timeoutHandle;\n if (typeof opts.timeout === \"number\") {\n timeoutHandle = setTimeout(function () {\n if (!disposer.$mobx.isDisposed) {\n disposer();\n var error = new Error(\"WHEN_TIMEOUT\");\n if (opts.onError)\n opts.onError(error);\n else\n throw error;\n }\n }, opts.timeout);\n }\n opts.name = opts.name || \"When@\" + getNextId();\n var effectAction = createAction(opts.name + \"-effect\", effect);\n var disposer = autorun(function (r) {\n if (predicate()) {\n r.dispose();\n if (timeoutHandle)\n clearTimeout(timeoutHandle);\n effectAction();\n }\n }, opts);\n return disposer;\n}\nfunction whenPromise(predicate, opts) {\n if (process.env.NODE_ENV !== \"production\" && opts && opts.onError)\n return fail(\"the options 'onError' and 'promise' cannot be combined\");\n var cancel;\n var res = new Promise(function (resolve, reject) {\n var disposer = _when(predicate, resolve, __assign(__assign({}, opts), { onError: reject }));\n cancel = function () {\n disposer();\n reject(\"WHEN_CANCELLED\");\n };\n });\n res.cancel = cancel;\n return res;\n}\n\nfunction hasInterceptors(interceptable) {\n return interceptable.interceptors !== undefined && interceptable.interceptors.length > 0;\n}\nfunction registerInterceptor(interceptable, handler) {\n var interceptors = interceptable.interceptors || (interceptable.interceptors = []);\n interceptors.push(handler);\n return once(function () {\n var idx = interceptors.indexOf(handler);\n if (idx !== -1)\n interceptors.splice(idx, 1);\n });\n}\nfunction interceptChange(interceptable, change) {\n var prevU = untrackedStart();\n try {\n var interceptors = interceptable.interceptors;\n if (interceptors)\n for (var i = 0, l = interceptors.length; i < l; i++) {\n change = interceptors[i](change);\n invariant(!change || change.type, \"Intercept handlers should return nothing or a change object\");\n if (!change)\n break;\n }\n return change;\n }\n finally {\n untrackedEnd(prevU);\n }\n}\n\nfunction hasListeners(listenable) {\n return listenable.changeListeners !== undefined && listenable.changeListeners.length > 0;\n}\nfunction registerListener(listenable, handler) {\n var listeners = listenable.changeListeners || (listenable.changeListeners = []);\n listeners.push(handler);\n return once(function () {\n var idx = listeners.indexOf(handler);\n if (idx !== -1)\n listeners.splice(idx, 1);\n });\n}\nfunction notifyListeners(listenable, change) {\n var prevU = untrackedStart();\n var listeners = listenable.changeListeners;\n if (!listeners)\n return;\n listeners = listeners.slice();\n for (var i = 0, l = listeners.length; i < l; i++) {\n listeners[i](change);\n }\n untrackedEnd(prevU);\n}\n\nvar MAX_SPLICE_SIZE = 10000; // See e.g. https://github.com/mobxjs/mobx/issues/859\n// Detects bug in safari 9.1.1 (or iOS 9 safari mobile). See #364\nvar safariPrototypeSetterInheritanceBug = (function () {\n var v = false;\n var p = {};\n Object.defineProperty(p, \"0\", {\n set: function () {\n v = true;\n }\n });\n Object.create(p)[\"0\"] = 1;\n return v === false;\n})();\n/**\n * This array buffer contains two lists of properties, so that all arrays\n * can recycle their property definitions, which significantly improves performance of creating\n * properties on the fly.\n */\nvar OBSERVABLE_ARRAY_BUFFER_SIZE = 0;\n// Typescript workaround to make sure ObservableArray extends Array\nvar StubArray = /** @class */ (function () {\n function StubArray() {\n }\n return StubArray;\n}());\nfunction inherit(ctor, proto) {\n if (typeof Object[\"setPrototypeOf\"] !== \"undefined\") {\n Object[\"setPrototypeOf\"](ctor.prototype, proto);\n }\n else if (typeof ctor.prototype.__proto__ !== \"undefined\") {\n ctor.prototype.__proto__ = proto;\n }\n else {\n ctor[\"prototype\"] = proto;\n }\n}\ninherit(StubArray, Array.prototype);\n// Weex freeze Array.prototype\n// Make them writeable and configurable in prototype chain\n// https://github.com/alibaba/weex/pull/1529\nif (Object.isFrozen(Array)) {\n [\n \"constructor\",\n \"push\",\n \"shift\",\n \"concat\",\n \"pop\",\n \"unshift\",\n \"replace\",\n \"find\",\n \"findIndex\",\n \"splice\",\n \"reverse\",\n \"sort\"\n ].forEach(function (key) {\n Object.defineProperty(StubArray.prototype, key, {\n configurable: true,\n writable: true,\n value: Array.prototype[key]\n });\n });\n}\nvar ObservableArrayAdministration = /** @class */ (function () {\n function ObservableArrayAdministration(name, enhancer, array, owned) {\n this.array = array;\n this.owned = owned;\n this.values = [];\n this.lastKnownLength = 0;\n this.atom = new Atom(name || \"ObservableArray@\" + getNextId());\n this.enhancer = function (newV, oldV) { return enhancer(newV, oldV, name + \"[..]\"); };\n }\n ObservableArrayAdministration.prototype.dehanceValue = function (value) {\n if (this.dehancer !== undefined)\n return this.dehancer(value);\n return value;\n };\n ObservableArrayAdministration.prototype.dehanceValues = function (values) {\n if (this.dehancer !== undefined && values.length > 0)\n return values.map(this.dehancer);\n return values;\n };\n ObservableArrayAdministration.prototype.intercept = function (handler) {\n return registerInterceptor(this, handler);\n };\n ObservableArrayAdministration.prototype.observe = function (listener, fireImmediately) {\n if (fireImmediately === void 0) { fireImmediately = false; }\n if (fireImmediately) {\n listener({\n object: this.array,\n type: \"splice\",\n index: 0,\n added: this.values.slice(),\n addedCount: this.values.length,\n removed: [],\n removedCount: 0\n });\n }\n return registerListener(this, listener);\n };\n ObservableArrayAdministration.prototype.getArrayLength = function () {\n this.atom.reportObserved();\n return this.values.length;\n };\n ObservableArrayAdministration.prototype.setArrayLength = function (newLength) {\n if (typeof newLength !== \"number\" || newLength < 0)\n throw new Error(\"[mobx.array] Out of range: \" + newLength);\n var currentLength = this.values.length;\n if (newLength === currentLength)\n return;\n else if (newLength > currentLength) {\n var newItems = new Array(newLength - currentLength);\n for (var i = 0; i < newLength - currentLength; i++)\n newItems[i] = undefined; // No Array.fill everywhere...\n this.spliceWithArray(currentLength, 0, newItems);\n }\n else\n this.spliceWithArray(newLength, currentLength - newLength);\n };\n // adds / removes the necessary numeric properties to this object\n ObservableArrayAdministration.prototype.updateArrayLength = function (oldLength, delta) {\n if (oldLength !== this.lastKnownLength)\n throw new Error(\"[mobx] Modification exception: the internal structure of an observable array was changed. Did you use peek() to change it?\");\n this.lastKnownLength += delta;\n if (delta > 0 && oldLength + delta + 1 > OBSERVABLE_ARRAY_BUFFER_SIZE)\n reserveArrayBuffer(oldLength + delta + 1);\n };\n ObservableArrayAdministration.prototype.spliceWithArray = function (index, deleteCount, newItems) {\n var _this = this;\n checkIfStateModificationsAreAllowed(this.atom);\n var length = this.values.length;\n if (index === undefined)\n index = 0;\n else if (index > length)\n index = length;\n else if (index < 0)\n index = Math.max(0, length + index);\n if (arguments.length === 1)\n deleteCount = length - index;\n else if (deleteCount === undefined || deleteCount === null)\n deleteCount = 0;\n else\n deleteCount = Math.max(0, Math.min(deleteCount, length - index));\n if (newItems === undefined)\n newItems = EMPTY_ARRAY;\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.array,\n type: \"splice\",\n index: index,\n removedCount: deleteCount,\n added: newItems\n });\n if (!change)\n return EMPTY_ARRAY;\n deleteCount = change.removedCount;\n newItems = change.added;\n }\n newItems =\n newItems.length === 0 ? newItems : newItems.map(function (v) { return _this.enhancer(v, undefined); });\n var lengthDelta = newItems.length - deleteCount;\n this.updateArrayLength(length, lengthDelta); // create or remove new entries\n var res = this.spliceItemsIntoValues(index, deleteCount, newItems);\n if (deleteCount !== 0 || newItems.length !== 0)\n this.notifyArraySplice(index, newItems, res);\n return this.dehanceValues(res);\n };\n ObservableArrayAdministration.prototype.spliceItemsIntoValues = function (index, deleteCount, newItems) {\n var _a;\n if (newItems.length < MAX_SPLICE_SIZE) {\n return (_a = this.values).splice.apply(_a, __spread([index, deleteCount], newItems));\n }\n else {\n var res = this.values.slice(index, index + deleteCount);\n this.values = this.values\n .slice(0, index)\n .concat(newItems, this.values.slice(index + deleteCount));\n return res;\n }\n };\n ObservableArrayAdministration.prototype.notifyArrayChildUpdate = function (index, newValue, oldValue) {\n var notifySpy = !this.owned && isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy\n ? {\n object: this.array,\n type: \"update\",\n index: index,\n newValue: newValue,\n oldValue: oldValue\n }\n : null;\n if (notifySpy)\n spyReportStart(__assign(__assign({}, change), { name: this.atom.name }));\n this.atom.reportChanged();\n if (notify)\n notifyListeners(this, change);\n if (notifySpy)\n spyReportEnd();\n };\n ObservableArrayAdministration.prototype.notifyArraySplice = function (index, added, removed) {\n var notifySpy = !this.owned && isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy\n ? {\n object: this.array,\n type: \"splice\",\n index: index,\n removed: removed,\n added: added,\n removedCount: removed.length,\n addedCount: added.length\n }\n : null;\n if (notifySpy)\n spyReportStart(__assign(__assign({}, change), { name: this.atom.name }));\n this.atom.reportChanged();\n // conform: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/observe\n if (notify)\n notifyListeners(this, change);\n if (notifySpy)\n spyReportEnd();\n };\n return ObservableArrayAdministration;\n}());\nvar ObservableArray = /** @class */ (function (_super) {\n __extends(ObservableArray, _super);\n function ObservableArray(initialValues, enhancer, name, owned) {\n if (name === void 0) { name = \"ObservableArray@\" + getNextId(); }\n if (owned === void 0) { owned = false; }\n var _this = _super.call(this) || this;\n var adm = new ObservableArrayAdministration(name, enhancer, _this, owned);\n addHiddenFinalProp(_this, \"$mobx\", adm);\n if (initialValues && initialValues.length) {\n var prev = allowStateChangesStart(true);\n _this.spliceWithArray(0, 0, initialValues);\n allowStateChangesEnd(prev);\n }\n if (safariPrototypeSetterInheritanceBug) {\n // Seems that Safari won't use numeric prototype setter untill any * numeric property is\n // defined on the instance. After that it works fine, even if this property is deleted.\n Object.defineProperty(adm.array, \"0\", ENTRY_0);\n }\n return _this;\n }\n ObservableArray.prototype.intercept = function (handler) {\n return this.$mobx.intercept(handler);\n };\n ObservableArray.prototype.observe = function (listener, fireImmediately) {\n if (fireImmediately === void 0) { fireImmediately = false; }\n return this.$mobx.observe(listener, fireImmediately);\n };\n ObservableArray.prototype.clear = function () {\n return this.splice(0);\n };\n ObservableArray.prototype.concat = function () {\n var arrays = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n arrays[_i] = arguments[_i];\n }\n this.$mobx.atom.reportObserved();\n return Array.prototype.concat.apply(this.peek(), arrays.map(function (a) { return (isObservableArray(a) ? a.peek() : a); }));\n };\n ObservableArray.prototype.replace = function (newItems) {\n return this.$mobx.spliceWithArray(0, this.$mobx.values.length, newItems);\n };\n /**\n * Converts this array back to a (shallow) javascript structure.\n * For a deep clone use mobx.toJS\n */\n ObservableArray.prototype.toJS = function () {\n return this.slice();\n };\n ObservableArray.prototype.toJSON = function () {\n // Used by JSON.stringify\n return this.toJS();\n };\n ObservableArray.prototype.peek = function () {\n this.$mobx.atom.reportObserved();\n return this.$mobx.dehanceValues(this.$mobx.values);\n };\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find\n ObservableArray.prototype.find = function (predicate, thisArg, fromIndex) {\n if (fromIndex === void 0) { fromIndex = 0; }\n if (arguments.length === 3)\n deprecated(\"The array.find fromIndex argument to find will not be supported anymore in the next major\");\n var idx = this.findIndex.apply(this, arguments);\n return idx === -1 ? undefined : this.get(idx);\n };\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex\n ObservableArray.prototype.findIndex = function (predicate, thisArg, fromIndex) {\n if (fromIndex === void 0) { fromIndex = 0; }\n if (arguments.length === 3)\n deprecated(\"The array.findIndex fromIndex argument to find will not be supported anymore in the next major\");\n var items = this.peek(), l = items.length;\n for (var i = fromIndex; i < l; i++)\n if (predicate.call(thisArg, items[i], i, this))\n return i;\n return -1;\n };\n /*\n * functions that do alter the internal structure of the array, (based on lib.es6.d.ts)\n * since these functions alter the inner structure of the array, the have side effects.\n * Because the have side effects, they should not be used in computed function,\n * and for that reason the do not call dependencyState.notifyObserved\n */\n ObservableArray.prototype.splice = function (index, deleteCount) {\n var newItems = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n newItems[_i - 2] = arguments[_i];\n }\n switch (arguments.length) {\n case 0:\n return [];\n case 1:\n return this.$mobx.spliceWithArray(index);\n case 2:\n return this.$mobx.spliceWithArray(index, deleteCount);\n }\n return this.$mobx.spliceWithArray(index, deleteCount, newItems);\n };\n ObservableArray.prototype.spliceWithArray = function (index, deleteCount, newItems) {\n return this.$mobx.spliceWithArray(index, deleteCount, newItems);\n };\n ObservableArray.prototype.push = function () {\n var items = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n items[_i] = arguments[_i];\n }\n var adm = this.$mobx;\n adm.spliceWithArray(adm.values.length, 0, items);\n return adm.values.length;\n };\n ObservableArray.prototype.pop = function () {\n return this.splice(Math.max(this.$mobx.values.length - 1, 0), 1)[0];\n };\n ObservableArray.prototype.shift = function () {\n return this.splice(0, 1)[0];\n };\n ObservableArray.prototype.unshift = function () {\n var items = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n items[_i] = arguments[_i];\n }\n var adm = this.$mobx;\n adm.spliceWithArray(0, 0, items);\n return adm.values.length;\n };\n ObservableArray.prototype.reverse = function () {\n // reverse by default mutates in place before returning the result\n // which makes it both a 'derivation' and a 'mutation'.\n // so we deviate from the default and just make it an dervitation\n var clone = this.slice();\n return clone.reverse.apply(clone, arguments);\n };\n ObservableArray.prototype.sort = function (compareFn) {\n // sort by default mutates in place before returning the result\n // which goes against all good practices. Let's not change the array in place!\n var clone = this.slice();\n return clone.sort.apply(clone, arguments);\n };\n ObservableArray.prototype.remove = function (value) {\n var idx = this.$mobx.dehanceValues(this.$mobx.values).indexOf(value);\n if (idx > -1) {\n this.splice(idx, 1);\n return true;\n }\n return false;\n };\n ObservableArray.prototype.move = function (fromIndex, toIndex) {\n deprecated(\"observableArray.move is deprecated, use .slice() & .replace() instead\");\n function checkIndex(index) {\n if (index < 0) {\n throw new Error(\"[mobx.array] Index out of bounds: \" + index + \" is negative\");\n }\n var length = this.$mobx.values.length;\n if (index >= length) {\n throw new Error(\"[mobx.array] Index out of bounds: \" + index + \" is not smaller than \" + length);\n }\n }\n checkIndex.call(this, fromIndex);\n checkIndex.call(this, toIndex);\n if (fromIndex === toIndex) {\n return;\n }\n var oldItems = this.$mobx.values;\n var newItems;\n if (fromIndex < toIndex) {\n newItems = __spread(oldItems.slice(0, fromIndex), oldItems.slice(fromIndex + 1, toIndex + 1), [\n oldItems[fromIndex]\n ], oldItems.slice(toIndex + 1));\n }\n else {\n // toIndex < fromIndex\n newItems = __spread(oldItems.slice(0, toIndex), [\n oldItems[fromIndex]\n ], oldItems.slice(toIndex, fromIndex), oldItems.slice(fromIndex + 1));\n }\n this.replace(newItems);\n };\n // See #734, in case property accessors are unreliable...\n ObservableArray.prototype.get = function (index) {\n var impl = this.$mobx;\n if (impl) {\n if (index < impl.values.length) {\n impl.atom.reportObserved();\n return impl.dehanceValue(impl.values[index]);\n }\n console.warn(\"[mobx.array] Attempt to read an array index (\" + index + \") that is out of bounds (\" + impl.values.length + \"). Please check length first. Out of bound indices will not be tracked by MobX\");\n }\n return undefined;\n };\n // See #734, in case property accessors are unreliable...\n ObservableArray.prototype.set = function (index, newValue) {\n var adm = this.$mobx;\n var values = adm.values;\n if (index < values.length) {\n // update at index in range\n checkIfStateModificationsAreAllowed(adm.atom);\n var oldValue = values[index];\n if (hasInterceptors(adm)) {\n var change = interceptChange(adm, {\n type: \"update\",\n object: this,\n index: index,\n newValue: newValue\n });\n if (!change)\n return;\n newValue = change.newValue;\n }\n newValue = adm.enhancer(newValue, oldValue);\n var changed = newValue !== oldValue;\n if (changed) {\n values[index] = newValue;\n adm.notifyArrayChildUpdate(index, newValue, oldValue);\n }\n }\n else if (index === values.length) {\n // add a new item\n adm.spliceWithArray(index, 0, [newValue]);\n }\n else {\n // out of bounds\n throw new Error(\"[mobx.array] Index out of bounds, \" + index + \" is larger than \" + values.length);\n }\n };\n return ObservableArray;\n}(StubArray));\ndeclareIterator(ObservableArray.prototype, function () {\n this.$mobx.atom.reportObserved();\n var self = this;\n var nextIndex = 0;\n return makeIterable({\n next: function () {\n return nextIndex < self.length\n ? { value: self[nextIndex++], done: false }\n : { done: true, value: undefined };\n }\n });\n});\nObject.defineProperty(ObservableArray.prototype, \"length\", {\n enumerable: false,\n configurable: true,\n get: function () {\n return this.$mobx.getArrayLength();\n },\n set: function (newLength) {\n this.$mobx.setArrayLength(newLength);\n }\n});\naddHiddenProp(ObservableArray.prototype, toStringTagSymbol(), \"Array\");\n[\"indexOf\", \"join\", \"lastIndexOf\", \"slice\", \"toString\", \"toLocaleString\"].forEach(function (funcName) {\n var baseFunc = Array.prototype[funcName];\n invariant(typeof baseFunc === \"function\", \"Base function not defined on Array prototype: '\" + funcName + \"'\");\n addHiddenProp(ObservableArray.prototype, funcName, function () {\n return baseFunc.apply(this.peek(), arguments);\n });\n});\n[\n \"every\",\n \"filter\",\n //\"find\", // implemented individually (IE support)\n //\"findIndex\", // implemented individually (IE support)\n //\"flatMap\", // not supported\n \"forEach\",\n \"map\",\n \"some\"\n].forEach(function (funcName) {\n var baseFunc = Array.prototype[funcName];\n invariant(typeof baseFunc === \"function\", \"Base function not defined on Array prototype: '\" + funcName + \"'\");\n addHiddenProp(ObservableArray.prototype, funcName, function (callback, thisArg) {\n var _this = this;\n var adm = this.$mobx;\n adm.atom.reportObserved();\n var dehancedValues = adm.dehanceValues(adm.values);\n return dehancedValues[funcName](function (element, index) {\n return callback.call(thisArg, element, index, _this);\n }, thisArg);\n });\n});\n[\"reduce\", \"reduceRight\"].forEach(function (funcName) {\n addHiddenProp(ObservableArray.prototype, funcName, function () {\n var _this = this;\n var adm = this.$mobx;\n adm.atom.reportObserved();\n // #2432 - reduce behavior depends on arguments.length\n var callback = arguments[0];\n arguments[0] = function (accumulator, currentValue, index) {\n currentValue = adm.dehanceValue(currentValue);\n return callback(accumulator, currentValue, index, _this);\n };\n return adm.values[funcName].apply(adm.values, arguments);\n });\n});\n/**\n * We don't want those to show up in `for (const key in ar)` ...\n */\nmakeNonEnumerable(ObservableArray.prototype, [\n \"constructor\",\n \"intercept\",\n \"observe\",\n \"clear\",\n \"concat\",\n \"get\",\n \"replace\",\n \"toJS\",\n \"toJSON\",\n \"peek\",\n \"find\",\n \"findIndex\",\n \"splice\",\n \"spliceWithArray\",\n \"push\",\n \"pop\",\n \"set\",\n \"shift\",\n \"unshift\",\n \"reverse\",\n \"sort\",\n \"remove\",\n \"move\",\n \"toString\",\n \"toLocaleString\"\n]);\n// See #364\nvar ENTRY_0 = createArrayEntryDescriptor(0);\nfunction createArrayEntryDescriptor(index) {\n return {\n enumerable: false,\n configurable: false,\n get: function () {\n return this.get(index);\n },\n set: function (value) {\n this.set(index, value);\n }\n };\n}\nfunction createArrayBufferItem(index) {\n Object.defineProperty(ObservableArray.prototype, \"\" + index, createArrayEntryDescriptor(index));\n}\nfunction reserveArrayBuffer(max) {\n for (var index = OBSERVABLE_ARRAY_BUFFER_SIZE; index < max; index++)\n createArrayBufferItem(index);\n OBSERVABLE_ARRAY_BUFFER_SIZE = max;\n}\nreserveArrayBuffer(1000);\nvar isObservableArrayAdministration = createInstanceofPredicate(\"ObservableArrayAdministration\", ObservableArrayAdministration);\nfunction isObservableArray(thing) {\n return isObject(thing) && isObservableArrayAdministration(thing.$mobx);\n}\n\nvar ObservableMapMarker = {};\nvar ObservableMap = /** @class */ (function () {\n function ObservableMap(initialData, enhancer, name) {\n if (enhancer === void 0) { enhancer = deepEnhancer; }\n if (name === void 0) { name = \"ObservableMap@\" + getNextId(); }\n this.enhancer = enhancer;\n this.name = name;\n this.$mobx = ObservableMapMarker;\n this._keysAtom = createAtom(this.name + \".keys()\");\n if (typeof Map !== \"function\") {\n throw new Error(\"mobx.map requires Map polyfill for the current browser. Check babel-polyfill or core-js/es6/map.js\");\n }\n this._data = new Map();\n this._hasMap = new Map();\n this.merge(initialData);\n }\n ObservableMap.prototype._has = function (key) {\n return this._data.has(key);\n };\n ObservableMap.prototype.has = function (key) {\n var _this = this;\n if (!globalState.trackingDerivation)\n return this._has(key);\n var entry = this._hasMap.get(key);\n if (!entry) {\n // todo: replace with atom (breaking change)\n var newEntry = (entry = new ObservableValue(this._has(key), referenceEnhancer, this.name + \".\" + stringifyKey(key) + \"?\", false));\n this._hasMap.set(key, newEntry);\n onBecomeUnobserved(newEntry, function () { return _this._hasMap.delete(key); });\n }\n return entry.get();\n };\n ObservableMap.prototype.set = function (key, value) {\n var hasKey = this._has(key);\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: hasKey ? \"update\" : \"add\",\n object: this,\n newValue: value,\n name: key\n });\n if (!change)\n return this;\n value = change.newValue;\n }\n if (hasKey) {\n this._updateValue(key, value);\n }\n else {\n this._addValue(key, value);\n }\n return this;\n };\n ObservableMap.prototype.delete = function (key) {\n var _this = this;\n checkIfStateModificationsAreAllowed(this._keysAtom);\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: \"delete\",\n object: this,\n name: key\n });\n if (!change)\n return false;\n }\n if (this._has(key)) {\n var notifySpy = isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy\n ? {\n type: \"delete\",\n object: this,\n oldValue: this._data.get(key).value,\n name: key\n }\n : null;\n if (notifySpy)\n spyReportStart(__assign(__assign({}, change), { name: this.name, key: key }));\n transaction(function () {\n _this._keysAtom.reportChanged();\n _this._updateHasMapEntry(key, false);\n var observable = _this._data.get(key);\n observable.setNewValue(undefined);\n _this._data.delete(key);\n });\n if (notify)\n notifyListeners(this, change);\n if (notifySpy)\n spyReportEnd();\n return true;\n }\n return false;\n };\n ObservableMap.prototype._updateHasMapEntry = function (key, value) {\n var entry = this._hasMap.get(key);\n if (entry) {\n entry.setNewValue(value);\n }\n };\n ObservableMap.prototype._updateValue = function (key, newValue) {\n var observable = this._data.get(key);\n newValue = observable.prepareNewValue(newValue);\n if (newValue !== globalState.UNCHANGED) {\n var notifySpy = isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy\n ? {\n type: \"update\",\n object: this,\n oldValue: observable.value,\n name: key,\n newValue: newValue\n }\n : null;\n if (notifySpy)\n spyReportStart(__assign(__assign({}, change), { name: this.name, key: key }));\n observable.setNewValue(newValue);\n if (notify)\n notifyListeners(this, change);\n if (notifySpy)\n spyReportEnd();\n }\n };\n ObservableMap.prototype._addValue = function (key, newValue) {\n var _this = this;\n checkIfStateModificationsAreAllowed(this._keysAtom);\n transaction(function () {\n var observable = new ObservableValue(newValue, _this.enhancer, _this.name + \".\" + stringifyKey(key), false);\n _this._data.set(key, observable);\n newValue = observable.value; // value might have been changed\n _this._updateHasMapEntry(key, true);\n _this._keysAtom.reportChanged();\n });\n var notifySpy = isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy\n ? {\n type: \"add\",\n object: this,\n name: key,\n newValue: newValue\n }\n : null;\n if (notifySpy)\n spyReportStart(__assign(__assign({}, change), { name: this.name, key: key }));\n if (notify)\n notifyListeners(this, change);\n if (notifySpy)\n spyReportEnd();\n };\n ObservableMap.prototype.get = function (key) {\n if (this.has(key))\n return this.dehanceValue(this._data.get(key).get());\n return this.dehanceValue(undefined);\n };\n ObservableMap.prototype.dehanceValue = function (value) {\n if (this.dehancer !== undefined) {\n return this.dehancer(value);\n }\n return value;\n };\n ObservableMap.prototype.keys = function () {\n this._keysAtom.reportObserved();\n return this._data.keys();\n };\n ObservableMap.prototype.values = function () {\n var self = this;\n var keys = this.keys();\n return makeIterable({\n next: function () {\n var _a = keys.next(), done = _a.done, value = _a.value;\n return {\n done: done,\n value: done ? undefined : self.get(value)\n };\n }\n });\n };\n ObservableMap.prototype.entries = function () {\n var self = this;\n var keys = this.keys();\n return makeIterable({\n next: function () {\n var _a = keys.next(), done = _a.done, value = _a.value;\n return {\n done: done,\n value: done ? undefined : [value, self.get(value)]\n };\n }\n });\n };\n ObservableMap.prototype.forEach = function (callback, thisArg) {\n var _this = this;\n this._keysAtom.reportObserved();\n this._data.forEach(function (_, key) { return callback.call(thisArg, _this.get(key), key, _this); });\n };\n /** Merge another object into this object, returns this. */\n ObservableMap.prototype.merge = function (other) {\n var _this = this;\n if (isObservableMap(other)) {\n other = other.toJS();\n }\n transaction(function () {\n var prev = allowStateChangesStart(true);\n try {\n if (isPlainObject(other))\n Object.keys(other).forEach(function (key) { return _this.set(key, other[key]); });\n else if (Array.isArray(other))\n other.forEach(function (_a) {\n var _b = __read(_a, 2), key = _b[0], value = _b[1];\n return _this.set(key, value);\n });\n else if (isES6Map(other)) {\n if (other.constructor !== Map)\n fail(\"Cannot initialize from classes that inherit from Map: \" + other.constructor.name); // prettier-ignore\n else\n other.forEach(function (value, key) { return _this.set(key, value); });\n }\n else if (other !== null && other !== undefined)\n fail(\"Cannot initialize map from \" + other);\n }\n finally {\n allowStateChangesEnd(prev);\n }\n });\n return this;\n };\n ObservableMap.prototype.clear = function () {\n var _this = this;\n transaction(function () {\n untracked(function () {\n // Note we are concurrently reading/deleting the same keys\n // forEach handles this properly\n _this._data.forEach(function (_, key) { return _this.delete(key); });\n });\n });\n };\n ObservableMap.prototype.replace = function (values) {\n var _this = this;\n // Implementation requirements:\n // - respect ordering of replacement map\n // - allow interceptors to run and potentially prevent individual operations\n // - don't recreate observables that already exist in original map (so we don't destroy existing subscriptions)\n // - don't _keysAtom.reportChanged if the keys of resulting map are indentical (order matters!)\n // - note that result map may differ from replacement map due to the interceptors\n transaction(function () {\n // Convert to map so we can do quick key lookups\n var replacementMap = convertToMap(values);\n var orderedData = new Map();\n // Used for optimization\n var keysReportChangedCalled = false;\n // Delete keys that don't exist in replacement map\n // if the key deletion is prevented by interceptor\n // add entry at the beginning of the result map\n forOf(_this._data.keys(), function (key) {\n // Concurrently iterating/deleting keys\n // iterator should handle this correctly\n if (!replacementMap.has(key)) {\n var deleted = _this.delete(key);\n // Was the key removed?\n if (deleted) {\n // _keysAtom.reportChanged() was already called\n keysReportChangedCalled = true;\n }\n else {\n // Delete prevented by interceptor\n var value = _this._data.get(key);\n orderedData.set(key, value);\n }\n }\n });\n // Merge entries\n forOf(replacementMap.entries(), function (_a) {\n var _b = __read(_a, 2), key = _b[0], value = _b[1];\n // We will want to know whether a new key is added\n var keyExisted = _this._data.has(key);\n // Add or update value\n _this.set(key, value);\n // The addition could have been prevent by interceptor\n if (_this._data.has(key)) {\n // The update could have been prevented by interceptor\n // and also we want to preserve existing values\n // so use value from _data map (instead of replacement map)\n var value_1 = _this._data.get(key);\n orderedData.set(key, value_1);\n // Was a new key added?\n if (!keyExisted) {\n // _keysAtom.reportChanged() was already called\n keysReportChangedCalled = true;\n }\n }\n });\n // Check for possible key order change\n if (!keysReportChangedCalled) {\n if (_this._data.size !== orderedData.size) {\n // If size differs, keys are definitely modified\n _this._keysAtom.reportChanged();\n }\n else {\n var iter1 = _this._data.keys();\n var iter2 = orderedData.keys();\n var next1 = iter1.next();\n var next2 = iter2.next();\n while (!next1.done) {\n if (next1.value !== next2.value) {\n _this._keysAtom.reportChanged();\n break;\n }\n next1 = iter1.next();\n next2 = iter2.next();\n }\n }\n }\n // Use correctly ordered map\n _this._data = orderedData;\n });\n return this;\n };\n Object.defineProperty(ObservableMap.prototype, \"size\", {\n get: function () {\n this._keysAtom.reportObserved();\n return this._data.size;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Returns a plain object that represents this map.\n * Note that all the keys being stringified.\n * If there are duplicating keys after converting them to strings, behaviour is undetermined.\n */\n ObservableMap.prototype.toPOJO = function () {\n var _this = this;\n var res = {};\n this.forEach(function (_, key) {\n return (res[typeof key === \"symbol\" ? key : stringifyKey(key)] = _this.get(key));\n });\n return res;\n };\n /**\n * Returns a shallow non observable object clone of this map.\n * Note that the values migth still be observable. For a deep clone use mobx.toJS.\n */\n ObservableMap.prototype.toJS = function () {\n return new Map(this);\n };\n ObservableMap.prototype.toJSON = function () {\n // Used by JSON.stringify\n return this.toPOJO();\n };\n ObservableMap.prototype.toString = function () {\n var _this = this;\n return (this.name +\n \"[{ \" +\n iteratorToArray(this.keys())\n .map(function (key) { return stringifyKey(key) + \": \" + (\"\" + _this.get(key)); })\n .join(\", \") +\n \" }]\");\n };\n /**\n * Observes this object. Triggers for the events 'add', 'update' and 'delete'.\n * See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/observe\n * for callback details\n */\n ObservableMap.prototype.observe = function (listener, fireImmediately) {\n process.env.NODE_ENV !== \"production\" &&\n invariant(fireImmediately !== true, \"`observe` doesn't support fireImmediately=true in combination with maps.\");\n return registerListener(this, listener);\n };\n ObservableMap.prototype.intercept = function (handler) {\n return registerInterceptor(this, handler);\n };\n return ObservableMap;\n}());\nfunction stringifyKey(key) {\n if (key && key.toString)\n return key.toString();\n else\n return new String(key).toString();\n}\ndeclareIterator(ObservableMap.prototype, function () {\n return this.entries();\n});\naddHiddenFinalProp(ObservableMap.prototype, toStringTagSymbol(), \"Map\");\n/* 'var' fixes small-build issue */\nvar isObservableMap = createInstanceofPredicate(\"ObservableMap\", ObservableMap);\n\nvar ObservableSetMarker = {};\nvar ObservableSet = /** @class */ (function () {\n function ObservableSet(initialData, enhancer, name) {\n if (enhancer === void 0) { enhancer = deepEnhancer; }\n if (name === void 0) { name = \"ObservableSet@\" + getNextId(); }\n this.name = name;\n this.$mobx = ObservableSetMarker;\n this._data = new Set();\n this._atom = createAtom(this.name);\n if (typeof Set !== \"function\") {\n throw new Error(\"mobx.set requires Set polyfill for the current browser. Check babel-polyfill or core-js/es6/set.js\");\n }\n this.enhancer = function (newV, oldV) { return enhancer(newV, oldV, name); };\n if (initialData) {\n this.replace(initialData);\n }\n }\n ObservableSet.prototype.dehanceValue = function (value) {\n if (this.dehancer !== undefined) {\n return this.dehancer(value);\n }\n return value;\n };\n ObservableSet.prototype.clear = function () {\n var _this = this;\n transaction(function () {\n untracked(function () {\n _this._data.forEach(function (value) {\n _this.delete(value);\n });\n });\n });\n };\n ObservableSet.prototype.forEach = function (callbackFn, thisArg) {\n var _this = this;\n this._atom.reportObserved();\n this._data.forEach(function (value) {\n callbackFn.call(thisArg, value, value, _this);\n });\n };\n Object.defineProperty(ObservableSet.prototype, \"size\", {\n get: function () {\n this._atom.reportObserved();\n return this._data.size;\n },\n enumerable: true,\n configurable: true\n });\n ObservableSet.prototype.add = function (value) {\n var _this = this;\n checkIfStateModificationsAreAllowed(this._atom);\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: \"add\",\n object: this,\n newValue: value\n });\n if (!change)\n return this;\n // TODO: ideally, value = change.value would be done here, so that values can be\n // changed by interceptor. Same applies for other Set and Map api's.\n }\n if (!this.has(value)) {\n transaction(function () {\n _this._data.add(_this.enhancer(value, undefined));\n _this._atom.reportChanged();\n });\n var notifySpy = isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy\n ? {\n type: \"add\",\n object: this,\n newValue: value\n }\n : null;\n if (notifySpy && process.env.NODE_ENV !== \"production\")\n spyReportStart(change);\n if (notify)\n notifyListeners(this, change);\n if (notifySpy && process.env.NODE_ENV !== \"production\")\n spyReportEnd();\n }\n return this;\n };\n ObservableSet.prototype.delete = function (value) {\n var _this = this;\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: \"delete\",\n object: this,\n oldValue: value\n });\n if (!change)\n return false;\n }\n if (this.has(value)) {\n var notifySpy = isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy\n ? {\n type: \"delete\",\n object: this,\n oldValue: value\n }\n : null;\n if (notifySpy && process.env.NODE_ENV !== \"production\")\n spyReportStart(__assign(__assign({}, change), { name: this.name }));\n transaction(function () {\n _this._atom.reportChanged();\n _this._data.delete(value);\n });\n if (notify)\n notifyListeners(this, change);\n if (notifySpy && process.env.NODE_ENV !== \"production\")\n spyReportEnd();\n return true;\n }\n return false;\n };\n ObservableSet.prototype.has = function (value) {\n this._atom.reportObserved();\n return this._data.has(this.dehanceValue(value));\n };\n ObservableSet.prototype.entries = function () {\n var nextIndex = 0;\n var keys = iteratorToArray(this.keys());\n var values = iteratorToArray(this.values());\n return makeIterable({\n next: function () {\n var index = nextIndex;\n nextIndex += 1;\n return index < values.length\n ? { value: [keys[index], values[index]], done: false }\n : { done: true };\n }\n });\n };\n ObservableSet.prototype.keys = function () {\n return this.values();\n };\n ObservableSet.prototype.values = function () {\n this._atom.reportObserved();\n var self = this;\n var nextIndex = 0;\n var observableValues;\n if (this._data.values !== undefined) {\n observableValues = iteratorToArray(this._data.values());\n }\n else {\n // There is no values function in IE11\n observableValues = [];\n this._data.forEach(function (e) { return observableValues.push(e); });\n }\n return makeIterable({\n next: function () {\n return nextIndex < observableValues.length\n ? { value: self.dehanceValue(observableValues[nextIndex++]), done: false }\n : { done: true };\n }\n });\n };\n ObservableSet.prototype.replace = function (other) {\n var _this = this;\n if (isObservableSet(other)) {\n other = other.toJS();\n }\n transaction(function () {\n var prev = allowStateChangesStart(true);\n try {\n if (Array.isArray(other)) {\n _this.clear();\n other.forEach(function (value) { return _this.add(value); });\n }\n else if (isES6Set(other)) {\n _this.clear();\n other.forEach(function (value) { return _this.add(value); });\n }\n else if (other !== null && other !== undefined) {\n fail(\"Cannot initialize set from \" + other);\n }\n }\n finally {\n allowStateChangesEnd(prev);\n }\n });\n return this;\n };\n ObservableSet.prototype.observe = function (listener, fireImmediately) {\n // TODO 'fireImmediately' can be true?\n process.env.NODE_ENV !== \"production\" &&\n invariant(fireImmediately !== true, \"`observe` doesn't support fireImmediately=true in combination with sets.\");\n return registerListener(this, listener);\n };\n ObservableSet.prototype.intercept = function (handler) {\n return registerInterceptor(this, handler);\n };\n ObservableSet.prototype.toJS = function () {\n return new Set(this);\n };\n ObservableSet.prototype.toString = function () {\n return this.name + \"[ \" + iteratorToArray(this.keys()).join(\", \") + \" ]\";\n };\n return ObservableSet;\n}());\ndeclareIterator(ObservableSet.prototype, function () {\n return this.values();\n});\naddHiddenFinalProp(ObservableSet.prototype, toStringTagSymbol(), \"Set\");\nvar isObservableSet = createInstanceofPredicate(\"ObservableSet\", ObservableSet);\n\nvar ObservableObjectAdministration = /** @class */ (function () {\n function ObservableObjectAdministration(target, name, defaultEnhancer) {\n this.target = target;\n this.name = name;\n this.defaultEnhancer = defaultEnhancer;\n this.values = {};\n }\n ObservableObjectAdministration.prototype.read = function (owner, key) {\n if (process.env.NODE_ENV === \"production\" && this.target !== owner) {\n this.illegalAccess(owner, key);\n if (!this.values[key])\n return undefined;\n }\n return this.values[key].get();\n };\n ObservableObjectAdministration.prototype.write = function (owner, key, newValue) {\n var instance = this.target;\n if (process.env.NODE_ENV === \"production\" && instance !== owner) {\n this.illegalAccess(owner, key);\n }\n var observable = this.values[key];\n if (observable instanceof ComputedValue) {\n observable.set(newValue);\n return;\n }\n // intercept\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: \"update\",\n object: instance,\n name: key,\n newValue: newValue\n });\n if (!change)\n return;\n newValue = change.newValue;\n }\n newValue = observable.prepareNewValue(newValue);\n // notify spy & observers\n if (newValue !== globalState.UNCHANGED) {\n var notify = hasListeners(this);\n var notifySpy = isSpyEnabled();\n var change = notify || notifySpy\n ? {\n type: \"update\",\n object: instance,\n oldValue: observable.value,\n name: key,\n newValue: newValue\n }\n : null;\n if (notifySpy)\n spyReportStart(__assign(__assign({}, change), { name: this.name, key: key }));\n observable.setNewValue(newValue);\n if (notify)\n notifyListeners(this, change);\n if (notifySpy)\n spyReportEnd();\n }\n };\n ObservableObjectAdministration.prototype.remove = function (key) {\n if (!this.values[key])\n return;\n var target = this.target;\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: target,\n name: key,\n type: \"remove\"\n });\n if (!change)\n return;\n }\n try {\n startBatch();\n var notify = hasListeners(this);\n var notifySpy = isSpyEnabled();\n var oldValue = this.values[key].get();\n if (this.keys)\n this.keys.remove(key);\n delete this.values[key];\n delete this.target[key];\n var change = notify || notifySpy\n ? {\n type: \"remove\",\n object: target,\n oldValue: oldValue,\n name: key\n }\n : null;\n if (notifySpy)\n spyReportStart(__assign(__assign({}, change), { name: this.name, key: key }));\n if (notify)\n notifyListeners(this, change);\n if (notifySpy)\n spyReportEnd();\n }\n finally {\n endBatch();\n }\n };\n ObservableObjectAdministration.prototype.illegalAccess = function (owner, propName) {\n /**\n * This happens if a property is accessed through the prototype chain, but the property was\n * declared directly as own property on the prototype.\n *\n * E.g.:\n * class A {\n * }\n * extendObservable(A.prototype, { x: 1 })\n *\n * classB extens A {\n * }\n * console.log(new B().x)\n *\n * It is unclear whether the property should be considered 'static' or inherited.\n * Either use `console.log(A.x)`\n * or: decorate(A, { x: observable })\n *\n * When using decorate, the property will always be redeclared as own property on the actual instance\n */\n console.warn(\"Property '\" + propName + \"' of '\" + owner + \"' was accessed through the prototype chain. Use 'decorate' instead to declare the prop or access it statically through it's owner\");\n };\n /**\n * Observes this object. Triggers for the events 'add', 'update' and 'delete'.\n * See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/observe\n * for callback details\n */\n ObservableObjectAdministration.prototype.observe = function (callback, fireImmediately) {\n process.env.NODE_ENV !== \"production\" &&\n invariant(fireImmediately !== true, \"`observe` doesn't support the fire immediately property for observable objects.\");\n return registerListener(this, callback);\n };\n ObservableObjectAdministration.prototype.intercept = function (handler) {\n return registerInterceptor(this, handler);\n };\n ObservableObjectAdministration.prototype.getKeys = function () {\n var _this = this;\n if (this.keys === undefined) {\n this.keys = (new ObservableArray(Object.keys(this.values).filter(function (key) { return _this.values[key] instanceof ObservableValue; }), referenceEnhancer, \"keys(\" + this.name + \")\", true));\n }\n return this.keys.slice();\n };\n return ObservableObjectAdministration;\n}());\nfunction asObservableObject(target, name, defaultEnhancer) {\n if (name === void 0) { name = \"\"; }\n if (defaultEnhancer === void 0) { defaultEnhancer = deepEnhancer; }\n var adm = target.$mobx;\n if (adm)\n return adm;\n process.env.NODE_ENV !== \"production\" &&\n invariant(Object.isExtensible(target), \"Cannot make the designated object observable; it is not extensible\");\n if (!isPlainObject(target))\n name = (target.constructor.name || \"ObservableObject\") + \"@\" + getNextId();\n if (!name)\n name = \"ObservableObject@\" + getNextId();\n adm = new ObservableObjectAdministration(target, name, defaultEnhancer);\n addHiddenFinalProp(target, \"$mobx\", adm);\n return adm;\n}\nfunction defineObservableProperty(target, propName, newValue, enhancer) {\n var adm = asObservableObject(target);\n assertPropertyConfigurable(target, propName);\n if (hasInterceptors(adm)) {\n var change = interceptChange(adm, {\n object: target,\n name: propName,\n type: \"add\",\n newValue: newValue\n });\n if (!change)\n return;\n newValue = change.newValue;\n }\n var observable = (adm.values[propName] = new ObservableValue(newValue, enhancer, adm.name + \".\" + propName, false));\n newValue = observable.value; // observableValue might have changed it\n Object.defineProperty(target, propName, generateObservablePropConfig(propName));\n if (adm.keys)\n adm.keys.push(propName);\n notifyPropertyAddition(adm, target, propName, newValue);\n}\nfunction defineComputedProperty(target, // which objects holds the observable and provides `this` context?\npropName, options) {\n var adm = asObservableObject(target);\n options.name = adm.name + \".\" + propName;\n options.context = target;\n adm.values[propName] = new ComputedValue(options);\n Object.defineProperty(target, propName, generateComputedPropConfig(propName));\n}\nvar observablePropertyConfigs = Object.create(null);\nvar computedPropertyConfigs = Object.create(null);\nfunction generateObservablePropConfig(propName) {\n return (observablePropertyConfigs[propName] ||\n (observablePropertyConfigs[propName] = {\n configurable: true,\n enumerable: true,\n get: function () {\n return this.$mobx.read(this, propName);\n },\n set: function (v) {\n this.$mobx.write(this, propName, v);\n }\n }));\n}\nfunction getAdministrationForComputedPropOwner(owner) {\n var adm = owner.$mobx;\n if (!adm) {\n // because computed props are declared on proty,\n // the current instance might not have been initialized yet\n initializeInstance(owner);\n return owner.$mobx;\n }\n return adm;\n}\nfunction generateComputedPropConfig(propName) {\n return (computedPropertyConfigs[propName] ||\n (computedPropertyConfigs[propName] = {\n configurable: globalState.computedConfigurable,\n enumerable: false,\n get: function () {\n return getAdministrationForComputedPropOwner(this).read(this, propName);\n },\n set: function (v) {\n getAdministrationForComputedPropOwner(this).write(this, propName, v);\n }\n }));\n}\nfunction notifyPropertyAddition(adm, object, key, newValue) {\n var notify = hasListeners(adm);\n var notifySpy = isSpyEnabled();\n var change = notify || notifySpy\n ? {\n type: \"add\",\n object: object,\n name: key,\n newValue: newValue\n }\n : null;\n if (notifySpy)\n spyReportStart(__assign(__assign({}, change), { name: adm.name, key: key }));\n if (notify)\n notifyListeners(adm, change);\n if (notifySpy)\n spyReportEnd();\n}\nvar isObservableObjectAdministration = createInstanceofPredicate(\"ObservableObjectAdministration\", ObservableObjectAdministration);\nfunction isObservableObject(thing) {\n if (isObject(thing)) {\n // Initializers run lazily when transpiling to babel, so make sure they are run...\n initializeInstance(thing);\n return isObservableObjectAdministration(thing.$mobx);\n }\n return false;\n}\n\nfunction getAtom(thing, property) {\n if (typeof thing === \"object\" && thing !== null) {\n if (isObservableArray(thing)) {\n if (property !== undefined)\n fail(process.env.NODE_ENV !== \"production\" &&\n \"It is not possible to get index atoms from arrays\");\n return thing.$mobx.atom;\n }\n if (isObservableSet(thing)) {\n return thing.$mobx;\n }\n if (isObservableMap(thing)) {\n var anyThing = thing;\n if (property === undefined)\n return anyThing._keysAtom;\n var observable = anyThing._data.get(property) || anyThing._hasMap.get(property);\n if (!observable)\n fail(process.env.NODE_ENV !== \"production\" &&\n \"the entry '\" + property + \"' does not exist in the observable map '\" + getDebugName(thing) + \"'\");\n return observable;\n }\n // Initializers run lazily when transpiling to babel, so make sure they are run...\n initializeInstance(thing);\n if (property && !thing.$mobx)\n thing[property]; // See #1072\n if (isObservableObject(thing)) {\n if (!property)\n return fail(process.env.NODE_ENV !== \"production\" && \"please specify a property\");\n var observable = thing.$mobx.values[property];\n if (!observable)\n fail(process.env.NODE_ENV !== \"production\" &&\n \"no observable property '\" + property + \"' found on the observable object '\" + getDebugName(thing) + \"'\");\n return observable;\n }\n if (isAtom(thing) || isComputedValue(thing) || isReaction(thing)) {\n return thing;\n }\n }\n else if (typeof thing === \"function\") {\n if (isReaction(thing.$mobx)) {\n // disposer function\n return thing.$mobx;\n }\n }\n return fail(process.env.NODE_ENV !== \"production\" && \"Cannot obtain atom from \" + thing);\n}\nfunction getAdministration(thing, property) {\n if (!thing)\n fail(\"Expecting some object\");\n if (property !== undefined)\n return getAdministration(getAtom(thing, property));\n if (isAtom(thing) || isComputedValue(thing) || isReaction(thing))\n return thing;\n if (isObservableMap(thing) || isObservableSet(thing))\n return thing;\n // Initializers run lazily when transpiling to babel, so make sure they are run...\n initializeInstance(thing);\n if (thing.$mobx)\n return thing.$mobx;\n fail(process.env.NODE_ENV !== \"production\" && \"Cannot obtain administration from \" + thing);\n}\nfunction getDebugName(thing, property) {\n var named;\n if (property !== undefined)\n named = getAtom(thing, property);\n else if (isObservableObject(thing) || isObservableMap(thing) || isObservableSet(thing))\n named = getAdministration(thing);\n else\n named = getAtom(thing); // valid for arrays as well\n return named.name;\n}\n\nvar toString = Object.prototype.toString;\nfunction deepEqual(a, b, depth) {\n if (depth === void 0) { depth = -1; }\n return eq(a, b, depth);\n}\n// Copied from https://github.com/jashkenas/underscore/blob/5c237a7c682fb68fd5378203f0bf22dce1624854/underscore.js#L1186-L1289\n// Internal recursive comparison function for `isEqual`.\nfunction eq(a, b, depth, aStack, bStack) {\n // Identical objects are equal. `0 === -0`, but they aren't identical.\n // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal).\n if (a === b)\n return a !== 0 || 1 / a === 1 / b;\n // `null` or `undefined` only equal to itself (strict comparison).\n if (a == null || b == null)\n return false;\n // `NaN`s are equivalent, but non-reflexive.\n if (a !== a)\n return b !== b;\n // Exhaust primitive checks\n var type = typeof a;\n if (type !== \"function\" && type !== \"object\" && typeof b != \"object\")\n return false;\n // Unwrap any wrapped objects.\n a = unwrap(a);\n b = unwrap(b);\n // Compare `[[Class]]` names.\n var className = toString.call(a);\n if (className !== toString.call(b))\n return false;\n switch (className) {\n // Strings, numbers, regular expressions, dates, and booleans are compared by value.\n case \"[object RegExp]\":\n // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')\n case \"[object String]\":\n // Primitives and their corresponding object wrappers are equivalent; thus, `\"5\"` is\n // equivalent to `new String(\"5\")`.\n return \"\" + a === \"\" + b;\n case \"[object Number]\":\n // `NaN`s are equivalent, but non-reflexive.\n // Object(NaN) is equivalent to NaN.\n if (+a !== +a)\n return +b !== +b;\n // An `egal` comparison is performed for other numeric values.\n return +a === 0 ? 1 / +a === 1 / b : +a === +b;\n case \"[object Date]\":\n case \"[object Boolean]\":\n // Coerce dates and booleans to numeric primitive values. Dates are compared by their\n // millisecond representations. Note that invalid dates with millisecond representations\n // of `NaN` are not equivalent.\n return +a === +b;\n case \"[object Symbol]\":\n return (\n // eslint-disable-next-line\n typeof Symbol !== \"undefined\" && Symbol.valueOf.call(a) === Symbol.valueOf.call(b));\n }\n var areArrays = className === \"[object Array]\";\n if (!areArrays) {\n if (typeof a != \"object\" || typeof b != \"object\")\n return false;\n // Objects with different constructors are not equivalent, but `Object`s or `Array`s\n // from different frames are.\n var aCtor = a.constructor, bCtor = b.constructor;\n if (aCtor !== bCtor &&\n !(typeof aCtor === \"function\" &&\n aCtor instanceof aCtor &&\n typeof bCtor === \"function\" &&\n bCtor instanceof bCtor) &&\n (\"constructor\" in a && \"constructor\" in b)) {\n return false;\n }\n }\n if (depth === 0) {\n return false;\n }\n else if (depth < 0) {\n depth = -1;\n }\n // Assume equality for cyclic structures. The algorithm for detecting cyclic\n // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.\n // Initializing stack of traversed objects.\n // It's done here since we only need them for objects and arrays comparison.\n aStack = aStack || [];\n bStack = bStack || [];\n var length = aStack.length;\n while (length--) {\n // Linear search. Performance is inversely proportional to the number of\n // unique nested structures.\n if (aStack[length] === a)\n return bStack[length] === b;\n }\n // Add the first object to the stack of traversed objects.\n aStack.push(a);\n bStack.push(b);\n // Recursively compare objects and arrays.\n if (areArrays) {\n // Compare array lengths to determine if a deep comparison is necessary.\n length = a.length;\n if (length !== b.length)\n return false;\n // Deep compare the contents, ignoring non-numeric properties.\n while (length--) {\n if (!eq(a[length], b[length], depth - 1, aStack, bStack))\n return false;\n }\n }\n else {\n // Deep compare objects.\n var keys = Object.keys(a);\n var key = void 0;\n length = keys.length;\n // Ensure that both objects contain the same number of properties before comparing deep equality.\n if (Object.keys(b).length !== length)\n return false;\n while (length--) {\n // Deep compare each member\n key = keys[length];\n if (!(has$1(b, key) && eq(a[key], b[key], depth - 1, aStack, bStack)))\n return false;\n }\n }\n // Remove the first object from the stack of traversed objects.\n aStack.pop();\n bStack.pop();\n return true;\n}\nfunction unwrap(a) {\n if (isObservableArray(a))\n return a.peek();\n if (isES6Map(a) || isObservableMap(a))\n return iteratorToArray(a.entries());\n if (isES6Set(a) || isObservableSet(a))\n return iteratorToArray(a.entries());\n return a;\n}\nfunction has$1(a, key) {\n return Object.prototype.hasOwnProperty.call(a, key);\n}\n\n/**\n * (c) Michel Weststrate 2015 - 2019\n * MIT Licensed\n *\n * Welcome to the mobx sources! To get an global overview of how MobX internally works,\n * this is a good place to start:\n * https://medium.com/@mweststrate/becoming-fully-reactive-an-in-depth-explanation-of-mobservable-55995262a254#.xvbh6qd74\n *\n * Source folders:\n * ===============\n *\n * - api/ Most of the public static methods exposed by the module can be found here.\n * - core/ Implementation of the MobX algorithm; atoms, derivations, reactions, dependency trees, optimizations. Cool stuff can be found here.\n * - types/ All the magic that is need to have observable objects, arrays and values is in this folder. Including the modifiers like `asFlat`.\n * - utils/ Utility stuff.\n *\n */\ntry {\n // define process.env if needed\n // if this is not a production build in the first place\n // (in which case the expression below would be substituted with 'production')\n // tslint:disable-next-line\n process.env.NODE_ENV;\n}\ncatch (e) {\n var g = getGlobal();\n if (typeof process === \"undefined\")\n g.process = {};\n g.process.env = {};\n}\n(function () {\n function testCodeMinification() { }\n if (testCodeMinification.name !== \"testCodeMinification\" &&\n process.env.NODE_ENV !== \"production\" &&\n typeof process !== 'undefined' && process.env.IGNORE_MOBX_MINIFY_WARNING !== \"true\") {\n // trick so it doesn't get replaced\n var varName = [\"process\", \"env\", \"NODE_ENV\"].join(\".\");\n console.warn(\"[mobx] you are running a minified build, but '\" + varName + \"' was not set to 'production' in your bundler. This results in an unnecessarily large and slow bundle\");\n }\n})();\n// forward compatibility with mobx, so that packages can easily support mobx 4 & 5\nvar $mobx = \"$mobx\";\nif (typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__ === \"object\") {\n // See: https://github.com/andykog/mobx-devtools/\n __MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({\n spy: spy,\n extras: {\n getDebugName: getDebugName\n },\n $mobx: $mobx\n });\n}\n// TODO: remove in some future build\nif (process.env.NODE_ENV !== \"production\" &&\n typeof module !== \"undefined\" &&\n typeof module.exports !== \"undefined\") {\n var warnedAboutDefaultExport_1 = false;\n Object.defineProperty(module.exports, \"default\", {\n enumerable: false,\n get: function () {\n if (!warnedAboutDefaultExport_1) {\n warnedAboutDefaultExport_1 = true;\n console.warn(\"The MobX package does not have a default export. Use 'import { thing } from \\\"mobx\\\"' (recommended) or 'import * as mobx from \\\"mobx\\\"' instead.\\\"\");\n }\n return undefined;\n }\n });\n [\n \"extras\",\n \"Atom\",\n \"BaseAtom\",\n \"asFlat\",\n \"asMap\",\n \"asReference\",\n \"asStructure\",\n \"autorunAsync\",\n \"createTranformer\",\n \"expr\",\n \"isModifierDescriptor\",\n \"isStrictModeEnabled\",\n \"map\",\n \"useStrict\",\n \"whyRun\"\n ].forEach(function (prop) {\n Object.defineProperty(module.exports, prop, {\n enumerable: false,\n get: function () {\n fail(\"'\" + prop + \"' is no longer part of the public MobX api. Please consult the changelog to find out where this functionality went\");\n },\n set: function () { }\n });\n });\n}\n\nexport { $mobx, FlowCancellationError, IDerivationState, ObservableMap, ObservableSet, Reaction, allowStateChanges as _allowStateChanges, allowStateChangesInsideComputed as _allowStateChangesInsideComputed, allowStateReadsEnd as _allowStateReadsEnd, allowStateReadsStart as _allowStateReadsStart, _endAction, getAdministration as _getAdministration, getGlobalState as _getGlobalState, interceptReads as _interceptReads, isComputingDerivation as _isComputingDerivation, resetGlobalState as _resetGlobalState, _startAction, action, autorun, comparer, computed, configure, createAtom, decorate, entries, extendObservable, extendShallowObservable, flow, get, getAtom, getDebugName, getDependencyTree, getObserverTree, has, intercept, isAction, isArrayLike, isObservableValue as isBoxedObservable, isComputed, isComputedProp, isFlowCancellationError, isObservable, isObservableArray, isObservableMap, isObservableObject, isObservableProp, isObservableSet, keys, observable, observe, onBecomeObserved, onBecomeUnobserved, onReactionError, reaction, remove, runInAction, set, spy, toJS, trace, transaction, untracked, values, when };\n","/**\n * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * @module utils/ckeditorerror\n */\n\n/* globals console */\n\n/**\n * URL to the documentation with error codes.\n */\nexport const DOCUMENTATION_URL =\n\t'https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/error-codes.html';\n\n/**\n * The CKEditor error class.\n *\n * You should throw `CKEditorError` when:\n *\n * * An unexpected situation occurred and the editor (most probably) will not work properly. Such exception will be handled\n * by the {@link module:watchdog/watchdog~Watchdog watchdog} (if it is integrated),\n * * If the editor is incorrectly integrated or the editor API is used in the wrong way. This way you will give\n * feedback to the developer as soon as possible. Keep in mind that for common integration issues which should not\n * stop editor initialization (like missing upload adapter, wrong name of a toolbar component) we use\n * {@link module:utils/ckeditorerror~logWarning `logWarning()`} and\n * {@link module:utils/ckeditorerror~logError `logError()`}\n * to improve developers experience and let them see the a working editor as soon as possible.\n *\n *\t\t/**\n *\t\t * Error thrown when a plugin cannot be loaded due to JavaScript errors, lack of plugins with a given name, etc.\n *\t\t *\n *\t\t * @error plugin-load\n *\t\t * @param pluginName The name of the plugin that could not be loaded.\n *\t\t * @param moduleName The name of the module which tried to load this plugin.\n *\t\t * /\n *\t\tthrow new CKEditorError( 'plugin-load', {\n *\t\t\tpluginName: 'foo',\n *\t\t\tmoduleName: 'bar'\n *\t\t} );\n *\n * @extends Error\n */\nexport default class CKEditorError extends Error {\n\t/**\n\t * Creates an instance of the CKEditorError class.\n\t *\n\t * @param {String} errorName The error id in an `error-name` format. A link to this error documentation page will be added\n\t * to the thrown error's `message`.\n\t * @param {Object|null} context A context of the error by which the {@link module:watchdog/watchdog~Watchdog watchdog}\n\t * is able to determine which editor crashed. It should be an editor instance or a property connected to it. It can be also\n\t * a `null` value if the editor should not be restarted in case of the error (e.g. during the editor initialization).\n\t * The error context should be checked using the `areConnectedThroughProperties( editor, context )` utility\n\t * to check if the object works as the context.\n\t * @param {Object} [data] Additional data describing the error. A stringified version of this object\n\t * will be appended to the error message, so the data are quickly visible in the console. The original\n\t * data object will also be later available under the {@link #data} property.\n\t */\n\tconstructor( errorName, context, data ) {\n\t\tconst message = `${ errorName }${ ( data ? ` ${ JSON.stringify( data ) }` : '' ) }${ getLinkToDocumentationMessage( errorName ) }`;\n\n\t\tsuper( message );\n\n\t\t/**\n\t\t * @type {String}\n\t\t */\n\t\tthis.name = 'CKEditorError';\n\n\t\t/**\n\t\t * A context of the error by which the Watchdog is able to determine which editor crashed.\n\t\t *\n\t\t * @type {Object|null}\n\t\t */\n\t\tthis.context = context;\n\n\t\t/**\n\t\t * The additional error data passed to the constructor. Undefined if none was passed.\n\t\t *\n\t\t * @type {Object|undefined}\n\t\t */\n\t\tthis.data = data;\n\t}\n\n\t/**\n\t * Checks if the error is of the `CKEditorError` type.\n\t */\n\tis( type ) {\n\t\treturn type === 'CKEditorError';\n\t}\n\n\t/**\n\t * A utility that ensures that the thrown error is a {@link module:utils/ckeditorerror~CKEditorError} one.\n\t * It is useful when combined with the {@link module:watchdog/watchdog~Watchdog} feature, which can restart the editor in case\n\t * of a {@link module:utils/ckeditorerror~CKEditorError} error.\n\t *\n\t * @static\n\t * @param {Error} err The error to rethrow.\n\t * @param {Object} context An object connected through properties with the editor instance. This context will be used\n\t * by the watchdog to verify which editor should be restarted.\n\t */\n\tstatic rethrowUnexpectedError( err, context ) {\n\t\tif ( err.is && err.is( 'CKEditorError' ) ) {\n\t\t\tthrow err;\n\t\t}\n\n\t\t/**\n\t\t * An unexpected error occurred inside the CKEditor 5 codebase. This error will look like the original one\n\t\t * to make the debugging easier.\n\t\t *\n\t\t * This error is only useful when the editor is initialized using the {@link module:watchdog/watchdog~Watchdog} feature.\n\t\t * In case of such error (or any {@link module:utils/ckeditorerror~CKEditorError} error) the watchdog should restart the editor.\n\t\t *\n\t\t * @error unexpected-error\n\t\t */\n\t\tconst error = new CKEditorError( err.message, context );\n\n\t\t// Restore the original stack trace to make the error look like the original one.\n\t\t// See https://github.com/ckeditor/ckeditor5/issues/5595 for more details.\n\t\terror.stack = err.stack;\n\n\t\tthrow error;\n\t}\n}\n\n/**\n * Logs a warning to the console with a properly formatted message and adds a link to the documentation.\n * Use whenever you want to log a warning to the console.\n *\n *\t\t/**\n *\t\t * There was a problem processing the configuration of the toolbar. The item with the given\n *\t\t * name does not exist, so it was omitted when rendering the toolbar.\n *\t\t *\n *\t\t * @error toolbarview-item-unavailable\n *\t\t * @param {String} name The name of the component.\n *\t\t * /\n *\t\tlogWarning( 'toolbarview-item-unavailable', { name } );\n *\n * See also {@link module:utils/ckeditorerror~CKEditorError} for an explanation when to throw an error and when to log\n * a warning or an error to the console.\n *\n * @param {String} errorName Error name to be logged.\n * @param {Object} [data] Additional data to be logged.\n * @returns {String}\n */\nexport function logWarning( errorName, data ) {\n\tconsole.warn( ...formatConsoleArguments( errorName, data ) );\n}\n\n/**\n * Logs an error to the console with properly formatted message and adds a link to the documentation.\n * Use whenever you want to log a error to the console.\n *\n *\t\t/**\n *\t\t * There was a problem processing the configuration of the toolbar. The item with the given\n *\t\t * name does not exist, so it was omitted when rendering the toolbar.\n *\t\t *\n *\t\t * @error toolbarview-item-unavailable\n *\t\t * @param {String} name The name of the component.\n *\t\t * /\n *\t\t logError( 'toolbarview-item-unavailable', { name } );\n *\n * **Note**: In most cases logging a warning using {@link module:utils/ckeditorerror~logWarning} is enough.\n *\n * See also {@link module:utils/ckeditorerror~CKEditorError} for an explanation when to use each method.\n *\n * @param {String} errorName Error name to be logged.\n * @param {Object} [data] Additional data to be logged.\n * @returns {String}\n */\nexport function logError( errorName, data ) {\n\tconsole.error( ...formatConsoleArguments( errorName, data ) );\n}\n\nfunction getLinkToDocumentationMessage( errorName ) {\n\treturn `\\nRead more: ${ DOCUMENTATION_URL }#error-${ errorName }`;\n}\n\nfunction formatConsoleArguments( errorName, data ) {\n\tconst documentationMessage = getLinkToDocumentationMessage( errorName );\n\n\treturn data ? [ errorName, data, documentationMessage ] : [ errorName, documentationMessage ];\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\nif (process.env.NODE_ENV !== 'production') {\n var ReactIs = require('react-is');\n\n // By explicitly using `prop-types` you are opting into new development behavior.\n // http://fb.me/prop-types-in-prod\n var throwOnDirectAccess = true;\n module.exports = require('./factoryWithTypeCheckers')(ReactIs.isElement, throwOnDirectAccess);\n} else {\n // By explicitly using `prop-types` you are opting into new production behavior.\n // http://fb.me/prop-types-in-prod\n module.exports = require('./factoryWithThrowingShims')();\n}\n","/*!\n Copyright (c) 2017 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) && arg.length) {\n\t\t\t\tvar inner = classNames.apply(null, arg);\n\t\t\t\tif (inner) {\n\t\t\t\t\tclasses.push(inner);\n\t\t\t\t}\n\t\t\t} else if (argType === 'object') {\n\t\t\t\tfor (var key in arg) {\n\t\t\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\t\t\tclasses.push(key);\n\t\t\t\t\t}\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","//! 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","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.ReactCSS = exports.loop = exports.handleActive = exports.handleHover = exports.hover = undefined;\n\nvar _flattenNames = require('./flattenNames');\n\nvar _flattenNames2 = _interopRequireDefault(_flattenNames);\n\nvar _mergeClasses = require('./mergeClasses');\n\nvar _mergeClasses2 = _interopRequireDefault(_mergeClasses);\n\nvar _autoprefix = require('./autoprefix');\n\nvar _autoprefix2 = _interopRequireDefault(_autoprefix);\n\nvar _hover2 = require('./components/hover');\n\nvar _hover3 = _interopRequireDefault(_hover2);\n\nvar _active = require('./components/active');\n\nvar _active2 = _interopRequireDefault(_active);\n\nvar _loop2 = require('./loop');\n\nvar _loop3 = _interopRequireDefault(_loop2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.hover = _hover3.default;\nexports.handleHover = _hover3.default;\nexports.handleActive = _active2.default;\nexports.loop = _loop3.default;\nvar ReactCSS = exports.ReactCSS = function ReactCSS(classes) {\n for (var _len = arguments.length, activations = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n activations[_key - 1] = arguments[_key];\n }\n\n var activeNames = (0, _flattenNames2.default)(activations);\n var merged = (0, _mergeClasses2.default)(classes, activeNames);\n return (0, _autoprefix2.default)(merged);\n};\n\nexports.default = ReactCSS;","/*\n* loglevel - https://github.com/pimterry/loglevel\n*\n* Copyright (c) 2013 Tim Perry\n* Licensed under the MIT license.\n*/\n(function (root, definition) {\n \"use strict\";\n if (typeof define === 'function' && define.amd) {\n define(definition);\n } else if (typeof module === 'object' && module.exports) {\n module.exports = definition();\n } else {\n root.log = definition();\n }\n}(this, function () {\n \"use strict\";\n\n // Slightly dubious tricks to cut down minimized file size\n var noop = function() {};\n var undefinedType = \"undefined\";\n var isIE = (typeof window !== undefinedType) && (typeof window.navigator !== undefinedType) && (\n /Trident\\/|MSIE /.test(window.navigator.userAgent)\n );\n\n var logMethods = [\n \"trace\",\n \"debug\",\n \"info\",\n \"warn\",\n \"error\"\n ];\n\n // Cross-browser bind equivalent that works at least back to IE6\n function bindMethod(obj, methodName) {\n var method = obj[methodName];\n if (typeof method.bind === 'function') {\n return method.bind(obj);\n } else {\n try {\n return Function.prototype.bind.call(method, obj);\n } catch (e) {\n // Missing bind shim or IE8 + Modernizr, fallback to wrapping\n return function() {\n return Function.prototype.apply.apply(method, [obj, arguments]);\n };\n }\n }\n }\n\n // Trace() doesn't print the message in IE, so for that case we need to wrap it\n function traceForIE() {\n if (console.log) {\n if (console.log.apply) {\n console.log.apply(console, arguments);\n } else {\n // In old IE, native console methods themselves don't have apply().\n Function.prototype.apply.apply(console.log, [console, arguments]);\n }\n }\n if (console.trace) console.trace();\n }\n\n // Build the best logging method possible for this env\n // Wherever possible we want to bind, not wrap, to preserve stack traces\n function realMethod(methodName) {\n if (methodName === 'debug') {\n methodName = 'log';\n }\n\n if (typeof console === undefinedType) {\n return false; // No method possible, for now - fixed later by enableLoggingWhenConsoleArrives\n } else if (methodName === 'trace' && isIE) {\n return traceForIE;\n } else if (console[methodName] !== undefined) {\n return bindMethod(console, methodName);\n } else if (console.log !== undefined) {\n return bindMethod(console, 'log');\n } else {\n return noop;\n }\n }\n\n // These private functions always need `this` to be set properly\n\n function replaceLoggingMethods(level, loggerName) {\n /*jshint validthis:true */\n for (var i = 0; i < logMethods.length; i++) {\n var methodName = logMethods[i];\n this[methodName] = (i < level) ?\n noop :\n this.methodFactory(methodName, level, loggerName);\n }\n\n // Define log.log as an alias for log.debug\n this.log = this.debug;\n }\n\n // In old IE versions, the console isn't present until you first open it.\n // We build realMethod() replacements here that regenerate logging methods\n function enableLoggingWhenConsoleArrives(methodName, level, loggerName) {\n return function () {\n if (typeof console !== undefinedType) {\n replaceLoggingMethods.call(this, level, loggerName);\n this[methodName].apply(this, arguments);\n }\n };\n }\n\n // By default, we use closely bound real methods wherever possible, and\n // otherwise we wait for a console to appear, and then try again.\n function defaultMethodFactory(methodName, level, loggerName) {\n /*jshint validthis:true */\n return realMethod(methodName) ||\n enableLoggingWhenConsoleArrives.apply(this, arguments);\n }\n\n function Logger(name, defaultLevel, factory) {\n var self = this;\n var currentLevel;\n\n var storageKey = \"loglevel\";\n if (typeof name === \"string\") {\n storageKey += \":\" + name;\n } else if (typeof name === \"symbol\") {\n storageKey = undefined;\n }\n\n function persistLevelIfPossible(levelNum) {\n var levelName = (logMethods[levelNum] || 'silent').toUpperCase();\n\n if (typeof window === undefinedType || !storageKey) return;\n\n // Use localStorage if available\n try {\n window.localStorage[storageKey] = levelName;\n return;\n } catch (ignore) {}\n\n // Use session cookie as fallback\n try {\n window.document.cookie =\n encodeURIComponent(storageKey) + \"=\" + levelName + \";\";\n } catch (ignore) {}\n }\n\n function getPersistedLevel() {\n var storedLevel;\n\n if (typeof window === undefinedType || !storageKey) return;\n\n try {\n storedLevel = window.localStorage[storageKey];\n } catch (ignore) {}\n\n // Fallback to cookies if local storage gives us nothing\n if (typeof storedLevel === undefinedType) {\n try {\n var cookie = window.document.cookie;\n var location = cookie.indexOf(\n encodeURIComponent(storageKey) + \"=\");\n if (location !== -1) {\n storedLevel = /^([^;]+)/.exec(cookie.slice(location))[1];\n }\n } catch (ignore) {}\n }\n\n // If the stored level is not valid, treat it as if nothing was stored.\n if (self.levels[storedLevel] === undefined) {\n storedLevel = undefined;\n }\n\n return storedLevel;\n }\n\n /*\n *\n * Public logger API - see https://github.com/pimterry/loglevel for details\n *\n */\n\n self.name = name;\n\n self.levels = { \"TRACE\": 0, \"DEBUG\": 1, \"INFO\": 2, \"WARN\": 3,\n \"ERROR\": 4, \"SILENT\": 5};\n\n self.methodFactory = factory || defaultMethodFactory;\n\n self.getLevel = function () {\n return currentLevel;\n };\n\n self.setLevel = function (level, persist) {\n if (typeof level === \"string\" && self.levels[level.toUpperCase()] !== undefined) {\n level = self.levels[level.toUpperCase()];\n }\n if (typeof level === \"number\" && level >= 0 && level <= self.levels.SILENT) {\n currentLevel = level;\n if (persist !== false) { // defaults to true\n persistLevelIfPossible(level);\n }\n replaceLoggingMethods.call(self, level, name);\n if (typeof console === undefinedType && level < self.levels.SILENT) {\n return \"No console available for logging\";\n }\n } else {\n throw \"log.setLevel() called with invalid level: \" + level;\n }\n };\n\n self.setDefaultLevel = function (level) {\n if (!getPersistedLevel()) {\n self.setLevel(level, false);\n }\n };\n\n self.enableAll = function(persist) {\n self.setLevel(self.levels.TRACE, persist);\n };\n\n self.disableAll = function(persist) {\n self.setLevel(self.levels.SILENT, persist);\n };\n\n // Initialize with the right level\n var initialLevel = getPersistedLevel();\n if (initialLevel == null) {\n initialLevel = defaultLevel == null ? \"WARN\" : defaultLevel;\n }\n self.setLevel(initialLevel, false);\n }\n\n /*\n *\n * Top-level API\n *\n */\n\n var defaultLogger = new Logger();\n\n var _loggersByName = {};\n defaultLogger.getLogger = function getLogger(name) {\n if ((typeof name !== \"symbol\" && typeof name !== \"string\") || name === \"\") {\n throw new TypeError(\"You must supply a name when creating a logger.\");\n }\n\n var logger = _loggersByName[name];\n if (!logger) {\n logger = _loggersByName[name] = new Logger(\n name, defaultLogger.getLevel(), defaultLogger.methodFactory);\n }\n return logger;\n };\n\n // Grab the current global log variable in case of overwrite\n var _log = (typeof window !== undefinedType) ? window.log : undefined;\n defaultLogger.noConflict = function() {\n if (typeof window !== undefinedType &&\n window.log === defaultLogger) {\n window.log = _log;\n }\n\n return defaultLogger;\n };\n\n defaultLogger.getLoggers = function getLoggers() {\n return _loggersByName;\n };\n\n // ES6 default export, for compatibility\n defaultLogger['default'] = defaultLogger;\n\n return defaultLogger;\n}));\n","'use strict';\n\n// do not edit .js files directly - edit src/index.jst\n\n\n\nmodule.exports = function equal(a, b) {\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n\n for (i = length; i-- !== 0;) {\n var key = keys[i];\n\n if (!equal(a[key], b[key])) return false;\n }\n\n return true;\n }\n\n // true if both NaN, false otherwise\n return a!==a && b!==b;\n};\n","'use strict';\n\nfunction checkDCE() {\n /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */\n if (\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined' ||\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== 'function'\n ) {\n return;\n }\n if (process.env.NODE_ENV !== 'production') {\n // This branch is unreachable because this function is only called\n // in production, but the condition is true only in development.\n // Therefore if the branch is still here, dead code elimination wasn't\n // properly applied.\n // Don't change the message. React DevTools relies on it. Also make sure\n // this message doesn't occur elsewhere in this function, or it will cause\n // a false positive.\n throw new Error('^_^');\n }\n try {\n // Verify that the code above has been dead code eliminated (DCE'd).\n __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);\n } catch (err) {\n // DevTools shouldn't crash React, no matter what.\n // We should still report in case we break this code.\n console.error(err);\n }\n}\n\nif (process.env.NODE_ENV === 'production') {\n // DCE check should happen before ReactDOM bundle executes so that\n // DevTools can report bad minification during injection.\n checkDCE();\n module.exports = require('./cjs/react-dom.production.min.js');\n} else {\n module.exports = require('./cjs/react-dom.development.js');\n}\n","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nvar _defineProperty2 = _interopRequireDefault(require(\"@babel/runtime/helpers/defineProperty\"));\n\nvar _classCallCheck2 = _interopRequireDefault(require(\"@babel/runtime/helpers/classCallCheck\"));\n\nvar _createClass2 = _interopRequireDefault(require(\"@babel/runtime/helpers/createClass\"));\n\n/*\n * Jexl\n * Copyright 2020 Tom Shawver\n */\nvar Expression = require('./Expression');\n\nvar _require = require('./grammar'),\n getGrammar = _require.getGrammar;\n/**\n * Jexl is the Javascript Expression Language, capable of parsing and\n * evaluating basic to complex expression strings, combined with advanced\n * xpath-like drilldown into native Javascript objects.\n * @constructor\n */\n\n\nvar Jexl = /*#__PURE__*/function () {\n function Jexl() {\n (0, _classCallCheck2.default)(this, Jexl);\n // Allow expr to be called outside of the jexl context\n this.expr = this.expr.bind(this);\n this._grammar = getGrammar();\n }\n /**\n * Adds a binary operator to Jexl at the specified precedence. The higher the\n * precedence, the earlier the operator is applied in the order of operations.\n * For example, * has a higher precedence than +, because multiplication comes\n * before division.\n *\n * Please see grammar.js for a listing of all default operators and their\n * precedence values in order to choose the appropriate precedence for the\n * new operator.\n * @param {string} operator The operator string to be added\n * @param {number} precedence The operator's precedence\n * @param {function} fn A function to run to calculate the result. The function\n * will be called with two arguments: left and right, denoting the values\n * on either side of the operator. It should return either the resulting\n * value, or a Promise that resolves with the resulting value.\n * @param {boolean} [manualEval] If true, the `left` and `right` arguments\n * will be wrapped in objects with an `eval` function. Calling\n * left.eval() or right.eval() will return a promise that resolves to\n * that operand's actual value. This is useful to conditionally evaluate\n * operands.\n */\n\n\n (0, _createClass2.default)(Jexl, [{\n key: \"addBinaryOp\",\n value: function addBinaryOp(operator, precedence, fn, manualEval) {\n this._addGrammarElement(operator, (0, _defineProperty2.default)({\n type: 'binaryOp',\n precedence: precedence\n }, manualEval ? 'evalOnDemand' : 'eval', fn));\n }\n /**\n * Adds or replaces an expression function in this Jexl instance.\n * @param {string} name The name of the expression function, as it will be\n * used within Jexl expressions\n * @param {function} fn The javascript function to be executed when this\n * expression function is invoked. It will be provided with each argument\n * supplied in the expression, in the same order.\n */\n\n }, {\n key: \"addFunction\",\n value: function addFunction(name, fn) {\n this._grammar.functions[name] = fn;\n }\n /**\n * Syntactic sugar for calling {@link #addFunction} repeatedly. This function\n * accepts a map of one or more expression function names to their javascript\n * function counterpart.\n * @param {{}} map A map of expression function names to javascript functions\n */\n\n }, {\n key: \"addFunctions\",\n value: function addFunctions(map) {\n for (var key in map) {\n this._grammar.functions[key] = map[key];\n }\n }\n /**\n * Adds a unary operator to Jexl. Unary operators are currently only supported\n * on the left side of the value on which it will operate.\n * @param {string} operator The operator string to be added\n * @param {function} fn A function to run to calculate the result. The function\n * will be called with one argument: the literal value to the right of the\n * operator. It should return either the resulting value, or a Promise\n * that resolves with the resulting value.\n */\n\n }, {\n key: \"addUnaryOp\",\n value: function addUnaryOp(operator, fn) {\n this._addGrammarElement(operator, {\n type: 'unaryOp',\n weight: Infinity,\n eval: fn\n });\n }\n /**\n * Adds or replaces a transform function in this Jexl instance.\n * @param {string} name The name of the transform function, as it will be used\n * within Jexl expressions\n * @param {function} fn The function to be executed when this transform is\n * invoked. It will be provided with at least one argument:\n * - {*} value: The value to be transformed\n * - {...*} args: The arguments for this transform\n */\n\n }, {\n key: \"addTransform\",\n value: function addTransform(name, fn) {\n this._grammar.transforms[name] = fn;\n }\n /**\n * Syntactic sugar for calling {@link #addTransform} repeatedly. This function\n * accepts a map of one or more transform names to their transform function.\n * @param {{}} map A map of transform names to transform functions\n */\n\n }, {\n key: \"addTransforms\",\n value: function addTransforms(map) {\n for (var key in map) {\n this._grammar.transforms[key] = map[key];\n }\n }\n /**\n * Creates an Expression object from the given Jexl expression string, and\n * immediately compiles it. The returned Expression object can then be\n * evaluated multiple times with new contexts, without generating any\n * additional string processing overhead.\n * @param {string} expression The Jexl expression to be compiled\n * @returns {Expression} The compiled Expression object\n */\n\n }, {\n key: \"compile\",\n value: function compile(expression) {\n var exprObj = this.createExpression(expression);\n return exprObj.compile();\n }\n /**\n * Constructs an Expression object from a Jexl expression string.\n * @param {string} expression The Jexl expression to be wrapped in an\n * Expression object\n * @returns {Expression} The Expression object representing the given string\n */\n\n }, {\n key: \"createExpression\",\n value: function createExpression(expression) {\n return new Expression(this._grammar, expression);\n }\n /**\n * Retrieves a previously set expression function.\n * @param {string} name The name of the expression function\n * @returns {function} The expression function\n */\n\n }, {\n key: \"getFunction\",\n value: function getFunction(name) {\n return this._grammar.functions[name];\n }\n /**\n * Retrieves a previously set transform function.\n * @param {string} name The name of the transform function\n * @returns {function} The transform function\n */\n\n }, {\n key: \"getTransform\",\n value: function getTransform(name) {\n return this._grammar.transforms[name];\n }\n /**\n * Asynchronously evaluates a Jexl string within an optional context.\n * @param {string} expression The Jexl expression to be evaluated\n * @param {Object} [context] A mapping of variables to values, which will be\n * made accessible to the Jexl expression when evaluating it\n * @returns {Promise<*>} resolves with the result of the evaluation.\n */\n\n }, {\n key: \"eval\",\n value: function _eval(expression) {\n var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var exprObj = this.createExpression(expression);\n return exprObj.eval(context);\n }\n /**\n * Synchronously evaluates a Jexl string within an optional context.\n * @param {string} expression The Jexl expression to be evaluated\n * @param {Object} [context] A mapping of variables to values, which will be\n * made accessible to the Jexl expression when evaluating it\n * @returns {*} the result of the evaluation.\n * @throws {*} on error\n */\n\n }, {\n key: \"evalSync\",\n value: function evalSync(expression) {\n var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var exprObj = this.createExpression(expression);\n return exprObj.evalSync(context);\n }\n /**\n * A JavaScript template literal to allow expressions to be defined by the\n * syntax: expr`40 + 2`\n * @param {Array} strs\n * @param {...any} args\n */\n\n }, {\n key: \"expr\",\n value: function expr(strs) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n var exprStr = strs.reduce(function (acc, str, idx) {\n var arg = idx < args.length ? args[idx] : '';\n acc += str + arg;\n return acc;\n }, '');\n return this.createExpression(exprStr);\n }\n /**\n * Removes a binary or unary operator from the Jexl grammar.\n * @param {string} operator The operator string to be removed\n */\n\n }, {\n key: \"removeOp\",\n value: function removeOp(operator) {\n if (this._grammar.elements[operator] && (this._grammar.elements[operator].type === 'binaryOp' || this._grammar.elements[operator].type === 'unaryOp')) {\n delete this._grammar.elements[operator];\n }\n }\n /**\n * Adds an element to the grammar map used by this Jexl instance.\n * @param {string} str The key string to be added\n * @param {{type: }} obj A map of configuration options for this\n * grammar element\n * @private\n */\n\n }, {\n key: \"_addGrammarElement\",\n value: function _addGrammarElement(str, obj) {\n this._grammar.elements[str] = obj;\n }\n }]);\n return Jexl;\n}();\n\nmodule.exports = new Jexl();\nmodule.exports.Jexl = Jexl;","'use strict';\n\nvar each = require('foreach');\nmodule.exports = api;\n\n\n/**\n * Convenience wrapper around the api.\n * Calls `.get` when called with an `object` and a `pointer`.\n * Calls `.set` when also called with `value`.\n * If only supplied `object`, returns a partially applied function, mapped to the object.\n *\n * @param {Object} obj\n * @param {String|Array} pointer\n * @param value\n * @returns {*}\n */\n\nfunction api (obj, pointer, value) {\n // .set()\n if (arguments.length === 3) {\n return api.set(obj, pointer, value);\n }\n // .get()\n if (arguments.length === 2) {\n return api.get(obj, pointer);\n }\n // Return a partially applied function on `obj`.\n var wrapped = api.bind(api, obj);\n\n // Support for oo style\n for (var name in api) {\n if (api.hasOwnProperty(name)) {\n wrapped[name] = api[name].bind(wrapped, obj);\n }\n }\n return wrapped;\n}\n\n\n/**\n * Lookup a json pointer in an object\n *\n * @param {Object} obj\n * @param {String|Array} pointer\n * @returns {*}\n */\napi.get = function get (obj, pointer) {\n var refTokens = Array.isArray(pointer) ? pointer : api.parse(pointer);\n\n for (var i = 0; i < refTokens.length; ++i) {\n var tok = refTokens[i];\n if (!(typeof obj == 'object' && tok in obj)) {\n throw new Error('Invalid reference token: ' + tok);\n }\n obj = obj[tok];\n }\n return obj;\n};\n\n/**\n * Sets a value on an object\n *\n * @param {Object} obj\n * @param {String|Array} pointer\n * @param value\n */\napi.set = function set (obj, pointer, value) {\n var refTokens = Array.isArray(pointer) ? pointer : api.parse(pointer),\n nextTok = refTokens[0];\n\n if (refTokens.length === 0) {\n throw Error('Can not set the root object');\n }\n\n for (var i = 0; i < refTokens.length - 1; ++i) {\n var tok = refTokens[i];\n if (tok === \"__proto__\" || tok === \"constructor\" || tok === \"prototype\") {\n continue\n }\n if (tok === '-' && Array.isArray(obj)) {\n tok = obj.length;\n }\n nextTok = refTokens[i + 1];\n\n if (!(tok in obj)) {\n if (nextTok.match(/^(\\d+|-)$/)) {\n obj[tok] = [];\n } else {\n obj[tok] = {};\n }\n }\n obj = obj[tok];\n }\n if (nextTok === '-' && Array.isArray(obj)) {\n nextTok = obj.length;\n }\n obj[nextTok] = value;\n return this;\n};\n\n/**\n * Removes an attribute\n *\n * @param {Object} obj\n * @param {String|Array} pointer\n */\napi.remove = function (obj, pointer) {\n var refTokens = Array.isArray(pointer) ? pointer : api.parse(pointer);\n var finalToken = refTokens[refTokens.length -1];\n if (finalToken === undefined) {\n throw new Error('Invalid JSON pointer for remove: \"' + pointer + '\"');\n }\n\n var parent = api.get(obj, refTokens.slice(0, -1));\n if (Array.isArray(parent)) {\n var index = +finalToken;\n if (finalToken === '' && isNaN(index)) {\n throw new Error('Invalid array index: \"' + finalToken + '\"');\n }\n\n Array.prototype.splice.call(parent, index, 1);\n } else {\n delete parent[finalToken];\n }\n};\n\n/**\n * Returns a (pointer -> value) dictionary for an object\n *\n * @param obj\n * @param {function} descend\n * @returns {}\n */\napi.dict = function dict (obj, descend) {\n var results = {};\n api.walk(obj, function (value, pointer) {\n results[pointer] = value;\n }, descend);\n return results;\n};\n\n/**\n * Iterates over an object\n * Iterator: function (value, pointer) {}\n *\n * @param obj\n * @param {function} iterator\n * @param {function} descend\n */\napi.walk = function walk (obj, iterator, descend) {\n var refTokens = [];\n\n descend = descend || function (value) {\n var type = Object.prototype.toString.call(value);\n return type === '[object Object]' || type === '[object Array]';\n };\n\n (function next (cur) {\n each(cur, function (value, key) {\n refTokens.push(String(key));\n if (descend(value)) {\n next(value);\n } else {\n iterator(value, api.compile(refTokens));\n }\n refTokens.pop();\n });\n }(obj));\n};\n\n/**\n * Tests if an object has a value for a json pointer\n *\n * @param obj\n * @param pointer\n * @returns {boolean}\n */\napi.has = function has (obj, pointer) {\n try {\n api.get(obj, pointer);\n } catch (e) {\n return false;\n }\n return true;\n};\n\n/**\n * Escapes a reference token\n *\n * @param str\n * @returns {string}\n */\napi.escape = function escape (str) {\n return str.toString().replace(/~/g, '~0').replace(/\\//g, '~1');\n};\n\n/**\n * Unescapes a reference token\n *\n * @param str\n * @returns {string}\n */\napi.unescape = function unescape (str) {\n return str.replace(/~1/g, '/').replace(/~0/g, '~');\n};\n\n/**\n * Converts a json pointer into a array of reference tokens\n *\n * @param pointer\n * @returns {Array}\n */\napi.parse = function parse (pointer) {\n if (pointer === '') { return []; }\n if (pointer.charAt(0) !== '/') { throw new Error('Invalid JSON pointer: ' + pointer); }\n return pointer.substring(1).split(/\\//).map(api.unescape);\n};\n\n/**\n * Builds a json pointer from a array of reference tokens\n *\n * @param refTokens\n * @returns {string}\n */\napi.compile = function compile (refTokens) {\n if (refTokens.length === 0) { return ''; }\n return '/' + refTokens.map(api.escape).join('/');\n};\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"table\":\"table--3OVMF8dOBt\",\"header\":\"header--18fHWvcEtu\",\"header-cell\":\"header-cell--1qOOcy4Q47\",\"headerCell\":\"header-cell--1qOOcy4Q47\",\"cell\":\"cell--3QhdjYDo1X\",\"button-cell\":\"button-cell--15ZsRHax0E\",\"buttonCell\":\"button-cell--15ZsRHax0E\",\"clickable\":\"clickable--lc4pQQLkgC\",\"cell-content\":\"cell-content--2c7QOZz1IK\",\"cellContent\":\"cell-content--2c7QOZz1IK\",\"toggle-icon\":\"toggle-icon--_hQt5-ocNY\",\"toggleIcon\":\"toggle-icon--_hQt5-ocNY\",\"cell-select\":\"cell-select--3m02H4FoaS\",\"cellSelect\":\"cell-select--3m02H4FoaS\",\"header-cell-sort-icon\":\"header-cell-sort-icon--3-IhntFNCe\",\"headerCellSortIcon\":\"header-cell-sort-icon--3-IhntFNCe\",\"header-button-cell\":\"header-button-cell--2jMdDWPow1\",\"headerButtonCell\":\"header-button-cell--2jMdDWPow1\",\"row\":\"row--16jZlysVSE\",\"disabled\":\"disabled--1uF4YhmIxh\",\"small\":\"small--1KOK57-GZT\",\"table-placeholder-area\":\"table-placeholder-area--2Wzvqb7dX0\",\"tablePlaceholderArea\":\"table-placeholder-area--2Wzvqb7dX0\",\"table-placeholder-icon\":\"table-placeholder-icon---y33ZMzRTK\",\"tablePlaceholderIcon\":\"table-placeholder-icon---y33ZMzRTK\",\"table-placeholder-text\":\"table-placeholder-text--3TB4_8UnLX\",\"tablePlaceholderText\":\"table-placeholder-text--3TB4_8UnLX\",\"dark\":\"dark--3w5GzWBb9F\",\"light\":\"light--3RBAs_BrII\"};","/*global define:false */\n/**\n * Copyright 2012-2017 Craig Campbell\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * Mousetrap is a simple keyboard shortcut library for Javascript with\n * no external dependencies\n *\n * @version 1.6.5\n * @url craig.is/killing/mice\n */\n(function(window, document, undefined) {\n\n // Check if mousetrap is used inside browser, if not, return\n if (!window) {\n return;\n }\n\n /**\n * mapping of special keycodes to their corresponding keys\n *\n * everything in this dictionary cannot use keypress events\n * so it has to be here to map to the correct keycodes for\n * keyup/keydown events\n *\n * @type {Object}\n */\n var _MAP = {\n 8: 'backspace',\n 9: 'tab',\n 13: 'enter',\n 16: 'shift',\n 17: 'ctrl',\n 18: 'alt',\n 20: 'capslock',\n 27: 'esc',\n 32: 'space',\n 33: 'pageup',\n 34: 'pagedown',\n 35: 'end',\n 36: 'home',\n 37: 'left',\n 38: 'up',\n 39: 'right',\n 40: 'down',\n 45: 'ins',\n 46: 'del',\n 91: 'meta',\n 93: 'meta',\n 224: 'meta'\n };\n\n /**\n * mapping for special characters so they can support\n *\n * this dictionary is only used incase you want to bind a\n * keyup or keydown event to one of these keys\n *\n * @type {Object}\n */\n var _KEYCODE_MAP = {\n 106: '*',\n 107: '+',\n 109: '-',\n 110: '.',\n 111 : '/',\n 186: ';',\n 187: '=',\n 188: ',',\n 189: '-',\n 190: '.',\n 191: '/',\n 192: '`',\n 219: '[',\n 220: '\\\\',\n 221: ']',\n 222: '\\''\n };\n\n /**\n * this is a mapping of keys that require shift on a US keypad\n * back to the non shift equivelents\n *\n * this is so you can use keyup events with these keys\n *\n * note that this will only work reliably on US keyboards\n *\n * @type {Object}\n */\n var _SHIFT_MAP = {\n '~': '`',\n '!': '1',\n '@': '2',\n '#': '3',\n '$': '4',\n '%': '5',\n '^': '6',\n '&': '7',\n '*': '8',\n '(': '9',\n ')': '0',\n '_': '-',\n '+': '=',\n ':': ';',\n '\\\"': '\\'',\n '<': ',',\n '>': '.',\n '?': '/',\n '|': '\\\\'\n };\n\n /**\n * this is a list of special strings you can use to map\n * to modifier keys when you specify your keyboard shortcuts\n *\n * @type {Object}\n */\n var _SPECIAL_ALIASES = {\n 'option': 'alt',\n 'command': 'meta',\n 'return': 'enter',\n 'escape': 'esc',\n 'plus': '+',\n 'mod': /Mac|iPod|iPhone|iPad/.test(navigator.platform) ? 'meta' : 'ctrl'\n };\n\n /**\n * variable to store the flipped version of _MAP from above\n * needed to check if we should use keypress or not when no action\n * is specified\n *\n * @type {Object|undefined}\n */\n var _REVERSE_MAP;\n\n /**\n * loop through the f keys, f1 to f19 and add them to the map\n * programatically\n */\n for (var i = 1; i < 20; ++i) {\n _MAP[111 + i] = 'f' + i;\n }\n\n /**\n * loop through to map numbers on the numeric keypad\n */\n for (i = 0; i <= 9; ++i) {\n\n // This needs to use a string cause otherwise since 0 is falsey\n // mousetrap will never fire for numpad 0 pressed as part of a keydown\n // event.\n //\n // @see https://github.com/ccampbell/mousetrap/pull/258\n _MAP[i + 96] = i.toString();\n }\n\n /**\n * cross browser add event method\n *\n * @param {Element|HTMLDocument} object\n * @param {string} type\n * @param {Function} callback\n * @returns void\n */\n function _addEvent(object, type, callback) {\n if (object.addEventListener) {\n object.addEventListener(type, callback, false);\n return;\n }\n\n object.attachEvent('on' + type, callback);\n }\n\n /**\n * takes the event and returns the key character\n *\n * @param {Event} e\n * @return {string}\n */\n function _characterFromEvent(e) {\n\n // for keypress events we should return the character as is\n if (e.type == 'keypress') {\n var character = String.fromCharCode(e.which);\n\n // if the shift key is not pressed then it is safe to assume\n // that we want the character to be lowercase. this means if\n // you accidentally have caps lock on then your key bindings\n // will continue to work\n //\n // the only side effect that might not be desired is if you\n // bind something like 'A' cause you want to trigger an\n // event when capital A is pressed caps lock will no longer\n // trigger the event. shift+a will though.\n if (!e.shiftKey) {\n character = character.toLowerCase();\n }\n\n return character;\n }\n\n // for non keypress events the special maps are needed\n if (_MAP[e.which]) {\n return _MAP[e.which];\n }\n\n if (_KEYCODE_MAP[e.which]) {\n return _KEYCODE_MAP[e.which];\n }\n\n // if it is not in the special map\n\n // with keydown and keyup events the character seems to always\n // come in as an uppercase character whether you are pressing shift\n // or not. we should make sure it is always lowercase for comparisons\n return String.fromCharCode(e.which).toLowerCase();\n }\n\n /**\n * checks if two arrays are equal\n *\n * @param {Array} modifiers1\n * @param {Array} modifiers2\n * @returns {boolean}\n */\n function _modifiersMatch(modifiers1, modifiers2) {\n return modifiers1.sort().join(',') === modifiers2.sort().join(',');\n }\n\n /**\n * takes a key event and figures out what the modifiers are\n *\n * @param {Event} e\n * @returns {Array}\n */\n function _eventModifiers(e) {\n var modifiers = [];\n\n if (e.shiftKey) {\n modifiers.push('shift');\n }\n\n if (e.altKey) {\n modifiers.push('alt');\n }\n\n if (e.ctrlKey) {\n modifiers.push('ctrl');\n }\n\n if (e.metaKey) {\n modifiers.push('meta');\n }\n\n return modifiers;\n }\n\n /**\n * prevents default for this event\n *\n * @param {Event} e\n * @returns void\n */\n function _preventDefault(e) {\n if (e.preventDefault) {\n e.preventDefault();\n return;\n }\n\n e.returnValue = false;\n }\n\n /**\n * stops propogation for this event\n *\n * @param {Event} e\n * @returns void\n */\n function _stopPropagation(e) {\n if (e.stopPropagation) {\n e.stopPropagation();\n return;\n }\n\n e.cancelBubble = true;\n }\n\n /**\n * determines if the keycode specified is a modifier key or not\n *\n * @param {string} key\n * @returns {boolean}\n */\n function _isModifier(key) {\n return key == 'shift' || key == 'ctrl' || key == 'alt' || key == 'meta';\n }\n\n /**\n * reverses the map lookup so that we can look for specific keys\n * to see what can and can't use keypress\n *\n * @return {Object}\n */\n function _getReverseMap() {\n if (!_REVERSE_MAP) {\n _REVERSE_MAP = {};\n for (var key in _MAP) {\n\n // pull out the numeric keypad from here cause keypress should\n // be able to detect the keys from the character\n if (key > 95 && key < 112) {\n continue;\n }\n\n if (_MAP.hasOwnProperty(key)) {\n _REVERSE_MAP[_MAP[key]] = key;\n }\n }\n }\n return _REVERSE_MAP;\n }\n\n /**\n * picks the best action based on the key combination\n *\n * @param {string} key - character for key\n * @param {Array} modifiers\n * @param {string=} action passed in\n */\n function _pickBestAction(key, modifiers, action) {\n\n // if no action was picked in we should try to pick the one\n // that we think would work best for this key\n if (!action) {\n action = _getReverseMap()[key] ? 'keydown' : 'keypress';\n }\n\n // modifier keys don't work as expected with keypress,\n // switch to keydown\n if (action == 'keypress' && modifiers.length) {\n action = 'keydown';\n }\n\n return action;\n }\n\n /**\n * Converts from a string key combination to an array\n *\n * @param {string} combination like \"command+shift+l\"\n * @return {Array}\n */\n function _keysFromString(combination) {\n if (combination === '+') {\n return ['+'];\n }\n\n combination = combination.replace(/\\+{2}/g, '+plus');\n return combination.split('+');\n }\n\n /**\n * Gets info for a specific key combination\n *\n * @param {string} combination key combination (\"command+s\" or \"a\" or \"*\")\n * @param {string=} action\n * @returns {Object}\n */\n function _getKeyInfo(combination, action) {\n var keys;\n var key;\n var i;\n var modifiers = [];\n\n // take the keys from this pattern and figure out what the actual\n // pattern is all about\n keys = _keysFromString(combination);\n\n for (i = 0; i < keys.length; ++i) {\n key = keys[i];\n\n // normalize key names\n if (_SPECIAL_ALIASES[key]) {\n key = _SPECIAL_ALIASES[key];\n }\n\n // if this is not a keypress event then we should\n // be smart about using shift keys\n // this will only work for US keyboards however\n if (action && action != 'keypress' && _SHIFT_MAP[key]) {\n key = _SHIFT_MAP[key];\n modifiers.push('shift');\n }\n\n // if this key is a modifier then add it to the list of modifiers\n if (_isModifier(key)) {\n modifiers.push(key);\n }\n }\n\n // depending on what the key combination is\n // we will try to pick the best event for it\n action = _pickBestAction(key, modifiers, action);\n\n return {\n key: key,\n modifiers: modifiers,\n action: action\n };\n }\n\n function _belongsTo(element, ancestor) {\n if (element === null || element === document) {\n return false;\n }\n\n if (element === ancestor) {\n return true;\n }\n\n return _belongsTo(element.parentNode, ancestor);\n }\n\n function Mousetrap(targetElement) {\n var self = this;\n\n targetElement = targetElement || document;\n\n if (!(self instanceof Mousetrap)) {\n return new Mousetrap(targetElement);\n }\n\n /**\n * element to attach key events to\n *\n * @type {Element}\n */\n self.target = targetElement;\n\n /**\n * a list of all the callbacks setup via Mousetrap.bind()\n *\n * @type {Object}\n */\n self._callbacks = {};\n\n /**\n * direct map of string combinations to callbacks used for trigger()\n *\n * @type {Object}\n */\n self._directMap = {};\n\n /**\n * keeps track of what level each sequence is at since multiple\n * sequences can start out with the same sequence\n *\n * @type {Object}\n */\n var _sequenceLevels = {};\n\n /**\n * variable to store the setTimeout call\n *\n * @type {null|number}\n */\n var _resetTimer;\n\n /**\n * temporary state where we will ignore the next keyup\n *\n * @type {boolean|string}\n */\n var _ignoreNextKeyup = false;\n\n /**\n * temporary state where we will ignore the next keypress\n *\n * @type {boolean}\n */\n var _ignoreNextKeypress = false;\n\n /**\n * are we currently inside of a sequence?\n * type of action (\"keyup\" or \"keydown\" or \"keypress\") or false\n *\n * @type {boolean|string}\n */\n var _nextExpectedAction = false;\n\n /**\n * resets all sequence counters except for the ones passed in\n *\n * @param {Object} doNotReset\n * @returns void\n */\n function _resetSequences(doNotReset) {\n doNotReset = doNotReset || {};\n\n var activeSequences = false,\n key;\n\n for (key in _sequenceLevels) {\n if (doNotReset[key]) {\n activeSequences = true;\n continue;\n }\n _sequenceLevels[key] = 0;\n }\n\n if (!activeSequences) {\n _nextExpectedAction = false;\n }\n }\n\n /**\n * finds all callbacks that match based on the keycode, modifiers,\n * and action\n *\n * @param {string} character\n * @param {Array} modifiers\n * @param {Event|Object} e\n * @param {string=} sequenceName - name of the sequence we are looking for\n * @param {string=} combination\n * @param {number=} level\n * @returns {Array}\n */\n function _getMatches(character, modifiers, e, sequenceName, combination, level) {\n var i;\n var callback;\n var matches = [];\n var action = e.type;\n\n // if there are no events related to this keycode\n if (!self._callbacks[character]) {\n return [];\n }\n\n // if a modifier key is coming up on its own we should allow it\n if (action == 'keyup' && _isModifier(character)) {\n modifiers = [character];\n }\n\n // loop through all callbacks for the key that was pressed\n // and see if any of them match\n for (i = 0; i < self._callbacks[character].length; ++i) {\n callback = self._callbacks[character][i];\n\n // if a sequence name is not specified, but this is a sequence at\n // the wrong level then move onto the next match\n if (!sequenceName && callback.seq && _sequenceLevels[callback.seq] != callback.level) {\n continue;\n }\n\n // if the action we are looking for doesn't match the action we got\n // then we should keep going\n if (action != callback.action) {\n continue;\n }\n\n // if this is a keypress event and the meta key and control key\n // are not pressed that means that we need to only look at the\n // character, otherwise check the modifiers as well\n //\n // chrome will not fire a keypress if meta or control is down\n // safari will fire a keypress if meta or meta+shift is down\n // firefox will fire a keypress if meta or control is down\n if ((action == 'keypress' && !e.metaKey && !e.ctrlKey) || _modifiersMatch(modifiers, callback.modifiers)) {\n\n // when you bind a combination or sequence a second time it\n // should overwrite the first one. if a sequenceName or\n // combination is specified in this call it does just that\n //\n // @todo make deleting its own method?\n var deleteCombo = !sequenceName && callback.combo == combination;\n var deleteSequence = sequenceName && callback.seq == sequenceName && callback.level == level;\n if (deleteCombo || deleteSequence) {\n self._callbacks[character].splice(i, 1);\n }\n\n matches.push(callback);\n }\n }\n\n return matches;\n }\n\n /**\n * actually calls the callback function\n *\n * if your callback function returns false this will use the jquery\n * convention - prevent default and stop propogation on the event\n *\n * @param {Function} callback\n * @param {Event} e\n * @returns void\n */\n function _fireCallback(callback, e, combo, sequence) {\n\n // if this event should not happen stop here\n if (self.stopCallback(e, e.target || e.srcElement, combo, sequence)) {\n return;\n }\n\n if (callback(e, combo) === false) {\n _preventDefault(e);\n _stopPropagation(e);\n }\n }\n\n /**\n * handles a character key event\n *\n * @param {string} character\n * @param {Array} modifiers\n * @param {Event} e\n * @returns void\n */\n self._handleKey = function(character, modifiers, e) {\n var callbacks = _getMatches(character, modifiers, e);\n var i;\n var doNotReset = {};\n var maxLevel = 0;\n var processedSequenceCallback = false;\n\n // Calculate the maxLevel for sequences so we can only execute the longest callback sequence\n for (i = 0; i < callbacks.length; ++i) {\n if (callbacks[i].seq) {\n maxLevel = Math.max(maxLevel, callbacks[i].level);\n }\n }\n\n // loop through matching callbacks for this key event\n for (i = 0; i < callbacks.length; ++i) {\n\n // fire for all sequence callbacks\n // this is because if for example you have multiple sequences\n // bound such as \"g i\" and \"g t\" they both need to fire the\n // callback for matching g cause otherwise you can only ever\n // match the first one\n if (callbacks[i].seq) {\n\n // only fire callbacks for the maxLevel to prevent\n // subsequences from also firing\n //\n // for example 'a option b' should not cause 'option b' to fire\n // even though 'option b' is part of the other sequence\n //\n // any sequences that do not match here will be discarded\n // below by the _resetSequences call\n if (callbacks[i].level != maxLevel) {\n continue;\n }\n\n processedSequenceCallback = true;\n\n // keep a list of which sequences were matches for later\n doNotReset[callbacks[i].seq] = 1;\n _fireCallback(callbacks[i].callback, e, callbacks[i].combo, callbacks[i].seq);\n continue;\n }\n\n // if there were no sequence matches but we are still here\n // that means this is a regular match so we should fire that\n if (!processedSequenceCallback) {\n _fireCallback(callbacks[i].callback, e, callbacks[i].combo);\n }\n }\n\n // if the key you pressed matches the type of sequence without\n // being a modifier (ie \"keyup\" or \"keypress\") then we should\n // reset all sequences that were not matched by this event\n //\n // this is so, for example, if you have the sequence \"h a t\" and you\n // type \"h e a r t\" it does not match. in this case the \"e\" will\n // cause the sequence to reset\n //\n // modifier keys are ignored because you can have a sequence\n // that contains modifiers such as \"enter ctrl+space\" and in most\n // cases the modifier key will be pressed before the next key\n //\n // also if you have a sequence such as \"ctrl+b a\" then pressing the\n // \"b\" key will trigger a \"keypress\" and a \"keydown\"\n //\n // the \"keydown\" is expected when there is a modifier, but the\n // \"keypress\" ends up matching the _nextExpectedAction since it occurs\n // after and that causes the sequence to reset\n //\n // we ignore keypresses in a sequence that directly follow a keydown\n // for the same character\n var ignoreThisKeypress = e.type == 'keypress' && _ignoreNextKeypress;\n if (e.type == _nextExpectedAction && !_isModifier(character) && !ignoreThisKeypress) {\n _resetSequences(doNotReset);\n }\n\n _ignoreNextKeypress = processedSequenceCallback && e.type == 'keydown';\n };\n\n /**\n * handles a keydown event\n *\n * @param {Event} e\n * @returns void\n */\n function _handleKeyEvent(e) {\n\n // normalize e.which for key events\n // @see http://stackoverflow.com/questions/4285627/javascript-keycode-vs-charcode-utter-confusion\n if (typeof e.which !== 'number') {\n e.which = e.keyCode;\n }\n\n var character = _characterFromEvent(e);\n\n // no character found then stop\n if (!character) {\n return;\n }\n\n // need to use === for the character check because the character can be 0\n if (e.type == 'keyup' && _ignoreNextKeyup === character) {\n _ignoreNextKeyup = false;\n return;\n }\n\n self.handleKey(character, _eventModifiers(e), e);\n }\n\n /**\n * called to set a 1 second timeout on the specified sequence\n *\n * this is so after each key press in the sequence you have 1 second\n * to press the next key before you have to start over\n *\n * @returns void\n */\n function _resetSequenceTimer() {\n clearTimeout(_resetTimer);\n _resetTimer = setTimeout(_resetSequences, 1000);\n }\n\n /**\n * binds a key sequence to an event\n *\n * @param {string} combo - combo specified in bind call\n * @param {Array} keys\n * @param {Function} callback\n * @param {string=} action\n * @returns void\n */\n function _bindSequence(combo, keys, callback, action) {\n\n // start off by adding a sequence level record for this combination\n // and setting the level to 0\n _sequenceLevels[combo] = 0;\n\n /**\n * callback to increase the sequence level for this sequence and reset\n * all other sequences that were active\n *\n * @param {string} nextAction\n * @returns {Function}\n */\n function _increaseSequence(nextAction) {\n return function() {\n _nextExpectedAction = nextAction;\n ++_sequenceLevels[combo];\n _resetSequenceTimer();\n };\n }\n\n /**\n * wraps the specified callback inside of another function in order\n * to reset all sequence counters as soon as this sequence is done\n *\n * @param {Event} e\n * @returns void\n */\n function _callbackAndReset(e) {\n _fireCallback(callback, e, combo);\n\n // we should ignore the next key up if the action is key down\n // or keypress. this is so if you finish a sequence and\n // release the key the final key will not trigger a keyup\n if (action !== 'keyup') {\n _ignoreNextKeyup = _characterFromEvent(e);\n }\n\n // weird race condition if a sequence ends with the key\n // another sequence begins with\n setTimeout(_resetSequences, 10);\n }\n\n // loop through keys one at a time and bind the appropriate callback\n // function. for any key leading up to the final one it should\n // increase the sequence. after the final, it should reset all sequences\n //\n // if an action is specified in the original bind call then that will\n // be used throughout. otherwise we will pass the action that the\n // next key in the sequence should match. this allows a sequence\n // to mix and match keypress and keydown events depending on which\n // ones are better suited to the key provided\n for (var i = 0; i < keys.length; ++i) {\n var isFinal = i + 1 === keys.length;\n var wrappedCallback = isFinal ? _callbackAndReset : _increaseSequence(action || _getKeyInfo(keys[i + 1]).action);\n _bindSingle(keys[i], wrappedCallback, action, combo, i);\n }\n }\n\n /**\n * binds a single keyboard combination\n *\n * @param {string} combination\n * @param {Function} callback\n * @param {string=} action\n * @param {string=} sequenceName - name of sequence if part of sequence\n * @param {number=} level - what part of the sequence the command is\n * @returns void\n */\n function _bindSingle(combination, callback, action, sequenceName, level) {\n\n // store a direct mapped reference for use with Mousetrap.trigger\n self._directMap[combination + ':' + action] = callback;\n\n // make sure multiple spaces in a row become a single space\n combination = combination.replace(/\\s+/g, ' ');\n\n var sequence = combination.split(' ');\n var info;\n\n // if this pattern is a sequence of keys then run through this method\n // to reprocess each pattern one key at a time\n if (sequence.length > 1) {\n _bindSequence(combination, sequence, callback, action);\n return;\n }\n\n info = _getKeyInfo(combination, action);\n\n // make sure to initialize array if this is the first time\n // a callback is added for this key\n self._callbacks[info.key] = self._callbacks[info.key] || [];\n\n // remove an existing match if there is one\n _getMatches(info.key, info.modifiers, {type: info.action}, sequenceName, combination, level);\n\n // add this call back to the array\n // if it is a sequence put it at the beginning\n // if not put it at the end\n //\n // this is important because the way these are processed expects\n // the sequence ones to come first\n self._callbacks[info.key][sequenceName ? 'unshift' : 'push']({\n callback: callback,\n modifiers: info.modifiers,\n action: info.action,\n seq: sequenceName,\n level: level,\n combo: combination\n });\n }\n\n /**\n * binds multiple combinations to the same callback\n *\n * @param {Array} combinations\n * @param {Function} callback\n * @param {string|undefined} action\n * @returns void\n */\n self._bindMultiple = function(combinations, callback, action) {\n for (var i = 0; i < combinations.length; ++i) {\n _bindSingle(combinations[i], callback, action);\n }\n };\n\n // start!\n _addEvent(targetElement, 'keypress', _handleKeyEvent);\n _addEvent(targetElement, 'keydown', _handleKeyEvent);\n _addEvent(targetElement, 'keyup', _handleKeyEvent);\n }\n\n /**\n * binds an event to mousetrap\n *\n * can be a single key, a combination of keys separated with +,\n * an array of keys, or a sequence of keys separated by spaces\n *\n * be sure to list the modifier keys first to make sure that the\n * correct key ends up getting bound (the last key in the pattern)\n *\n * @param {string|Array} keys\n * @param {Function} callback\n * @param {string=} action - 'keypress', 'keydown', or 'keyup'\n * @returns void\n */\n Mousetrap.prototype.bind = function(keys, callback, action) {\n var self = this;\n keys = keys instanceof Array ? keys : [keys];\n self._bindMultiple.call(self, keys, callback, action);\n return self;\n };\n\n /**\n * unbinds an event to mousetrap\n *\n * the unbinding sets the callback function of the specified key combo\n * to an empty function and deletes the corresponding key in the\n * _directMap dict.\n *\n * TODO: actually remove this from the _callbacks dictionary instead\n * of binding an empty function\n *\n * the keycombo+action has to be exactly the same as\n * it was defined in the bind method\n *\n * @param {string|Array} keys\n * @param {string} action\n * @returns void\n */\n Mousetrap.prototype.unbind = function(keys, action) {\n var self = this;\n return self.bind.call(self, keys, function() {}, action);\n };\n\n /**\n * triggers an event that has already been bound\n *\n * @param {string} keys\n * @param {string=} action\n * @returns void\n */\n Mousetrap.prototype.trigger = function(keys, action) {\n var self = this;\n if (self._directMap[keys + ':' + action]) {\n self._directMap[keys + ':' + action]({}, keys);\n }\n return self;\n };\n\n /**\n * resets the library back to its initial state. this is useful\n * if you want to clear out the current keyboard shortcuts and bind\n * new ones - for example if you switch to another page\n *\n * @returns void\n */\n Mousetrap.prototype.reset = function() {\n var self = this;\n self._callbacks = {};\n self._directMap = {};\n return self;\n };\n\n /**\n * should we stop this event before firing off callbacks\n *\n * @param {Event} e\n * @param {Element} element\n * @return {boolean}\n */\n Mousetrap.prototype.stopCallback = function(e, element) {\n var self = this;\n\n // if the element has the class \"mousetrap\" then no need to stop\n if ((' ' + element.className + ' ').indexOf(' mousetrap ') > -1) {\n return false;\n }\n\n if (_belongsTo(element, self.target)) {\n return false;\n }\n\n // Events originating from a shadow DOM are re-targetted and `e.target` is the shadow host,\n // not the initial event target in the shadow tree. Note that not all events cross the\n // shadow boundary.\n // For shadow trees with `mode: 'open'`, the initial event target is the first element in\n // the event’s composed path. For shadow trees with `mode: 'closed'`, the initial event\n // target cannot be obtained.\n if ('composedPath' in e && typeof e.composedPath === 'function') {\n // For open shadow trees, update `element` so that the following check works.\n var initialEventTarget = e.composedPath()[0];\n if (initialEventTarget !== e.target) {\n element = initialEventTarget;\n }\n }\n\n // stop for input, select, and textarea\n return element.tagName == 'INPUT' || element.tagName == 'SELECT' || element.tagName == 'TEXTAREA' || element.isContentEditable;\n };\n\n /**\n * exposes _handleKey publicly so it can be overwritten by extensions\n */\n Mousetrap.prototype.handleKey = function() {\n var self = this;\n return self._handleKey.apply(self, arguments);\n };\n\n /**\n * allow custom key mappings\n */\n Mousetrap.addKeycodes = function(object) {\n for (var key in object) {\n if (object.hasOwnProperty(key)) {\n _MAP[key] = object[key];\n }\n }\n _REVERSE_MAP = null;\n };\n\n /**\n * Init the global mousetrap functions\n *\n * This method is needed to allow the global mousetrap functions to work\n * now that mousetrap is a constructor function.\n */\n Mousetrap.init = function() {\n var documentMousetrap = Mousetrap(document);\n for (var method in documentMousetrap) {\n if (method.charAt(0) !== '_') {\n Mousetrap[method] = (function(method) {\n return function() {\n return documentMousetrap[method].apply(documentMousetrap, arguments);\n };\n } (method));\n }\n }\n };\n\n Mousetrap.init();\n\n // expose mousetrap to the global object\n window.Mousetrap = Mousetrap;\n\n // expose as a common js module\n if (typeof module !== 'undefined' && module.exports) {\n module.exports = Mousetrap;\n }\n\n // expose mousetrap as an AMD module\n if (typeof define === 'function' && define.amd) {\n define(function() {\n return Mousetrap;\n });\n }\n}) (typeof window !== 'undefined' ? window : null, typeof window !== 'undefined' ? document : null);\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"content\":\"content--22PPB-25WC\",\"section\":\"section--1LWIf_8ryW\",\"source\":\"source--1myPwj4TjN\",\"source-button\":\"source-button--1hiC1IVXJS\",\"sourceButton\":\"source-button--1hiC1IVXJS\",\"description\":\"description--2DBehTBjQ9\",\"categories\":\"categories--1VFgPffG7-\",\"categories-select\":\"categories-select--1ZZjHjlJ8D\",\"categoriesSelect\":\"categories-select--1ZZjHjlJ8D\",\"tags\":\"tags--1ZYMedkjbg\",\"tags-auto-complete\":\"tags-auto-complete--bZTUn2Yaqp\",\"tagsAutoComplete\":\"tags-auto-complete--bZTUn2Yaqp\",\"tags-select\":\"tags-select--27pbZ1Z-vI\",\"tagsSelect\":\"tags-select--27pbZ1Z-vI\",\"sorting\":\"sorting--3QuB90axtW\",\"sort-column\":\"sort-column--2mZxrwznHp\",\"sortColumn\":\"sort-column--2mZxrwznHp\",\"sort-order\":\"sort-order--bJ_cvhspE9\",\"sortOrder\":\"sort-order--bJ_cvhspE9\",\"presentation\":\"presentation--3AVx6-oWXP\",\"limit\":\"limit--3l-G7mfTw-\"};","import freeGlobal from './_freeGlobal.js';\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\nexport default root;\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"form\":\"form--1pNyeHZ_J6\",\"buttons\":\"buttons--2B7RG6G7uu\",\"input-field\":\"input-field--31TEuk-dv0\",\"inputField\":\"input-field--31TEuk-dv0\",\"error\":\"error--1E_rPAurFD\",\"label-text\":\"label-text--2dcgberBAk\",\"labelText\":\"label-text--2dcgberBAk\"};","/* @preserve\n * Leaflet 1.7.1, a JS library for interactive maps. http://leafletjs.com\n * (c) 2010-2019 Vladimir Agafonkin, (c) 2010-2011 CloudMade\n */\n\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :\n typeof define === 'function' && define.amd ? define(['exports'], factory) :\n (factory((global.L = {})));\n}(this, (function (exports) { 'use strict';\n\n var version = \"1.7.1\";\n\n /*\r\n * @namespace Util\r\n *\r\n * Various utility functions, used by Leaflet internally.\r\n */\r\n\r\n // @function extend(dest: Object, src?: Object): Object\r\n // Merges the properties of the `src` object (or multiple objects) into `dest` object and returns the latter. Has an `L.extend` shortcut.\r\n function extend(dest) {\r\n \tvar i, j, len, src;\r\n\r\n \tfor (j = 1, len = arguments.length; j < len; j++) {\r\n \t\tsrc = arguments[j];\r\n \t\tfor (i in src) {\r\n \t\t\tdest[i] = src[i];\r\n \t\t}\r\n \t}\r\n \treturn dest;\r\n }\r\n\r\n // @function create(proto: Object, properties?: Object): Object\r\n // Compatibility polyfill for [Object.create](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/create)\r\n var create = Object.create || (function () {\r\n \tfunction F() {}\r\n \treturn function (proto) {\r\n \t\tF.prototype = proto;\r\n \t\treturn new F();\r\n \t};\r\n })();\r\n\r\n // @function bind(fn: Function, …): Function\r\n // Returns a new function bound to the arguments passed, like [Function.prototype.bind](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/bind).\r\n // Has a `L.bind()` shortcut.\r\n function bind(fn, obj) {\r\n \tvar slice = Array.prototype.slice;\r\n\r\n \tif (fn.bind) {\r\n \t\treturn fn.bind.apply(fn, slice.call(arguments, 1));\r\n \t}\r\n\r\n \tvar args = slice.call(arguments, 2);\r\n\r\n \treturn function () {\r\n \t\treturn fn.apply(obj, args.length ? args.concat(slice.call(arguments)) : arguments);\r\n \t};\r\n }\r\n\r\n // @property lastId: Number\r\n // Last unique ID used by [`stamp()`](#util-stamp)\r\n var lastId = 0;\r\n\r\n // @function stamp(obj: Object): Number\r\n // Returns the unique ID of an object, assigning it one if it doesn't have it.\r\n function stamp(obj) {\r\n \t/*eslint-disable */\r\n \tobj._leaflet_id = obj._leaflet_id || ++lastId;\r\n \treturn obj._leaflet_id;\r\n \t/* eslint-enable */\r\n }\r\n\r\n // @function throttle(fn: Function, time: Number, context: Object): Function\r\n // Returns a function which executes function `fn` with the given scope `context`\r\n // (so that the `this` keyword refers to `context` inside `fn`'s code). The function\r\n // `fn` will be called no more than one time per given amount of `time`. The arguments\r\n // received by the bound function will be any arguments passed when binding the\r\n // function, followed by any arguments passed when invoking the bound function.\r\n // Has an `L.throttle` shortcut.\r\n function throttle(fn, time, context) {\r\n \tvar lock, args, wrapperFn, later;\r\n\r\n \tlater = function () {\r\n \t\t// reset lock and call if queued\r\n \t\tlock = false;\r\n \t\tif (args) {\r\n \t\t\twrapperFn.apply(context, args);\r\n \t\t\targs = false;\r\n \t\t}\r\n \t};\r\n\r\n \twrapperFn = function () {\r\n \t\tif (lock) {\r\n \t\t\t// called too soon, queue to call later\r\n \t\t\targs = arguments;\r\n\r\n \t\t} else {\r\n \t\t\t// call and lock until later\r\n \t\t\tfn.apply(context, arguments);\r\n \t\t\tsetTimeout(later, time);\r\n \t\t\tlock = true;\r\n \t\t}\r\n \t};\r\n\r\n \treturn wrapperFn;\r\n }\r\n\r\n // @function wrapNum(num: Number, range: Number[], includeMax?: Boolean): Number\r\n // Returns the number `num` modulo `range` in such a way so it lies within\r\n // `range[0]` and `range[1]`. The returned value will be always smaller than\r\n // `range[1]` unless `includeMax` is set to `true`.\r\n function wrapNum(x, range, includeMax) {\r\n \tvar max = range[1],\r\n \t min = range[0],\r\n \t d = max - min;\r\n \treturn x === max && includeMax ? x : ((x - min) % d + d) % d + min;\r\n }\r\n\r\n // @function falseFn(): Function\r\n // Returns a function which always returns `false`.\r\n function falseFn() { return false; }\r\n\r\n // @function formatNum(num: Number, digits?: Number): Number\r\n // Returns the number `num` rounded to `digits` decimals, or to 6 decimals by default.\r\n function formatNum(num, digits) {\r\n \tvar pow = Math.pow(10, (digits === undefined ? 6 : digits));\r\n \treturn Math.round(num * pow) / pow;\r\n }\r\n\r\n // @function trim(str: String): String\r\n // Compatibility polyfill for [String.prototype.trim](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/Trim)\r\n function trim(str) {\r\n \treturn str.trim ? str.trim() : str.replace(/^\\s+|\\s+$/g, '');\r\n }\r\n\r\n // @function splitWords(str: String): String[]\r\n // Trims and splits the string on whitespace and returns the array of parts.\r\n function splitWords(str) {\r\n \treturn trim(str).split(/\\s+/);\r\n }\r\n\r\n // @function setOptions(obj: Object, options: Object): Object\r\n // Merges the given properties to the `options` of the `obj` object, returning the resulting options. See `Class options`. Has an `L.setOptions` shortcut.\r\n function setOptions(obj, options) {\r\n \tif (!Object.prototype.hasOwnProperty.call(obj, 'options')) {\r\n \t\tobj.options = obj.options ? create(obj.options) : {};\r\n \t}\r\n \tfor (var i in options) {\r\n \t\tobj.options[i] = options[i];\r\n \t}\r\n \treturn obj.options;\r\n }\r\n\r\n // @function getParamString(obj: Object, existingUrl?: String, uppercase?: Boolean): String\r\n // Converts an object into a parameter URL string, e.g. `{a: \"foo\", b: \"bar\"}`\r\n // translates to `'?a=foo&b=bar'`. If `existingUrl` is set, the parameters will\r\n // be appended at the end. If `uppercase` is `true`, the parameter names will\r\n // be uppercased (e.g. `'?A=foo&B=bar'`)\r\n function getParamString(obj, existingUrl, uppercase) {\r\n \tvar params = [];\r\n \tfor (var i in obj) {\r\n \t\tparams.push(encodeURIComponent(uppercase ? i.toUpperCase() : i) + '=' + encodeURIComponent(obj[i]));\r\n \t}\r\n \treturn ((!existingUrl || existingUrl.indexOf('?') === -1) ? '?' : '&') + params.join('&');\r\n }\r\n\r\n var templateRe = /\\{ *([\\w_-]+) *\\}/g;\r\n\r\n // @function template(str: String, data: Object): String\r\n // Simple templating facility, accepts a template string of the form `'Hello {a}, {b}'`\r\n // and a data object like `{a: 'foo', b: 'bar'}`, returns evaluated string\r\n // `('Hello foo, bar')`. You can also specify functions instead of strings for\r\n // data values — they will be evaluated passing `data` as an argument.\r\n function template(str, data) {\r\n \treturn str.replace(templateRe, function (str, key) {\r\n \t\tvar value = data[key];\r\n\r\n \t\tif (value === undefined) {\r\n \t\t\tthrow new Error('No value provided for variable ' + str);\r\n\r\n \t\t} else if (typeof value === 'function') {\r\n \t\t\tvalue = value(data);\r\n \t\t}\r\n \t\treturn value;\r\n \t});\r\n }\r\n\r\n // @function isArray(obj): Boolean\r\n // Compatibility polyfill for [Array.isArray](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray)\r\n var isArray = Array.isArray || function (obj) {\r\n \treturn (Object.prototype.toString.call(obj) === '[object Array]');\r\n };\r\n\r\n // @function indexOf(array: Array, el: Object): Number\r\n // Compatibility polyfill for [Array.prototype.indexOf](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf)\r\n function indexOf(array, el) {\r\n \tfor (var i = 0; i < array.length; i++) {\r\n \t\tif (array[i] === el) { return i; }\r\n \t}\r\n \treturn -1;\r\n }\r\n\r\n // @property emptyImageUrl: String\r\n // Data URI string containing a base64-encoded empty GIF image.\r\n // Used as a hack to free memory from unused images on WebKit-powered\r\n // mobile devices (by setting image `src` to this string).\r\n var emptyImageUrl = 'data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=';\r\n\r\n // inspired by http://paulirish.com/2011/requestanimationframe-for-smart-animating/\r\n\r\n function getPrefixed(name) {\r\n \treturn window['webkit' + name] || window['moz' + name] || window['ms' + name];\r\n }\r\n\r\n var lastTime = 0;\r\n\r\n // fallback for IE 7-8\r\n function timeoutDefer(fn) {\r\n \tvar time = +new Date(),\r\n \t timeToCall = Math.max(0, 16 - (time - lastTime));\r\n\r\n \tlastTime = time + timeToCall;\r\n \treturn window.setTimeout(fn, timeToCall);\r\n }\r\n\r\n var requestFn = window.requestAnimationFrame || getPrefixed('RequestAnimationFrame') || timeoutDefer;\r\n var cancelFn = window.cancelAnimationFrame || getPrefixed('CancelAnimationFrame') ||\r\n \t\tgetPrefixed('CancelRequestAnimationFrame') || function (id) { window.clearTimeout(id); };\r\n\r\n // @function requestAnimFrame(fn: Function, context?: Object, immediate?: Boolean): Number\r\n // Schedules `fn` to be executed when the browser repaints. `fn` is bound to\r\n // `context` if given. When `immediate` is set, `fn` is called immediately if\r\n // the browser doesn't have native support for\r\n // [`window.requestAnimationFrame`](https://developer.mozilla.org/docs/Web/API/window/requestAnimationFrame),\r\n // otherwise it's delayed. Returns a request ID that can be used to cancel the request.\r\n function requestAnimFrame(fn, context, immediate) {\r\n \tif (immediate && requestFn === timeoutDefer) {\r\n \t\tfn.call(context);\r\n \t} else {\r\n \t\treturn requestFn.call(window, bind(fn, context));\r\n \t}\r\n }\r\n\r\n // @function cancelAnimFrame(id: Number): undefined\r\n // Cancels a previous `requestAnimFrame`. See also [window.cancelAnimationFrame](https://developer.mozilla.org/docs/Web/API/window/cancelAnimationFrame).\r\n function cancelAnimFrame(id) {\r\n \tif (id) {\r\n \t\tcancelFn.call(window, id);\r\n \t}\r\n }\n\n var Util = ({\n extend: extend,\n create: create,\n bind: bind,\n lastId: lastId,\n stamp: stamp,\n throttle: throttle,\n wrapNum: wrapNum,\n falseFn: falseFn,\n formatNum: formatNum,\n trim: trim,\n splitWords: splitWords,\n setOptions: setOptions,\n getParamString: getParamString,\n template: template,\n isArray: isArray,\n indexOf: indexOf,\n emptyImageUrl: emptyImageUrl,\n requestFn: requestFn,\n cancelFn: cancelFn,\n requestAnimFrame: requestAnimFrame,\n cancelAnimFrame: cancelAnimFrame\n });\n\n // @class Class\r\n // @aka L.Class\r\n\r\n // @section\r\n // @uninheritable\r\n\r\n // Thanks to John Resig and Dean Edwards for inspiration!\r\n\r\n function Class() {}\r\n\r\n Class.extend = function (props) {\r\n\r\n \t// @function extend(props: Object): Function\r\n \t// [Extends the current class](#class-inheritance) given the properties to be included.\r\n \t// Returns a Javascript function that is a class constructor (to be called with `new`).\r\n \tvar NewClass = function () {\r\n\r\n \t\t// call the constructor\r\n \t\tif (this.initialize) {\r\n \t\t\tthis.initialize.apply(this, arguments);\r\n \t\t}\r\n\r\n \t\t// call all constructor hooks\r\n \t\tthis.callInitHooks();\r\n \t};\r\n\r\n \tvar parentProto = NewClass.__super__ = this.prototype;\r\n\r\n \tvar proto = create(parentProto);\r\n \tproto.constructor = NewClass;\r\n\r\n \tNewClass.prototype = proto;\r\n\r\n \t// inherit parent's statics\r\n \tfor (var i in this) {\r\n \t\tif (Object.prototype.hasOwnProperty.call(this, i) && i !== 'prototype' && i !== '__super__') {\r\n \t\t\tNewClass[i] = this[i];\r\n \t\t}\r\n \t}\r\n\r\n \t// mix static properties into the class\r\n \tif (props.statics) {\r\n \t\textend(NewClass, props.statics);\r\n \t\tdelete props.statics;\r\n \t}\r\n\r\n \t// mix includes into the prototype\r\n \tif (props.includes) {\r\n \t\tcheckDeprecatedMixinEvents(props.includes);\r\n \t\textend.apply(null, [proto].concat(props.includes));\r\n \t\tdelete props.includes;\r\n \t}\r\n\r\n \t// merge options\r\n \tif (proto.options) {\r\n \t\tprops.options = extend(create(proto.options), props.options);\r\n \t}\r\n\r\n \t// mix given properties into the prototype\r\n \textend(proto, props);\r\n\r\n \tproto._initHooks = [];\r\n\r\n \t// add method for calling all hooks\r\n \tproto.callInitHooks = function () {\r\n\r\n \t\tif (this._initHooksCalled) { return; }\r\n\r\n \t\tif (parentProto.callInitHooks) {\r\n \t\t\tparentProto.callInitHooks.call(this);\r\n \t\t}\r\n\r\n \t\tthis._initHooksCalled = true;\r\n\r\n \t\tfor (var i = 0, len = proto._initHooks.length; i < len; i++) {\r\n \t\t\tproto._initHooks[i].call(this);\r\n \t\t}\r\n \t};\r\n\r\n \treturn NewClass;\r\n };\r\n\r\n\r\n // @function include(properties: Object): this\r\n // [Includes a mixin](#class-includes) into the current class.\r\n Class.include = function (props) {\r\n \textend(this.prototype, props);\r\n \treturn this;\r\n };\r\n\r\n // @function mergeOptions(options: Object): this\r\n // [Merges `options`](#class-options) into the defaults of the class.\r\n Class.mergeOptions = function (options) {\r\n \textend(this.prototype.options, options);\r\n \treturn this;\r\n };\r\n\r\n // @function addInitHook(fn: Function): this\r\n // Adds a [constructor hook](#class-constructor-hooks) to the class.\r\n Class.addInitHook = function (fn) { // (Function) || (String, args...)\r\n \tvar args = Array.prototype.slice.call(arguments, 1);\r\n\r\n \tvar init = typeof fn === 'function' ? fn : function () {\r\n \t\tthis[fn].apply(this, args);\r\n \t};\r\n\r\n \tthis.prototype._initHooks = this.prototype._initHooks || [];\r\n \tthis.prototype._initHooks.push(init);\r\n \treturn this;\r\n };\r\n\r\n function checkDeprecatedMixinEvents(includes) {\r\n \tif (typeof L === 'undefined' || !L || !L.Mixin) { return; }\r\n\r\n \tincludes = isArray(includes) ? includes : [includes];\r\n\r\n \tfor (var i = 0; i < includes.length; i++) {\r\n \t\tif (includes[i] === L.Mixin.Events) {\r\n \t\t\tconsole.warn('Deprecated include of L.Mixin.Events: ' +\r\n \t\t\t\t'this property will be removed in future releases, ' +\r\n \t\t\t\t'please inherit from L.Evented instead.', new Error().stack);\r\n \t\t}\r\n \t}\r\n }\n\n /*\r\n * @class Evented\r\n * @aka L.Evented\r\n * @inherits Class\r\n *\r\n * A set of methods shared between event-powered classes (like `Map` and `Marker`). Generally, events allow you to execute some function when something happens with an object (e.g. the user clicks on the map, causing the map to fire `'click'` event).\r\n *\r\n * @example\r\n *\r\n * ```js\r\n * map.on('click', function(e) {\r\n * \talert(e.latlng);\r\n * } );\r\n * ```\r\n *\r\n * Leaflet deals with event listeners by reference, so if you want to add a listener and then remove it, define it as a function:\r\n *\r\n * ```js\r\n * function onClick(e) { ... }\r\n *\r\n * map.on('click', onClick);\r\n * map.off('click', onClick);\r\n * ```\r\n */\r\n\r\n var Events = {\r\n \t/* @method on(type: String, fn: Function, context?: Object): this\r\n \t * Adds a listener function (`fn`) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. `'click dblclick'`).\r\n \t *\r\n \t * @alternative\r\n \t * @method on(eventMap: Object): this\r\n \t * Adds a set of type/listener pairs, e.g. `{click: onClick, mousemove: onMouseMove}`\r\n \t */\r\n \ton: function (types, fn, context) {\r\n\r\n \t\t// types can be a map of types/handlers\r\n \t\tif (typeof types === 'object') {\r\n \t\t\tfor (var type in types) {\r\n \t\t\t\t// we don't process space-separated events here for performance;\r\n \t\t\t\t// it's a hot path since Layer uses the on(obj) syntax\r\n \t\t\t\tthis._on(type, types[type], fn);\r\n \t\t\t}\r\n\r\n \t\t} else {\r\n \t\t\t// types can be a string of space-separated words\r\n \t\t\ttypes = splitWords(types);\r\n\r\n \t\t\tfor (var i = 0, len = types.length; i < len; i++) {\r\n \t\t\t\tthis._on(types[i], fn, context);\r\n \t\t\t}\r\n \t\t}\r\n\r\n \t\treturn this;\r\n \t},\r\n\r\n \t/* @method off(type: String, fn?: Function, context?: Object): this\r\n \t * Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to `on`, you must pass the same context to `off` in order to remove the listener.\r\n \t *\r\n \t * @alternative\r\n \t * @method off(eventMap: Object): this\r\n \t * Removes a set of type/listener pairs.\r\n \t *\r\n \t * @alternative\r\n \t * @method off: this\r\n \t * Removes all listeners to all events on the object. This includes implicitly attached events.\r\n \t */\r\n \toff: function (types, fn, context) {\r\n\r\n \t\tif (!types) {\r\n \t\t\t// clear all listeners if called without arguments\r\n \t\t\tdelete this._events;\r\n\r\n \t\t} else if (typeof types === 'object') {\r\n \t\t\tfor (var type in types) {\r\n \t\t\t\tthis._off(type, types[type], fn);\r\n \t\t\t}\r\n\r\n \t\t} else {\r\n \t\t\ttypes = splitWords(types);\r\n\r\n \t\t\tfor (var i = 0, len = types.length; i < len; i++) {\r\n \t\t\t\tthis._off(types[i], fn, context);\r\n \t\t\t}\r\n \t\t}\r\n\r\n \t\treturn this;\r\n \t},\r\n\r\n \t// attach listener (without syntactic sugar now)\r\n \t_on: function (type, fn, context) {\r\n \t\tthis._events = this._events || {};\r\n\r\n \t\t/* get/init listeners for type */\r\n \t\tvar typeListeners = this._events[type];\r\n \t\tif (!typeListeners) {\r\n \t\t\ttypeListeners = [];\r\n \t\t\tthis._events[type] = typeListeners;\r\n \t\t}\r\n\r\n \t\tif (context === this) {\r\n \t\t\t// Less memory footprint.\r\n \t\t\tcontext = undefined;\r\n \t\t}\r\n \t\tvar newListener = {fn: fn, ctx: context},\r\n \t\t listeners = typeListeners;\r\n\r\n \t\t// check if fn already there\r\n \t\tfor (var i = 0, len = listeners.length; i < len; i++) {\r\n \t\t\tif (listeners[i].fn === fn && listeners[i].ctx === context) {\r\n \t\t\t\treturn;\r\n \t\t\t}\r\n \t\t}\r\n\r\n \t\tlisteners.push(newListener);\r\n \t},\r\n\r\n \t_off: function (type, fn, context) {\r\n \t\tvar listeners,\r\n \t\t i,\r\n \t\t len;\r\n\r\n \t\tif (!this._events) { return; }\r\n\r\n \t\tlisteners = this._events[type];\r\n\r\n \t\tif (!listeners) {\r\n \t\t\treturn;\r\n \t\t}\r\n\r\n \t\tif (!fn) {\r\n \t\t\t// Set all removed listeners to noop so they are not called if remove happens in fire\r\n \t\t\tfor (i = 0, len = listeners.length; i < len; i++) {\r\n \t\t\t\tlisteners[i].fn = falseFn;\r\n \t\t\t}\r\n \t\t\t// clear all listeners for a type if function isn't specified\r\n \t\t\tdelete this._events[type];\r\n \t\t\treturn;\r\n \t\t}\r\n\r\n \t\tif (context === this) {\r\n \t\t\tcontext = undefined;\r\n \t\t}\r\n\r\n \t\tif (listeners) {\r\n\r\n \t\t\t// find fn and remove it\r\n \t\t\tfor (i = 0, len = listeners.length; i < len; i++) {\r\n \t\t\t\tvar l = listeners[i];\r\n \t\t\t\tif (l.ctx !== context) { continue; }\r\n \t\t\t\tif (l.fn === fn) {\r\n\r\n \t\t\t\t\t// set the removed listener to noop so that's not called if remove happens in fire\r\n \t\t\t\t\tl.fn = falseFn;\r\n\r\n \t\t\t\t\tif (this._firingCount) {\r\n \t\t\t\t\t\t/* copy array in case events are being fired */\r\n \t\t\t\t\t\tthis._events[type] = listeners = listeners.slice();\r\n \t\t\t\t\t}\r\n \t\t\t\t\tlisteners.splice(i, 1);\r\n\r\n \t\t\t\t\treturn;\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t}\r\n \t},\r\n\r\n \t// @method fire(type: String, data?: Object, propagate?: Boolean): this\r\n \t// Fires an event of the specified type. You can optionally provide an data\r\n \t// object — the first argument of the listener function will contain its\r\n \t// properties. The event can optionally be propagated to event parents.\r\n \tfire: function (type, data, propagate) {\r\n \t\tif (!this.listens(type, propagate)) { return this; }\r\n\r\n \t\tvar event = extend({}, data, {\r\n \t\t\ttype: type,\r\n \t\t\ttarget: this,\r\n \t\t\tsourceTarget: data && data.sourceTarget || this\r\n \t\t});\r\n\r\n \t\tif (this._events) {\r\n \t\t\tvar listeners = this._events[type];\r\n\r\n \t\t\tif (listeners) {\r\n \t\t\t\tthis._firingCount = (this._firingCount + 1) || 1;\r\n \t\t\t\tfor (var i = 0, len = listeners.length; i < len; i++) {\r\n \t\t\t\t\tvar l = listeners[i];\r\n \t\t\t\t\tl.fn.call(l.ctx || this, event);\r\n \t\t\t\t}\r\n\r\n \t\t\t\tthis._firingCount--;\r\n \t\t\t}\r\n \t\t}\r\n\r\n \t\tif (propagate) {\r\n \t\t\t// propagate the event to parents (set with addEventParent)\r\n \t\t\tthis._propagateEvent(event);\r\n \t\t}\r\n\r\n \t\treturn this;\r\n \t},\r\n\r\n \t// @method listens(type: String): Boolean\r\n \t// Returns `true` if a particular event type has any listeners attached to it.\r\n \tlistens: function (type, propagate) {\r\n \t\tvar listeners = this._events && this._events[type];\r\n \t\tif (listeners && listeners.length) { return true; }\r\n\r\n \t\tif (propagate) {\r\n \t\t\t// also check parents for listeners if event propagates\r\n \t\t\tfor (var id in this._eventParents) {\r\n \t\t\t\tif (this._eventParents[id].listens(type, propagate)) { return true; }\r\n \t\t\t}\r\n \t\t}\r\n \t\treturn false;\r\n \t},\r\n\r\n \t// @method once(…): this\r\n \t// Behaves as [`on(…)`](#evented-on), except the listener will only get fired once and then removed.\r\n \tonce: function (types, fn, context) {\r\n\r\n \t\tif (typeof types === 'object') {\r\n \t\t\tfor (var type in types) {\r\n \t\t\t\tthis.once(type, types[type], fn);\r\n \t\t\t}\r\n \t\t\treturn this;\r\n \t\t}\r\n\r\n \t\tvar handler = bind(function () {\r\n \t\t\tthis\r\n \t\t\t .off(types, fn, context)\r\n \t\t\t .off(types, handler, context);\r\n \t\t}, this);\r\n\r\n \t\t// add a listener that's executed once and removed after that\r\n \t\treturn this\r\n \t\t .on(types, fn, context)\r\n \t\t .on(types, handler, context);\r\n \t},\r\n\r\n \t// @method addEventParent(obj: Evented): this\r\n \t// Adds an event parent - an `Evented` that will receive propagated events\r\n \taddEventParent: function (obj) {\r\n \t\tthis._eventParents = this._eventParents || {};\r\n \t\tthis._eventParents[stamp(obj)] = obj;\r\n \t\treturn this;\r\n \t},\r\n\r\n \t// @method removeEventParent(obj: Evented): this\r\n \t// Removes an event parent, so it will stop receiving propagated events\r\n \tremoveEventParent: function (obj) {\r\n \t\tif (this._eventParents) {\r\n \t\t\tdelete this._eventParents[stamp(obj)];\r\n \t\t}\r\n \t\treturn this;\r\n \t},\r\n\r\n \t_propagateEvent: function (e) {\r\n \t\tfor (var id in this._eventParents) {\r\n \t\t\tthis._eventParents[id].fire(e.type, extend({\r\n \t\t\t\tlayer: e.target,\r\n \t\t\t\tpropagatedFrom: e.target\r\n \t\t\t}, e), true);\r\n \t\t}\r\n \t}\r\n };\r\n\r\n // aliases; we should ditch those eventually\r\n\r\n // @method addEventListener(…): this\r\n // Alias to [`on(…)`](#evented-on)\r\n Events.addEventListener = Events.on;\r\n\r\n // @method removeEventListener(…): this\r\n // Alias to [`off(…)`](#evented-off)\r\n\r\n // @method clearAllEventListeners(…): this\r\n // Alias to [`off()`](#evented-off)\r\n Events.removeEventListener = Events.clearAllEventListeners = Events.off;\r\n\r\n // @method addOneTimeEventListener(…): this\r\n // Alias to [`once(…)`](#evented-once)\r\n Events.addOneTimeEventListener = Events.once;\r\n\r\n // @method fireEvent(…): this\r\n // Alias to [`fire(…)`](#evented-fire)\r\n Events.fireEvent = Events.fire;\r\n\r\n // @method hasEventListeners(…): Boolean\r\n // Alias to [`listens(…)`](#evented-listens)\r\n Events.hasEventListeners = Events.listens;\r\n\r\n var Evented = Class.extend(Events);\n\n /*\r\n * @class Point\r\n * @aka L.Point\r\n *\r\n * Represents a point with `x` and `y` coordinates in pixels.\r\n *\r\n * @example\r\n *\r\n * ```js\r\n * var point = L.point(200, 300);\r\n * ```\r\n *\r\n * All Leaflet methods and options that accept `Point` objects also accept them in a simple Array form (unless noted otherwise), so these lines are equivalent:\r\n *\r\n * ```js\r\n * map.panBy([200, 300]);\r\n * map.panBy(L.point(200, 300));\r\n * ```\r\n *\r\n * Note that `Point` does not inherit from Leaflet's `Class` object,\r\n * which means new classes can't inherit from it, and new methods\r\n * can't be added to it with the `include` function.\r\n */\r\n\r\n function Point(x, y, round) {\r\n \t// @property x: Number; The `x` coordinate of the point\r\n \tthis.x = (round ? Math.round(x) : x);\r\n \t// @property y: Number; The `y` coordinate of the point\r\n \tthis.y = (round ? Math.round(y) : y);\r\n }\r\n\r\n var trunc = Math.trunc || function (v) {\r\n \treturn v > 0 ? Math.floor(v) : Math.ceil(v);\r\n };\r\n\r\n Point.prototype = {\r\n\r\n \t// @method clone(): Point\r\n \t// Returns a copy of the current point.\r\n \tclone: function () {\r\n \t\treturn new Point(this.x, this.y);\r\n \t},\r\n\r\n \t// @method add(otherPoint: Point): Point\r\n \t// Returns the result of addition of the current and the given points.\r\n \tadd: function (point) {\r\n \t\t// non-destructive, returns a new point\r\n \t\treturn this.clone()._add(toPoint(point));\r\n \t},\r\n\r\n \t_add: function (point) {\r\n \t\t// destructive, used directly for performance in situations where it's safe to modify existing point\r\n \t\tthis.x += point.x;\r\n \t\tthis.y += point.y;\r\n \t\treturn this;\r\n \t},\r\n\r\n \t// @method subtract(otherPoint: Point): Point\r\n \t// Returns the result of subtraction of the given point from the current.\r\n \tsubtract: function (point) {\r\n \t\treturn this.clone()._subtract(toPoint(point));\r\n \t},\r\n\r\n \t_subtract: function (point) {\r\n \t\tthis.x -= point.x;\r\n \t\tthis.y -= point.y;\r\n \t\treturn this;\r\n \t},\r\n\r\n \t// @method divideBy(num: Number): Point\r\n \t// Returns the result of division of the current point by the given number.\r\n \tdivideBy: function (num) {\r\n \t\treturn this.clone()._divideBy(num);\r\n \t},\r\n\r\n \t_divideBy: function (num) {\r\n \t\tthis.x /= num;\r\n \t\tthis.y /= num;\r\n \t\treturn this;\r\n \t},\r\n\r\n \t// @method multiplyBy(num: Number): Point\r\n \t// Returns the result of multiplication of the current point by the given number.\r\n \tmultiplyBy: function (num) {\r\n \t\treturn this.clone()._multiplyBy(num);\r\n \t},\r\n\r\n \t_multiplyBy: function (num) {\r\n \t\tthis.x *= num;\r\n \t\tthis.y *= num;\r\n \t\treturn this;\r\n \t},\r\n\r\n \t// @method scaleBy(scale: Point): Point\r\n \t// Multiply each coordinate of the current point by each coordinate of\r\n \t// `scale`. In linear algebra terms, multiply the point by the\r\n \t// [scaling matrix](https://en.wikipedia.org/wiki/Scaling_%28geometry%29#Matrix_representation)\r\n \t// defined by `scale`.\r\n \tscaleBy: function (point) {\r\n \t\treturn new Point(this.x * point.x, this.y * point.y);\r\n \t},\r\n\r\n \t// @method unscaleBy(scale: Point): Point\r\n \t// Inverse of `scaleBy`. Divide each coordinate of the current point by\r\n \t// each coordinate of `scale`.\r\n \tunscaleBy: function (point) {\r\n \t\treturn new Point(this.x / point.x, this.y / point.y);\r\n \t},\r\n\r\n \t// @method round(): Point\r\n \t// Returns a copy of the current point with rounded coordinates.\r\n \tround: function () {\r\n \t\treturn this.clone()._round();\r\n \t},\r\n\r\n \t_round: function () {\r\n \t\tthis.x = Math.round(this.x);\r\n \t\tthis.y = Math.round(this.y);\r\n \t\treturn this;\r\n \t},\r\n\r\n \t// @method floor(): Point\r\n \t// Returns a copy of the current point with floored coordinates (rounded down).\r\n \tfloor: function () {\r\n \t\treturn this.clone()._floor();\r\n \t},\r\n\r\n \t_floor: function () {\r\n \t\tthis.x = Math.floor(this.x);\r\n \t\tthis.y = Math.floor(this.y);\r\n \t\treturn this;\r\n \t},\r\n\r\n \t// @method ceil(): Point\r\n \t// Returns a copy of the current point with ceiled coordinates (rounded up).\r\n \tceil: function () {\r\n \t\treturn this.clone()._ceil();\r\n \t},\r\n\r\n \t_ceil: function () {\r\n \t\tthis.x = Math.ceil(this.x);\r\n \t\tthis.y = Math.ceil(this.y);\r\n \t\treturn this;\r\n \t},\r\n\r\n \t// @method trunc(): Point\r\n \t// Returns a copy of the current point with truncated coordinates (rounded towards zero).\r\n \ttrunc: function () {\r\n \t\treturn this.clone()._trunc();\r\n \t},\r\n\r\n \t_trunc: function () {\r\n \t\tthis.x = trunc(this.x);\r\n \t\tthis.y = trunc(this.y);\r\n \t\treturn this;\r\n \t},\r\n\r\n \t// @method distanceTo(otherPoint: Point): Number\r\n \t// Returns the cartesian distance between the current and the given points.\r\n \tdistanceTo: function (point) {\r\n \t\tpoint = toPoint(point);\r\n\r\n \t\tvar x = point.x - this.x,\r\n \t\t y = point.y - this.y;\r\n\r\n \t\treturn Math.sqrt(x * x + y * y);\r\n \t},\r\n\r\n \t// @method equals(otherPoint: Point): Boolean\r\n \t// Returns `true` if the given point has the same coordinates.\r\n \tequals: function (point) {\r\n \t\tpoint = toPoint(point);\r\n\r\n \t\treturn point.x === this.x &&\r\n \t\t point.y === this.y;\r\n \t},\r\n\r\n \t// @method contains(otherPoint: Point): Boolean\r\n \t// Returns `true` if both coordinates of the given point are less than the corresponding current point coordinates (in absolute values).\r\n \tcontains: function (point) {\r\n \t\tpoint = toPoint(point);\r\n\r\n \t\treturn Math.abs(point.x) <= Math.abs(this.x) &&\r\n \t\t Math.abs(point.y) <= Math.abs(this.y);\r\n \t},\r\n\r\n \t// @method toString(): String\r\n \t// Returns a string representation of the point for debugging purposes.\r\n \ttoString: function () {\r\n \t\treturn 'Point(' +\r\n \t\t formatNum(this.x) + ', ' +\r\n \t\t formatNum(this.y) + ')';\r\n \t}\r\n };\r\n\r\n // @factory L.point(x: Number, y: Number, round?: Boolean)\r\n // Creates a Point object with the given `x` and `y` coordinates. If optional `round` is set to true, rounds the `x` and `y` values.\r\n\r\n // @alternative\r\n // @factory L.point(coords: Number[])\r\n // Expects an array of the form `[x, y]` instead.\r\n\r\n // @alternative\r\n // @factory L.point(coords: Object)\r\n // Expects a plain object of the form `{x: Number, y: Number}` instead.\r\n function toPoint(x, y, round) {\r\n \tif (x instanceof Point) {\r\n \t\treturn x;\r\n \t}\r\n \tif (isArray(x)) {\r\n \t\treturn new Point(x[0], x[1]);\r\n \t}\r\n \tif (x === undefined || x === null) {\r\n \t\treturn x;\r\n \t}\r\n \tif (typeof x === 'object' && 'x' in x && 'y' in x) {\r\n \t\treturn new Point(x.x, x.y);\r\n \t}\r\n \treturn new Point(x, y, round);\r\n }\n\n /*\r\n * @class Bounds\r\n * @aka L.Bounds\r\n *\r\n * Represents a rectangular area in pixel coordinates.\r\n *\r\n * @example\r\n *\r\n * ```js\r\n * var p1 = L.point(10, 10),\r\n * p2 = L.point(40, 60),\r\n * bounds = L.bounds(p1, p2);\r\n * ```\r\n *\r\n * All Leaflet methods that accept `Bounds` objects also accept them in a simple Array form (unless noted otherwise), so the bounds example above can be passed like this:\r\n *\r\n * ```js\r\n * otherBounds.intersects([[10, 10], [40, 60]]);\r\n * ```\r\n *\r\n * Note that `Bounds` does not inherit from Leaflet's `Class` object,\r\n * which means new classes can't inherit from it, and new methods\r\n * can't be added to it with the `include` function.\r\n */\r\n\r\n function Bounds(a, b) {\r\n \tif (!a) { return; }\r\n\r\n \tvar points = b ? [a, b] : a;\r\n\r\n \tfor (var i = 0, len = points.length; i < len; i++) {\r\n \t\tthis.extend(points[i]);\r\n \t}\r\n }\r\n\r\n Bounds.prototype = {\r\n \t// @method extend(point: Point): this\r\n \t// Extends the bounds to contain the given point.\r\n \textend: function (point) { // (Point)\r\n \t\tpoint = toPoint(point);\r\n\r\n \t\t// @property min: Point\r\n \t\t// The top left corner of the rectangle.\r\n \t\t// @property max: Point\r\n \t\t// The bottom right corner of the rectangle.\r\n \t\tif (!this.min && !this.max) {\r\n \t\t\tthis.min = point.clone();\r\n \t\t\tthis.max = point.clone();\r\n \t\t} else {\r\n \t\t\tthis.min.x = Math.min(point.x, this.min.x);\r\n \t\t\tthis.max.x = Math.max(point.x, this.max.x);\r\n \t\t\tthis.min.y = Math.min(point.y, this.min.y);\r\n \t\t\tthis.max.y = Math.max(point.y, this.max.y);\r\n \t\t}\r\n \t\treturn this;\r\n \t},\r\n\r\n \t// @method getCenter(round?: Boolean): Point\r\n \t// Returns the center point of the bounds.\r\n \tgetCenter: function (round) {\r\n \t\treturn new Point(\r\n \t\t (this.min.x + this.max.x) / 2,\r\n \t\t (this.min.y + this.max.y) / 2, round);\r\n \t},\r\n\r\n \t// @method getBottomLeft(): Point\r\n \t// Returns the bottom-left point of the bounds.\r\n \tgetBottomLeft: function () {\r\n \t\treturn new Point(this.min.x, this.max.y);\r\n \t},\r\n\r\n \t// @method getTopRight(): Point\r\n \t// Returns the top-right point of the bounds.\r\n \tgetTopRight: function () { // -> Point\r\n \t\treturn new Point(this.max.x, this.min.y);\r\n \t},\r\n\r\n \t// @method getTopLeft(): Point\r\n \t// Returns the top-left point of the bounds (i.e. [`this.min`](#bounds-min)).\r\n \tgetTopLeft: function () {\r\n \t\treturn this.min; // left, top\r\n \t},\r\n\r\n \t// @method getBottomRight(): Point\r\n \t// Returns the bottom-right point of the bounds (i.e. [`this.max`](#bounds-max)).\r\n \tgetBottomRight: function () {\r\n \t\treturn this.max; // right, bottom\r\n \t},\r\n\r\n \t// @method getSize(): Point\r\n \t// Returns the size of the given bounds\r\n \tgetSize: function () {\r\n \t\treturn this.max.subtract(this.min);\r\n \t},\r\n\r\n \t// @method contains(otherBounds: Bounds): Boolean\r\n \t// Returns `true` if the rectangle contains the given one.\r\n \t// @alternative\r\n \t// @method contains(point: Point): Boolean\r\n \t// Returns `true` if the rectangle contains the given point.\r\n \tcontains: function (obj) {\r\n \t\tvar min, max;\r\n\r\n \t\tif (typeof obj[0] === 'number' || obj instanceof Point) {\r\n \t\t\tobj = toPoint(obj);\r\n \t\t} else {\r\n \t\t\tobj = toBounds(obj);\r\n \t\t}\r\n\r\n \t\tif (obj instanceof Bounds) {\r\n \t\t\tmin = obj.min;\r\n \t\t\tmax = obj.max;\r\n \t\t} else {\r\n \t\t\tmin = max = obj;\r\n \t\t}\r\n\r\n \t\treturn (min.x >= this.min.x) &&\r\n \t\t (max.x <= this.max.x) &&\r\n \t\t (min.y >= this.min.y) &&\r\n \t\t (max.y <= this.max.y);\r\n \t},\r\n\r\n \t// @method intersects(otherBounds: Bounds): Boolean\r\n \t// Returns `true` if the rectangle intersects the given bounds. Two bounds\r\n \t// intersect if they have at least one point in common.\r\n \tintersects: function (bounds) { // (Bounds) -> Boolean\r\n \t\tbounds = toBounds(bounds);\r\n\r\n \t\tvar min = this.min,\r\n \t\t max = this.max,\r\n \t\t min2 = bounds.min,\r\n \t\t max2 = bounds.max,\r\n \t\t xIntersects = (max2.x >= min.x) && (min2.x <= max.x),\r\n \t\t yIntersects = (max2.y >= min.y) && (min2.y <= max.y);\r\n\r\n \t\treturn xIntersects && yIntersects;\r\n \t},\r\n\r\n \t// @method overlaps(otherBounds: Bounds): Boolean\r\n \t// Returns `true` if the rectangle overlaps the given bounds. Two bounds\r\n \t// overlap if their intersection is an area.\r\n \toverlaps: function (bounds) { // (Bounds) -> Boolean\r\n \t\tbounds = toBounds(bounds);\r\n\r\n \t\tvar min = this.min,\r\n \t\t max = this.max,\r\n \t\t min2 = bounds.min,\r\n \t\t max2 = bounds.max,\r\n \t\t xOverlaps = (max2.x > min.x) && (min2.x < max.x),\r\n \t\t yOverlaps = (max2.y > min.y) && (min2.y < max.y);\r\n\r\n \t\treturn xOverlaps && yOverlaps;\r\n \t},\r\n\r\n \tisValid: function () {\r\n \t\treturn !!(this.min && this.max);\r\n \t}\r\n };\r\n\r\n\r\n // @factory L.bounds(corner1: Point, corner2: Point)\r\n // Creates a Bounds object from two corners coordinate pairs.\r\n // @alternative\r\n // @factory L.bounds(points: Point[])\r\n // Creates a Bounds object from the given array of points.\r\n function toBounds(a, b) {\r\n \tif (!a || a instanceof Bounds) {\r\n \t\treturn a;\r\n \t}\r\n \treturn new Bounds(a, b);\r\n }\n\n /*\r\n * @class LatLngBounds\r\n * @aka L.LatLngBounds\r\n *\r\n * Represents a rectangular geographical area on a map.\r\n *\r\n * @example\r\n *\r\n * ```js\r\n * var corner1 = L.latLng(40.712, -74.227),\r\n * corner2 = L.latLng(40.774, -74.125),\r\n * bounds = L.latLngBounds(corner1, corner2);\r\n * ```\r\n *\r\n * All Leaflet methods that accept LatLngBounds objects also accept them in a simple Array form (unless noted otherwise), so the bounds example above can be passed like this:\r\n *\r\n * ```js\r\n * map.fitBounds([\r\n * \t[40.712, -74.227],\r\n * \t[40.774, -74.125]\r\n * ]);\r\n * ```\r\n *\r\n * Caution: if the area crosses the antimeridian (often confused with the International Date Line), you must specify corners _outside_ the [-180, 180] degrees longitude range.\r\n *\r\n * Note that `LatLngBounds` does not inherit from Leaflet's `Class` object,\r\n * which means new classes can't inherit from it, and new methods\r\n * can't be added to it with the `include` function.\r\n */\r\n\r\n function LatLngBounds(corner1, corner2) { // (LatLng, LatLng) or (LatLng[])\r\n \tif (!corner1) { return; }\r\n\r\n \tvar latlngs = corner2 ? [corner1, corner2] : corner1;\r\n\r\n \tfor (var i = 0, len = latlngs.length; i < len; i++) {\r\n \t\tthis.extend(latlngs[i]);\r\n \t}\r\n }\r\n\r\n LatLngBounds.prototype = {\r\n\r\n \t// @method extend(latlng: LatLng): this\r\n \t// Extend the bounds to contain the given point\r\n\r\n \t// @alternative\r\n \t// @method extend(otherBounds: LatLngBounds): this\r\n \t// Extend the bounds to contain the given bounds\r\n \textend: function (obj) {\r\n \t\tvar sw = this._southWest,\r\n \t\t ne = this._northEast,\r\n \t\t sw2, ne2;\r\n\r\n \t\tif (obj instanceof LatLng) {\r\n \t\t\tsw2 = obj;\r\n \t\t\tne2 = obj;\r\n\r\n \t\t} else if (obj instanceof LatLngBounds) {\r\n \t\t\tsw2 = obj._southWest;\r\n \t\t\tne2 = obj._northEast;\r\n\r\n \t\t\tif (!sw2 || !ne2) { return this; }\r\n\r\n \t\t} else {\r\n \t\t\treturn obj ? this.extend(toLatLng(obj) || toLatLngBounds(obj)) : this;\r\n \t\t}\r\n\r\n \t\tif (!sw && !ne) {\r\n \t\t\tthis._southWest = new LatLng(sw2.lat, sw2.lng);\r\n \t\t\tthis._northEast = new LatLng(ne2.lat, ne2.lng);\r\n \t\t} else {\r\n \t\t\tsw.lat = Math.min(sw2.lat, sw.lat);\r\n \t\t\tsw.lng = Math.min(sw2.lng, sw.lng);\r\n \t\t\tne.lat = Math.max(ne2.lat, ne.lat);\r\n \t\t\tne.lng = Math.max(ne2.lng, ne.lng);\r\n \t\t}\r\n\r\n \t\treturn this;\r\n \t},\r\n\r\n \t// @method pad(bufferRatio: Number): LatLngBounds\r\n \t// Returns bounds created by extending or retracting the current bounds by a given ratio in each direction.\r\n \t// For example, a ratio of 0.5 extends the bounds by 50% in each direction.\r\n \t// Negative values will retract the bounds.\r\n \tpad: function (bufferRatio) {\r\n \t\tvar sw = this._southWest,\r\n \t\t ne = this._northEast,\r\n \t\t heightBuffer = Math.abs(sw.lat - ne.lat) * bufferRatio,\r\n \t\t widthBuffer = Math.abs(sw.lng - ne.lng) * bufferRatio;\r\n\r\n \t\treturn new LatLngBounds(\r\n \t\t new LatLng(sw.lat - heightBuffer, sw.lng - widthBuffer),\r\n \t\t new LatLng(ne.lat + heightBuffer, ne.lng + widthBuffer));\r\n \t},\r\n\r\n \t// @method getCenter(): LatLng\r\n \t// Returns the center point of the bounds.\r\n \tgetCenter: function () {\r\n \t\treturn new LatLng(\r\n \t\t (this._southWest.lat + this._northEast.lat) / 2,\r\n \t\t (this._southWest.lng + this._northEast.lng) / 2);\r\n \t},\r\n\r\n \t// @method getSouthWest(): LatLng\r\n \t// Returns the south-west point of the bounds.\r\n \tgetSouthWest: function () {\r\n \t\treturn this._southWest;\r\n \t},\r\n\r\n \t// @method getNorthEast(): LatLng\r\n \t// Returns the north-east point of the bounds.\r\n \tgetNorthEast: function () {\r\n \t\treturn this._northEast;\r\n \t},\r\n\r\n \t// @method getNorthWest(): LatLng\r\n \t// Returns the north-west point of the bounds.\r\n \tgetNorthWest: function () {\r\n \t\treturn new LatLng(this.getNorth(), this.getWest());\r\n \t},\r\n\r\n \t// @method getSouthEast(): LatLng\r\n \t// Returns the south-east point of the bounds.\r\n \tgetSouthEast: function () {\r\n \t\treturn new LatLng(this.getSouth(), this.getEast());\r\n \t},\r\n\r\n \t// @method getWest(): Number\r\n \t// Returns the west longitude of the bounds\r\n \tgetWest: function () {\r\n \t\treturn this._southWest.lng;\r\n \t},\r\n\r\n \t// @method getSouth(): Number\r\n \t// Returns the south latitude of the bounds\r\n \tgetSouth: function () {\r\n \t\treturn this._southWest.lat;\r\n \t},\r\n\r\n \t// @method getEast(): Number\r\n \t// Returns the east longitude of the bounds\r\n \tgetEast: function () {\r\n \t\treturn this._northEast.lng;\r\n \t},\r\n\r\n \t// @method getNorth(): Number\r\n \t// Returns the north latitude of the bounds\r\n \tgetNorth: function () {\r\n \t\treturn this._northEast.lat;\r\n \t},\r\n\r\n \t// @method contains(otherBounds: LatLngBounds): Boolean\r\n \t// Returns `true` if the rectangle contains the given one.\r\n\r\n \t// @alternative\r\n \t// @method contains (latlng: LatLng): Boolean\r\n \t// Returns `true` if the rectangle contains the given point.\r\n \tcontains: function (obj) { // (LatLngBounds) or (LatLng) -> Boolean\r\n \t\tif (typeof obj[0] === 'number' || obj instanceof LatLng || 'lat' in obj) {\r\n \t\t\tobj = toLatLng(obj);\r\n \t\t} else {\r\n \t\t\tobj = toLatLngBounds(obj);\r\n \t\t}\r\n\r\n \t\tvar sw = this._southWest,\r\n \t\t ne = this._northEast,\r\n \t\t sw2, ne2;\r\n\r\n \t\tif (obj instanceof LatLngBounds) {\r\n \t\t\tsw2 = obj.getSouthWest();\r\n \t\t\tne2 = obj.getNorthEast();\r\n \t\t} else {\r\n \t\t\tsw2 = ne2 = obj;\r\n \t\t}\r\n\r\n \t\treturn (sw2.lat >= sw.lat) && (ne2.lat <= ne.lat) &&\r\n \t\t (sw2.lng >= sw.lng) && (ne2.lng <= ne.lng);\r\n \t},\r\n\r\n \t// @method intersects(otherBounds: LatLngBounds): Boolean\r\n \t// Returns `true` if the rectangle intersects the given bounds. Two bounds intersect if they have at least one point in common.\r\n \tintersects: function (bounds) {\r\n \t\tbounds = toLatLngBounds(bounds);\r\n\r\n \t\tvar sw = this._southWest,\r\n \t\t ne = this._northEast,\r\n \t\t sw2 = bounds.getSouthWest(),\r\n \t\t ne2 = bounds.getNorthEast(),\r\n\r\n \t\t latIntersects = (ne2.lat >= sw.lat) && (sw2.lat <= ne.lat),\r\n \t\t lngIntersects = (ne2.lng >= sw.lng) && (sw2.lng <= ne.lng);\r\n\r\n \t\treturn latIntersects && lngIntersects;\r\n \t},\r\n\r\n \t// @method overlaps(otherBounds: LatLngBounds): Boolean\r\n \t// Returns `true` if the rectangle overlaps the given bounds. Two bounds overlap if their intersection is an area.\r\n \toverlaps: function (bounds) {\r\n \t\tbounds = toLatLngBounds(bounds);\r\n\r\n \t\tvar sw = this._southWest,\r\n \t\t ne = this._northEast,\r\n \t\t sw2 = bounds.getSouthWest(),\r\n \t\t ne2 = bounds.getNorthEast(),\r\n\r\n \t\t latOverlaps = (ne2.lat > sw.lat) && (sw2.lat < ne.lat),\r\n \t\t lngOverlaps = (ne2.lng > sw.lng) && (sw2.lng < ne.lng);\r\n\r\n \t\treturn latOverlaps && lngOverlaps;\r\n \t},\r\n\r\n \t// @method toBBoxString(): String\r\n \t// Returns a string with bounding box coordinates in a 'southwest_lng,southwest_lat,northeast_lng,northeast_lat' format. Useful for sending requests to web services that return geo data.\r\n \ttoBBoxString: function () {\r\n \t\treturn [this.getWest(), this.getSouth(), this.getEast(), this.getNorth()].join(',');\r\n \t},\r\n\r\n \t// @method equals(otherBounds: LatLngBounds, maxMargin?: Number): Boolean\r\n \t// Returns `true` if the rectangle is equivalent (within a small margin of error) to the given bounds. The margin of error can be overridden by setting `maxMargin` to a small number.\r\n \tequals: function (bounds, maxMargin) {\r\n \t\tif (!bounds) { return false; }\r\n\r\n \t\tbounds = toLatLngBounds(bounds);\r\n\r\n \t\treturn this._southWest.equals(bounds.getSouthWest(), maxMargin) &&\r\n \t\t this._northEast.equals(bounds.getNorthEast(), maxMargin);\r\n \t},\r\n\r\n \t// @method isValid(): Boolean\r\n \t// Returns `true` if the bounds are properly initialized.\r\n \tisValid: function () {\r\n \t\treturn !!(this._southWest && this._northEast);\r\n \t}\r\n };\r\n\r\n // TODO International date line?\r\n\r\n // @factory L.latLngBounds(corner1: LatLng, corner2: LatLng)\r\n // Creates a `LatLngBounds` object by defining two diagonally opposite corners of the rectangle.\r\n\r\n // @alternative\r\n // @factory L.latLngBounds(latlngs: LatLng[])\r\n // Creates a `LatLngBounds` object defined by the geographical points it contains. Very useful for zooming the map to fit a particular set of locations with [`fitBounds`](#map-fitbounds).\r\n function toLatLngBounds(a, b) {\r\n \tif (a instanceof LatLngBounds) {\r\n \t\treturn a;\r\n \t}\r\n \treturn new LatLngBounds(a, b);\r\n }\n\n /* @class LatLng\r\n * @aka L.LatLng\r\n *\r\n * Represents a geographical point with a certain latitude and longitude.\r\n *\r\n * @example\r\n *\r\n * ```\r\n * var latlng = L.latLng(50.5, 30.5);\r\n * ```\r\n *\r\n * All Leaflet methods that accept LatLng objects also accept them in a simple Array form and simple object form (unless noted otherwise), so these lines are equivalent:\r\n *\r\n * ```\r\n * map.panTo([50, 30]);\r\n * map.panTo({lon: 30, lat: 50});\r\n * map.panTo({lat: 50, lng: 30});\r\n * map.panTo(L.latLng(50, 30));\r\n * ```\r\n *\r\n * Note that `LatLng` does not inherit from Leaflet's `Class` object,\r\n * which means new classes can't inherit from it, and new methods\r\n * can't be added to it with the `include` function.\r\n */\r\n\r\n function LatLng(lat, lng, alt) {\r\n \tif (isNaN(lat) || isNaN(lng)) {\r\n \t\tthrow new Error('Invalid LatLng object: (' + lat + ', ' + lng + ')');\r\n \t}\r\n\r\n \t// @property lat: Number\r\n \t// Latitude in degrees\r\n \tthis.lat = +lat;\r\n\r\n \t// @property lng: Number\r\n \t// Longitude in degrees\r\n \tthis.lng = +lng;\r\n\r\n \t// @property alt: Number\r\n \t// Altitude in meters (optional)\r\n \tif (alt !== undefined) {\r\n \t\tthis.alt = +alt;\r\n \t}\r\n }\r\n\r\n LatLng.prototype = {\r\n \t// @method equals(otherLatLng: LatLng, maxMargin?: Number): Boolean\r\n \t// Returns `true` if the given `LatLng` point is at the same position (within a small margin of error). The margin of error can be overridden by setting `maxMargin` to a small number.\r\n \tequals: function (obj, maxMargin) {\r\n \t\tif (!obj) { return false; }\r\n\r\n \t\tobj = toLatLng(obj);\r\n\r\n \t\tvar margin = Math.max(\r\n \t\t Math.abs(this.lat - obj.lat),\r\n \t\t Math.abs(this.lng - obj.lng));\r\n\r\n \t\treturn margin <= (maxMargin === undefined ? 1.0E-9 : maxMargin);\r\n \t},\r\n\r\n \t// @method toString(): String\r\n \t// Returns a string representation of the point (for debugging purposes).\r\n \ttoString: function (precision) {\r\n \t\treturn 'LatLng(' +\r\n \t\t formatNum(this.lat, precision) + ', ' +\r\n \t\t formatNum(this.lng, precision) + ')';\r\n \t},\r\n\r\n \t// @method distanceTo(otherLatLng: LatLng): Number\r\n \t// Returns the distance (in meters) to the given `LatLng` calculated using the [Spherical Law of Cosines](https://en.wikipedia.org/wiki/Spherical_law_of_cosines).\r\n \tdistanceTo: function (other) {\r\n \t\treturn Earth.distance(this, toLatLng(other));\r\n \t},\r\n\r\n \t// @method wrap(): LatLng\r\n \t// Returns a new `LatLng` object with the longitude wrapped so it's always between -180 and +180 degrees.\r\n \twrap: function () {\r\n \t\treturn Earth.wrapLatLng(this);\r\n \t},\r\n\r\n \t// @method toBounds(sizeInMeters: Number): LatLngBounds\r\n \t// Returns a new `LatLngBounds` object in which each boundary is `sizeInMeters/2` meters apart from the `LatLng`.\r\n \ttoBounds: function (sizeInMeters) {\r\n \t\tvar latAccuracy = 180 * sizeInMeters / 40075017,\r\n \t\t lngAccuracy = latAccuracy / Math.cos((Math.PI / 180) * this.lat);\r\n\r\n \t\treturn toLatLngBounds(\r\n \t\t [this.lat - latAccuracy, this.lng - lngAccuracy],\r\n \t\t [this.lat + latAccuracy, this.lng + lngAccuracy]);\r\n \t},\r\n\r\n \tclone: function () {\r\n \t\treturn new LatLng(this.lat, this.lng, this.alt);\r\n \t}\r\n };\r\n\r\n\r\n\r\n // @factory L.latLng(latitude: Number, longitude: Number, altitude?: Number): LatLng\r\n // Creates an object representing a geographical point with the given latitude and longitude (and optionally altitude).\r\n\r\n // @alternative\r\n // @factory L.latLng(coords: Array): LatLng\r\n // Expects an array of the form `[Number, Number]` or `[Number, Number, Number]` instead.\r\n\r\n // @alternative\r\n // @factory L.latLng(coords: Object): LatLng\r\n // Expects an plain object of the form `{lat: Number, lng: Number}` or `{lat: Number, lng: Number, alt: Number}` instead.\r\n\r\n function toLatLng(a, b, c) {\r\n \tif (a instanceof LatLng) {\r\n \t\treturn a;\r\n \t}\r\n \tif (isArray(a) && typeof a[0] !== 'object') {\r\n \t\tif (a.length === 3) {\r\n \t\t\treturn new LatLng(a[0], a[1], a[2]);\r\n \t\t}\r\n \t\tif (a.length === 2) {\r\n \t\t\treturn new LatLng(a[0], a[1]);\r\n \t\t}\r\n \t\treturn null;\r\n \t}\r\n \tif (a === undefined || a === null) {\r\n \t\treturn a;\r\n \t}\r\n \tif (typeof a === 'object' && 'lat' in a) {\r\n \t\treturn new LatLng(a.lat, 'lng' in a ? a.lng : a.lon, a.alt);\r\n \t}\r\n \tif (b === undefined) {\r\n \t\treturn null;\r\n \t}\r\n \treturn new LatLng(a, b, c);\r\n }\n\n /*\r\n * @namespace CRS\r\n * @crs L.CRS.Base\r\n * Object that defines coordinate reference systems for projecting\r\n * geographical points into pixel (screen) coordinates and back (and to\r\n * coordinates in other units for [WMS](https://en.wikipedia.org/wiki/Web_Map_Service) services). See\r\n * [spatial reference system](http://en.wikipedia.org/wiki/Coordinate_reference_system).\r\n *\r\n * Leaflet defines the most usual CRSs by default. If you want to use a\r\n * CRS not defined by default, take a look at the\r\n * [Proj4Leaflet](https://github.com/kartena/Proj4Leaflet) plugin.\r\n *\r\n * Note that the CRS instances do not inherit from Leaflet's `Class` object,\r\n * and can't be instantiated. Also, new classes can't inherit from them,\r\n * and methods can't be added to them with the `include` function.\r\n */\r\n\r\n var CRS = {\r\n \t// @method latLngToPoint(latlng: LatLng, zoom: Number): Point\r\n \t// Projects geographical coordinates into pixel coordinates for a given zoom.\r\n \tlatLngToPoint: function (latlng, zoom) {\r\n \t\tvar projectedPoint = this.projection.project(latlng),\r\n \t\t scale = this.scale(zoom);\r\n\r\n \t\treturn this.transformation._transform(projectedPoint, scale);\r\n \t},\r\n\r\n \t// @method pointToLatLng(point: Point, zoom: Number): LatLng\r\n \t// The inverse of `latLngToPoint`. Projects pixel coordinates on a given\r\n \t// zoom into geographical coordinates.\r\n \tpointToLatLng: function (point, zoom) {\r\n \t\tvar scale = this.scale(zoom),\r\n \t\t untransformedPoint = this.transformation.untransform(point, scale);\r\n\r\n \t\treturn this.projection.unproject(untransformedPoint);\r\n \t},\r\n\r\n \t// @method project(latlng: LatLng): Point\r\n \t// Projects geographical coordinates into coordinates in units accepted for\r\n \t// this CRS (e.g. meters for EPSG:3857, for passing it to WMS services).\r\n \tproject: function (latlng) {\r\n \t\treturn this.projection.project(latlng);\r\n \t},\r\n\r\n \t// @method unproject(point: Point): LatLng\r\n \t// Given a projected coordinate returns the corresponding LatLng.\r\n \t// The inverse of `project`.\r\n \tunproject: function (point) {\r\n \t\treturn this.projection.unproject(point);\r\n \t},\r\n\r\n \t// @method scale(zoom: Number): Number\r\n \t// Returns the scale used when transforming projected coordinates into\r\n \t// pixel coordinates for a particular zoom. For example, it returns\r\n \t// `256 * 2^zoom` for Mercator-based CRS.\r\n \tscale: function (zoom) {\r\n \t\treturn 256 * Math.pow(2, zoom);\r\n \t},\r\n\r\n \t// @method zoom(scale: Number): Number\r\n \t// Inverse of `scale()`, returns the zoom level corresponding to a scale\r\n \t// factor of `scale`.\r\n \tzoom: function (scale) {\r\n \t\treturn Math.log(scale / 256) / Math.LN2;\r\n \t},\r\n\r\n \t// @method getProjectedBounds(zoom: Number): Bounds\r\n \t// Returns the projection's bounds scaled and transformed for the provided `zoom`.\r\n \tgetProjectedBounds: function (zoom) {\r\n \t\tif (this.infinite) { return null; }\r\n\r\n \t\tvar b = this.projection.bounds,\r\n \t\t s = this.scale(zoom),\r\n \t\t min = this.transformation.transform(b.min, s),\r\n \t\t max = this.transformation.transform(b.max, s);\r\n\r\n \t\treturn new Bounds(min, max);\r\n \t},\r\n\r\n \t// @method distance(latlng1: LatLng, latlng2: LatLng): Number\r\n \t// Returns the distance between two geographical coordinates.\r\n\r\n \t// @property code: String\r\n \t// Standard code name of the CRS passed into WMS services (e.g. `'EPSG:3857'`)\r\n \t//\r\n \t// @property wrapLng: Number[]\r\n \t// An array of two numbers defining whether the longitude (horizontal) coordinate\r\n \t// axis wraps around a given range and how. Defaults to `[-180, 180]` in most\r\n \t// geographical CRSs. If `undefined`, the longitude axis does not wrap around.\r\n \t//\r\n \t// @property wrapLat: Number[]\r\n \t// Like `wrapLng`, but for the latitude (vertical) axis.\r\n\r\n \t// wrapLng: [min, max],\r\n \t// wrapLat: [min, max],\r\n\r\n \t// @property infinite: Boolean\r\n \t// If true, the coordinate space will be unbounded (infinite in both axes)\r\n \tinfinite: false,\r\n\r\n \t// @method wrapLatLng(latlng: LatLng): LatLng\r\n \t// Returns a `LatLng` where lat and lng has been wrapped according to the\r\n \t// CRS's `wrapLat` and `wrapLng` properties, if they are outside the CRS's bounds.\r\n \twrapLatLng: function (latlng) {\r\n \t\tvar lng = this.wrapLng ? wrapNum(latlng.lng, this.wrapLng, true) : latlng.lng,\r\n \t\t lat = this.wrapLat ? wrapNum(latlng.lat, this.wrapLat, true) : latlng.lat,\r\n \t\t alt = latlng.alt;\r\n\r\n \t\treturn new LatLng(lat, lng, alt);\r\n \t},\r\n\r\n \t// @method wrapLatLngBounds(bounds: LatLngBounds): LatLngBounds\r\n \t// Returns a `LatLngBounds` with the same size as the given one, ensuring\r\n \t// that its center is within the CRS's bounds.\r\n \t// Only accepts actual `L.LatLngBounds` instances, not arrays.\r\n \twrapLatLngBounds: function (bounds) {\r\n \t\tvar center = bounds.getCenter(),\r\n \t\t newCenter = this.wrapLatLng(center),\r\n \t\t latShift = center.lat - newCenter.lat,\r\n \t\t lngShift = center.lng - newCenter.lng;\r\n\r\n \t\tif (latShift === 0 && lngShift === 0) {\r\n \t\t\treturn bounds;\r\n \t\t}\r\n\r\n \t\tvar sw = bounds.getSouthWest(),\r\n \t\t ne = bounds.getNorthEast(),\r\n \t\t newSw = new LatLng(sw.lat - latShift, sw.lng - lngShift),\r\n \t\t newNe = new LatLng(ne.lat - latShift, ne.lng - lngShift);\r\n\r\n \t\treturn new LatLngBounds(newSw, newNe);\r\n \t}\r\n };\n\n /*\n * @namespace CRS\n * @crs L.CRS.Earth\n *\n * Serves as the base for CRS that are global such that they cover the earth.\n * Can only be used as the base for other CRS and cannot be used directly,\n * since it does not have a `code`, `projection` or `transformation`. `distance()` returns\n * meters.\n */\n\n var Earth = extend({}, CRS, {\n \twrapLng: [-180, 180],\n\n \t// Mean Earth Radius, as recommended for use by\n \t// the International Union of Geodesy and Geophysics,\n \t// see http://rosettacode.org/wiki/Haversine_formula\n \tR: 6371000,\n\n \t// distance between two geographical points using spherical law of cosines approximation\n \tdistance: function (latlng1, latlng2) {\n \t\tvar rad = Math.PI / 180,\n \t\t lat1 = latlng1.lat * rad,\n \t\t lat2 = latlng2.lat * rad,\n \t\t sinDLat = Math.sin((latlng2.lat - latlng1.lat) * rad / 2),\n \t\t sinDLon = Math.sin((latlng2.lng - latlng1.lng) * rad / 2),\n \t\t a = sinDLat * sinDLat + Math.cos(lat1) * Math.cos(lat2) * sinDLon * sinDLon,\n \t\t c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\n \t\treturn this.R * c;\n \t}\n });\n\n /*\r\n * @namespace Projection\r\n * @projection L.Projection.SphericalMercator\r\n *\r\n * Spherical Mercator projection — the most common projection for online maps,\r\n * used by almost all free and commercial tile providers. Assumes that Earth is\r\n * a sphere. Used by the `EPSG:3857` CRS.\r\n */\r\n\r\n var earthRadius = 6378137;\r\n\r\n var SphericalMercator = {\r\n\r\n \tR: earthRadius,\r\n \tMAX_LATITUDE: 85.0511287798,\r\n\r\n \tproject: function (latlng) {\r\n \t\tvar d = Math.PI / 180,\r\n \t\t max = this.MAX_LATITUDE,\r\n \t\t lat = Math.max(Math.min(max, latlng.lat), -max),\r\n \t\t sin = Math.sin(lat * d);\r\n\r\n \t\treturn new Point(\r\n \t\t\tthis.R * latlng.lng * d,\r\n \t\t\tthis.R * Math.log((1 + sin) / (1 - sin)) / 2);\r\n \t},\r\n\r\n \tunproject: function (point) {\r\n \t\tvar d = 180 / Math.PI;\r\n\r\n \t\treturn new LatLng(\r\n \t\t\t(2 * Math.atan(Math.exp(point.y / this.R)) - (Math.PI / 2)) * d,\r\n \t\t\tpoint.x * d / this.R);\r\n \t},\r\n\r\n \tbounds: (function () {\r\n \t\tvar d = earthRadius * Math.PI;\r\n \t\treturn new Bounds([-d, -d], [d, d]);\r\n \t})()\r\n };\n\n /*\r\n * @class Transformation\r\n * @aka L.Transformation\r\n *\r\n * Represents an affine transformation: a set of coefficients `a`, `b`, `c`, `d`\r\n * for transforming a point of a form `(x, y)` into `(a*x + b, c*y + d)` and doing\r\n * the reverse. Used by Leaflet in its projections code.\r\n *\r\n * @example\r\n *\r\n * ```js\r\n * var transformation = L.transformation(2, 5, -1, 10),\r\n * \tp = L.point(1, 2),\r\n * \tp2 = transformation.transform(p), // L.point(7, 8)\r\n * \tp3 = transformation.untransform(p2); // L.point(1, 2)\r\n * ```\r\n */\r\n\r\n\r\n // factory new L.Transformation(a: Number, b: Number, c: Number, d: Number)\r\n // Creates a `Transformation` object with the given coefficients.\r\n function Transformation(a, b, c, d) {\r\n \tif (isArray(a)) {\r\n \t\t// use array properties\r\n \t\tthis._a = a[0];\r\n \t\tthis._b = a[1];\r\n \t\tthis._c = a[2];\r\n \t\tthis._d = a[3];\r\n \t\treturn;\r\n \t}\r\n \tthis._a = a;\r\n \tthis._b = b;\r\n \tthis._c = c;\r\n \tthis._d = d;\r\n }\r\n\r\n Transformation.prototype = {\r\n \t// @method transform(point: Point, scale?: Number): Point\r\n \t// Returns a transformed point, optionally multiplied by the given scale.\r\n \t// Only accepts actual `L.Point` instances, not arrays.\r\n \ttransform: function (point, scale) { // (Point, Number) -> Point\r\n \t\treturn this._transform(point.clone(), scale);\r\n \t},\r\n\r\n \t// destructive transform (faster)\r\n \t_transform: function (point, scale) {\r\n \t\tscale = scale || 1;\r\n \t\tpoint.x = scale * (this._a * point.x + this._b);\r\n \t\tpoint.y = scale * (this._c * point.y + this._d);\r\n \t\treturn point;\r\n \t},\r\n\r\n \t// @method untransform(point: Point, scale?: Number): Point\r\n \t// Returns the reverse transformation of the given point, optionally divided\r\n \t// by the given scale. Only accepts actual `L.Point` instances, not arrays.\r\n \tuntransform: function (point, scale) {\r\n \t\tscale = scale || 1;\r\n \t\treturn new Point(\r\n \t\t (point.x / scale - this._b) / this._a,\r\n \t\t (point.y / scale - this._d) / this._c);\r\n \t}\r\n };\r\n\r\n // factory L.transformation(a: Number, b: Number, c: Number, d: Number)\r\n\r\n // @factory L.transformation(a: Number, b: Number, c: Number, d: Number)\r\n // Instantiates a Transformation object with the given coefficients.\r\n\r\n // @alternative\r\n // @factory L.transformation(coefficients: Array): Transformation\r\n // Expects an coefficients array of the form\r\n // `[a: Number, b: Number, c: Number, d: Number]`.\r\n\r\n function toTransformation(a, b, c, d) {\r\n \treturn new Transformation(a, b, c, d);\r\n }\n\n /*\r\n * @namespace CRS\r\n * @crs L.CRS.EPSG3857\r\n *\r\n * The most common CRS for online maps, used by almost all free and commercial\r\n * tile providers. Uses Spherical Mercator projection. Set in by default in\r\n * Map's `crs` option.\r\n */\r\n\r\n var EPSG3857 = extend({}, Earth, {\r\n \tcode: 'EPSG:3857',\r\n \tprojection: SphericalMercator,\r\n\r\n \ttransformation: (function () {\r\n \t\tvar scale = 0.5 / (Math.PI * SphericalMercator.R);\r\n \t\treturn toTransformation(scale, 0.5, -scale, 0.5);\r\n \t}())\r\n });\r\n\r\n var EPSG900913 = extend({}, EPSG3857, {\r\n \tcode: 'EPSG:900913'\r\n });\n\n // @namespace SVG; @section\n // There are several static functions which can be called without instantiating L.SVG:\n\n // @function create(name: String): SVGElement\n // Returns a instance of [SVGElement](https://developer.mozilla.org/docs/Web/API/SVGElement),\n // corresponding to the class name passed. For example, using 'line' will return\n // an instance of [SVGLineElement](https://developer.mozilla.org/docs/Web/API/SVGLineElement).\n function svgCreate(name) {\n \treturn document.createElementNS('http://www.w3.org/2000/svg', name);\n }\n\n // @function pointsToPath(rings: Point[], closed: Boolean): String\n // Generates a SVG path string for multiple rings, with each ring turning\n // into \"M..L..L..\" instructions\n function pointsToPath(rings, closed) {\n \tvar str = '',\n \ti, j, len, len2, points, p;\n\n \tfor (i = 0, len = rings.length; i < len; i++) {\n \t\tpoints = rings[i];\n\n \t\tfor (j = 0, len2 = points.length; j < len2; j++) {\n \t\t\tp = points[j];\n \t\t\tstr += (j ? 'L' : 'M') + p.x + ' ' + p.y;\n \t\t}\n\n \t\t// closes the ring for polygons; \"x\" is VML syntax\n \t\tstr += closed ? (svg ? 'z' : 'x') : '';\n \t}\n\n \t// SVG complains about empty path strings\n \treturn str || 'M0 0';\n }\n\n /*\r\n * @namespace Browser\r\n * @aka L.Browser\r\n *\r\n * A namespace with static properties for browser/feature detection used by Leaflet internally.\r\n *\r\n * @example\r\n *\r\n * ```js\r\n * if (L.Browser.ielt9) {\r\n * alert('Upgrade your browser, dude!');\r\n * }\r\n * ```\r\n */\r\n\r\n var style$1 = document.documentElement.style;\r\n\r\n // @property ie: Boolean; `true` for all Internet Explorer versions (not Edge).\r\n var ie = 'ActiveXObject' in window;\r\n\r\n // @property ielt9: Boolean; `true` for Internet Explorer versions less than 9.\r\n var ielt9 = ie && !document.addEventListener;\r\n\r\n // @property edge: Boolean; `true` for the Edge web browser.\r\n var edge = 'msLaunchUri' in navigator && !('documentMode' in document);\r\n\r\n // @property webkit: Boolean;\r\n // `true` for webkit-based browsers like Chrome and Safari (including mobile versions).\r\n var webkit = userAgentContains('webkit');\r\n\r\n // @property android: Boolean\r\n // `true` for any browser running on an Android platform.\r\n var android = userAgentContains('android');\r\n\r\n // @property android23: Boolean; `true` for browsers running on Android 2 or Android 3.\r\n var android23 = userAgentContains('android 2') || userAgentContains('android 3');\r\n\r\n /* See https://stackoverflow.com/a/17961266 for details on detecting stock Android */\r\n var webkitVer = parseInt(/WebKit\\/([0-9]+)|$/.exec(navigator.userAgent)[1], 10); // also matches AppleWebKit\r\n // @property androidStock: Boolean; `true` for the Android stock browser (i.e. not Chrome)\r\n var androidStock = android && userAgentContains('Google') && webkitVer < 537 && !('AudioNode' in window);\r\n\r\n // @property opera: Boolean; `true` for the Opera browser\r\n var opera = !!window.opera;\r\n\r\n // @property chrome: Boolean; `true` for the Chrome browser.\r\n var chrome = !edge && userAgentContains('chrome');\r\n\r\n // @property gecko: Boolean; `true` for gecko-based browsers like Firefox.\r\n var gecko = userAgentContains('gecko') && !webkit && !opera && !ie;\r\n\r\n // @property safari: Boolean; `true` for the Safari browser.\r\n var safari = !chrome && userAgentContains('safari');\r\n\r\n var phantom = userAgentContains('phantom');\r\n\r\n // @property opera12: Boolean\r\n // `true` for the Opera browser supporting CSS transforms (version 12 or later).\r\n var opera12 = 'OTransition' in style$1;\r\n\r\n // @property win: Boolean; `true` when the browser is running in a Windows platform\r\n var win = navigator.platform.indexOf('Win') === 0;\r\n\r\n // @property ie3d: Boolean; `true` for all Internet Explorer versions supporting CSS transforms.\r\n var ie3d = ie && ('transition' in style$1);\r\n\r\n // @property webkit3d: Boolean; `true` for webkit-based browsers supporting CSS transforms.\r\n var webkit3d = ('WebKitCSSMatrix' in window) && ('m11' in new window.WebKitCSSMatrix()) && !android23;\r\n\r\n // @property gecko3d: Boolean; `true` for gecko-based browsers supporting CSS transforms.\r\n var gecko3d = 'MozPerspective' in style$1;\r\n\r\n // @property any3d: Boolean\r\n // `true` for all browsers supporting CSS transforms.\r\n var any3d = !window.L_DISABLE_3D && (ie3d || webkit3d || gecko3d) && !opera12 && !phantom;\r\n\r\n // @property mobile: Boolean; `true` for all browsers running in a mobile device.\r\n var mobile = typeof orientation !== 'undefined' || userAgentContains('mobile');\r\n\r\n // @property mobileWebkit: Boolean; `true` for all webkit-based browsers in a mobile device.\r\n var mobileWebkit = mobile && webkit;\r\n\r\n // @property mobileWebkit3d: Boolean\r\n // `true` for all webkit-based browsers in a mobile device supporting CSS transforms.\r\n var mobileWebkit3d = mobile && webkit3d;\r\n\r\n // @property msPointer: Boolean\r\n // `true` for browsers implementing the Microsoft touch events model (notably IE10).\r\n var msPointer = !window.PointerEvent && window.MSPointerEvent;\r\n\r\n // @property pointer: Boolean\r\n // `true` for all browsers supporting [pointer events](https://msdn.microsoft.com/en-us/library/dn433244%28v=vs.85%29.aspx).\r\n var pointer = !!(window.PointerEvent || msPointer);\r\n\r\n // @property touch: Boolean\r\n // `true` for all browsers supporting [touch events](https://developer.mozilla.org/docs/Web/API/Touch_events).\r\n // This does not necessarily mean that the browser is running in a computer with\r\n // a touchscreen, it only means that the browser is capable of understanding\r\n // touch events.\r\n var touch = !window.L_NO_TOUCH && (pointer || 'ontouchstart' in window ||\r\n \t\t(window.DocumentTouch && document instanceof window.DocumentTouch));\r\n\r\n // @property mobileOpera: Boolean; `true` for the Opera browser in a mobile device.\r\n var mobileOpera = mobile && opera;\r\n\r\n // @property mobileGecko: Boolean\r\n // `true` for gecko-based browsers running in a mobile device.\r\n var mobileGecko = mobile && gecko;\r\n\r\n // @property retina: Boolean\r\n // `true` for browsers on a high-resolution \"retina\" screen or on any screen when browser's display zoom is more than 100%.\r\n var retina = (window.devicePixelRatio || (window.screen.deviceXDPI / window.screen.logicalXDPI)) > 1;\r\n\r\n // @property passiveEvents: Boolean\r\n // `true` for browsers that support passive events.\r\n var passiveEvents = (function () {\r\n \tvar supportsPassiveOption = false;\r\n \ttry {\r\n \t\tvar opts = Object.defineProperty({}, 'passive', {\r\n \t\t\tget: function () { // eslint-disable-line getter-return\r\n \t\t\t\tsupportsPassiveOption = true;\r\n \t\t\t}\r\n \t\t});\r\n \t\twindow.addEventListener('testPassiveEventSupport', falseFn, opts);\r\n \t\twindow.removeEventListener('testPassiveEventSupport', falseFn, opts);\r\n \t} catch (e) {\r\n \t\t// Errors can safely be ignored since this is only a browser support test.\r\n \t}\r\n \treturn supportsPassiveOption;\r\n }());\r\n\r\n // @property canvas: Boolean\r\n // `true` when the browser supports [``](https://developer.mozilla.org/docs/Web/API/Canvas_API).\r\n var canvas = (function () {\r\n \treturn !!document.createElement('canvas').getContext;\r\n }());\r\n\r\n // @property svg: Boolean\r\n // `true` when the browser supports [SVG](https://developer.mozilla.org/docs/Web/SVG).\r\n var svg = !!(document.createElementNS && svgCreate('svg').createSVGRect);\r\n\r\n // @property vml: Boolean\r\n // `true` if the browser supports [VML](https://en.wikipedia.org/wiki/Vector_Markup_Language).\r\n var vml = !svg && (function () {\r\n \ttry {\r\n \t\tvar div = document.createElement('div');\r\n \t\tdiv.innerHTML = '';\r\n\r\n \t\tvar shape = div.firstChild;\r\n \t\tshape.style.behavior = 'url(#default#VML)';\r\n\r\n \t\treturn shape && (typeof shape.adj === 'object');\r\n\r\n \t} catch (e) {\r\n \t\treturn false;\r\n \t}\r\n }());\r\n\r\n\r\n function userAgentContains(str) {\r\n \treturn navigator.userAgent.toLowerCase().indexOf(str) >= 0;\r\n }\n\n var Browser = ({\n ie: ie,\n ielt9: ielt9,\n edge: edge,\n webkit: webkit,\n android: android,\n android23: android23,\n androidStock: androidStock,\n opera: opera,\n chrome: chrome,\n gecko: gecko,\n safari: safari,\n phantom: phantom,\n opera12: opera12,\n win: win,\n ie3d: ie3d,\n webkit3d: webkit3d,\n gecko3d: gecko3d,\n any3d: any3d,\n mobile: mobile,\n mobileWebkit: mobileWebkit,\n mobileWebkit3d: mobileWebkit3d,\n msPointer: msPointer,\n pointer: pointer,\n touch: touch,\n mobileOpera: mobileOpera,\n mobileGecko: mobileGecko,\n retina: retina,\n passiveEvents: passiveEvents,\n canvas: canvas,\n svg: svg,\n vml: vml\n });\n\n /*\n * Extends L.DomEvent to provide touch support for Internet Explorer and Windows-based devices.\n */\n\n\n var POINTER_DOWN = msPointer ? 'MSPointerDown' : 'pointerdown';\n var POINTER_MOVE = msPointer ? 'MSPointerMove' : 'pointermove';\n var POINTER_UP = msPointer ? 'MSPointerUp' : 'pointerup';\n var POINTER_CANCEL = msPointer ? 'MSPointerCancel' : 'pointercancel';\n\n var _pointers = {};\n var _pointerDocListener = false;\n\n // Provides a touch events wrapper for (ms)pointer events.\n // ref http://www.w3.org/TR/pointerevents/ https://www.w3.org/Bugs/Public/show_bug.cgi?id=22890\n\n function addPointerListener(obj, type, handler, id) {\n \tif (type === 'touchstart') {\n \t\t_addPointerStart(obj, handler, id);\n\n \t} else if (type === 'touchmove') {\n \t\t_addPointerMove(obj, handler, id);\n\n \t} else if (type === 'touchend') {\n \t\t_addPointerEnd(obj, handler, id);\n \t}\n\n \treturn this;\n }\n\n function removePointerListener(obj, type, id) {\n \tvar handler = obj['_leaflet_' + type + id];\n\n \tif (type === 'touchstart') {\n \t\tobj.removeEventListener(POINTER_DOWN, handler, false);\n\n \t} else if (type === 'touchmove') {\n \t\tobj.removeEventListener(POINTER_MOVE, handler, false);\n\n \t} else if (type === 'touchend') {\n \t\tobj.removeEventListener(POINTER_UP, handler, false);\n \t\tobj.removeEventListener(POINTER_CANCEL, handler, false);\n \t}\n\n \treturn this;\n }\n\n function _addPointerStart(obj, handler, id) {\n \tvar onDown = bind(function (e) {\n \t\t// IE10 specific: MsTouch needs preventDefault. See #2000\n \t\tif (e.MSPOINTER_TYPE_TOUCH && e.pointerType === e.MSPOINTER_TYPE_TOUCH) {\n \t\t\tpreventDefault(e);\n \t\t}\n\n \t\t_handlePointer(e, handler);\n \t});\n\n \tobj['_leaflet_touchstart' + id] = onDown;\n \tobj.addEventListener(POINTER_DOWN, onDown, false);\n\n \t// need to keep track of what pointers and how many are active to provide e.touches emulation\n \tif (!_pointerDocListener) {\n \t\t// we listen document as any drags that end by moving the touch off the screen get fired there\n \t\tdocument.addEventListener(POINTER_DOWN, _globalPointerDown, true);\n \t\tdocument.addEventListener(POINTER_MOVE, _globalPointerMove, true);\n \t\tdocument.addEventListener(POINTER_UP, _globalPointerUp, true);\n \t\tdocument.addEventListener(POINTER_CANCEL, _globalPointerUp, true);\n\n \t\t_pointerDocListener = true;\n \t}\n }\n\n function _globalPointerDown(e) {\n \t_pointers[e.pointerId] = e;\n }\n\n function _globalPointerMove(e) {\n \tif (_pointers[e.pointerId]) {\n \t\t_pointers[e.pointerId] = e;\n \t}\n }\n\n function _globalPointerUp(e) {\n \tdelete _pointers[e.pointerId];\n }\n\n function _handlePointer(e, handler) {\n \te.touches = [];\n \tfor (var i in _pointers) {\n \t\te.touches.push(_pointers[i]);\n \t}\n \te.changedTouches = [e];\n\n \thandler(e);\n }\n\n function _addPointerMove(obj, handler, id) {\n \tvar onMove = function (e) {\n \t\t// don't fire touch moves when mouse isn't down\n \t\tif ((e.pointerType === (e.MSPOINTER_TYPE_MOUSE || 'mouse')) && e.buttons === 0) {\n \t\t\treturn;\n \t\t}\n\n \t\t_handlePointer(e, handler);\n \t};\n\n \tobj['_leaflet_touchmove' + id] = onMove;\n \tobj.addEventListener(POINTER_MOVE, onMove, false);\n }\n\n function _addPointerEnd(obj, handler, id) {\n \tvar onUp = function (e) {\n \t\t_handlePointer(e, handler);\n \t};\n\n \tobj['_leaflet_touchend' + id] = onUp;\n \tobj.addEventListener(POINTER_UP, onUp, false);\n \tobj.addEventListener(POINTER_CANCEL, onUp, false);\n }\n\n /*\r\n * Extends the event handling code with double tap support for mobile browsers.\r\n */\r\n\r\n var _touchstart = msPointer ? 'MSPointerDown' : pointer ? 'pointerdown' : 'touchstart';\r\n var _touchend = msPointer ? 'MSPointerUp' : pointer ? 'pointerup' : 'touchend';\r\n var _pre = '_leaflet_';\r\n\r\n // inspired by Zepto touch code by Thomas Fuchs\r\n function addDoubleTapListener(obj, handler, id) {\r\n \tvar last, touch$$1,\r\n \t doubleTap = false,\r\n \t delay = 250;\r\n\r\n \tfunction onTouchStart(e) {\r\n\r\n \t\tif (pointer) {\r\n \t\t\tif (!e.isPrimary) { return; }\r\n \t\t\tif (e.pointerType === 'mouse') { return; } // mouse fires native dblclick\r\n \t\t} else if (e.touches.length > 1) {\r\n \t\t\treturn;\r\n \t\t}\r\n\r\n \t\tvar now = Date.now(),\r\n \t\t delta = now - (last || now);\r\n\r\n \t\ttouch$$1 = e.touches ? e.touches[0] : e;\r\n \t\tdoubleTap = (delta > 0 && delta <= delay);\r\n \t\tlast = now;\r\n \t}\r\n\r\n \tfunction onTouchEnd(e) {\r\n \t\tif (doubleTap && !touch$$1.cancelBubble) {\r\n \t\t\tif (pointer) {\r\n \t\t\t\tif (e.pointerType === 'mouse') { return; }\r\n \t\t\t\t// work around .type being readonly with MSPointer* events\r\n \t\t\t\tvar newTouch = {},\r\n \t\t\t\t prop, i;\r\n\r\n \t\t\t\tfor (i in touch$$1) {\r\n \t\t\t\t\tprop = touch$$1[i];\r\n \t\t\t\t\tnewTouch[i] = prop && prop.bind ? prop.bind(touch$$1) : prop;\r\n \t\t\t\t}\r\n \t\t\t\ttouch$$1 = newTouch;\r\n \t\t\t}\r\n \t\t\ttouch$$1.type = 'dblclick';\r\n \t\t\ttouch$$1.button = 0;\r\n \t\t\thandler(touch$$1);\r\n \t\t\tlast = null;\r\n \t\t}\r\n \t}\r\n\r\n \tobj[_pre + _touchstart + id] = onTouchStart;\r\n \tobj[_pre + _touchend + id] = onTouchEnd;\r\n \tobj[_pre + 'dblclick' + id] = handler;\r\n\r\n \tobj.addEventListener(_touchstart, onTouchStart, passiveEvents ? {passive: false} : false);\r\n \tobj.addEventListener(_touchend, onTouchEnd, passiveEvents ? {passive: false} : false);\r\n\r\n \t// On some platforms (notably, chrome<55 on win10 + touchscreen + mouse),\r\n \t// the browser doesn't fire touchend/pointerup events but does fire\r\n \t// native dblclicks. See #4127.\r\n \t// Edge 14 also fires native dblclicks, but only for pointerType mouse, see #5180.\r\n \tobj.addEventListener('dblclick', handler, false);\r\n\r\n \treturn this;\r\n }\r\n\r\n function removeDoubleTapListener(obj, id) {\r\n \tvar touchstart = obj[_pre + _touchstart + id],\r\n \t touchend = obj[_pre + _touchend + id],\r\n \t dblclick = obj[_pre + 'dblclick' + id];\r\n\r\n \tobj.removeEventListener(_touchstart, touchstart, passiveEvents ? {passive: false} : false);\r\n \tobj.removeEventListener(_touchend, touchend, passiveEvents ? {passive: false} : false);\r\n \tobj.removeEventListener('dblclick', dblclick, false);\r\n\r\n \treturn this;\r\n }\n\n /*\r\n * @namespace DomUtil\r\n *\r\n * Utility functions to work with the [DOM](https://developer.mozilla.org/docs/Web/API/Document_Object_Model)\r\n * tree, used by Leaflet internally.\r\n *\r\n * Most functions expecting or returning a `HTMLElement` also work for\r\n * SVG elements. The only difference is that classes refer to CSS classes\r\n * in HTML and SVG classes in SVG.\r\n */\r\n\r\n\r\n // @property TRANSFORM: String\r\n // Vendor-prefixed transform style name (e.g. `'webkitTransform'` for WebKit).\r\n var TRANSFORM = testProp(\r\n \t['transform', 'webkitTransform', 'OTransform', 'MozTransform', 'msTransform']);\r\n\r\n // webkitTransition comes first because some browser versions that drop vendor prefix don't do\r\n // the same for the transitionend event, in particular the Android 4.1 stock browser\r\n\r\n // @property TRANSITION: String\r\n // Vendor-prefixed transition style name.\r\n var TRANSITION = testProp(\r\n \t['webkitTransition', 'transition', 'OTransition', 'MozTransition', 'msTransition']);\r\n\r\n // @property TRANSITION_END: String\r\n // Vendor-prefixed transitionend event name.\r\n var TRANSITION_END =\r\n \tTRANSITION === 'webkitTransition' || TRANSITION === 'OTransition' ? TRANSITION + 'End' : 'transitionend';\r\n\r\n\r\n // @function get(id: String|HTMLElement): HTMLElement\r\n // Returns an element given its DOM id, or returns the element itself\r\n // if it was passed directly.\r\n function get(id) {\r\n \treturn typeof id === 'string' ? document.getElementById(id) : id;\r\n }\r\n\r\n // @function getStyle(el: HTMLElement, styleAttrib: String): String\r\n // Returns the value for a certain style attribute on an element,\r\n // including computed values or values set through CSS.\r\n function getStyle(el, style) {\r\n \tvar value = el.style[style] || (el.currentStyle && el.currentStyle[style]);\r\n\r\n \tif ((!value || value === 'auto') && document.defaultView) {\r\n \t\tvar css = document.defaultView.getComputedStyle(el, null);\r\n \t\tvalue = css ? css[style] : null;\r\n \t}\r\n \treturn value === 'auto' ? null : value;\r\n }\r\n\r\n // @function create(tagName: String, className?: String, container?: HTMLElement): HTMLElement\r\n // Creates an HTML element with `tagName`, sets its class to `className`, and optionally appends it to `container` element.\r\n function create$1(tagName, className, container) {\r\n \tvar el = document.createElement(tagName);\r\n \tel.className = className || '';\r\n\r\n \tif (container) {\r\n \t\tcontainer.appendChild(el);\r\n \t}\r\n \treturn el;\r\n }\r\n\r\n // @function remove(el: HTMLElement)\r\n // Removes `el` from its parent element\r\n function remove(el) {\r\n \tvar parent = el.parentNode;\r\n \tif (parent) {\r\n \t\tparent.removeChild(el);\r\n \t}\r\n }\r\n\r\n // @function empty(el: HTMLElement)\r\n // Removes all of `el`'s children elements from `el`\r\n function empty(el) {\r\n \twhile (el.firstChild) {\r\n \t\tel.removeChild(el.firstChild);\r\n \t}\r\n }\r\n\r\n // @function toFront(el: HTMLElement)\r\n // Makes `el` the last child of its parent, so it renders in front of the other children.\r\n function toFront(el) {\r\n \tvar parent = el.parentNode;\r\n \tif (parent && parent.lastChild !== el) {\r\n \t\tparent.appendChild(el);\r\n \t}\r\n }\r\n\r\n // @function toBack(el: HTMLElement)\r\n // Makes `el` the first child of its parent, so it renders behind the other children.\r\n function toBack(el) {\r\n \tvar parent = el.parentNode;\r\n \tif (parent && parent.firstChild !== el) {\r\n \t\tparent.insertBefore(el, parent.firstChild);\r\n \t}\r\n }\r\n\r\n // @function hasClass(el: HTMLElement, name: String): Boolean\r\n // Returns `true` if the element's class attribute contains `name`.\r\n function hasClass(el, name) {\r\n \tif (el.classList !== undefined) {\r\n \t\treturn el.classList.contains(name);\r\n \t}\r\n \tvar className = getClass(el);\r\n \treturn className.length > 0 && new RegExp('(^|\\\\s)' + name + '(\\\\s|$)').test(className);\r\n }\r\n\r\n // @function addClass(el: HTMLElement, name: String)\r\n // Adds `name` to the element's class attribute.\r\n function addClass(el, name) {\r\n \tif (el.classList !== undefined) {\r\n \t\tvar classes = splitWords(name);\r\n \t\tfor (var i = 0, len = classes.length; i < len; i++) {\r\n \t\t\tel.classList.add(classes[i]);\r\n \t\t}\r\n \t} else if (!hasClass(el, name)) {\r\n \t\tvar className = getClass(el);\r\n \t\tsetClass(el, (className ? className + ' ' : '') + name);\r\n \t}\r\n }\r\n\r\n // @function removeClass(el: HTMLElement, name: String)\r\n // Removes `name` from the element's class attribute.\r\n function removeClass(el, name) {\r\n \tif (el.classList !== undefined) {\r\n \t\tel.classList.remove(name);\r\n \t} else {\r\n \t\tsetClass(el, trim((' ' + getClass(el) + ' ').replace(' ' + name + ' ', ' ')));\r\n \t}\r\n }\r\n\r\n // @function setClass(el: HTMLElement, name: String)\r\n // Sets the element's class.\r\n function setClass(el, name) {\r\n \tif (el.className.baseVal === undefined) {\r\n \t\tel.className = name;\r\n \t} else {\r\n \t\t// in case of SVG element\r\n \t\tel.className.baseVal = name;\r\n \t}\r\n }\r\n\r\n // @function getClass(el: HTMLElement): String\r\n // Returns the element's class.\r\n function getClass(el) {\r\n \t// Check if the element is an SVGElementInstance and use the correspondingElement instead\r\n \t// (Required for linked SVG elements in IE11.)\r\n \tif (el.correspondingElement) {\r\n \t\tel = el.correspondingElement;\r\n \t}\r\n \treturn el.className.baseVal === undefined ? el.className : el.className.baseVal;\r\n }\r\n\r\n // @function setOpacity(el: HTMLElement, opacity: Number)\r\n // Set the opacity of an element (including old IE support).\r\n // `opacity` must be a number from `0` to `1`.\r\n function setOpacity(el, value) {\r\n \tif ('opacity' in el.style) {\r\n \t\tel.style.opacity = value;\r\n \t} else if ('filter' in el.style) {\r\n \t\t_setOpacityIE(el, value);\r\n \t}\r\n }\r\n\r\n function _setOpacityIE(el, value) {\r\n \tvar filter = false,\r\n \t filterName = 'DXImageTransform.Microsoft.Alpha';\r\n\r\n \t// filters collection throws an error if we try to retrieve a filter that doesn't exist\r\n \ttry {\r\n \t\tfilter = el.filters.item(filterName);\r\n \t} catch (e) {\r\n \t\t// don't set opacity to 1 if we haven't already set an opacity,\r\n \t\t// it isn't needed and breaks transparent pngs.\r\n \t\tif (value === 1) { return; }\r\n \t}\r\n\r\n \tvalue = Math.round(value * 100);\r\n\r\n \tif (filter) {\r\n \t\tfilter.Enabled = (value !== 100);\r\n \t\tfilter.Opacity = value;\r\n \t} else {\r\n \t\tel.style.filter += ' progid:' + filterName + '(opacity=' + value + ')';\r\n \t}\r\n }\r\n\r\n // @function testProp(props: String[]): String|false\r\n // Goes through the array of style names and returns the first name\r\n // that is a valid style name for an element. If no such name is found,\r\n // it returns false. Useful for vendor-prefixed styles like `transform`.\r\n function testProp(props) {\r\n \tvar style = document.documentElement.style;\r\n\r\n \tfor (var i = 0; i < props.length; i++) {\r\n \t\tif (props[i] in style) {\r\n \t\t\treturn props[i];\r\n \t\t}\r\n \t}\r\n \treturn false;\r\n }\r\n\r\n // @function setTransform(el: HTMLElement, offset: Point, scale?: Number)\r\n // Resets the 3D CSS transform of `el` so it is translated by `offset` pixels\r\n // and optionally scaled by `scale`. Does not have an effect if the\r\n // browser doesn't support 3D CSS transforms.\r\n function setTransform(el, offset, scale) {\r\n \tvar pos = offset || new Point(0, 0);\r\n\r\n \tel.style[TRANSFORM] =\r\n \t\t(ie3d ?\r\n \t\t\t'translate(' + pos.x + 'px,' + pos.y + 'px)' :\r\n \t\t\t'translate3d(' + pos.x + 'px,' + pos.y + 'px,0)') +\r\n \t\t(scale ? ' scale(' + scale + ')' : '');\r\n }\r\n\r\n // @function setPosition(el: HTMLElement, position: Point)\r\n // Sets the position of `el` to coordinates specified by `position`,\r\n // using CSS translate or top/left positioning depending on the browser\r\n // (used by Leaflet internally to position its layers).\r\n function setPosition(el, point) {\r\n\r\n \t/*eslint-disable */\r\n \tel._leaflet_pos = point;\r\n \t/* eslint-enable */\r\n\r\n \tif (any3d) {\r\n \t\tsetTransform(el, point);\r\n \t} else {\r\n \t\tel.style.left = point.x + 'px';\r\n \t\tel.style.top = point.y + 'px';\r\n \t}\r\n }\r\n\r\n // @function getPosition(el: HTMLElement): Point\r\n // Returns the coordinates of an element previously positioned with setPosition.\r\n function getPosition(el) {\r\n \t// this method is only used for elements previously positioned using setPosition,\r\n \t// so it's safe to cache the position for performance\r\n\r\n \treturn el._leaflet_pos || new Point(0, 0);\r\n }\r\n\r\n // @function disableTextSelection()\r\n // Prevents the user from generating `selectstart` DOM events, usually generated\r\n // when the user drags the mouse through a page with text. Used internally\r\n // by Leaflet to override the behaviour of any click-and-drag interaction on\r\n // the map. Affects drag interactions on the whole document.\r\n\r\n // @function enableTextSelection()\r\n // Cancels the effects of a previous [`L.DomUtil.disableTextSelection`](#domutil-disabletextselection).\r\n var disableTextSelection;\r\n var enableTextSelection;\r\n var _userSelect;\r\n if ('onselectstart' in document) {\r\n \tdisableTextSelection = function () {\r\n \t\ton(window, 'selectstart', preventDefault);\r\n \t};\r\n \tenableTextSelection = function () {\r\n \t\toff(window, 'selectstart', preventDefault);\r\n \t};\r\n } else {\r\n \tvar userSelectProperty = testProp(\r\n \t\t['userSelect', 'WebkitUserSelect', 'OUserSelect', 'MozUserSelect', 'msUserSelect']);\r\n\r\n \tdisableTextSelection = function () {\r\n \t\tif (userSelectProperty) {\r\n \t\t\tvar style = document.documentElement.style;\r\n \t\t\t_userSelect = style[userSelectProperty];\r\n \t\t\tstyle[userSelectProperty] = 'none';\r\n \t\t}\r\n \t};\r\n \tenableTextSelection = function () {\r\n \t\tif (userSelectProperty) {\r\n \t\t\tdocument.documentElement.style[userSelectProperty] = _userSelect;\r\n \t\t\t_userSelect = undefined;\r\n \t\t}\r\n \t};\r\n }\r\n\r\n // @function disableImageDrag()\r\n // As [`L.DomUtil.disableTextSelection`](#domutil-disabletextselection), but\r\n // for `dragstart` DOM events, usually generated when the user drags an image.\r\n function disableImageDrag() {\r\n \ton(window, 'dragstart', preventDefault);\r\n }\r\n\r\n // @function enableImageDrag()\r\n // Cancels the effects of a previous [`L.DomUtil.disableImageDrag`](#domutil-disabletextselection).\r\n function enableImageDrag() {\r\n \toff(window, 'dragstart', preventDefault);\r\n }\r\n\r\n var _outlineElement, _outlineStyle;\r\n // @function preventOutline(el: HTMLElement)\r\n // Makes the [outline](https://developer.mozilla.org/docs/Web/CSS/outline)\r\n // of the element `el` invisible. Used internally by Leaflet to prevent\r\n // focusable elements from displaying an outline when the user performs a\r\n // drag interaction on them.\r\n function preventOutline(element) {\r\n \twhile (element.tabIndex === -1) {\r\n \t\telement = element.parentNode;\r\n \t}\r\n \tif (!element.style) { return; }\r\n \trestoreOutline();\r\n \t_outlineElement = element;\r\n \t_outlineStyle = element.style.outline;\r\n \telement.style.outline = 'none';\r\n \ton(window, 'keydown', restoreOutline);\r\n }\r\n\r\n // @function restoreOutline()\r\n // Cancels the effects of a previous [`L.DomUtil.preventOutline`]().\r\n function restoreOutline() {\r\n \tif (!_outlineElement) { return; }\r\n \t_outlineElement.style.outline = _outlineStyle;\r\n \t_outlineElement = undefined;\r\n \t_outlineStyle = undefined;\r\n \toff(window, 'keydown', restoreOutline);\r\n }\r\n\r\n // @function getSizedParentNode(el: HTMLElement): HTMLElement\r\n // Finds the closest parent node which size (width and height) is not null.\r\n function getSizedParentNode(element) {\r\n \tdo {\r\n \t\telement = element.parentNode;\r\n \t} while ((!element.offsetWidth || !element.offsetHeight) && element !== document.body);\r\n \treturn element;\r\n }\r\n\r\n // @function getScale(el: HTMLElement): Object\r\n // Computes the CSS scale currently applied on the element.\r\n // Returns an object with `x` and `y` members as horizontal and vertical scales respectively,\r\n // and `boundingClientRect` as the result of [`getBoundingClientRect()`](https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect).\r\n function getScale(element) {\r\n \tvar rect = element.getBoundingClientRect(); // Read-only in old browsers.\r\n\r\n \treturn {\r\n \t\tx: rect.width / element.offsetWidth || 1,\r\n \t\ty: rect.height / element.offsetHeight || 1,\r\n \t\tboundingClientRect: rect\r\n \t};\r\n }\n\n var DomUtil = ({\n TRANSFORM: TRANSFORM,\n TRANSITION: TRANSITION,\n TRANSITION_END: TRANSITION_END,\n get: get,\n getStyle: getStyle,\n create: create$1,\n remove: remove,\n empty: empty,\n toFront: toFront,\n toBack: toBack,\n hasClass: hasClass,\n addClass: addClass,\n removeClass: removeClass,\n setClass: setClass,\n getClass: getClass,\n setOpacity: setOpacity,\n testProp: testProp,\n setTransform: setTransform,\n setPosition: setPosition,\n getPosition: getPosition,\n disableTextSelection: disableTextSelection,\n enableTextSelection: enableTextSelection,\n disableImageDrag: disableImageDrag,\n enableImageDrag: enableImageDrag,\n preventOutline: preventOutline,\n restoreOutline: restoreOutline,\n getSizedParentNode: getSizedParentNode,\n getScale: getScale\n });\n\n /*\r\n * @namespace DomEvent\r\n * Utility functions to work with the [DOM events](https://developer.mozilla.org/docs/Web/API/Event), used by Leaflet internally.\r\n */\r\n\r\n // Inspired by John Resig, Dean Edwards and YUI addEvent implementations.\r\n\r\n // @function on(el: HTMLElement, types: String, fn: Function, context?: Object): this\r\n // Adds a listener function (`fn`) to a particular DOM event type of the\r\n // element `el`. You can optionally specify the context of the listener\r\n // (object the `this` keyword will point to). You can also pass several\r\n // space-separated types (e.g. `'click dblclick'`).\r\n\r\n // @alternative\r\n // @function on(el: HTMLElement, eventMap: Object, context?: Object): this\r\n // Adds a set of type/listener pairs, e.g. `{click: onClick, mousemove: onMouseMove}`\r\n function on(obj, types, fn, context) {\r\n\r\n \tif (typeof types === 'object') {\r\n \t\tfor (var type in types) {\r\n \t\t\taddOne(obj, type, types[type], fn);\r\n \t\t}\r\n \t} else {\r\n \t\ttypes = splitWords(types);\r\n\r\n \t\tfor (var i = 0, len = types.length; i < len; i++) {\r\n \t\t\taddOne(obj, types[i], fn, context);\r\n \t\t}\r\n \t}\r\n\r\n \treturn this;\r\n }\r\n\r\n var eventsKey = '_leaflet_events';\r\n\r\n // @function off(el: HTMLElement, types: String, fn: Function, context?: Object): this\r\n // Removes a previously added listener function.\r\n // Note that if you passed a custom context to on, you must pass the same\r\n // context to `off` in order to remove the listener.\r\n\r\n // @alternative\r\n // @function off(el: HTMLElement, eventMap: Object, context?: Object): this\r\n // Removes a set of type/listener pairs, e.g. `{click: onClick, mousemove: onMouseMove}`\r\n function off(obj, types, fn, context) {\r\n\r\n \tif (typeof types === 'object') {\r\n \t\tfor (var type in types) {\r\n \t\t\tremoveOne(obj, type, types[type], fn);\r\n \t\t}\r\n \t} else if (types) {\r\n \t\ttypes = splitWords(types);\r\n\r\n \t\tfor (var i = 0, len = types.length; i < len; i++) {\r\n \t\t\tremoveOne(obj, types[i], fn, context);\r\n \t\t}\r\n \t} else {\r\n \t\tfor (var j in obj[eventsKey]) {\r\n \t\t\tremoveOne(obj, j, obj[eventsKey][j]);\r\n \t\t}\r\n \t\tdelete obj[eventsKey];\r\n \t}\r\n\r\n \treturn this;\r\n }\r\n\r\n function browserFiresNativeDblClick() {\r\n \t// See https://github.com/w3c/pointerevents/issues/171\r\n \tif (pointer) {\r\n \t\treturn !(edge || safari);\r\n \t}\r\n }\r\n\r\n var mouseSubst = {\r\n \tmouseenter: 'mouseover',\r\n \tmouseleave: 'mouseout',\r\n \twheel: !('onwheel' in window) && 'mousewheel'\r\n };\r\n\r\n function addOne(obj, type, fn, context) {\r\n \tvar id = type + stamp(fn) + (context ? '_' + stamp(context) : '');\r\n\r\n \tif (obj[eventsKey] && obj[eventsKey][id]) { return this; }\r\n\r\n \tvar handler = function (e) {\r\n \t\treturn fn.call(context || obj, e || window.event);\r\n \t};\r\n\r\n \tvar originalHandler = handler;\r\n\r\n \tif (pointer && type.indexOf('touch') === 0) {\r\n \t\t// Needs DomEvent.Pointer.js\r\n \t\taddPointerListener(obj, type, handler, id);\r\n\r\n \t} else if (touch && (type === 'dblclick') && !browserFiresNativeDblClick()) {\r\n \t\taddDoubleTapListener(obj, handler, id);\r\n\r\n \t} else if ('addEventListener' in obj) {\r\n\r\n \t\tif (type === 'touchstart' || type === 'touchmove' || type === 'wheel' || type === 'mousewheel') {\r\n \t\t\tobj.addEventListener(mouseSubst[type] || type, handler, passiveEvents ? {passive: false} : false);\r\n\r\n \t\t} else if (type === 'mouseenter' || type === 'mouseleave') {\r\n \t\t\thandler = function (e) {\r\n \t\t\t\te = e || window.event;\r\n \t\t\t\tif (isExternalTarget(obj, e)) {\r\n \t\t\t\t\toriginalHandler(e);\r\n \t\t\t\t}\r\n \t\t\t};\r\n \t\t\tobj.addEventListener(mouseSubst[type], handler, false);\r\n\r\n \t\t} else {\r\n \t\t\tobj.addEventListener(type, originalHandler, false);\r\n \t\t}\r\n\r\n \t} else if ('attachEvent' in obj) {\r\n \t\tobj.attachEvent('on' + type, handler);\r\n \t}\r\n\r\n \tobj[eventsKey] = obj[eventsKey] || {};\r\n \tobj[eventsKey][id] = handler;\r\n }\r\n\r\n function removeOne(obj, type, fn, context) {\r\n\r\n \tvar id = type + stamp(fn) + (context ? '_' + stamp(context) : ''),\r\n \t handler = obj[eventsKey] && obj[eventsKey][id];\r\n\r\n \tif (!handler) { return this; }\r\n\r\n \tif (pointer && type.indexOf('touch') === 0) {\r\n \t\tremovePointerListener(obj, type, id);\r\n\r\n \t} else if (touch && (type === 'dblclick') && !browserFiresNativeDblClick()) {\r\n \t\tremoveDoubleTapListener(obj, id);\r\n\r\n \t} else if ('removeEventListener' in obj) {\r\n\r\n \t\tobj.removeEventListener(mouseSubst[type] || type, handler, false);\r\n\r\n \t} else if ('detachEvent' in obj) {\r\n \t\tobj.detachEvent('on' + type, handler);\r\n \t}\r\n\r\n \tobj[eventsKey][id] = null;\r\n }\r\n\r\n // @function stopPropagation(ev: DOMEvent): this\r\n // Stop the given event from propagation to parent elements. Used inside the listener functions:\r\n // ```js\r\n // L.DomEvent.on(div, 'click', function (ev) {\r\n // \tL.DomEvent.stopPropagation(ev);\r\n // });\r\n // ```\r\n function stopPropagation(e) {\r\n\r\n \tif (e.stopPropagation) {\r\n \t\te.stopPropagation();\r\n \t} else if (e.originalEvent) { // In case of Leaflet event.\r\n \t\te.originalEvent._stopped = true;\r\n \t} else {\r\n \t\te.cancelBubble = true;\r\n \t}\r\n \tskipped(e);\r\n\r\n \treturn this;\r\n }\r\n\r\n // @function disableScrollPropagation(el: HTMLElement): this\r\n // Adds `stopPropagation` to the element's `'wheel'` events (plus browser variants).\r\n function disableScrollPropagation(el) {\r\n \taddOne(el, 'wheel', stopPropagation);\r\n \treturn this;\r\n }\r\n\r\n // @function disableClickPropagation(el: HTMLElement): this\r\n // Adds `stopPropagation` to the element's `'click'`, `'doubleclick'`,\r\n // `'mousedown'` and `'touchstart'` events (plus browser variants).\r\n function disableClickPropagation(el) {\r\n \ton(el, 'mousedown touchstart dblclick', stopPropagation);\r\n \taddOne(el, 'click', fakeStop);\r\n \treturn this;\r\n }\r\n\r\n // @function preventDefault(ev: DOMEvent): this\r\n // Prevents the default action of the DOM Event `ev` from happening (such as\r\n // following a link in the href of the a element, or doing a POST request\r\n // with page reload when a `
` is submitted).\r\n // Use it inside listener functions.\r\n function preventDefault(e) {\r\n \tif (e.preventDefault) {\r\n \t\te.preventDefault();\r\n \t} else {\r\n \t\te.returnValue = false;\r\n \t}\r\n \treturn this;\r\n }\r\n\r\n // @function stop(ev: DOMEvent): this\r\n // Does `stopPropagation` and `preventDefault` at the same time.\r\n function stop(e) {\r\n \tpreventDefault(e);\r\n \tstopPropagation(e);\r\n \treturn this;\r\n }\r\n\r\n // @function getMousePosition(ev: DOMEvent, container?: HTMLElement): Point\r\n // Gets normalized mouse position from a DOM event relative to the\r\n // `container` (border excluded) or to the whole page if not specified.\r\n function getMousePosition(e, container) {\r\n \tif (!container) {\r\n \t\treturn new Point(e.clientX, e.clientY);\r\n \t}\r\n\r\n \tvar scale = getScale(container),\r\n \t offset = scale.boundingClientRect; // left and top values are in page scale (like the event clientX/Y)\r\n\r\n \treturn new Point(\r\n \t\t// offset.left/top values are in page scale (like clientX/Y),\r\n \t\t// whereas clientLeft/Top (border width) values are the original values (before CSS scale applies).\r\n \t\t(e.clientX - offset.left) / scale.x - container.clientLeft,\r\n \t\t(e.clientY - offset.top) / scale.y - container.clientTop\r\n \t);\r\n }\r\n\r\n // Chrome on Win scrolls double the pixels as in other platforms (see #4538),\r\n // and Firefox scrolls device pixels, not CSS pixels\r\n var wheelPxFactor =\r\n \t(win && chrome) ? 2 * window.devicePixelRatio :\r\n \tgecko ? window.devicePixelRatio : 1;\r\n\r\n // @function getWheelDelta(ev: DOMEvent): Number\r\n // Gets normalized wheel delta from a wheel DOM event, in vertical\r\n // pixels scrolled (negative if scrolling down).\r\n // Events from pointing devices without precise scrolling are mapped to\r\n // a best guess of 60 pixels.\r\n function getWheelDelta(e) {\r\n \treturn (edge) ? e.wheelDeltaY / 2 : // Don't trust window-geometry-based delta\r\n \t (e.deltaY && e.deltaMode === 0) ? -e.deltaY / wheelPxFactor : // Pixels\r\n \t (e.deltaY && e.deltaMode === 1) ? -e.deltaY * 20 : // Lines\r\n \t (e.deltaY && e.deltaMode === 2) ? -e.deltaY * 60 : // Pages\r\n \t (e.deltaX || e.deltaZ) ? 0 :\t// Skip horizontal/depth wheel events\r\n \t e.wheelDelta ? (e.wheelDeltaY || e.wheelDelta) / 2 : // Legacy IE pixels\r\n \t (e.detail && Math.abs(e.detail) < 32765) ? -e.detail * 20 : // Legacy Moz lines\r\n \t e.detail ? e.detail / -32765 * 60 : // Legacy Moz pages\r\n \t 0;\r\n }\r\n\r\n var skipEvents = {};\r\n\r\n function fakeStop(e) {\r\n \t// fakes stopPropagation by setting a special event flag, checked/reset with skipped(e)\r\n \tskipEvents[e.type] = true;\r\n }\r\n\r\n function skipped(e) {\r\n \tvar events = skipEvents[e.type];\r\n \t// reset when checking, as it's only used in map container and propagates outside of the map\r\n \tskipEvents[e.type] = false;\r\n \treturn events;\r\n }\r\n\r\n // check if element really left/entered the event target (for mouseenter/mouseleave)\r\n function isExternalTarget(el, e) {\r\n\r\n \tvar related = e.relatedTarget;\r\n\r\n \tif (!related) { return true; }\r\n\r\n \ttry {\r\n \t\twhile (related && (related !== el)) {\r\n \t\t\trelated = related.parentNode;\r\n \t\t}\r\n \t} catch (err) {\r\n \t\treturn false;\r\n \t}\r\n \treturn (related !== el);\r\n }\n\n var DomEvent = ({\n on: on,\n off: off,\n stopPropagation: stopPropagation,\n disableScrollPropagation: disableScrollPropagation,\n disableClickPropagation: disableClickPropagation,\n preventDefault: preventDefault,\n stop: stop,\n getMousePosition: getMousePosition,\n getWheelDelta: getWheelDelta,\n fakeStop: fakeStop,\n skipped: skipped,\n isExternalTarget: isExternalTarget,\n addListener: on,\n removeListener: off\n });\n\n /*\n * @class PosAnimation\n * @aka L.PosAnimation\n * @inherits Evented\n * Used internally for panning animations, utilizing CSS3 Transitions for modern browsers and a timer fallback for IE6-9.\n *\n * @example\n * ```js\n * var fx = new L.PosAnimation();\n * fx.run(el, [300, 500], 0.5);\n * ```\n *\n * @constructor L.PosAnimation()\n * Creates a `PosAnimation` object.\n *\n */\n\n var PosAnimation = Evented.extend({\n\n \t// @method run(el: HTMLElement, newPos: Point, duration?: Number, easeLinearity?: Number)\n \t// Run an animation of a given element to a new position, optionally setting\n \t// duration in seconds (`0.25` by default) and easing linearity factor (3rd\n \t// argument of the [cubic bezier curve](http://cubic-bezier.com/#0,0,.5,1),\n \t// `0.5` by default).\n \trun: function (el, newPos, duration, easeLinearity) {\n \t\tthis.stop();\n\n \t\tthis._el = el;\n \t\tthis._inProgress = true;\n \t\tthis._duration = duration || 0.25;\n \t\tthis._easeOutPower = 1 / Math.max(easeLinearity || 0.5, 0.2);\n\n \t\tthis._startPos = getPosition(el);\n \t\tthis._offset = newPos.subtract(this._startPos);\n \t\tthis._startTime = +new Date();\n\n \t\t// @event start: Event\n \t\t// Fired when the animation starts\n \t\tthis.fire('start');\n\n \t\tthis._animate();\n \t},\n\n \t// @method stop()\n \t// Stops the animation (if currently running).\n \tstop: function () {\n \t\tif (!this._inProgress) { return; }\n\n \t\tthis._step(true);\n \t\tthis._complete();\n \t},\n\n \t_animate: function () {\n \t\t// animation loop\n \t\tthis._animId = requestAnimFrame(this._animate, this);\n \t\tthis._step();\n \t},\n\n \t_step: function (round) {\n \t\tvar elapsed = (+new Date()) - this._startTime,\n \t\t duration = this._duration * 1000;\n\n \t\tif (elapsed < duration) {\n \t\t\tthis._runFrame(this._easeOut(elapsed / duration), round);\n \t\t} else {\n \t\t\tthis._runFrame(1);\n \t\t\tthis._complete();\n \t\t}\n \t},\n\n \t_runFrame: function (progress, round) {\n \t\tvar pos = this._startPos.add(this._offset.multiplyBy(progress));\n \t\tif (round) {\n \t\t\tpos._round();\n \t\t}\n \t\tsetPosition(this._el, pos);\n\n \t\t// @event step: Event\n \t\t// Fired continuously during the animation.\n \t\tthis.fire('step');\n \t},\n\n \t_complete: function () {\n \t\tcancelAnimFrame(this._animId);\n\n \t\tthis._inProgress = false;\n \t\t// @event end: Event\n \t\t// Fired when the animation ends.\n \t\tthis.fire('end');\n \t},\n\n \t_easeOut: function (t) {\n \t\treturn 1 - Math.pow(1 - t, this._easeOutPower);\n \t}\n });\n\n /*\r\n * @class Map\r\n * @aka L.Map\r\n * @inherits Evented\r\n *\r\n * The central class of the API — it is used to create a map on a page and manipulate it.\r\n *\r\n * @example\r\n *\r\n * ```js\r\n * // initialize the map on the \"map\" div with a given center and zoom\r\n * var map = L.map('map', {\r\n * \tcenter: [51.505, -0.09],\r\n * \tzoom: 13\r\n * });\r\n * ```\r\n *\r\n */\r\n\r\n var Map = Evented.extend({\r\n\r\n \toptions: {\r\n \t\t// @section Map State Options\r\n \t\t// @option crs: CRS = L.CRS.EPSG3857\r\n \t\t// The [Coordinate Reference System](#crs) to use. Don't change this if you're not\r\n \t\t// sure what it means.\r\n \t\tcrs: EPSG3857,\r\n\r\n \t\t// @option center: LatLng = undefined\r\n \t\t// Initial geographic center of the map\r\n \t\tcenter: undefined,\r\n\r\n \t\t// @option zoom: Number = undefined\r\n \t\t// Initial map zoom level\r\n \t\tzoom: undefined,\r\n\r\n \t\t// @option minZoom: Number = *\r\n \t\t// Minimum zoom level of the map.\r\n \t\t// If not specified and at least one `GridLayer` or `TileLayer` is in the map,\r\n \t\t// the lowest of their `minZoom` options will be used instead.\r\n \t\tminZoom: undefined,\r\n\r\n \t\t// @option maxZoom: Number = *\r\n \t\t// Maximum zoom level of the map.\r\n \t\t// If not specified and at least one `GridLayer` or `TileLayer` is in the map,\r\n \t\t// the highest of their `maxZoom` options will be used instead.\r\n \t\tmaxZoom: undefined,\r\n\r\n \t\t// @option layers: Layer[] = []\r\n \t\t// Array of layers that will be added to the map initially\r\n \t\tlayers: [],\r\n\r\n \t\t// @option maxBounds: LatLngBounds = null\r\n \t\t// When this option is set, the map restricts the view to the given\r\n \t\t// geographical bounds, bouncing the user back if the user tries to pan\r\n \t\t// outside the view. To set the restriction dynamically, use\r\n \t\t// [`setMaxBounds`](#map-setmaxbounds) method.\r\n \t\tmaxBounds: undefined,\r\n\r\n \t\t// @option renderer: Renderer = *\r\n \t\t// The default method for drawing vector layers on the map. `L.SVG`\r\n \t\t// or `L.Canvas` by default depending on browser support.\r\n \t\trenderer: undefined,\r\n\r\n\r\n \t\t// @section Animation Options\r\n \t\t// @option zoomAnimation: Boolean = true\r\n \t\t// Whether the map zoom animation is enabled. By default it's enabled\r\n \t\t// in all browsers that support CSS3 Transitions except Android.\r\n \t\tzoomAnimation: true,\r\n\r\n \t\t// @option zoomAnimationThreshold: Number = 4\r\n \t\t// Won't animate zoom if the zoom difference exceeds this value.\r\n \t\tzoomAnimationThreshold: 4,\r\n\r\n \t\t// @option fadeAnimation: Boolean = true\r\n \t\t// Whether the tile fade animation is enabled. By default it's enabled\r\n \t\t// in all browsers that support CSS3 Transitions except Android.\r\n \t\tfadeAnimation: true,\r\n\r\n \t\t// @option markerZoomAnimation: Boolean = true\r\n \t\t// Whether markers animate their zoom with the zoom animation, if disabled\r\n \t\t// they will disappear for the length of the animation. By default it's\r\n \t\t// enabled in all browsers that support CSS3 Transitions except Android.\r\n \t\tmarkerZoomAnimation: true,\r\n\r\n \t\t// @option transform3DLimit: Number = 2^23\r\n \t\t// Defines the maximum size of a CSS translation transform. The default\r\n \t\t// value should not be changed unless a web browser positions layers in\r\n \t\t// the wrong place after doing a large `panBy`.\r\n \t\ttransform3DLimit: 8388608, // Precision limit of a 32-bit float\r\n\r\n \t\t// @section Interaction Options\r\n \t\t// @option zoomSnap: Number = 1\r\n \t\t// Forces the map's zoom level to always be a multiple of this, particularly\r\n \t\t// right after a [`fitBounds()`](#map-fitbounds) or a pinch-zoom.\r\n \t\t// By default, the zoom level snaps to the nearest integer; lower values\r\n \t\t// (e.g. `0.5` or `0.1`) allow for greater granularity. A value of `0`\r\n \t\t// means the zoom level will not be snapped after `fitBounds` or a pinch-zoom.\r\n \t\tzoomSnap: 1,\r\n\r\n \t\t// @option zoomDelta: Number = 1\r\n \t\t// Controls how much the map's zoom level will change after a\r\n \t\t// [`zoomIn()`](#map-zoomin), [`zoomOut()`](#map-zoomout), pressing `+`\r\n \t\t// or `-` on the keyboard, or using the [zoom controls](#control-zoom).\r\n \t\t// Values smaller than `1` (e.g. `0.5`) allow for greater granularity.\r\n \t\tzoomDelta: 1,\r\n\r\n \t\t// @option trackResize: Boolean = true\r\n \t\t// Whether the map automatically handles browser window resize to update itself.\r\n \t\ttrackResize: true\r\n \t},\r\n\r\n \tinitialize: function (id, options) { // (HTMLElement or String, Object)\r\n \t\toptions = setOptions(this, options);\r\n\r\n \t\t// Make sure to assign internal flags at the beginning,\r\n \t\t// to avoid inconsistent state in some edge cases.\r\n \t\tthis._handlers = [];\r\n \t\tthis._layers = {};\r\n \t\tthis._zoomBoundLayers = {};\r\n \t\tthis._sizeChanged = true;\r\n\r\n \t\tthis._initContainer(id);\r\n \t\tthis._initLayout();\r\n\r\n \t\t// hack for https://github.com/Leaflet/Leaflet/issues/1980\r\n \t\tthis._onResize = bind(this._onResize, this);\r\n\r\n \t\tthis._initEvents();\r\n\r\n \t\tif (options.maxBounds) {\r\n \t\t\tthis.setMaxBounds(options.maxBounds);\r\n \t\t}\r\n\r\n \t\tif (options.zoom !== undefined) {\r\n \t\t\tthis._zoom = this._limitZoom(options.zoom);\r\n \t\t}\r\n\r\n \t\tif (options.center && options.zoom !== undefined) {\r\n \t\t\tthis.setView(toLatLng(options.center), options.zoom, {reset: true});\r\n \t\t}\r\n\r\n \t\tthis.callInitHooks();\r\n\r\n \t\t// don't animate on browsers without hardware-accelerated transitions or old Android/Opera\r\n \t\tthis._zoomAnimated = TRANSITION && any3d && !mobileOpera &&\r\n \t\t\t\tthis.options.zoomAnimation;\r\n\r\n \t\t// zoom transitions run with the same duration for all layers, so if one of transitionend events\r\n \t\t// happens after starting zoom animation (propagating to the map pane), we know that it ended globally\r\n \t\tif (this._zoomAnimated) {\r\n \t\t\tthis._createAnimProxy();\r\n \t\t\ton(this._proxy, TRANSITION_END, this._catchTransitionEnd, this);\r\n \t\t}\r\n\r\n \t\tthis._addLayers(this.options.layers);\r\n \t},\r\n\r\n\r\n \t// @section Methods for modifying map state\r\n\r\n \t// @method setView(center: LatLng, zoom: Number, options?: Zoom/pan options): this\r\n \t// Sets the view of the map (geographical center and zoom) with the given\r\n \t// animation options.\r\n \tsetView: function (center, zoom, options) {\r\n\r\n \t\tzoom = zoom === undefined ? this._zoom : this._limitZoom(zoom);\r\n \t\tcenter = this._limitCenter(toLatLng(center), zoom, this.options.maxBounds);\r\n \t\toptions = options || {};\r\n\r\n \t\tthis._stop();\r\n\r\n \t\tif (this._loaded && !options.reset && options !== true) {\r\n\r\n \t\t\tif (options.animate !== undefined) {\r\n \t\t\t\toptions.zoom = extend({animate: options.animate}, options.zoom);\r\n \t\t\t\toptions.pan = extend({animate: options.animate, duration: options.duration}, options.pan);\r\n \t\t\t}\r\n\r\n \t\t\t// try animating pan or zoom\r\n \t\t\tvar moved = (this._zoom !== zoom) ?\r\n \t\t\t\tthis._tryAnimatedZoom && this._tryAnimatedZoom(center, zoom, options.zoom) :\r\n \t\t\t\tthis._tryAnimatedPan(center, options.pan);\r\n\r\n \t\t\tif (moved) {\r\n \t\t\t\t// prevent resize handler call, the view will refresh after animation anyway\r\n \t\t\t\tclearTimeout(this._sizeTimer);\r\n \t\t\t\treturn this;\r\n \t\t\t}\r\n \t\t}\r\n\r\n \t\t// animation didn't start, just reset the map view\r\n \t\tthis._resetView(center, zoom);\r\n\r\n \t\treturn this;\r\n \t},\r\n\r\n \t// @method setZoom(zoom: Number, options?: Zoom/pan options): this\r\n \t// Sets the zoom of the map.\r\n \tsetZoom: function (zoom, options) {\r\n \t\tif (!this._loaded) {\r\n \t\t\tthis._zoom = zoom;\r\n \t\t\treturn this;\r\n \t\t}\r\n \t\treturn this.setView(this.getCenter(), zoom, {zoom: options});\r\n \t},\r\n\r\n \t// @method zoomIn(delta?: Number, options?: Zoom options): this\r\n \t// Increases the zoom of the map by `delta` ([`zoomDelta`](#map-zoomdelta) by default).\r\n \tzoomIn: function (delta, options) {\r\n \t\tdelta = delta || (any3d ? this.options.zoomDelta : 1);\r\n \t\treturn this.setZoom(this._zoom + delta, options);\r\n \t},\r\n\r\n \t// @method zoomOut(delta?: Number, options?: Zoom options): this\r\n \t// Decreases the zoom of the map by `delta` ([`zoomDelta`](#map-zoomdelta) by default).\r\n \tzoomOut: function (delta, options) {\r\n \t\tdelta = delta || (any3d ? this.options.zoomDelta : 1);\r\n \t\treturn this.setZoom(this._zoom - delta, options);\r\n \t},\r\n\r\n \t// @method setZoomAround(latlng: LatLng, zoom: Number, options: Zoom options): this\r\n \t// Zooms the map while keeping a specified geographical point on the map\r\n \t// stationary (e.g. used internally for scroll zoom and double-click zoom).\r\n \t// @alternative\r\n \t// @method setZoomAround(offset: Point, zoom: Number, options: Zoom options): this\r\n \t// Zooms the map while keeping a specified pixel on the map (relative to the top-left corner) stationary.\r\n \tsetZoomAround: function (latlng, zoom, options) {\r\n \t\tvar scale = this.getZoomScale(zoom),\r\n \t\t viewHalf = this.getSize().divideBy(2),\r\n \t\t containerPoint = latlng instanceof Point ? latlng : this.latLngToContainerPoint(latlng),\r\n\r\n \t\t centerOffset = containerPoint.subtract(viewHalf).multiplyBy(1 - 1 / scale),\r\n \t\t newCenter = this.containerPointToLatLng(viewHalf.add(centerOffset));\r\n\r\n \t\treturn this.setView(newCenter, zoom, {zoom: options});\r\n \t},\r\n\r\n \t_getBoundsCenterZoom: function (bounds, options) {\r\n\r\n \t\toptions = options || {};\r\n \t\tbounds = bounds.getBounds ? bounds.getBounds() : toLatLngBounds(bounds);\r\n\r\n \t\tvar paddingTL = toPoint(options.paddingTopLeft || options.padding || [0, 0]),\r\n \t\t paddingBR = toPoint(options.paddingBottomRight || options.padding || [0, 0]),\r\n\r\n \t\t zoom = this.getBoundsZoom(bounds, false, paddingTL.add(paddingBR));\r\n\r\n \t\tzoom = (typeof options.maxZoom === 'number') ? Math.min(options.maxZoom, zoom) : zoom;\r\n\r\n \t\tif (zoom === Infinity) {\r\n \t\t\treturn {\r\n \t\t\t\tcenter: bounds.getCenter(),\r\n \t\t\t\tzoom: zoom\r\n \t\t\t};\r\n \t\t}\r\n\r\n \t\tvar paddingOffset = paddingBR.subtract(paddingTL).divideBy(2),\r\n\r\n \t\t swPoint = this.project(bounds.getSouthWest(), zoom),\r\n \t\t nePoint = this.project(bounds.getNorthEast(), zoom),\r\n \t\t center = this.unproject(swPoint.add(nePoint).divideBy(2).add(paddingOffset), zoom);\r\n\r\n \t\treturn {\r\n \t\t\tcenter: center,\r\n \t\t\tzoom: zoom\r\n \t\t};\r\n \t},\r\n\r\n \t// @method fitBounds(bounds: LatLngBounds, options?: fitBounds options): this\r\n \t// Sets a map view that contains the given geographical bounds with the\r\n \t// maximum zoom level possible.\r\n \tfitBounds: function (bounds, options) {\r\n\r\n \t\tbounds = toLatLngBounds(bounds);\r\n\r\n \t\tif (!bounds.isValid()) {\r\n \t\t\tthrow new Error('Bounds are not valid.');\r\n \t\t}\r\n\r\n \t\tvar target = this._getBoundsCenterZoom(bounds, options);\r\n \t\treturn this.setView(target.center, target.zoom, options);\r\n \t},\r\n\r\n \t// @method fitWorld(options?: fitBounds options): this\r\n \t// Sets a map view that mostly contains the whole world with the maximum\r\n \t// zoom level possible.\r\n \tfitWorld: function (options) {\r\n \t\treturn this.fitBounds([[-90, -180], [90, 180]], options);\r\n \t},\r\n\r\n \t// @method panTo(latlng: LatLng, options?: Pan options): this\r\n \t// Pans the map to a given center.\r\n \tpanTo: function (center, options) { // (LatLng)\r\n \t\treturn this.setView(center, this._zoom, {pan: options});\r\n \t},\r\n\r\n \t// @method panBy(offset: Point, options?: Pan options): this\r\n \t// Pans the map by a given number of pixels (animated).\r\n \tpanBy: function (offset, options) {\r\n \t\toffset = toPoint(offset).round();\r\n \t\toptions = options || {};\r\n\r\n \t\tif (!offset.x && !offset.y) {\r\n \t\t\treturn this.fire('moveend');\r\n \t\t}\r\n \t\t// If we pan too far, Chrome gets issues with tiles\r\n \t\t// and makes them disappear or appear in the wrong place (slightly offset) #2602\r\n \t\tif (options.animate !== true && !this.getSize().contains(offset)) {\r\n \t\t\tthis._resetView(this.unproject(this.project(this.getCenter()).add(offset)), this.getZoom());\r\n \t\t\treturn this;\r\n \t\t}\r\n\r\n \t\tif (!this._panAnim) {\r\n \t\t\tthis._panAnim = new PosAnimation();\r\n\r\n \t\t\tthis._panAnim.on({\r\n \t\t\t\t'step': this._onPanTransitionStep,\r\n \t\t\t\t'end': this._onPanTransitionEnd\r\n \t\t\t}, this);\r\n \t\t}\r\n\r\n \t\t// don't fire movestart if animating inertia\r\n \t\tif (!options.noMoveStart) {\r\n \t\t\tthis.fire('movestart');\r\n \t\t}\r\n\r\n \t\t// animate pan unless animate: false specified\r\n \t\tif (options.animate !== false) {\r\n \t\t\taddClass(this._mapPane, 'leaflet-pan-anim');\r\n\r\n \t\t\tvar newPos = this._getMapPanePos().subtract(offset).round();\r\n \t\t\tthis._panAnim.run(this._mapPane, newPos, options.duration || 0.25, options.easeLinearity);\r\n \t\t} else {\r\n \t\t\tthis._rawPanBy(offset);\r\n \t\t\tthis.fire('move').fire('moveend');\r\n \t\t}\r\n\r\n \t\treturn this;\r\n \t},\r\n\r\n \t// @method flyTo(latlng: LatLng, zoom?: Number, options?: Zoom/pan options): this\r\n \t// Sets the view of the map (geographical center and zoom) performing a smooth\r\n \t// pan-zoom animation.\r\n \tflyTo: function (targetCenter, targetZoom, options) {\r\n\r\n \t\toptions = options || {};\r\n \t\tif (options.animate === false || !any3d) {\r\n \t\t\treturn this.setView(targetCenter, targetZoom, options);\r\n \t\t}\r\n\r\n \t\tthis._stop();\r\n\r\n \t\tvar from = this.project(this.getCenter()),\r\n \t\t to = this.project(targetCenter),\r\n \t\t size = this.getSize(),\r\n \t\t startZoom = this._zoom;\r\n\r\n \t\ttargetCenter = toLatLng(targetCenter);\r\n \t\ttargetZoom = targetZoom === undefined ? startZoom : targetZoom;\r\n\r\n \t\tvar w0 = Math.max(size.x, size.y),\r\n \t\t w1 = w0 * this.getZoomScale(startZoom, targetZoom),\r\n \t\t u1 = (to.distanceTo(from)) || 1,\r\n \t\t rho = 1.42,\r\n \t\t rho2 = rho * rho;\r\n\r\n \t\tfunction r(i) {\r\n \t\t\tvar s1 = i ? -1 : 1,\r\n \t\t\t s2 = i ? w1 : w0,\r\n \t\t\t t1 = w1 * w1 - w0 * w0 + s1 * rho2 * rho2 * u1 * u1,\r\n \t\t\t b1 = 2 * s2 * rho2 * u1,\r\n \t\t\t b = t1 / b1,\r\n \t\t\t sq = Math.sqrt(b * b + 1) - b;\r\n\r\n \t\t\t // workaround for floating point precision bug when sq = 0, log = -Infinite,\r\n \t\t\t // thus triggering an infinite loop in flyTo\r\n \t\t\t var log = sq < 0.000000001 ? -18 : Math.log(sq);\r\n\r\n \t\t\treturn log;\r\n \t\t}\r\n\r\n \t\tfunction sinh(n) { return (Math.exp(n) - Math.exp(-n)) / 2; }\r\n \t\tfunction cosh(n) { return (Math.exp(n) + Math.exp(-n)) / 2; }\r\n \t\tfunction tanh(n) { return sinh(n) / cosh(n); }\r\n\r\n \t\tvar r0 = r(0);\r\n\r\n \t\tfunction w(s) { return w0 * (cosh(r0) / cosh(r0 + rho * s)); }\r\n \t\tfunction u(s) { return w0 * (cosh(r0) * tanh(r0 + rho * s) - sinh(r0)) / rho2; }\r\n\r\n \t\tfunction easeOut(t) { return 1 - Math.pow(1 - t, 1.5); }\r\n\r\n \t\tvar start = Date.now(),\r\n \t\t S = (r(1) - r0) / rho,\r\n \t\t duration = options.duration ? 1000 * options.duration : 1000 * S * 0.8;\r\n\r\n \t\tfunction frame() {\r\n \t\t\tvar t = (Date.now() - start) / duration,\r\n \t\t\t s = easeOut(t) * S;\r\n\r\n \t\t\tif (t <= 1) {\r\n \t\t\t\tthis._flyToFrame = requestAnimFrame(frame, this);\r\n\r\n \t\t\t\tthis._move(\r\n \t\t\t\t\tthis.unproject(from.add(to.subtract(from).multiplyBy(u(s) / u1)), startZoom),\r\n \t\t\t\t\tthis.getScaleZoom(w0 / w(s), startZoom),\r\n \t\t\t\t\t{flyTo: true});\r\n\r\n \t\t\t} else {\r\n \t\t\t\tthis\r\n \t\t\t\t\t._move(targetCenter, targetZoom)\r\n \t\t\t\t\t._moveEnd(true);\r\n \t\t\t}\r\n \t\t}\r\n\r\n \t\tthis._moveStart(true, options.noMoveStart);\r\n\r\n \t\tframe.call(this);\r\n \t\treturn this;\r\n \t},\r\n\r\n \t// @method flyToBounds(bounds: LatLngBounds, options?: fitBounds options): this\r\n \t// Sets the view of the map with a smooth animation like [`flyTo`](#map-flyto),\r\n \t// but takes a bounds parameter like [`fitBounds`](#map-fitbounds).\r\n \tflyToBounds: function (bounds, options) {\r\n \t\tvar target = this._getBoundsCenterZoom(bounds, options);\r\n \t\treturn this.flyTo(target.center, target.zoom, options);\r\n \t},\r\n\r\n \t// @method setMaxBounds(bounds: LatLngBounds): this\r\n \t// Restricts the map view to the given bounds (see the [maxBounds](#map-maxbounds) option).\r\n \tsetMaxBounds: function (bounds) {\r\n \t\tbounds = toLatLngBounds(bounds);\r\n\r\n \t\tif (!bounds.isValid()) {\r\n \t\t\tthis.options.maxBounds = null;\r\n \t\t\treturn this.off('moveend', this._panInsideMaxBounds);\r\n \t\t} else if (this.options.maxBounds) {\r\n \t\t\tthis.off('moveend', this._panInsideMaxBounds);\r\n \t\t}\r\n\r\n \t\tthis.options.maxBounds = bounds;\r\n\r\n \t\tif (this._loaded) {\r\n \t\t\tthis._panInsideMaxBounds();\r\n \t\t}\r\n\r\n \t\treturn this.on('moveend', this._panInsideMaxBounds);\r\n \t},\r\n\r\n \t// @method setMinZoom(zoom: Number): this\r\n \t// Sets the lower limit for the available zoom levels (see the [minZoom](#map-minzoom) option).\r\n \tsetMinZoom: function (zoom) {\r\n \t\tvar oldZoom = this.options.minZoom;\r\n \t\tthis.options.minZoom = zoom;\r\n\r\n \t\tif (this._loaded && oldZoom !== zoom) {\r\n \t\t\tthis.fire('zoomlevelschange');\r\n\r\n \t\t\tif (this.getZoom() < this.options.minZoom) {\r\n \t\t\t\treturn this.setZoom(zoom);\r\n \t\t\t}\r\n \t\t}\r\n\r\n \t\treturn this;\r\n \t},\r\n\r\n \t// @method setMaxZoom(zoom: Number): this\r\n \t// Sets the upper limit for the available zoom levels (see the [maxZoom](#map-maxzoom) option).\r\n \tsetMaxZoom: function (zoom) {\r\n \t\tvar oldZoom = this.options.maxZoom;\r\n \t\tthis.options.maxZoom = zoom;\r\n\r\n \t\tif (this._loaded && oldZoom !== zoom) {\r\n \t\t\tthis.fire('zoomlevelschange');\r\n\r\n \t\t\tif (this.getZoom() > this.options.maxZoom) {\r\n \t\t\t\treturn this.setZoom(zoom);\r\n \t\t\t}\r\n \t\t}\r\n\r\n \t\treturn this;\r\n \t},\r\n\r\n \t// @method panInsideBounds(bounds: LatLngBounds, options?: Pan options): this\r\n \t// Pans the map to the closest view that would lie inside the given bounds (if it's not already), controlling the animation using the options specific, if any.\r\n \tpanInsideBounds: function (bounds, options) {\r\n \t\tthis._enforcingBounds = true;\r\n \t\tvar center = this.getCenter(),\r\n \t\t newCenter = this._limitCenter(center, this._zoom, toLatLngBounds(bounds));\r\n\r\n \t\tif (!center.equals(newCenter)) {\r\n \t\t\tthis.panTo(newCenter, options);\r\n \t\t}\r\n\r\n \t\tthis._enforcingBounds = false;\r\n \t\treturn this;\r\n \t},\r\n\r\n \t// @method panInside(latlng: LatLng, options?: options): this\r\n \t// Pans the map the minimum amount to make the `latlng` visible. Use\r\n \t// `padding`, `paddingTopLeft` and `paddingTopRight` options to fit\r\n \t// the display to more restricted bounds, like [`fitBounds`](#map-fitbounds).\r\n \t// If `latlng` is already within the (optionally padded) display bounds,\r\n \t// the map will not be panned.\r\n \tpanInside: function (latlng, options) {\r\n \t\toptions = options || {};\r\n\r\n \t\tvar paddingTL = toPoint(options.paddingTopLeft || options.padding || [0, 0]),\r\n \t\t paddingBR = toPoint(options.paddingBottomRight || options.padding || [0, 0]),\r\n \t\t center = this.getCenter(),\r\n \t\t pixelCenter = this.project(center),\r\n \t\t pixelPoint = this.project(latlng),\r\n \t\t pixelBounds = this.getPixelBounds(),\r\n \t\t halfPixelBounds = pixelBounds.getSize().divideBy(2),\r\n \t\t paddedBounds = toBounds([pixelBounds.min.add(paddingTL), pixelBounds.max.subtract(paddingBR)]);\r\n\r\n \t\tif (!paddedBounds.contains(pixelPoint)) {\r\n \t\t\tthis._enforcingBounds = true;\r\n \t\t\tvar diff = pixelCenter.subtract(pixelPoint),\r\n \t\t\t newCenter = toPoint(pixelPoint.x + diff.x, pixelPoint.y + diff.y);\r\n\r\n \t\t\tif (pixelPoint.x < paddedBounds.min.x || pixelPoint.x > paddedBounds.max.x) {\r\n \t\t\t\tnewCenter.x = pixelCenter.x - diff.x;\r\n \t\t\t\tif (diff.x > 0) {\r\n \t\t\t\t\tnewCenter.x += halfPixelBounds.x - paddingTL.x;\r\n \t\t\t\t} else {\r\n \t\t\t\t\tnewCenter.x -= halfPixelBounds.x - paddingBR.x;\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t\tif (pixelPoint.y < paddedBounds.min.y || pixelPoint.y > paddedBounds.max.y) {\r\n \t\t\t\tnewCenter.y = pixelCenter.y - diff.y;\r\n \t\t\t\tif (diff.y > 0) {\r\n \t\t\t\t\tnewCenter.y += halfPixelBounds.y - paddingTL.y;\r\n \t\t\t\t} else {\r\n \t\t\t\t\tnewCenter.y -= halfPixelBounds.y - paddingBR.y;\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t\tthis.panTo(this.unproject(newCenter), options);\r\n \t\t\tthis._enforcingBounds = false;\r\n \t\t}\r\n \t\treturn this;\r\n \t},\r\n\r\n \t// @method invalidateSize(options: Zoom/pan options): this\r\n \t// Checks if the map container size changed and updates the map if so —\r\n \t// call it after you've changed the map size dynamically, also animating\r\n \t// pan by default. If `options.pan` is `false`, panning will not occur.\r\n \t// If `options.debounceMoveend` is `true`, it will delay `moveend` event so\r\n \t// that it doesn't happen often even if the method is called many\r\n \t// times in a row.\r\n\r\n \t// @alternative\r\n \t// @method invalidateSize(animate: Boolean): this\r\n \t// Checks if the map container size changed and updates the map if so —\r\n \t// call it after you've changed the map size dynamically, also animating\r\n \t// pan by default.\r\n \tinvalidateSize: function (options) {\r\n \t\tif (!this._loaded) { return this; }\r\n\r\n \t\toptions = extend({\r\n \t\t\tanimate: false,\r\n \t\t\tpan: true\r\n \t\t}, options === true ? {animate: true} : options);\r\n\r\n \t\tvar oldSize = this.getSize();\r\n \t\tthis._sizeChanged = true;\r\n \t\tthis._lastCenter = null;\r\n\r\n \t\tvar newSize = this.getSize(),\r\n \t\t oldCenter = oldSize.divideBy(2).round(),\r\n \t\t newCenter = newSize.divideBy(2).round(),\r\n \t\t offset = oldCenter.subtract(newCenter);\r\n\r\n \t\tif (!offset.x && !offset.y) { return this; }\r\n\r\n \t\tif (options.animate && options.pan) {\r\n \t\t\tthis.panBy(offset);\r\n\r\n \t\t} else {\r\n \t\t\tif (options.pan) {\r\n \t\t\t\tthis._rawPanBy(offset);\r\n \t\t\t}\r\n\r\n \t\t\tthis.fire('move');\r\n\r\n \t\t\tif (options.debounceMoveend) {\r\n \t\t\t\tclearTimeout(this._sizeTimer);\r\n \t\t\t\tthis._sizeTimer = setTimeout(bind(this.fire, this, 'moveend'), 200);\r\n \t\t\t} else {\r\n \t\t\t\tthis.fire('moveend');\r\n \t\t\t}\r\n \t\t}\r\n\r\n \t\t// @section Map state change events\r\n \t\t// @event resize: ResizeEvent\r\n \t\t// Fired when the map is resized.\r\n \t\treturn this.fire('resize', {\r\n \t\t\toldSize: oldSize,\r\n \t\t\tnewSize: newSize\r\n \t\t});\r\n \t},\r\n\r\n \t// @section Methods for modifying map state\r\n \t// @method stop(): this\r\n \t// Stops the currently running `panTo` or `flyTo` animation, if any.\r\n \tstop: function () {\r\n \t\tthis.setZoom(this._limitZoom(this._zoom));\r\n \t\tif (!this.options.zoomSnap) {\r\n \t\t\tthis.fire('viewreset');\r\n \t\t}\r\n \t\treturn this._stop();\r\n \t},\r\n\r\n \t// @section Geolocation methods\r\n \t// @method locate(options?: Locate options): this\r\n \t// Tries to locate the user using the Geolocation API, firing a [`locationfound`](#map-locationfound)\r\n \t// event with location data on success or a [`locationerror`](#map-locationerror) event on failure,\r\n \t// and optionally sets the map view to the user's location with respect to\r\n \t// detection accuracy (or to the world view if geolocation failed).\r\n \t// Note that, if your page doesn't use HTTPS, this method will fail in\r\n \t// modern browsers ([Chrome 50 and newer](https://sites.google.com/a/chromium.org/dev/Home/chromium-security/deprecating-powerful-features-on-insecure-origins))\r\n \t// See `Locate options` for more details.\r\n \tlocate: function (options) {\r\n\r\n \t\toptions = this._locateOptions = extend({\r\n \t\t\ttimeout: 10000,\r\n \t\t\twatch: false\r\n \t\t\t// setView: false\r\n \t\t\t// maxZoom: \r\n \t\t\t// maximumAge: 0\r\n \t\t\t// enableHighAccuracy: false\r\n \t\t}, options);\r\n\r\n \t\tif (!('geolocation' in navigator)) {\r\n \t\t\tthis._handleGeolocationError({\r\n \t\t\t\tcode: 0,\r\n \t\t\t\tmessage: 'Geolocation not supported.'\r\n \t\t\t});\r\n \t\t\treturn this;\r\n \t\t}\r\n\r\n \t\tvar onResponse = bind(this._handleGeolocationResponse, this),\r\n \t\t onError = bind(this._handleGeolocationError, this);\r\n\r\n \t\tif (options.watch) {\r\n \t\t\tthis._locationWatchId =\r\n \t\t\t navigator.geolocation.watchPosition(onResponse, onError, options);\r\n \t\t} else {\r\n \t\t\tnavigator.geolocation.getCurrentPosition(onResponse, onError, options);\r\n \t\t}\r\n \t\treturn this;\r\n \t},\r\n\r\n \t// @method stopLocate(): this\r\n \t// Stops watching location previously initiated by `map.locate({watch: true})`\r\n \t// and aborts resetting the map view if map.locate was called with\r\n \t// `{setView: true}`.\r\n \tstopLocate: function () {\r\n \t\tif (navigator.geolocation && navigator.geolocation.clearWatch) {\r\n \t\t\tnavigator.geolocation.clearWatch(this._locationWatchId);\r\n \t\t}\r\n \t\tif (this._locateOptions) {\r\n \t\t\tthis._locateOptions.setView = false;\r\n \t\t}\r\n \t\treturn this;\r\n \t},\r\n\r\n \t_handleGeolocationError: function (error) {\r\n \t\tvar c = error.code,\r\n \t\t message = error.message ||\r\n \t\t (c === 1 ? 'permission denied' :\r\n \t\t (c === 2 ? 'position unavailable' : 'timeout'));\r\n\r\n \t\tif (this._locateOptions.setView && !this._loaded) {\r\n \t\t\tthis.fitWorld();\r\n \t\t}\r\n\r\n \t\t// @section Location events\r\n \t\t// @event locationerror: ErrorEvent\r\n \t\t// Fired when geolocation (using the [`locate`](#map-locate) method) failed.\r\n \t\tthis.fire('locationerror', {\r\n \t\t\tcode: c,\r\n \t\t\tmessage: 'Geolocation error: ' + message + '.'\r\n \t\t});\r\n \t},\r\n\r\n \t_handleGeolocationResponse: function (pos) {\r\n \t\tvar lat = pos.coords.latitude,\r\n \t\t lng = pos.coords.longitude,\r\n \t\t latlng = new LatLng(lat, lng),\r\n \t\t bounds = latlng.toBounds(pos.coords.accuracy * 2),\r\n \t\t options = this._locateOptions;\r\n\r\n \t\tif (options.setView) {\r\n \t\t\tvar zoom = this.getBoundsZoom(bounds);\r\n \t\t\tthis.setView(latlng, options.maxZoom ? Math.min(zoom, options.maxZoom) : zoom);\r\n \t\t}\r\n\r\n \t\tvar data = {\r\n \t\t\tlatlng: latlng,\r\n \t\t\tbounds: bounds,\r\n \t\t\ttimestamp: pos.timestamp\r\n \t\t};\r\n\r\n \t\tfor (var i in pos.coords) {\r\n \t\t\tif (typeof pos.coords[i] === 'number') {\r\n \t\t\t\tdata[i] = pos.coords[i];\r\n \t\t\t}\r\n \t\t}\r\n\r\n \t\t// @event locationfound: LocationEvent\r\n \t\t// Fired when geolocation (using the [`locate`](#map-locate) method)\r\n \t\t// went successfully.\r\n \t\tthis.fire('locationfound', data);\r\n \t},\r\n\r\n \t// TODO Appropriate docs section?\r\n \t// @section Other Methods\r\n \t// @method addHandler(name: String, HandlerClass: Function): this\r\n \t// Adds a new `Handler` to the map, given its name and constructor function.\r\n \taddHandler: function (name, HandlerClass) {\r\n \t\tif (!HandlerClass) { return this; }\r\n\r\n \t\tvar handler = this[name] = new HandlerClass(this);\r\n\r\n \t\tthis._handlers.push(handler);\r\n\r\n \t\tif (this.options[name]) {\r\n \t\t\thandler.enable();\r\n \t\t}\r\n\r\n \t\treturn this;\r\n \t},\r\n\r\n \t// @method remove(): this\r\n \t// Destroys the map and clears all related event listeners.\r\n \tremove: function () {\r\n\r\n \t\tthis._initEvents(true);\r\n \t\tthis.off('moveend', this._panInsideMaxBounds);\r\n\r\n \t\tif (this._containerId !== this._container._leaflet_id) {\r\n \t\t\tthrow new Error('Map container is being reused by another instance');\r\n \t\t}\r\n\r\n \t\ttry {\r\n \t\t\t// throws error in IE6-8\r\n \t\t\tdelete this._container._leaflet_id;\r\n \t\t\tdelete this._containerId;\r\n \t\t} catch (e) {\r\n \t\t\t/*eslint-disable */\r\n \t\t\tthis._container._leaflet_id = undefined;\r\n \t\t\t/* eslint-enable */\r\n \t\t\tthis._containerId = undefined;\r\n \t\t}\r\n\r\n \t\tif (this._locationWatchId !== undefined) {\r\n \t\t\tthis.stopLocate();\r\n \t\t}\r\n\r\n \t\tthis._stop();\r\n\r\n \t\tremove(this._mapPane);\r\n\r\n \t\tif (this._clearControlPos) {\r\n \t\t\tthis._clearControlPos();\r\n \t\t}\r\n \t\tif (this._resizeRequest) {\r\n \t\t\tcancelAnimFrame(this._resizeRequest);\r\n \t\t\tthis._resizeRequest = null;\r\n \t\t}\r\n\r\n \t\tthis._clearHandlers();\r\n\r\n \t\tif (this._loaded) {\r\n \t\t\t// @section Map state change events\r\n \t\t\t// @event unload: Event\r\n \t\t\t// Fired when the map is destroyed with [remove](#map-remove) method.\r\n \t\t\tthis.fire('unload');\r\n \t\t}\r\n\r\n \t\tvar i;\r\n \t\tfor (i in this._layers) {\r\n \t\t\tthis._layers[i].remove();\r\n \t\t}\r\n \t\tfor (i in this._panes) {\r\n \t\t\tremove(this._panes[i]);\r\n \t\t}\r\n\r\n \t\tthis._layers = [];\r\n \t\tthis._panes = [];\r\n \t\tdelete this._mapPane;\r\n \t\tdelete this._renderer;\r\n\r\n \t\treturn this;\r\n \t},\r\n\r\n \t// @section Other Methods\r\n \t// @method createPane(name: String, container?: HTMLElement): HTMLElement\r\n \t// Creates a new [map pane](#map-pane) with the given name if it doesn't exist already,\r\n \t// then returns it. The pane is created as a child of `container`, or\r\n \t// as a child of the main map pane if not set.\r\n \tcreatePane: function (name, container) {\r\n \t\tvar className = 'leaflet-pane' + (name ? ' leaflet-' + name.replace('Pane', '') + '-pane' : ''),\r\n \t\t pane = create$1('div', className, container || this._mapPane);\r\n\r\n \t\tif (name) {\r\n \t\t\tthis._panes[name] = pane;\r\n \t\t}\r\n \t\treturn pane;\r\n \t},\r\n\r\n \t// @section Methods for Getting Map State\r\n\r\n \t// @method getCenter(): LatLng\r\n \t// Returns the geographical center of the map view\r\n \tgetCenter: function () {\r\n \t\tthis._checkIfLoaded();\r\n\r\n \t\tif (this._lastCenter && !this._moved()) {\r\n \t\t\treturn this._lastCenter;\r\n \t\t}\r\n \t\treturn this.layerPointToLatLng(this._getCenterLayerPoint());\r\n \t},\r\n\r\n \t// @method getZoom(): Number\r\n \t// Returns the current zoom level of the map view\r\n \tgetZoom: function () {\r\n \t\treturn this._zoom;\r\n \t},\r\n\r\n \t// @method getBounds(): LatLngBounds\r\n \t// Returns the geographical bounds visible in the current map view\r\n \tgetBounds: function () {\r\n \t\tvar bounds = this.getPixelBounds(),\r\n \t\t sw = this.unproject(bounds.getBottomLeft()),\r\n \t\t ne = this.unproject(bounds.getTopRight());\r\n\r\n \t\treturn new LatLngBounds(sw, ne);\r\n \t},\r\n\r\n \t// @method getMinZoom(): Number\r\n \t// Returns the minimum zoom level of the map (if set in the `minZoom` option of the map or of any layers), or `0` by default.\r\n \tgetMinZoom: function () {\r\n \t\treturn this.options.minZoom === undefined ? this._layersMinZoom || 0 : this.options.minZoom;\r\n \t},\r\n\r\n \t// @method getMaxZoom(): Number\r\n \t// Returns the maximum zoom level of the map (if set in the `maxZoom` option of the map or of any layers).\r\n \tgetMaxZoom: function () {\r\n \t\treturn this.options.maxZoom === undefined ?\r\n \t\t\t(this._layersMaxZoom === undefined ? Infinity : this._layersMaxZoom) :\r\n \t\t\tthis.options.maxZoom;\r\n \t},\r\n\r\n \t// @method getBoundsZoom(bounds: LatLngBounds, inside?: Boolean, padding?: Point): Number\r\n \t// Returns the maximum zoom level on which the given bounds fit to the map\r\n \t// view in its entirety. If `inside` (optional) is set to `true`, the method\r\n \t// instead returns the minimum zoom level on which the map view fits into\r\n \t// the given bounds in its entirety.\r\n \tgetBoundsZoom: function (bounds, inside, padding) { // (LatLngBounds[, Boolean, Point]) -> Number\r\n \t\tbounds = toLatLngBounds(bounds);\r\n \t\tpadding = toPoint(padding || [0, 0]);\r\n\r\n \t\tvar zoom = this.getZoom() || 0,\r\n \t\t min = this.getMinZoom(),\r\n \t\t max = this.getMaxZoom(),\r\n \t\t nw = bounds.getNorthWest(),\r\n \t\t se = bounds.getSouthEast(),\r\n \t\t size = this.getSize().subtract(padding),\r\n \t\t boundsSize = toBounds(this.project(se, zoom), this.project(nw, zoom)).getSize(),\r\n \t\t snap = any3d ? this.options.zoomSnap : 1,\r\n \t\t scalex = size.x / boundsSize.x,\r\n \t\t scaley = size.y / boundsSize.y,\r\n \t\t scale = inside ? Math.max(scalex, scaley) : Math.min(scalex, scaley);\r\n\r\n \t\tzoom = this.getScaleZoom(scale, zoom);\r\n\r\n \t\tif (snap) {\r\n \t\t\tzoom = Math.round(zoom / (snap / 100)) * (snap / 100); // don't jump if within 1% of a snap level\r\n \t\t\tzoom = inside ? Math.ceil(zoom / snap) * snap : Math.floor(zoom / snap) * snap;\r\n \t\t}\r\n\r\n \t\treturn Math.max(min, Math.min(max, zoom));\r\n \t},\r\n\r\n \t// @method getSize(): Point\r\n \t// Returns the current size of the map container (in pixels).\r\n \tgetSize: function () {\r\n \t\tif (!this._size || this._sizeChanged) {\r\n \t\t\tthis._size = new Point(\r\n \t\t\t\tthis._container.clientWidth || 0,\r\n \t\t\t\tthis._container.clientHeight || 0);\r\n\r\n \t\t\tthis._sizeChanged = false;\r\n \t\t}\r\n \t\treturn this._size.clone();\r\n \t},\r\n\r\n \t// @method getPixelBounds(): Bounds\r\n \t// Returns the bounds of the current map view in projected pixel\r\n \t// coordinates (sometimes useful in layer and overlay implementations).\r\n \tgetPixelBounds: function (center, zoom) {\r\n \t\tvar topLeftPoint = this._getTopLeftPoint(center, zoom);\r\n \t\treturn new Bounds(topLeftPoint, topLeftPoint.add(this.getSize()));\r\n \t},\r\n\r\n \t// TODO: Check semantics - isn't the pixel origin the 0,0 coord relative to\r\n \t// the map pane? \"left point of the map layer\" can be confusing, specially\r\n \t// since there can be negative offsets.\r\n \t// @method getPixelOrigin(): Point\r\n \t// Returns the projected pixel coordinates of the top left point of\r\n \t// the map layer (useful in custom layer and overlay implementations).\r\n \tgetPixelOrigin: function () {\r\n \t\tthis._checkIfLoaded();\r\n \t\treturn this._pixelOrigin;\r\n \t},\r\n\r\n \t// @method getPixelWorldBounds(zoom?: Number): Bounds\r\n \t// Returns the world's bounds in pixel coordinates for zoom level `zoom`.\r\n \t// If `zoom` is omitted, the map's current zoom level is used.\r\n \tgetPixelWorldBounds: function (zoom) {\r\n \t\treturn this.options.crs.getProjectedBounds(zoom === undefined ? this.getZoom() : zoom);\r\n \t},\r\n\r\n \t// @section Other Methods\r\n\r\n \t// @method getPane(pane: String|HTMLElement): HTMLElement\r\n \t// Returns a [map pane](#map-pane), given its name or its HTML element (its identity).\r\n \tgetPane: function (pane) {\r\n \t\treturn typeof pane === 'string' ? this._panes[pane] : pane;\r\n \t},\r\n\r\n \t// @method getPanes(): Object\r\n \t// Returns a plain object containing the names of all [panes](#map-pane) as keys and\r\n \t// the panes as values.\r\n \tgetPanes: function () {\r\n \t\treturn this._panes;\r\n \t},\r\n\r\n \t// @method getContainer: HTMLElement\r\n \t// Returns the HTML element that contains the map.\r\n \tgetContainer: function () {\r\n \t\treturn this._container;\r\n \t},\r\n\r\n\r\n \t// @section Conversion Methods\r\n\r\n \t// @method getZoomScale(toZoom: Number, fromZoom: Number): Number\r\n \t// Returns the scale factor to be applied to a map transition from zoom level\r\n \t// `fromZoom` to `toZoom`. Used internally to help with zoom animations.\r\n \tgetZoomScale: function (toZoom, fromZoom) {\r\n \t\t// TODO replace with universal implementation after refactoring projections\r\n \t\tvar crs = this.options.crs;\r\n \t\tfromZoom = fromZoom === undefined ? this._zoom : fromZoom;\r\n \t\treturn crs.scale(toZoom) / crs.scale(fromZoom);\r\n \t},\r\n\r\n \t// @method getScaleZoom(scale: Number, fromZoom: Number): Number\r\n \t// Returns the zoom level that the map would end up at, if it is at `fromZoom`\r\n \t// level and everything is scaled by a factor of `scale`. Inverse of\r\n \t// [`getZoomScale`](#map-getZoomScale).\r\n \tgetScaleZoom: function (scale, fromZoom) {\r\n \t\tvar crs = this.options.crs;\r\n \t\tfromZoom = fromZoom === undefined ? this._zoom : fromZoom;\r\n \t\tvar zoom = crs.zoom(scale * crs.scale(fromZoom));\r\n \t\treturn isNaN(zoom) ? Infinity : zoom;\r\n \t},\r\n\r\n \t// @method project(latlng: LatLng, zoom: Number): Point\r\n \t// Projects a geographical coordinate `LatLng` according to the projection\r\n \t// of the map's CRS, then scales it according to `zoom` and the CRS's\r\n \t// `Transformation`. The result is pixel coordinate relative to\r\n \t// the CRS origin.\r\n \tproject: function (latlng, zoom) {\r\n \t\tzoom = zoom === undefined ? this._zoom : zoom;\r\n \t\treturn this.options.crs.latLngToPoint(toLatLng(latlng), zoom);\r\n \t},\r\n\r\n \t// @method unproject(point: Point, zoom: Number): LatLng\r\n \t// Inverse of [`project`](#map-project).\r\n \tunproject: function (point, zoom) {\r\n \t\tzoom = zoom === undefined ? this._zoom : zoom;\r\n \t\treturn this.options.crs.pointToLatLng(toPoint(point), zoom);\r\n \t},\r\n\r\n \t// @method layerPointToLatLng(point: Point): LatLng\r\n \t// Given a pixel coordinate relative to the [origin pixel](#map-getpixelorigin),\r\n \t// returns the corresponding geographical coordinate (for the current zoom level).\r\n \tlayerPointToLatLng: function (point) {\r\n \t\tvar projectedPoint = toPoint(point).add(this.getPixelOrigin());\r\n \t\treturn this.unproject(projectedPoint);\r\n \t},\r\n\r\n \t// @method latLngToLayerPoint(latlng: LatLng): Point\r\n \t// Given a geographical coordinate, returns the corresponding pixel coordinate\r\n \t// relative to the [origin pixel](#map-getpixelorigin).\r\n \tlatLngToLayerPoint: function (latlng) {\r\n \t\tvar projectedPoint = this.project(toLatLng(latlng))._round();\r\n \t\treturn projectedPoint._subtract(this.getPixelOrigin());\r\n \t},\r\n\r\n \t// @method wrapLatLng(latlng: LatLng): LatLng\r\n \t// Returns a `LatLng` where `lat` and `lng` has been wrapped according to the\r\n \t// map's CRS's `wrapLat` and `wrapLng` properties, if they are outside the\r\n \t// CRS's bounds.\r\n \t// By default this means longitude is wrapped around the dateline so its\r\n \t// value is between -180 and +180 degrees.\r\n \twrapLatLng: function (latlng) {\r\n \t\treturn this.options.crs.wrapLatLng(toLatLng(latlng));\r\n \t},\r\n\r\n \t// @method wrapLatLngBounds(bounds: LatLngBounds): LatLngBounds\r\n \t// Returns a `LatLngBounds` with the same size as the given one, ensuring that\r\n \t// its center is within the CRS's bounds.\r\n \t// By default this means the center longitude is wrapped around the dateline so its\r\n \t// value is between -180 and +180 degrees, and the majority of the bounds\r\n \t// overlaps the CRS's bounds.\r\n \twrapLatLngBounds: function (latlng) {\r\n \t\treturn this.options.crs.wrapLatLngBounds(toLatLngBounds(latlng));\r\n \t},\r\n\r\n \t// @method distance(latlng1: LatLng, latlng2: LatLng): Number\r\n \t// Returns the distance between two geographical coordinates according to\r\n \t// the map's CRS. By default this measures distance in meters.\r\n \tdistance: function (latlng1, latlng2) {\r\n \t\treturn this.options.crs.distance(toLatLng(latlng1), toLatLng(latlng2));\r\n \t},\r\n\r\n \t// @method containerPointToLayerPoint(point: Point): Point\r\n \t// Given a pixel coordinate relative to the map container, returns the corresponding\r\n \t// pixel coordinate relative to the [origin pixel](#map-getpixelorigin).\r\n \tcontainerPointToLayerPoint: function (point) { // (Point)\r\n \t\treturn toPoint(point).subtract(this._getMapPanePos());\r\n \t},\r\n\r\n \t// @method layerPointToContainerPoint(point: Point): Point\r\n \t// Given a pixel coordinate relative to the [origin pixel](#map-getpixelorigin),\r\n \t// returns the corresponding pixel coordinate relative to the map container.\r\n \tlayerPointToContainerPoint: function (point) { // (Point)\r\n \t\treturn toPoint(point).add(this._getMapPanePos());\r\n \t},\r\n\r\n \t// @method containerPointToLatLng(point: Point): LatLng\r\n \t// Given a pixel coordinate relative to the map container, returns\r\n \t// the corresponding geographical coordinate (for the current zoom level).\r\n \tcontainerPointToLatLng: function (point) {\r\n \t\tvar layerPoint = this.containerPointToLayerPoint(toPoint(point));\r\n \t\treturn this.layerPointToLatLng(layerPoint);\r\n \t},\r\n\r\n \t// @method latLngToContainerPoint(latlng: LatLng): Point\r\n \t// Given a geographical coordinate, returns the corresponding pixel coordinate\r\n \t// relative to the map container.\r\n \tlatLngToContainerPoint: function (latlng) {\r\n \t\treturn this.layerPointToContainerPoint(this.latLngToLayerPoint(toLatLng(latlng)));\r\n \t},\r\n\r\n \t// @method mouseEventToContainerPoint(ev: MouseEvent): Point\r\n \t// Given a MouseEvent object, returns the pixel coordinate relative to the\r\n \t// map container where the event took place.\r\n \tmouseEventToContainerPoint: function (e) {\r\n \t\treturn getMousePosition(e, this._container);\r\n \t},\r\n\r\n \t// @method mouseEventToLayerPoint(ev: MouseEvent): Point\r\n \t// Given a MouseEvent object, returns the pixel coordinate relative to\r\n \t// the [origin pixel](#map-getpixelorigin) where the event took place.\r\n \tmouseEventToLayerPoint: function (e) {\r\n \t\treturn this.containerPointToLayerPoint(this.mouseEventToContainerPoint(e));\r\n \t},\r\n\r\n \t// @method mouseEventToLatLng(ev: MouseEvent): LatLng\r\n \t// Given a MouseEvent object, returns geographical coordinate where the\r\n \t// event took place.\r\n \tmouseEventToLatLng: function (e) { // (MouseEvent)\r\n \t\treturn this.layerPointToLatLng(this.mouseEventToLayerPoint(e));\r\n \t},\r\n\r\n\r\n \t// map initialization methods\r\n\r\n \t_initContainer: function (id) {\r\n \t\tvar container = this._container = get(id);\r\n\r\n \t\tif (!container) {\r\n \t\t\tthrow new Error('Map container not found.');\r\n \t\t} else if (container._leaflet_id) {\r\n \t\t\tthrow new Error('Map container is already initialized.');\r\n \t\t}\r\n\r\n \t\ton(container, 'scroll', this._onScroll, this);\r\n \t\tthis._containerId = stamp(container);\r\n \t},\r\n\r\n \t_initLayout: function () {\r\n \t\tvar container = this._container;\r\n\r\n \t\tthis._fadeAnimated = this.options.fadeAnimation && any3d;\r\n\r\n \t\taddClass(container, 'leaflet-container' +\r\n \t\t\t(touch ? ' leaflet-touch' : '') +\r\n \t\t\t(retina ? ' leaflet-retina' : '') +\r\n \t\t\t(ielt9 ? ' leaflet-oldie' : '') +\r\n \t\t\t(safari ? ' leaflet-safari' : '') +\r\n \t\t\t(this._fadeAnimated ? ' leaflet-fade-anim' : ''));\r\n\r\n \t\tvar position = getStyle(container, 'position');\r\n\r\n \t\tif (position !== 'absolute' && position !== 'relative' && position !== 'fixed') {\r\n \t\t\tcontainer.style.position = 'relative';\r\n \t\t}\r\n\r\n \t\tthis._initPanes();\r\n\r\n \t\tif (this._initControlPos) {\r\n \t\t\tthis._initControlPos();\r\n \t\t}\r\n \t},\r\n\r\n \t_initPanes: function () {\r\n \t\tvar panes = this._panes = {};\r\n \t\tthis._paneRenderers = {};\r\n\r\n \t\t// @section\r\n \t\t//\r\n \t\t// Panes are DOM elements used to control the ordering of layers on the map. You\r\n \t\t// can access panes with [`map.getPane`](#map-getpane) or\r\n \t\t// [`map.getPanes`](#map-getpanes) methods. New panes can be created with the\r\n \t\t// [`map.createPane`](#map-createpane) method.\r\n \t\t//\r\n \t\t// Every map has the following default panes that differ only in zIndex.\r\n \t\t//\r\n \t\t// @pane mapPane: HTMLElement = 'auto'\r\n \t\t// Pane that contains all other map panes\r\n\r\n \t\tthis._mapPane = this.createPane('mapPane', this._container);\r\n \t\tsetPosition(this._mapPane, new Point(0, 0));\r\n\r\n \t\t// @pane tilePane: HTMLElement = 200\r\n \t\t// Pane for `GridLayer`s and `TileLayer`s\r\n \t\tthis.createPane('tilePane');\r\n \t\t// @pane overlayPane: HTMLElement = 400\r\n \t\t// Pane for overlay shadows (e.g. `Marker` shadows)\r\n \t\tthis.createPane('shadowPane');\r\n \t\t// @pane shadowPane: HTMLElement = 500\r\n \t\t// Pane for vectors (`Path`s, like `Polyline`s and `Polygon`s), `ImageOverlay`s and `VideoOverlay`s\r\n \t\tthis.createPane('overlayPane');\r\n \t\t// @pane markerPane: HTMLElement = 600\r\n \t\t// Pane for `Icon`s of `Marker`s\r\n \t\tthis.createPane('markerPane');\r\n \t\t// @pane tooltipPane: HTMLElement = 650\r\n \t\t// Pane for `Tooltip`s.\r\n \t\tthis.createPane('tooltipPane');\r\n \t\t// @pane popupPane: HTMLElement = 700\r\n \t\t// Pane for `Popup`s.\r\n \t\tthis.createPane('popupPane');\r\n\r\n \t\tif (!this.options.markerZoomAnimation) {\r\n \t\t\taddClass(panes.markerPane, 'leaflet-zoom-hide');\r\n \t\t\taddClass(panes.shadowPane, 'leaflet-zoom-hide');\r\n \t\t}\r\n \t},\r\n\r\n\r\n \t// private methods that modify map state\r\n\r\n \t// @section Map state change events\r\n \t_resetView: function (center, zoom) {\r\n \t\tsetPosition(this._mapPane, new Point(0, 0));\r\n\r\n \t\tvar loading = !this._loaded;\r\n \t\tthis._loaded = true;\r\n \t\tzoom = this._limitZoom(zoom);\r\n\r\n \t\tthis.fire('viewprereset');\r\n\r\n \t\tvar zoomChanged = this._zoom !== zoom;\r\n \t\tthis\r\n \t\t\t._moveStart(zoomChanged, false)\r\n \t\t\t._move(center, zoom)\r\n \t\t\t._moveEnd(zoomChanged);\r\n\r\n \t\t// @event viewreset: Event\r\n \t\t// Fired when the map needs to redraw its content (this usually happens\r\n \t\t// on map zoom or load). Very useful for creating custom overlays.\r\n \t\tthis.fire('viewreset');\r\n\r\n \t\t// @event load: Event\r\n \t\t// Fired when the map is initialized (when its center and zoom are set\r\n \t\t// for the first time).\r\n \t\tif (loading) {\r\n \t\t\tthis.fire('load');\r\n \t\t}\r\n \t},\r\n\r\n \t_moveStart: function (zoomChanged, noMoveStart) {\r\n \t\t// @event zoomstart: Event\r\n \t\t// Fired when the map zoom is about to change (e.g. before zoom animation).\r\n \t\t// @event movestart: Event\r\n \t\t// Fired when the view of the map starts changing (e.g. user starts dragging the map).\r\n \t\tif (zoomChanged) {\r\n \t\t\tthis.fire('zoomstart');\r\n \t\t}\r\n \t\tif (!noMoveStart) {\r\n \t\t\tthis.fire('movestart');\r\n \t\t}\r\n \t\treturn this;\r\n \t},\r\n\r\n \t_move: function (center, zoom, data) {\r\n \t\tif (zoom === undefined) {\r\n \t\t\tzoom = this._zoom;\r\n \t\t}\r\n \t\tvar zoomChanged = this._zoom !== zoom;\r\n\r\n \t\tthis._zoom = zoom;\r\n \t\tthis._lastCenter = center;\r\n \t\tthis._pixelOrigin = this._getNewPixelOrigin(center);\r\n\r\n \t\t// @event zoom: Event\r\n \t\t// Fired repeatedly during any change in zoom level, including zoom\r\n \t\t// and fly animations.\r\n \t\tif (zoomChanged || (data && data.pinch)) {\t// Always fire 'zoom' if pinching because #3530\r\n \t\t\tthis.fire('zoom', data);\r\n \t\t}\r\n\r\n \t\t// @event move: Event\r\n \t\t// Fired repeatedly during any movement of the map, including pan and\r\n \t\t// fly animations.\r\n \t\treturn this.fire('move', data);\r\n \t},\r\n\r\n \t_moveEnd: function (zoomChanged) {\r\n \t\t// @event zoomend: Event\r\n \t\t// Fired when the map has changed, after any animations.\r\n \t\tif (zoomChanged) {\r\n \t\t\tthis.fire('zoomend');\r\n \t\t}\r\n\r\n \t\t// @event moveend: Event\r\n \t\t// Fired when the center of the map stops changing (e.g. user stopped\r\n \t\t// dragging the map).\r\n \t\treturn this.fire('moveend');\r\n \t},\r\n\r\n \t_stop: function () {\r\n \t\tcancelAnimFrame(this._flyToFrame);\r\n \t\tif (this._panAnim) {\r\n \t\t\tthis._panAnim.stop();\r\n \t\t}\r\n \t\treturn this;\r\n \t},\r\n\r\n \t_rawPanBy: function (offset) {\r\n \t\tsetPosition(this._mapPane, this._getMapPanePos().subtract(offset));\r\n \t},\r\n\r\n \t_getZoomSpan: function () {\r\n \t\treturn this.getMaxZoom() - this.getMinZoom();\r\n \t},\r\n\r\n \t_panInsideMaxBounds: function () {\r\n \t\tif (!this._enforcingBounds) {\r\n \t\t\tthis.panInsideBounds(this.options.maxBounds);\r\n \t\t}\r\n \t},\r\n\r\n \t_checkIfLoaded: function () {\r\n \t\tif (!this._loaded) {\r\n \t\t\tthrow new Error('Set map center and zoom first.');\r\n \t\t}\r\n \t},\r\n\r\n \t// DOM event handling\r\n\r\n \t// @section Interaction events\r\n \t_initEvents: function (remove$$1) {\r\n \t\tthis._targets = {};\r\n \t\tthis._targets[stamp(this._container)] = this;\r\n\r\n \t\tvar onOff = remove$$1 ? off : on;\r\n\r\n \t\t// @event click: MouseEvent\r\n \t\t// Fired when the user clicks (or taps) the map.\r\n \t\t// @event dblclick: MouseEvent\r\n \t\t// Fired when the user double-clicks (or double-taps) the map.\r\n \t\t// @event mousedown: MouseEvent\r\n \t\t// Fired when the user pushes the mouse button on the map.\r\n \t\t// @event mouseup: MouseEvent\r\n \t\t// Fired when the user releases the mouse button on the map.\r\n \t\t// @event mouseover: MouseEvent\r\n \t\t// Fired when the mouse enters the map.\r\n \t\t// @event mouseout: MouseEvent\r\n \t\t// Fired when the mouse leaves the map.\r\n \t\t// @event mousemove: MouseEvent\r\n \t\t// Fired while the mouse moves over the map.\r\n \t\t// @event contextmenu: MouseEvent\r\n \t\t// Fired when the user pushes the right mouse button on the map, prevents\r\n \t\t// default browser context menu from showing if there are listeners on\r\n \t\t// this event. Also fired on mobile when the user holds a single touch\r\n \t\t// for a second (also called long press).\r\n \t\t// @event keypress: KeyboardEvent\r\n \t\t// Fired when the user presses a key from the keyboard that produces a character value while the map is focused.\r\n \t\t// @event keydown: KeyboardEvent\r\n \t\t// Fired when the user presses a key from the keyboard while the map is focused. Unlike the `keypress` event,\r\n \t\t// the `keydown` event is fired for keys that produce a character value and for keys\r\n \t\t// that do not produce a character value.\r\n \t\t// @event keyup: KeyboardEvent\r\n \t\t// Fired when the user releases a key from the keyboard while the map is focused.\r\n \t\tonOff(this._container, 'click dblclick mousedown mouseup ' +\r\n \t\t\t'mouseover mouseout mousemove contextmenu keypress keydown keyup', this._handleDOMEvent, this);\r\n\r\n \t\tif (this.options.trackResize) {\r\n \t\t\tonOff(window, 'resize', this._onResize, this);\r\n \t\t}\r\n\r\n \t\tif (any3d && this.options.transform3DLimit) {\r\n \t\t\t(remove$$1 ? this.off : this.on).call(this, 'moveend', this._onMoveEnd);\r\n \t\t}\r\n \t},\r\n\r\n \t_onResize: function () {\r\n \t\tcancelAnimFrame(this._resizeRequest);\r\n \t\tthis._resizeRequest = requestAnimFrame(\r\n \t\t function () { this.invalidateSize({debounceMoveend: true}); }, this);\r\n \t},\r\n\r\n \t_onScroll: function () {\r\n \t\tthis._container.scrollTop = 0;\r\n \t\tthis._container.scrollLeft = 0;\r\n \t},\r\n\r\n \t_onMoveEnd: function () {\r\n \t\tvar pos = this._getMapPanePos();\r\n \t\tif (Math.max(Math.abs(pos.x), Math.abs(pos.y)) >= this.options.transform3DLimit) {\r\n \t\t\t// https://bugzilla.mozilla.org/show_bug.cgi?id=1203873 but Webkit also have\r\n \t\t\t// a pixel offset on very high values, see: http://jsfiddle.net/dg6r5hhb/\r\n \t\t\tthis._resetView(this.getCenter(), this.getZoom());\r\n \t\t}\r\n \t},\r\n\r\n \t_findEventTargets: function (e, type) {\r\n \t\tvar targets = [],\r\n \t\t target,\r\n \t\t isHover = type === 'mouseout' || type === 'mouseover',\r\n \t\t src = e.target || e.srcElement,\r\n \t\t dragging = false;\r\n\r\n \t\twhile (src) {\r\n \t\t\ttarget = this._targets[stamp(src)];\r\n \t\t\tif (target && (type === 'click' || type === 'preclick') && !e._simulated && this._draggableMoved(target)) {\r\n \t\t\t\t// Prevent firing click after you just dragged an object.\r\n \t\t\t\tdragging = true;\r\n \t\t\t\tbreak;\r\n \t\t\t}\r\n \t\t\tif (target && target.listens(type, true)) {\r\n \t\t\t\tif (isHover && !isExternalTarget(src, e)) { break; }\r\n \t\t\t\ttargets.push(target);\r\n \t\t\t\tif (isHover) { break; }\r\n \t\t\t}\r\n \t\t\tif (src === this._container) { break; }\r\n \t\t\tsrc = src.parentNode;\r\n \t\t}\r\n \t\tif (!targets.length && !dragging && !isHover && isExternalTarget(src, e)) {\r\n \t\t\ttargets = [this];\r\n \t\t}\r\n \t\treturn targets;\r\n \t},\r\n\r\n \t_handleDOMEvent: function (e) {\r\n \t\tif (!this._loaded || skipped(e)) { return; }\r\n\r\n \t\tvar type = e.type;\r\n\r\n \t\tif (type === 'mousedown' || type === 'keypress' || type === 'keyup' || type === 'keydown') {\r\n \t\t\t// prevents outline when clicking on keyboard-focusable element\r\n \t\t\tpreventOutline(e.target || e.srcElement);\r\n \t\t}\r\n\r\n \t\tthis._fireDOMEvent(e, type);\r\n \t},\r\n\r\n \t_mouseEvents: ['click', 'dblclick', 'mouseover', 'mouseout', 'contextmenu'],\r\n\r\n \t_fireDOMEvent: function (e, type, targets) {\r\n\r\n \t\tif (e.type === 'click') {\r\n \t\t\t// Fire a synthetic 'preclick' event which propagates up (mainly for closing popups).\r\n \t\t\t// @event preclick: MouseEvent\r\n \t\t\t// Fired before mouse click on the map (sometimes useful when you\r\n \t\t\t// want something to happen on click before any existing click\r\n \t\t\t// handlers start running).\r\n \t\t\tvar synth = extend({}, e);\r\n \t\t\tsynth.type = 'preclick';\r\n \t\t\tthis._fireDOMEvent(synth, synth.type, targets);\r\n \t\t}\r\n\r\n \t\tif (e._stopped) { return; }\r\n\r\n \t\t// Find the layer the event is propagating from and its parents.\r\n \t\ttargets = (targets || []).concat(this._findEventTargets(e, type));\r\n\r\n \t\tif (!targets.length) { return; }\r\n\r\n \t\tvar target = targets[0];\r\n \t\tif (type === 'contextmenu' && target.listens(type, true)) {\r\n \t\t\tpreventDefault(e);\r\n \t\t}\r\n\r\n \t\tvar data = {\r\n \t\t\toriginalEvent: e\r\n \t\t};\r\n\r\n \t\tif (e.type !== 'keypress' && e.type !== 'keydown' && e.type !== 'keyup') {\r\n \t\t\tvar isMarker = target.getLatLng && (!target._radius || target._radius <= 10);\r\n \t\t\tdata.containerPoint = isMarker ?\r\n \t\t\t\tthis.latLngToContainerPoint(target.getLatLng()) : this.mouseEventToContainerPoint(e);\r\n \t\t\tdata.layerPoint = this.containerPointToLayerPoint(data.containerPoint);\r\n \t\t\tdata.latlng = isMarker ? target.getLatLng() : this.layerPointToLatLng(data.layerPoint);\r\n \t\t}\r\n\r\n \t\tfor (var i = 0; i < targets.length; i++) {\r\n \t\t\ttargets[i].fire(type, data, true);\r\n \t\t\tif (data.originalEvent._stopped ||\r\n \t\t\t\t(targets[i].options.bubblingMouseEvents === false && indexOf(this._mouseEvents, type) !== -1)) { return; }\r\n \t\t}\r\n \t},\r\n\r\n \t_draggableMoved: function (obj) {\r\n \t\tobj = obj.dragging && obj.dragging.enabled() ? obj : this;\r\n \t\treturn (obj.dragging && obj.dragging.moved()) || (this.boxZoom && this.boxZoom.moved());\r\n \t},\r\n\r\n \t_clearHandlers: function () {\r\n \t\tfor (var i = 0, len = this._handlers.length; i < len; i++) {\r\n \t\t\tthis._handlers[i].disable();\r\n \t\t}\r\n \t},\r\n\r\n \t// @section Other Methods\r\n\r\n \t// @method whenReady(fn: Function, context?: Object): this\r\n \t// Runs the given function `fn` when the map gets initialized with\r\n \t// a view (center and zoom) and at least one layer, or immediately\r\n \t// if it's already initialized, optionally passing a function context.\r\n \twhenReady: function (callback, context) {\r\n \t\tif (this._loaded) {\r\n \t\t\tcallback.call(context || this, {target: this});\r\n \t\t} else {\r\n \t\t\tthis.on('load', callback, context);\r\n \t\t}\r\n \t\treturn this;\r\n \t},\r\n\r\n\r\n \t// private methods for getting map state\r\n\r\n \t_getMapPanePos: function () {\r\n \t\treturn getPosition(this._mapPane) || new Point(0, 0);\r\n \t},\r\n\r\n \t_moved: function () {\r\n \t\tvar pos = this._getMapPanePos();\r\n \t\treturn pos && !pos.equals([0, 0]);\r\n \t},\r\n\r\n \t_getTopLeftPoint: function (center, zoom) {\r\n \t\tvar pixelOrigin = center && zoom !== undefined ?\r\n \t\t\tthis._getNewPixelOrigin(center, zoom) :\r\n \t\t\tthis.getPixelOrigin();\r\n \t\treturn pixelOrigin.subtract(this._getMapPanePos());\r\n \t},\r\n\r\n \t_getNewPixelOrigin: function (center, zoom) {\r\n \t\tvar viewHalf = this.getSize()._divideBy(2);\r\n \t\treturn this.project(center, zoom)._subtract(viewHalf)._add(this._getMapPanePos())._round();\r\n \t},\r\n\r\n \t_latLngToNewLayerPoint: function (latlng, zoom, center) {\r\n \t\tvar topLeft = this._getNewPixelOrigin(center, zoom);\r\n \t\treturn this.project(latlng, zoom)._subtract(topLeft);\r\n \t},\r\n\r\n \t_latLngBoundsToNewLayerBounds: function (latLngBounds, zoom, center) {\r\n \t\tvar topLeft = this._getNewPixelOrigin(center, zoom);\r\n \t\treturn toBounds([\r\n \t\t\tthis.project(latLngBounds.getSouthWest(), zoom)._subtract(topLeft),\r\n \t\t\tthis.project(latLngBounds.getNorthWest(), zoom)._subtract(topLeft),\r\n \t\t\tthis.project(latLngBounds.getSouthEast(), zoom)._subtract(topLeft),\r\n \t\t\tthis.project(latLngBounds.getNorthEast(), zoom)._subtract(topLeft)\r\n \t\t]);\r\n \t},\r\n\r\n \t// layer point of the current center\r\n \t_getCenterLayerPoint: function () {\r\n \t\treturn this.containerPointToLayerPoint(this.getSize()._divideBy(2));\r\n \t},\r\n\r\n \t// offset of the specified place to the current center in pixels\r\n \t_getCenterOffset: function (latlng) {\r\n \t\treturn this.latLngToLayerPoint(latlng).subtract(this._getCenterLayerPoint());\r\n \t},\r\n\r\n \t// adjust center for view to get inside bounds\r\n \t_limitCenter: function (center, zoom, bounds) {\r\n\r\n \t\tif (!bounds) { return center; }\r\n\r\n \t\tvar centerPoint = this.project(center, zoom),\r\n \t\t viewHalf = this.getSize().divideBy(2),\r\n \t\t viewBounds = new Bounds(centerPoint.subtract(viewHalf), centerPoint.add(viewHalf)),\r\n \t\t offset = this._getBoundsOffset(viewBounds, bounds, zoom);\r\n\r\n \t\t// If offset is less than a pixel, ignore.\r\n \t\t// This prevents unstable projections from getting into\r\n \t\t// an infinite loop of tiny offsets.\r\n \t\tif (offset.round().equals([0, 0])) {\r\n \t\t\treturn center;\r\n \t\t}\r\n\r\n \t\treturn this.unproject(centerPoint.add(offset), zoom);\r\n \t},\r\n\r\n \t// adjust offset for view to get inside bounds\r\n \t_limitOffset: function (offset, bounds) {\r\n \t\tif (!bounds) { return offset; }\r\n\r\n \t\tvar viewBounds = this.getPixelBounds(),\r\n \t\t newBounds = new Bounds(viewBounds.min.add(offset), viewBounds.max.add(offset));\r\n\r\n \t\treturn offset.add(this._getBoundsOffset(newBounds, bounds));\r\n \t},\r\n\r\n \t// returns offset needed for pxBounds to get inside maxBounds at a specified zoom\r\n \t_getBoundsOffset: function (pxBounds, maxBounds, zoom) {\r\n \t\tvar projectedMaxBounds = toBounds(\r\n \t\t this.project(maxBounds.getNorthEast(), zoom),\r\n \t\t this.project(maxBounds.getSouthWest(), zoom)\r\n \t\t ),\r\n \t\t minOffset = projectedMaxBounds.min.subtract(pxBounds.min),\r\n \t\t maxOffset = projectedMaxBounds.max.subtract(pxBounds.max),\r\n\r\n \t\t dx = this._rebound(minOffset.x, -maxOffset.x),\r\n \t\t dy = this._rebound(minOffset.y, -maxOffset.y);\r\n\r\n \t\treturn new Point(dx, dy);\r\n \t},\r\n\r\n \t_rebound: function (left, right) {\r\n \t\treturn left + right > 0 ?\r\n \t\t\tMath.round(left - right) / 2 :\r\n \t\t\tMath.max(0, Math.ceil(left)) - Math.max(0, Math.floor(right));\r\n \t},\r\n\r\n \t_limitZoom: function (zoom) {\r\n \t\tvar min = this.getMinZoom(),\r\n \t\t max = this.getMaxZoom(),\r\n \t\t snap = any3d ? this.options.zoomSnap : 1;\r\n \t\tif (snap) {\r\n \t\t\tzoom = Math.round(zoom / snap) * snap;\r\n \t\t}\r\n \t\treturn Math.max(min, Math.min(max, zoom));\r\n \t},\r\n\r\n \t_onPanTransitionStep: function () {\r\n \t\tthis.fire('move');\r\n \t},\r\n\r\n \t_onPanTransitionEnd: function () {\r\n \t\tremoveClass(this._mapPane, 'leaflet-pan-anim');\r\n \t\tthis.fire('moveend');\r\n \t},\r\n\r\n \t_tryAnimatedPan: function (center, options) {\r\n \t\t// difference between the new and current centers in pixels\r\n \t\tvar offset = this._getCenterOffset(center)._trunc();\r\n\r\n \t\t// don't animate too far unless animate: true specified in options\r\n \t\tif ((options && options.animate) !== true && !this.getSize().contains(offset)) { return false; }\r\n\r\n \t\tthis.panBy(offset, options);\r\n\r\n \t\treturn true;\r\n \t},\r\n\r\n \t_createAnimProxy: function () {\r\n\r\n \t\tvar proxy = this._proxy = create$1('div', 'leaflet-proxy leaflet-zoom-animated');\r\n \t\tthis._panes.mapPane.appendChild(proxy);\r\n\r\n \t\tthis.on('zoomanim', function (e) {\r\n \t\t\tvar prop = TRANSFORM,\r\n \t\t\t transform = this._proxy.style[prop];\r\n\r\n \t\t\tsetTransform(this._proxy, this.project(e.center, e.zoom), this.getZoomScale(e.zoom, 1));\r\n\r\n \t\t\t// workaround for case when transform is the same and so transitionend event is not fired\r\n \t\t\tif (transform === this._proxy.style[prop] && this._animatingZoom) {\r\n \t\t\t\tthis._onZoomTransitionEnd();\r\n \t\t\t}\r\n \t\t}, this);\r\n\r\n \t\tthis.on('load moveend', this._animMoveEnd, this);\r\n\r\n \t\tthis._on('unload', this._destroyAnimProxy, this);\r\n \t},\r\n\r\n \t_destroyAnimProxy: function () {\r\n \t\tremove(this._proxy);\r\n \t\tthis.off('load moveend', this._animMoveEnd, this);\r\n \t\tdelete this._proxy;\r\n \t},\r\n\r\n \t_animMoveEnd: function () {\r\n \t\tvar c = this.getCenter(),\r\n \t\t z = this.getZoom();\r\n \t\tsetTransform(this._proxy, this.project(c, z), this.getZoomScale(z, 1));\r\n \t},\r\n\r\n \t_catchTransitionEnd: function (e) {\r\n \t\tif (this._animatingZoom && e.propertyName.indexOf('transform') >= 0) {\r\n \t\t\tthis._onZoomTransitionEnd();\r\n \t\t}\r\n \t},\r\n\r\n \t_nothingToAnimate: function () {\r\n \t\treturn !this._container.getElementsByClassName('leaflet-zoom-animated').length;\r\n \t},\r\n\r\n \t_tryAnimatedZoom: function (center, zoom, options) {\r\n\r\n \t\tif (this._animatingZoom) { return true; }\r\n\r\n \t\toptions = options || {};\r\n\r\n \t\t// don't animate if disabled, not supported or zoom difference is too large\r\n \t\tif (!this._zoomAnimated || options.animate === false || this._nothingToAnimate() ||\r\n \t\t Math.abs(zoom - this._zoom) > this.options.zoomAnimationThreshold) { return false; }\r\n\r\n \t\t// offset is the pixel coords of the zoom origin relative to the current center\r\n \t\tvar scale = this.getZoomScale(zoom),\r\n \t\t offset = this._getCenterOffset(center)._divideBy(1 - 1 / scale);\r\n\r\n \t\t// don't animate if the zoom origin isn't within one screen from the current center, unless forced\r\n \t\tif (options.animate !== true && !this.getSize().contains(offset)) { return false; }\r\n\r\n \t\trequestAnimFrame(function () {\r\n \t\t\tthis\r\n \t\t\t ._moveStart(true, false)\r\n \t\t\t ._animateZoom(center, zoom, true);\r\n \t\t}, this);\r\n\r\n \t\treturn true;\r\n \t},\r\n\r\n \t_animateZoom: function (center, zoom, startAnim, noUpdate) {\r\n \t\tif (!this._mapPane) { return; }\r\n\r\n \t\tif (startAnim) {\r\n \t\t\tthis._animatingZoom = true;\r\n\r\n \t\t\t// remember what center/zoom to set after animation\r\n \t\t\tthis._animateToCenter = center;\r\n \t\t\tthis._animateToZoom = zoom;\r\n\r\n \t\t\taddClass(this._mapPane, 'leaflet-zoom-anim');\r\n \t\t}\r\n\r\n \t\t// @section Other Events\r\n \t\t// @event zoomanim: ZoomAnimEvent\r\n \t\t// Fired at least once per zoom animation. For continuous zoom, like pinch zooming, fired once per frame during zoom.\r\n \t\tthis.fire('zoomanim', {\r\n \t\t\tcenter: center,\r\n \t\t\tzoom: zoom,\r\n \t\t\tnoUpdate: noUpdate\r\n \t\t});\r\n\r\n \t\t// Work around webkit not firing 'transitionend', see https://github.com/Leaflet/Leaflet/issues/3689, 2693\r\n \t\tsetTimeout(bind(this._onZoomTransitionEnd, this), 250);\r\n \t},\r\n\r\n \t_onZoomTransitionEnd: function () {\r\n \t\tif (!this._animatingZoom) { return; }\r\n\r\n \t\tif (this._mapPane) {\r\n \t\t\tremoveClass(this._mapPane, 'leaflet-zoom-anim');\r\n \t\t}\r\n\r\n \t\tthis._animatingZoom = false;\r\n\r\n \t\tthis._move(this._animateToCenter, this._animateToZoom);\r\n\r\n \t\t// This anim frame should prevent an obscure iOS webkit tile loading race condition.\r\n \t\trequestAnimFrame(function () {\r\n \t\t\tthis._moveEnd(true);\r\n \t\t}, this);\r\n \t}\r\n });\r\n\r\n // @section\r\n\r\n // @factory L.map(id: String, options?: Map options)\r\n // Instantiates a map object given the DOM ID of a `
` element\r\n // and optionally an object literal with `Map options`.\r\n //\r\n // @alternative\r\n // @factory L.map(el: HTMLElement, options?: Map options)\r\n // Instantiates a map object given an instance of a `
` HTML element\r\n // and optionally an object literal with `Map options`.\r\n function createMap(id, options) {\r\n \treturn new Map(id, options);\r\n }\n\n /*\r\n * @class Control\r\n * @aka L.Control\r\n * @inherits Class\r\n *\r\n * L.Control is a base class for implementing map controls. Handles positioning.\r\n * All other controls extend from this class.\r\n */\r\n\r\n var Control = Class.extend({\r\n \t// @section\r\n \t// @aka Control options\r\n \toptions: {\r\n \t\t// @option position: String = 'topright'\r\n \t\t// The position of the control (one of the map corners). Possible values are `'topleft'`,\r\n \t\t// `'topright'`, `'bottomleft'` or `'bottomright'`\r\n \t\tposition: 'topright'\r\n \t},\r\n\r\n \tinitialize: function (options) {\r\n \t\tsetOptions(this, options);\r\n \t},\r\n\r\n \t/* @section\r\n \t * Classes extending L.Control will inherit the following methods:\r\n \t *\r\n \t * @method getPosition: string\r\n \t * Returns the position of the control.\r\n \t */\r\n \tgetPosition: function () {\r\n \t\treturn this.options.position;\r\n \t},\r\n\r\n \t// @method setPosition(position: string): this\r\n \t// Sets the position of the control.\r\n \tsetPosition: function (position) {\r\n \t\tvar map = this._map;\r\n\r\n \t\tif (map) {\r\n \t\t\tmap.removeControl(this);\r\n \t\t}\r\n\r\n \t\tthis.options.position = position;\r\n\r\n \t\tif (map) {\r\n \t\t\tmap.addControl(this);\r\n \t\t}\r\n\r\n \t\treturn this;\r\n \t},\r\n\r\n \t// @method getContainer: HTMLElement\r\n \t// Returns the HTMLElement that contains the control.\r\n \tgetContainer: function () {\r\n \t\treturn this._container;\r\n \t},\r\n\r\n \t// @method addTo(map: Map): this\r\n \t// Adds the control to the given map.\r\n \taddTo: function (map) {\r\n \t\tthis.remove();\r\n \t\tthis._map = map;\r\n\r\n \t\tvar container = this._container = this.onAdd(map),\r\n \t\t pos = this.getPosition(),\r\n \t\t corner = map._controlCorners[pos];\r\n\r\n \t\taddClass(container, 'leaflet-control');\r\n\r\n \t\tif (pos.indexOf('bottom') !== -1) {\r\n \t\t\tcorner.insertBefore(container, corner.firstChild);\r\n \t\t} else {\r\n \t\t\tcorner.appendChild(container);\r\n \t\t}\r\n\r\n \t\tthis._map.on('unload', this.remove, this);\r\n\r\n \t\treturn this;\r\n \t},\r\n\r\n \t// @method remove: this\r\n \t// Removes the control from the map it is currently active on.\r\n \tremove: function () {\r\n \t\tif (!this._map) {\r\n \t\t\treturn this;\r\n \t\t}\r\n\r\n \t\tremove(this._container);\r\n\r\n \t\tif (this.onRemove) {\r\n \t\t\tthis.onRemove(this._map);\r\n \t\t}\r\n\r\n \t\tthis._map.off('unload', this.remove, this);\r\n \t\tthis._map = null;\r\n\r\n \t\treturn this;\r\n \t},\r\n\r\n \t_refocusOnMap: function (e) {\r\n \t\t// if map exists and event is not a keyboard event\r\n \t\tif (this._map && e && e.screenX > 0 && e.screenY > 0) {\r\n \t\t\tthis._map.getContainer().focus();\r\n \t\t}\r\n \t}\r\n });\r\n\r\n var control = function (options) {\r\n \treturn new Control(options);\r\n };\r\n\r\n /* @section Extension methods\r\n * @uninheritable\r\n *\r\n * Every control should extend from `L.Control` and (re-)implement the following methods.\r\n *\r\n * @method onAdd(map: Map): HTMLElement\r\n * Should return the container DOM element for the control and add listeners on relevant map events. Called on [`control.addTo(map)`](#control-addTo).\r\n *\r\n * @method onRemove(map: Map)\r\n * Optional method. Should contain all clean up code that removes the listeners previously added in [`onAdd`](#control-onadd). Called on [`control.remove()`](#control-remove).\r\n */\r\n\r\n /* @namespace Map\r\n * @section Methods for Layers and Controls\r\n */\r\n Map.include({\r\n \t// @method addControl(control: Control): this\r\n \t// Adds the given control to the map\r\n \taddControl: function (control) {\r\n \t\tcontrol.addTo(this);\r\n \t\treturn this;\r\n \t},\r\n\r\n \t// @method removeControl(control: Control): this\r\n \t// Removes the given control from the map\r\n \tremoveControl: function (control) {\r\n \t\tcontrol.remove();\r\n \t\treturn this;\r\n \t},\r\n\r\n \t_initControlPos: function () {\r\n \t\tvar corners = this._controlCorners = {},\r\n \t\t l = 'leaflet-',\r\n \t\t container = this._controlContainer =\r\n \t\t create$1('div', l + 'control-container', this._container);\r\n\r\n \t\tfunction createCorner(vSide, hSide) {\r\n \t\t\tvar className = l + vSide + ' ' + l + hSide;\r\n\r\n \t\t\tcorners[vSide + hSide] = create$1('div', className, container);\r\n \t\t}\r\n\r\n \t\tcreateCorner('top', 'left');\r\n \t\tcreateCorner('top', 'right');\r\n \t\tcreateCorner('bottom', 'left');\r\n \t\tcreateCorner('bottom', 'right');\r\n \t},\r\n\r\n \t_clearControlPos: function () {\r\n \t\tfor (var i in this._controlCorners) {\r\n \t\t\tremove(this._controlCorners[i]);\r\n \t\t}\r\n \t\tremove(this._controlContainer);\r\n \t\tdelete this._controlCorners;\r\n \t\tdelete this._controlContainer;\r\n \t}\r\n });\n\n /*\r\n * @class Control.Layers\r\n * @aka L.Control.Layers\r\n * @inherits Control\r\n *\r\n * The layers control gives users the ability to switch between different base layers and switch overlays on/off (check out the [detailed example](http://leafletjs.com/examples/layers-control/)). Extends `Control`.\r\n *\r\n * @example\r\n *\r\n * ```js\r\n * var baseLayers = {\r\n * \t\"Mapbox\": mapbox,\r\n * \t\"OpenStreetMap\": osm\r\n * };\r\n *\r\n * var overlays = {\r\n * \t\"Marker\": marker,\r\n * \t\"Roads\": roadsLayer\r\n * };\r\n *\r\n * L.control.layers(baseLayers, overlays).addTo(map);\r\n * ```\r\n *\r\n * The `baseLayers` and `overlays` parameters are object literals with layer names as keys and `Layer` objects as values:\r\n *\r\n * ```js\r\n * {\r\n * \"\": layer1,\r\n * \"\": layer2\r\n * }\r\n * ```\r\n *\r\n * The layer names can contain HTML, which allows you to add additional styling to the items:\r\n *\r\n * ```js\r\n * {\" My Layer\": myLayer}\r\n * ```\r\n */\r\n\r\n var Layers = Control.extend({\r\n \t// @section\r\n \t// @aka Control.Layers options\r\n \toptions: {\r\n \t\t// @option collapsed: Boolean = true\r\n \t\t// If `true`, the control will be collapsed into an icon and expanded on mouse hover or touch.\r\n \t\tcollapsed: true,\r\n \t\tposition: 'topright',\r\n\r\n \t\t// @option autoZIndex: Boolean = true\r\n \t\t// If `true`, the control will assign zIndexes in increasing order to all of its layers so that the order is preserved when switching them on/off.\r\n \t\tautoZIndex: true,\r\n\r\n \t\t// @option hideSingleBase: Boolean = false\r\n \t\t// If `true`, the base layers in the control will be hidden when there is only one.\r\n \t\thideSingleBase: false,\r\n\r\n \t\t// @option sortLayers: Boolean = false\r\n \t\t// Whether to sort the layers. When `false`, layers will keep the order\r\n \t\t// in which they were added to the control.\r\n \t\tsortLayers: false,\r\n\r\n \t\t// @option sortFunction: Function = *\r\n \t\t// A [compare function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/sort)\r\n \t\t// that will be used for sorting the layers, when `sortLayers` is `true`.\r\n \t\t// The function receives both the `L.Layer` instances and their names, as in\r\n \t\t// `sortFunction(layerA, layerB, nameA, nameB)`.\r\n \t\t// By default, it sorts layers alphabetically by their name.\r\n \t\tsortFunction: function (layerA, layerB, nameA, nameB) {\r\n \t\t\treturn nameA < nameB ? -1 : (nameB < nameA ? 1 : 0);\r\n \t\t}\r\n \t},\r\n\r\n \tinitialize: function (baseLayers, overlays, options) {\r\n \t\tsetOptions(this, options);\r\n\r\n \t\tthis._layerControlInputs = [];\r\n \t\tthis._layers = [];\r\n \t\tthis._lastZIndex = 0;\r\n \t\tthis._handlingClick = false;\r\n\r\n \t\tfor (var i in baseLayers) {\r\n \t\t\tthis._addLayer(baseLayers[i], i);\r\n \t\t}\r\n\r\n \t\tfor (i in overlays) {\r\n \t\t\tthis._addLayer(overlays[i], i, true);\r\n \t\t}\r\n \t},\r\n\r\n \tonAdd: function (map) {\r\n \t\tthis._initLayout();\r\n \t\tthis._update();\r\n\r\n \t\tthis._map = map;\r\n \t\tmap.on('zoomend', this._checkDisabledLayers, this);\r\n\r\n \t\tfor (var i = 0; i < this._layers.length; i++) {\r\n \t\t\tthis._layers[i].layer.on('add remove', this._onLayerChange, this);\r\n \t\t}\r\n\r\n \t\treturn this._container;\r\n \t},\r\n\r\n \taddTo: function (map) {\r\n \t\tControl.prototype.addTo.call(this, map);\r\n \t\t// Trigger expand after Layers Control has been inserted into DOM so that is now has an actual height.\r\n \t\treturn this._expandIfNotCollapsed();\r\n \t},\r\n\r\n \tonRemove: function () {\r\n \t\tthis._map.off('zoomend', this._checkDisabledLayers, this);\r\n\r\n \t\tfor (var i = 0; i < this._layers.length; i++) {\r\n \t\t\tthis._layers[i].layer.off('add remove', this._onLayerChange, this);\r\n \t\t}\r\n \t},\r\n\r\n \t// @method addBaseLayer(layer: Layer, name: String): this\r\n \t// Adds a base layer (radio button entry) with the given name to the control.\r\n \taddBaseLayer: function (layer, name) {\r\n \t\tthis._addLayer(layer, name);\r\n \t\treturn (this._map) ? this._update() : this;\r\n \t},\r\n\r\n \t// @method addOverlay(layer: Layer, name: String): this\r\n \t// Adds an overlay (checkbox entry) with the given name to the control.\r\n \taddOverlay: function (layer, name) {\r\n \t\tthis._addLayer(layer, name, true);\r\n \t\treturn (this._map) ? this._update() : this;\r\n \t},\r\n\r\n \t// @method removeLayer(layer: Layer): this\r\n \t// Remove the given layer from the control.\r\n \tremoveLayer: function (layer) {\r\n \t\tlayer.off('add remove', this._onLayerChange, this);\r\n\r\n \t\tvar obj = this._getLayer(stamp(layer));\r\n \t\tif (obj) {\r\n \t\t\tthis._layers.splice(this._layers.indexOf(obj), 1);\r\n \t\t}\r\n \t\treturn (this._map) ? this._update() : this;\r\n \t},\r\n\r\n \t// @method expand(): this\r\n \t// Expand the control container if collapsed.\r\n \texpand: function () {\r\n \t\taddClass(this._container, 'leaflet-control-layers-expanded');\r\n \t\tthis._section.style.height = null;\r\n \t\tvar acceptableHeight = this._map.getSize().y - (this._container.offsetTop + 50);\r\n \t\tif (acceptableHeight < this._section.clientHeight) {\r\n \t\t\taddClass(this._section, 'leaflet-control-layers-scrollbar');\r\n \t\t\tthis._section.style.height = acceptableHeight + 'px';\r\n \t\t} else {\r\n \t\t\tremoveClass(this._section, 'leaflet-control-layers-scrollbar');\r\n \t\t}\r\n \t\tthis._checkDisabledLayers();\r\n \t\treturn this;\r\n \t},\r\n\r\n \t// @method collapse(): this\r\n \t// Collapse the control container if expanded.\r\n \tcollapse: function () {\r\n \t\tremoveClass(this._container, 'leaflet-control-layers-expanded');\r\n \t\treturn this;\r\n \t},\r\n\r\n \t_initLayout: function () {\r\n \t\tvar className = 'leaflet-control-layers',\r\n \t\t container = this._container = create$1('div', className),\r\n \t\t collapsed = this.options.collapsed;\r\n\r\n \t\t// makes this work on IE touch devices by stopping it from firing a mouseout event when the touch is released\r\n \t\tcontainer.setAttribute('aria-haspopup', true);\r\n\r\n \t\tdisableClickPropagation(container);\r\n \t\tdisableScrollPropagation(container);\r\n\r\n \t\tvar section = this._section = create$1('section', className + '-list');\r\n\r\n \t\tif (collapsed) {\r\n \t\t\tthis._map.on('click', this.collapse, this);\r\n\r\n \t\t\tif (!android) {\r\n \t\t\t\ton(container, {\r\n \t\t\t\t\tmouseenter: this.expand,\r\n \t\t\t\t\tmouseleave: this.collapse\r\n \t\t\t\t}, this);\r\n \t\t\t}\r\n \t\t}\r\n\r\n \t\tvar link = this._layersLink = create$1('a', className + '-toggle', container);\r\n \t\tlink.href = '#';\r\n \t\tlink.title = 'Layers';\r\n\r\n \t\tif (touch) {\r\n \t\t\ton(link, 'click', stop);\r\n \t\t\ton(link, 'click', this.expand, this);\r\n \t\t} else {\r\n \t\t\ton(link, 'focus', this.expand, this);\r\n \t\t}\r\n\r\n \t\tif (!collapsed) {\r\n \t\t\tthis.expand();\r\n \t\t}\r\n\r\n \t\tthis._baseLayersList = create$1('div', className + '-base', section);\r\n \t\tthis._separator = create$1('div', className + '-separator', section);\r\n \t\tthis._overlaysList = create$1('div', className + '-overlays', section);\r\n\r\n \t\tcontainer.appendChild(section);\r\n \t},\r\n\r\n \t_getLayer: function (id) {\r\n \t\tfor (var i = 0; i < this._layers.length; i++) {\r\n\r\n \t\t\tif (this._layers[i] && stamp(this._layers[i].layer) === id) {\r\n \t\t\t\treturn this._layers[i];\r\n \t\t\t}\r\n \t\t}\r\n \t},\r\n\r\n \t_addLayer: function (layer, name, overlay) {\r\n \t\tif (this._map) {\r\n \t\t\tlayer.on('add remove', this._onLayerChange, this);\r\n \t\t}\r\n\r\n \t\tthis._layers.push({\r\n \t\t\tlayer: layer,\r\n \t\t\tname: name,\r\n \t\t\toverlay: overlay\r\n \t\t});\r\n\r\n \t\tif (this.options.sortLayers) {\r\n \t\t\tthis._layers.sort(bind(function (a, b) {\r\n \t\t\t\treturn this.options.sortFunction(a.layer, b.layer, a.name, b.name);\r\n \t\t\t}, this));\r\n \t\t}\r\n\r\n \t\tif (this.options.autoZIndex && layer.setZIndex) {\r\n \t\t\tthis._lastZIndex++;\r\n \t\t\tlayer.setZIndex(this._lastZIndex);\r\n \t\t}\r\n\r\n \t\tthis._expandIfNotCollapsed();\r\n \t},\r\n\r\n \t_update: function () {\r\n \t\tif (!this._container) { return this; }\r\n\r\n \t\tempty(this._baseLayersList);\r\n \t\tempty(this._overlaysList);\r\n\r\n \t\tthis._layerControlInputs = [];\r\n \t\tvar baseLayersPresent, overlaysPresent, i, obj, baseLayersCount = 0;\r\n\r\n \t\tfor (i = 0; i < this._layers.length; i++) {\r\n \t\t\tobj = this._layers[i];\r\n \t\t\tthis._addItem(obj);\r\n \t\t\toverlaysPresent = overlaysPresent || obj.overlay;\r\n \t\t\tbaseLayersPresent = baseLayersPresent || !obj.overlay;\r\n \t\t\tbaseLayersCount += !obj.overlay ? 1 : 0;\r\n \t\t}\r\n\r\n \t\t// Hide base layers section if there's only one layer.\r\n \t\tif (this.options.hideSingleBase) {\r\n \t\t\tbaseLayersPresent = baseLayersPresent && baseLayersCount > 1;\r\n \t\t\tthis._baseLayersList.style.display = baseLayersPresent ? '' : 'none';\r\n \t\t}\r\n\r\n \t\tthis._separator.style.display = overlaysPresent && baseLayersPresent ? '' : 'none';\r\n\r\n \t\treturn this;\r\n \t},\r\n\r\n \t_onLayerChange: function (e) {\r\n \t\tif (!this._handlingClick) {\r\n \t\t\tthis._update();\r\n \t\t}\r\n\r\n \t\tvar obj = this._getLayer(stamp(e.target));\r\n\r\n \t\t// @namespace Map\r\n \t\t// @section Layer events\r\n \t\t// @event baselayerchange: LayersControlEvent\r\n \t\t// Fired when the base layer is changed through the [layers control](#control-layers).\r\n \t\t// @event overlayadd: LayersControlEvent\r\n \t\t// Fired when an overlay is selected through the [layers control](#control-layers).\r\n \t\t// @event overlayremove: LayersControlEvent\r\n \t\t// Fired when an overlay is deselected through the [layers control](#control-layers).\r\n \t\t// @namespace Control.Layers\r\n \t\tvar type = obj.overlay ?\r\n \t\t\t(e.type === 'add' ? 'overlayadd' : 'overlayremove') :\r\n \t\t\t(e.type === 'add' ? 'baselayerchange' : null);\r\n\r\n \t\tif (type) {\r\n \t\t\tthis._map.fire(type, obj);\r\n \t\t}\r\n \t},\r\n\r\n \t// IE7 bugs out if you create a radio dynamically, so you have to do it this hacky way (see http://bit.ly/PqYLBe)\r\n \t_createRadioElement: function (name, checked) {\r\n\r\n \t\tvar radioHtml = '';\r\n\r\n \t\tvar radioFragment = document.createElement('div');\r\n \t\tradioFragment.innerHTML = radioHtml;\r\n\r\n \t\treturn radioFragment.firstChild;\r\n \t},\r\n\r\n \t_addItem: function (obj) {\r\n \t\tvar label = document.createElement('label'),\r\n \t\t checked = this._map.hasLayer(obj.layer),\r\n \t\t input;\r\n\r\n \t\tif (obj.overlay) {\r\n \t\t\tinput = document.createElement('input');\r\n \t\t\tinput.type = 'checkbox';\r\n \t\t\tinput.className = 'leaflet-control-layers-selector';\r\n \t\t\tinput.defaultChecked = checked;\r\n \t\t} else {\r\n \t\t\tinput = this._createRadioElement('leaflet-base-layers_' + stamp(this), checked);\r\n \t\t}\r\n\r\n \t\tthis._layerControlInputs.push(input);\r\n \t\tinput.layerId = stamp(obj.layer);\r\n\r\n \t\ton(input, 'click', this._onInputClick, this);\r\n\r\n \t\tvar name = document.createElement('span');\r\n \t\tname.innerHTML = ' ' + obj.name;\r\n\r\n \t\t// Helps from preventing layer control flicker when checkboxes are disabled\r\n \t\t// https://github.com/Leaflet/Leaflet/issues/2771\r\n \t\tvar holder = document.createElement('div');\r\n\r\n \t\tlabel.appendChild(holder);\r\n \t\tholder.appendChild(input);\r\n \t\tholder.appendChild(name);\r\n\r\n \t\tvar container = obj.overlay ? this._overlaysList : this._baseLayersList;\r\n \t\tcontainer.appendChild(label);\r\n\r\n \t\tthis._checkDisabledLayers();\r\n \t\treturn label;\r\n \t},\r\n\r\n \t_onInputClick: function () {\r\n \t\tvar inputs = this._layerControlInputs,\r\n \t\t input, layer;\r\n \t\tvar addedLayers = [],\r\n \t\t removedLayers = [];\r\n\r\n \t\tthis._handlingClick = true;\r\n\r\n \t\tfor (var i = inputs.length - 1; i >= 0; i--) {\r\n \t\t\tinput = inputs[i];\r\n \t\t\tlayer = this._getLayer(input.layerId).layer;\r\n\r\n \t\t\tif (input.checked) {\r\n \t\t\t\taddedLayers.push(layer);\r\n \t\t\t} else if (!input.checked) {\r\n \t\t\t\tremovedLayers.push(layer);\r\n \t\t\t}\r\n \t\t}\r\n\r\n \t\t// Bugfix issue 2318: Should remove all old layers before readding new ones\r\n \t\tfor (i = 0; i < removedLayers.length; i++) {\r\n \t\t\tif (this._map.hasLayer(removedLayers[i])) {\r\n \t\t\t\tthis._map.removeLayer(removedLayers[i]);\r\n \t\t\t}\r\n \t\t}\r\n \t\tfor (i = 0; i < addedLayers.length; i++) {\r\n \t\t\tif (!this._map.hasLayer(addedLayers[i])) {\r\n \t\t\t\tthis._map.addLayer(addedLayers[i]);\r\n \t\t\t}\r\n \t\t}\r\n\r\n \t\tthis._handlingClick = false;\r\n\r\n \t\tthis._refocusOnMap();\r\n \t},\r\n\r\n \t_checkDisabledLayers: function () {\r\n \t\tvar inputs = this._layerControlInputs,\r\n \t\t input,\r\n \t\t layer,\r\n \t\t zoom = this._map.getZoom();\r\n\r\n \t\tfor (var i = inputs.length - 1; i >= 0; i--) {\r\n \t\t\tinput = inputs[i];\r\n \t\t\tlayer = this._getLayer(input.layerId).layer;\r\n \t\t\tinput.disabled = (layer.options.minZoom !== undefined && zoom < layer.options.minZoom) ||\r\n \t\t\t (layer.options.maxZoom !== undefined && zoom > layer.options.maxZoom);\r\n\r\n \t\t}\r\n \t},\r\n\r\n \t_expandIfNotCollapsed: function () {\r\n \t\tif (this._map && !this.options.collapsed) {\r\n \t\t\tthis.expand();\r\n \t\t}\r\n \t\treturn this;\r\n \t},\r\n\r\n \t_expand: function () {\r\n \t\t// Backward compatibility, remove me in 1.1.\r\n \t\treturn this.expand();\r\n \t},\r\n\r\n \t_collapse: function () {\r\n \t\t// Backward compatibility, remove me in 1.1.\r\n \t\treturn this.collapse();\r\n \t}\r\n\r\n });\r\n\r\n\r\n // @factory L.control.layers(baselayers?: Object, overlays?: Object, options?: Control.Layers options)\r\n // Creates a layers control with the given layers. Base layers will be switched with radio buttons, while overlays will be switched with checkboxes. Note that all base layers should be passed in the base layers object, but only one should be added to the map during map instantiation.\r\n var layers = function (baseLayers, overlays, options) {\r\n \treturn new Layers(baseLayers, overlays, options);\r\n };\n\n /*\r\n * @class Control.Zoom\r\n * @aka L.Control.Zoom\r\n * @inherits Control\r\n *\r\n * A basic zoom control with two buttons (zoom in and zoom out). It is put on the map by default unless you set its [`zoomControl` option](#map-zoomcontrol) to `false`. Extends `Control`.\r\n */\r\n\r\n var Zoom = Control.extend({\r\n \t// @section\r\n \t// @aka Control.Zoom options\r\n \toptions: {\r\n \t\tposition: 'topleft',\r\n\r\n \t\t// @option zoomInText: String = '+'\r\n \t\t// The text set on the 'zoom in' button.\r\n \t\tzoomInText: '+',\r\n\r\n \t\t// @option zoomInTitle: String = 'Zoom in'\r\n \t\t// The title set on the 'zoom in' button.\r\n \t\tzoomInTitle: 'Zoom in',\r\n\r\n \t\t// @option zoomOutText: String = '−'\r\n \t\t// The text set on the 'zoom out' button.\r\n \t\tzoomOutText: '−',\r\n\r\n \t\t// @option zoomOutTitle: String = 'Zoom out'\r\n \t\t// The title set on the 'zoom out' button.\r\n \t\tzoomOutTitle: 'Zoom out'\r\n \t},\r\n\r\n \tonAdd: function (map) {\r\n \t\tvar zoomName = 'leaflet-control-zoom',\r\n \t\t container = create$1('div', zoomName + ' leaflet-bar'),\r\n \t\t options = this.options;\r\n\r\n \t\tthis._zoomInButton = this._createButton(options.zoomInText, options.zoomInTitle,\r\n \t\t zoomName + '-in', container, this._zoomIn);\r\n \t\tthis._zoomOutButton = this._createButton(options.zoomOutText, options.zoomOutTitle,\r\n \t\t zoomName + '-out', container, this._zoomOut);\r\n\r\n \t\tthis._updateDisabled();\r\n \t\tmap.on('zoomend zoomlevelschange', this._updateDisabled, this);\r\n\r\n \t\treturn container;\r\n \t},\r\n\r\n \tonRemove: function (map) {\r\n \t\tmap.off('zoomend zoomlevelschange', this._updateDisabled, this);\r\n \t},\r\n\r\n \tdisable: function () {\r\n \t\tthis._disabled = true;\r\n \t\tthis._updateDisabled();\r\n \t\treturn this;\r\n \t},\r\n\r\n \tenable: function () {\r\n \t\tthis._disabled = false;\r\n \t\tthis._updateDisabled();\r\n \t\treturn this;\r\n \t},\r\n\r\n \t_zoomIn: function (e) {\r\n \t\tif (!this._disabled && this._map._zoom < this._map.getMaxZoom()) {\r\n \t\t\tthis._map.zoomIn(this._map.options.zoomDelta * (e.shiftKey ? 3 : 1));\r\n \t\t}\r\n \t},\r\n\r\n \t_zoomOut: function (e) {\r\n \t\tif (!this._disabled && this._map._zoom > this._map.getMinZoom()) {\r\n \t\t\tthis._map.zoomOut(this._map.options.zoomDelta * (e.shiftKey ? 3 : 1));\r\n \t\t}\r\n \t},\r\n\r\n \t_createButton: function (html, title, className, container, fn) {\r\n \t\tvar link = create$1('a', className, container);\r\n \t\tlink.innerHTML = html;\r\n \t\tlink.href = '#';\r\n \t\tlink.title = title;\r\n\r\n \t\t/*\r\n \t\t * Will force screen readers like VoiceOver to read this as \"Zoom in - button\"\r\n \t\t */\r\n \t\tlink.setAttribute('role', 'button');\r\n \t\tlink.setAttribute('aria-label', title);\r\n\r\n \t\tdisableClickPropagation(link);\r\n \t\ton(link, 'click', stop);\r\n \t\ton(link, 'click', fn, this);\r\n \t\ton(link, 'click', this._refocusOnMap, this);\r\n\r\n \t\treturn link;\r\n \t},\r\n\r\n \t_updateDisabled: function () {\r\n \t\tvar map = this._map,\r\n \t\t className = 'leaflet-disabled';\r\n\r\n \t\tremoveClass(this._zoomInButton, className);\r\n \t\tremoveClass(this._zoomOutButton, className);\r\n\r\n \t\tif (this._disabled || map._zoom === map.getMinZoom()) {\r\n \t\t\taddClass(this._zoomOutButton, className);\r\n \t\t}\r\n \t\tif (this._disabled || map._zoom === map.getMaxZoom()) {\r\n \t\t\taddClass(this._zoomInButton, className);\r\n \t\t}\r\n \t}\r\n });\r\n\r\n // @namespace Map\r\n // @section Control options\r\n // @option zoomControl: Boolean = true\r\n // Whether a [zoom control](#control-zoom) is added to the map by default.\r\n Map.mergeOptions({\r\n \tzoomControl: true\r\n });\r\n\r\n Map.addInitHook(function () {\r\n \tif (this.options.zoomControl) {\r\n \t\t// @section Controls\r\n \t\t// @property zoomControl: Control.Zoom\r\n \t\t// The default zoom control (only available if the\r\n \t\t// [`zoomControl` option](#map-zoomcontrol) was `true` when creating the map).\r\n \t\tthis.zoomControl = new Zoom();\r\n \t\tthis.addControl(this.zoomControl);\r\n \t}\r\n });\r\n\r\n // @namespace Control.Zoom\r\n // @factory L.control.zoom(options: Control.Zoom options)\r\n // Creates a zoom control\r\n var zoom = function (options) {\r\n \treturn new Zoom(options);\r\n };\n\n /*\n * @class Control.Scale\n * @aka L.Control.Scale\n * @inherits Control\n *\n * A simple scale control that shows the scale of the current center of screen in metric (m/km) and imperial (mi/ft) systems. Extends `Control`.\n *\n * @example\n *\n * ```js\n * L.control.scale().addTo(map);\n * ```\n */\n\n var Scale = Control.extend({\n \t// @section\n \t// @aka Control.Scale options\n \toptions: {\n \t\tposition: 'bottomleft',\n\n \t\t// @option maxWidth: Number = 100\n \t\t// Maximum width of the control in pixels. The width is set dynamically to show round values (e.g. 100, 200, 500).\n \t\tmaxWidth: 100,\n\n \t\t// @option metric: Boolean = True\n \t\t// Whether to show the metric scale line (m/km).\n \t\tmetric: true,\n\n \t\t// @option imperial: Boolean = True\n \t\t// Whether to show the imperial scale line (mi/ft).\n \t\timperial: true\n\n \t\t// @option updateWhenIdle: Boolean = false\n \t\t// If `true`, the control is updated on [`moveend`](#map-moveend), otherwise it's always up-to-date (updated on [`move`](#map-move)).\n \t},\n\n \tonAdd: function (map) {\n \t\tvar className = 'leaflet-control-scale',\n \t\t container = create$1('div', className),\n \t\t options = this.options;\n\n \t\tthis._addScales(options, className + '-line', container);\n\n \t\tmap.on(options.updateWhenIdle ? 'moveend' : 'move', this._update, this);\n \t\tmap.whenReady(this._update, this);\n\n \t\treturn container;\n \t},\n\n \tonRemove: function (map) {\n \t\tmap.off(this.options.updateWhenIdle ? 'moveend' : 'move', this._update, this);\n \t},\n\n \t_addScales: function (options, className, container) {\n \t\tif (options.metric) {\n \t\t\tthis._mScale = create$1('div', className, container);\n \t\t}\n \t\tif (options.imperial) {\n \t\t\tthis._iScale = create$1('div', className, container);\n \t\t}\n \t},\n\n \t_update: function () {\n \t\tvar map = this._map,\n \t\t y = map.getSize().y / 2;\n\n \t\tvar maxMeters = map.distance(\n \t\t\tmap.containerPointToLatLng([0, y]),\n \t\t\tmap.containerPointToLatLng([this.options.maxWidth, y]));\n\n \t\tthis._updateScales(maxMeters);\n \t},\n\n \t_updateScales: function (maxMeters) {\n \t\tif (this.options.metric && maxMeters) {\n \t\t\tthis._updateMetric(maxMeters);\n \t\t}\n \t\tif (this.options.imperial && maxMeters) {\n \t\t\tthis._updateImperial(maxMeters);\n \t\t}\n \t},\n\n \t_updateMetric: function (maxMeters) {\n \t\tvar meters = this._getRoundNum(maxMeters),\n \t\t label = meters < 1000 ? meters + ' m' : (meters / 1000) + ' km';\n\n \t\tthis._updateScale(this._mScale, label, meters / maxMeters);\n \t},\n\n \t_updateImperial: function (maxMeters) {\n \t\tvar maxFeet = maxMeters * 3.2808399,\n \t\t maxMiles, miles, feet;\n\n \t\tif (maxFeet > 5280) {\n \t\t\tmaxMiles = maxFeet / 5280;\n \t\t\tmiles = this._getRoundNum(maxMiles);\n \t\t\tthis._updateScale(this._iScale, miles + ' mi', miles / maxMiles);\n\n \t\t} else {\n \t\t\tfeet = this._getRoundNum(maxFeet);\n \t\t\tthis._updateScale(this._iScale, feet + ' ft', feet / maxFeet);\n \t\t}\n \t},\n\n \t_updateScale: function (scale, text, ratio) {\n \t\tscale.style.width = Math.round(this.options.maxWidth * ratio) + 'px';\n \t\tscale.innerHTML = text;\n \t},\n\n \t_getRoundNum: function (num) {\n \t\tvar pow10 = Math.pow(10, (Math.floor(num) + '').length - 1),\n \t\t d = num / pow10;\n\n \t\td = d >= 10 ? 10 :\n \t\t d >= 5 ? 5 :\n \t\t d >= 3 ? 3 :\n \t\t d >= 2 ? 2 : 1;\n\n \t\treturn pow10 * d;\n \t}\n });\n\n\n // @factory L.control.scale(options?: Control.Scale options)\n // Creates an scale control with the given options.\n var scale = function (options) {\n \treturn new Scale(options);\n };\n\n /*\r\n * @class Control.Attribution\r\n * @aka L.Control.Attribution\r\n * @inherits Control\r\n *\r\n * The attribution control allows you to display attribution data in a small text box on a map. It is put on the map by default unless you set its [`attributionControl` option](#map-attributioncontrol) to `false`, and it fetches attribution texts from layers with the [`getAttribution` method](#layer-getattribution) automatically. Extends Control.\r\n */\r\n\r\n var Attribution = Control.extend({\r\n \t// @section\r\n \t// @aka Control.Attribution options\r\n \toptions: {\r\n \t\tposition: 'bottomright',\r\n\r\n \t\t// @option prefix: String = 'Leaflet'\r\n \t\t// The HTML text shown before the attributions. Pass `false` to disable.\r\n \t\tprefix: 'Leaflet'\r\n \t},\r\n\r\n \tinitialize: function (options) {\r\n \t\tsetOptions(this, options);\r\n\r\n \t\tthis._attributions = {};\r\n \t},\r\n\r\n \tonAdd: function (map) {\r\n \t\tmap.attributionControl = this;\r\n \t\tthis._container = create$1('div', 'leaflet-control-attribution');\r\n \t\tdisableClickPropagation(this._container);\r\n\r\n \t\t// TODO ugly, refactor\r\n \t\tfor (var i in map._layers) {\r\n \t\t\tif (map._layers[i].getAttribution) {\r\n \t\t\t\tthis.addAttribution(map._layers[i].getAttribution());\r\n \t\t\t}\r\n \t\t}\r\n\r\n \t\tthis._update();\r\n\r\n \t\treturn this._container;\r\n \t},\r\n\r\n \t// @method setPrefix(prefix: String): this\r\n \t// Sets the text before the attributions.\r\n \tsetPrefix: function (prefix) {\r\n \t\tthis.options.prefix = prefix;\r\n \t\tthis._update();\r\n \t\treturn this;\r\n \t},\r\n\r\n \t// @method addAttribution(text: String): this\r\n \t// Adds an attribution text (e.g. `'Vector data © Mapbox'`).\r\n \taddAttribution: function (text) {\r\n \t\tif (!text) { return this; }\r\n\r\n \t\tif (!this._attributions[text]) {\r\n \t\t\tthis._attributions[text] = 0;\r\n \t\t}\r\n \t\tthis._attributions[text]++;\r\n\r\n \t\tthis._update();\r\n\r\n \t\treturn this;\r\n \t},\r\n\r\n \t// @method removeAttribution(text: String): this\r\n \t// Removes an attribution text.\r\n \tremoveAttribution: function (text) {\r\n \t\tif (!text) { return this; }\r\n\r\n \t\tif (this._attributions[text]) {\r\n \t\t\tthis._attributions[text]--;\r\n \t\t\tthis._update();\r\n \t\t}\r\n\r\n \t\treturn this;\r\n \t},\r\n\r\n \t_update: function () {\r\n \t\tif (!this._map) { return; }\r\n\r\n \t\tvar attribs = [];\r\n\r\n \t\tfor (var i in this._attributions) {\r\n \t\t\tif (this._attributions[i]) {\r\n \t\t\t\tattribs.push(i);\r\n \t\t\t}\r\n \t\t}\r\n\r\n \t\tvar prefixAndAttribs = [];\r\n\r\n \t\tif (this.options.prefix) {\r\n \t\t\tprefixAndAttribs.push(this.options.prefix);\r\n \t\t}\r\n \t\tif (attribs.length) {\r\n \t\t\tprefixAndAttribs.push(attribs.join(', '));\r\n \t\t}\r\n\r\n \t\tthis._container.innerHTML = prefixAndAttribs.join(' | ');\r\n \t}\r\n });\r\n\r\n // @namespace Map\r\n // @section Control options\r\n // @option attributionControl: Boolean = true\r\n // Whether a [attribution control](#control-attribution) is added to the map by default.\r\n Map.mergeOptions({\r\n \tattributionControl: true\r\n });\r\n\r\n Map.addInitHook(function () {\r\n \tif (this.options.attributionControl) {\r\n \t\tnew Attribution().addTo(this);\r\n \t}\r\n });\r\n\r\n // @namespace Control.Attribution\r\n // @factory L.control.attribution(options: Control.Attribution options)\r\n // Creates an attribution control.\r\n var attribution = function (options) {\r\n \treturn new Attribution(options);\r\n };\n\n Control.Layers = Layers;\n Control.Zoom = Zoom;\n Control.Scale = Scale;\n Control.Attribution = Attribution;\n\n control.layers = layers;\n control.zoom = zoom;\n control.scale = scale;\n control.attribution = attribution;\n\n /*\n \tL.Handler is a base class for handler classes that are used internally to inject\n \tinteraction features like dragging to classes like Map and Marker.\n */\n\n // @class Handler\n // @aka L.Handler\n // Abstract class for map interaction handlers\n\n var Handler = Class.extend({\n \tinitialize: function (map) {\n \t\tthis._map = map;\n \t},\n\n \t// @method enable(): this\n \t// Enables the handler\n \tenable: function () {\n \t\tif (this._enabled) { return this; }\n\n \t\tthis._enabled = true;\n \t\tthis.addHooks();\n \t\treturn this;\n \t},\n\n \t// @method disable(): this\n \t// Disables the handler\n \tdisable: function () {\n \t\tif (!this._enabled) { return this; }\n\n \t\tthis._enabled = false;\n \t\tthis.removeHooks();\n \t\treturn this;\n \t},\n\n \t// @method enabled(): Boolean\n \t// Returns `true` if the handler is enabled\n \tenabled: function () {\n \t\treturn !!this._enabled;\n \t}\n\n \t// @section Extension methods\n \t// Classes inheriting from `Handler` must implement the two following methods:\n \t// @method addHooks()\n \t// Called when the handler is enabled, should add event hooks.\n \t// @method removeHooks()\n \t// Called when the handler is disabled, should remove the event hooks added previously.\n });\n\n // @section There is static function which can be called without instantiating L.Handler:\n // @function addTo(map: Map, name: String): this\n // Adds a new Handler to the given map with the given name.\n Handler.addTo = function (map, name) {\n \tmap.addHandler(name, this);\n \treturn this;\n };\n\n var Mixin = {Events: Events};\n\n /*\r\n * @class Draggable\r\n * @aka L.Draggable\r\n * @inherits Evented\r\n *\r\n * A class for making DOM elements draggable (including touch support).\r\n * Used internally for map and marker dragging. Only works for elements\r\n * that were positioned with [`L.DomUtil.setPosition`](#domutil-setposition).\r\n *\r\n * @example\r\n * ```js\r\n * var draggable = new L.Draggable(elementToDrag);\r\n * draggable.enable();\r\n * ```\r\n */\r\n\r\n var START = touch ? 'touchstart mousedown' : 'mousedown';\r\n var END = {\r\n \tmousedown: 'mouseup',\r\n \ttouchstart: 'touchend',\r\n \tpointerdown: 'touchend',\r\n \tMSPointerDown: 'touchend'\r\n };\r\n var MOVE = {\r\n \tmousedown: 'mousemove',\r\n \ttouchstart: 'touchmove',\r\n \tpointerdown: 'touchmove',\r\n \tMSPointerDown: 'touchmove'\r\n };\r\n\r\n\r\n var Draggable = Evented.extend({\r\n\r\n \toptions: {\r\n \t\t// @section\r\n \t\t// @aka Draggable options\r\n \t\t// @option clickTolerance: Number = 3\r\n \t\t// The max number of pixels a user can shift the mouse pointer during a click\r\n \t\t// for it to be considered a valid click (as opposed to a mouse drag).\r\n \t\tclickTolerance: 3\r\n \t},\r\n\r\n \t// @constructor L.Draggable(el: HTMLElement, dragHandle?: HTMLElement, preventOutline?: Boolean, options?: Draggable options)\r\n \t// Creates a `Draggable` object for moving `el` when you start dragging the `dragHandle` element (equals `el` itself by default).\r\n \tinitialize: function (element, dragStartTarget, preventOutline$$1, options) {\r\n \t\tsetOptions(this, options);\r\n\r\n \t\tthis._element = element;\r\n \t\tthis._dragStartTarget = dragStartTarget || element;\r\n \t\tthis._preventOutline = preventOutline$$1;\r\n \t},\r\n\r\n \t// @method enable()\r\n \t// Enables the dragging ability\r\n \tenable: function () {\r\n \t\tif (this._enabled) { return; }\r\n\r\n \t\ton(this._dragStartTarget, START, this._onDown, this);\r\n\r\n \t\tthis._enabled = true;\r\n \t},\r\n\r\n \t// @method disable()\r\n \t// Disables the dragging ability\r\n \tdisable: function () {\r\n \t\tif (!this._enabled) { return; }\r\n\r\n \t\t// If we're currently dragging this draggable,\r\n \t\t// disabling it counts as first ending the drag.\r\n \t\tif (Draggable._dragging === this) {\r\n \t\t\tthis.finishDrag();\r\n \t\t}\r\n\r\n \t\toff(this._dragStartTarget, START, this._onDown, this);\r\n\r\n \t\tthis._enabled = false;\r\n \t\tthis._moved = false;\r\n \t},\r\n\r\n \t_onDown: function (e) {\r\n \t\t// Ignore simulated events, since we handle both touch and\r\n \t\t// mouse explicitly; otherwise we risk getting duplicates of\r\n \t\t// touch events, see #4315.\r\n \t\t// Also ignore the event if disabled; this happens in IE11\r\n \t\t// under some circumstances, see #3666.\r\n \t\tif (e._simulated || !this._enabled) { return; }\r\n\r\n \t\tthis._moved = false;\r\n\r\n \t\tif (hasClass(this._element, 'leaflet-zoom-anim')) { return; }\r\n\r\n \t\tif (Draggable._dragging || e.shiftKey || ((e.which !== 1) && (e.button !== 1) && !e.touches)) { return; }\r\n \t\tDraggable._dragging = this; // Prevent dragging multiple objects at once.\r\n\r\n \t\tif (this._preventOutline) {\r\n \t\t\tpreventOutline(this._element);\r\n \t\t}\r\n\r\n \t\tdisableImageDrag();\r\n \t\tdisableTextSelection();\r\n\r\n \t\tif (this._moving) { return; }\r\n\r\n \t\t// @event down: Event\r\n \t\t// Fired when a drag is about to start.\r\n \t\tthis.fire('down');\r\n\r\n \t\tvar first = e.touches ? e.touches[0] : e,\r\n \t\t sizedParent = getSizedParentNode(this._element);\r\n\r\n \t\tthis._startPoint = new Point(first.clientX, first.clientY);\r\n\r\n \t\t// Cache the scale, so that we can continuously compensate for it during drag (_onMove).\r\n \t\tthis._parentScale = getScale(sizedParent);\r\n\r\n \t\ton(document, MOVE[e.type], this._onMove, this);\r\n \t\ton(document, END[e.type], this._onUp, this);\r\n \t},\r\n\r\n \t_onMove: function (e) {\r\n \t\t// Ignore simulated events, since we handle both touch and\r\n \t\t// mouse explicitly; otherwise we risk getting duplicates of\r\n \t\t// touch events, see #4315.\r\n \t\t// Also ignore the event if disabled; this happens in IE11\r\n \t\t// under some circumstances, see #3666.\r\n \t\tif (e._simulated || !this._enabled) { return; }\r\n\r\n \t\tif (e.touches && e.touches.length > 1) {\r\n \t\t\tthis._moved = true;\r\n \t\t\treturn;\r\n \t\t}\r\n\r\n \t\tvar first = (e.touches && e.touches.length === 1 ? e.touches[0] : e),\r\n \t\t offset = new Point(first.clientX, first.clientY)._subtract(this._startPoint);\r\n\r\n \t\tif (!offset.x && !offset.y) { return; }\r\n \t\tif (Math.abs(offset.x) + Math.abs(offset.y) < this.options.clickTolerance) { return; }\r\n\r\n \t\t// We assume that the parent container's position, border and scale do not change for the duration of the drag.\r\n \t\t// Therefore there is no need to account for the position and border (they are eliminated by the subtraction)\r\n \t\t// and we can use the cached value for the scale.\r\n \t\toffset.x /= this._parentScale.x;\r\n \t\toffset.y /= this._parentScale.y;\r\n\r\n \t\tpreventDefault(e);\r\n\r\n \t\tif (!this._moved) {\r\n \t\t\t// @event dragstart: Event\r\n \t\t\t// Fired when a drag starts\r\n \t\t\tthis.fire('dragstart');\r\n\r\n \t\t\tthis._moved = true;\r\n \t\t\tthis._startPos = getPosition(this._element).subtract(offset);\r\n\r\n \t\t\taddClass(document.body, 'leaflet-dragging');\r\n\r\n \t\t\tthis._lastTarget = e.target || e.srcElement;\r\n \t\t\t// IE and Edge do not give the element, so fetch it\r\n \t\t\t// if necessary\r\n \t\t\tif (window.SVGElementInstance && this._lastTarget instanceof window.SVGElementInstance) {\r\n \t\t\t\tthis._lastTarget = this._lastTarget.correspondingUseElement;\r\n \t\t\t}\r\n \t\t\taddClass(this._lastTarget, 'leaflet-drag-target');\r\n \t\t}\r\n\r\n \t\tthis._newPos = this._startPos.add(offset);\r\n \t\tthis._moving = true;\r\n\r\n \t\tcancelAnimFrame(this._animRequest);\r\n \t\tthis._lastEvent = e;\r\n \t\tthis._animRequest = requestAnimFrame(this._updatePosition, this, true);\r\n \t},\r\n\r\n \t_updatePosition: function () {\r\n \t\tvar e = {originalEvent: this._lastEvent};\r\n\r\n \t\t// @event predrag: Event\r\n \t\t// Fired continuously during dragging *before* each corresponding\r\n \t\t// update of the element's position.\r\n \t\tthis.fire('predrag', e);\r\n \t\tsetPosition(this._element, this._newPos);\r\n\r\n \t\t// @event drag: Event\r\n \t\t// Fired continuously during dragging.\r\n \t\tthis.fire('drag', e);\r\n \t},\r\n\r\n \t_onUp: function (e) {\r\n \t\t// Ignore simulated events, since we handle both touch and\r\n \t\t// mouse explicitly; otherwise we risk getting duplicates of\r\n \t\t// touch events, see #4315.\r\n \t\t// Also ignore the event if disabled; this happens in IE11\r\n \t\t// under some circumstances, see #3666.\r\n \t\tif (e._simulated || !this._enabled) { return; }\r\n \t\tthis.finishDrag();\r\n \t},\r\n\r\n \tfinishDrag: function () {\r\n \t\tremoveClass(document.body, 'leaflet-dragging');\r\n\r\n \t\tif (this._lastTarget) {\r\n \t\t\tremoveClass(this._lastTarget, 'leaflet-drag-target');\r\n \t\t\tthis._lastTarget = null;\r\n \t\t}\r\n\r\n \t\tfor (var i in MOVE) {\r\n \t\t\toff(document, MOVE[i], this._onMove, this);\r\n \t\t\toff(document, END[i], this._onUp, this);\r\n \t\t}\r\n\r\n \t\tenableImageDrag();\r\n \t\tenableTextSelection();\r\n\r\n \t\tif (this._moved && this._moving) {\r\n \t\t\t// ensure drag is not fired after dragend\r\n \t\t\tcancelAnimFrame(this._animRequest);\r\n\r\n \t\t\t// @event dragend: DragEndEvent\r\n \t\t\t// Fired when the drag ends.\r\n \t\t\tthis.fire('dragend', {\r\n \t\t\t\tdistance: this._newPos.distanceTo(this._startPos)\r\n \t\t\t});\r\n \t\t}\r\n\r\n \t\tthis._moving = false;\r\n \t\tDraggable._dragging = false;\r\n \t}\r\n\r\n });\n\n /*\r\n * @namespace LineUtil\r\n *\r\n * Various utility functions for polyline points processing, used by Leaflet internally to make polylines lightning-fast.\r\n */\r\n\r\n // Simplify polyline with vertex reduction and Douglas-Peucker simplification.\r\n // Improves rendering performance dramatically by lessening the number of points to draw.\r\n\r\n // @function simplify(points: Point[], tolerance: Number): Point[]\r\n // Dramatically reduces the number of points in a polyline while retaining\r\n // its shape and returns a new array of simplified points, using the\r\n // [Douglas-Peucker algorithm](http://en.wikipedia.org/wiki/Douglas-Peucker_algorithm).\r\n // Used for a huge performance boost when processing/displaying Leaflet polylines for\r\n // each zoom level and also reducing visual noise. tolerance affects the amount of\r\n // simplification (lesser value means higher quality but slower and with more points).\r\n // Also released as a separated micro-library [Simplify.js](http://mourner.github.com/simplify-js/).\r\n function simplify(points, tolerance) {\r\n \tif (!tolerance || !points.length) {\r\n \t\treturn points.slice();\r\n \t}\r\n\r\n \tvar sqTolerance = tolerance * tolerance;\r\n\r\n \t // stage 1: vertex reduction\r\n \t points = _reducePoints(points, sqTolerance);\r\n\r\n \t // stage 2: Douglas-Peucker simplification\r\n \t points = _simplifyDP(points, sqTolerance);\r\n\r\n \treturn points;\r\n }\r\n\r\n // @function pointToSegmentDistance(p: Point, p1: Point, p2: Point): Number\r\n // Returns the distance between point `p` and segment `p1` to `p2`.\r\n function pointToSegmentDistance(p, p1, p2) {\r\n \treturn Math.sqrt(_sqClosestPointOnSegment(p, p1, p2, true));\r\n }\r\n\r\n // @function closestPointOnSegment(p: Point, p1: Point, p2: Point): Number\r\n // Returns the closest point from a point `p` on a segment `p1` to `p2`.\r\n function closestPointOnSegment(p, p1, p2) {\r\n \treturn _sqClosestPointOnSegment(p, p1, p2);\r\n }\r\n\r\n // Douglas-Peucker simplification, see http://en.wikipedia.org/wiki/Douglas-Peucker_algorithm\r\n function _simplifyDP(points, sqTolerance) {\r\n\r\n \tvar len = points.length,\r\n \t ArrayConstructor = typeof Uint8Array !== undefined + '' ? Uint8Array : Array,\r\n \t markers = new ArrayConstructor(len);\r\n\r\n \t markers[0] = markers[len - 1] = 1;\r\n\r\n \t_simplifyDPStep(points, markers, sqTolerance, 0, len - 1);\r\n\r\n \tvar i,\r\n \t newPoints = [];\r\n\r\n \tfor (i = 0; i < len; i++) {\r\n \t\tif (markers[i]) {\r\n \t\t\tnewPoints.push(points[i]);\r\n \t\t}\r\n \t}\r\n\r\n \treturn newPoints;\r\n }\r\n\r\n function _simplifyDPStep(points, markers, sqTolerance, first, last) {\r\n\r\n \tvar maxSqDist = 0,\r\n \tindex, i, sqDist;\r\n\r\n \tfor (i = first + 1; i <= last - 1; i++) {\r\n \t\tsqDist = _sqClosestPointOnSegment(points[i], points[first], points[last], true);\r\n\r\n \t\tif (sqDist > maxSqDist) {\r\n \t\t\tindex = i;\r\n \t\t\tmaxSqDist = sqDist;\r\n \t\t}\r\n \t}\r\n\r\n \tif (maxSqDist > sqTolerance) {\r\n \t\tmarkers[index] = 1;\r\n\r\n \t\t_simplifyDPStep(points, markers, sqTolerance, first, index);\r\n \t\t_simplifyDPStep(points, markers, sqTolerance, index, last);\r\n \t}\r\n }\r\n\r\n // reduce points that are too close to each other to a single point\r\n function _reducePoints(points, sqTolerance) {\r\n \tvar reducedPoints = [points[0]];\r\n\r\n \tfor (var i = 1, prev = 0, len = points.length; i < len; i++) {\r\n \t\tif (_sqDist(points[i], points[prev]) > sqTolerance) {\r\n \t\t\treducedPoints.push(points[i]);\r\n \t\t\tprev = i;\r\n \t\t}\r\n \t}\r\n \tif (prev < len - 1) {\r\n \t\treducedPoints.push(points[len - 1]);\r\n \t}\r\n \treturn reducedPoints;\r\n }\r\n\r\n var _lastCode;\r\n\r\n // @function clipSegment(a: Point, b: Point, bounds: Bounds, useLastCode?: Boolean, round?: Boolean): Point[]|Boolean\r\n // Clips the segment a to b by rectangular bounds with the\r\n // [Cohen-Sutherland algorithm](https://en.wikipedia.org/wiki/Cohen%E2%80%93Sutherland_algorithm)\r\n // (modifying the segment points directly!). Used by Leaflet to only show polyline\r\n // points that are on the screen or near, increasing performance.\r\n function clipSegment(a, b, bounds, useLastCode, round) {\r\n \tvar codeA = useLastCode ? _lastCode : _getBitCode(a, bounds),\r\n \t codeB = _getBitCode(b, bounds),\r\n\r\n \t codeOut, p, newCode;\r\n\r\n \t // save 2nd code to avoid calculating it on the next segment\r\n \t _lastCode = codeB;\r\n\r\n \twhile (true) {\r\n \t\t// if a,b is inside the clip window (trivial accept)\r\n \t\tif (!(codeA | codeB)) {\r\n \t\t\treturn [a, b];\r\n \t\t}\r\n\r\n \t\t// if a,b is outside the clip window (trivial reject)\r\n \t\tif (codeA & codeB) {\r\n \t\t\treturn false;\r\n \t\t}\r\n\r\n \t\t// other cases\r\n \t\tcodeOut = codeA || codeB;\r\n \t\tp = _getEdgeIntersection(a, b, codeOut, bounds, round);\r\n \t\tnewCode = _getBitCode(p, bounds);\r\n\r\n \t\tif (codeOut === codeA) {\r\n \t\t\ta = p;\r\n \t\t\tcodeA = newCode;\r\n \t\t} else {\r\n \t\t\tb = p;\r\n \t\t\tcodeB = newCode;\r\n \t\t}\r\n \t}\r\n }\r\n\r\n function _getEdgeIntersection(a, b, code, bounds, round) {\r\n \tvar dx = b.x - a.x,\r\n \t dy = b.y - a.y,\r\n \t min = bounds.min,\r\n \t max = bounds.max,\r\n \t x, y;\r\n\r\n \tif (code & 8) { // top\r\n \t\tx = a.x + dx * (max.y - a.y) / dy;\r\n \t\ty = max.y;\r\n\r\n \t} else if (code & 4) { // bottom\r\n \t\tx = a.x + dx * (min.y - a.y) / dy;\r\n \t\ty = min.y;\r\n\r\n \t} else if (code & 2) { // right\r\n \t\tx = max.x;\r\n \t\ty = a.y + dy * (max.x - a.x) / dx;\r\n\r\n \t} else if (code & 1) { // left\r\n \t\tx = min.x;\r\n \t\ty = a.y + dy * (min.x - a.x) / dx;\r\n \t}\r\n\r\n \treturn new Point(x, y, round);\r\n }\r\n\r\n function _getBitCode(p, bounds) {\r\n \tvar code = 0;\r\n\r\n \tif (p.x < bounds.min.x) { // left\r\n \t\tcode |= 1;\r\n \t} else if (p.x > bounds.max.x) { // right\r\n \t\tcode |= 2;\r\n \t}\r\n\r\n \tif (p.y < bounds.min.y) { // bottom\r\n \t\tcode |= 4;\r\n \t} else if (p.y > bounds.max.y) { // top\r\n \t\tcode |= 8;\r\n \t}\r\n\r\n \treturn code;\r\n }\r\n\r\n // square distance (to avoid unnecessary Math.sqrt calls)\r\n function _sqDist(p1, p2) {\r\n \tvar dx = p2.x - p1.x,\r\n \t dy = p2.y - p1.y;\r\n \treturn dx * dx + dy * dy;\r\n }\r\n\r\n // return closest point on segment or distance to that point\r\n function _sqClosestPointOnSegment(p, p1, p2, sqDist) {\r\n \tvar x = p1.x,\r\n \t y = p1.y,\r\n \t dx = p2.x - x,\r\n \t dy = p2.y - y,\r\n \t dot = dx * dx + dy * dy,\r\n \t t;\r\n\r\n \tif (dot > 0) {\r\n \t\tt = ((p.x - x) * dx + (p.y - y) * dy) / dot;\r\n\r\n \t\tif (t > 1) {\r\n \t\t\tx = p2.x;\r\n \t\t\ty = p2.y;\r\n \t\t} else if (t > 0) {\r\n \t\t\tx += dx * t;\r\n \t\t\ty += dy * t;\r\n \t\t}\r\n \t}\r\n\r\n \tdx = p.x - x;\r\n \tdy = p.y - y;\r\n\r\n \treturn sqDist ? dx * dx + dy * dy : new Point(x, y);\r\n }\r\n\r\n\r\n // @function isFlat(latlngs: LatLng[]): Boolean\r\n // Returns true if `latlngs` is a flat array, false is nested.\r\n function isFlat(latlngs) {\r\n \treturn !isArray(latlngs[0]) || (typeof latlngs[0][0] !== 'object' && typeof latlngs[0][0] !== 'undefined');\r\n }\r\n\r\n function _flat(latlngs) {\r\n \tconsole.warn('Deprecated use of _flat, please use L.LineUtil.isFlat instead.');\r\n \treturn isFlat(latlngs);\r\n }\n\n var LineUtil = ({\n simplify: simplify,\n pointToSegmentDistance: pointToSegmentDistance,\n closestPointOnSegment: closestPointOnSegment,\n clipSegment: clipSegment,\n _getEdgeIntersection: _getEdgeIntersection,\n _getBitCode: _getBitCode,\n _sqClosestPointOnSegment: _sqClosestPointOnSegment,\n isFlat: isFlat,\n _flat: _flat\n });\n\n /*\r\n * @namespace PolyUtil\r\n * Various utility functions for polygon geometries.\r\n */\r\n\r\n /* @function clipPolygon(points: Point[], bounds: Bounds, round?: Boolean): Point[]\r\n * Clips the polygon geometry defined by the given `points` by the given bounds (using the [Sutherland-Hodgman algorithm](https://en.wikipedia.org/wiki/Sutherland%E2%80%93Hodgman_algorithm)).\r\n * Used by Leaflet to only show polygon points that are on the screen or near, increasing\r\n * performance. Note that polygon points needs different algorithm for clipping\r\n * than polyline, so there's a separate method for it.\r\n */\r\n function clipPolygon(points, bounds, round) {\r\n \tvar clippedPoints,\r\n \t edges = [1, 4, 2, 8],\r\n \t i, j, k,\r\n \t a, b,\r\n \t len, edge, p;\r\n\r\n \tfor (i = 0, len = points.length; i < len; i++) {\r\n \t\tpoints[i]._code = _getBitCode(points[i], bounds);\r\n \t}\r\n\r\n \t// for each edge (left, bottom, right, top)\r\n \tfor (k = 0; k < 4; k++) {\r\n \t\tedge = edges[k];\r\n \t\tclippedPoints = [];\r\n\r\n \t\tfor (i = 0, len = points.length, j = len - 1; i < len; j = i++) {\r\n \t\t\ta = points[i];\r\n \t\t\tb = points[j];\r\n\r\n \t\t\t// if a is inside the clip window\r\n \t\t\tif (!(a._code & edge)) {\r\n \t\t\t\t// if b is outside the clip window (a->b goes out of screen)\r\n \t\t\t\tif (b._code & edge) {\r\n \t\t\t\t\tp = _getEdgeIntersection(b, a, edge, bounds, round);\r\n \t\t\t\t\tp._code = _getBitCode(p, bounds);\r\n \t\t\t\t\tclippedPoints.push(p);\r\n \t\t\t\t}\r\n \t\t\t\tclippedPoints.push(a);\r\n\r\n \t\t\t// else if b is inside the clip window (a->b enters the screen)\r\n \t\t\t} else if (!(b._code & edge)) {\r\n \t\t\t\tp = _getEdgeIntersection(b, a, edge, bounds, round);\r\n \t\t\t\tp._code = _getBitCode(p, bounds);\r\n \t\t\t\tclippedPoints.push(p);\r\n \t\t\t}\r\n \t\t}\r\n \t\tpoints = clippedPoints;\r\n \t}\r\n\r\n \treturn points;\r\n }\n\n var PolyUtil = ({\n clipPolygon: clipPolygon\n });\n\n /*\r\n * @namespace Projection\r\n * @section\r\n * Leaflet comes with a set of already defined Projections out of the box:\r\n *\r\n * @projection L.Projection.LonLat\r\n *\r\n * Equirectangular, or Plate Carree projection — the most simple projection,\r\n * mostly used by GIS enthusiasts. Directly maps `x` as longitude, and `y` as\r\n * latitude. Also suitable for flat worlds, e.g. game maps. Used by the\r\n * `EPSG:4326` and `Simple` CRS.\r\n */\r\n\r\n var LonLat = {\r\n \tproject: function (latlng) {\r\n \t\treturn new Point(latlng.lng, latlng.lat);\r\n \t},\r\n\r\n \tunproject: function (point) {\r\n \t\treturn new LatLng(point.y, point.x);\r\n \t},\r\n\r\n \tbounds: new Bounds([-180, -90], [180, 90])\r\n };\n\n /*\r\n * @namespace Projection\r\n * @projection L.Projection.Mercator\r\n *\r\n * Elliptical Mercator projection — more complex than Spherical Mercator. Assumes that Earth is an ellipsoid. Used by the EPSG:3395 CRS.\r\n */\r\n\r\n var Mercator = {\r\n \tR: 6378137,\r\n \tR_MINOR: 6356752.314245179,\r\n\r\n \tbounds: new Bounds([-20037508.34279, -15496570.73972], [20037508.34279, 18764656.23138]),\r\n\r\n \tproject: function (latlng) {\r\n \t\tvar d = Math.PI / 180,\r\n \t\t r = this.R,\r\n \t\t y = latlng.lat * d,\r\n \t\t tmp = this.R_MINOR / r,\r\n \t\t e = Math.sqrt(1 - tmp * tmp),\r\n \t\t con = e * Math.sin(y);\r\n\r\n \t\tvar ts = Math.tan(Math.PI / 4 - y / 2) / Math.pow((1 - con) / (1 + con), e / 2);\r\n \t\ty = -r * Math.log(Math.max(ts, 1E-10));\r\n\r\n \t\treturn new Point(latlng.lng * d * r, y);\r\n \t},\r\n\r\n \tunproject: function (point) {\r\n \t\tvar d = 180 / Math.PI,\r\n \t\t r = this.R,\r\n \t\t tmp = this.R_MINOR / r,\r\n \t\t e = Math.sqrt(1 - tmp * tmp),\r\n \t\t ts = Math.exp(-point.y / r),\r\n \t\t phi = Math.PI / 2 - 2 * Math.atan(ts);\r\n\r\n \t\tfor (var i = 0, dphi = 0.1, con; i < 15 && Math.abs(dphi) > 1e-7; i++) {\r\n \t\t\tcon = e * Math.sin(phi);\r\n \t\t\tcon = Math.pow((1 - con) / (1 + con), e / 2);\r\n \t\t\tdphi = Math.PI / 2 - 2 * Math.atan(ts * con) - phi;\r\n \t\t\tphi += dphi;\r\n \t\t}\r\n\r\n \t\treturn new LatLng(phi * d, point.x * d / r);\r\n \t}\r\n };\n\n /*\n * @class Projection\n\n * An object with methods for projecting geographical coordinates of the world onto\n * a flat surface (and back). See [Map projection](http://en.wikipedia.org/wiki/Map_projection).\n\n * @property bounds: Bounds\n * The bounds (specified in CRS units) where the projection is valid\n\n * @method project(latlng: LatLng): Point\n * Projects geographical coordinates into a 2D point.\n * Only accepts actual `L.LatLng` instances, not arrays.\n\n * @method unproject(point: Point): LatLng\n * The inverse of `project`. Projects a 2D point into a geographical location.\n * Only accepts actual `L.Point` instances, not arrays.\n\n * Note that the projection instances do not inherit from Leaflet's `Class` object,\n * and can't be instantiated. Also, new classes can't inherit from them,\n * and methods can't be added to them with the `include` function.\n\n */\n\n var index = ({\n LonLat: LonLat,\n Mercator: Mercator,\n SphericalMercator: SphericalMercator\n });\n\n /*\r\n * @namespace CRS\r\n * @crs L.CRS.EPSG3395\r\n *\r\n * Rarely used by some commercial tile providers. Uses Elliptical Mercator projection.\r\n */\r\n var EPSG3395 = extend({}, Earth, {\r\n \tcode: 'EPSG:3395',\r\n \tprojection: Mercator,\r\n\r\n \ttransformation: (function () {\r\n \t\tvar scale = 0.5 / (Math.PI * Mercator.R);\r\n \t\treturn toTransformation(scale, 0.5, -scale, 0.5);\r\n \t}())\r\n });\n\n /*\r\n * @namespace CRS\r\n * @crs L.CRS.EPSG4326\r\n *\r\n * A common CRS among GIS enthusiasts. Uses simple Equirectangular projection.\r\n *\r\n * Leaflet 1.0.x complies with the [TMS coordinate scheme for EPSG:4326](https://wiki.osgeo.org/wiki/Tile_Map_Service_Specification#global-geodetic),\r\n * which is a breaking change from 0.7.x behaviour. If you are using a `TileLayer`\r\n * with this CRS, ensure that there are two 256x256 pixel tiles covering the\r\n * whole earth at zoom level zero, and that the tile coordinate origin is (-180,+90),\r\n * or (-180,-90) for `TileLayer`s with [the `tms` option](#tilelayer-tms) set.\r\n */\r\n\r\n var EPSG4326 = extend({}, Earth, {\r\n \tcode: 'EPSG:4326',\r\n \tprojection: LonLat,\r\n \ttransformation: toTransformation(1 / 180, 1, -1 / 180, 0.5)\r\n });\n\n /*\n * @namespace CRS\n * @crs L.CRS.Simple\n *\n * A simple CRS that maps longitude and latitude into `x` and `y` directly.\n * May be used for maps of flat surfaces (e.g. game maps). Note that the `y`\n * axis should still be inverted (going from bottom to top). `distance()` returns\n * simple euclidean distance.\n */\n\n var Simple = extend({}, CRS, {\n \tprojection: LonLat,\n \ttransformation: toTransformation(1, 0, -1, 0),\n\n \tscale: function (zoom) {\n \t\treturn Math.pow(2, zoom);\n \t},\n\n \tzoom: function (scale) {\n \t\treturn Math.log(scale) / Math.LN2;\n \t},\n\n \tdistance: function (latlng1, latlng2) {\n \t\tvar dx = latlng2.lng - latlng1.lng,\n \t\t dy = latlng2.lat - latlng1.lat;\n\n \t\treturn Math.sqrt(dx * dx + dy * dy);\n \t},\n\n \tinfinite: true\n });\n\n CRS.Earth = Earth;\n CRS.EPSG3395 = EPSG3395;\n CRS.EPSG3857 = EPSG3857;\n CRS.EPSG900913 = EPSG900913;\n CRS.EPSG4326 = EPSG4326;\n CRS.Simple = Simple;\n\n /*\n * @class Layer\n * @inherits Evented\n * @aka L.Layer\n * @aka ILayer\n *\n * A set of methods from the Layer base class that all Leaflet layers use.\n * Inherits all methods, options and events from `L.Evented`.\n *\n * @example\n *\n * ```js\n * var layer = L.marker(latlng).addTo(map);\n * layer.addTo(map);\n * layer.remove();\n * ```\n *\n * @event add: Event\n * Fired after the layer is added to a map\n *\n * @event remove: Event\n * Fired after the layer is removed from a map\n */\n\n\n var Layer = Evented.extend({\n\n \t// Classes extending `L.Layer` will inherit the following options:\n \toptions: {\n \t\t// @option pane: String = 'overlayPane'\n \t\t// By default the layer will be added to the map's [overlay pane](#map-overlaypane). Overriding this option will cause the layer to be placed on another pane by default.\n \t\tpane: 'overlayPane',\n\n \t\t// @option attribution: String = null\n \t\t// String to be shown in the attribution control, e.g. \"© OpenStreetMap contributors\". It describes the layer data and is often a legal obligation towards copyright holders and tile providers.\n \t\tattribution: null,\n\n \t\tbubblingMouseEvents: true\n \t},\n\n \t/* @section\n \t * Classes extending `L.Layer` will inherit the following methods:\n \t *\n \t * @method addTo(map: Map|LayerGroup): this\n \t * Adds the layer to the given map or layer group.\n \t */\n \taddTo: function (map) {\n \t\tmap.addLayer(this);\n \t\treturn this;\n \t},\n\n \t// @method remove: this\n \t// Removes the layer from the map it is currently active on.\n \tremove: function () {\n \t\treturn this.removeFrom(this._map || this._mapToAdd);\n \t},\n\n \t// @method removeFrom(map: Map): this\n \t// Removes the layer from the given map\n \t//\n \t// @alternative\n \t// @method removeFrom(group: LayerGroup): this\n \t// Removes the layer from the given `LayerGroup`\n \tremoveFrom: function (obj) {\n \t\tif (obj) {\n \t\t\tobj.removeLayer(this);\n \t\t}\n \t\treturn this;\n \t},\n\n \t// @method getPane(name? : String): HTMLElement\n \t// Returns the `HTMLElement` representing the named pane on the map. If `name` is omitted, returns the pane for this layer.\n \tgetPane: function (name) {\n \t\treturn this._map.getPane(name ? (this.options[name] || name) : this.options.pane);\n \t},\n\n \taddInteractiveTarget: function (targetEl) {\n \t\tthis._map._targets[stamp(targetEl)] = this;\n \t\treturn this;\n \t},\n\n \tremoveInteractiveTarget: function (targetEl) {\n \t\tdelete this._map._targets[stamp(targetEl)];\n \t\treturn this;\n \t},\n\n \t// @method getAttribution: String\n \t// Used by the `attribution control`, returns the [attribution option](#gridlayer-attribution).\n \tgetAttribution: function () {\n \t\treturn this.options.attribution;\n \t},\n\n \t_layerAdd: function (e) {\n \t\tvar map = e.target;\n\n \t\t// check in case layer gets added and then removed before the map is ready\n \t\tif (!map.hasLayer(this)) { return; }\n\n \t\tthis._map = map;\n \t\tthis._zoomAnimated = map._zoomAnimated;\n\n \t\tif (this.getEvents) {\n \t\t\tvar events = this.getEvents();\n \t\t\tmap.on(events, this);\n \t\t\tthis.once('remove', function () {\n \t\t\t\tmap.off(events, this);\n \t\t\t}, this);\n \t\t}\n\n \t\tthis.onAdd(map);\n\n \t\tif (this.getAttribution && map.attributionControl) {\n \t\t\tmap.attributionControl.addAttribution(this.getAttribution());\n \t\t}\n\n \t\tthis.fire('add');\n \t\tmap.fire('layeradd', {layer: this});\n \t}\n });\n\n /* @section Extension methods\n * @uninheritable\n *\n * Every layer should extend from `L.Layer` and (re-)implement the following methods.\n *\n * @method onAdd(map: Map): this\n * Should contain code that creates DOM elements for the layer, adds them to `map panes` where they should belong and puts listeners on relevant map events. Called on [`map.addLayer(layer)`](#map-addlayer).\n *\n * @method onRemove(map: Map): this\n * Should contain all clean up code that removes the layer's elements from the DOM and removes listeners previously added in [`onAdd`](#layer-onadd). Called on [`map.removeLayer(layer)`](#map-removelayer).\n *\n * @method getEvents(): Object\n * This optional method should return an object like `{ viewreset: this._reset }` for [`addEventListener`](#evented-addeventlistener). The event handlers in this object will be automatically added and removed from the map with your layer.\n *\n * @method getAttribution(): String\n * This optional method should return a string containing HTML to be shown on the `Attribution control` whenever the layer is visible.\n *\n * @method beforeAdd(map: Map): this\n * Optional method. Called on [`map.addLayer(layer)`](#map-addlayer), before the layer is added to the map, before events are initialized, without waiting until the map is in a usable state. Use for early initialization only.\n */\n\n\n /* @namespace Map\n * @section Layer events\n *\n * @event layeradd: LayerEvent\n * Fired when a new layer is added to the map.\n *\n * @event layerremove: LayerEvent\n * Fired when some layer is removed from the map\n *\n * @section Methods for Layers and Controls\n */\n Map.include({\n \t// @method addLayer(layer: Layer): this\n \t// Adds the given layer to the map\n \taddLayer: function (layer) {\n \t\tif (!layer._layerAdd) {\n \t\t\tthrow new Error('The provided object is not a Layer.');\n \t\t}\n\n \t\tvar id = stamp(layer);\n \t\tif (this._layers[id]) { return this; }\n \t\tthis._layers[id] = layer;\n\n \t\tlayer._mapToAdd = this;\n\n \t\tif (layer.beforeAdd) {\n \t\t\tlayer.beforeAdd(this);\n \t\t}\n\n \t\tthis.whenReady(layer._layerAdd, layer);\n\n \t\treturn this;\n \t},\n\n \t// @method removeLayer(layer: Layer): this\n \t// Removes the given layer from the map.\n \tremoveLayer: function (layer) {\n \t\tvar id = stamp(layer);\n\n \t\tif (!this._layers[id]) { return this; }\n\n \t\tif (this._loaded) {\n \t\t\tlayer.onRemove(this);\n \t\t}\n\n \t\tif (layer.getAttribution && this.attributionControl) {\n \t\t\tthis.attributionControl.removeAttribution(layer.getAttribution());\n \t\t}\n\n \t\tdelete this._layers[id];\n\n \t\tif (this._loaded) {\n \t\t\tthis.fire('layerremove', {layer: layer});\n \t\t\tlayer.fire('remove');\n \t\t}\n\n \t\tlayer._map = layer._mapToAdd = null;\n\n \t\treturn this;\n \t},\n\n \t// @method hasLayer(layer: Layer): Boolean\n \t// Returns `true` if the given layer is currently added to the map\n \thasLayer: function (layer) {\n \t\treturn !!layer && (stamp(layer) in this._layers);\n \t},\n\n \t/* @method eachLayer(fn: Function, context?: Object): this\n \t * Iterates over the layers of the map, optionally specifying context of the iterator function.\n \t * ```\n \t * map.eachLayer(function(layer){\n \t * layer.bindPopup('Hello');\n \t * });\n \t * ```\n \t */\n \teachLayer: function (method, context) {\n \t\tfor (var i in this._layers) {\n \t\t\tmethod.call(context, this._layers[i]);\n \t\t}\n \t\treturn this;\n \t},\n\n \t_addLayers: function (layers) {\n \t\tlayers = layers ? (isArray(layers) ? layers : [layers]) : [];\n\n \t\tfor (var i = 0, len = layers.length; i < len; i++) {\n \t\t\tthis.addLayer(layers[i]);\n \t\t}\n \t},\n\n \t_addZoomLimit: function (layer) {\n \t\tif (isNaN(layer.options.maxZoom) || !isNaN(layer.options.minZoom)) {\n \t\t\tthis._zoomBoundLayers[stamp(layer)] = layer;\n \t\t\tthis._updateZoomLevels();\n \t\t}\n \t},\n\n \t_removeZoomLimit: function (layer) {\n \t\tvar id = stamp(layer);\n\n \t\tif (this._zoomBoundLayers[id]) {\n \t\t\tdelete this._zoomBoundLayers[id];\n \t\t\tthis._updateZoomLevels();\n \t\t}\n \t},\n\n \t_updateZoomLevels: function () {\n \t\tvar minZoom = Infinity,\n \t\t maxZoom = -Infinity,\n \t\t oldZoomSpan = this._getZoomSpan();\n\n \t\tfor (var i in this._zoomBoundLayers) {\n \t\t\tvar options = this._zoomBoundLayers[i].options;\n\n \t\t\tminZoom = options.minZoom === undefined ? minZoom : Math.min(minZoom, options.minZoom);\n \t\t\tmaxZoom = options.maxZoom === undefined ? maxZoom : Math.max(maxZoom, options.maxZoom);\n \t\t}\n\n \t\tthis._layersMaxZoom = maxZoom === -Infinity ? undefined : maxZoom;\n \t\tthis._layersMinZoom = minZoom === Infinity ? undefined : minZoom;\n\n \t\t// @section Map state change events\n \t\t// @event zoomlevelschange: Event\n \t\t// Fired when the number of zoomlevels on the map is changed due\n \t\t// to adding or removing a layer.\n \t\tif (oldZoomSpan !== this._getZoomSpan()) {\n \t\t\tthis.fire('zoomlevelschange');\n \t\t}\n\n \t\tif (this.options.maxZoom === undefined && this._layersMaxZoom && this.getZoom() > this._layersMaxZoom) {\n \t\t\tthis.setZoom(this._layersMaxZoom);\n \t\t}\n \t\tif (this.options.minZoom === undefined && this._layersMinZoom && this.getZoom() < this._layersMinZoom) {\n \t\t\tthis.setZoom(this._layersMinZoom);\n \t\t}\n \t}\n });\n\n /*\r\n * @class LayerGroup\r\n * @aka L.LayerGroup\r\n * @inherits Layer\r\n *\r\n * Used to group several layers and handle them as one. If you add it to the map,\r\n * any layers added or removed from the group will be added/removed on the map as\r\n * well. Extends `Layer`.\r\n *\r\n * @example\r\n *\r\n * ```js\r\n * L.layerGroup([marker1, marker2])\r\n * \t.addLayer(polyline)\r\n * \t.addTo(map);\r\n * ```\r\n */\r\n\r\n var LayerGroup = Layer.extend({\r\n\r\n \tinitialize: function (layers, options) {\r\n \t\tsetOptions(this, options);\r\n\r\n \t\tthis._layers = {};\r\n\r\n \t\tvar i, len;\r\n\r\n \t\tif (layers) {\r\n \t\t\tfor (i = 0, len = layers.length; i < len; i++) {\r\n \t\t\t\tthis.addLayer(layers[i]);\r\n \t\t\t}\r\n \t\t}\r\n \t},\r\n\r\n \t// @method addLayer(layer: Layer): this\r\n \t// Adds the given layer to the group.\r\n \taddLayer: function (layer) {\r\n \t\tvar id = this.getLayerId(layer);\r\n\r\n \t\tthis._layers[id] = layer;\r\n\r\n \t\tif (this._map) {\r\n \t\t\tthis._map.addLayer(layer);\r\n \t\t}\r\n\r\n \t\treturn this;\r\n \t},\r\n\r\n \t// @method removeLayer(layer: Layer): this\r\n \t// Removes the given layer from the group.\r\n \t// @alternative\r\n \t// @method removeLayer(id: Number): this\r\n \t// Removes the layer with the given internal ID from the group.\r\n \tremoveLayer: function (layer) {\r\n \t\tvar id = layer in this._layers ? layer : this.getLayerId(layer);\r\n\r\n \t\tif (this._map && this._layers[id]) {\r\n \t\t\tthis._map.removeLayer(this._layers[id]);\r\n \t\t}\r\n\r\n \t\tdelete this._layers[id];\r\n\r\n \t\treturn this;\r\n \t},\r\n\r\n \t// @method hasLayer(layer: Layer): Boolean\r\n \t// Returns `true` if the given layer is currently added to the group.\r\n \t// @alternative\r\n \t// @method hasLayer(id: Number): Boolean\r\n \t// Returns `true` if the given internal ID is currently added to the group.\r\n \thasLayer: function (layer) {\r\n \t\tif (!layer) { return false; }\r\n \t\tvar layerId = typeof layer === 'number' ? layer : this.getLayerId(layer);\r\n \t\treturn layerId in this._layers;\r\n \t},\r\n\r\n \t// @method clearLayers(): this\r\n \t// Removes all the layers from the group.\r\n \tclearLayers: function () {\r\n \t\treturn this.eachLayer(this.removeLayer, this);\r\n \t},\r\n\r\n \t// @method invoke(methodName: String, …): this\r\n \t// Calls `methodName` on every layer contained in this group, passing any\r\n \t// additional parameters. Has no effect if the layers contained do not\r\n \t// implement `methodName`.\r\n \tinvoke: function (methodName) {\r\n \t\tvar args = Array.prototype.slice.call(arguments, 1),\r\n \t\t i, layer;\r\n\r\n \t\tfor (i in this._layers) {\r\n \t\t\tlayer = this._layers[i];\r\n\r\n \t\t\tif (layer[methodName]) {\r\n \t\t\t\tlayer[methodName].apply(layer, args);\r\n \t\t\t}\r\n \t\t}\r\n\r\n \t\treturn this;\r\n \t},\r\n\r\n \tonAdd: function (map) {\r\n \t\tthis.eachLayer(map.addLayer, map);\r\n \t},\r\n\r\n \tonRemove: function (map) {\r\n \t\tthis.eachLayer(map.removeLayer, map);\r\n \t},\r\n\r\n \t// @method eachLayer(fn: Function, context?: Object): this\r\n \t// Iterates over the layers of the group, optionally specifying context of the iterator function.\r\n \t// ```js\r\n \t// group.eachLayer(function (layer) {\r\n \t// \tlayer.bindPopup('Hello');\r\n \t// });\r\n \t// ```\r\n \teachLayer: function (method, context) {\r\n \t\tfor (var i in this._layers) {\r\n \t\t\tmethod.call(context, this._layers[i]);\r\n \t\t}\r\n \t\treturn this;\r\n \t},\r\n\r\n \t// @method getLayer(id: Number): Layer\r\n \t// Returns the layer with the given internal ID.\r\n \tgetLayer: function (id) {\r\n \t\treturn this._layers[id];\r\n \t},\r\n\r\n \t// @method getLayers(): Layer[]\r\n \t// Returns an array of all the layers added to the group.\r\n \tgetLayers: function () {\r\n \t\tvar layers = [];\r\n \t\tthis.eachLayer(layers.push, layers);\r\n \t\treturn layers;\r\n \t},\r\n\r\n \t// @method setZIndex(zIndex: Number): this\r\n \t// Calls `setZIndex` on every layer contained in this group, passing the z-index.\r\n \tsetZIndex: function (zIndex) {\r\n \t\treturn this.invoke('setZIndex', zIndex);\r\n \t},\r\n\r\n \t// @method getLayerId(layer: Layer): Number\r\n \t// Returns the internal ID for a layer\r\n \tgetLayerId: function (layer) {\r\n \t\treturn stamp(layer);\r\n \t}\r\n });\r\n\r\n\r\n // @factory L.layerGroup(layers?: Layer[], options?: Object)\r\n // Create a layer group, optionally given an initial set of layers and an `options` object.\r\n var layerGroup = function (layers, options) {\r\n \treturn new LayerGroup(layers, options);\r\n };\n\n /*\r\n * @class FeatureGroup\r\n * @aka L.FeatureGroup\r\n * @inherits LayerGroup\r\n *\r\n * Extended `LayerGroup` that makes it easier to do the same thing to all its member layers:\r\n * * [`bindPopup`](#layer-bindpopup) binds a popup to all of the layers at once (likewise with [`bindTooltip`](#layer-bindtooltip))\r\n * * Events are propagated to the `FeatureGroup`, so if the group has an event\r\n * handler, it will handle events from any of the layers. This includes mouse events\r\n * and custom events.\r\n * * Has `layeradd` and `layerremove` events\r\n *\r\n * @example\r\n *\r\n * ```js\r\n * L.featureGroup([marker1, marker2, polyline])\r\n * \t.bindPopup('Hello world!')\r\n * \t.on('click', function() { alert('Clicked on a member of the group!'); })\r\n * \t.addTo(map);\r\n * ```\r\n */\r\n\r\n var FeatureGroup = LayerGroup.extend({\r\n\r\n \taddLayer: function (layer) {\r\n \t\tif (this.hasLayer(layer)) {\r\n \t\t\treturn this;\r\n \t\t}\r\n\r\n \t\tlayer.addEventParent(this);\r\n\r\n \t\tLayerGroup.prototype.addLayer.call(this, layer);\r\n\r\n \t\t// @event layeradd: LayerEvent\r\n \t\t// Fired when a layer is added to this `FeatureGroup`\r\n \t\treturn this.fire('layeradd', {layer: layer});\r\n \t},\r\n\r\n \tremoveLayer: function (layer) {\r\n \t\tif (!this.hasLayer(layer)) {\r\n \t\t\treturn this;\r\n \t\t}\r\n \t\tif (layer in this._layers) {\r\n \t\t\tlayer = this._layers[layer];\r\n \t\t}\r\n\r\n \t\tlayer.removeEventParent(this);\r\n\r\n \t\tLayerGroup.prototype.removeLayer.call(this, layer);\r\n\r\n \t\t// @event layerremove: LayerEvent\r\n \t\t// Fired when a layer is removed from this `FeatureGroup`\r\n \t\treturn this.fire('layerremove', {layer: layer});\r\n \t},\r\n\r\n \t// @method setStyle(style: Path options): this\r\n \t// Sets the given path options to each layer of the group that has a `setStyle` method.\r\n \tsetStyle: function (style) {\r\n \t\treturn this.invoke('setStyle', style);\r\n \t},\r\n\r\n \t// @method bringToFront(): this\r\n \t// Brings the layer group to the top of all other layers\r\n \tbringToFront: function () {\r\n \t\treturn this.invoke('bringToFront');\r\n \t},\r\n\r\n \t// @method bringToBack(): this\r\n \t// Brings the layer group to the back of all other layers\r\n \tbringToBack: function () {\r\n \t\treturn this.invoke('bringToBack');\r\n \t},\r\n\r\n \t// @method getBounds(): LatLngBounds\r\n \t// Returns the LatLngBounds of the Feature Group (created from bounds and coordinates of its children).\r\n \tgetBounds: function () {\r\n \t\tvar bounds = new LatLngBounds();\r\n\r\n \t\tfor (var id in this._layers) {\r\n \t\t\tvar layer = this._layers[id];\r\n \t\t\tbounds.extend(layer.getBounds ? layer.getBounds() : layer.getLatLng());\r\n \t\t}\r\n \t\treturn bounds;\r\n \t}\r\n });\r\n\r\n // @factory L.featureGroup(layers?: Layer[], options?: Object)\r\n // Create a feature group, optionally given an initial set of layers and an `options` object.\r\n var featureGroup = function (layers, options) {\r\n \treturn new FeatureGroup(layers, options);\r\n };\n\n /*\r\n * @class Icon\r\n * @aka L.Icon\r\n *\r\n * Represents an icon to provide when creating a marker.\r\n *\r\n * @example\r\n *\r\n * ```js\r\n * var myIcon = L.icon({\r\n * iconUrl: 'my-icon.png',\r\n * iconRetinaUrl: 'my-icon@2x.png',\r\n * iconSize: [38, 95],\r\n * iconAnchor: [22, 94],\r\n * popupAnchor: [-3, -76],\r\n * shadowUrl: 'my-icon-shadow.png',\r\n * shadowRetinaUrl: 'my-icon-shadow@2x.png',\r\n * shadowSize: [68, 95],\r\n * shadowAnchor: [22, 94]\r\n * });\r\n *\r\n * L.marker([50.505, 30.57], {icon: myIcon}).addTo(map);\r\n * ```\r\n *\r\n * `L.Icon.Default` extends `L.Icon` and is the blue icon Leaflet uses for markers by default.\r\n *\r\n */\r\n\r\n var Icon = Class.extend({\r\n\r\n \t/* @section\r\n \t * @aka Icon options\r\n \t *\r\n \t * @option iconUrl: String = null\r\n \t * **(required)** The URL to the icon image (absolute or relative to your script path).\r\n \t *\r\n \t * @option iconRetinaUrl: String = null\r\n \t * The URL to a retina sized version of the icon image (absolute or relative to your\r\n \t * script path). Used for Retina screen devices.\r\n \t *\r\n \t * @option iconSize: Point = null\r\n \t * Size of the icon image in pixels.\r\n \t *\r\n \t * @option iconAnchor: Point = null\r\n \t * The coordinates of the \"tip\" of the icon (relative to its top left corner). The icon\r\n \t * will be aligned so that this point is at the marker's geographical location. Centered\r\n \t * by default if size is specified, also can be set in CSS with negative margins.\r\n \t *\r\n \t * @option popupAnchor: Point = [0, 0]\r\n \t * The coordinates of the point from which popups will \"open\", relative to the icon anchor.\r\n \t *\r\n \t * @option tooltipAnchor: Point = [0, 0]\r\n \t * The coordinates of the point from which tooltips will \"open\", relative to the icon anchor.\r\n \t *\r\n \t * @option shadowUrl: String = null\r\n \t * The URL to the icon shadow image. If not specified, no shadow image will be created.\r\n \t *\r\n \t * @option shadowRetinaUrl: String = null\r\n \t *\r\n \t * @option shadowSize: Point = null\r\n \t * Size of the shadow image in pixels.\r\n \t *\r\n \t * @option shadowAnchor: Point = null\r\n \t * The coordinates of the \"tip\" of the shadow (relative to its top left corner) (the same\r\n \t * as iconAnchor if not specified).\r\n \t *\r\n \t * @option className: String = ''\r\n \t * A custom class name to assign to both icon and shadow images. Empty by default.\r\n \t */\r\n\r\n \toptions: {\r\n \t\tpopupAnchor: [0, 0],\r\n \t\ttooltipAnchor: [0, 0]\r\n \t},\r\n\r\n \tinitialize: function (options) {\r\n \t\tsetOptions(this, options);\r\n \t},\r\n\r\n \t// @method createIcon(oldIcon?: HTMLElement): HTMLElement\r\n \t// Called internally when the icon has to be shown, returns a `` HTML element\r\n \t// styled according to the options.\r\n \tcreateIcon: function (oldIcon) {\r\n \t\treturn this._createIcon('icon', oldIcon);\r\n \t},\r\n\r\n \t// @method createShadow(oldIcon?: HTMLElement): HTMLElement\r\n \t// As `createIcon`, but for the shadow beneath it.\r\n \tcreateShadow: function (oldIcon) {\r\n \t\treturn this._createIcon('shadow', oldIcon);\r\n \t},\r\n\r\n \t_createIcon: function (name, oldIcon) {\r\n \t\tvar src = this._getIconUrl(name);\r\n\r\n \t\tif (!src) {\r\n \t\t\tif (name === 'icon') {\r\n \t\t\t\tthrow new Error('iconUrl not set in Icon options (see the docs).');\r\n \t\t\t}\r\n \t\t\treturn null;\r\n \t\t}\r\n\r\n \t\tvar img = this._createImg(src, oldIcon && oldIcon.tagName === 'IMG' ? oldIcon : null);\r\n \t\tthis._setIconStyles(img, name);\r\n\r\n \t\treturn img;\r\n \t},\r\n\r\n \t_setIconStyles: function (img, name) {\r\n \t\tvar options = this.options;\r\n \t\tvar sizeOption = options[name + 'Size'];\r\n\r\n \t\tif (typeof sizeOption === 'number') {\r\n \t\t\tsizeOption = [sizeOption, sizeOption];\r\n \t\t}\r\n\r\n \t\tvar size = toPoint(sizeOption),\r\n \t\t anchor = toPoint(name === 'shadow' && options.shadowAnchor || options.iconAnchor ||\r\n \t\t size && size.divideBy(2, true));\r\n\r\n \t\timg.className = 'leaflet-marker-' + name + ' ' + (options.className || '');\r\n\r\n \t\tif (anchor) {\r\n \t\t\timg.style.marginLeft = (-anchor.x) + 'px';\r\n \t\t\timg.style.marginTop = (-anchor.y) + 'px';\r\n \t\t}\r\n\r\n \t\tif (size) {\r\n \t\t\timg.style.width = size.x + 'px';\r\n \t\t\timg.style.height = size.y + 'px';\r\n \t\t}\r\n \t},\r\n\r\n \t_createImg: function (src, el) {\r\n \t\tel = el || document.createElement('img');\r\n \t\tel.src = src;\r\n \t\treturn el;\r\n \t},\r\n\r\n \t_getIconUrl: function (name) {\r\n \t\treturn retina && this.options[name + 'RetinaUrl'] || this.options[name + 'Url'];\r\n \t}\r\n });\r\n\r\n\r\n // @factory L.icon(options: Icon options)\r\n // Creates an icon instance with the given options.\r\n function icon(options) {\r\n \treturn new Icon(options);\r\n }\n\n /*\n * @miniclass Icon.Default (Icon)\n * @aka L.Icon.Default\n * @section\n *\n * A trivial subclass of `Icon`, represents the icon to use in `Marker`s when\n * no icon is specified. Points to the blue marker image distributed with Leaflet\n * releases.\n *\n * In order to customize the default icon, just change the properties of `L.Icon.Default.prototype.options`\n * (which is a set of `Icon options`).\n *\n * If you want to _completely_ replace the default icon, override the\n * `L.Marker.prototype.options.icon` with your own icon instead.\n */\n\n var IconDefault = Icon.extend({\n\n \toptions: {\n \t\ticonUrl: 'marker-icon.png',\n \t\ticonRetinaUrl: 'marker-icon-2x.png',\n \t\tshadowUrl: 'marker-shadow.png',\n \t\ticonSize: [25, 41],\n \t\ticonAnchor: [12, 41],\n \t\tpopupAnchor: [1, -34],\n \t\ttooltipAnchor: [16, -28],\n \t\tshadowSize: [41, 41]\n \t},\n\n \t_getIconUrl: function (name) {\n \t\tif (!IconDefault.imagePath) {\t// Deprecated, backwards-compatibility only\n \t\t\tIconDefault.imagePath = this._detectIconPath();\n \t\t}\n\n \t\t// @option imagePath: String\n \t\t// `Icon.Default` will try to auto-detect the location of the\n \t\t// blue icon images. If you are placing these images in a non-standard\n \t\t// way, set this option to point to the right path.\n \t\treturn (this.options.imagePath || IconDefault.imagePath) + Icon.prototype._getIconUrl.call(this, name);\n \t},\n\n \t_detectIconPath: function () {\n \t\tvar el = create$1('div', 'leaflet-default-icon-path', document.body);\n \t\tvar path = getStyle(el, 'background-image') ||\n \t\t getStyle(el, 'backgroundImage');\t// IE8\n\n \t\tdocument.body.removeChild(el);\n\n \t\tif (path === null || path.indexOf('url') !== 0) {\n \t\t\tpath = '';\n \t\t} else {\n \t\t\tpath = path.replace(/^url\\([\"']?/, '').replace(/marker-icon\\.png[\"']?\\)$/, '');\n \t\t}\n\n \t\treturn path;\n \t}\n });\n\n /*\n * L.Handler.MarkerDrag is used internally by L.Marker to make the markers draggable.\n */\n\n\n /* @namespace Marker\n * @section Interaction handlers\n *\n * Interaction handlers are properties of a marker instance that allow you to control interaction behavior in runtime, enabling or disabling certain features such as dragging (see `Handler` methods). Example:\n *\n * ```js\n * marker.dragging.disable();\n * ```\n *\n * @property dragging: Handler\n * Marker dragging handler (by both mouse and touch). Only valid when the marker is on the map (Otherwise set [`marker.options.draggable`](#marker-draggable)).\n */\n\n var MarkerDrag = Handler.extend({\n \tinitialize: function (marker) {\n \t\tthis._marker = marker;\n \t},\n\n \taddHooks: function () {\n \t\tvar icon = this._marker._icon;\n\n \t\tif (!this._draggable) {\n \t\t\tthis._draggable = new Draggable(icon, icon, true);\n \t\t}\n\n \t\tthis._draggable.on({\n \t\t\tdragstart: this._onDragStart,\n \t\t\tpredrag: this._onPreDrag,\n \t\t\tdrag: this._onDrag,\n \t\t\tdragend: this._onDragEnd\n \t\t}, this).enable();\n\n \t\taddClass(icon, 'leaflet-marker-draggable');\n \t},\n\n \tremoveHooks: function () {\n \t\tthis._draggable.off({\n \t\t\tdragstart: this._onDragStart,\n \t\t\tpredrag: this._onPreDrag,\n \t\t\tdrag: this._onDrag,\n \t\t\tdragend: this._onDragEnd\n \t\t}, this).disable();\n\n \t\tif (this._marker._icon) {\n \t\t\tremoveClass(this._marker._icon, 'leaflet-marker-draggable');\n \t\t}\n \t},\n\n \tmoved: function () {\n \t\treturn this._draggable && this._draggable._moved;\n \t},\n\n \t_adjustPan: function (e) {\n \t\tvar marker = this._marker,\n \t\t map = marker._map,\n \t\t speed = this._marker.options.autoPanSpeed,\n \t\t padding = this._marker.options.autoPanPadding,\n \t\t iconPos = getPosition(marker._icon),\n \t\t bounds = map.getPixelBounds(),\n \t\t origin = map.getPixelOrigin();\n\n \t\tvar panBounds = toBounds(\n \t\t\tbounds.min._subtract(origin).add(padding),\n \t\t\tbounds.max._subtract(origin).subtract(padding)\n \t\t);\n\n \t\tif (!panBounds.contains(iconPos)) {\n \t\t\t// Compute incremental movement\n \t\t\tvar movement = toPoint(\n \t\t\t\t(Math.max(panBounds.max.x, iconPos.x) - panBounds.max.x) / (bounds.max.x - panBounds.max.x) -\n \t\t\t\t(Math.min(panBounds.min.x, iconPos.x) - panBounds.min.x) / (bounds.min.x - panBounds.min.x),\n\n \t\t\t\t(Math.max(panBounds.max.y, iconPos.y) - panBounds.max.y) / (bounds.max.y - panBounds.max.y) -\n \t\t\t\t(Math.min(panBounds.min.y, iconPos.y) - panBounds.min.y) / (bounds.min.y - panBounds.min.y)\n \t\t\t).multiplyBy(speed);\n\n \t\t\tmap.panBy(movement, {animate: false});\n\n \t\t\tthis._draggable._newPos._add(movement);\n \t\t\tthis._draggable._startPos._add(movement);\n\n \t\t\tsetPosition(marker._icon, this._draggable._newPos);\n \t\t\tthis._onDrag(e);\n\n \t\t\tthis._panRequest = requestAnimFrame(this._adjustPan.bind(this, e));\n \t\t}\n \t},\n\n \t_onDragStart: function () {\n \t\t// @section Dragging events\n \t\t// @event dragstart: Event\n \t\t// Fired when the user starts dragging the marker.\n\n \t\t// @event movestart: Event\n \t\t// Fired when the marker starts moving (because of dragging).\n\n \t\tthis._oldLatLng = this._marker.getLatLng();\n\n \t\t// When using ES6 imports it could not be set when `Popup` was not imported as well\n \t\tthis._marker.closePopup && this._marker.closePopup();\n\n \t\tthis._marker\n \t\t\t.fire('movestart')\n \t\t\t.fire('dragstart');\n \t},\n\n \t_onPreDrag: function (e) {\n \t\tif (this._marker.options.autoPan) {\n \t\t\tcancelAnimFrame(this._panRequest);\n \t\t\tthis._panRequest = requestAnimFrame(this._adjustPan.bind(this, e));\n \t\t}\n \t},\n\n \t_onDrag: function (e) {\n \t\tvar marker = this._marker,\n \t\t shadow = marker._shadow,\n \t\t iconPos = getPosition(marker._icon),\n \t\t latlng = marker._map.layerPointToLatLng(iconPos);\n\n \t\t// update shadow position\n \t\tif (shadow) {\n \t\t\tsetPosition(shadow, iconPos);\n \t\t}\n\n \t\tmarker._latlng = latlng;\n \t\te.latlng = latlng;\n \t\te.oldLatLng = this._oldLatLng;\n\n \t\t// @event drag: Event\n \t\t// Fired repeatedly while the user drags the marker.\n \t\tmarker\n \t\t .fire('move', e)\n \t\t .fire('drag', e);\n \t},\n\n \t_onDragEnd: function (e) {\n \t\t// @event dragend: DragEndEvent\n \t\t// Fired when the user stops dragging the marker.\n\n \t\t cancelAnimFrame(this._panRequest);\n\n \t\t// @event moveend: Event\n \t\t// Fired when the marker stops moving (because of dragging).\n \t\tdelete this._oldLatLng;\n \t\tthis._marker\n \t\t .fire('moveend')\n \t\t .fire('dragend', e);\n \t}\n });\n\n /*\r\n * @class Marker\r\n * @inherits Interactive layer\r\n * @aka L.Marker\r\n * L.Marker is used to display clickable/draggable icons on the map. Extends `Layer`.\r\n *\r\n * @example\r\n *\r\n * ```js\r\n * L.marker([50.5, 30.5]).addTo(map);\r\n * ```\r\n */\r\n\r\n var Marker = Layer.extend({\r\n\r\n \t// @section\r\n \t// @aka Marker options\r\n \toptions: {\r\n \t\t// @option icon: Icon = *\r\n \t\t// Icon instance to use for rendering the marker.\r\n \t\t// See [Icon documentation](#L.Icon) for details on how to customize the marker icon.\r\n \t\t// If not specified, a common instance of `L.Icon.Default` is used.\r\n \t\ticon: new IconDefault(),\r\n\r\n \t\t// Option inherited from \"Interactive layer\" abstract class\r\n \t\tinteractive: true,\r\n\r\n \t\t// @option keyboard: Boolean = true\r\n \t\t// Whether the marker can be tabbed to with a keyboard and clicked by pressing enter.\r\n \t\tkeyboard: true,\r\n\r\n \t\t// @option title: String = ''\r\n \t\t// Text for the browser tooltip that appear on marker hover (no tooltip by default).\r\n \t\ttitle: '',\r\n\r\n \t\t// @option alt: String = ''\r\n \t\t// Text for the `alt` attribute of the icon image (useful for accessibility).\r\n \t\talt: '',\r\n\r\n \t\t// @option zIndexOffset: Number = 0\r\n \t\t// By default, marker images zIndex is set automatically based on its latitude. Use this option if you want to put the marker on top of all others (or below), specifying a high value like `1000` (or high negative value, respectively).\r\n \t\tzIndexOffset: 0,\r\n\r\n \t\t// @option opacity: Number = 1.0\r\n \t\t// The opacity of the marker.\r\n \t\topacity: 1,\r\n\r\n \t\t// @option riseOnHover: Boolean = false\r\n \t\t// If `true`, the marker will get on top of others when you hover the mouse over it.\r\n \t\triseOnHover: false,\r\n\r\n \t\t// @option riseOffset: Number = 250\r\n \t\t// The z-index offset used for the `riseOnHover` feature.\r\n \t\triseOffset: 250,\r\n\r\n \t\t// @option pane: String = 'markerPane'\r\n \t\t// `Map pane` where the markers icon will be added.\r\n \t\tpane: 'markerPane',\r\n\r\n \t\t// @option shadowPane: String = 'shadowPane'\r\n \t\t// `Map pane` where the markers shadow will be added.\r\n \t\tshadowPane: 'shadowPane',\r\n\r\n \t\t// @option bubblingMouseEvents: Boolean = false\r\n \t\t// When `true`, a mouse event on this marker will trigger the same event on the map\r\n \t\t// (unless [`L.DomEvent.stopPropagation`](#domevent-stoppropagation) is used).\r\n \t\tbubblingMouseEvents: false,\r\n\r\n \t\t// @section Draggable marker options\r\n \t\t// @option draggable: Boolean = false\r\n \t\t// Whether the marker is draggable with mouse/touch or not.\r\n \t\tdraggable: false,\r\n\r\n \t\t// @option autoPan: Boolean = false\r\n \t\t// Whether to pan the map when dragging this marker near its edge or not.\r\n \t\tautoPan: false,\r\n\r\n \t\t// @option autoPanPadding: Point = Point(50, 50)\r\n \t\t// Distance (in pixels to the left/right and to the top/bottom) of the\r\n \t\t// map edge to start panning the map.\r\n \t\tautoPanPadding: [50, 50],\r\n\r\n \t\t// @option autoPanSpeed: Number = 10\r\n \t\t// Number of pixels the map should pan by.\r\n \t\tautoPanSpeed: 10\r\n \t},\r\n\r\n \t/* @section\r\n \t *\r\n \t * In addition to [shared layer methods](#Layer) like `addTo()` and `remove()` and [popup methods](#Popup) like bindPopup() you can also use the following methods:\r\n \t */\r\n\r\n \tinitialize: function (latlng, options) {\r\n \t\tsetOptions(this, options);\r\n \t\tthis._latlng = toLatLng(latlng);\r\n \t},\r\n\r\n \tonAdd: function (map) {\r\n \t\tthis._zoomAnimated = this._zoomAnimated && map.options.markerZoomAnimation;\r\n\r\n \t\tif (this._zoomAnimated) {\r\n \t\t\tmap.on('zoomanim', this._animateZoom, this);\r\n \t\t}\r\n\r\n \t\tthis._initIcon();\r\n \t\tthis.update();\r\n \t},\r\n\r\n \tonRemove: function (map) {\r\n \t\tif (this.dragging && this.dragging.enabled()) {\r\n \t\t\tthis.options.draggable = true;\r\n \t\t\tthis.dragging.removeHooks();\r\n \t\t}\r\n \t\tdelete this.dragging;\r\n\r\n \t\tif (this._zoomAnimated) {\r\n \t\t\tmap.off('zoomanim', this._animateZoom, this);\r\n \t\t}\r\n\r\n \t\tthis._removeIcon();\r\n \t\tthis._removeShadow();\r\n \t},\r\n\r\n \tgetEvents: function () {\r\n \t\treturn {\r\n \t\t\tzoom: this.update,\r\n \t\t\tviewreset: this.update\r\n \t\t};\r\n \t},\r\n\r\n \t// @method getLatLng: LatLng\r\n \t// Returns the current geographical position of the marker.\r\n \tgetLatLng: function () {\r\n \t\treturn this._latlng;\r\n \t},\r\n\r\n \t// @method setLatLng(latlng: LatLng): this\r\n \t// Changes the marker position to the given point.\r\n \tsetLatLng: function (latlng) {\r\n \t\tvar oldLatLng = this._latlng;\r\n \t\tthis._latlng = toLatLng(latlng);\r\n \t\tthis.update();\r\n\r\n \t\t// @event move: Event\r\n \t\t// Fired when the marker is moved via [`setLatLng`](#marker-setlatlng) or by [dragging](#marker-dragging). Old and new coordinates are included in event arguments as `oldLatLng`, `latlng`.\r\n \t\treturn this.fire('move', {oldLatLng: oldLatLng, latlng: this._latlng});\r\n \t},\r\n\r\n \t// @method setZIndexOffset(offset: Number): this\r\n \t// Changes the [zIndex offset](#marker-zindexoffset) of the marker.\r\n \tsetZIndexOffset: function (offset) {\r\n \t\tthis.options.zIndexOffset = offset;\r\n \t\treturn this.update();\r\n \t},\r\n\r\n \t// @method getIcon: Icon\r\n \t// Returns the current icon used by the marker\r\n \tgetIcon: function () {\r\n \t\treturn this.options.icon;\r\n \t},\r\n\r\n \t// @method setIcon(icon: Icon): this\r\n \t// Changes the marker icon.\r\n \tsetIcon: function (icon) {\r\n\r\n \t\tthis.options.icon = icon;\r\n\r\n \t\tif (this._map) {\r\n \t\t\tthis._initIcon();\r\n \t\t\tthis.update();\r\n \t\t}\r\n\r\n \t\tif (this._popup) {\r\n \t\t\tthis.bindPopup(this._popup, this._popup.options);\r\n \t\t}\r\n\r\n \t\treturn this;\r\n \t},\r\n\r\n \tgetElement: function () {\r\n \t\treturn this._icon;\r\n \t},\r\n\r\n \tupdate: function () {\r\n\r\n \t\tif (this._icon && this._map) {\r\n \t\t\tvar pos = this._map.latLngToLayerPoint(this._latlng).round();\r\n \t\t\tthis._setPos(pos);\r\n \t\t}\r\n\r\n \t\treturn this;\r\n \t},\r\n\r\n \t_initIcon: function () {\r\n \t\tvar options = this.options,\r\n \t\t classToAdd = 'leaflet-zoom-' + (this._zoomAnimated ? 'animated' : 'hide');\r\n\r\n \t\tvar icon = options.icon.createIcon(this._icon),\r\n \t\t addIcon = false;\r\n\r\n \t\t// if we're not reusing the icon, remove the old one and init new one\r\n \t\tif (icon !== this._icon) {\r\n \t\t\tif (this._icon) {\r\n \t\t\t\tthis._removeIcon();\r\n \t\t\t}\r\n \t\t\taddIcon = true;\r\n\r\n \t\t\tif (options.title) {\r\n \t\t\t\ticon.title = options.title;\r\n \t\t\t}\r\n\r\n \t\t\tif (icon.tagName === 'IMG') {\r\n \t\t\t\ticon.alt = options.alt || '';\r\n \t\t\t}\r\n \t\t}\r\n\r\n \t\taddClass(icon, classToAdd);\r\n\r\n \t\tif (options.keyboard) {\r\n \t\t\ticon.tabIndex = '0';\r\n \t\t}\r\n\r\n \t\tthis._icon = icon;\r\n\r\n \t\tif (options.riseOnHover) {\r\n \t\t\tthis.on({\r\n \t\t\t\tmouseover: this._bringToFront,\r\n \t\t\t\tmouseout: this._resetZIndex\r\n \t\t\t});\r\n \t\t}\r\n\r\n \t\tvar newShadow = options.icon.createShadow(this._shadow),\r\n \t\t addShadow = false;\r\n\r\n \t\tif (newShadow !== this._shadow) {\r\n \t\t\tthis._removeShadow();\r\n \t\t\taddShadow = true;\r\n \t\t}\r\n\r\n \t\tif (newShadow) {\r\n \t\t\taddClass(newShadow, classToAdd);\r\n \t\t\tnewShadow.alt = '';\r\n \t\t}\r\n \t\tthis._shadow = newShadow;\r\n\r\n\r\n \t\tif (options.opacity < 1) {\r\n \t\t\tthis._updateOpacity();\r\n \t\t}\r\n\r\n\r\n \t\tif (addIcon) {\r\n \t\t\tthis.getPane().appendChild(this._icon);\r\n \t\t}\r\n \t\tthis._initInteraction();\r\n \t\tif (newShadow && addShadow) {\r\n \t\t\tthis.getPane(options.shadowPane).appendChild(this._shadow);\r\n \t\t}\r\n \t},\r\n\r\n \t_removeIcon: function () {\r\n \t\tif (this.options.riseOnHover) {\r\n \t\t\tthis.off({\r\n \t\t\t\tmouseover: this._bringToFront,\r\n \t\t\t\tmouseout: this._resetZIndex\r\n \t\t\t});\r\n \t\t}\r\n\r\n \t\tremove(this._icon);\r\n \t\tthis.removeInteractiveTarget(this._icon);\r\n\r\n \t\tthis._icon = null;\r\n \t},\r\n\r\n \t_removeShadow: function () {\r\n \t\tif (this._shadow) {\r\n \t\t\tremove(this._shadow);\r\n \t\t}\r\n \t\tthis._shadow = null;\r\n \t},\r\n\r\n \t_setPos: function (pos) {\r\n\r\n \t\tif (this._icon) {\r\n \t\t\tsetPosition(this._icon, pos);\r\n \t\t}\r\n\r\n \t\tif (this._shadow) {\r\n \t\t\tsetPosition(this._shadow, pos);\r\n \t\t}\r\n\r\n \t\tthis._zIndex = pos.y + this.options.zIndexOffset;\r\n\r\n \t\tthis._resetZIndex();\r\n \t},\r\n\r\n \t_updateZIndex: function (offset) {\r\n \t\tif (this._icon) {\r\n \t\t\tthis._icon.style.zIndex = this._zIndex + offset;\r\n \t\t}\r\n \t},\r\n\r\n \t_animateZoom: function (opt) {\r\n \t\tvar pos = this._map._latLngToNewLayerPoint(this._latlng, opt.zoom, opt.center).round();\r\n\r\n \t\tthis._setPos(pos);\r\n \t},\r\n\r\n \t_initInteraction: function () {\r\n\r\n \t\tif (!this.options.interactive) { return; }\r\n\r\n \t\taddClass(this._icon, 'leaflet-interactive');\r\n\r\n \t\tthis.addInteractiveTarget(this._icon);\r\n\r\n \t\tif (MarkerDrag) {\r\n \t\t\tvar draggable = this.options.draggable;\r\n \t\t\tif (this.dragging) {\r\n \t\t\t\tdraggable = this.dragging.enabled();\r\n \t\t\t\tthis.dragging.disable();\r\n \t\t\t}\r\n\r\n \t\t\tthis.dragging = new MarkerDrag(this);\r\n\r\n \t\t\tif (draggable) {\r\n \t\t\t\tthis.dragging.enable();\r\n \t\t\t}\r\n \t\t}\r\n \t},\r\n\r\n \t// @method setOpacity(opacity: Number): this\r\n \t// Changes the opacity of the marker.\r\n \tsetOpacity: function (opacity) {\r\n \t\tthis.options.opacity = opacity;\r\n \t\tif (this._map) {\r\n \t\t\tthis._updateOpacity();\r\n \t\t}\r\n\r\n \t\treturn this;\r\n \t},\r\n\r\n \t_updateOpacity: function () {\r\n \t\tvar opacity = this.options.opacity;\r\n\r\n \t\tif (this._icon) {\r\n \t\t\tsetOpacity(this._icon, opacity);\r\n \t\t}\r\n\r\n \t\tif (this._shadow) {\r\n \t\t\tsetOpacity(this._shadow, opacity);\r\n \t\t}\r\n \t},\r\n\r\n \t_bringToFront: function () {\r\n \t\tthis._updateZIndex(this.options.riseOffset);\r\n \t},\r\n\r\n \t_resetZIndex: function () {\r\n \t\tthis._updateZIndex(0);\r\n \t},\r\n\r\n \t_getPopupAnchor: function () {\r\n \t\treturn this.options.icon.options.popupAnchor;\r\n \t},\r\n\r\n \t_getTooltipAnchor: function () {\r\n \t\treturn this.options.icon.options.tooltipAnchor;\r\n \t}\r\n });\r\n\r\n\r\n // factory L.marker(latlng: LatLng, options? : Marker options)\r\n\r\n // @factory L.marker(latlng: LatLng, options? : Marker options)\r\n // Instantiates a Marker object given a geographical point and optionally an options object.\r\n function marker(latlng, options) {\r\n \treturn new Marker(latlng, options);\r\n }\n\n /*\n * @class Path\n * @aka L.Path\n * @inherits Interactive layer\n *\n * An abstract class that contains options and constants shared between vector\n * overlays (Polygon, Polyline, Circle). Do not use it directly. Extends `Layer`.\n */\n\n var Path = Layer.extend({\n\n \t// @section\n \t// @aka Path options\n \toptions: {\n \t\t// @option stroke: Boolean = true\n \t\t// Whether to draw stroke along the path. Set it to `false` to disable borders on polygons or circles.\n \t\tstroke: true,\n\n \t\t// @option color: String = '#3388ff'\n \t\t// Stroke color\n \t\tcolor: '#3388ff',\n\n \t\t// @option weight: Number = 3\n \t\t// Stroke width in pixels\n \t\tweight: 3,\n\n \t\t// @option opacity: Number = 1.0\n \t\t// Stroke opacity\n \t\topacity: 1,\n\n \t\t// @option lineCap: String= 'round'\n \t\t// A string that defines [shape to be used at the end](https://developer.mozilla.org/docs/Web/SVG/Attribute/stroke-linecap) of the stroke.\n \t\tlineCap: 'round',\n\n \t\t// @option lineJoin: String = 'round'\n \t\t// A string that defines [shape to be used at the corners](https://developer.mozilla.org/docs/Web/SVG/Attribute/stroke-linejoin) of the stroke.\n \t\tlineJoin: 'round',\n\n \t\t// @option dashArray: String = null\n \t\t// A string that defines the stroke [dash pattern](https://developer.mozilla.org/docs/Web/SVG/Attribute/stroke-dasharray). Doesn't work on `Canvas`-powered layers in [some old browsers](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/setLineDash#Browser_compatibility).\n \t\tdashArray: null,\n\n \t\t// @option dashOffset: String = null\n \t\t// A string that defines the [distance into the dash pattern to start the dash](https://developer.mozilla.org/docs/Web/SVG/Attribute/stroke-dashoffset). Doesn't work on `Canvas`-powered layers in [some old browsers](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/setLineDash#Browser_compatibility).\n \t\tdashOffset: null,\n\n \t\t// @option fill: Boolean = depends\n \t\t// Whether to fill the path with color. Set it to `false` to disable filling on polygons or circles.\n \t\tfill: false,\n\n \t\t// @option fillColor: String = *\n \t\t// Fill color. Defaults to the value of the [`color`](#path-color) option\n \t\tfillColor: null,\n\n \t\t// @option fillOpacity: Number = 0.2\n \t\t// Fill opacity.\n \t\tfillOpacity: 0.2,\n\n \t\t// @option fillRule: String = 'evenodd'\n \t\t// A string that defines [how the inside of a shape](https://developer.mozilla.org/docs/Web/SVG/Attribute/fill-rule) is determined.\n \t\tfillRule: 'evenodd',\n\n \t\t// className: '',\n\n \t\t// Option inherited from \"Interactive layer\" abstract class\n \t\tinteractive: true,\n\n \t\t// @option bubblingMouseEvents: Boolean = true\n \t\t// When `true`, a mouse event on this path will trigger the same event on the map\n \t\t// (unless [`L.DomEvent.stopPropagation`](#domevent-stoppropagation) is used).\n \t\tbubblingMouseEvents: true\n \t},\n\n \tbeforeAdd: function (map) {\n \t\t// Renderer is set here because we need to call renderer.getEvents\n \t\t// before this.getEvents.\n \t\tthis._renderer = map.getRenderer(this);\n \t},\n\n \tonAdd: function () {\n \t\tthis._renderer._initPath(this);\n \t\tthis._reset();\n \t\tthis._renderer._addPath(this);\n \t},\n\n \tonRemove: function () {\n \t\tthis._renderer._removePath(this);\n \t},\n\n \t// @method redraw(): this\n \t// Redraws the layer. Sometimes useful after you changed the coordinates that the path uses.\n \tredraw: function () {\n \t\tif (this._map) {\n \t\t\tthis._renderer._updatePath(this);\n \t\t}\n \t\treturn this;\n \t},\n\n \t// @method setStyle(style: Path options): this\n \t// Changes the appearance of a Path based on the options in the `Path options` object.\n \tsetStyle: function (style) {\n \t\tsetOptions(this, style);\n \t\tif (this._renderer) {\n \t\t\tthis._renderer._updateStyle(this);\n \t\t\tif (this.options.stroke && style && Object.prototype.hasOwnProperty.call(style, 'weight')) {\n \t\t\t\tthis._updateBounds();\n \t\t\t}\n \t\t}\n \t\treturn this;\n \t},\n\n \t// @method bringToFront(): this\n \t// Brings the layer to the top of all path layers.\n \tbringToFront: function () {\n \t\tif (this._renderer) {\n \t\t\tthis._renderer._bringToFront(this);\n \t\t}\n \t\treturn this;\n \t},\n\n \t// @method bringToBack(): this\n \t// Brings the layer to the bottom of all path layers.\n \tbringToBack: function () {\n \t\tif (this._renderer) {\n \t\t\tthis._renderer._bringToBack(this);\n \t\t}\n \t\treturn this;\n \t},\n\n \tgetElement: function () {\n \t\treturn this._path;\n \t},\n\n \t_reset: function () {\n \t\t// defined in child classes\n \t\tthis._project();\n \t\tthis._update();\n \t},\n\n \t_clickTolerance: function () {\n \t\t// used when doing hit detection for Canvas layers\n \t\treturn (this.options.stroke ? this.options.weight / 2 : 0) + this._renderer.options.tolerance;\n \t}\n });\n\n /*\n * @class CircleMarker\n * @aka L.CircleMarker\n * @inherits Path\n *\n * A circle of a fixed size with radius specified in pixels. Extends `Path`.\n */\n\n var CircleMarker = Path.extend({\n\n \t// @section\n \t// @aka CircleMarker options\n \toptions: {\n \t\tfill: true,\n\n \t\t// @option radius: Number = 10\n \t\t// Radius of the circle marker, in pixels\n \t\tradius: 10\n \t},\n\n \tinitialize: function (latlng, options) {\n \t\tsetOptions(this, options);\n \t\tthis._latlng = toLatLng(latlng);\n \t\tthis._radius = this.options.radius;\n \t},\n\n \t// @method setLatLng(latLng: LatLng): this\n \t// Sets the position of a circle marker to a new location.\n \tsetLatLng: function (latlng) {\n \t\tvar oldLatLng = this._latlng;\n \t\tthis._latlng = toLatLng(latlng);\n \t\tthis.redraw();\n\n \t\t// @event move: Event\n \t\t// Fired when the marker is moved via [`setLatLng`](#circlemarker-setlatlng). Old and new coordinates are included in event arguments as `oldLatLng`, `latlng`.\n \t\treturn this.fire('move', {oldLatLng: oldLatLng, latlng: this._latlng});\n \t},\n\n \t// @method getLatLng(): LatLng\n \t// Returns the current geographical position of the circle marker\n \tgetLatLng: function () {\n \t\treturn this._latlng;\n \t},\n\n \t// @method setRadius(radius: Number): this\n \t// Sets the radius of a circle marker. Units are in pixels.\n \tsetRadius: function (radius) {\n \t\tthis.options.radius = this._radius = radius;\n \t\treturn this.redraw();\n \t},\n\n \t// @method getRadius(): Number\n \t// Returns the current radius of the circle\n \tgetRadius: function () {\n \t\treturn this._radius;\n \t},\n\n \tsetStyle : function (options) {\n \t\tvar radius = options && options.radius || this._radius;\n \t\tPath.prototype.setStyle.call(this, options);\n \t\tthis.setRadius(radius);\n \t\treturn this;\n \t},\n\n \t_project: function () {\n \t\tthis._point = this._map.latLngToLayerPoint(this._latlng);\n \t\tthis._updateBounds();\n \t},\n\n \t_updateBounds: function () {\n \t\tvar r = this._radius,\n \t\t r2 = this._radiusY || r,\n \t\t w = this._clickTolerance(),\n \t\t p = [r + w, r2 + w];\n \t\tthis._pxBounds = new Bounds(this._point.subtract(p), this._point.add(p));\n \t},\n\n \t_update: function () {\n \t\tif (this._map) {\n \t\t\tthis._updatePath();\n \t\t}\n \t},\n\n \t_updatePath: function () {\n \t\tthis._renderer._updateCircle(this);\n \t},\n\n \t_empty: function () {\n \t\treturn this._radius && !this._renderer._bounds.intersects(this._pxBounds);\n \t},\n\n \t// Needed by the `Canvas` renderer for interactivity\n \t_containsPoint: function (p) {\n \t\treturn p.distanceTo(this._point) <= this._radius + this._clickTolerance();\n \t}\n });\n\n\n // @factory L.circleMarker(latlng: LatLng, options?: CircleMarker options)\n // Instantiates a circle marker object given a geographical point, and an optional options object.\n function circleMarker(latlng, options) {\n \treturn new CircleMarker(latlng, options);\n }\n\n /*\n * @class Circle\n * @aka L.Circle\n * @inherits CircleMarker\n *\n * A class for drawing circle overlays on a map. Extends `CircleMarker`.\n *\n * It's an approximation and starts to diverge from a real circle closer to poles (due to projection distortion).\n *\n * @example\n *\n * ```js\n * L.circle([50.5, 30.5], {radius: 200}).addTo(map);\n * ```\n */\n\n var Circle = CircleMarker.extend({\n\n \tinitialize: function (latlng, options, legacyOptions) {\n \t\tif (typeof options === 'number') {\n \t\t\t// Backwards compatibility with 0.7.x factory (latlng, radius, options?)\n \t\t\toptions = extend({}, legacyOptions, {radius: options});\n \t\t}\n \t\tsetOptions(this, options);\n \t\tthis._latlng = toLatLng(latlng);\n\n \t\tif (isNaN(this.options.radius)) { throw new Error('Circle radius cannot be NaN'); }\n\n \t\t// @section\n \t\t// @aka Circle options\n \t\t// @option radius: Number; Radius of the circle, in meters.\n \t\tthis._mRadius = this.options.radius;\n \t},\n\n \t// @method setRadius(radius: Number): this\n \t// Sets the radius of a circle. Units are in meters.\n \tsetRadius: function (radius) {\n \t\tthis._mRadius = radius;\n \t\treturn this.redraw();\n \t},\n\n \t// @method getRadius(): Number\n \t// Returns the current radius of a circle. Units are in meters.\n \tgetRadius: function () {\n \t\treturn this._mRadius;\n \t},\n\n \t// @method getBounds(): LatLngBounds\n \t// Returns the `LatLngBounds` of the path.\n \tgetBounds: function () {\n \t\tvar half = [this._radius, this._radiusY || this._radius];\n\n \t\treturn new LatLngBounds(\n \t\t\tthis._map.layerPointToLatLng(this._point.subtract(half)),\n \t\t\tthis._map.layerPointToLatLng(this._point.add(half)));\n \t},\n\n \tsetStyle: Path.prototype.setStyle,\n\n \t_project: function () {\n\n \t\tvar lng = this._latlng.lng,\n \t\t lat = this._latlng.lat,\n \t\t map = this._map,\n \t\t crs = map.options.crs;\n\n \t\tif (crs.distance === Earth.distance) {\n \t\t\tvar d = Math.PI / 180,\n \t\t\t latR = (this._mRadius / Earth.R) / d,\n \t\t\t top = map.project([lat + latR, lng]),\n \t\t\t bottom = map.project([lat - latR, lng]),\n \t\t\t p = top.add(bottom).divideBy(2),\n \t\t\t lat2 = map.unproject(p).lat,\n \t\t\t lngR = Math.acos((Math.cos(latR * d) - Math.sin(lat * d) * Math.sin(lat2 * d)) /\n \t\t\t (Math.cos(lat * d) * Math.cos(lat2 * d))) / d;\n\n \t\t\tif (isNaN(lngR) || lngR === 0) {\n \t\t\t\tlngR = latR / Math.cos(Math.PI / 180 * lat); // Fallback for edge case, #2425\n \t\t\t}\n\n \t\t\tthis._point = p.subtract(map.getPixelOrigin());\n \t\t\tthis._radius = isNaN(lngR) ? 0 : p.x - map.project([lat2, lng - lngR]).x;\n \t\t\tthis._radiusY = p.y - top.y;\n\n \t\t} else {\n \t\t\tvar latlng2 = crs.unproject(crs.project(this._latlng).subtract([this._mRadius, 0]));\n\n \t\t\tthis._point = map.latLngToLayerPoint(this._latlng);\n \t\t\tthis._radius = this._point.x - map.latLngToLayerPoint(latlng2).x;\n \t\t}\n\n \t\tthis._updateBounds();\n \t}\n });\n\n // @factory L.circle(latlng: LatLng, options?: Circle options)\n // Instantiates a circle object given a geographical point, and an options object\n // which contains the circle radius.\n // @alternative\n // @factory L.circle(latlng: LatLng, radius: Number, options?: Circle options)\n // Obsolete way of instantiating a circle, for compatibility with 0.7.x code.\n // Do not use in new applications or plugins.\n function circle(latlng, options, legacyOptions) {\n \treturn new Circle(latlng, options, legacyOptions);\n }\n\n /*\n * @class Polyline\n * @aka L.Polyline\n * @inherits Path\n *\n * A class for drawing polyline overlays on a map. Extends `Path`.\n *\n * @example\n *\n * ```js\n * // create a red polyline from an array of LatLng points\n * var latlngs = [\n * \t[45.51, -122.68],\n * \t[37.77, -122.43],\n * \t[34.04, -118.2]\n * ];\n *\n * var polyline = L.polyline(latlngs, {color: 'red'}).addTo(map);\n *\n * // zoom the map to the polyline\n * map.fitBounds(polyline.getBounds());\n * ```\n *\n * You can also pass a multi-dimensional array to represent a `MultiPolyline` shape:\n *\n * ```js\n * // create a red polyline from an array of arrays of LatLng points\n * var latlngs = [\n * \t[[45.51, -122.68],\n * \t [37.77, -122.43],\n * \t [34.04, -118.2]],\n * \t[[40.78, -73.91],\n * \t [41.83, -87.62],\n * \t [32.76, -96.72]]\n * ];\n * ```\n */\n\n\n var Polyline = Path.extend({\n\n \t// @section\n \t// @aka Polyline options\n \toptions: {\n \t\t// @option smoothFactor: Number = 1.0\n \t\t// How much to simplify the polyline on each zoom level. More means\n \t\t// better performance and smoother look, and less means more accurate representation.\n \t\tsmoothFactor: 1.0,\n\n \t\t// @option noClip: Boolean = false\n \t\t// Disable polyline clipping.\n \t\tnoClip: false\n \t},\n\n \tinitialize: function (latlngs, options) {\n \t\tsetOptions(this, options);\n \t\tthis._setLatLngs(latlngs);\n \t},\n\n \t// @method getLatLngs(): LatLng[]\n \t// Returns an array of the points in the path, or nested arrays of points in case of multi-polyline.\n \tgetLatLngs: function () {\n \t\treturn this._latlngs;\n \t},\n\n \t// @method setLatLngs(latlngs: LatLng[]): this\n \t// Replaces all the points in the polyline with the given array of geographical points.\n \tsetLatLngs: function (latlngs) {\n \t\tthis._setLatLngs(latlngs);\n \t\treturn this.redraw();\n \t},\n\n \t// @method isEmpty(): Boolean\n \t// Returns `true` if the Polyline has no LatLngs.\n \tisEmpty: function () {\n \t\treturn !this._latlngs.length;\n \t},\n\n \t// @method closestLayerPoint(p: Point): Point\n \t// Returns the point closest to `p` on the Polyline.\n \tclosestLayerPoint: function (p) {\n \t\tvar minDistance = Infinity,\n \t\t minPoint = null,\n \t\t closest = _sqClosestPointOnSegment,\n \t\t p1, p2;\n\n \t\tfor (var j = 0, jLen = this._parts.length; j < jLen; j++) {\n \t\t\tvar points = this._parts[j];\n\n \t\t\tfor (var i = 1, len = points.length; i < len; i++) {\n \t\t\t\tp1 = points[i - 1];\n \t\t\t\tp2 = points[i];\n\n \t\t\t\tvar sqDist = closest(p, p1, p2, true);\n\n \t\t\t\tif (sqDist < minDistance) {\n \t\t\t\t\tminDistance = sqDist;\n \t\t\t\t\tminPoint = closest(p, p1, p2);\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t\tif (minPoint) {\n \t\t\tminPoint.distance = Math.sqrt(minDistance);\n \t\t}\n \t\treturn minPoint;\n \t},\n\n \t// @method getCenter(): LatLng\n \t// Returns the center ([centroid](http://en.wikipedia.org/wiki/Centroid)) of the polyline.\n \tgetCenter: function () {\n \t\t// throws error when not yet added to map as this center calculation requires projected coordinates\n \t\tif (!this._map) {\n \t\t\tthrow new Error('Must add layer to map before using getCenter()');\n \t\t}\n\n \t\tvar i, halfDist, segDist, dist, p1, p2, ratio,\n \t\t points = this._rings[0],\n \t\t len = points.length;\n\n \t\tif (!len) { return null; }\n\n \t\t// polyline centroid algorithm; only uses the first ring if there are multiple\n\n \t\tfor (i = 0, halfDist = 0; i < len - 1; i++) {\n \t\t\thalfDist += points[i].distanceTo(points[i + 1]) / 2;\n \t\t}\n\n \t\t// The line is so small in the current view that all points are on the same pixel.\n \t\tif (halfDist === 0) {\n \t\t\treturn this._map.layerPointToLatLng(points[0]);\n \t\t}\n\n \t\tfor (i = 0, dist = 0; i < len - 1; i++) {\n \t\t\tp1 = points[i];\n \t\t\tp2 = points[i + 1];\n \t\t\tsegDist = p1.distanceTo(p2);\n \t\t\tdist += segDist;\n\n \t\t\tif (dist > halfDist) {\n \t\t\t\tratio = (dist - halfDist) / segDist;\n \t\t\t\treturn this._map.layerPointToLatLng([\n \t\t\t\t\tp2.x - ratio * (p2.x - p1.x),\n \t\t\t\t\tp2.y - ratio * (p2.y - p1.y)\n \t\t\t\t]);\n \t\t\t}\n \t\t}\n \t},\n\n \t// @method getBounds(): LatLngBounds\n \t// Returns the `LatLngBounds` of the path.\n \tgetBounds: function () {\n \t\treturn this._bounds;\n \t},\n\n \t// @method addLatLng(latlng: LatLng, latlngs?: LatLng[]): this\n \t// Adds a given point to the polyline. By default, adds to the first ring of\n \t// the polyline in case of a multi-polyline, but can be overridden by passing\n \t// a specific ring as a LatLng array (that you can earlier access with [`getLatLngs`](#polyline-getlatlngs)).\n \taddLatLng: function (latlng, latlngs) {\n \t\tlatlngs = latlngs || this._defaultShape();\n \t\tlatlng = toLatLng(latlng);\n \t\tlatlngs.push(latlng);\n \t\tthis._bounds.extend(latlng);\n \t\treturn this.redraw();\n \t},\n\n \t_setLatLngs: function (latlngs) {\n \t\tthis._bounds = new LatLngBounds();\n \t\tthis._latlngs = this._convertLatLngs(latlngs);\n \t},\n\n \t_defaultShape: function () {\n \t\treturn isFlat(this._latlngs) ? this._latlngs : this._latlngs[0];\n \t},\n\n \t// recursively convert latlngs input into actual LatLng instances; calculate bounds along the way\n \t_convertLatLngs: function (latlngs) {\n \t\tvar result = [],\n \t\t flat = isFlat(latlngs);\n\n \t\tfor (var i = 0, len = latlngs.length; i < len; i++) {\n \t\t\tif (flat) {\n \t\t\t\tresult[i] = toLatLng(latlngs[i]);\n \t\t\t\tthis._bounds.extend(result[i]);\n \t\t\t} else {\n \t\t\t\tresult[i] = this._convertLatLngs(latlngs[i]);\n \t\t\t}\n \t\t}\n\n \t\treturn result;\n \t},\n\n \t_project: function () {\n \t\tvar pxBounds = new Bounds();\n \t\tthis._rings = [];\n \t\tthis._projectLatlngs(this._latlngs, this._rings, pxBounds);\n\n \t\tif (this._bounds.isValid() && pxBounds.isValid()) {\n \t\t\tthis._rawPxBounds = pxBounds;\n \t\t\tthis._updateBounds();\n \t\t}\n \t},\n\n \t_updateBounds: function () {\n \t\tvar w = this._clickTolerance(),\n \t\t p = new Point(w, w);\n \t\tthis._pxBounds = new Bounds([\n \t\t\tthis._rawPxBounds.min.subtract(p),\n \t\t\tthis._rawPxBounds.max.add(p)\n \t\t]);\n \t},\n\n \t// recursively turns latlngs into a set of rings with projected coordinates\n \t_projectLatlngs: function (latlngs, result, projectedBounds) {\n \t\tvar flat = latlngs[0] instanceof LatLng,\n \t\t len = latlngs.length,\n \t\t i, ring;\n\n \t\tif (flat) {\n \t\t\tring = [];\n \t\t\tfor (i = 0; i < len; i++) {\n \t\t\t\tring[i] = this._map.latLngToLayerPoint(latlngs[i]);\n \t\t\t\tprojectedBounds.extend(ring[i]);\n \t\t\t}\n \t\t\tresult.push(ring);\n \t\t} else {\n \t\t\tfor (i = 0; i < len; i++) {\n \t\t\t\tthis._projectLatlngs(latlngs[i], result, projectedBounds);\n \t\t\t}\n \t\t}\n \t},\n\n \t// clip polyline by renderer bounds so that we have less to render for performance\n \t_clipPoints: function () {\n \t\tvar bounds = this._renderer._bounds;\n\n \t\tthis._parts = [];\n \t\tif (!this._pxBounds || !this._pxBounds.intersects(bounds)) {\n \t\t\treturn;\n \t\t}\n\n \t\tif (this.options.noClip) {\n \t\t\tthis._parts = this._rings;\n \t\t\treturn;\n \t\t}\n\n \t\tvar parts = this._parts,\n \t\t i, j, k, len, len2, segment, points;\n\n \t\tfor (i = 0, k = 0, len = this._rings.length; i < len; i++) {\n \t\t\tpoints = this._rings[i];\n\n \t\t\tfor (j = 0, len2 = points.length; j < len2 - 1; j++) {\n \t\t\t\tsegment = clipSegment(points[j], points[j + 1], bounds, j, true);\n\n \t\t\t\tif (!segment) { continue; }\n\n \t\t\t\tparts[k] = parts[k] || [];\n \t\t\t\tparts[k].push(segment[0]);\n\n \t\t\t\t// if segment goes out of screen, or it's the last one, it's the end of the line part\n \t\t\t\tif ((segment[1] !== points[j + 1]) || (j === len2 - 2)) {\n \t\t\t\t\tparts[k].push(segment[1]);\n \t\t\t\t\tk++;\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t},\n\n \t// simplify each clipped part of the polyline for performance\n \t_simplifyPoints: function () {\n \t\tvar parts = this._parts,\n \t\t tolerance = this.options.smoothFactor;\n\n \t\tfor (var i = 0, len = parts.length; i < len; i++) {\n \t\t\tparts[i] = simplify(parts[i], tolerance);\n \t\t}\n \t},\n\n \t_update: function () {\n \t\tif (!this._map) { return; }\n\n \t\tthis._clipPoints();\n \t\tthis._simplifyPoints();\n \t\tthis._updatePath();\n \t},\n\n \t_updatePath: function () {\n \t\tthis._renderer._updatePoly(this);\n \t},\n\n \t// Needed by the `Canvas` renderer for interactivity\n \t_containsPoint: function (p, closed) {\n \t\tvar i, j, k, len, len2, part,\n \t\t w = this._clickTolerance();\n\n \t\tif (!this._pxBounds || !this._pxBounds.contains(p)) { return false; }\n\n \t\t// hit detection for polylines\n \t\tfor (i = 0, len = this._parts.length; i < len; i++) {\n \t\t\tpart = this._parts[i];\n\n \t\t\tfor (j = 0, len2 = part.length, k = len2 - 1; j < len2; k = j++) {\n \t\t\t\tif (!closed && (j === 0)) { continue; }\n\n \t\t\t\tif (pointToSegmentDistance(p, part[k], part[j]) <= w) {\n \t\t\t\t\treturn true;\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t\treturn false;\n \t}\n });\n\n // @factory L.polyline(latlngs: LatLng[], options?: Polyline options)\n // Instantiates a polyline object given an array of geographical points and\n // optionally an options object. You can create a `Polyline` object with\n // multiple separate lines (`MultiPolyline`) by passing an array of arrays\n // of geographic points.\n function polyline(latlngs, options) {\n \treturn new Polyline(latlngs, options);\n }\n\n // Retrocompat. Allow plugins to support Leaflet versions before and after 1.1.\n Polyline._flat = _flat;\n\n /*\n * @class Polygon\n * @aka L.Polygon\n * @inherits Polyline\n *\n * A class for drawing polygon overlays on a map. Extends `Polyline`.\n *\n * Note that points you pass when creating a polygon shouldn't have an additional last point equal to the first one — it's better to filter out such points.\n *\n *\n * @example\n *\n * ```js\n * // create a red polygon from an array of LatLng points\n * var latlngs = [[37, -109.05],[41, -109.03],[41, -102.05],[37, -102.04]];\n *\n * var polygon = L.polygon(latlngs, {color: 'red'}).addTo(map);\n *\n * // zoom the map to the polygon\n * map.fitBounds(polygon.getBounds());\n * ```\n *\n * You can also pass an array of arrays of latlngs, with the first array representing the outer shape and the other arrays representing holes in the outer shape:\n *\n * ```js\n * var latlngs = [\n * [[37, -109.05],[41, -109.03],[41, -102.05],[37, -102.04]], // outer ring\n * [[37.29, -108.58],[40.71, -108.58],[40.71, -102.50],[37.29, -102.50]] // hole\n * ];\n * ```\n *\n * Additionally, you can pass a multi-dimensional array to represent a MultiPolygon shape.\n *\n * ```js\n * var latlngs = [\n * [ // first polygon\n * [[37, -109.05],[41, -109.03],[41, -102.05],[37, -102.04]], // outer ring\n * [[37.29, -108.58],[40.71, -108.58],[40.71, -102.50],[37.29, -102.50]] // hole\n * ],\n * [ // second polygon\n * [[41, -111.03],[45, -111.04],[45, -104.05],[41, -104.05]]\n * ]\n * ];\n * ```\n */\n\n var Polygon = Polyline.extend({\n\n \toptions: {\n \t\tfill: true\n \t},\n\n \tisEmpty: function () {\n \t\treturn !this._latlngs.length || !this._latlngs[0].length;\n \t},\n\n \tgetCenter: function () {\n \t\t// throws error when not yet added to map as this center calculation requires projected coordinates\n \t\tif (!this._map) {\n \t\t\tthrow new Error('Must add layer to map before using getCenter()');\n \t\t}\n\n \t\tvar i, j, p1, p2, f, area, x, y, center,\n \t\t points = this._rings[0],\n \t\t len = points.length;\n\n \t\tif (!len) { return null; }\n\n \t\t// polygon centroid algorithm; only uses the first ring if there are multiple\n\n \t\tarea = x = y = 0;\n\n \t\tfor (i = 0, j = len - 1; i < len; j = i++) {\n \t\t\tp1 = points[i];\n \t\t\tp2 = points[j];\n\n \t\t\tf = p1.y * p2.x - p2.y * p1.x;\n \t\t\tx += (p1.x + p2.x) * f;\n \t\t\ty += (p1.y + p2.y) * f;\n \t\t\tarea += f * 3;\n \t\t}\n\n \t\tif (area === 0) {\n \t\t\t// Polygon is so small that all points are on same pixel.\n \t\t\tcenter = points[0];\n \t\t} else {\n \t\t\tcenter = [x / area, y / area];\n \t\t}\n \t\treturn this._map.layerPointToLatLng(center);\n \t},\n\n \t_convertLatLngs: function (latlngs) {\n \t\tvar result = Polyline.prototype._convertLatLngs.call(this, latlngs),\n \t\t len = result.length;\n\n \t\t// remove last point if it equals first one\n \t\tif (len >= 2 && result[0] instanceof LatLng && result[0].equals(result[len - 1])) {\n \t\t\tresult.pop();\n \t\t}\n \t\treturn result;\n \t},\n\n \t_setLatLngs: function (latlngs) {\n \t\tPolyline.prototype._setLatLngs.call(this, latlngs);\n \t\tif (isFlat(this._latlngs)) {\n \t\t\tthis._latlngs = [this._latlngs];\n \t\t}\n \t},\n\n \t_defaultShape: function () {\n \t\treturn isFlat(this._latlngs[0]) ? this._latlngs[0] : this._latlngs[0][0];\n \t},\n\n \t_clipPoints: function () {\n \t\t// polygons need a different clipping algorithm so we redefine that\n\n \t\tvar bounds = this._renderer._bounds,\n \t\t w = this.options.weight,\n \t\t p = new Point(w, w);\n\n \t\t// increase clip padding by stroke width to avoid stroke on clip edges\n \t\tbounds = new Bounds(bounds.min.subtract(p), bounds.max.add(p));\n\n \t\tthis._parts = [];\n \t\tif (!this._pxBounds || !this._pxBounds.intersects(bounds)) {\n \t\t\treturn;\n \t\t}\n\n \t\tif (this.options.noClip) {\n \t\t\tthis._parts = this._rings;\n \t\t\treturn;\n \t\t}\n\n \t\tfor (var i = 0, len = this._rings.length, clipped; i < len; i++) {\n \t\t\tclipped = clipPolygon(this._rings[i], bounds, true);\n \t\t\tif (clipped.length) {\n \t\t\t\tthis._parts.push(clipped);\n \t\t\t}\n \t\t}\n \t},\n\n \t_updatePath: function () {\n \t\tthis._renderer._updatePoly(this, true);\n \t},\n\n \t// Needed by the `Canvas` renderer for interactivity\n \t_containsPoint: function (p) {\n \t\tvar inside = false,\n \t\t part, p1, p2, i, j, k, len, len2;\n\n \t\tif (!this._pxBounds || !this._pxBounds.contains(p)) { return false; }\n\n \t\t// ray casting algorithm for detecting if point is in polygon\n \t\tfor (i = 0, len = this._parts.length; i < len; i++) {\n \t\t\tpart = this._parts[i];\n\n \t\t\tfor (j = 0, len2 = part.length, k = len2 - 1; j < len2; k = j++) {\n \t\t\t\tp1 = part[j];\n \t\t\t\tp2 = part[k];\n\n \t\t\t\tif (((p1.y > p.y) !== (p2.y > p.y)) && (p.x < (p2.x - p1.x) * (p.y - p1.y) / (p2.y - p1.y) + p1.x)) {\n \t\t\t\t\tinside = !inside;\n \t\t\t\t}\n \t\t\t}\n \t\t}\n\n \t\t// also check if it's on polygon stroke\n \t\treturn inside || Polyline.prototype._containsPoint.call(this, p, true);\n \t}\n\n });\n\n\n // @factory L.polygon(latlngs: LatLng[], options?: Polyline options)\n function polygon(latlngs, options) {\n \treturn new Polygon(latlngs, options);\n }\n\n /*\r\n * @class GeoJSON\r\n * @aka L.GeoJSON\r\n * @inherits FeatureGroup\r\n *\r\n * Represents a GeoJSON object or an array of GeoJSON objects. Allows you to parse\r\n * GeoJSON data and display it on the map. Extends `FeatureGroup`.\r\n *\r\n * @example\r\n *\r\n * ```js\r\n * L.geoJSON(data, {\r\n * \tstyle: function (feature) {\r\n * \t\treturn {color: feature.properties.color};\r\n * \t}\r\n * }).bindPopup(function (layer) {\r\n * \treturn layer.feature.properties.description;\r\n * }).addTo(map);\r\n * ```\r\n */\r\n\r\n var GeoJSON = FeatureGroup.extend({\r\n\r\n \t/* @section\r\n \t * @aka GeoJSON options\r\n \t *\r\n \t * @option pointToLayer: Function = *\r\n \t * A `Function` defining how GeoJSON points spawn Leaflet layers. It is internally\r\n \t * called when data is added, passing the GeoJSON point feature and its `LatLng`.\r\n \t * The default is to spawn a default `Marker`:\r\n \t * ```js\r\n \t * function(geoJsonPoint, latlng) {\r\n \t * \treturn L.marker(latlng);\r\n \t * }\r\n \t * ```\r\n \t *\r\n \t * @option style: Function = *\r\n \t * A `Function` defining the `Path options` for styling GeoJSON lines and polygons,\r\n \t * called internally when data is added.\r\n \t * The default value is to not override any defaults:\r\n \t * ```js\r\n \t * function (geoJsonFeature) {\r\n \t * \treturn {}\r\n \t * }\r\n \t * ```\r\n \t *\r\n \t * @option onEachFeature: Function = *\r\n \t * A `Function` that will be called once for each created `Feature`, after it has\r\n \t * been created and styled. Useful for attaching events and popups to features.\r\n \t * The default is to do nothing with the newly created layers:\r\n \t * ```js\r\n \t * function (feature, layer) {}\r\n \t * ```\r\n \t *\r\n \t * @option filter: Function = *\r\n \t * A `Function` that will be used to decide whether to include a feature or not.\r\n \t * The default is to include all features:\r\n \t * ```js\r\n \t * function (geoJsonFeature) {\r\n \t * \treturn true;\r\n \t * }\r\n \t * ```\r\n \t * Note: dynamically changing the `filter` option will have effect only on newly\r\n \t * added data. It will _not_ re-evaluate already included features.\r\n \t *\r\n \t * @option coordsToLatLng: Function = *\r\n \t * A `Function` that will be used for converting GeoJSON coordinates to `LatLng`s.\r\n \t * The default is the `coordsToLatLng` static method.\r\n \t *\r\n \t * @option markersInheritOptions: Boolean = false\r\n \t * Whether default Markers for \"Point\" type Features inherit from group options.\r\n \t */\r\n\r\n \tinitialize: function (geojson, options) {\r\n \t\tsetOptions(this, options);\r\n\r\n \t\tthis._layers = {};\r\n\r\n \t\tif (geojson) {\r\n \t\t\tthis.addData(geojson);\r\n \t\t}\r\n \t},\r\n\r\n \t// @method addData( data ): this\r\n \t// Adds a GeoJSON object to the layer.\r\n \taddData: function (geojson) {\r\n \t\tvar features = isArray(geojson) ? geojson : geojson.features,\r\n \t\t i, len, feature;\r\n\r\n \t\tif (features) {\r\n \t\t\tfor (i = 0, len = features.length; i < len; i++) {\r\n \t\t\t\t// only add this if geometry or geometries are set and not null\r\n \t\t\t\tfeature = features[i];\r\n \t\t\t\tif (feature.geometries || feature.geometry || feature.features || feature.coordinates) {\r\n \t\t\t\t\tthis.addData(feature);\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t\treturn this;\r\n \t\t}\r\n\r\n \t\tvar options = this.options;\r\n\r\n \t\tif (options.filter && !options.filter(geojson)) { return this; }\r\n\r\n \t\tvar layer = geometryToLayer(geojson, options);\r\n \t\tif (!layer) {\r\n \t\t\treturn this;\r\n \t\t}\r\n \t\tlayer.feature = asFeature(geojson);\r\n\r\n \t\tlayer.defaultOptions = layer.options;\r\n \t\tthis.resetStyle(layer);\r\n\r\n \t\tif (options.onEachFeature) {\r\n \t\t\toptions.onEachFeature(geojson, layer);\r\n \t\t}\r\n\r\n \t\treturn this.addLayer(layer);\r\n \t},\r\n\r\n \t// @method resetStyle( layer? ): this\r\n \t// Resets the given vector layer's style to the original GeoJSON style, useful for resetting style after hover events.\r\n \t// If `layer` is omitted, the style of all features in the current layer is reset.\r\n \tresetStyle: function (layer) {\r\n \t\tif (layer === undefined) {\r\n \t\t\treturn this.eachLayer(this.resetStyle, this);\r\n \t\t}\r\n \t\t// reset any custom styles\r\n \t\tlayer.options = extend({}, layer.defaultOptions);\r\n \t\tthis._setLayerStyle(layer, this.options.style);\r\n \t\treturn this;\r\n \t},\r\n\r\n \t// @method setStyle( style ): this\r\n \t// Changes styles of GeoJSON vector layers with the given style function.\r\n \tsetStyle: function (style) {\r\n \t\treturn this.eachLayer(function (layer) {\r\n \t\t\tthis._setLayerStyle(layer, style);\r\n \t\t}, this);\r\n \t},\r\n\r\n \t_setLayerStyle: function (layer, style) {\r\n \t\tif (layer.setStyle) {\r\n \t\t\tif (typeof style === 'function') {\r\n \t\t\t\tstyle = style(layer.feature);\r\n \t\t\t}\r\n \t\t\tlayer.setStyle(style);\r\n \t\t}\r\n \t}\r\n });\r\n\r\n // @section\r\n // There are several static functions which can be called without instantiating L.GeoJSON:\r\n\r\n // @function geometryToLayer(featureData: Object, options?: GeoJSON options): Layer\r\n // Creates a `Layer` from a given GeoJSON feature. Can use a custom\r\n // [`pointToLayer`](#geojson-pointtolayer) and/or [`coordsToLatLng`](#geojson-coordstolatlng)\r\n // functions if provided as options.\r\n function geometryToLayer(geojson, options) {\r\n\r\n \tvar geometry = geojson.type === 'Feature' ? geojson.geometry : geojson,\r\n \t coords = geometry ? geometry.coordinates : null,\r\n \t layers = [],\r\n \t pointToLayer = options && options.pointToLayer,\r\n \t _coordsToLatLng = options && options.coordsToLatLng || coordsToLatLng,\r\n \t latlng, latlngs, i, len;\r\n\r\n \tif (!coords && !geometry) {\r\n \t\treturn null;\r\n \t}\r\n\r\n \tswitch (geometry.type) {\r\n \tcase 'Point':\r\n \t\tlatlng = _coordsToLatLng(coords);\r\n \t\treturn _pointToLayer(pointToLayer, geojson, latlng, options);\r\n\r\n \tcase 'MultiPoint':\r\n \t\tfor (i = 0, len = coords.length; i < len; i++) {\r\n \t\t\tlatlng = _coordsToLatLng(coords[i]);\r\n \t\t\tlayers.push(_pointToLayer(pointToLayer, geojson, latlng, options));\r\n \t\t}\r\n \t\treturn new FeatureGroup(layers);\r\n\r\n \tcase 'LineString':\r\n \tcase 'MultiLineString':\r\n \t\tlatlngs = coordsToLatLngs(coords, geometry.type === 'LineString' ? 0 : 1, _coordsToLatLng);\r\n \t\treturn new Polyline(latlngs, options);\r\n\r\n \tcase 'Polygon':\r\n \tcase 'MultiPolygon':\r\n \t\tlatlngs = coordsToLatLngs(coords, geometry.type === 'Polygon' ? 1 : 2, _coordsToLatLng);\r\n \t\treturn new Polygon(latlngs, options);\r\n\r\n \tcase 'GeometryCollection':\r\n \t\tfor (i = 0, len = geometry.geometries.length; i < len; i++) {\r\n \t\t\tvar layer = geometryToLayer({\r\n \t\t\t\tgeometry: geometry.geometries[i],\r\n \t\t\t\ttype: 'Feature',\r\n \t\t\t\tproperties: geojson.properties\r\n \t\t\t}, options);\r\n\r\n \t\t\tif (layer) {\r\n \t\t\t\tlayers.push(layer);\r\n \t\t\t}\r\n \t\t}\r\n \t\treturn new FeatureGroup(layers);\r\n\r\n \tdefault:\r\n \t\tthrow new Error('Invalid GeoJSON object.');\r\n \t}\r\n }\r\n\r\n function _pointToLayer(pointToLayerFn, geojson, latlng, options) {\r\n \treturn pointToLayerFn ?\r\n \t\tpointToLayerFn(geojson, latlng) :\r\n \t\tnew Marker(latlng, options && options.markersInheritOptions && options);\r\n }\r\n\r\n // @function coordsToLatLng(coords: Array): LatLng\r\n // Creates a `LatLng` object from an array of 2 numbers (longitude, latitude)\r\n // or 3 numbers (longitude, latitude, altitude) used in GeoJSON for points.\r\n function coordsToLatLng(coords) {\r\n \treturn new LatLng(coords[1], coords[0], coords[2]);\r\n }\r\n\r\n // @function coordsToLatLngs(coords: Array, levelsDeep?: Number, coordsToLatLng?: Function): Array\r\n // Creates a multidimensional array of `LatLng`s from a GeoJSON coordinates array.\r\n // `levelsDeep` specifies the nesting level (0 is for an array of points, 1 for an array of arrays of points, etc., 0 by default).\r\n // Can use a custom [`coordsToLatLng`](#geojson-coordstolatlng) function.\r\n function coordsToLatLngs(coords, levelsDeep, _coordsToLatLng) {\r\n \tvar latlngs = [];\r\n\r\n \tfor (var i = 0, len = coords.length, latlng; i < len; i++) {\r\n \t\tlatlng = levelsDeep ?\r\n \t\t\tcoordsToLatLngs(coords[i], levelsDeep - 1, _coordsToLatLng) :\r\n \t\t\t(_coordsToLatLng || coordsToLatLng)(coords[i]);\r\n\r\n \t\tlatlngs.push(latlng);\r\n \t}\r\n\r\n \treturn latlngs;\r\n }\r\n\r\n // @function latLngToCoords(latlng: LatLng, precision?: Number): Array\r\n // Reverse of [`coordsToLatLng`](#geojson-coordstolatlng)\r\n function latLngToCoords(latlng, precision) {\r\n \tprecision = typeof precision === 'number' ? precision : 6;\r\n \treturn latlng.alt !== undefined ?\r\n \t\t[formatNum(latlng.lng, precision), formatNum(latlng.lat, precision), formatNum(latlng.alt, precision)] :\r\n \t\t[formatNum(latlng.lng, precision), formatNum(latlng.lat, precision)];\r\n }\r\n\r\n // @function latLngsToCoords(latlngs: Array, levelsDeep?: Number, closed?: Boolean): Array\r\n // Reverse of [`coordsToLatLngs`](#geojson-coordstolatlngs)\r\n // `closed` determines whether the first point should be appended to the end of the array to close the feature, only used when `levelsDeep` is 0. False by default.\r\n function latLngsToCoords(latlngs, levelsDeep, closed, precision) {\r\n \tvar coords = [];\r\n\r\n \tfor (var i = 0, len = latlngs.length; i < len; i++) {\r\n \t\tcoords.push(levelsDeep ?\r\n \t\t\tlatLngsToCoords(latlngs[i], levelsDeep - 1, closed, precision) :\r\n \t\t\tlatLngToCoords(latlngs[i], precision));\r\n \t}\r\n\r\n \tif (!levelsDeep && closed) {\r\n \t\tcoords.push(coords[0]);\r\n \t}\r\n\r\n \treturn coords;\r\n }\r\n\r\n function getFeature(layer, newGeometry) {\r\n \treturn layer.feature ?\r\n \t\textend({}, layer.feature, {geometry: newGeometry}) :\r\n \t\tasFeature(newGeometry);\r\n }\r\n\r\n // @function asFeature(geojson: Object): Object\r\n // Normalize GeoJSON geometries/features into GeoJSON features.\r\n function asFeature(geojson) {\r\n \tif (geojson.type === 'Feature' || geojson.type === 'FeatureCollection') {\r\n \t\treturn geojson;\r\n \t}\r\n\r\n \treturn {\r\n \t\ttype: 'Feature',\r\n \t\tproperties: {},\r\n \t\tgeometry: geojson\r\n \t};\r\n }\r\n\r\n var PointToGeoJSON = {\r\n \ttoGeoJSON: function (precision) {\r\n \t\treturn getFeature(this, {\r\n \t\t\ttype: 'Point',\r\n \t\t\tcoordinates: latLngToCoords(this.getLatLng(), precision)\r\n \t\t});\r\n \t}\r\n };\r\n\r\n // @namespace Marker\r\n // @section Other methods\r\n // @method toGeoJSON(precision?: Number): Object\r\n // `precision` is the number of decimal places for coordinates.\r\n // The default value is 6 places.\r\n // Returns a [`GeoJSON`](http://en.wikipedia.org/wiki/GeoJSON) representation of the marker (as a GeoJSON `Point` Feature).\r\n Marker.include(PointToGeoJSON);\r\n\r\n // @namespace CircleMarker\r\n // @method toGeoJSON(precision?: Number): Object\r\n // `precision` is the number of decimal places for coordinates.\r\n // The default value is 6 places.\r\n // Returns a [`GeoJSON`](http://en.wikipedia.org/wiki/GeoJSON) representation of the circle marker (as a GeoJSON `Point` Feature).\r\n Circle.include(PointToGeoJSON);\r\n CircleMarker.include(PointToGeoJSON);\r\n\r\n\r\n // @namespace Polyline\r\n // @method toGeoJSON(precision?: Number): Object\r\n // `precision` is the number of decimal places for coordinates.\r\n // The default value is 6 places.\r\n // Returns a [`GeoJSON`](http://en.wikipedia.org/wiki/GeoJSON) representation of the polyline (as a GeoJSON `LineString` or `MultiLineString` Feature).\r\n Polyline.include({\r\n \ttoGeoJSON: function (precision) {\r\n \t\tvar multi = !isFlat(this._latlngs);\r\n\r\n \t\tvar coords = latLngsToCoords(this._latlngs, multi ? 1 : 0, false, precision);\r\n\r\n \t\treturn getFeature(this, {\r\n \t\t\ttype: (multi ? 'Multi' : '') + 'LineString',\r\n \t\t\tcoordinates: coords\r\n \t\t});\r\n \t}\r\n });\r\n\r\n // @namespace Polygon\r\n // @method toGeoJSON(precision?: Number): Object\r\n // `precision` is the number of decimal places for coordinates.\r\n // The default value is 6 places.\r\n // Returns a [`GeoJSON`](http://en.wikipedia.org/wiki/GeoJSON) representation of the polygon (as a GeoJSON `Polygon` or `MultiPolygon` Feature).\r\n Polygon.include({\r\n \ttoGeoJSON: function (precision) {\r\n \t\tvar holes = !isFlat(this._latlngs),\r\n \t\t multi = holes && !isFlat(this._latlngs[0]);\r\n\r\n \t\tvar coords = latLngsToCoords(this._latlngs, multi ? 2 : holes ? 1 : 0, true, precision);\r\n\r\n \t\tif (!holes) {\r\n \t\t\tcoords = [coords];\r\n \t\t}\r\n\r\n \t\treturn getFeature(this, {\r\n \t\t\ttype: (multi ? 'Multi' : '') + 'Polygon',\r\n \t\t\tcoordinates: coords\r\n \t\t});\r\n \t}\r\n });\r\n\r\n\r\n // @namespace LayerGroup\r\n LayerGroup.include({\r\n \ttoMultiPoint: function (precision) {\r\n \t\tvar coords = [];\r\n\r\n \t\tthis.eachLayer(function (layer) {\r\n \t\t\tcoords.push(layer.toGeoJSON(precision).geometry.coordinates);\r\n \t\t});\r\n\r\n \t\treturn getFeature(this, {\r\n \t\t\ttype: 'MultiPoint',\r\n \t\t\tcoordinates: coords\r\n \t\t});\r\n \t},\r\n\r\n \t// @method toGeoJSON(precision?: Number): Object\r\n \t// `precision` is the number of decimal places for coordinates.\r\n \t// The default value is 6 places.\r\n \t// Returns a [`GeoJSON`](http://en.wikipedia.org/wiki/GeoJSON) representation of the layer group (as a GeoJSON `FeatureCollection`, `GeometryCollection`, or `MultiPoint`).\r\n \ttoGeoJSON: function (precision) {\r\n\r\n \t\tvar type = this.feature && this.feature.geometry && this.feature.geometry.type;\r\n\r\n \t\tif (type === 'MultiPoint') {\r\n \t\t\treturn this.toMultiPoint(precision);\r\n \t\t}\r\n\r\n \t\tvar isGeometryCollection = type === 'GeometryCollection',\r\n \t\t jsons = [];\r\n\r\n \t\tthis.eachLayer(function (layer) {\r\n \t\t\tif (layer.toGeoJSON) {\r\n \t\t\t\tvar json = layer.toGeoJSON(precision);\r\n \t\t\t\tif (isGeometryCollection) {\r\n \t\t\t\t\tjsons.push(json.geometry);\r\n \t\t\t\t} else {\r\n \t\t\t\t\tvar feature = asFeature(json);\r\n \t\t\t\t\t// Squash nested feature collections\r\n \t\t\t\t\tif (feature.type === 'FeatureCollection') {\r\n \t\t\t\t\t\tjsons.push.apply(jsons, feature.features);\r\n \t\t\t\t\t} else {\r\n \t\t\t\t\t\tjsons.push(feature);\r\n \t\t\t\t\t}\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t});\r\n\r\n \t\tif (isGeometryCollection) {\r\n \t\t\treturn getFeature(this, {\r\n \t\t\t\tgeometries: jsons,\r\n \t\t\t\ttype: 'GeometryCollection'\r\n \t\t\t});\r\n \t\t}\r\n\r\n \t\treturn {\r\n \t\t\ttype: 'FeatureCollection',\r\n \t\t\tfeatures: jsons\r\n \t\t};\r\n \t}\r\n });\r\n\r\n // @namespace GeoJSON\r\n // @factory L.geoJSON(geojson?: Object, options?: GeoJSON options)\r\n // Creates a GeoJSON layer. Optionally accepts an object in\r\n // [GeoJSON format](https://tools.ietf.org/html/rfc7946) to display on the map\r\n // (you can alternatively add it later with `addData` method) and an `options` object.\r\n function geoJSON(geojson, options) {\r\n \treturn new GeoJSON(geojson, options);\r\n }\r\n\r\n // Backward compatibility.\r\n var geoJson = geoJSON;\n\n /*\r\n * @class ImageOverlay\r\n * @aka L.ImageOverlay\r\n * @inherits Interactive layer\r\n *\r\n * Used to load and display a single image over specific bounds of the map. Extends `Layer`.\r\n *\r\n * @example\r\n *\r\n * ```js\r\n * var imageUrl = 'http://www.lib.utexas.edu/maps/historical/newark_nj_1922.jpg',\r\n * \timageBounds = [[40.712216, -74.22655], [40.773941, -74.12544]];\r\n * L.imageOverlay(imageUrl, imageBounds).addTo(map);\r\n * ```\r\n */\r\n\r\n var ImageOverlay = Layer.extend({\r\n\r\n \t// @section\r\n \t// @aka ImageOverlay options\r\n \toptions: {\r\n \t\t// @option opacity: Number = 1.0\r\n \t\t// The opacity of the image overlay.\r\n \t\topacity: 1,\r\n\r\n \t\t// @option alt: String = ''\r\n \t\t// Text for the `alt` attribute of the image (useful for accessibility).\r\n \t\talt: '',\r\n\r\n \t\t// @option interactive: Boolean = false\r\n \t\t// If `true`, the image overlay will emit [mouse events](#interactive-layer) when clicked or hovered.\r\n \t\tinteractive: false,\r\n\r\n \t\t// @option crossOrigin: Boolean|String = false\r\n \t\t// Whether the crossOrigin attribute will be added to the image.\r\n \t\t// If a String is provided, the image will have its crossOrigin attribute set to the String provided. This is needed if you want to access image pixel data.\r\n \t\t// Refer to [CORS Settings](https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes) for valid String values.\r\n \t\tcrossOrigin: false,\r\n\r\n \t\t// @option errorOverlayUrl: String = ''\r\n \t\t// URL to the overlay image to show in place of the overlay that failed to load.\r\n \t\terrorOverlayUrl: '',\r\n\r\n \t\t// @option zIndex: Number = 1\r\n \t\t// The explicit [zIndex](https://developer.mozilla.org/docs/Web/CSS/CSS_Positioning/Understanding_z_index) of the overlay layer.\r\n \t\tzIndex: 1,\r\n\r\n \t\t// @option className: String = ''\r\n \t\t// A custom class name to assign to the image. Empty by default.\r\n \t\tclassName: ''\r\n \t},\r\n\r\n \tinitialize: function (url, bounds, options) { // (String, LatLngBounds, Object)\r\n \t\tthis._url = url;\r\n \t\tthis._bounds = toLatLngBounds(bounds);\r\n\r\n \t\tsetOptions(this, options);\r\n \t},\r\n\r\n \tonAdd: function () {\r\n \t\tif (!this._image) {\r\n \t\t\tthis._initImage();\r\n\r\n \t\t\tif (this.options.opacity < 1) {\r\n \t\t\t\tthis._updateOpacity();\r\n \t\t\t}\r\n \t\t}\r\n\r\n \t\tif (this.options.interactive) {\r\n \t\t\taddClass(this._image, 'leaflet-interactive');\r\n \t\t\tthis.addInteractiveTarget(this._image);\r\n \t\t}\r\n\r\n \t\tthis.getPane().appendChild(this._image);\r\n \t\tthis._reset();\r\n \t},\r\n\r\n \tonRemove: function () {\r\n \t\tremove(this._image);\r\n \t\tif (this.options.interactive) {\r\n \t\t\tthis.removeInteractiveTarget(this._image);\r\n \t\t}\r\n \t},\r\n\r\n \t// @method setOpacity(opacity: Number): this\r\n \t// Sets the opacity of the overlay.\r\n \tsetOpacity: function (opacity) {\r\n \t\tthis.options.opacity = opacity;\r\n\r\n \t\tif (this._image) {\r\n \t\t\tthis._updateOpacity();\r\n \t\t}\r\n \t\treturn this;\r\n \t},\r\n\r\n \tsetStyle: function (styleOpts) {\r\n \t\tif (styleOpts.opacity) {\r\n \t\t\tthis.setOpacity(styleOpts.opacity);\r\n \t\t}\r\n \t\treturn this;\r\n \t},\r\n\r\n \t// @method bringToFront(): this\r\n \t// Brings the layer to the top of all overlays.\r\n \tbringToFront: function () {\r\n \t\tif (this._map) {\r\n \t\t\ttoFront(this._image);\r\n \t\t}\r\n \t\treturn this;\r\n \t},\r\n\r\n \t// @method bringToBack(): this\r\n \t// Brings the layer to the bottom of all overlays.\r\n \tbringToBack: function () {\r\n \t\tif (this._map) {\r\n \t\t\ttoBack(this._image);\r\n \t\t}\r\n \t\treturn this;\r\n \t},\r\n\r\n \t// @method setUrl(url: String): this\r\n \t// Changes the URL of the image.\r\n \tsetUrl: function (url) {\r\n \t\tthis._url = url;\r\n\r\n \t\tif (this._image) {\r\n \t\t\tthis._image.src = url;\r\n \t\t}\r\n \t\treturn this;\r\n \t},\r\n\r\n \t// @method setBounds(bounds: LatLngBounds): this\r\n \t// Update the bounds that this ImageOverlay covers\r\n \tsetBounds: function (bounds) {\r\n \t\tthis._bounds = toLatLngBounds(bounds);\r\n\r\n \t\tif (this._map) {\r\n \t\t\tthis._reset();\r\n \t\t}\r\n \t\treturn this;\r\n \t},\r\n\r\n \tgetEvents: function () {\r\n \t\tvar events = {\r\n \t\t\tzoom: this._reset,\r\n \t\t\tviewreset: this._reset\r\n \t\t};\r\n\r\n \t\tif (this._zoomAnimated) {\r\n \t\t\tevents.zoomanim = this._animateZoom;\r\n \t\t}\r\n\r\n \t\treturn events;\r\n \t},\r\n\r\n \t// @method setZIndex(value: Number): this\r\n \t// Changes the [zIndex](#imageoverlay-zindex) of the image overlay.\r\n \tsetZIndex: function (value) {\r\n \t\tthis.options.zIndex = value;\r\n \t\tthis._updateZIndex();\r\n \t\treturn this;\r\n \t},\r\n\r\n \t// @method getBounds(): LatLngBounds\r\n \t// Get the bounds that this ImageOverlay covers\r\n \tgetBounds: function () {\r\n \t\treturn this._bounds;\r\n \t},\r\n\r\n \t// @method getElement(): HTMLElement\r\n \t// Returns the instance of [`HTMLImageElement`](https://developer.mozilla.org/docs/Web/API/HTMLImageElement)\r\n \t// used by this overlay.\r\n \tgetElement: function () {\r\n \t\treturn this._image;\r\n \t},\r\n\r\n \t_initImage: function () {\r\n \t\tvar wasElementSupplied = this._url.tagName === 'IMG';\r\n \t\tvar img = this._image = wasElementSupplied ? this._url : create$1('img');\r\n\r\n \t\taddClass(img, 'leaflet-image-layer');\r\n \t\tif (this._zoomAnimated) { addClass(img, 'leaflet-zoom-animated'); }\r\n \t\tif (this.options.className) { addClass(img, this.options.className); }\r\n\r\n \t\timg.onselectstart = falseFn;\r\n \t\timg.onmousemove = falseFn;\r\n\r\n \t\t// @event load: Event\r\n \t\t// Fired when the ImageOverlay layer has loaded its image\r\n \t\timg.onload = bind(this.fire, this, 'load');\r\n \t\timg.onerror = bind(this._overlayOnError, this, 'error');\r\n\r\n \t\tif (this.options.crossOrigin || this.options.crossOrigin === '') {\r\n \t\t\timg.crossOrigin = this.options.crossOrigin === true ? '' : this.options.crossOrigin;\r\n \t\t}\r\n\r\n \t\tif (this.options.zIndex) {\r\n \t\t\tthis._updateZIndex();\r\n \t\t}\r\n\r\n \t\tif (wasElementSupplied) {\r\n \t\t\tthis._url = img.src;\r\n \t\t\treturn;\r\n \t\t}\r\n\r\n \t\timg.src = this._url;\r\n \t\timg.alt = this.options.alt;\r\n \t},\r\n\r\n \t_animateZoom: function (e) {\r\n \t\tvar scale = this._map.getZoomScale(e.zoom),\r\n \t\t offset = this._map._latLngBoundsToNewLayerBounds(this._bounds, e.zoom, e.center).min;\r\n\r\n \t\tsetTransform(this._image, offset, scale);\r\n \t},\r\n\r\n \t_reset: function () {\r\n \t\tvar image = this._image,\r\n \t\t bounds = new Bounds(\r\n \t\t this._map.latLngToLayerPoint(this._bounds.getNorthWest()),\r\n \t\t this._map.latLngToLayerPoint(this._bounds.getSouthEast())),\r\n \t\t size = bounds.getSize();\r\n\r\n \t\tsetPosition(image, bounds.min);\r\n\r\n \t\timage.style.width = size.x + 'px';\r\n \t\timage.style.height = size.y + 'px';\r\n \t},\r\n\r\n \t_updateOpacity: function () {\r\n \t\tsetOpacity(this._image, this.options.opacity);\r\n \t},\r\n\r\n \t_updateZIndex: function () {\r\n \t\tif (this._image && this.options.zIndex !== undefined && this.options.zIndex !== null) {\r\n \t\t\tthis._image.style.zIndex = this.options.zIndex;\r\n \t\t}\r\n \t},\r\n\r\n \t_overlayOnError: function () {\r\n \t\t// @event error: Event\r\n \t\t// Fired when the ImageOverlay layer fails to load its image\r\n \t\tthis.fire('error');\r\n\r\n \t\tvar errorUrl = this.options.errorOverlayUrl;\r\n \t\tif (errorUrl && this._url !== errorUrl) {\r\n \t\t\tthis._url = errorUrl;\r\n \t\t\tthis._image.src = errorUrl;\r\n \t\t}\r\n \t}\r\n });\r\n\r\n // @factory L.imageOverlay(imageUrl: String, bounds: LatLngBounds, options?: ImageOverlay options)\r\n // Instantiates an image overlay object given the URL of the image and the\r\n // geographical bounds it is tied to.\r\n var imageOverlay = function (url, bounds, options) {\r\n \treturn new ImageOverlay(url, bounds, options);\r\n };\n\n /*\r\n * @class VideoOverlay\r\n * @aka L.VideoOverlay\r\n * @inherits ImageOverlay\r\n *\r\n * Used to load and display a video player over specific bounds of the map. Extends `ImageOverlay`.\r\n *\r\n * A video overlay uses the [`