jQuery Pin It Button for Images - Version 2.3.1

Version Description

  • Released 2017-07-09
  • Settings panel code rework
  • Fixed issue with disabling review nag
Download this release

Release Info

Developer mrsztuczkens
Plugin Icon wp plugin jQuery Pin It Button for Images
Version 2.3.1
Comparing to
See all releases

Code changes from version 2.3.0 to 2.3.1

css/admin.css CHANGED
@@ -1 +1 @@
1
- @charset "UTF-8";a.pinit-button.old_default,a.pinit-button.old_default span{height:41px!important;width:65px!important}a.pinit-button.default.jpibfi-size-small .jpibfi-icon-circle,a.pinit-button.default.jpibfi-size-small .jpibfi-icon-plain{font-size:28.8px}a.pinit-button.custom,a.pinit-button.old_default{text-indent:-9999em!important}a.pinit-button.custom span,a.pinit-button.old_default span{display:block;background-color:transparent!important;background-repeat:no-repeat!important;background-position:0 0!important}a.pinit-button.old_default span{background-image:url(images/pinit-button.png)!important;background-size:65px 41px!important}a.pinit-button.default{display:block;overflow:hidden;text-decoration:none;color:#fff;background-color:#bd081c}a.pinit-button.default:hover{background-color:#a50718}a.pinit-button.default.jpibfi-size-small{height:43.2px}a.pinit-button.default.jpibfi-size-small.jpibfi-button-round,a.pinit-button.default.jpibfi-size-small.jpibfi-button-rounded-square,a.pinit-button.default.jpibfi-size-small.jpibfi-button-square{width:43.2px}a.pinit-button.default.jpibfi-size-small.jpibfi-button-rectangle,a.pinit-button.default.jpibfi-size-small.jpibfi-button-rounded-rectangle{width:64.8px}a.pinit-button.default.jpibfi-size-small .jpibfi-icon-circle:before{margin-top:-14.4px;margin-left:-12.38px}a.pinit-button.default.jpibfi-size-small .jpibfi-icon-pushpin,a.pinit-button.default.jpibfi-size-small .jpibfi-icon-thumb-tack{font-size:17.28px}a.pinit-button.default.jpibfi-size-small .jpibfi-icon-plain:before{margin-top:-13.5px;margin-left:-10.06px}a.pinit-button.default.jpibfi-size-small .jpibfi-icon-thumb-tack:before{margin-top:-7.97px;margin-left:-5.54px}a.pinit-button.default.jpibfi-size-small .jpibfi-icon-pushpin:before{margin-top:-8.64px;margin-left:-8.64px}a.pinit-button.default.jpibfi-size-small .jpibfi-icon-pinterest2{font-size:28.8px}a.pinit-button.default.jpibfi-size-normal .jpibfi-icon-circle,a.pinit-button.default.jpibfi-size-normal .jpibfi-icon-plain{font-size:36px}a.pinit-button.default.jpibfi-size-small .jpibfi-icon-pinterest2:before{margin-top:-14.4px;margin-left:-14.4px}a.pinit-button.default.jpibfi-size-normal{height:54px}a.pinit-button.default.jpibfi-size-normal.jpibfi-button-round,a.pinit-button.default.jpibfi-size-normal.jpibfi-button-rounded-square,a.pinit-button.default.jpibfi-size-normal.jpibfi-button-square{width:54px}a.pinit-button.default.jpibfi-size-large.jpibfi-button-round,a.pinit-button.default.jpibfi-size-large.jpibfi-button-rounded-square,a.pinit-button.default.jpibfi-size-large.jpibfi-button-square,a.pinit-button.default.jpibfi-size-normal.jpibfi-button-rectangle,a.pinit-button.default.jpibfi-size-normal.jpibfi-button-rounded-rectangle{width:81px}a.pinit-button.default.jpibfi-size-normal .jpibfi-icon-circle:before{margin-top:-18px;margin-left:-15.47px}a.pinit-button.default.jpibfi-size-normal .jpibfi-icon-pushpin,a.pinit-button.default.jpibfi-size-normal .jpibfi-icon-thumb-tack{font-size:21.6px}a.pinit-button.default.jpibfi-size-normal .jpibfi-icon-plain:before{margin-top:-16.88px;margin-left:-12.58px}a.pinit-button.default.jpibfi-size-normal .jpibfi-icon-thumb-tack:before{margin-top:-9.96px;margin-left:-6.92px}a.pinit-button.default.jpibfi-size-normal .jpibfi-icon-pushpin:before{margin-top:-10.8px;margin-left:-10.8px}a.pinit-button.default.jpibfi-size-normal .jpibfi-icon-pinterest2{font-size:36px}a.pinit-button.default.jpibfi-size-large .jpibfi-icon-circle,a.pinit-button.default.jpibfi-size-large .jpibfi-icon-plain{font-size:54px}a.pinit-button.default.jpibfi-size-normal .jpibfi-icon-pinterest2:before{margin-top:-18px;margin-left:-18px}a.pinit-button.default.jpibfi-size-large{height:81px}a.pinit-button.default.jpibfi-size-large.jpibfi-button-rectangle,a.pinit-button.default.jpibfi-size-large.jpibfi-button-rounded-rectangle{width:121.5px}a.pinit-button.default.jpibfi-size-large .jpibfi-icon-circle:before{margin-top:-27px;margin-left:-23.2px}a.pinit-button.default.jpibfi-size-large .jpibfi-icon-pushpin,a.pinit-button.default.jpibfi-size-large .jpibfi-icon-thumb-tack{font-size:32.4px}a.pinit-button.default.jpibfi-size-large .jpibfi-icon-plain:before{margin-top:-25.31px;margin-left:-18.86px}a.pinit-button.default.jpibfi-size-large .jpibfi-icon-thumb-tack:before{margin-top:-14.93px;margin-left:-10.38px}a.pinit-button.default.jpibfi-size-large .jpibfi-icon-pushpin:before{margin-top:-16.2px;margin-left:-16.2px}a.pinit-button.default.jpibfi-size-large .jpibfi-icon-pinterest2{font-size:54px}a.pinit-button.default.jpibfi-size-large .jpibfi-icon-pinterest2:before{margin-top:-27px;margin-left:-27px}a.pinit-button.default.jpibfi-button-rounded-rectangle,a.pinit-button.default.jpibfi-button-rounded-square{border-radius:10px}a.pinit-button.default.jpibfi-button-round{border-radius:50%}a.pinit-button.default [class*=" jpibfi-icon-"],a.pinit-button.default [class^=jpibfi-icon-]{color:#fff;display:block}a.pinit-button.default [class*=" jpibfi-icon-"]:hover,a.pinit-button.default [class^=jpibfi-icon-]:hover{color:#fff}a.pinit-button.default [class*=" jpibfi-icon-"]:before,a.pinit-button.default [class^=jpibfi-icon-]:before{display:block;position:absolute;top:50%;left:50%}@font-face{font-family:jpibfi-font;src:url(fonts/jpibfi-font.eot?ifsn2k);src:url(fonts/jpibfi-font.eot?ifsn2k#iefix) format("embedded-opentype"),url(fonts/jpibfi-font.ttf?ifsn2k) format("truetype"),url(fonts/jpibfi-font.woff?ifsn2k) format("woff"),url(fonts/jpibfi-font.svg?ifsn2k#jpibfi-font) format("svg");font-weight:400;font-style:normal}[class*=" jpibfi-icon-"],[class^=jpibfi-icon-]{font-family:jpibfi-font!important;speak:none;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.jpibfi-icon-circle:before{content:""}.jpibfi-icon-plain:before{content:""}.jpibfi-icon-thumb-tack:before{content:""}.jpibfi-icon-pushpin:before{content:""}.jpibfi-icon-pinterest2:before{content:""}.frizzly-sortable li{cursor:move}input[type=checkbox]~label{padding-left:5px}input#custom_image_url{width:100%}div.checkbox-indented{margin-left:20px}table.jpibfi-inner-table td,table.jpibfi-inner-table th{max-width:350px}table.jpibfi-inner-table th{padding:5px;width:auto}table.jpibfi-inner-table td{vertical-align:top;padding:0 15px 0 10px}a.pinit-button{display:block;position:relative}
1
+ @charset "UTF-8";a.pinit-button.custom,a.pinit-button.old_default{text-indent:-9999em!important}a.pinit-button.custom span,a.pinit-button.old_default span{display:block;background-color:transparent!important;background-repeat:no-repeat!important;background-position:0 0!important}a.pinit-button.old_default{width:65px!important;height:41px!important}a.pinit-button.old_default span{height:41px!important;width:65px!important;background-image:url(images/pinit-button.png)!important;background-size:65px 41px!important}a.pinit-button.default{display:block;overflow:hidden;text-decoration:none;color:#fff;background-color:#bd081c}a.pinit-button.default:hover{background-color:#a50718}a.pinit-button.default.jpibfi-size-small{height:43.2px}a.pinit-button.default.jpibfi-size-small.jpibfi-button-round,a.pinit-button.default.jpibfi-size-small.jpibfi-button-rounded-square,a.pinit-button.default.jpibfi-size-small.jpibfi-button-square{width:43.2px}a.pinit-button.default.jpibfi-size-small.jpibfi-button-rectangle,a.pinit-button.default.jpibfi-size-small.jpibfi-button-rounded-rectangle{width:64.8px}a.pinit-button.default.jpibfi-size-small .jpibfi-icon-circle{font-size:28.8px}a.pinit-button.default.jpibfi-size-small .jpibfi-icon-circle:before{margin-top:-14.4px;margin-left:-12.375px}a.pinit-button.default.jpibfi-size-small .jpibfi-icon-plain{font-size:28.8px}a.pinit-button.default.jpibfi-size-small .jpibfi-icon-plain:before{margin-top:-13.5px;margin-left:-10.06027px}a.pinit-button.default.jpibfi-size-small .jpibfi-icon-thumb-tack{font-size:17.28px}a.pinit-button.default.jpibfi-size-small .jpibfi-icon-thumb-tack:before{margin-top:-7.965px;margin-left:-5.535px}a.pinit-button.default.jpibfi-size-small .jpibfi-icon-pushpin{font-size:17.28px}a.pinit-button.default.jpibfi-size-small .jpibfi-icon-pushpin:before{margin-top:-8.64px;margin-left:-8.64px}a.pinit-button.default.jpibfi-size-small .jpibfi-icon-pinterest2{font-size:28.8px}a.pinit-button.default.jpibfi-size-small .jpibfi-icon-pinterest2:before{margin-top:-14.4px;margin-left:-14.4px}a.pinit-button.default.jpibfi-size-normal{height:54px}a.pinit-button.default.jpibfi-size-normal.jpibfi-button-round,a.pinit-button.default.jpibfi-size-normal.jpibfi-button-rounded-square,a.pinit-button.default.jpibfi-size-normal.jpibfi-button-square{width:54px}a.pinit-button.default.jpibfi-size-normal.jpibfi-button-rectangle,a.pinit-button.default.jpibfi-size-normal.jpibfi-button-rounded-rectangle{width:81px}a.pinit-button.default.jpibfi-size-normal .jpibfi-icon-circle{font-size:36px}a.pinit-button.default.jpibfi-size-normal .jpibfi-icon-circle:before{margin-top:-18px;margin-left:-15.46875px}a.pinit-button.default.jpibfi-size-normal .jpibfi-icon-plain{font-size:36px}a.pinit-button.default.jpibfi-size-normal .jpibfi-icon-plain:before{margin-top:-16.875px;margin-left:-12.57534px}a.pinit-button.default.jpibfi-size-normal .jpibfi-icon-thumb-tack{font-size:21.6px}a.pinit-button.default.jpibfi-size-normal .jpibfi-icon-thumb-tack:before{margin-top:-9.95625px;margin-left:-6.91875px}a.pinit-button.default.jpibfi-size-normal .jpibfi-icon-pushpin{font-size:21.6px}a.pinit-button.default.jpibfi-size-normal .jpibfi-icon-pushpin:before{margin-top:-10.8px;margin-left:-10.8px}a.pinit-button.default.jpibfi-size-normal .jpibfi-icon-pinterest2{font-size:36px}a.pinit-button.default.jpibfi-size-normal .jpibfi-icon-pinterest2:before{margin-top:-18px;margin-left:-18px}a.pinit-button.default.jpibfi-size-large{height:81px}a.pinit-button.default.jpibfi-size-large.jpibfi-button-round,a.pinit-button.default.jpibfi-size-large.jpibfi-button-rounded-square,a.pinit-button.default.jpibfi-size-large.jpibfi-button-square{width:81px}a.pinit-button.default.jpibfi-size-large.jpibfi-button-rectangle,a.pinit-button.default.jpibfi-size-large.jpibfi-button-rounded-rectangle{width:121.5px}a.pinit-button.default.jpibfi-size-large .jpibfi-icon-circle{font-size:54px}a.pinit-button.default.jpibfi-size-large .jpibfi-icon-circle:before{margin-top:-27px;margin-left:-23.20313px}a.pinit-button.default.jpibfi-size-large .jpibfi-icon-plain{font-size:54px}a.pinit-button.default.jpibfi-size-large .jpibfi-icon-plain:before{margin-top:-25.3125px;margin-left:-18.86301px}a.pinit-button.default.jpibfi-size-large .jpibfi-icon-thumb-tack{font-size:32.4px}a.pinit-button.default.jpibfi-size-large .jpibfi-icon-thumb-tack:before{margin-top:-14.93437px;margin-left:-10.37812px}a.pinit-button.default.jpibfi-size-large .jpibfi-icon-pushpin{font-size:32.4px}a.pinit-button.default.jpibfi-size-large .jpibfi-icon-pushpin:before{margin-top:-16.2px;margin-left:-16.2px}a.pinit-button.default.jpibfi-size-large .jpibfi-icon-pinterest2{font-size:54px}a.pinit-button.default.jpibfi-size-large .jpibfi-icon-pinterest2:before{margin-top:-27px;margin-left:-27px}a.pinit-button.default.jpibfi-button-rounded-rectangle,a.pinit-button.default.jpibfi-button-rounded-square{border-radius:10px}a.pinit-button.default.jpibfi-button-round{border-radius:50%}a.pinit-button.default [class*=" jpibfi-icon-"],a.pinit-button.default [class^=jpibfi-icon-]{color:#fff;display:block}a.pinit-button.default [class*=" jpibfi-icon-"]:hover,a.pinit-button.default [class^=jpibfi-icon-]:hover{color:#fff}a.pinit-button.default [class*=" jpibfi-icon-"]:before,a.pinit-button.default [class^=jpibfi-icon-]:before{display:block;position:absolute;top:50%;left:50%}@font-face{font-family:jpibfi-font;src:url(fonts/jpibfi-font.eot?ifsn2k);src:url(fonts/jpibfi-font.eot?ifsn2k#iefix) format("embedded-opentype"),url(fonts/jpibfi-font.ttf?ifsn2k) format("truetype"),url(fonts/jpibfi-font.woff?ifsn2k) format("woff"),url(fonts/jpibfi-font.svg?ifsn2k#jpibfi-font) format("svg");font-weight:400;font-style:normal}[class*=" jpibfi-icon-"],[class^=jpibfi-icon-]{font-family:jpibfi-font!important;speak:none;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.jpibfi-icon-circle:before{content:""}.jpibfi-icon-plain:before{content:""}.jpibfi-icon-thumb-tack:before{content:""}.jpibfi-icon-pushpin:before{content:""}.jpibfi-icon-pinterest2:before{content:""}.frizzly-sortable li{cursor:move}input[type=checkbox]~label{padding-left:5px}input#custom_image_url{width:100%}div.checkbox-indented{margin-left:20px}table.jpibfi-inner-table td,table.jpibfi-inner-table th{max-width:350px}table.jpibfi-inner-table th{padding:5px;width:auto}table.jpibfi-inner-table td{vertical-align:top;padding:0 15px 0 10px}a.pinit-button{display:block;position:relative}
css/client.css CHANGED
@@ -1 +1 @@
1
- @charset "UTF-8";a.pinit-button.old_default,a.pinit-button.old_default span{height:41px!important;width:65px!important}a.pinit-button.default.jpibfi-size-small .jpibfi-icon-circle,a.pinit-button.default.jpibfi-size-small .jpibfi-icon-plain{font-size:28.8px}a.pinit-button.custom,a.pinit-button.old_default{text-indent:-9999em!important}a.pinit-button.custom span,a.pinit-button.old_default span{display:block;background-color:transparent!important;background-repeat:no-repeat!important;background-position:0 0!important}a.pinit-button.old_default span{background-image:url(images/pinit-button.png)!important;background-size:65px 41px!important}a.pinit-button.default{display:block;overflow:hidden;text-decoration:none;color:#fff;background-color:#bd081c}a.pinit-button.default:hover{background-color:#a50718}a.pinit-button.default.jpibfi-size-small{height:43.2px}a.pinit-button.default.jpibfi-size-small.jpibfi-button-round,a.pinit-button.default.jpibfi-size-small.jpibfi-button-rounded-square,a.pinit-button.default.jpibfi-size-small.jpibfi-button-square{width:43.2px}a.pinit-button.default.jpibfi-size-small.jpibfi-button-rectangle,a.pinit-button.default.jpibfi-size-small.jpibfi-button-rounded-rectangle{width:64.8px}a.pinit-button.default.jpibfi-size-small .jpibfi-icon-circle:before{margin-top:-14.4px;margin-left:-12.38px}a.pinit-button.default.jpibfi-size-small .jpibfi-icon-pushpin,a.pinit-button.default.jpibfi-size-small .jpibfi-icon-thumb-tack{font-size:17.28px}a.pinit-button.default.jpibfi-size-small .jpibfi-icon-plain:before{margin-top:-13.5px;margin-left:-10.06px}a.pinit-button.default.jpibfi-size-small .jpibfi-icon-thumb-tack:before{margin-top:-7.97px;margin-left:-5.54px}a.pinit-button.default.jpibfi-size-small .jpibfi-icon-pushpin:before{margin-top:-8.64px;margin-left:-8.64px}a.pinit-button.default.jpibfi-size-small .jpibfi-icon-pinterest2{font-size:28.8px}a.pinit-button.default.jpibfi-size-normal .jpibfi-icon-circle,a.pinit-button.default.jpibfi-size-normal .jpibfi-icon-plain{font-size:36px}a.pinit-button.default.jpibfi-size-small .jpibfi-icon-pinterest2:before{margin-top:-14.4px;margin-left:-14.4px}a.pinit-button.default.jpibfi-size-normal{height:54px}a.pinit-button.default.jpibfi-size-normal.jpibfi-button-round,a.pinit-button.default.jpibfi-size-normal.jpibfi-button-rounded-square,a.pinit-button.default.jpibfi-size-normal.jpibfi-button-square{width:54px}a.pinit-button.default.jpibfi-size-large.jpibfi-button-round,a.pinit-button.default.jpibfi-size-large.jpibfi-button-rounded-square,a.pinit-button.default.jpibfi-size-large.jpibfi-button-square,a.pinit-button.default.jpibfi-size-normal.jpibfi-button-rectangle,a.pinit-button.default.jpibfi-size-normal.jpibfi-button-rounded-rectangle{width:81px}a.pinit-button.default.jpibfi-size-normal .jpibfi-icon-circle:before{margin-top:-18px;margin-left:-15.47px}a.pinit-button.default.jpibfi-size-normal .jpibfi-icon-pushpin,a.pinit-button.default.jpibfi-size-normal .jpibfi-icon-thumb-tack{font-size:21.6px}a.pinit-button.default.jpibfi-size-normal .jpibfi-icon-plain:before{margin-top:-16.88px;margin-left:-12.58px}a.pinit-button.default.jpibfi-size-normal .jpibfi-icon-thumb-tack:before{margin-top:-9.96px;margin-left:-6.92px}a.pinit-button.default.jpibfi-size-normal .jpibfi-icon-pushpin:before{margin-top:-10.8px;margin-left:-10.8px}a.pinit-button.default.jpibfi-size-normal .jpibfi-icon-pinterest2{font-size:36px}a.pinit-button.default.jpibfi-size-large .jpibfi-icon-circle,a.pinit-button.default.jpibfi-size-large .jpibfi-icon-plain{font-size:54px}a.pinit-button.default.jpibfi-size-normal .jpibfi-icon-pinterest2:before{margin-top:-18px;margin-left:-18px}a.pinit-button.default.jpibfi-size-large{height:81px}a.pinit-button.default.jpibfi-size-large.jpibfi-button-rectangle,a.pinit-button.default.jpibfi-size-large.jpibfi-button-rounded-rectangle{width:121.5px}a.pinit-button.default.jpibfi-size-large .jpibfi-icon-circle:before{margin-top:-27px;margin-left:-23.2px}a.pinit-button.default.jpibfi-size-large .jpibfi-icon-pushpin,a.pinit-button.default.jpibfi-size-large .jpibfi-icon-thumb-tack{font-size:32.4px}a.pinit-button.default.jpibfi-size-large .jpibfi-icon-plain:before{margin-top:-25.31px;margin-left:-18.86px}a.pinit-button.default.jpibfi-size-large .jpibfi-icon-thumb-tack:before{margin-top:-14.93px;margin-left:-10.38px}a.pinit-button.default.jpibfi-size-large .jpibfi-icon-pushpin:before{margin-top:-16.2px;margin-left:-16.2px}a.pinit-button.default.jpibfi-size-large .jpibfi-icon-pinterest2{font-size:54px}a.pinit-button.default.jpibfi-size-large .jpibfi-icon-pinterest2:before{margin-top:-27px;margin-left:-27px}a.pinit-button.default.jpibfi-button-rounded-rectangle,a.pinit-button.default.jpibfi-button-rounded-square{border-radius:10px}a.pinit-button.default.jpibfi-button-round{border-radius:50%}a.pinit-button.default [class*=" jpibfi-icon-"],a.pinit-button.default [class^=jpibfi-icon-]{color:#fff;display:block}a.pinit-button.default [class*=" jpibfi-icon-"]:hover,a.pinit-button.default [class^=jpibfi-icon-]:hover{color:#fff}a.pinit-button.default [class*=" jpibfi-icon-"]:before,a.pinit-button.default [class^=jpibfi-icon-]:before{display:block;position:absolute;top:50%;left:50%}@font-face{font-family:jpibfi-font;src:url(fonts/jpibfi-font.eot?ifsn2k);src:url(fonts/jpibfi-font.eot?ifsn2k#iefix) format("embedded-opentype"),url(fonts/jpibfi-font.ttf?ifsn2k) format("truetype"),url(fonts/jpibfi-font.woff?ifsn2k) format("woff"),url(fonts/jpibfi-font.svg?ifsn2k#jpibfi-font) format("svg");font-weight:400;font-style:normal}[class*=" jpibfi-icon-"],[class^=jpibfi-icon-]{font-family:jpibfi-font!important;speak:none;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.jpibfi-icon-circle:before{content:""}.jpibfi-icon-plain:before{content:""}.jpibfi-icon-thumb-tack:before{content:""}.jpibfi-icon-pushpin:before{content:""}.jpibfi-icon-pinterest2:before{content:""}a.pinit-button{position:absolute;display:none}
1
+ @charset "UTF-8";a.pinit-button.custom,a.pinit-button.old_default{text-indent:-9999em!important}a.pinit-button.custom span,a.pinit-button.old_default span{display:block;background-color:transparent!important;background-repeat:no-repeat!important;background-position:0 0!important}a.pinit-button.old_default{width:65px!important;height:41px!important}a.pinit-button.old_default span{height:41px!important;width:65px!important;background-image:url(images/pinit-button.png)!important;background-size:65px 41px!important}a.pinit-button.default{display:block;overflow:hidden;text-decoration:none;color:#fff;background-color:#bd081c}a.pinit-button.default:hover{background-color:#a50718}a.pinit-button.default.jpibfi-size-small{height:43.2px}a.pinit-button.default.jpibfi-size-small.jpibfi-button-round,a.pinit-button.default.jpibfi-size-small.jpibfi-button-rounded-square,a.pinit-button.default.jpibfi-size-small.jpibfi-button-square{width:43.2px}a.pinit-button.default.jpibfi-size-small.jpibfi-button-rectangle,a.pinit-button.default.jpibfi-size-small.jpibfi-button-rounded-rectangle{width:64.8px}a.pinit-button.default.jpibfi-size-small .jpibfi-icon-circle{font-size:28.8px}a.pinit-button.default.jpibfi-size-small .jpibfi-icon-circle:before{margin-top:-14.4px;margin-left:-12.375px}a.pinit-button.default.jpibfi-size-small .jpibfi-icon-plain{font-size:28.8px}a.pinit-button.default.jpibfi-size-small .jpibfi-icon-plain:before{margin-top:-13.5px;margin-left:-10.06027px}a.pinit-button.default.jpibfi-size-small .jpibfi-icon-thumb-tack{font-size:17.28px}a.pinit-button.default.jpibfi-size-small .jpibfi-icon-thumb-tack:before{margin-top:-7.965px;margin-left:-5.535px}a.pinit-button.default.jpibfi-size-small .jpibfi-icon-pushpin{font-size:17.28px}a.pinit-button.default.jpibfi-size-small .jpibfi-icon-pushpin:before{margin-top:-8.64px;margin-left:-8.64px}a.pinit-button.default.jpibfi-size-small .jpibfi-icon-pinterest2{font-size:28.8px}a.pinit-button.default.jpibfi-size-small .jpibfi-icon-pinterest2:before{margin-top:-14.4px;margin-left:-14.4px}a.pinit-button.default.jpibfi-size-normal{height:54px}a.pinit-button.default.jpibfi-size-normal.jpibfi-button-round,a.pinit-button.default.jpibfi-size-normal.jpibfi-button-rounded-square,a.pinit-button.default.jpibfi-size-normal.jpibfi-button-square{width:54px}a.pinit-button.default.jpibfi-size-normal.jpibfi-button-rectangle,a.pinit-button.default.jpibfi-size-normal.jpibfi-button-rounded-rectangle{width:81px}a.pinit-button.default.jpibfi-size-normal .jpibfi-icon-circle{font-size:36px}a.pinit-button.default.jpibfi-size-normal .jpibfi-icon-circle:before{margin-top:-18px;margin-left:-15.46875px}a.pinit-button.default.jpibfi-size-normal .jpibfi-icon-plain{font-size:36px}a.pinit-button.default.jpibfi-size-normal .jpibfi-icon-plain:before{margin-top:-16.875px;margin-left:-12.57534px}a.pinit-button.default.jpibfi-size-normal .jpibfi-icon-thumb-tack{font-size:21.6px}a.pinit-button.default.jpibfi-size-normal .jpibfi-icon-thumb-tack:before{margin-top:-9.95625px;margin-left:-6.91875px}a.pinit-button.default.jpibfi-size-normal .jpibfi-icon-pushpin{font-size:21.6px}a.pinit-button.default.jpibfi-size-normal .jpibfi-icon-pushpin:before{margin-top:-10.8px;margin-left:-10.8px}a.pinit-button.default.jpibfi-size-normal .jpibfi-icon-pinterest2{font-size:36px}a.pinit-button.default.jpibfi-size-normal .jpibfi-icon-pinterest2:before{margin-top:-18px;margin-left:-18px}a.pinit-button.default.jpibfi-size-large{height:81px}a.pinit-button.default.jpibfi-size-large.jpibfi-button-round,a.pinit-button.default.jpibfi-size-large.jpibfi-button-rounded-square,a.pinit-button.default.jpibfi-size-large.jpibfi-button-square{width:81px}a.pinit-button.default.jpibfi-size-large.jpibfi-button-rectangle,a.pinit-button.default.jpibfi-size-large.jpibfi-button-rounded-rectangle{width:121.5px}a.pinit-button.default.jpibfi-size-large .jpibfi-icon-circle{font-size:54px}a.pinit-button.default.jpibfi-size-large .jpibfi-icon-circle:before{margin-top:-27px;margin-left:-23.20313px}a.pinit-button.default.jpibfi-size-large .jpibfi-icon-plain{font-size:54px}a.pinit-button.default.jpibfi-size-large .jpibfi-icon-plain:before{margin-top:-25.3125px;margin-left:-18.86301px}a.pinit-button.default.jpibfi-size-large .jpibfi-icon-thumb-tack{font-size:32.4px}a.pinit-button.default.jpibfi-size-large .jpibfi-icon-thumb-tack:before{margin-top:-14.93437px;margin-left:-10.37812px}a.pinit-button.default.jpibfi-size-large .jpibfi-icon-pushpin{font-size:32.4px}a.pinit-button.default.jpibfi-size-large .jpibfi-icon-pushpin:before{margin-top:-16.2px;margin-left:-16.2px}a.pinit-button.default.jpibfi-size-large .jpibfi-icon-pinterest2{font-size:54px}a.pinit-button.default.jpibfi-size-large .jpibfi-icon-pinterest2:before{margin-top:-27px;margin-left:-27px}a.pinit-button.default.jpibfi-button-rounded-rectangle,a.pinit-button.default.jpibfi-button-rounded-square{border-radius:10px}a.pinit-button.default.jpibfi-button-round{border-radius:50%}a.pinit-button.default [class*=" jpibfi-icon-"],a.pinit-button.default [class^=jpibfi-icon-]{color:#fff;display:block}a.pinit-button.default [class*=" jpibfi-icon-"]:hover,a.pinit-button.default [class^=jpibfi-icon-]:hover{color:#fff}a.pinit-button.default [class*=" jpibfi-icon-"]:before,a.pinit-button.default [class^=jpibfi-icon-]:before{display:block;position:absolute;top:50%;left:50%}@font-face{font-family:jpibfi-font;src:url(fonts/jpibfi-font.eot?ifsn2k);src:url(fonts/jpibfi-font.eot?ifsn2k#iefix) format("embedded-opentype"),url(fonts/jpibfi-font.ttf?ifsn2k) format("truetype"),url(fonts/jpibfi-font.woff?ifsn2k) format("woff"),url(fonts/jpibfi-font.svg?ifsn2k#jpibfi-font) format("svg");font-weight:400;font-style:normal}[class*=" jpibfi-icon-"],[class^=jpibfi-icon-]{font-family:jpibfi-font!important;speak:none;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.jpibfi-icon-circle:before{content:""}.jpibfi-icon-plain:before{content:""}.jpibfi-icon-thumb-tack:before{content:""}.jpibfi-icon-pushpin:before{content:""}.jpibfi-icon-pinterest2:before{content:""}a.pinit-button{position:absolute;display:none}
includes/public/class-jpibfi-client.php CHANGED
@@ -170,7 +170,10 @@ class JPIBFI_Client {
170
  (function () {
171
  if (!jQuery) return;
172
  jQuery(document).ready(function () {
173
- jQuery('.jpibfi').closest('div').addClass('jpibfi_container');
 
 
 
174
  });
175
  })();
176
  </script>
170
  (function () {
171
  if (!jQuery) return;
172
  jQuery(document).ready(function () {
173
+ var $inputs = jQuery('.jpibfi');
174
+ var $closest = $inputs.closest('div, article');
175
+ $closest = $closest.length ? $closest : $inputs.parent();
176
+ $closest.addClass('jpibfi_container');
177
  });
178
  })();
179
  </script>
jquery-pin-it-button-for-images.php CHANGED
@@ -6,7 +6,7 @@ Description: Highlights images on hover and adds a "Pin It" button over them for
6
  Text Domain: jquery-pin-it-button-for-images
7
  Domain Path: /languages
8
  Author: Marcin Skrzypiec
9
- Version:2.3.0
10
  Author URI: https://highfiveplugins.com/
11
  */
12
 
@@ -18,7 +18,7 @@ if ( !class_exists( 'jQuery_Pin_It_Button_For_Images' ) ) {
18
  final class jQuery_Pin_It_Button_For_Images {
19
 
20
  function __construct() {
21
- $version = '2.3.0';
22
  require_once plugin_dir_path(__FILE__) . 'includes/jpibfi.php';
23
  new JPIBFI(__FILE__, $version);
24
  }
6
  Text Domain: jquery-pin-it-button-for-images
7
  Domain Path: /languages
8
  Author: Marcin Skrzypiec
9
+ Version:2.3.1
10
  Author URI: https://highfiveplugins.com/
11
  */
12
 
18
  final class jQuery_Pin_It_Button_For_Images {
19
 
20
  function __construct() {
21
+ $version = '2.3.1';
22
  require_once plugin_dir_path(__FILE__) . 'includes/jpibfi.php';
23
  new JPIBFI(__FILE__, $version);
24
  }
js/jpibfi.admin.js CHANGED
@@ -1,20087 +1,13 @@
1
-
2
- (function() {
3
- var existingWindowDotAngular = window.angular;
4
- var angular = (window.angular = {});
5
- (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
6
- 'use strict';
7
-
8
- Object.defineProperty(exports, "__esModule", {
9
- value: true
10
- });
11
-
12
- var _app = require('./app.controller');
13
-
14
- var _app2 = _interopRequireDefault(_app);
15
-
16
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
-
18
- var AppComponent = {
19
- bindings: {
20
- settingsName: '@'
21
- },
22
- controller: _app2.default,
23
- template: '<navbar id="settings-navbar"\n tabs="$ctrl.config.tabs"\n page="$ctrl.config.page"\n links="$ctrl.config.links"\n current-tab="$ctrl.config.currentTab">\n </navbar>\n <form method="POST" enctype="multipart/form-data" id="jpibfi-form" action="{{ $ctrl.config.save.post_url }}">\n <input name="{{ ::$ctrl.config.save.action }}" value="{{ ::$ctrl.config.save.nonce }}" type="hidden" />\n <input name="{{ ::$ctrl.config.save.tab }}" value="{{ ::$ctrl.config.currentTab }}" type="hidden" />\n <select-editor\n ng-if="$ctrl.config.currentTab == \'select\'"\n settings="$ctrl.config.settings"\n i18n="$ctrl.config.i18n.editor">\n </select-editor>\n <visual-editor\n ng-if="$ctrl.config.currentTab == \'visual\'"\n settings="$ctrl.config.settings"\n i18n="$ctrl.config.i18n.editor">\n </visual-editor>\n <advanced-editor\n ng-if="$ctrl.config.currentTab == \'advanced\'"\n settings="$ctrl.config.settings"\n i18n="$ctrl.config.i18n.editor">\n </advanced-editor>\n <import-editor\n ng-if="$ctrl.config.currentTab == \'import\'"\n settings="$ctrl.config.settings"\n i18n="$ctrl.config.i18n.editor">\n </import-editor>\n <input ng-if="$ctrl.config.currentTab == \'select\' || $ctrl.config.currentTab == \'visual\' || $ctrl.config.currentTab == \'advanced\'" \n type="submit" class="button button-primary" value="{{ ::$ctrl.config.save.submit }}" /> \n </form>\n '
24
- };
25
-
26
- exports.default = AppComponent;
27
-
28
- },{"./app.controller":2}],2:[function(require,module,exports){
29
- 'use strict';
30
-
31
- Object.defineProperty(exports, "__esModule", {
32
- value: true
33
- });
34
-
35
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
36
-
37
- var _angular = require('angular');
38
-
39
- var _angular2 = _interopRequireDefault(_angular);
40
-
41
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
42
-
43
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
44
-
45
- var AppController = function () {
46
- function AppController(linkService) {
47
- _classCallCheck(this, AppController);
48
-
49
- this.linkService = linkService;
50
- this.config = {};
51
- this.settingsValue = {};
52
- }
53
-
54
- _createClass(AppController, [{
55
- key: '$onInit',
56
- value: function $onInit() {
57
- this.config = window[this.settingsName];
58
- this.linkService.init(this.config.page);
59
-
60
- _angular2.default.element('#jpibfi-error').css({ display: 'none' });
61
- }
62
- }]);
63
-
64
- return AppController;
65
- }();
66
-
67
- AppController.$inject = ['linkService'];
68
-
69
- exports.default = AppController;
70
-
71
- },{"angular":42}],3:[function(require,module,exports){
72
- 'use strict';
73
-
74
- Object.defineProperty(exports, "__esModule", {
75
- value: true
76
- });
77
-
78
- var _angular = require('angular');
79
-
80
- var _angular2 = _interopRequireDefault(_angular);
81
-
82
- var _angularSanitize = require('angular-sanitize');
83
-
84
- var _angularSanitize2 = _interopRequireDefault(_angularSanitize);
85
-
86
- var _ngFileUpload = require('ng-file-upload');
87
-
88
- var _ngFileUpload2 = _interopRequireDefault(_ngFileUpload);
89
-
90
- var _angularDragAndDropLists = require('angular-drag-and-drop-lists');
91
-
92
- var _angularDragAndDropLists2 = _interopRequireDefault(_angularDragAndDropLists);
93
-
94
- var _app = require('./app.component');
95
-
96
- var _app2 = _interopRequireDefault(_app);
97
-
98
- var _components = require('./components/components');
99
-
100
- var _components2 = _interopRequireDefault(_components);
101
-
102
- var _components3 = require('./common/components');
103
-
104
- var _components4 = _interopRequireDefault(_components3);
105
-
106
- var _services = require('./services');
107
-
108
- var _services2 = _interopRequireDefault(_services);
109
-
110
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
111
-
112
-
113
- var root = _angular2.default.module('jpibfi', [_angularSanitize2.default, _ngFileUpload2.default, _components2.default, _components4.default, _services2.default]).component('jpibfi', _app2.default).name;
114
-
115
- exports.default = root;
116
-
117
- },{"./app.component":1,"./common/components":8,"./components/components":18,"./services":35,"angular":42,"angular-drag-and-drop-lists":38,"angular-sanitize":40,"ng-file-upload":44}],4:[function(require,module,exports){
118
- 'use strict';
119
-
120
- Object.defineProperty(exports, "__esModule", {
121
- value: true
122
- });
123
-
124
- var _base = require('./../base.controller');
125
-
126
- var _base2 = _interopRequireDefault(_base);
127
-
128
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
129
-
130
- var AdvancedComponent = {
131
- bindings: {
132
- settings: '<',
133
- i18n: '<'
134
- },
135
- controller: _base2.default,
136
- template: '\n <h2>{{ $ctrl.i18n.title }}</h2>\n <table class="form-table">\n <tbody>\n <tr>\n <th>{{ ::$ctrl.i18n.filters_label }}</th>\n <td>\n <p>\n <filter name="$ctrl.settings.filter_the_content_on" priority="$ctrl.settings.filter_the_content_priority"\n update="$ctrl.update($event)" template="$ctrl.i18n.filter_template">\n </filter>\n </p>\n <p>\n <filter name="$ctrl.settings.filter_the_excerpt_on" priority="$ctrl.settings.filter_the_excerpt_priority"\n update="$ctrl.update($event)" template="$ctrl.i18n.filter_template">\n </filter>\n </p>\n <p>\n <filter name="$ctrl.settings.filter_post_thumbnail_html_on" priority="$ctrl.settings.filter_post_thumbnail_html_priority"\n update="$ctrl.update($event)" template="$ctrl.i18n.filter_template">\n </filter>\n </p>\n <p class="description" ng-bind-html="$ctrl.i18n.filters_description"></p>\n </td>\n </tr>\n </tbody>\n </table>\n '
137
- };
138
-
139
- exports.default = AdvancedComponent;
140
-
141
- },{"./../base.controller":7}],5:[function(require,module,exports){
142
- 'use strict';
143
-
144
- Object.defineProperty(exports, "__esModule", {
145
- value: true
146
- });
147
-
148
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
149
-
150
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
151
-
152
- var FilterDirective = function () {
153
- function FilterDirective($compile) {
154
- _classCallCheck(this, FilterDirective);
155
-
156
- this.$compile = $compile;
157
- this.restrict = 'E';
158
- this.scope = {
159
- name: '=',
160
- priority: '=',
161
- template: '=',
162
- update: '&'
163
- };
164
- }
165
-
166
- _createClass(FilterDirective, [{
167
- key: 'link',
168
- value: function link($scope, $element, $attrs) {
169
- var template = $scope.template;
170
- var html = template.replace('%name%', '<editor-checkbox args="name" on-update="update({ $event })" add-br="false"></editor-checkbox>').replace('%priority%', '<editor-number args="priority" on-update="update({ $event })"></editor-number>');
171
- $element.html(html);
172
- this.$compile($element.contents())($scope);
173
- }
174
- }]);
175
-
176
- return FilterDirective;
177
- }();
178
-
179
- exports.default = FilterDirective;
180
-
181
- },{}],6:[function(require,module,exports){
182
- 'use strict';
183
-
184
- Object.defineProperty(exports, "__esModule", {
185
- value: true
186
- });
187
-
188
- var _angular = require('angular');
189
-
190
- var _angular2 = _interopRequireDefault(_angular);
191
-
192
- var _filter = require('./filter.directive');
193
-
194
- var _filter2 = _interopRequireDefault(_filter);
195
-
196
- var _advanced = require('./advanced.component');
197
-
198
- var _advanced2 = _interopRequireDefault(_advanced);
199
-
200
- var _components = require('./../../components/components');
201
-
202
- var _components2 = _interopRequireDefault(_components);
203
-
204
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
205
-
206
- var advanced = _angular2.default.module('app.common.advanced', [_components2.default]).directive('filter', ['$compile', function ($compile) {
207
- return new _filter2.default($compile);
208
- }]).component('advancedEditor', _advanced2.default).name;
209
-
210
- exports.default = advanced;
211
-
212
- },{"./../../components/components":18,"./advanced.component":4,"./filter.directive":5,"angular":42}],7:[function(require,module,exports){
213
- "use strict";
214
-
215
- Object.defineProperty(exports, "__esModule", {
216
- value: true
217
- });
218
-
219
- var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
220
-
221
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
222
-
223
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
224
-
225
- var BaseController = function () {
226
- function BaseController() {
227
- _classCallCheck(this, BaseController);
228
- }
229
-
230
- _createClass(BaseController, [{
231
- key: "$onChanges",
232
- value: function $onChanges(changes) {
233
- var _this = this;
234
-
235
- if (changes.settings) {
236
- this.settings = _extends({}, this.settings);
237
- this.values = Object.keys(this.settings).reduce(function (prev, key) {
238
- prev[key] = _this.settings[key].value;
239
- return prev;
240
- }, {});
241
- }
242
- }
243
- }, {
244
- key: "update",
245
- value: function update(_ref) {
246
- var key = _ref.key,
247
- value = _ref.value;
248
-
249
- this.values[key] = value;
250
- }
251
- }, {
252
- key: "updateValue",
253
- value: function updateValue(key, value) {
254
- this.settings[key] = _extends({}, this.settings[key], { value: value });
255
- this.values[key] = value;
256
- }
257
- }]);
258
-
259
- return BaseController;
260
- }();
261
-
262
- exports.default = BaseController;
263
-
264
- },{}],8:[function(require,module,exports){
265
- 'use strict';
266
-
267
- Object.defineProperty(exports, "__esModule", {
268
- value: true
269
- });
270
-
271
- var _angular = require('angular');
272
-
273
- var _angular2 = _interopRequireDefault(_angular);
274
-
275
- var _select = require('./select');
276
-
277
- var _select2 = _interopRequireDefault(_select);
278
-
279
- var _visual = require('./visual');
280
-
281
- var _visual2 = _interopRequireDefault(_visual);
282
-
283
- var _import = require('./import');
284
-
285
- var _import2 = _interopRequireDefault(_import);
286
-
287
- var _advanced = require('./advanced');
288
-
289
- var _advanced2 = _interopRequireDefault(_advanced);
290
-
291
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
292
-
293
- var components = _angular2.default.module('app.common', [_select2.default, _visual2.default, _import2.default, _advanced2.default]).name;
294
-
295
- exports.default = components;
296
-
297
- },{"./advanced":6,"./import":11,"./select":12,"./visual":15,"angular":42}],9:[function(require,module,exports){
298
- 'use strict';
299
-
300
- Object.defineProperty(exports, "__esModule", {
301
- value: true
302
- });
303
-
304
- var _import = require('./import.controller');
305
-
306
- var _import2 = _interopRequireDefault(_import);
307
-
308
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
309
-
310
- var ImportComponent = {
311
- bindings: {
312
- i18n: '<'
313
- },
314
- require: {
315
- form: '^form'
316
- },
317
- controller: _import2.default,
318
- template: '\n <h2>{{ ::$ctrl.i18n.title }}</h2>\n <table class="form-table">\n <tbody>\n <tr>\n <th><label>{{ ::$ctrl.i18n.export_title }}</label></th>\n <td>\n <a href="{{ ::$ctrl.i18n.export_url }}" class="button button-default">\n {{ ::$ctrl.i18n.export_button_text }}\n </a>\n </td>\n </tr>\n <tr>\n <th><label>{{ ::$ctrl.i18n.import_title }}</label></th>\n <td>\n <input type="file" name="import" ng-change="$ctrl.upload()" ng-model="$ctrl.file" ngf-accept="\'.json\'"\n ngf-select="$ctrl.upload()" ngf-max-size="1MB" />\n </td>\n </tr>\n </tbody>\n </table>\n '
319
- };
320
-
321
- exports.default = ImportComponent;
322
-
323
- },{"./import.controller":10}],10:[function(require,module,exports){
324
- 'use strict';
325
-
326
- Object.defineProperty(exports, "__esModule", {
327
- value: true
328
- });
329
-
330
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
331
-
332
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
333
-
334
- var ImportController = function () {
335
- function ImportController(Upload) {
336
- _classCallCheck(this, ImportController);
337
-
338
- this.Upload = Upload;
339
- }
340
-
341
- _createClass(ImportController, [{
342
- key: 'upload',
343
- value: function upload() {
344
- document.getElementById('jpibfi-form').submit();
345
- }
346
- }]);
347
-
348
- return ImportController;
349
- }();
350
-
351
- ImportController.$inject = ['Upload'];
352
-
353
- exports.default = ImportController;
354
-
355
- },{}],11:[function(require,module,exports){
356
- 'use strict';
357
-
358
- Object.defineProperty(exports, "__esModule", {
359
- value: true
360
- });
361
-
362
- var _angular = require('angular');
363
-
364
- var _angular2 = _interopRequireDefault(_angular);
365
-
366
- var _import = require('./import.component');
367
-
368
- var _import2 = _interopRequireDefault(_import);
369
-
370
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
371
-
372
- var importComponentName = _angular2.default.module('app.common.import', []).component('importEditor', _import2.default).name;
373
-
374
- exports.default = importComponentName;
375
-
376
- },{"./import.component":9,"angular":42}],12:[function(require,module,exports){
377
- 'use strict';
378
-
379
- Object.defineProperty(exports, "__esModule", {
380
- value: true
381
- });
382
-
383
- var _angular = require('angular');
384
-
385
- var _angular2 = _interopRequireDefault(_angular);
386
-
387
- var _resolution = require('./resolution.directive');
388
-
389
- var _resolution2 = _interopRequireDefault(_resolution);
390
-
391
- var _select = require('./select.component');
392
-
393
- var _select2 = _interopRequireDefault(_select);
394
-
395
- var _components = require('./../../components/components');
396
-
397
- var _components2 = _interopRequireDefault(_components);
398
-
399
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
400
-
401
- var select = _angular2.default.module('app.common.select', [_components2.default]).directive('resolution', ['$compile', function ($compile) {
402
- return new _resolution2.default($compile);
403
- }]).component('selectEditor', _select2.default).name;
404
-
405
- exports.default = select;
406
-
407
- },{"./../../components/components":18,"./resolution.directive":13,"./select.component":14,"angular":42}],13:[function(require,module,exports){
408
- 'use strict';
409
-
410
- Object.defineProperty(exports, "__esModule", {
411
- value: true
412
- });
413
-
414
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
415
-
416
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
417
-
418
- var ResolutionDirective = function () {
419
- function ResolutionDirective($compile) {
420
- _classCallCheck(this, ResolutionDirective);
421
-
422
- this.$compile = $compile;
423
- this.restrict = 'E';
424
- this.scope = {
425
- height: '=',
426
- width: '=',
427
- template: '=',
428
- update: '&'
429
- };
430
- }
431
-
432
- _createClass(ResolutionDirective, [{
433
- key: 'link',
434
- value: function link($scope, $element, $attrs) {
435
- var template = $scope.template;
436
- var html = template.replace('%height%', '<editor-number args="height" on-update="update({ $event })"></editor-number>').replace('%width%', '<editor-number args="width" on-update="update({ $event })"></editor-number>');
437
- $element.html(html);
438
- this.$compile($element.contents())($scope);
439
- }
440
- }]);
441
-
442
- return ResolutionDirective;
443
- }();
444
-
445
- exports.default = ResolutionDirective;
446
-
447
- },{}],14:[function(require,module,exports){
448
- 'use strict';
449
-
450
- Object.defineProperty(exports, "__esModule", {
451
- value: true
452
- });
453
-
454
- var _base = require('./../base.controller');
455
-
456
- var _base2 = _interopRequireDefault(_base);
457
-
458
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
459
-
460
- var SelectComponent = {
461
- bindings: {
462
- settings: '<',
463
- i18n: '<'
464
- },
465
- controller: _base2.default,
466
- template: '\n <h2>{{ $ctrl.i18n.title }}</h2>\n <table class="form-table">\n <tbody>\n <tr>\n <th><label for="image_selector">{{ ::$ctrl.settings.image_selector.label }}</label></th>\n <td>\n <editor-textarea args="$ctrl.settings.image_selector" on-update="$ctrl.update($event)"></editor-textarea>\n <p class="description" ng-bind-html="$ctrl.settings.image_selector.desc"></p>\n </td>\n </tr>\n <tr>\n <th><label for="disabled_classes">{{ ::$ctrl.settings.disabled_classes.label }}</label></th>\n <td>\n <editor-text args="$ctrl.settings.disabled_classes" on-update="$ctrl.update($event)"></editor-text>\n <p class="description" ng-bind-html="$ctrl.settings.disabled_classes.desc"></p>\n </td>\n </tr>\n <tr>\n <th><label for="enabled_classes">{{ ::$ctrl.settings.enabled_classes.label }}</label></th>\n <td>\n <editor-text args="$ctrl.settings.enabled_classes" on-update="$ctrl.update($event)"></editor-text>\n <p class="description" ng-bind-html="$ctrl.settings.enabled_classes.desc"></p>\n </td>\n </tr>\n <tr>\n <th>{{ ::$ctrl.i18n.image_resolution_label }}</th>\n <td>\n <p>\n <resolution height="$ctrl.settings.min_image_height_small" width="$ctrl.settings.min_image_width_small"\n update="$ctrl.update($event)" template="$ctrl.i18n.min_resolution_template_small">\n </resolution>\n </p>\n <p>\n <resolution height="$ctrl.settings.min_image_height" width="$ctrl.settings.min_image_width"\n update="$ctrl.update($event)" template="$ctrl.i18n.min_resolution_template">\n </resolution>\n </p>\n <p class="description" ng-bind-html="$ctrl.i18n.image_resolution_desc"></p>\n <p class="description" ng-bind-html="$ctrl.i18n.image_resolution_desc_2"></p>\n </td>\n </tr>\n <tr>\n <th>{{ ::$ctrl.i18n.show_on_field_label }}</th>\n <td>\n <p>\n <label for="show_on">{{ ::$ctrl.settings.show_on.label }}:</label><br/>\n <editor-textarea args="$ctrl.settings.show_on" on-update="$ctrl.update($event)"></editor-text>\n </p>\n <p>\n <label for="disable_on">{{ ::$ctrl.settings.disable_on.label }}:</label><br/>\n <editor-textarea args="$ctrl.settings.disable_on" on-update="$ctrl.update($event)"></editor-text>\n </p>\n <p class="description" ng-bind-html="$ctrl.i18n.show_on_field_desc"></p>\n </td>\n </tr>\n </tbody>\n </table>\n '
467
- };
468
-
469
- exports.default = SelectComponent;
470
-
471
- },{"./../base.controller":7}],15:[function(require,module,exports){
472
- 'use strict';
473
-
474
- Object.defineProperty(exports, "__esModule", {
475
- value: true
476
- });
477
-
478
- var _angular = require('angular');
479
-
480
- var _angular2 = _interopRequireDefault(_angular);
481
-
482
- var _visual = require('./visual.component');
483
-
484
- var _visual2 = _interopRequireDefault(_visual);
485
-
486
- var _components = require('./../../components/components');
487
-
488
- var _components2 = _interopRequireDefault(_components);
489
-
490
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
491
-
492
- var visual = _angular2.default.module('app.common.visual', [_components2.default]).component('visualEditor', _visual2.default).name;
493
-
494
- exports.default = visual;
495
-
496
- },{"./../../components/components":18,"./visual.component":16,"angular":42}],16:[function(require,module,exports){
497
- 'use strict';
498
-
499
- Object.defineProperty(exports, "__esModule", {
500
- value: true
501
- });
502
-
503
- var _visual = require('./visual.controller');
504
-
505
- var _visual2 = _interopRequireDefault(_visual);
506
-
507
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
508
-
509
- var VisualComponent = {
510
- bindings: {
511
- settings: '<',
512
- i18n: '<'
513
- },
514
- controller: _visual2.default,
515
- template: '\n <h2>{{ $ctrl.i18n.title }}</h2>\n <table class="form-table">\n <tbody>\n <tr>\n <th><label for="show_button">{{ ::$ctrl.settings.show_button.label }}</label></th>\n <td>\n <editor-select args="$ctrl.settings.show_button" on-update="$ctrl.update($event)"></editor-select>\n <p class="description" ng-bind-html="$ctrl.settings.show_button.desc"></p>\n <p ng-if="$ctrl.values.show_button != \'hover\'">\n <b ng-bind-html="$ctrl.i18n.pro_feature_error"></b>\n </p>\n </td>\n </tr>\n <tr>\n <th><label>{{ ::$ctrl.settings.description_option.label }}</label></th>\n <td>\n <editor-sortable-select args="$ctrl.settings.description_option" on-update="$ctrl.update($event)"></editor-sortable-select>\n <p class="description" ng-bind-html="$ctrl.settings.description_option.desc"></p>\n </td>\n </tr>\n <tr>\n <th><label for="pinLinkedImages">{{ ::$ctrl.settings.pinLinkedImages.label }}</label></th>\n <td>\n <editor-checkbox args="$ctrl.settings.pinLinkedImages" on-update="$ctrl.update($event)"></editor-checkbox>\n <p class="description" ng-bind-html="$ctrl.settings.pinLinkedImages.desc"></p>\n </td>\n </tr>\n <tr>\n <th><label for="transparency_value">{{ ::$ctrl.settings.transparency_value.label }}</label></th>\n <td>\n <editor-number args="$ctrl.settings.transparency_value" on-update="$ctrl.update($event)"></editor-number>\n <p class="description" ng-bind-html="$ctrl.settings.transparency_value.desc"></p>\n </td>\n </tr>\n <tr>\n <th><label>{{ ::$ctrl.settings.pin_image.label }}</label></th>\n <td>\n <table class="jpibfi-inner-table">\n <tr>\n <th>{{ ::$ctrl.i18n.mode }}</th>\n <th ng-if="$ctrl.values.pin_image != \'old_default\'">{{ ::$ctrl.i18n.settings }}</th>\n <th>{{ ::$ctrl.i18n.preview }}</th>\n </tr>\n <tr>\n <td>\n <p><label><input type="radio" name="{{ ::$ctrl.settings.pin_image.key }}" ng_model="$ctrl.values.pin_image" value="old_default">{{ ::$ctrl.settings.pin_image.options[\'old_default\'] }}</label></p>\n <p><label><input type="radio" name="{{ ::$ctrl.settings.pin_image.key }}" ng_model="$ctrl.values.pin_image" value="default">{{ ::$ctrl.settings.pin_image.options[\'default\'] }}</label></p>\n <p><label><input type="radio" name="{{ ::$ctrl.settings.pin_image.key }}" ng_model="$ctrl.values.pin_image" value="custom">{{ ::$ctrl.settings.pin_image.options[\'custom\'] }}</label></p>\n </td>\n <td ng-if="$ctrl.values.pin_image != \'old_default\'">\n <div ng-show="$ctrl.values.pin_image == \'default\'">\n <p>\n <label for="pin_image_icon">{{ ::$ctrl.settings.pin_image_icon.label }}</label>\n <editor-select args="$ctrl.settings.pin_image_icon" on-update="$ctrl.update($event)"></editor-select>\n <p ng-if="$ctrl.values.pin_image_icon != \'circle\'">\n <b ng-bind-html="$ctrl.i18n.pro_feature_error"></b>\n </p>\n </p>\n <p>\n <label for="pin_image_size">{{ ::$ctrl.settings.pin_image_size.label }}</label>\n <editor-select args="$ctrl.settings.pin_image_size" on-update="$ctrl.update($event)"></editor-select>\n </p>\n <p>\n <label for="pin_image_button">{{ ::$ctrl.settings.pin_image_button.label }}</label>\n <editor-select args="$ctrl.settings.pin_image_button" on-update="$ctrl.update($event)"></editor-select>\n </p>\n </div>\n <div ng-if="$ctrl.values.pin_image == \'custom\'">\n <p><button type="button" class="button button-default" ng-click="$ctrl.upload()">{{ ::$ctrl.i18n.custom_button_upload }}</button></p>\n <p>\n <label for="custom_image_url">{{ ::$ctrl.settings.custom_image_url.label }}</label>\n <editor-text args="$ctrl.settings.custom_image_url" on-update="$ctrl.update($event)"></editor-text>\n </p>\n <p>\n <div style="display: inline-block; width: 49%;">\n <label for="custom_image_height">{{ ::$ctrl.settings.custom_image_height.label }}</label>\n <editor-number args="$ctrl.settings.custom_image_height" on-update="$ctrl.update($event)"></editor-number>\n </div>\n <div style="display: inline-block; width: 49%;">\n <label for="custom_image_width">{{ ::$ctrl.settings.custom_image_width.label }}</label>\n <editor-number args="$ctrl.settings.custom_image_width" on-update="$ctrl.update($event)"></editor-number>\n </div>\n </p>\n <p class="description" ng-bind-html="$ctrl.i18n.custom_button_desc"></p>\n </div>\n </td>\n <td>\n <div ng-if="$ctrl.values.pin_image == \'old_default\'">\n <a class="pinit-button old_default"><span></span></a>\n </div>\n <div ng-show="$ctrl.values.pin_image == \'default\'">\n <a class="pinit-button default" ng-class="[\'jpibfi-size-\' + $ctrl.values.pin_image_size, \'jpibfi-button-\' + $ctrl.values.pin_image_button]">\n <span ng-class="[\'jpibfi-icon-\' + $ctrl.values.pin_image_icon]"></span>\n </a>\n </div>\n <div ng-show="$ctrl.values.pin_image == \'custom\'">\n <div ng-if="$ctrl.values.custom_image_url">\n <div style="width: {{ $ctrl.values.custom_image_width }}px;\n height: {{ $ctrl.values.custom_image_height }}px;\n background-image: url(\'{{ $ctrl.values.custom_image_url }}\');">\n </div>\n </div>\n <div ng-if="!$ctrl.values.custom_image_url">\n {{ ::$ctrl.i18n.custom_button_no_image_to_preview }}\n </div>\n </div>\n </td>\n </tr>\n </table>\n </tr>\n <tr>\n <th><label for="button_position">{{ ::$ctrl.settings.button_position.label }}</label></th>\n <td>\n <editor-select args="$ctrl.settings.button_position" on-update="$ctrl.update($event)"></editor-select>\n <p class="description" ng-bind-html="$ctrl.settings.button_position.desc"></p>\n </td>\n </tr>\n <tr>\n <th><label>{{ ::$ctrl.i18n.margins_label }}</label></th>\n <td>\n <p>\n <label for="button_margin_top">{{ ::$ctrl.settings.button_margin_top.label }}</label>\n <editor-number ng-disabled="!$ctrl.marginAvailability.top" args="$ctrl.settings.button_margin_top" on-update="$ctrl.update($event)">\n </editor-number>\n </p>\n <p>\n <label for="button_margin_bottom">{{ ::$ctrl.settings.button_margin_bottom.label }}</label>\n <editor-number ng-disabled="!$ctrl.marginAvailability.bottom" args="$ctrl.settings.button_margin_bottom" on-update="$ctrl.update($event)">\n </editor-number>\n </p>\n <p>\n <label for="button_margin_left">{{ ::$ctrl.settings.button_margin_left.label }}</label>\n <editor-number ng-disabled="!$ctrl.marginAvailability.left" args="$ctrl.settings.button_margin_left" on-update="$ctrl.update($event)">\n </editor-number>\n </p>\n <p>\n <label for="button_margin_right">{{ ::$ctrl.settings.button_margin_right.label }}</label>\n <editor-number ng-disabled="!$ctrl.marginAvailability.right" args="$ctrl.settings.button_margin_right" on-update="$ctrl.update($event)">\n </editor-number>\n </p>\n <p class="description" ng-bind-html="$ctrl.i18n.margins_desc"></p>\n </td>\n </tr>\n </tbody>\n </table>\n <p ng-bind-html="$ctrl.i18n.attribution"></p>\n '
516
- };
517
-
518
- exports.default = VisualComponent;
519
-
520
- },{"./visual.controller":17}],17:[function(require,module,exports){
521
- 'use strict';
522
-
523
- Object.defineProperty(exports, "__esModule", {
524
- value: true
525
- });
526
-
527
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
528
-
529
- var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
530
-
531
- var _base = require('./../base.controller');
532
-
533
- var _base2 = _interopRequireDefault(_base);
534
-
535
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
536
-
537
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
538
-
539
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
540
-
541
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
542
-
543
- var VisualController = function (_BaseController) {
544
- _inherits(VisualController, _BaseController);
545
-
546
- function VisualController($scope) {
547
- _classCallCheck(this, VisualController);
548
-
549
- var _this = _possibleConstructorReturn(this, (VisualController.__proto__ || Object.getPrototypeOf(VisualController)).call(this));
550
-
551
- _this.$scope = $scope;
552
- _this.fileFrame = null;
553
- return _this;
554
- }
555
-
556
- _createClass(VisualController, [{
557
- key: '$onChanges',
558
- value: function $onChanges(changes) {
559
- _get(VisualController.prototype.__proto__ || Object.getPrototypeOf(VisualController.prototype), '$onChanges', this).call(this, changes);
560
- this.updateMarginAvailability();
561
- }
562
- }, {
563
- key: 'update',
564
- value: function update(_ref) {
565
- var key = _ref.key,
566
- value = _ref.value;
567
-
568
- this.values[key] = value;
569
- if (key === 'button_position') {
570
- this.updateMarginAvailability();
571
- }
572
- }
573
- }, {
574
- key: 'updateMarginAvailability',
575
- value: function updateMarginAvailability() {
576
- var btnPosition = this.values.button_position;
577
- this.marginAvailability = {
578
- top: btnPosition === 'top-left' || btnPosition === 'top-right',
579
- bottom: btnPosition === 'bottom-left' || btnPosition === 'bottom-right',
580
- left: btnPosition === 'top-left' || btnPosition === 'bottom-left',
581
- right: btnPosition === 'top-right' || btnPosition === 'bottom-right'
582
- };
583
- }
584
- }, {
585
- key: 'upload',
586
- value: function upload($event) {
587
- var _this2 = this;
588
-
589
- if (this.fileFrame) {
590
- this.fileFrame.open();
591
- return;
592
- }
593
-
594
- this.fileFrame = wp.media.frames.file_frame = wp.media({
595
- title: this.i18n.custom_button_frame_title,
596
- button: {
597
- text: this.i18n.custom_button_frame_button_text
598
- },
599
- multiple: false
600
- }).on('select', function () {
601
- var image = _this2.fileFrame.state().get('selection').first().toJSON();
602
- _this2.updateValue('custom_image_url', image.url);
603
- _this2.updateValue('custom_image_width', image.width);
604
- _this2.updateValue('custom_image_height', image.height);
605
- _this2.$scope.$digest();
606
- });
607
-
608
- this.fileFrame.open();
609
- }
610
- }]);
611
-
612
- return VisualController;
613
- }(_base2.default);
614
-
615
- VisualController.$inject = ['$scope'];
616
-
617
- exports.default = VisualController;
618
-
619
- },{"./../base.controller":7}],18:[function(require,module,exports){
620
- 'use strict';
621
-
622
- Object.defineProperty(exports, "__esModule", {
623
- value: true
624
- });
625
-
626
- var _angular = require('angular');
627
-
628
- var _angular2 = _interopRequireDefault(_angular);
629
-
630
- var _navbar = require('./navbar');
631
-
632
- var _navbar2 = _interopRequireDefault(_navbar);
633
-
634
- var _editors = require('./editors');
635
-
636
- var _editors2 = _interopRequireDefault(_editors);
637
-
638
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
639
-
640
- var components = _angular2.default.module('app.components', [_navbar2.default, _editors2.default]).name;
641
-
642
- exports.default = components;
643
-
644
- },{"./editors":32,"./navbar":33,"angular":42}],19:[function(require,module,exports){
645
- 'use strict';
646
-
647
- Object.defineProperty(exports, "__esModule", {
648
- value: true
649
- });
650
-
651
- var _editorCheckbox = require('./editor.checkbox.controller');
652
-
653
- var _editorCheckbox2 = _interopRequireDefault(_editorCheckbox);
654
-
655
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
656
-
657
- var EditorCheckboxComponent = {
658
- bindings: {
659
- args: '<',
660
- onUpdate: '&',
661
- addBr: '<?'
662
- },
663
- controller: _editorCheckbox2.default,
664
- template: '<input type="checkbox" ng-change="$ctrl.change()" name="{{ ::$ctrl.key }}" id="{{ ::$ctrl.key }}" ng-model="$ctrl.value">\n <label for="{{ ::$ctrl.key }}">{{ ::$ctrl.args.text }}</label>\n <span ng-if="$ctrl.args.tooltip" tooltips tooltip-template="{{ ::$ctrl.args.tooltip }}" class="dashicons dashicons-editor-help"></span>\n <br ng-if="$ctrl.addBr" />'
665
- };
666
-
667
- exports.default = EditorCheckboxComponent;
668
-
669
- },{"./editor.checkbox.controller":20}],20:[function(require,module,exports){
670
- 'use strict';
671
-
672
- Object.defineProperty(exports, "__esModule", {
673
- value: true
674
- });
675
-
676
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
677
-
678
- var _editor = require('./editor.controller');
679
-
680
- var _editor2 = _interopRequireDefault(_editor);
681
-
682
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
683
-
684
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
685
-
686
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
687
-
688
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
689
-
690
- var EditorCheckboxController = function (_controller) {
691
- _inherits(EditorCheckboxController, _controller);
692
-
693
- function EditorCheckboxController() {
694
- _classCallCheck(this, EditorCheckboxController);
695
-
696
- return _possibleConstructorReturn(this, (EditorCheckboxController.__proto__ || Object.getPrototypeOf(EditorCheckboxController)).apply(this, arguments));
697
- }
698
-
699
- _createClass(EditorCheckboxController, [{
700
- key: '$onInit',
701
- value: function $onInit() {
702
- if (undefined === this.addBr) {
703
- this.addBr = true;
704
- }
705
- }
706
- }]);
707
-
708
- return EditorCheckboxController;
709
- }(_editor2.default);
710
-
711
- exports.default = EditorCheckboxController;
712
-
713
- },{"./editor.controller":21}],21:[function(require,module,exports){
714
- "use strict";
715
-
716
- Object.defineProperty(exports, "__esModule", {
717
- value: true
718
- });
719
-
720
- var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
721
-
722
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
723
-
724
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
725
-
726
- var EditorController = function () {
727
- function EditorController() {
728
- _classCallCheck(this, EditorController);
729
- }
730
-
731
- _createClass(EditorController, [{
732
- key: "$onChanges",
733
- value: function $onChanges(changes) {
734
- if (changes.args) {
735
- this.args = _extends({}, this.args);
736
- this.key = this.args.key;
737
- this.value = this.args.value;
738
- }
739
- }
740
- }, {
741
- key: "change",
742
- value: function change() {
743
- this.onUpdate({
744
- $event: {
745
- key: this.key,
746
- value: this.value
747
- }
748
- });
749
- }
750
- }]);
751
-
752
- return EditorController;
753
- }();
754
-
755
- EditorController.$inject = [];
756
-
757
- exports.default = EditorController;
758
-
759
- },{}],22:[function(require,module,exports){
760
- 'use strict';
761
-
762
- Object.defineProperty(exports, "__esModule", {
763
- value: true
764
- });
765
-
766
- var _editorImage = require('./editor.image.controller');
767
-
768
- var _editorImage2 = _interopRequireDefault(_editorImage);
769
-
770
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
771
-
772
- var EditorImageComponent = {
773
- bindings: {
774
- args: '<',
775
- onUpdate: '&',
776
- class: '@'
777
- },
778
- controller: _editorImage2.default,
779
- template: '<input type="text" id="{{ $ctrl.key }}" name="{{ ::$ctrl.args.key }}" ng-model="$ctrl.value" ng-change="$ctrl.change()" class="regular-text" />\n<input type="button" class="button" value="{{ ::$ctrl.args.button_text }}" ng-click="$ctrl.selectFile()" />'
780
- };
781
-
782
- exports.default = EditorImageComponent;
783
-
784
- },{"./editor.image.controller":23}],23:[function(require,module,exports){
785
- 'use strict';
786
-
787
- Object.defineProperty(exports, "__esModule", {
788
- value: true
789
- });
790
-
791
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
792
-
793
- var _editor = require('./editor.controller');
794
-
795
- var _editor2 = _interopRequireDefault(_editor);
796
-
797
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
798
-
799
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
800
-
801
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
802
-
803
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
804
-
805
- var ImageController = function (_BaseController) {
806
- _inherits(ImageController, _BaseController);
807
-
808
- function ImageController($scope) {
809
- _classCallCheck(this, ImageController);
810
-
811
- var _this = _possibleConstructorReturn(this, (ImageController.__proto__ || Object.getPrototypeOf(ImageController)).call(this));
812
-
813
- _this.$scope = $scope;
814
- return _this;
815
- }
816
-
817
- _createClass(ImageController, [{
818
- key: 'selectFile',
819
- value: function selectFile() {
820
- var _this2 = this;
821
-
822
- this.fileFrame = this.fileFrame || null;
823
- if (this.fileFrame) {
824
- return this.fileFrame.open();
825
- }
826
-
827
- this.fileFrame = wp.media.frames.file_frame = wp.media({
828
- title: this.args.title_text,
829
- button: {
830
- text: this.args.button_text
831
- },
832
- multiple: false
833
- }).on('select', function () {
834
- var image = _this2.fileFrame.state().get('selection').first().toJSON();
835
- _this2.value = image.url;
836
- _this2.onUpdate({
837
- $event: {
838
- key: _this2.key,
839
- value: _this2.value
840
- }
841
- });
842
- _this2.$scope.$apply();
843
- });
844
-
845
- this.fileFrame.open();
846
- }
847
- }]);
848
-
849
- return ImageController;
850
- }(_editor2.default);
851
-
852
- ImageController.$inject = ['$scope'];
853
-
854
- exports.default = ImageController;
855
-
856
- },{"./editor.controller":21}],24:[function(require,module,exports){
857
- 'use strict';
858
-
859
- Object.defineProperty(exports, "__esModule", {
860
- value: true
861
- });
862
-
863
- var _editor = require('./editor.controller');
864
-
865
- var _editor2 = _interopRequireDefault(_editor);
866
-
867
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
868
-
869
- var EditorNumberComponent = {
870
- bindings: {
871
- args: '<',
872
- ngDisabled: '<',
873
- onUpdate: '&'
874
- },
875
- controller: _editor2.default,
876
- template: '\n <input id="{{ $ctrl.key }}" name="{{ ::$ctrl.args.key }}" ng-disabled="$ctrl.ngDisabled" number-attributes="$ctrl.args" class="small-text" type="number" ng-model="$ctrl.value" ng-change="$ctrl.change()" />'
877
- };
878
-
879
- exports.default = EditorNumberComponent;
880
-
881
- },{"./editor.controller":21}],25:[function(require,module,exports){
882
- 'use strict';
883
-
884
- Object.defineProperty(exports, "__esModule", {
885
- value: true
886
- });
887
-
888
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
889
-
890
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
891
-
892
- var NumberAttributes = function () {
893
- function NumberAttributes($parse) {
894
- _classCallCheck(this, NumberAttributes);
895
-
896
- this.$parse = $parse;
897
- this.restrict = 'A';
898
- }
899
-
900
- _createClass(NumberAttributes, [{
901
- key: 'link',
902
- value: function link($scope, $element, $attrs) {
903
- var args = this.$parse($attrs.numberAttributes)($scope);
904
- var attributes = ['step', 'min', 'max'];
905
- attributes.forEach(function (attName) {
906
- if (args[attName] !== undefined) {
907
- $element.attr(attName, args[attName]);
908
- }
909
- });
910
- }
911
- }]);
912
-
913
- return NumberAttributes;
914
- }();
915
-
916
- exports.default = NumberAttributes;
917
-
918
- },{}],26:[function(require,module,exports){
919
- 'use strict';
920
-
921
- Object.defineProperty(exports, "__esModule", {
922
- value: true
923
- });
924
-
925
- var _editorSelect = require('./editor.select.controller');
926
-
927
- var _editorSelect2 = _interopRequireDefault(_editorSelect);
928
-
929
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
930
-
931
- var EditorSelectComponent = {
932
- bindings: {
933
- args: '<',
934
- onUpdate: '&'
935
- },
936
- controller: _editorSelect2.default,
937
- template: '\n <select name="{{ ::$ctrl.key }}" ng-model="$ctrl.value" id="{{ ::$ctrl.args.key }}" ng-change="$ctrl.change()">\n <option ng-repeat="(value, name) in $ctrl.args.options" value="{{ value }}">{{ name }}</option>\n </select>'
938
- };
939
-
940
- exports.default = EditorSelectComponent;
941
-
942
- },{"./editor.select.controller":27}],27:[function(require,module,exports){
943
- 'use strict';
944
-
945
- Object.defineProperty(exports, "__esModule", {
946
- value: true
947
- });
948
-
949
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
950
-
951
- var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
952
-
953
- var _editor = require('./editor.controller');
954
-
955
- var _editor2 = _interopRequireDefault(_editor);
956
-
957
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
958
-
959
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
960
-
961
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
962
-
963
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
964
-
965
- var SelectEditorController = function (_EditorController) {
966
- _inherits(SelectEditorController, _EditorController);
967
-
968
- function SelectEditorController() {
969
- _classCallCheck(this, SelectEditorController);
970
-
971
- return _possibleConstructorReturn(this, (SelectEditorController.__proto__ || Object.getPrototypeOf(SelectEditorController)).apply(this, arguments));
972
- }
973
-
974
- _createClass(SelectEditorController, [{
975
- key: '$onChanges',
976
- value: function $onChanges(changes) {
977
- _get(SelectEditorController.prototype.__proto__ || Object.getPrototypeOf(SelectEditorController.prototype), '$onChanges', this).call(this, changes);
978
- if (changes.args) {
979
- if (this.args.value === undefined || this.args.value === null) {
980
- this.value = Object.keys(this.args.options)[0];
981
- this.change();
982
- }
983
- if (this.args.truthy) {
984
- this.value = this.value ? '1' : '0';
985
- }
986
- }
987
- }
988
- }, {
989
- key: 'change',
990
- value: function change() {
991
- this.onUpdate({
992
- $event: {
993
- key: this.key,
994
- value: this.args.truthy ? this.value === '1' : this.value
995
- }
996
- });
997
- }
998
- }]);
999
-
1000
- return SelectEditorController;
1001
- }(_editor2.default);
1002
-
1003
- SelectEditorController.$inject = [];
1004
-
1005
- exports.default = SelectEditorController;
1006
-
1007
- },{"./editor.controller":21}],28:[function(require,module,exports){
1008
- 'use strict';
1009
-
1010
- Object.defineProperty(exports, "__esModule", {
1011
- value: true
1012
- });
1013
-
1014
- var _editorSortableSelect = require('./editor.sortableSelect.controller');
1015
-
1016
- var _editorSortableSelect2 = _interopRequireDefault(_editorSortableSelect);
1017
-
1018
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1019
-
1020
- var EditorSortableSelectComponent = {
1021
- bindings: {
1022
- args: '<',
1023
- onUpdate: '&'
1024
- },
1025
- controller: _editorSortableSelect2.default,
1026
- template: '\n <input type="hidden" name="{{ ::$ctrl.args.key }}" ng-value="$ctrl.hiddenInputValue" />\n <ul class="frizzly-sortable" dnd-list="$ctrl.options">\n <li ng-repeat="item in $ctrl.options"\n dnd-draggable="item"\n dnd-moved="$ctrl.options.splice($index, 1); $ctrl.change()"\n dnd-effect-allowed="move">\n <input type="checkbox" id="{{ item.key }}" ng-model="item.selected" ng-change="$ctrl.change()" />\n <label for="{{ item.key }}">{{ item.label }}\n </li>\n </ul>\n '
1027
- };
1028
-
1029
- exports.default = EditorSortableSelectComponent;
1030
-
1031
- },{"./editor.sortableSelect.controller":29}],29:[function(require,module,exports){
1032
- "use strict";
1033
-
1034
- Object.defineProperty(exports, "__esModule", {
1035
- value: true
1036
- });
1037
-
1038
- var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
1039
-
1040
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
1041
-
1042
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1043
-
1044
- var EditorController = function () {
1045
- function EditorController() {
1046
- _classCallCheck(this, EditorController);
1047
- }
1048
-
1049
- _createClass(EditorController, [{
1050
- key: "$onChanges",
1051
- value: function $onChanges(changes) {
1052
- var _this = this;
1053
-
1054
- if (changes.args) {
1055
- this.args = _extends({}, this.args);
1056
- this.key = this.args.key;
1057
- this.value = this.args.value || [];
1058
- this.hiddenInputValue = this.value;
1059
- var keysSorted = this.value.slice().concat(Object.keys(this.args.options).filter(function (key) {
1060
- return _this.value.indexOf(key) === -1;
1061
- }));
1062
- this.options = keysSorted.map(function (key) {
1063
- return { key: key, label: _this.args.options[key], selected: _this.value.indexOf(key) !== -1 };
1064
- });
1065
- }
1066
- }
1067
- }, {
1068
- key: "change",
1069
- value: function change() {
1070
- var value = this.options.reduce(function (prev, option) {
1071
- return option.selected ? prev.concat([option.key]) : prev;
1072
- }, []);
1073
- this.hiddenInputValue = value;
1074
- this.onUpdate({
1075
- $event: {
1076
- key: this.key,
1077
- value: value
1078
- }
1079
- });
1080
- }
1081
- }]);
1082
-
1083
- return EditorController;
1084
- }();
1085
-
1086
- EditorController.$inject = [];
1087
-
1088
- exports.default = EditorController;
1089
-
1090
- },{}],30:[function(require,module,exports){
1091
- 'use strict';
1092
-
1093
- Object.defineProperty(exports, "__esModule", {
1094
- value: true
1095
- });
1096
-
1097
- var _editor = require('./editor.controller');
1098
-
1099
- var _editor2 = _interopRequireDefault(_editor);
1100
-
1101
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1102
-
1103
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1104
-
1105
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
1106
-
1107
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
1108
-
1109
- var controller = function (_BaseController) {
1110
- _inherits(controller, _BaseController);
1111
-
1112
- function controller() {
1113
- _classCallCheck(this, controller);
1114
-
1115
- var _this = _possibleConstructorReturn(this, (controller.__proto__ || Object.getPrototypeOf(controller)).call(this));
1116
-
1117
- _this.class = 'regular-text';
1118
- return _this;
1119
- }
1120
-
1121
- return controller;
1122
- }(_editor2.default);
1123
-
1124
- var EditorTextComponent = {
1125
- bindings: {
1126
- args: '<',
1127
- onUpdate: '&',
1128
- class: '@',
1129
- ngDisabled: '<'
1130
- },
1131
- controller: controller,
1132
- template: '<input type="text" placeholder="{{ $ctrl.args.placeholder || \'\' }}" name="{{ ::$ctrl.key }}" id="{{ $ctrl.key }}" ng-model="$ctrl.value" ng-change="$ctrl.change()" ng-class="$ctrl.class" ng-disabled="$ctrl.ngDisabled" />'
1133
- };
1134
-
1135
- exports.default = EditorTextComponent;
1136
-
1137
- },{"./editor.controller":21}],31:[function(require,module,exports){
1138
- 'use strict';
1139
-
1140
- Object.defineProperty(exports, "__esModule", {
1141
- value: true
1142
- });
1143
-
1144
- var _editor = require('./editor.controller');
1145
-
1146
- var _editor2 = _interopRequireDefault(_editor);
1147
-
1148
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1149
-
1150
- var EditorTextAreaComponent = {
1151
- bindings: {
1152
- args: '<',
1153
- onUpdate: '&'
1154
- },
1155
- controller: _editor2.default,
1156
- template: '<textarea rows="3" cols="50" id="{{ $ctrl.key }}" name="{{ ::$ctrl.args.key }}" class="large-text code" ng-model="$ctrl.value" ng-change="$ctrl.change()"></textarea>'
1157
- };
1158
-
1159
- exports.default = EditorTextAreaComponent;
1160
-
1161
- },{"./editor.controller":21}],32:[function(require,module,exports){
1162
- 'use strict';
1163
-
1164
- Object.defineProperty(exports, "__esModule", {
1165
- value: true
1166
- });
1167
-
1168
- var _angular = require('angular');
1169
-
1170
- var _angular2 = _interopRequireDefault(_angular);
1171
-
1172
- var _editorText = require('./editor.text.component');
1173
-
1174
- var _editorText2 = _interopRequireDefault(_editorText);
1175
-
1176
- var _editorTextarea = require('./editor.textarea.component');
1177
-
1178
- var _editorTextarea2 = _interopRequireDefault(_editorTextarea);
1179
-
1180
- var _editorImage = require('./editor.image.component');
1181
-
1182
- var _editorImage2 = _interopRequireDefault(_editorImage);
1183
-
1184
- var _editorNumber = require('./editor.number.component');
1185
-
1186
- var _editorNumber2 = _interopRequireDefault(_editorNumber);
1187
-
1188
- var _editorNumber3 = require('./editor.number.directive');
1189
-
1190
- var _editorNumber4 = _interopRequireDefault(_editorNumber3);
1191
-
1192
- var _editorCheckbox = require('./editor.checkbox.component');
1193
-
1194
- var _editorCheckbox2 = _interopRequireDefault(_editorCheckbox);
1195
-
1196
- var _editorSelect = require('./editor.select.component');
1197
-
1198
- var _editorSelect2 = _interopRequireDefault(_editorSelect);
1199
-
1200
- var _editorSortableSelect = require('./editor.sortableSelect.component');
1201
-
1202
- var _editorSortableSelect2 = _interopRequireDefault(_editorSortableSelect);
1203
-
1204
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1205
-
1206
- var editors = _angular2.default.module('editors', ['dndLists']).component('editorText', _editorText2.default).component('editorTextarea', _editorTextarea2.default).component('editorImage', _editorImage2.default).component('editorNumber', _editorNumber2.default).component('editorCheckbox', _editorCheckbox2.default).component('editorSelect', _editorSelect2.default).component('editorSortableSelect', _editorSortableSelect2.default).directive('numberAttributes', ['$parse', function ($parse) {
1207
- return new _editorNumber4.default($parse);
1208
- }]).name;
1209
-
1210
- exports.default = editors;
1211
-
1212
- },{"./editor.checkbox.component":19,"./editor.image.component":22,"./editor.number.component":24,"./editor.number.directive":25,"./editor.select.component":26,"./editor.sortableSelect.component":28,"./editor.text.component":30,"./editor.textarea.component":31,"angular":42}],33:[function(require,module,exports){
1213
- 'use strict';
1214
-
1215
- Object.defineProperty(exports, "__esModule", {
1216
- value: true
1217
- });
1218
-
1219
- var _angular = require('angular');
1220
-
1221
- var _angular2 = _interopRequireDefault(_angular);
1222
-
1223
- var _navbar = require('./navbar.component');
1224
-
1225
- var _navbar2 = _interopRequireDefault(_navbar);
1226
-
1227
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1228
-
1229
- var navbar = _angular2.default.module('navbar', []).component('navbar', _navbar2.default).name;
1230
-
1231
- exports.default = navbar;
1232
-
1233
- },{"./navbar.component":34,"angular":42}],34:[function(require,module,exports){
1234
- 'use strict';
1235
-
1236
- Object.defineProperty(exports, "__esModule", {
1237
- value: true
1238
- });
1239
- var NavbarComponent = {
1240
- bindings: {
1241
- currentTab: '<',
1242
- tabs: '<',
1243
- page: '<',
1244
- links: '<'
1245
- },
1246
- controller: function controller() {},
1247
- template: '\n <h2 class="nav-tab-wrapper">\n <a ng-repeat="tab in $ctrl.tabs" \n href="?page={{ $ctrl.page }}&tab={{ tab.slug }}" class="nav-tab {{ $ctrl.currentTab == tab.slug ? \'nav-tab-active\' : \'\' }}">\n {{ tab.name }}\n </a>\n <a ng-repeat="link in $ctrl.links" href="{{ link.url }}" target="_blank" class="nav-tab">\n {{ link.label }}\n </a>\n </h2>\n '
1248
- };
1249
-
1250
- exports.default = NavbarComponent;
1251
-
1252
- },{}],35:[function(require,module,exports){
1253
- 'use strict';
1254
-
1255
- Object.defineProperty(exports, "__esModule", {
1256
- value: true
1257
- });
1258
-
1259
- var _angular = require('angular');
1260
-
1261
- var _angular2 = _interopRequireDefault(_angular);
1262
-
1263
- var _link = require('./link.service');
1264
-
1265
- var _link2 = _interopRequireDefault(_link);
1266
-
1267
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1268
-
1269
- var services = _angular2.default.module('services', []).service('linkService', _link2.default).name;
1270
-
1271
- exports.default = services;
1272
-
1273
- },{"./link.service":36,"angular":42}],36:[function(require,module,exports){
1274
- 'use strict';
1275
-
1276
- Object.defineProperty(exports, "__esModule", {
1277
- value: true
1278
- });
1279
-
1280
- var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
1281
-
1282
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
1283
-
1284
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1285
-
1286
- var LinkService = function () {
1287
- function LinkService() {
1288
- _classCallCheck(this, LinkService);
1289
-
1290
- this.baseLink = '';
1291
- }
1292
-
1293
- _createClass(LinkService, [{
1294
- key: 'init',
1295
- value: function init(page) {
1296
- this.baseLink = '?page=' + page;
1297
- }
1298
- }, {
1299
- key: 'generateQuery',
1300
- value: function generateQuery() {
1301
- for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
1302
- args[_key] = arguments[_key];
1303
- }
1304
-
1305
- return args.reduce(function (prev, _ref) {
1306
- var _ref2 = _slicedToArray(_ref, 2),
1307
- key = _ref2[0],
1308
- value = _ref2[1];
1309
-
1310
- return prev + '&' + key + '=' + value;
1311
- }, this.baseLink);
1312
- }
1313
- }]);
1314
-
1315
- return LinkService;
1316
- }();
1317
-
1318
- LinkService.$inject = [];
1319
-
1320
- exports.default = LinkService;
1321
-
1322
- },{}],37:[function(require,module,exports){
1323
- 'use strict';
1324
-
1325
- var _app = require('./app/app');
1326
-
1327
- var _app2 = _interopRequireDefault(_app);
1328
-
1329
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1330
-
1331
- },{"./app/app":3}],38:[function(require,module,exports){
1332
- angular.module('dndLists', [])
1333
-
1334
- .directive('dndDraggable', ['$parse', '$timeout', 'dndDropEffectWorkaround', 'dndDragTypeWorkaround',
1335
- function($parse, $timeout, dndDropEffectWorkaround, dndDragTypeWorkaround) {
1336
- return function(scope, element, attr) {
1337
- element.attr("draggable", "true");
1338
-
1339
- if (attr.dndDisableIf) {
1340
- scope.$watch(attr.dndDisableIf, function(disabled) {
1341
- element.attr("draggable", !disabled);
1342
- });
1343
- }
1344
-
1345
- element.on('dragstart', function(event) {
1346
- event = event.originalEvent || event;
1347
-
1348
- if (element.attr('draggable') == 'false') return true;
1349
-
1350
- event.dataTransfer.setData("Text", angular.toJson(scope.$eval(attr.dndDraggable)));
1351
-
1352
- event.dataTransfer.effectAllowed = attr.dndEffectAllowed || "move";
1353
-
1354
- element.addClass("dndDragging");
1355
- $timeout(function() { element.addClass("dndDraggingSource"); }, 0);
1356
-
1357
- dndDropEffectWorkaround.dropEffect = "none";
1358
- dndDragTypeWorkaround.isDragging = true;
1359
-
1360
- dndDragTypeWorkaround.dragType = attr.dndType ? scope.$eval(attr.dndType) : undefined;
1361
-
1362
- if (event._dndHandle && event.dataTransfer.setDragImage) {
1363
- event.dataTransfer.setDragImage(element[0], 0, 0);
1364
- }
1365
-
1366
- $parse(attr.dndDragstart)(scope, {event: event});
1367
-
1368
- event.stopPropagation();
1369
- });
1370
-
1371
- element.on('dragend', function(event) {
1372
- event = event.originalEvent || event;
1373
-
1374
- var dropEffect = dndDropEffectWorkaround.dropEffect;
1375
- scope.$apply(function() {
1376
- switch (dropEffect) {
1377
- case "move":
1378
- $parse(attr.dndMoved)(scope, {event: event});
1379
- break;
1380
- case "copy":
1381
- $parse(attr.dndCopied)(scope, {event: event});
1382
- break;
1383
- case "none":
1384
- $parse(attr.dndCanceled)(scope, {event: event});
1385
- break;
1386
- }
1387
- $parse(attr.dndDragend)(scope, {event: event, dropEffect: dropEffect});
1388
- });
1389
-
1390
- element.removeClass("dndDragging");
1391
- $timeout(function() { element.removeClass("dndDraggingSource"); }, 0);
1392
- dndDragTypeWorkaround.isDragging = false;
1393
- event.stopPropagation();
1394
- });
1395
-
1396
- element.on('click', function(event) {
1397
- if (!attr.dndSelected) return;
1398
-
1399
- event = event.originalEvent || event;
1400
- scope.$apply(function() {
1401
- $parse(attr.dndSelected)(scope, {event: event});
1402
- });
1403
-
1404
- event.stopPropagation();
1405
- });
1406
-
1407
- element.on('selectstart', function() {
1408
- if (this.dragDrop) this.dragDrop();
1409
- });
1410
- };
1411
- }])
1412
-
1413
- .directive('dndList', ['$parse', '$timeout', 'dndDropEffectWorkaround', 'dndDragTypeWorkaround',
1414
- function($parse, $timeout, dndDropEffectWorkaround, dndDragTypeWorkaround) {
1415
- return function(scope, element, attr) {
1416
- var placeholder = getPlaceholderElement();
1417
- var placeholderNode = placeholder[0];
1418
- var listNode = element[0];
1419
- placeholder.remove();
1420
-
1421
- var horizontal = attr.dndHorizontalList && scope.$eval(attr.dndHorizontalList);
1422
- var externalSources = attr.dndExternalSources && scope.$eval(attr.dndExternalSources);
1423
-
1424
- element.on('dragenter', function (event) {
1425
- event = event.originalEvent || event;
1426
- if (!isDropAllowed(event)) return true;
1427
- event.preventDefault();
1428
- });
1429
-
1430
- element.on('dragover', function(event) {
1431
- event = event.originalEvent || event;
1432
-
1433
- if (!isDropAllowed(event)) return true;
1434
-
1435
- if (placeholderNode.parentNode != listNode) {
1436
- element.append(placeholder);
1437
- }
1438
-
1439
- if (event.target !== listNode) {
1440
- var listItemNode = event.target;
1441
- while (listItemNode.parentNode !== listNode && listItemNode.parentNode) {
1442
- listItemNode = listItemNode.parentNode;
1443
- }
1444
-
1445
- if (listItemNode.parentNode === listNode && listItemNode !== placeholderNode) {
1446
- if (isMouseInFirstHalf(event, listItemNode)) {
1447
- listNode.insertBefore(placeholderNode, listItemNode);
1448
- } else {
1449
- listNode.insertBefore(placeholderNode, listItemNode.nextSibling);
1450
- }
1451
- }
1452
- } else {
1453
- if (isMouseInFirstHalf(event, placeholderNode, true)) {
1454
- while (placeholderNode.previousElementSibling
1455
- && (isMouseInFirstHalf(event, placeholderNode.previousElementSibling, true)
1456
- || placeholderNode.previousElementSibling.offsetHeight === 0)) {
1457
- listNode.insertBefore(placeholderNode, placeholderNode.previousElementSibling);
1458
- }
1459
- } else {
1460
- while (placeholderNode.nextElementSibling &&
1461
- !isMouseInFirstHalf(event, placeholderNode.nextElementSibling, true)) {
1462
- listNode.insertBefore(placeholderNode,
1463
- placeholderNode.nextElementSibling.nextElementSibling);
1464
- }
1465
- }
1466
- }
1467
-
1468
- if (attr.dndDragover && !invokeCallback(attr.dndDragover, event, getPlaceholderIndex())) {
1469
- return stopDragover();
1470
- }
1471
-
1472
- element.addClass("dndDragover");
1473
- event.preventDefault();
1474
- event.stopPropagation();
1475
- return false;
1476
- });
1477
-
1478
- element.on('drop', function(event) {
1479
- event = event.originalEvent || event;
1480
-
1481
- if (!isDropAllowed(event)) return true;
1482
-
1483
- event.preventDefault();
1484
-
1485
- var data = event.dataTransfer.getData("Text") || event.dataTransfer.getData("text/plain");
1486
- var transferredObject;
1487
- try {
1488
- transferredObject = JSON.parse(data);
1489
- } catch(e) {
1490
- return stopDragover();
1491
- }
1492
-
1493
- var index = getPlaceholderIndex();
1494
- if (attr.dndDrop) {
1495
- transferredObject = invokeCallback(attr.dndDrop, event, index, transferredObject);
1496
- if (!transferredObject) {
1497
- return stopDragover();
1498
- }
1499
- }
1500
-
1501
- if (transferredObject !== true) {
1502
- scope.$apply(function() {
1503
- scope.$eval(attr.dndList).splice(index, 0, transferredObject);
1504
- });
1505
- }
1506
- invokeCallback(attr.dndInserted, event, index, transferredObject);
1507
-
1508
- if (event.dataTransfer.dropEffect === "none") {
1509
- if (event.dataTransfer.effectAllowed === "copy" ||
1510
- event.dataTransfer.effectAllowed === "move") {
1511
- dndDropEffectWorkaround.dropEffect = event.dataTransfer.effectAllowed;
1512
- } else {
1513
- dndDropEffectWorkaround.dropEffect = event.ctrlKey ? "copy" : "move";
1514
- }
1515
- } else {
1516
- dndDropEffectWorkaround.dropEffect = event.dataTransfer.dropEffect;
1517
- }
1518
-
1519
- stopDragover();
1520
- event.stopPropagation();
1521
- return false;
1522
- });
1523
-
1524
- element.on('dragleave', function(event) {
1525
- event = event.originalEvent || event;
1526
-
1527
- element.removeClass("dndDragover");
1528
- $timeout(function() {
1529
- if (!element.hasClass("dndDragover")) {
1530
- placeholder.remove();
1531
- }
1532
- }, 100);
1533
- });
1534
-
1535
- function isMouseInFirstHalf(event, targetNode, relativeToParent) {
1536
- var mousePointer = horizontal ? (event.offsetX || event.layerX)
1537
- : (event.offsetY || event.layerY);
1538
- var targetSize = horizontal ? targetNode.offsetWidth : targetNode.offsetHeight;
1539
- var targetPosition = horizontal ? targetNode.offsetLeft : targetNode.offsetTop;
1540
- targetPosition = relativeToParent ? targetPosition : 0;
1541
- return mousePointer < targetPosition + targetSize / 2;
1542
- }
1543
-
1544
- function getPlaceholderElement() {
1545
- var placeholder;
1546
- angular.forEach(element.children(), function(childNode) {
1547
- var child = angular.element(childNode);
1548
- if (child.hasClass('dndPlaceholder')) {
1549
- placeholder = child;
1550
- }
1551
- });
1552
- return placeholder || angular.element("<li class='dndPlaceholder'></li>");
1553
- }
1554
-
1555
- function getPlaceholderIndex() {
1556
- return Array.prototype.indexOf.call(listNode.children, placeholderNode);
1557
- }
1558
-
1559
- function isDropAllowed(event) {
1560
- if (!dndDragTypeWorkaround.isDragging && !externalSources) return false;
1561
-
1562
- if (!hasTextMimetype(event.dataTransfer.types)) return false;
1563
-
1564
- if (attr.dndAllowedTypes && dndDragTypeWorkaround.isDragging) {
1565
- var allowed = scope.$eval(attr.dndAllowedTypes);
1566
- if (angular.isArray(allowed) && allowed.indexOf(dndDragTypeWorkaround.dragType) === -1) {
1567
- return false;
1568
- }
1569
- }
1570
-
1571
- if (attr.dndDisableIf && scope.$eval(attr.dndDisableIf)) return false;
1572
-
1573
- return true;
1574
- }
1575
-
1576
- function stopDragover() {
1577
- placeholder.remove();
1578
- element.removeClass("dndDragover");
1579
- return true;
1580
- }
1581
-
1582
- function invokeCallback(expression, event, index, item) {
1583
- return $parse(expression)(scope, {
1584
- event: event,
1585
- index: index,
1586
- item: item || undefined,
1587
- external: !dndDragTypeWorkaround.isDragging,
1588
- type: dndDragTypeWorkaround.isDragging ? dndDragTypeWorkaround.dragType : undefined
1589
- });
1590
- }
1591
-
1592
- function hasTextMimetype(types) {
1593
- if (!types) return true;
1594
- for (var i = 0; i < types.length; i++) {
1595
- if (types[i] === "Text" || types[i] === "text/plain") return true;
1596
- }
1597
-
1598
- return false;
1599
- }
1600
- };
1601
- }])
1602
-
1603
- .directive('dndNodrag', function() {
1604
- return function(scope, element, attr) {
1605
- element.attr("draggable", "true");
1606
-
1607
- element.on('dragstart', function(event) {
1608
- event = event.originalEvent || event;
1609
-
1610
- if (!event._dndHandle) {
1611
- if (!(event.dataTransfer.types && event.dataTransfer.types.length)) {
1612
- event.preventDefault();
1613
- }
1614
- event.stopPropagation();
1615
- }
1616
- });
1617
-
1618
- element.on('dragend', function(event) {
1619
- event = event.originalEvent || event;
1620
- if (!event._dndHandle) {
1621
- event.stopPropagation();
1622
- }
1623
- });
1624
- };
1625
- })
1626
-
1627
- .directive('dndHandle', function() {
1628
- return function(scope, element, attr) {
1629
- element.attr("draggable", "true");
1630
-
1631
- element.on('dragstart dragend', function(event) {
1632
- event = event.originalEvent || event;
1633
- event._dndHandle = true;
1634
- });
1635
- };
1636
- })
1637
-
1638
- .factory('dndDragTypeWorkaround', function(){ return {} })
1639
-
1640
- .factory('dndDropEffectWorkaround', function(){ return {} });
1641
-
1642
- },{}],39:[function(require,module,exports){
1643
- (function(window, angular) {'use strict';
1644
-
1645
-
1646
- var $sanitizeMinErr = angular.$$minErr('$sanitize');
1647
- var bind;
1648
- var extend;
1649
- var forEach;
1650
- var isDefined;
1651
- var lowercase;
1652
- var noop;
1653
- var htmlParser;
1654
- var htmlSanitizeWriter;
1655
-
1656
-
1657
-
1658
-
1659
- function $SanitizeProvider() {
1660
- var svgEnabled = false;
1661
-
1662
- this.$get = ['$$sanitizeUri', function($$sanitizeUri) {
1663
- if (svgEnabled) {
1664
- extend(validElements, svgElements);
1665
- }
1666
- return function(html) {
1667
- var buf = [];
1668
- htmlParser(html, htmlSanitizeWriter(buf, function(uri, isImage) {
1669
- return !/^unsafe:/.test($$sanitizeUri(uri, isImage));
1670
- }));
1671
- return buf.join('');
1672
- };
1673
- }];
1674
-
1675
-
1676
- this.enableSvg = function(enableSvg) {
1677
- if (isDefined(enableSvg)) {
1678
- svgEnabled = enableSvg;
1679
- return this;
1680
- } else {
1681
- return svgEnabled;
1682
- }
1683
- };
1684
-
1685
-
1686
- bind = angular.bind;
1687
- extend = angular.extend;
1688
- forEach = angular.forEach;
1689
- isDefined = angular.isDefined;
1690
- lowercase = angular.lowercase;
1691
- noop = angular.noop;
1692
-
1693
- htmlParser = htmlParserImpl;
1694
- htmlSanitizeWriter = htmlSanitizeWriterImpl;
1695
-
1696
- var SURROGATE_PAIR_REGEXP = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g,
1697
- NON_ALPHANUMERIC_REGEXP = /([^#-~ |!])/g;
1698
-
1699
-
1700
-
1701
- var voidElements = toMap('area,br,col,hr,img,wbr');
1702
-
1703
- var optionalEndTagBlockElements = toMap('colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr'),
1704
- optionalEndTagInlineElements = toMap('rp,rt'),
1705
- optionalEndTagElements = extend({},
1706
- optionalEndTagInlineElements,
1707
- optionalEndTagBlockElements);
1708
-
1709
- var blockElements = extend({}, optionalEndTagBlockElements, toMap('address,article,' +
1710
- 'aside,blockquote,caption,center,del,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,' +
1711
- 'h6,header,hgroup,hr,ins,map,menu,nav,ol,pre,section,table,ul'));
1712
-
1713
- var inlineElements = extend({}, optionalEndTagInlineElements, toMap('a,abbr,acronym,b,' +
1714
- 'bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,q,ruby,rp,rt,s,' +
1715
- 'samp,small,span,strike,strong,sub,sup,time,tt,u,var'));
1716
-
1717
- var svgElements = toMap('circle,defs,desc,ellipse,font-face,font-face-name,font-face-src,g,glyph,' +
1718
- 'hkern,image,linearGradient,line,marker,metadata,missing-glyph,mpath,path,polygon,polyline,' +
1719
- 'radialGradient,rect,stop,svg,switch,text,title,tspan');
1720
-
1721
- var blockedElements = toMap('script,style');
1722
-
1723
- var validElements = extend({},
1724
- voidElements,
1725
- blockElements,
1726
- inlineElements,
1727
- optionalEndTagElements);
1728
-
1729
- var uriAttrs = toMap('background,cite,href,longdesc,src,xlink:href');
1730
-
1731
- var htmlAttrs = toMap('abbr,align,alt,axis,bgcolor,border,cellpadding,cellspacing,class,clear,' +
1732
- 'color,cols,colspan,compact,coords,dir,face,headers,height,hreflang,hspace,' +
1733
- 'ismap,lang,language,nohref,nowrap,rel,rev,rows,rowspan,rules,' +
1734
- 'scope,scrolling,shape,size,span,start,summary,tabindex,target,title,type,' +
1735
- 'valign,value,vspace,width');
1736
-
1737
- var svgAttrs = toMap('accent-height,accumulate,additive,alphabetic,arabic-form,ascent,' +
1738
- 'baseProfile,bbox,begin,by,calcMode,cap-height,class,color,color-rendering,content,' +
1739
- 'cx,cy,d,dx,dy,descent,display,dur,end,fill,fill-rule,font-family,font-size,font-stretch,' +
1740
- 'font-style,font-variant,font-weight,from,fx,fy,g1,g2,glyph-name,gradientUnits,hanging,' +
1741
- 'height,horiz-adv-x,horiz-origin-x,ideographic,k,keyPoints,keySplines,keyTimes,lang,' +
1742
- 'marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mathematical,' +
1743
- 'max,min,offset,opacity,orient,origin,overline-position,overline-thickness,panose-1,' +
1744
- 'path,pathLength,points,preserveAspectRatio,r,refX,refY,repeatCount,repeatDur,' +
1745
- 'requiredExtensions,requiredFeatures,restart,rotate,rx,ry,slope,stemh,stemv,stop-color,' +
1746
- 'stop-opacity,strikethrough-position,strikethrough-thickness,stroke,stroke-dasharray,' +
1747
- 'stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,' +
1748
- 'stroke-width,systemLanguage,target,text-anchor,to,transform,type,u1,u2,underline-position,' +
1749
- 'underline-thickness,unicode,unicode-range,units-per-em,values,version,viewBox,visibility,' +
1750
- 'width,widths,x,x-height,x1,x2,xlink:actuate,xlink:arcrole,xlink:role,xlink:show,xlink:title,' +
1751
- 'xlink:type,xml:base,xml:lang,xml:space,xmlns,xmlns:xlink,y,y1,y2,zoomAndPan', true);
1752
-
1753
- var validAttrs = extend({},
1754
- uriAttrs,
1755
- svgAttrs,
1756
- htmlAttrs);
1757
-
1758
- function toMap(str, lowercaseKeys) {
1759
- var obj = {}, items = str.split(','), i;
1760
- for (i = 0; i < items.length; i++) {
1761
- obj[lowercaseKeys ? lowercase(items[i]) : items[i]] = true;
1762
- }
1763
- return obj;
1764
- }
1765
-
1766
- var inertBodyElement;
1767
- (function(window) {
1768
- var doc;
1769
- if (window.document && window.document.implementation) {
1770
- doc = window.document.implementation.createHTMLDocument('inert');
1771
- } else {
1772
- throw $sanitizeMinErr('noinert', 'Can\'t create an inert html document');
1773
- }
1774
- var docElement = doc.documentElement || doc.getDocumentElement();
1775
- var bodyElements = docElement.getElementsByTagName('body');
1776
-
1777
- if (bodyElements.length === 1) {
1778
- inertBodyElement = bodyElements[0];
1779
- } else {
1780
- var html = doc.createElement('html');
1781
- inertBodyElement = doc.createElement('body');
1782
- html.appendChild(inertBodyElement);
1783
- doc.appendChild(html);
1784
- }
1785
- })(window);
1786
-
1787
- function htmlParserImpl(html, handler) {
1788
- if (html === null || html === undefined) {
1789
- html = '';
1790
- } else if (typeof html !== 'string') {
1791
- html = '' + html;
1792
- }
1793
- inertBodyElement.innerHTML = html;
1794
-
1795
- var mXSSAttempts = 5;
1796
- do {
1797
- if (mXSSAttempts === 0) {
1798
- throw $sanitizeMinErr('uinput', 'Failed to sanitize html because the input is unstable');
1799
- }
1800
- mXSSAttempts--;
1801
-
1802
- if (window.document.documentMode) {
1803
- stripCustomNsAttrs(inertBodyElement);
1804
- }
1805
- html = inertBodyElement.innerHTML;
1806
- inertBodyElement.innerHTML = html;
1807
- } while (html !== inertBodyElement.innerHTML);
1808
-
1809
- var node = inertBodyElement.firstChild;
1810
- while (node) {
1811
- switch (node.nodeType) {
1812
- case 1:
1813
- handler.start(node.nodeName.toLowerCase(), attrToMap(node.attributes));
1814
- break;
1815
- case 3:
1816
- handler.chars(node.textContent);
1817
- break;
1818
- }
1819
-
1820
- var nextNode;
1821
- if (!(nextNode = node.firstChild)) {
1822
- if (node.nodeType === 1) {
1823
- handler.end(node.nodeName.toLowerCase());
1824
- }
1825
- nextNode = node.nextSibling;
1826
- if (!nextNode) {
1827
- while (nextNode == null) {
1828
- node = node.parentNode;
1829
- if (node === inertBodyElement) break;
1830
- nextNode = node.nextSibling;
1831
- if (node.nodeType === 1) {
1832
- handler.end(node.nodeName.toLowerCase());
1833
- }
1834
- }
1835
- }
1836
- }
1837
- node = nextNode;
1838
- }
1839
-
1840
- while ((node = inertBodyElement.firstChild)) {
1841
- inertBodyElement.removeChild(node);
1842
- }
1843
- }
1844
-
1845
- function attrToMap(attrs) {
1846
- var map = {};
1847
- for (var i = 0, ii = attrs.length; i < ii; i++) {
1848
- var attr = attrs[i];
1849
- map[attr.name] = attr.value;
1850
- }
1851
- return map;
1852
- }
1853
-
1854
-
1855
- function encodeEntities(value) {
1856
- return value.
1857
- replace(/&/g, '&amp;').
1858
- replace(SURROGATE_PAIR_REGEXP, function(value) {
1859
- var hi = value.charCodeAt(0);
1860
- var low = value.charCodeAt(1);
1861
- return '&#' + (((hi - 0xD800) * 0x400) + (low - 0xDC00) + 0x10000) + ';';
1862
- }).
1863
- replace(NON_ALPHANUMERIC_REGEXP, function(value) {
1864
- return '&#' + value.charCodeAt(0) + ';';
1865
- }).
1866
- replace(/</g, '&lt;').
1867
- replace(/>/g, '&gt;');
1868
- }
1869
-
1870
- function htmlSanitizeWriterImpl(buf, uriValidator) {
1871
- var ignoreCurrentElement = false;
1872
- var out = bind(buf, buf.push);
1873
- return {
1874
- start: function(tag, attrs) {
1875
- tag = lowercase(tag);
1876
- if (!ignoreCurrentElement && blockedElements[tag]) {
1877
- ignoreCurrentElement = tag;
1878
- }
1879
- if (!ignoreCurrentElement && validElements[tag] === true) {
1880
- out('<');
1881
- out(tag);
1882
- forEach(attrs, function(value, key) {
1883
- var lkey = lowercase(key);
1884
- var isImage = (tag === 'img' && lkey === 'src') || (lkey === 'background');
1885
- if (validAttrs[lkey] === true &&
1886
- (uriAttrs[lkey] !== true || uriValidator(value, isImage))) {
1887
- out(' ');
1888
- out(key);
1889
- out('="');
1890
- out(encodeEntities(value));
1891
- out('"');
1892
- }
1893
- });
1894
- out('>');
1895
- }
1896
- },
1897
- end: function(tag) {
1898
- tag = lowercase(tag);
1899
- if (!ignoreCurrentElement && validElements[tag] === true && voidElements[tag] !== true) {
1900
- out('</');
1901
- out(tag);
1902
- out('>');
1903
- }
1904
- if (tag == ignoreCurrentElement) {
1905
- ignoreCurrentElement = false;
1906
- }
1907
- },
1908
- chars: function(chars) {
1909
- if (!ignoreCurrentElement) {
1910
- out(encodeEntities(chars));
1911
- }
1912
- }
1913
- };
1914
- }
1915
-
1916
-
1917
- function stripCustomNsAttrs(node) {
1918
- while (node) {
1919
- if (node.nodeType === window.Node.ELEMENT_NODE) {
1920
- var attrs = node.attributes;
1921
- for (var i = 0, l = attrs.length; i < l; i++) {
1922
- var attrNode = attrs[i];
1923
- var attrName = attrNode.name.toLowerCase();
1924
- if (attrName === 'xmlns:ns1' || attrName.lastIndexOf('ns1:', 0) === 0) {
1925
- node.removeAttributeNode(attrNode);
1926
- i--;
1927
- l--;
1928
- }
1929
- }
1930
- }
1931
-
1932
- var nextNode = node.firstChild;
1933
- if (nextNode) {
1934
- stripCustomNsAttrs(nextNode);
1935
- }
1936
-
1937
- node = node.nextSibling;
1938
- }
1939
- }
1940
- }
1941
-
1942
- function sanitizeText(chars) {
1943
- var buf = [];
1944
- var writer = htmlSanitizeWriter(buf, noop);
1945
- writer.chars(chars);
1946
- return buf.join('');
1947
- }
1948
-
1949
-
1950
- angular.module('ngSanitize', []).provider('$sanitize', $SanitizeProvider);
1951
-
1952
- angular.module('ngSanitize').filter('linky', ['$sanitize', function($sanitize) {
1953
- var LINKY_URL_REGEXP =
1954
- /((ftp|https?):\/\/|(www\.)|(mailto:)?[A-Za-z0-9._%+-]+@)\S*[^\s.;,(){}<>"\u201d\u2019]/i,
1955
- MAILTO_REGEXP = /^mailto:/i;
1956
-
1957
- var linkyMinErr = angular.$$minErr('linky');
1958
- var isDefined = angular.isDefined;
1959
- var isFunction = angular.isFunction;
1960
- var isObject = angular.isObject;
1961
- var isString = angular.isString;
1962
-
1963
- return function(text, target, attributes) {
1964
- if (text == null || text === '') return text;
1965
- if (!isString(text)) throw linkyMinErr('notstring', 'Expected string but received: {0}', text);
1966
-
1967
- var attributesFn =
1968
- isFunction(attributes) ? attributes :
1969
- isObject(attributes) ? function getAttributesObject() {return attributes;} :
1970
- function getEmptyAttributesObject() {return {};};
1971
-
1972
- var match;
1973
- var raw = text;
1974
- var html = [];
1975
- var url;
1976
- var i;
1977
- while ((match = raw.match(LINKY_URL_REGEXP))) {
1978
- url = match[0];
1979
- if (!match[2] && !match[4]) {
1980
- url = (match[3] ? 'http://' : 'mailto:') + url;
1981
- }
1982
- i = match.index;
1983
- addText(raw.substr(0, i));
1984
- addLink(url, match[0].replace(MAILTO_REGEXP, ''));
1985
- raw = raw.substring(i + match[0].length);
1986
- }
1987
- addText(raw);
1988
- return $sanitize(html.join(''));
1989
-
1990
- function addText(text) {
1991
- if (!text) {
1992
- return;
1993
- }
1994
- html.push(sanitizeText(text));
1995
- }
1996
-
1997
- function addLink(url, text) {
1998
- var key, linkAttributes = attributesFn(url);
1999
- html.push('<a ');
2000
-
2001
- for (key in linkAttributes) {
2002
- html.push(key + '="' + linkAttributes[key] + '" ');
2003
- }
2004
-
2005
- if (isDefined(target) && !('target' in linkAttributes)) {
2006
- html.push('target="',
2007
- target,
2008
- '" ');
2009
- }
2010
- html.push('href="',
2011
- url.replace(/"/g, '&quot;'),
2012
- '">');
2013
- addText(text);
2014
- html.push('</a>');
2015
- }
2016
- };
2017
- }]);
2018
-
2019
-
2020
- })(window, window.angular);
2021
-
2022
- },{}],40:[function(require,module,exports){
2023
- require('./angular-sanitize');
2024
- module.exports = 'ngSanitize';
2025
-
2026
- },{"./angular-sanitize":39}],41:[function(require,module,exports){
2027
- (function(window) {'use strict';
2028
-
2029
-
2030
- function minErr(module, ErrorConstructor) {
2031
- ErrorConstructor = ErrorConstructor || Error;
2032
- return function() {
2033
- var SKIP_INDEXES = 2;
2034
-
2035
- var templateArgs = arguments,
2036
- code = templateArgs[0],
2037
- message = '[' + (module ? module + ':' : '') + code + '] ',
2038
- template = templateArgs[1],
2039
- paramPrefix, i;
2040
-
2041
- message += template.replace(/\{\d+\}/g, function(match) {
2042
- var index = +match.slice(1, -1),
2043
- shiftedIndex = index + SKIP_INDEXES;
2044
-
2045
- if (shiftedIndex < templateArgs.length) {
2046
- return toDebugString(templateArgs[shiftedIndex]);
2047
- }
2048
-
2049
- return match;
2050
- });
2051
-
2052
- message += '\nhttp://errors.angularjs.org/1.6.1/' +
2053
- (module ? module + '/' : '') + code;
2054
-
2055
- for (i = SKIP_INDEXES, paramPrefix = '?'; i < templateArgs.length; i++, paramPrefix = '&') {
2056
- message += paramPrefix + 'p' + (i - SKIP_INDEXES) + '=' +
2057
- encodeURIComponent(toDebugString(templateArgs[i]));
2058
- }
2059
-
2060
- return new ErrorConstructor(message);
2061
- };
2062
- }
2063
-
2064
-
2065
-
2066
-
2067
- var REGEX_STRING_REGEXP = /^\/(.+)\/([a-z]*)$/;
2068
-
2069
- var VALIDITY_STATE_PROPERTY = 'validity';
2070
-
2071
-
2072
- var hasOwnProperty = Object.prototype.hasOwnProperty;
2073
-
2074
- var lowercase = function(string) {return isString(string) ? string.toLowerCase() : string;};
2075
-
2076
- var uppercase = function(string) {return isString(string) ? string.toUpperCase() : string;};
2077
-
2078
-
2079
- var manualLowercase = function(s) {
2080
- return isString(s)
2081
- ? s.replace(/[A-Z]/g, function(ch) {return String.fromCharCode(ch.charCodeAt(0) | 32);})
2082
- : s;
2083
- };
2084
- var manualUppercase = function(s) {
2085
- return isString(s)
2086
- ? s.replace(/[a-z]/g, function(ch) {return String.fromCharCode(ch.charCodeAt(0) & ~32);})
2087
- : s;
2088
- };
2089
-
2090
-
2091
- if ('i' !== 'I'.toLowerCase()) {
2092
- lowercase = manualLowercase;
2093
- uppercase = manualUppercase;
2094
- }
2095
-
2096
-
2097
- var
2098
- msie,
2099
- jqLite,
2100
- jQuery,
2101
- slice = [].slice,
2102
- splice = [].splice,
2103
- push = [].push,
2104
- toString = Object.prototype.toString,
2105
- getPrototypeOf = Object.getPrototypeOf,
2106
- ngMinErr = minErr('ng'),
2107
-
2108
- angular = window.angular || (window.angular = {}),
2109
- angularModule,
2110
- uid = 0;
2111
-
2112
- msie = window.document.documentMode;
2113
-
2114
-
2115
- function isArrayLike(obj) {
2116
-
2117
- if (obj == null || isWindow(obj)) return false;
2118
-
2119
- if (isArray(obj) || isString(obj) || (jqLite && obj instanceof jqLite)) return true;
2120
-
2121
- var length = 'length' in Object(obj) && obj.length;
2122
-
2123
- return isNumber(length) &&
2124
- (length >= 0 && ((length - 1) in obj || obj instanceof Array) || typeof obj.item === 'function');
2125
-
2126
- }
2127
-
2128
-
2129
- function forEach(obj, iterator, context) {
2130
- var key, length;
2131
- if (obj) {
2132
- if (isFunction(obj)) {
2133
- for (key in obj) {
2134
- if (key !== 'prototype' && key !== 'length' && key !== 'name' && obj.hasOwnProperty(key)) {
2135
- iterator.call(context, obj[key], key, obj);
2136
- }
2137
- }
2138
- } else if (isArray(obj) || isArrayLike(obj)) {
2139
- var isPrimitive = typeof obj !== 'object';
2140
- for (key = 0, length = obj.length; key < length; key++) {
2141
- if (isPrimitive || key in obj) {
2142
- iterator.call(context, obj[key], key, obj);
2143
- }
2144
- }
2145
- } else if (obj.forEach && obj.forEach !== forEach) {
2146
- obj.forEach(iterator, context, obj);
2147
- } else if (isBlankObject(obj)) {
2148
- for (key in obj) {
2149
- iterator.call(context, obj[key], key, obj);
2150
- }
2151
- } else if (typeof obj.hasOwnProperty === 'function') {
2152
- for (key in obj) {
2153
- if (obj.hasOwnProperty(key)) {
2154
- iterator.call(context, obj[key], key, obj);
2155
- }
2156
- }
2157
- } else {
2158
- for (key in obj) {
2159
- if (hasOwnProperty.call(obj, key)) {
2160
- iterator.call(context, obj[key], key, obj);
2161
- }
2162
- }
2163
- }
2164
- }
2165
- return obj;
2166
- }
2167
-
2168
- function forEachSorted(obj, iterator, context) {
2169
- var keys = Object.keys(obj).sort();
2170
- for (var i = 0; i < keys.length; i++) {
2171
- iterator.call(context, obj[keys[i]], keys[i]);
2172
- }
2173
- return keys;
2174
- }
2175
-
2176
-
2177
- function reverseParams(iteratorFn) {
2178
- return function(value, key) {iteratorFn(key, value);};
2179
- }
2180
-
2181
- function nextUid() {
2182
- return ++uid;
2183
- }
2184
-
2185
-
2186
- function setHashKey(obj, h) {
2187
- if (h) {
2188
- obj.$$hashKey = h;
2189
- } else {
2190
- delete obj.$$hashKey;
2191
- }
2192
- }
2193
-
2194
-
2195
- function baseExtend(dst, objs, deep) {
2196
- var h = dst.$$hashKey;
2197
-
2198
- for (var i = 0, ii = objs.length; i < ii; ++i) {
2199
- var obj = objs[i];
2200
- if (!isObject(obj) && !isFunction(obj)) continue;
2201
- var keys = Object.keys(obj);
2202
- for (var j = 0, jj = keys.length; j < jj; j++) {
2203
- var key = keys[j];
2204
- var src = obj[key];
2205
-
2206
- if (deep && isObject(src)) {
2207
- if (isDate(src)) {
2208
- dst[key] = new Date(src.valueOf());
2209
- } else if (isRegExp(src)) {
2210
- dst[key] = new RegExp(src);
2211
- } else if (src.nodeName) {
2212
- dst[key] = src.cloneNode(true);
2213
- } else if (isElement(src)) {
2214
- dst[key] = src.clone();
2215
- } else {
2216
- if (!isObject(dst[key])) dst[key] = isArray(src) ? [] : {};
2217
- baseExtend(dst[key], [src], true);
2218
- }
2219
- } else {
2220
- dst[key] = src;
2221
- }
2222
- }
2223
- }
2224
-
2225
- setHashKey(dst, h);
2226
- return dst;
2227
- }
2228
-
2229
- function extend(dst) {
2230
- return baseExtend(dst, slice.call(arguments, 1), false);
2231
- }
2232
-
2233
-
2234
- function merge(dst) {
2235
- return baseExtend(dst, slice.call(arguments, 1), true);
2236
- }
2237
-
2238
-
2239
-
2240
- function toInt(str) {
2241
- return parseInt(str, 10);
2242
- }
2243
-
2244
- var isNumberNaN = Number.isNaN || function isNumberNaN(num) {
2245
- return num !== num;
2246
- };
2247
-
2248
-
2249
- function inherit(parent, extra) {
2250
- return extend(Object.create(parent), extra);
2251
- }
2252
-
2253
- function noop() {}
2254
- noop.$inject = [];
2255
-
2256
-
2257
- function identity($) {return $;}
2258
- identity.$inject = [];
2259
-
2260
-
2261
- function valueFn(value) {return function valueRef() {return value;};}
2262
-
2263
- function hasCustomToString(obj) {
2264
- return isFunction(obj.toString) && obj.toString !== toString;
2265
- }
2266
-
2267
-
2268
- function isUndefined(value) {return typeof value === 'undefined';}
2269
-
2270
-
2271
- function isDefined(value) {return typeof value !== 'undefined';}
2272
-
2273
-
2274
- function isObject(value) {
2275
- return value !== null && typeof value === 'object';
2276
- }
2277
-
2278
-
2279
- function isBlankObject(value) {
2280
- return value !== null && typeof value === 'object' && !getPrototypeOf(value);
2281
- }
2282
-
2283
-
2284
- function isString(value) {return typeof value === 'string';}
2285
-
2286
-
2287
- function isNumber(value) {return typeof value === 'number';}
2288
-
2289
-
2290
- function isDate(value) {
2291
- return toString.call(value) === '[object Date]';
2292
- }
2293
-
2294
-
2295
- var isArray = Array.isArray;
2296
-
2297
- function isFunction(value) {return typeof value === 'function';}
2298
-
2299
-
2300
- function isRegExp(value) {
2301
- return toString.call(value) === '[object RegExp]';
2302
- }
2303
-
2304
-
2305
- function isWindow(obj) {
2306
- return obj && obj.window === obj;
2307
- }
2308
-
2309
-
2310
- function isScope(obj) {
2311
- return obj && obj.$evalAsync && obj.$watch;
2312
- }
2313
-
2314
-
2315
- function isFile(obj) {
2316
- return toString.call(obj) === '[object File]';
2317
- }
2318
-
2319
-
2320
- function isFormData(obj) {
2321
- return toString.call(obj) === '[object FormData]';
2322
- }
2323
-
2324
-
2325
- function isBlob(obj) {
2326
- return toString.call(obj) === '[object Blob]';
2327
- }
2328
-
2329
-
2330
- function isBoolean(value) {
2331
- return typeof value === 'boolean';
2332
- }
2333
-
2334
-
2335
- function isPromiseLike(obj) {
2336
- return obj && isFunction(obj.then);
2337
- }
2338
-
2339
-
2340
- var TYPED_ARRAY_REGEXP = /^\[object (?:Uint8|Uint8Clamped|Uint16|Uint32|Int8|Int16|Int32|Float32|Float64)Array]$/;
2341
- function isTypedArray(value) {
2342
- return value && isNumber(value.length) && TYPED_ARRAY_REGEXP.test(toString.call(value));
2343
- }
2344
-
2345
- function isArrayBuffer(obj) {
2346
- return toString.call(obj) === '[object ArrayBuffer]';
2347
- }
2348
-
2349
-
2350
- var trim = function(value) {
2351
- return isString(value) ? value.trim() : value;
2352
- };
2353
-
2354
- var escapeForRegexp = function(s) {
2355
- return s
2356
- .replace(/([-()[\]{}+?*.$^|,:#<!\\])/g, '\\$1')
2357
- .replace(/\x08/g, '\\x08');
2358
- };
2359
-
2360
-
2361
- function isElement(node) {
2362
- return !!(node &&
2363
- (node.nodeName
2364
- || (node.prop && node.attr && node.find)));
2365
- }
2366
-
2367
- function makeMap(str) {
2368
- var obj = {}, items = str.split(','), i;
2369
- for (i = 0; i < items.length; i++) {
2370
- obj[items[i]] = true;
2371
- }
2372
- return obj;
2373
- }
2374
-
2375
-
2376
- function nodeName_(element) {
2377
- return lowercase(element.nodeName || (element[0] && element[0].nodeName));
2378
- }
2379
-
2380
- function includes(array, obj) {
2381
- return Array.prototype.indexOf.call(array, obj) !== -1;
2382
- }
2383
-
2384
- function arrayRemove(array, value) {
2385
- var index = array.indexOf(value);
2386
- if (index >= 0) {
2387
- array.splice(index, 1);
2388
- }
2389
- return index;
2390
- }
2391
-
2392
- function copy(source, destination) {
2393
- var stackSource = [];
2394
- var stackDest = [];
2395
-
2396
- if (destination) {
2397
- if (isTypedArray(destination) || isArrayBuffer(destination)) {
2398
- throw ngMinErr('cpta', 'Can\'t copy! TypedArray destination cannot be mutated.');
2399
- }
2400
- if (source === destination) {
2401
- throw ngMinErr('cpi', 'Can\'t copy! Source and destination are identical.');
2402
- }
2403
-
2404
- if (isArray(destination)) {
2405
- destination.length = 0;
2406
- } else {
2407
- forEach(destination, function(value, key) {
2408
- if (key !== '$$hashKey') {
2409
- delete destination[key];
2410
- }
2411
- });
2412
- }
2413
-
2414
- stackSource.push(source);
2415
- stackDest.push(destination);
2416
- return copyRecurse(source, destination);
2417
- }
2418
-
2419
- return copyElement(source);
2420
-
2421
- function copyRecurse(source, destination) {
2422
- var h = destination.$$hashKey;
2423
- var key;
2424
- if (isArray(source)) {
2425
- for (var i = 0, ii = source.length; i < ii; i++) {
2426
- destination.push(copyElement(source[i]));
2427
- }
2428
- } else if (isBlankObject(source)) {
2429
- for (key in source) {
2430
- destination[key] = copyElement(source[key]);
2431
- }
2432
- } else if (source && typeof source.hasOwnProperty === 'function') {
2433
- for (key in source) {
2434
- if (source.hasOwnProperty(key)) {
2435
- destination[key] = copyElement(source[key]);
2436
- }
2437
- }
2438
- } else {
2439
- for (key in source) {
2440
- if (hasOwnProperty.call(source, key)) {
2441
- destination[key] = copyElement(source[key]);
2442
- }
2443
- }
2444
- }
2445
- setHashKey(destination, h);
2446
- return destination;
2447
- }
2448
-
2449
- function copyElement(source) {
2450
- if (!isObject(source)) {
2451
- return source;
2452
- }
2453
-
2454
- var index = stackSource.indexOf(source);
2455
- if (index !== -1) {
2456
- return stackDest[index];
2457
- }
2458
-
2459
- if (isWindow(source) || isScope(source)) {
2460
- throw ngMinErr('cpws',
2461
- 'Can\'t copy! Making copies of Window or Scope instances is not supported.');
2462
- }
2463
-
2464
- var needsRecurse = false;
2465
- var destination = copyType(source);
2466
-
2467
- if (destination === undefined) {
2468
- destination = isArray(source) ? [] : Object.create(getPrototypeOf(source));
2469
- needsRecurse = true;
2470
- }
2471
-
2472
- stackSource.push(source);
2473
- stackDest.push(destination);
2474
-
2475
- return needsRecurse
2476
- ? copyRecurse(source, destination)
2477
- : destination;
2478
- }
2479
-
2480
- function copyType(source) {
2481
- switch (toString.call(source)) {
2482
- case '[object Int8Array]':
2483
- case '[object Int16Array]':
2484
- case '[object Int32Array]':
2485
- case '[object Float32Array]':
2486
- case '[object Float64Array]':
2487
- case '[object Uint8Array]':
2488
- case '[object Uint8ClampedArray]':
2489
- case '[object Uint16Array]':
2490
- case '[object Uint32Array]':
2491
- return new source.constructor(copyElement(source.buffer), source.byteOffset, source.length);
2492
-
2493
- case '[object ArrayBuffer]':
2494
- if (!source.slice) {
2495
- var copied = new ArrayBuffer(source.byteLength);
2496
- new Uint8Array(copied).set(new Uint8Array(source));
2497
- return copied;
2498
- }
2499
- return source.slice(0);
2500
-
2501
- case '[object Boolean]':
2502
- case '[object Number]':
2503
- case '[object String]':
2504
- case '[object Date]':
2505
- return new source.constructor(source.valueOf());
2506
-
2507
- case '[object RegExp]':
2508
- var re = new RegExp(source.source, source.toString().match(/[^/]*$/)[0]);
2509
- re.lastIndex = source.lastIndex;
2510
- return re;
2511
-
2512
- case '[object Blob]':
2513
- return new source.constructor([source], {type: source.type});
2514
- }
2515
-
2516
- if (isFunction(source.cloneNode)) {
2517
- return source.cloneNode(true);
2518
- }
2519
- }
2520
- }
2521
-
2522
-
2523
- function equals(o1, o2) {
2524
- if (o1 === o2) return true;
2525
- if (o1 === null || o2 === null) return false;
2526
- if (o1 !== o1 && o2 !== o2) return true;
2527
- var t1 = typeof o1, t2 = typeof o2, length, key, keySet;
2528
- if (t1 === t2 && t1 === 'object') {
2529
- if (isArray(o1)) {
2530
- if (!isArray(o2)) return false;
2531
- if ((length = o1.length) === o2.length) {
2532
- for (key = 0; key < length; key++) {
2533
- if (!equals(o1[key], o2[key])) return false;
2534
- }
2535
- return true;
2536
- }
2537
- } else if (isDate(o1)) {
2538
- if (!isDate(o2)) return false;
2539
- return equals(o1.getTime(), o2.getTime());
2540
- } else if (isRegExp(o1)) {
2541
- if (!isRegExp(o2)) return false;
2542
- return o1.toString() === o2.toString();
2543
- } else {
2544
- if (isScope(o1) || isScope(o2) || isWindow(o1) || isWindow(o2) ||
2545
- isArray(o2) || isDate(o2) || isRegExp(o2)) return false;
2546
- keySet = createMap();
2547
- for (key in o1) {
2548
- if (key.charAt(0) === '$' || isFunction(o1[key])) continue;
2549
- if (!equals(o1[key], o2[key])) return false;
2550
- keySet[key] = true;
2551
- }
2552
- for (key in o2) {
2553
- if (!(key in keySet) &&
2554
- key.charAt(0) !== '$' &&
2555
- isDefined(o2[key]) &&
2556
- !isFunction(o2[key])) return false;
2557
- }
2558
- return true;
2559
- }
2560
- }
2561
- return false;
2562
- }
2563
-
2564
- var csp = function() {
2565
- if (!isDefined(csp.rules)) {
2566
-
2567
-
2568
- var ngCspElement = (window.document.querySelector('[ng-csp]') ||
2569
- window.document.querySelector('[data-ng-csp]'));
2570
-
2571
- if (ngCspElement) {
2572
- var ngCspAttribute = ngCspElement.getAttribute('ng-csp') ||
2573
- ngCspElement.getAttribute('data-ng-csp');
2574
- csp.rules = {
2575
- noUnsafeEval: !ngCspAttribute || (ngCspAttribute.indexOf('no-unsafe-eval') !== -1),
2576
- noInlineStyle: !ngCspAttribute || (ngCspAttribute.indexOf('no-inline-style') !== -1)
2577
- };
2578
- } else {
2579
- csp.rules = {
2580
- noUnsafeEval: noUnsafeEval(),
2581
- noInlineStyle: false
2582
- };
2583
- }
2584
- }
2585
-
2586
- return csp.rules;
2587
-
2588
- function noUnsafeEval() {
2589
- try {
2590
- new Function('');
2591
- return false;
2592
- } catch (e) {
2593
- return true;
2594
- }
2595
- }
2596
- };
2597
-
2598
- var jq = function() {
2599
- if (isDefined(jq.name_)) return jq.name_;
2600
- var el;
2601
- var i, ii = ngAttrPrefixes.length, prefix, name;
2602
- for (i = 0; i < ii; ++i) {
2603
- prefix = ngAttrPrefixes[i];
2604
- el = window.document.querySelector('[' + prefix.replace(':', '\\:') + 'jq]');
2605
- if (el) {
2606
- name = el.getAttribute(prefix + 'jq');
2607
- break;
2608
- }
2609
- }
2610
-
2611
- return (jq.name_ = name);
2612
- };
2613
-
2614
- function concat(array1, array2, index) {
2615
- return array1.concat(slice.call(array2, index));
2616
- }
2617
-
2618
- function sliceArgs(args, startIndex) {
2619
- return slice.call(args, startIndex || 0);
2620
- }
2621
-
2622
-
2623
- function bind(self, fn) {
2624
- var curryArgs = arguments.length > 2 ? sliceArgs(arguments, 2) : [];
2625
- if (isFunction(fn) && !(fn instanceof RegExp)) {
2626
- return curryArgs.length
2627
- ? function() {
2628
- return arguments.length
2629
- ? fn.apply(self, concat(curryArgs, arguments, 0))
2630
- : fn.apply(self, curryArgs);
2631
- }
2632
- : function() {
2633
- return arguments.length
2634
- ? fn.apply(self, arguments)
2635
- : fn.call(self);
2636
- };
2637
- } else {
2638
- return fn;
2639
- }
2640
- }
2641
-
2642
-
2643
- function toJsonReplacer(key, value) {
2644
- var val = value;
2645
-
2646
- if (typeof key === 'string' && key.charAt(0) === '$' && key.charAt(1) === '$') {
2647
- val = undefined;
2648
- } else if (isWindow(value)) {
2649
- val = '$WINDOW';
2650
- } else if (value && window.document === value) {
2651
- val = '$DOCUMENT';
2652
- } else if (isScope(value)) {
2653
- val = '$SCOPE';
2654
- }
2655
-
2656
- return val;
2657
- }
2658
-
2659
-
2660
- function toJson(obj, pretty) {
2661
- if (isUndefined(obj)) return undefined;
2662
- if (!isNumber(pretty)) {
2663
- pretty = pretty ? 2 : null;
2664
- }
2665
- return JSON.stringify(obj, toJsonReplacer, pretty);
2666
- }
2667
-
2668
-
2669
- function fromJson(json) {
2670
- return isString(json)
2671
- ? JSON.parse(json)
2672
- : json;
2673
- }
2674
-
2675
-
2676
- var ALL_COLONS = /:/g;
2677
- function timezoneToOffset(timezone, fallback) {
2678
- timezone = timezone.replace(ALL_COLONS, '');
2679
- var requestedTimezoneOffset = Date.parse('Jan 01, 1970 00:00:00 ' + timezone) / 60000;
2680
- return isNumberNaN(requestedTimezoneOffset) ? fallback : requestedTimezoneOffset;
2681
- }
2682
-
2683
-
2684
- function addDateMinutes(date, minutes) {
2685
- date = new Date(date.getTime());
2686
- date.setMinutes(date.getMinutes() + minutes);
2687
- return date;
2688
- }
2689
-
2690
-
2691
- function convertTimezoneToLocal(date, timezone, reverse) {
2692
- reverse = reverse ? -1 : 1;
2693
- var dateTimezoneOffset = date.getTimezoneOffset();
2694
- var timezoneOffset = timezoneToOffset(timezone, dateTimezoneOffset);
2695
- return addDateMinutes(date, reverse * (timezoneOffset - dateTimezoneOffset));
2696
- }
2697
-
2698
-
2699
- function startingTag(element) {
2700
- element = jqLite(element).clone();
2701
- try {
2702
- element.empty();
2703
- } catch (e) { }
2704
- var elemHtml = jqLite('<div>').append(element).html();
2705
- try {
2706
- return element[0].nodeType === NODE_TYPE_TEXT ? lowercase(elemHtml) :
2707
- elemHtml.
2708
- match(/^(<[^>]+>)/)[1].
2709
- replace(/^<([\w-]+)/, function(match, nodeName) {return '<' + lowercase(nodeName);});
2710
- } catch (e) {
2711
- return lowercase(elemHtml);
2712
- }
2713
-
2714
- }
2715
-
2716
-
2717
-
2718
- function tryDecodeURIComponent(value) {
2719
- try {
2720
- return decodeURIComponent(value);
2721
- } catch (e) {
2722
- }
2723
- }
2724
-
2725
-
2726
- function parseKeyValue(keyValue) {
2727
- var obj = {};
2728
- forEach((keyValue || '').split('&'), function(keyValue) {
2729
- var splitPoint, key, val;
2730
- if (keyValue) {
2731
- key = keyValue = keyValue.replace(/\+/g,'%20');
2732
- splitPoint = keyValue.indexOf('=');
2733
- if (splitPoint !== -1) {
2734
- key = keyValue.substring(0, splitPoint);
2735
- val = keyValue.substring(splitPoint + 1);
2736
- }
2737
- key = tryDecodeURIComponent(key);
2738
- if (isDefined(key)) {
2739
- val = isDefined(val) ? tryDecodeURIComponent(val) : true;
2740
- if (!hasOwnProperty.call(obj, key)) {
2741
- obj[key] = val;
2742
- } else if (isArray(obj[key])) {
2743
- obj[key].push(val);
2744
- } else {
2745
- obj[key] = [obj[key],val];
2746
- }
2747
- }
2748
- }
2749
- });
2750
- return obj;
2751
- }
2752
-
2753
- function toKeyValue(obj) {
2754
- var parts = [];
2755
- forEach(obj, function(value, key) {
2756
- if (isArray(value)) {
2757
- forEach(value, function(arrayValue) {
2758
- parts.push(encodeUriQuery(key, true) +
2759
- (arrayValue === true ? '' : '=' + encodeUriQuery(arrayValue, true)));
2760
- });
2761
- } else {
2762
- parts.push(encodeUriQuery(key, true) +
2763
- (value === true ? '' : '=' + encodeUriQuery(value, true)));
2764
- }
2765
- });
2766
- return parts.length ? parts.join('&') : '';
2767
- }
2768
-
2769
-
2770
- function encodeUriSegment(val) {
2771
- return encodeUriQuery(val, true).
2772
- replace(/%26/gi, '&').
2773
- replace(/%3D/gi, '=').
2774
- replace(/%2B/gi, '+');
2775
- }
2776
-
2777
-
2778
- function encodeUriQuery(val, pctEncodeSpaces) {
2779
- return encodeURIComponent(val).
2780
- replace(/%40/gi, '@').
2781
- replace(/%3A/gi, ':').
2782
- replace(/%24/g, '$').
2783
- replace(/%2C/gi, ',').
2784
- replace(/%3B/gi, ';').
2785
- replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));
2786
- }
2787
-
2788
- var ngAttrPrefixes = ['ng-', 'data-ng-', 'ng:', 'x-ng-'];
2789
-
2790
- function getNgAttribute(element, ngAttr) {
2791
- var attr, i, ii = ngAttrPrefixes.length;
2792
- for (i = 0; i < ii; ++i) {
2793
- attr = ngAttrPrefixes[i] + ngAttr;
2794
- if (isString(attr = element.getAttribute(attr))) {
2795
- return attr;
2796
- }
2797
- }
2798
- return null;
2799
- }
2800
-
2801
- function allowAutoBootstrap(document) {
2802
- if (!document.currentScript) {
2803
- return true;
2804
- }
2805
- var src = document.currentScript.getAttribute('src');
2806
- var link = document.createElement('a');
2807
- link.href = src;
2808
- if (document.location.origin === link.origin) {
2809
- return true;
2810
- }
2811
- switch (link.protocol) {
2812
- case 'http:':
2813
- case 'https:':
2814
- case 'ftp:':
2815
- case 'blob:':
2816
- case 'file:':
2817
- case 'data:':
2818
- return true;
2819
- default:
2820
- return false;
2821
- }
2822
- }
2823
-
2824
- var isAutoBootstrapAllowed = allowAutoBootstrap(window.document);
2825
-
2826
- function angularInit(element, bootstrap) {
2827
- var appElement,
2828
- module,
2829
- config = {};
2830
-
2831
- forEach(ngAttrPrefixes, function(prefix) {
2832
- var name = prefix + 'app';
2833
-
2834
- if (!appElement && element.hasAttribute && element.hasAttribute(name)) {
2835
- appElement = element;
2836
- module = element.getAttribute(name);
2837
- }
2838
- });
2839
- forEach(ngAttrPrefixes, function(prefix) {
2840
- var name = prefix + 'app';
2841
- var candidate;
2842
-
2843
- if (!appElement && (candidate = element.querySelector('[' + name.replace(':', '\\:') + ']'))) {
2844
- appElement = candidate;
2845
- module = candidate.getAttribute(name);
2846
- }
2847
- });
2848
- if (appElement) {
2849
- if (!isAutoBootstrapAllowed) {
2850
- window.console.error('Angular: disabling automatic bootstrap. <script> protocol indicates ' +
2851
- 'an extension, document.location.href does not match.');
2852
- return;
2853
- }
2854
- config.strictDi = getNgAttribute(appElement, 'strict-di') !== null;
2855
- bootstrap(appElement, module ? [module] : [], config);
2856
- }
2857
- }
2858
-
2859
- function bootstrap(element, modules, config) {
2860
- if (!isObject(config)) config = {};
2861
- var defaultConfig = {
2862
- strictDi: false
2863
- };
2864
- config = extend(defaultConfig, config);
2865
- var doBootstrap = function() {
2866
- element = jqLite(element);
2867
-
2868
- if (element.injector()) {
2869
- var tag = (element[0] === window.document) ? 'document' : startingTag(element);
2870
- throw ngMinErr(
2871
- 'btstrpd',
2872
- 'App already bootstrapped with this element \'{0}\'',
2873
- tag.replace(/</,'&lt;').replace(/>/,'&gt;'));
2874
- }
2875
-
2876
- modules = modules || [];
2877
- modules.unshift(['$provide', function($provide) {
2878
- $provide.value('$rootElement', element);
2879
- }]);
2880
-
2881
- if (config.debugInfoEnabled) {
2882
- modules.push(['$compileProvider', function($compileProvider) {
2883
- $compileProvider.debugInfoEnabled(true);
2884
- }]);
2885
- }
2886
-
2887
- modules.unshift('ng');
2888
- var injector = createInjector(modules, config.strictDi);
2889
- injector.invoke(['$rootScope', '$rootElement', '$compile', '$injector',
2890
- function bootstrapApply(scope, element, compile, injector) {
2891
- scope.$apply(function() {
2892
- element.data('$injector', injector);
2893
- compile(element)(scope);
2894
- });
2895
- }]
2896
- );
2897
- return injector;
2898
- };
2899
-
2900
- var NG_ENABLE_DEBUG_INFO = /^NG_ENABLE_DEBUG_INFO!/;
2901
- var NG_DEFER_BOOTSTRAP = /^NG_DEFER_BOOTSTRAP!/;
2902
-
2903
- if (window && NG_ENABLE_DEBUG_INFO.test(window.name)) {
2904
- config.debugInfoEnabled = true;
2905
- window.name = window.name.replace(NG_ENABLE_DEBUG_INFO, '');
2906
- }
2907
-
2908
- if (window && !NG_DEFER_BOOTSTRAP.test(window.name)) {
2909
- return doBootstrap();
2910
- }
2911
-
2912
- window.name = window.name.replace(NG_DEFER_BOOTSTRAP, '');
2913
- angular.resumeBootstrap = function(extraModules) {
2914
- forEach(extraModules, function(module) {
2915
- modules.push(module);
2916
- });
2917
- return doBootstrap();
2918
- };
2919
-
2920
- if (isFunction(angular.resumeDeferredBootstrap)) {
2921
- angular.resumeDeferredBootstrap();
2922
- }
2923
- }
2924
-
2925
- function reloadWithDebugInfo() {
2926
- window.name = 'NG_ENABLE_DEBUG_INFO!' + window.name;
2927
- window.location.reload();
2928
- }
2929
-
2930
- function getTestability(rootElement) {
2931
- var injector = angular.element(rootElement).injector();
2932
- if (!injector) {
2933
- throw ngMinErr('test',
2934
- 'no injector found for element argument to getTestability');
2935
- }
2936
- return injector.get('$$testability');
2937
- }
2938
-
2939
- var SNAKE_CASE_REGEXP = /[A-Z]/g;
2940
- function snake_case(name, separator) {
2941
- separator = separator || '_';
2942
- return name.replace(SNAKE_CASE_REGEXP, function(letter, pos) {
2943
- return (pos ? separator : '') + letter.toLowerCase();
2944
- });
2945
- }
2946
-
2947
- var bindJQueryFired = false;
2948
- function bindJQuery() {
2949
- var originalCleanData;
2950
-
2951
- if (bindJQueryFired) {
2952
- return;
2953
- }
2954
-
2955
- var jqName = jq();
2956
- jQuery = isUndefined(jqName) ? window.jQuery :
2957
- !jqName ? undefined :
2958
- window[jqName];
2959
-
2960
- if (jQuery && jQuery.fn.on) {
2961
- jqLite = jQuery;
2962
- extend(jQuery.fn, {
2963
- scope: JQLitePrototype.scope,
2964
- isolateScope: JQLitePrototype.isolateScope,
2965
- controller: JQLitePrototype.controller,
2966
- injector: JQLitePrototype.injector,
2967
- inheritedData: JQLitePrototype.inheritedData
2968
- });
2969
-
2970
- originalCleanData = jQuery.cleanData;
2971
- jQuery.cleanData = function(elems) {
2972
- var events;
2973
- for (var i = 0, elem; (elem = elems[i]) != null; i++) {
2974
- events = jQuery._data(elem, 'events');
2975
- if (events && events.$destroy) {
2976
- jQuery(elem).triggerHandler('$destroy');
2977
- }
2978
- }
2979
- originalCleanData(elems);
2980
- };
2981
- } else {
2982
- jqLite = JQLite;
2983
- }
2984
-
2985
- angular.element = jqLite;
2986
-
2987
- bindJQueryFired = true;
2988
- }
2989
-
2990
- function assertArg(arg, name, reason) {
2991
- if (!arg) {
2992
- throw ngMinErr('areq', 'Argument \'{0}\' is {1}', (name || '?'), (reason || 'required'));
2993
- }
2994
- return arg;
2995
- }
2996
-
2997
- function assertArgFn(arg, name, acceptArrayAnnotation) {
2998
- if (acceptArrayAnnotation && isArray(arg)) {
2999
- arg = arg[arg.length - 1];
3000
- }
3001
-
3002
- assertArg(isFunction(arg), name, 'not a function, got ' +
3003
- (arg && typeof arg === 'object' ? arg.constructor.name || 'Object' : typeof arg));
3004
- return arg;
3005
- }
3006
-
3007
- function assertNotHasOwnProperty(name, context) {
3008
- if (name === 'hasOwnProperty') {
3009
- throw ngMinErr('badname', 'hasOwnProperty is not a valid {0} name', context);
3010
- }
3011
- }
3012
-
3013
- function getter(obj, path, bindFnToScope) {
3014
- if (!path) return obj;
3015
- var keys = path.split('.');
3016
- var key;
3017
- var lastInstance = obj;
3018
- var len = keys.length;
3019
-
3020
- for (var i = 0; i < len; i++) {
3021
- key = keys[i];
3022
- if (obj) {
3023
- obj = (lastInstance = obj)[key];
3024
- }
3025
- }
3026
- if (!bindFnToScope && isFunction(obj)) {
3027
- return bind(lastInstance, obj);
3028
- }
3029
- return obj;
3030
- }
3031
-
3032
- function getBlockNodes(nodes) {
3033
- var node = nodes[0];
3034
- var endNode = nodes[nodes.length - 1];
3035
- var blockNodes;
3036
-
3037
- for (var i = 1; node !== endNode && (node = node.nextSibling); i++) {
3038
- if (blockNodes || nodes[i] !== node) {
3039
- if (!blockNodes) {
3040
- blockNodes = jqLite(slice.call(nodes, 0, i));
3041
- }
3042
- blockNodes.push(node);
3043
- }
3044
- }
3045
-
3046
- return blockNodes || nodes;
3047
- }
3048
-
3049
-
3050
- function createMap() {
3051
- return Object.create(null);
3052
- }
3053
-
3054
- function stringify(value) {
3055
- if (value == null) {
3056
- return '';
3057
- }
3058
- switch (typeof value) {
3059
- case 'string':
3060
- break;
3061
- case 'number':
3062
- value = '' + value;
3063
- break;
3064
- default:
3065
- if (hasCustomToString(value) && !isArray(value) && !isDate(value)) {
3066
- value = value.toString();
3067
- } else {
3068
- value = toJson(value);
3069
- }
3070
- }
3071
-
3072
- return value;
3073
- }
3074
-
3075
- var NODE_TYPE_ELEMENT = 1;
3076
- var NODE_TYPE_ATTRIBUTE = 2;
3077
- var NODE_TYPE_TEXT = 3;
3078
- var NODE_TYPE_COMMENT = 8;
3079
- var NODE_TYPE_DOCUMENT = 9;
3080
- var NODE_TYPE_DOCUMENT_FRAGMENT = 11;
3081
-
3082
-
3083
- function setupModuleLoader(window) {
3084
-
3085
- var $injectorMinErr = minErr('$injector');
3086
- var ngMinErr = minErr('ng');
3087
-
3088
- function ensure(obj, name, factory) {
3089
- return obj[name] || (obj[name] = factory());
3090
- }
3091
-
3092
- var angular = ensure(window, 'angular', Object);
3093
-
3094
- angular.$$minErr = angular.$$minErr || minErr;
3095
-
3096
- return ensure(angular, 'module', function() {
3097
- var modules = {};
3098
-
3099
- return function module(name, requires, configFn) {
3100
- var assertNotHasOwnProperty = function(name, context) {
3101
- if (name === 'hasOwnProperty') {
3102
- throw ngMinErr('badname', 'hasOwnProperty is not a valid {0} name', context);
3103
- }
3104
- };
3105
-
3106
- assertNotHasOwnProperty(name, 'module');
3107
- if (requires && modules.hasOwnProperty(name)) {
3108
- modules[name] = null;
3109
- }
3110
- return ensure(modules, name, function() {
3111
- if (!requires) {
3112
- throw $injectorMinErr('nomod', 'Module \'{0}\' is not available! You either misspelled ' +
3113
- 'the module name or forgot to load it. If registering a module ensure that you ' +
3114
- 'specify the dependencies as the second argument.', name);
3115
- }
3116
-
3117
- var invokeQueue = [];
3118
-
3119
- var configBlocks = [];
3120
-
3121
- var runBlocks = [];
3122
-
3123
- var config = invokeLater('$injector', 'invoke', 'push', configBlocks);
3124
-
3125
- var moduleInstance = {
3126
- _invokeQueue: invokeQueue,
3127
- _configBlocks: configBlocks,
3128
- _runBlocks: runBlocks,
3129
-
3130
- requires: requires,
3131
-
3132
- name: name,
3133
-
3134
-
3135
- provider: invokeLaterAndSetModuleName('$provide', 'provider'),
3136
-
3137
- factory: invokeLaterAndSetModuleName('$provide', 'factory'),
3138
-
3139
- service: invokeLaterAndSetModuleName('$provide', 'service'),
3140
-
3141
- value: invokeLater('$provide', 'value'),
3142
-
3143
- constant: invokeLater('$provide', 'constant', 'unshift'),
3144
-
3145
- decorator: invokeLaterAndSetModuleName('$provide', 'decorator', configBlocks),
3146
-
3147
- animation: invokeLaterAndSetModuleName('$animateProvider', 'register'),
3148
-
3149
- filter: invokeLaterAndSetModuleName('$filterProvider', 'register'),
3150
-
3151
- controller: invokeLaterAndSetModuleName('$controllerProvider', 'register'),
3152
-
3153
- directive: invokeLaterAndSetModuleName('$compileProvider', 'directive'),
3154
-
3155
- component: invokeLaterAndSetModuleName('$compileProvider', 'component'),
3156
-
3157
- config: config,
3158
-
3159
- run: function(block) {
3160
- runBlocks.push(block);
3161
- return this;
3162
- }
3163
- };
3164
-
3165
- if (configFn) {
3166
- config(configFn);
3167
- }
3168
-
3169
- return moduleInstance;
3170
-
3171
- function invokeLater(provider, method, insertMethod, queue) {
3172
- if (!queue) queue = invokeQueue;
3173
- return function() {
3174
- queue[insertMethod || 'push']([provider, method, arguments]);
3175
- return moduleInstance;
3176
- };
3177
- }
3178
-
3179
- function invokeLaterAndSetModuleName(provider, method, queue) {
3180
- if (!queue) queue = invokeQueue;
3181
- return function(recipeName, factoryFunction) {
3182
- if (factoryFunction && isFunction(factoryFunction)) factoryFunction.$$moduleName = name;
3183
- queue.push([provider, method, arguments]);
3184
- return moduleInstance;
3185
- };
3186
- }
3187
- });
3188
- };
3189
- });
3190
-
3191
- }
3192
-
3193
-
3194
- function shallowCopy(src, dst) {
3195
- if (isArray(src)) {
3196
- dst = dst || [];
3197
-
3198
- for (var i = 0, ii = src.length; i < ii; i++) {
3199
- dst[i] = src[i];
3200
- }
3201
- } else if (isObject(src)) {
3202
- dst = dst || {};
3203
-
3204
- for (var key in src) {
3205
- if (!(key.charAt(0) === '$' && key.charAt(1) === '$')) {
3206
- dst[key] = src[key];
3207
- }
3208
- }
3209
- }
3210
-
3211
- return dst || src;
3212
- }
3213
-
3214
-
3215
- function serializeObject(obj) {
3216
- var seen = [];
3217
-
3218
- return JSON.stringify(obj, function(key, val) {
3219
- val = toJsonReplacer(key, val);
3220
- if (isObject(val)) {
3221
-
3222
- if (seen.indexOf(val) >= 0) return '...';
3223
-
3224
- seen.push(val);
3225
- }
3226
- return val;
3227
- });
3228
- }
3229
-
3230
- function toDebugString(obj) {
3231
- if (typeof obj === 'function') {
3232
- return obj.toString().replace(/ \{[\s\S]*$/, '');
3233
- } else if (isUndefined(obj)) {
3234
- return 'undefined';
3235
- } else if (typeof obj !== 'string') {
3236
- return serializeObject(obj);
3237
- }
3238
- return obj;
3239
- }
3240
-
3241
-
3242
-
3243
- var version = {
3244
- full: '1.6.1',
3245
- major: 1,
3246
- minor: 6,
3247
- dot: 1,
3248
- codeName: 'promise-rectification'
3249
- };
3250
-
3251
-
3252
- function publishExternalAPI(angular) {
3253
- extend(angular, {
3254
- 'bootstrap': bootstrap,
3255
- 'copy': copy,
3256
- 'extend': extend,
3257
- 'merge': merge,
3258
- 'equals': equals,
3259
- 'element': jqLite,
3260
- 'forEach': forEach,
3261
- 'injector': createInjector,
3262
- 'noop': noop,
3263
- 'bind': bind,
3264
- 'toJson': toJson,
3265
- 'fromJson': fromJson,
3266
- 'identity': identity,
3267
- 'isUndefined': isUndefined,
3268
- 'isDefined': isDefined,
3269
- 'isString': isString,
3270
- 'isFunction': isFunction,
3271
- 'isObject': isObject,
3272
- 'isNumber': isNumber,
3273
- 'isElement': isElement,
3274
- 'isArray': isArray,
3275
- 'version': version,
3276
- 'isDate': isDate,
3277
- 'lowercase': lowercase,
3278
- 'uppercase': uppercase,
3279
- 'callbacks': {$$counter: 0},
3280
- 'getTestability': getTestability,
3281
- 'reloadWithDebugInfo': reloadWithDebugInfo,
3282
- '$$minErr': minErr,
3283
- '$$csp': csp,
3284
- '$$encodeUriSegment': encodeUriSegment,
3285
- '$$encodeUriQuery': encodeUriQuery,
3286
- '$$stringify': stringify
3287
- });
3288
-
3289
- angularModule = setupModuleLoader(window);
3290
-
3291
- angularModule('ng', ['ngLocale'], ['$provide',
3292
- function ngModule($provide) {
3293
- $provide.provider({
3294
- $$sanitizeUri: $$SanitizeUriProvider
3295
- });
3296
- $provide.provider('$compile', $CompileProvider).
3297
- directive({
3298
- a: htmlAnchorDirective,
3299
- input: inputDirective,
3300
- textarea: inputDirective,
3301
- form: formDirective,
3302
- script: scriptDirective,
3303
- select: selectDirective,
3304
- option: optionDirective,
3305
- ngBind: ngBindDirective,
3306
- ngBindHtml: ngBindHtmlDirective,
3307
- ngBindTemplate: ngBindTemplateDirective,
3308
- ngClass: ngClassDirective,
3309
- ngClassEven: ngClassEvenDirective,
3310
- ngClassOdd: ngClassOddDirective,
3311
- ngCloak: ngCloakDirective,
3312
- ngController: ngControllerDirective,
3313
- ngForm: ngFormDirective,
3314
- ngHide: ngHideDirective,
3315
- ngIf: ngIfDirective,
3316
- ngInclude: ngIncludeDirective,
3317
- ngInit: ngInitDirective,
3318
- ngNonBindable: ngNonBindableDirective,
3319
- ngPluralize: ngPluralizeDirective,
3320
- ngRepeat: ngRepeatDirective,
3321
- ngShow: ngShowDirective,
3322
- ngStyle: ngStyleDirective,
3323
- ngSwitch: ngSwitchDirective,
3324
- ngSwitchWhen: ngSwitchWhenDirective,
3325
- ngSwitchDefault: ngSwitchDefaultDirective,
3326
- ngOptions: ngOptionsDirective,
3327
- ngTransclude: ngTranscludeDirective,
3328
- ngModel: ngModelDirective,
3329
- ngList: ngListDirective,
3330
- ngChange: ngChangeDirective,
3331
- pattern: patternDirective,
3332
- ngPattern: patternDirective,
3333
- required: requiredDirective,
3334
- ngRequired: requiredDirective,
3335
- minlength: minlengthDirective,
3336
- ngMinlength: minlengthDirective,
3337
- maxlength: maxlengthDirective,
3338
- ngMaxlength: maxlengthDirective,
3339
- ngValue: ngValueDirective,
3340
- ngModelOptions: ngModelOptionsDirective
3341
- }).
3342
- directive({
3343
- ngInclude: ngIncludeFillContentDirective
3344
- }).
3345
- directive(ngAttributeAliasDirectives).
3346
- directive(ngEventDirectives);
3347
- $provide.provider({
3348
- $anchorScroll: $AnchorScrollProvider,
3349
- $animate: $AnimateProvider,
3350
- $animateCss: $CoreAnimateCssProvider,
3351
- $$animateJs: $$CoreAnimateJsProvider,
3352
- $$animateQueue: $$CoreAnimateQueueProvider,
3353
- $$AnimateRunner: $$AnimateRunnerFactoryProvider,
3354
- $$animateAsyncRun: $$AnimateAsyncRunFactoryProvider,
3355
- $browser: $BrowserProvider,
3356
- $cacheFactory: $CacheFactoryProvider,
3357
- $controller: $ControllerProvider,
3358
- $document: $DocumentProvider,
3359
- $$isDocumentHidden: $$IsDocumentHiddenProvider,
3360
- $exceptionHandler: $ExceptionHandlerProvider,
3361
- $filter: $FilterProvider,
3362
- $$forceReflow: $$ForceReflowProvider,
3363
- $interpolate: $InterpolateProvider,
3364
- $interval: $IntervalProvider,
3365
- $http: $HttpProvider,
3366
- $httpParamSerializer: $HttpParamSerializerProvider,
3367
- $httpParamSerializerJQLike: $HttpParamSerializerJQLikeProvider,
3368
- $httpBackend: $HttpBackendProvider,
3369
- $xhrFactory: $xhrFactoryProvider,
3370
- $jsonpCallbacks: $jsonpCallbacksProvider,
3371
- $location: $LocationProvider,
3372
- $log: $LogProvider,
3373
- $parse: $ParseProvider,
3374
- $rootScope: $RootScopeProvider,
3375
- $q: $QProvider,
3376
- $$q: $$QProvider,
3377
- $sce: $SceProvider,
3378
- $sceDelegate: $SceDelegateProvider,
3379
- $sniffer: $SnifferProvider,
3380
- $templateCache: $TemplateCacheProvider,
3381
- $templateRequest: $TemplateRequestProvider,
3382
- $$testability: $$TestabilityProvider,
3383
- $timeout: $TimeoutProvider,
3384
- $window: $WindowProvider,
3385
- $$rAF: $$RAFProvider,
3386
- $$jqLite: $$jqLiteProvider,
3387
- $$HashMap: $$HashMapProvider,
3388
- $$cookieReader: $$CookieReaderProvider
3389
- });
3390
- }
3391
- ]);
3392
- }
3393
-
3394
-
3395
-
3396
-
3397
-
3398
- JQLite.expando = 'ng339';
3399
-
3400
- var jqCache = JQLite.cache = {},
3401
- jqId = 1;
3402
-
3403
- JQLite._data = function(node) {
3404
- return this.cache[node[this.expando]] || {};
3405
- };
3406
-
3407
- function jqNextId() { return ++jqId; }
3408
-
3409
-
3410
- var DASH_LOWERCASE_REGEXP = /-([a-z])/g;
3411
- var MS_HACK_REGEXP = /^-ms-/;
3412
- var MOUSE_EVENT_MAP = { mouseleave: 'mouseout', mouseenter: 'mouseover' };
3413
- var jqLiteMinErr = minErr('jqLite');
3414
-
3415
- function cssKebabToCamel(name) {
3416
- return kebabToCamel(name.replace(MS_HACK_REGEXP, 'ms-'));
3417
- }
3418
-
3419
- function fnCamelCaseReplace(all, letter) {
3420
- return letter.toUpperCase();
3421
- }
3422
-
3423
- function kebabToCamel(name) {
3424
- return name
3425
- .replace(DASH_LOWERCASE_REGEXP, fnCamelCaseReplace);
3426
- }
3427
-
3428
- var SINGLE_TAG_REGEXP = /^<([\w-]+)\s*\/?>(?:<\/\1>|)$/;
3429
- var HTML_REGEXP = /<|&#?\w+;/;
3430
- var TAG_NAME_REGEXP = /<([\w:-]+)/;
3431
- var XHTML_TAG_REGEXP = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi;
3432
-
3433
- var wrapMap = {
3434
- 'option': [1, '<select multiple="multiple">', '</select>'],
3435
-
3436
- 'thead': [1, '<table>', '</table>'],
3437
- 'col': [2, '<table><colgroup>', '</colgroup></table>'],
3438
- 'tr': [2, '<table><tbody>', '</tbody></table>'],
3439
- 'td': [3, '<table><tbody><tr>', '</tr></tbody></table>'],
3440
- '_default': [0, '', '']
3441
- };
3442
-
3443
- wrapMap.optgroup = wrapMap.option;
3444
- wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
3445
- wrapMap.th = wrapMap.td;
3446
-
3447
-
3448
- function jqLiteIsTextNode(html) {
3449
- return !HTML_REGEXP.test(html);
3450
- }
3451
-
3452
- function jqLiteAcceptsData(node) {
3453
- var nodeType = node.nodeType;
3454
- return nodeType === NODE_TYPE_ELEMENT || !nodeType || nodeType === NODE_TYPE_DOCUMENT;
3455
- }
3456
-
3457
- function jqLiteHasData(node) {
3458
- for (var key in jqCache[node.ng339]) {
3459
- return true;
3460
- }
3461
- return false;
3462
- }
3463
-
3464
- function jqLiteCleanData(nodes) {
3465
- for (var i = 0, ii = nodes.length; i < ii; i++) {
3466
- jqLiteRemoveData(nodes[i]);
3467
- }
3468
- }
3469
-
3470
- function jqLiteBuildFragment(html, context) {
3471
- var tmp, tag, wrap,
3472
- fragment = context.createDocumentFragment(),
3473
- nodes = [], i;
3474
-
3475
- if (jqLiteIsTextNode(html)) {
3476
- nodes.push(context.createTextNode(html));
3477
- } else {
3478
- tmp = fragment.appendChild(context.createElement('div'));
3479
- tag = (TAG_NAME_REGEXP.exec(html) || ['', ''])[1].toLowerCase();
3480
- wrap = wrapMap[tag] || wrapMap._default;
3481
- tmp.innerHTML = wrap[1] + html.replace(XHTML_TAG_REGEXP, '<$1></$2>') + wrap[2];
3482
-
3483
- i = wrap[0];
3484
- while (i--) {
3485
- tmp = tmp.lastChild;
3486
- }
3487
-
3488
- nodes = concat(nodes, tmp.childNodes);
3489
-
3490
- tmp = fragment.firstChild;
3491
- tmp.textContent = '';
3492
- }
3493
-
3494
- fragment.textContent = '';
3495
- fragment.innerHTML = '';
3496
- forEach(nodes, function(node) {
3497
- fragment.appendChild(node);
3498
- });
3499
-
3500
- return fragment;
3501
- }
3502
-
3503
- function jqLiteParseHTML(html, context) {
3504
- context = context || window.document;
3505
- var parsed;
3506
-
3507
- if ((parsed = SINGLE_TAG_REGEXP.exec(html))) {
3508
- return [context.createElement(parsed[1])];
3509
- }
3510
-
3511
- if ((parsed = jqLiteBuildFragment(html, context))) {
3512
- return parsed.childNodes;
3513
- }
3514
-
3515
- return [];
3516
- }
3517
-
3518
- function jqLiteWrapNode(node, wrapper) {
3519
- var parent = node.parentNode;
3520
-
3521
- if (parent) {
3522
- parent.replaceChild(wrapper, node);
3523
- }
3524
-
3525
- wrapper.appendChild(node);
3526
- }
3527
-
3528
-
3529
- var jqLiteContains = window.Node.prototype.contains || function(arg) {
3530
- return !!(this.compareDocumentPosition(arg) & 16);
3531
- };
3532
-
3533
- function JQLite(element) {
3534
- if (element instanceof JQLite) {
3535
- return element;
3536
- }
3537
-
3538
- var argIsString;
3539
-
3540
- if (isString(element)) {
3541
- element = trim(element);
3542
- argIsString = true;
3543
- }
3544
- if (!(this instanceof JQLite)) {
3545
- if (argIsString && element.charAt(0) !== '<') {
3546
- throw jqLiteMinErr('nosel', 'Looking up elements via selectors is not supported by jqLite! See: http://docs.angularjs.org/api/angular.element');
3547
- }
3548
- return new JQLite(element);
3549
- }
3550
-
3551
- if (argIsString) {
3552
- jqLiteAddNodes(this, jqLiteParseHTML(element));
3553
- } else if (isFunction(element)) {
3554
- jqLiteReady(element);
3555
- } else {
3556
- jqLiteAddNodes(this, element);
3557
- }
3558
- }
3559
-
3560
- function jqLiteClone(element) {
3561
- return element.cloneNode(true);
3562
- }
3563
-
3564
- function jqLiteDealoc(element, onlyDescendants) {
3565
- if (!onlyDescendants) jqLiteRemoveData(element);
3566
-
3567
- if (element.querySelectorAll) {
3568
- var descendants = element.querySelectorAll('*');
3569
- for (var i = 0, l = descendants.length; i < l; i++) {
3570
- jqLiteRemoveData(descendants[i]);
3571
- }
3572
- }
3573
- }
3574
-
3575
- function jqLiteOff(element, type, fn, unsupported) {
3576
- if (isDefined(unsupported)) throw jqLiteMinErr('offargs', 'jqLite#off() does not support the `selector` argument');
3577
-
3578
- var expandoStore = jqLiteExpandoStore(element);
3579
- var events = expandoStore && expandoStore.events;
3580
- var handle = expandoStore && expandoStore.handle;
3581
-
3582
- if (!handle) return;
3583
-
3584
- if (!type) {
3585
- for (type in events) {
3586
- if (type !== '$destroy') {
3587
- element.removeEventListener(type, handle);
3588
- }
3589
- delete events[type];
3590
- }
3591
- } else {
3592
-
3593
- var removeHandler = function(type) {
3594
- var listenerFns = events[type];
3595
- if (isDefined(fn)) {
3596
- arrayRemove(listenerFns || [], fn);
3597
- }
3598
- if (!(isDefined(fn) && listenerFns && listenerFns.length > 0)) {
3599
- element.removeEventListener(type, handle);
3600
- delete events[type];
3601
- }
3602
- };
3603
-
3604
- forEach(type.split(' '), function(type) {
3605
- removeHandler(type);
3606
- if (MOUSE_EVENT_MAP[type]) {
3607
- removeHandler(MOUSE_EVENT_MAP[type]);
3608
- }
3609
- });
3610
- }
3611
- }
3612
-
3613
- function jqLiteRemoveData(element, name) {
3614
- var expandoId = element.ng339;
3615
- var expandoStore = expandoId && jqCache[expandoId];
3616
-
3617
- if (expandoStore) {
3618
- if (name) {
3619
- delete expandoStore.data[name];
3620
- return;
3621
- }
3622
-
3623
- if (expandoStore.handle) {
3624
- if (expandoStore.events.$destroy) {
3625
- expandoStore.handle({}, '$destroy');
3626
- }
3627
- jqLiteOff(element);
3628
- }
3629
- delete jqCache[expandoId];
3630
- element.ng339 = undefined;
3631
- }
3632
- }
3633
-
3634
-
3635
- function jqLiteExpandoStore(element, createIfNecessary) {
3636
- var expandoId = element.ng339,
3637
- expandoStore = expandoId && jqCache[expandoId];
3638
-
3639
- if (createIfNecessary && !expandoStore) {
3640
- element.ng339 = expandoId = jqNextId();
3641
- expandoStore = jqCache[expandoId] = {events: {}, data: {}, handle: undefined};
3642
- }
3643
-
3644
- return expandoStore;
3645
- }
3646
-
3647
-
3648
- function jqLiteData(element, key, value) {
3649
- if (jqLiteAcceptsData(element)) {
3650
- var prop;
3651
-
3652
- var isSimpleSetter = isDefined(value);
3653
- var isSimpleGetter = !isSimpleSetter && key && !isObject(key);
3654
- var massGetter = !key;
3655
- var expandoStore = jqLiteExpandoStore(element, !isSimpleGetter);
3656
- var data = expandoStore && expandoStore.data;
3657
-
3658
- if (isSimpleSetter) {
3659
- data[kebabToCamel(key)] = value;
3660
- } else {
3661
- if (massGetter) {
3662
- return data;
3663
- } else {
3664
- if (isSimpleGetter) {
3665
- return data && data[kebabToCamel(key)];
3666
- } else {
3667
- for (prop in key) {
3668
- data[kebabToCamel(prop)] = key[prop];
3669
- }
3670
- }
3671
- }
3672
- }
3673
- }
3674
- }
3675
-
3676
- function jqLiteHasClass(element, selector) {
3677
- if (!element.getAttribute) return false;
3678
- return ((' ' + (element.getAttribute('class') || '') + ' ').replace(/[\n\t]/g, ' ').
3679
- indexOf(' ' + selector + ' ') > -1);
3680
- }
3681
-
3682
- function jqLiteRemoveClass(element, cssClasses) {
3683
- if (cssClasses && element.setAttribute) {
3684
- forEach(cssClasses.split(' '), function(cssClass) {
3685
- element.setAttribute('class', trim(
3686
- (' ' + (element.getAttribute('class') || '') + ' ')
3687
- .replace(/[\n\t]/g, ' ')
3688
- .replace(' ' + trim(cssClass) + ' ', ' '))
3689
- );
3690
- });
3691
- }
3692
- }
3693
-
3694
- function jqLiteAddClass(element, cssClasses) {
3695
- if (cssClasses && element.setAttribute) {
3696
- var existingClasses = (' ' + (element.getAttribute('class') || '') + ' ')
3697
- .replace(/[\n\t]/g, ' ');
3698
-
3699
- forEach(cssClasses.split(' '), function(cssClass) {
3700
- cssClass = trim(cssClass);
3701
- if (existingClasses.indexOf(' ' + cssClass + ' ') === -1) {
3702
- existingClasses += cssClass + ' ';
3703
- }
3704
- });
3705
-
3706
- element.setAttribute('class', trim(existingClasses));
3707
- }
3708
- }
3709
-
3710
-
3711
- function jqLiteAddNodes(root, elements) {
3712
-
3713
- if (elements) {
3714
-
3715
- if (elements.nodeType) {
3716
- root[root.length++] = elements;
3717
- } else {
3718
- var length = elements.length;
3719
-
3720
- if (typeof length === 'number' && elements.window !== elements) {
3721
- if (length) {
3722
- for (var i = 0; i < length; i++) {
3723
- root[root.length++] = elements[i];
3724
- }
3725
- }
3726
- } else {
3727
- root[root.length++] = elements;
3728
- }
3729
- }
3730
- }
3731
- }
3732
-
3733
-
3734
- function jqLiteController(element, name) {
3735
- return jqLiteInheritedData(element, '$' + (name || 'ngController') + 'Controller');
3736
- }
3737
-
3738
- function jqLiteInheritedData(element, name, value) {
3739
- if (element.nodeType === NODE_TYPE_DOCUMENT) {
3740
- element = element.documentElement;
3741
- }
3742
- var names = isArray(name) ? name : [name];
3743
-
3744
- while (element) {
3745
- for (var i = 0, ii = names.length; i < ii; i++) {
3746
- if (isDefined(value = jqLite.data(element, names[i]))) return value;
3747
- }
3748
-
3749
- element = element.parentNode || (element.nodeType === NODE_TYPE_DOCUMENT_FRAGMENT && element.host);
3750
- }
3751
- }
3752
-
3753
- function jqLiteEmpty(element) {
3754
- jqLiteDealoc(element, true);
3755
- while (element.firstChild) {
3756
- element.removeChild(element.firstChild);
3757
- }
3758
- }
3759
-
3760
- function jqLiteRemove(element, keepData) {
3761
- if (!keepData) jqLiteDealoc(element);
3762
- var parent = element.parentNode;
3763
- if (parent) parent.removeChild(element);
3764
- }
3765
-
3766
-
3767
- function jqLiteDocumentLoaded(action, win) {
3768
- win = win || window;
3769
- if (win.document.readyState === 'complete') {
3770
- win.setTimeout(action);
3771
- } else {
3772
- jqLite(win).on('load', action);
3773
- }
3774
- }
3775
-
3776
- function jqLiteReady(fn) {
3777
- function trigger() {
3778
- window.document.removeEventListener('DOMContentLoaded', trigger);
3779
- window.removeEventListener('load', trigger);
3780
- fn();
3781
- }
3782
-
3783
- if (window.document.readyState === 'complete') {
3784
- window.setTimeout(fn);
3785
- } else {
3786
-
3787
- window.document.addEventListener('DOMContentLoaded', trigger);
3788
-
3789
- window.addEventListener('load', trigger);
3790
- }
3791
- }
3792
-
3793
- var JQLitePrototype = JQLite.prototype = {
3794
- ready: jqLiteReady,
3795
- toString: function() {
3796
- var value = [];
3797
- forEach(this, function(e) { value.push('' + e);});
3798
- return '[' + value.join(', ') + ']';
3799
- },
3800
-
3801
- eq: function(index) {
3802
- return (index >= 0) ? jqLite(this[index]) : jqLite(this[this.length + index]);
3803
- },
3804
-
3805
- length: 0,
3806
- push: push,
3807
- sort: [].sort,
3808
- splice: [].splice
3809
- };
3810
-
3811
- var BOOLEAN_ATTR = {};
3812
- forEach('multiple,selected,checked,disabled,readOnly,required,open'.split(','), function(value) {
3813
- BOOLEAN_ATTR[lowercase(value)] = value;
3814
- });
3815
- var BOOLEAN_ELEMENTS = {};
3816
- forEach('input,select,option,textarea,button,form,details'.split(','), function(value) {
3817
- BOOLEAN_ELEMENTS[value] = true;
3818
- });
3819
- var ALIASED_ATTR = {
3820
- 'ngMinlength': 'minlength',
3821
- 'ngMaxlength': 'maxlength',
3822
- 'ngMin': 'min',
3823
- 'ngMax': 'max',
3824
- 'ngPattern': 'pattern',
3825
- 'ngStep': 'step'
3826
- };
3827
-
3828
- function getBooleanAttrName(element, name) {
3829
- var booleanAttr = BOOLEAN_ATTR[name.toLowerCase()];
3830
-
3831
- return booleanAttr && BOOLEAN_ELEMENTS[nodeName_(element)] && booleanAttr;
3832
- }
3833
-
3834
- function getAliasedAttrName(name) {
3835
- return ALIASED_ATTR[name];
3836
- }
3837
-
3838
- forEach({
3839
- data: jqLiteData,
3840
- removeData: jqLiteRemoveData,
3841
- hasData: jqLiteHasData,
3842
- cleanData: jqLiteCleanData
3843
- }, function(fn, name) {
3844
- JQLite[name] = fn;
3845
- });
3846
-
3847
- forEach({
3848
- data: jqLiteData,
3849
- inheritedData: jqLiteInheritedData,
3850
-
3851
- scope: function(element) {
3852
- return jqLite.data(element, '$scope') || jqLiteInheritedData(element.parentNode || element, ['$isolateScope', '$scope']);
3853
- },
3854
-
3855
- isolateScope: function(element) {
3856
- return jqLite.data(element, '$isolateScope') || jqLite.data(element, '$isolateScopeNoTemplate');
3857
- },
3858
-
3859
- controller: jqLiteController,
3860
-
3861
- injector: function(element) {
3862
- return jqLiteInheritedData(element, '$injector');
3863
- },
3864
-
3865
- removeAttr: function(element, name) {
3866
- element.removeAttribute(name);
3867
- },
3868
-
3869
- hasClass: jqLiteHasClass,
3870
-
3871
- css: function(element, name, value) {
3872
- name = cssKebabToCamel(name);
3873
-
3874
- if (isDefined(value)) {
3875
- element.style[name] = value;
3876
- } else {
3877
- return element.style[name];
3878
- }
3879
- },
3880
-
3881
- attr: function(element, name, value) {
3882
- var ret;
3883
- var nodeType = element.nodeType;
3884
- if (nodeType === NODE_TYPE_TEXT || nodeType === NODE_TYPE_ATTRIBUTE || nodeType === NODE_TYPE_COMMENT ||
3885
- !element.getAttribute) {
3886
- return;
3887
- }
3888
-
3889
- var lowercasedName = lowercase(name);
3890
- var isBooleanAttr = BOOLEAN_ATTR[lowercasedName];
3891
-
3892
- if (isDefined(value)) {
3893
-
3894
- if (value === null || (value === false && isBooleanAttr)) {
3895
- element.removeAttribute(name);
3896
- } else {
3897
- element.setAttribute(name, isBooleanAttr ? lowercasedName : value);
3898
- }
3899
- } else {
3900
-
3901
- ret = element.getAttribute(name);
3902
-
3903
- if (isBooleanAttr && ret !== null) {
3904
- ret = lowercasedName;
3905
- }
3906
- return ret === null ? undefined : ret;
3907
- }
3908
- },
3909
-
3910
- prop: function(element, name, value) {
3911
- if (isDefined(value)) {
3912
- element[name] = value;
3913
- } else {
3914
- return element[name];
3915
- }
3916
- },
3917
-
3918
- text: (function() {
3919
- getText.$dv = '';
3920
- return getText;
3921
-
3922
- function getText(element, value) {
3923
- if (isUndefined(value)) {
3924
- var nodeType = element.nodeType;
3925
- return (nodeType === NODE_TYPE_ELEMENT || nodeType === NODE_TYPE_TEXT) ? element.textContent : '';
3926
- }
3927
- element.textContent = value;
3928
- }
3929
- })(),
3930
-
3931
- val: function(element, value) {
3932
- if (isUndefined(value)) {
3933
- if (element.multiple && nodeName_(element) === 'select') {
3934
- var result = [];
3935
- forEach(element.options, function(option) {
3936
- if (option.selected) {
3937
- result.push(option.value || option.text);
3938
- }
3939
- });
3940
- return result;
3941
- }
3942
- return element.value;
3943
- }
3944
- element.value = value;
3945
- },
3946
-
3947
- html: function(element, value) {
3948
- if (isUndefined(value)) {
3949
- return element.innerHTML;
3950
- }
3951
- jqLiteDealoc(element, true);
3952
- element.innerHTML = value;
3953
- },
3954
-
3955
- empty: jqLiteEmpty
3956
- }, function(fn, name) {
3957
- JQLite.prototype[name] = function(arg1, arg2) {
3958
- var i, key;
3959
- var nodeCount = this.length;
3960
-
3961
- if (fn !== jqLiteEmpty &&
3962
- (isUndefined((fn.length === 2 && (fn !== jqLiteHasClass && fn !== jqLiteController)) ? arg1 : arg2))) {
3963
- if (isObject(arg1)) {
3964
-
3965
- for (i = 0; i < nodeCount; i++) {
3966
- if (fn === jqLiteData) {
3967
- fn(this[i], arg1);
3968
- } else {
3969
- for (key in arg1) {
3970
- fn(this[i], key, arg1[key]);
3971
- }
3972
- }
3973
- }
3974
- return this;
3975
- } else {
3976
- var value = fn.$dv;
3977
- var jj = (isUndefined(value)) ? Math.min(nodeCount, 1) : nodeCount;
3978
- for (var j = 0; j < jj; j++) {
3979
- var nodeValue = fn(this[j], arg1, arg2);
3980
- value = value ? value + nodeValue : nodeValue;
3981
- }
3982
- return value;
3983
- }
3984
- } else {
3985
- for (i = 0; i < nodeCount; i++) {
3986
- fn(this[i], arg1, arg2);
3987
- }
3988
- return this;
3989
- }
3990
- };
3991
- });
3992
-
3993
- function createEventHandler(element, events) {
3994
- var eventHandler = function(event, type) {
3995
- event.isDefaultPrevented = function() {
3996
- return event.defaultPrevented;
3997
- };
3998
-
3999
- var eventFns = events[type || event.type];
4000
- var eventFnsLength = eventFns ? eventFns.length : 0;
4001
-
4002
- if (!eventFnsLength) return;
4003
-
4004
- if (isUndefined(event.immediatePropagationStopped)) {
4005
- var originalStopImmediatePropagation = event.stopImmediatePropagation;
4006
- event.stopImmediatePropagation = function() {
4007
- event.immediatePropagationStopped = true;
4008
-
4009
- if (event.stopPropagation) {
4010
- event.stopPropagation();
4011
- }
4012
-
4013
- if (originalStopImmediatePropagation) {
4014
- originalStopImmediatePropagation.call(event);
4015
- }
4016
- };
4017
- }
4018
-
4019
- event.isImmediatePropagationStopped = function() {
4020
- return event.immediatePropagationStopped === true;
4021
- };
4022
-
4023
- var handlerWrapper = eventFns.specialHandlerWrapper || defaultHandlerWrapper;
4024
-
4025
- if ((eventFnsLength > 1)) {
4026
- eventFns = shallowCopy(eventFns);
4027
- }
4028
-
4029
- for (var i = 0; i < eventFnsLength; i++) {
4030
- if (!event.isImmediatePropagationStopped()) {
4031
- handlerWrapper(element, event, eventFns[i]);
4032
- }
4033
- }
4034
- };
4035
-
4036
- eventHandler.elem = element;
4037
- return eventHandler;
4038
- }
4039
-
4040
- function defaultHandlerWrapper(element, event, handler) {
4041
- handler.call(element, event);
4042
- }
4043
-
4044
- function specialMouseHandlerWrapper(target, event, handler) {
4045
- var related = event.relatedTarget;
4046
- if (!related || (related !== target && !jqLiteContains.call(target, related))) {
4047
- handler.call(target, event);
4048
- }
4049
- }
4050
-
4051
- forEach({
4052
- removeData: jqLiteRemoveData,
4053
-
4054
- on: function jqLiteOn(element, type, fn, unsupported) {
4055
- if (isDefined(unsupported)) throw jqLiteMinErr('onargs', 'jqLite#on() does not support the `selector` or `eventData` parameters');
4056
-
4057
- if (!jqLiteAcceptsData(element)) {
4058
- return;
4059
- }
4060
-
4061
- var expandoStore = jqLiteExpandoStore(element, true);
4062
- var events = expandoStore.events;
4063
- var handle = expandoStore.handle;
4064
-
4065
- if (!handle) {
4066
- handle = expandoStore.handle = createEventHandler(element, events);
4067
- }
4068
-
4069
- var types = type.indexOf(' ') >= 0 ? type.split(' ') : [type];
4070
- var i = types.length;
4071
-
4072
- var addHandler = function(type, specialHandlerWrapper, noEventListener) {
4073
- var eventFns = events[type];
4074
-
4075
- if (!eventFns) {
4076
- eventFns = events[type] = [];
4077
- eventFns.specialHandlerWrapper = specialHandlerWrapper;
4078
- if (type !== '$destroy' && !noEventListener) {
4079
- element.addEventListener(type, handle);
4080
- }
4081
- }
4082
-
4083
- eventFns.push(fn);
4084
- };
4085
-
4086
- while (i--) {
4087
- type = types[i];
4088
- if (MOUSE_EVENT_MAP[type]) {
4089
- addHandler(MOUSE_EVENT_MAP[type], specialMouseHandlerWrapper);
4090
- addHandler(type, undefined, true);
4091
- } else {
4092
- addHandler(type);
4093
- }
4094
- }
4095
- },
4096
-
4097
- off: jqLiteOff,
4098
-
4099
- one: function(element, type, fn) {
4100
- element = jqLite(element);
4101
-
4102
- element.on(type, function onFn() {
4103
- element.off(type, fn);
4104
- element.off(type, onFn);
4105
- });
4106
- element.on(type, fn);
4107
- },
4108
-
4109
- replaceWith: function(element, replaceNode) {
4110
- var index, parent = element.parentNode;
4111
- jqLiteDealoc(element);
4112
- forEach(new JQLite(replaceNode), function(node) {
4113
- if (index) {
4114
- parent.insertBefore(node, index.nextSibling);
4115
- } else {
4116
- parent.replaceChild(node, element);
4117
- }
4118
- index = node;
4119
- });
4120
- },
4121
-
4122
- children: function(element) {
4123
- var children = [];
4124
- forEach(element.childNodes, function(element) {
4125
- if (element.nodeType === NODE_TYPE_ELEMENT) {
4126
- children.push(element);
4127
- }
4128
- });
4129
- return children;
4130
- },
4131
-
4132
- contents: function(element) {
4133
- return element.contentDocument || element.childNodes || [];
4134
- },
4135
-
4136
- append: function(element, node) {
4137
- var nodeType = element.nodeType;
4138
- if (nodeType !== NODE_TYPE_ELEMENT && nodeType !== NODE_TYPE_DOCUMENT_FRAGMENT) return;
4139
-
4140
- node = new JQLite(node);
4141
-
4142
- for (var i = 0, ii = node.length; i < ii; i++) {
4143
- var child = node[i];
4144
- element.appendChild(child);
4145
- }
4146
- },
4147
-
4148
- prepend: function(element, node) {
4149
- if (element.nodeType === NODE_TYPE_ELEMENT) {
4150
- var index = element.firstChild;
4151
- forEach(new JQLite(node), function(child) {
4152
- element.insertBefore(child, index);
4153
- });
4154
- }
4155
- },
4156
-
4157
- wrap: function(element, wrapNode) {
4158
- jqLiteWrapNode(element, jqLite(wrapNode).eq(0).clone()[0]);
4159
- },
4160
-
4161
- remove: jqLiteRemove,
4162
-
4163
- detach: function(element) {
4164
- jqLiteRemove(element, true);
4165
- },
4166
-
4167
- after: function(element, newElement) {
4168
- var index = element, parent = element.parentNode;
4169
-
4170
- if (parent) {
4171
- newElement = new JQLite(newElement);
4172
-
4173
- for (var i = 0, ii = newElement.length; i < ii; i++) {
4174
- var node = newElement[i];
4175
- parent.insertBefore(node, index.nextSibling);
4176
- index = node;
4177
- }
4178
- }
4179
- },
4180
-
4181
- addClass: jqLiteAddClass,
4182
- removeClass: jqLiteRemoveClass,
4183
-
4184
- toggleClass: function(element, selector, condition) {
4185
- if (selector) {
4186
- forEach(selector.split(' '), function(className) {
4187
- var classCondition = condition;
4188
- if (isUndefined(classCondition)) {
4189
- classCondition = !jqLiteHasClass(element, className);
4190
- }
4191
- (classCondition ? jqLiteAddClass : jqLiteRemoveClass)(element, className);
4192
- });
4193
- }
4194
- },
4195
-
4196
- parent: function(element) {
4197
- var parent = element.parentNode;
4198
- return parent && parent.nodeType !== NODE_TYPE_DOCUMENT_FRAGMENT ? parent : null;
4199
- },
4200
-
4201
- next: function(element) {
4202
- return element.nextElementSibling;
4203
- },
4204
-
4205
- find: function(element, selector) {
4206
- if (element.getElementsByTagName) {
4207
- return element.getElementsByTagName(selector);
4208
- } else {
4209
- return [];
4210
- }
4211
- },
4212
-
4213
- clone: jqLiteClone,
4214
-
4215
- triggerHandler: function(element, event, extraParameters) {
4216
-
4217
- var dummyEvent, eventFnsCopy, handlerArgs;
4218
- var eventName = event.type || event;
4219
- var expandoStore = jqLiteExpandoStore(element);
4220
- var events = expandoStore && expandoStore.events;
4221
- var eventFns = events && events[eventName];
4222
-
4223
- if (eventFns) {
4224
- dummyEvent = {
4225
- preventDefault: function() { this.defaultPrevented = true; },
4226
- isDefaultPrevented: function() { return this.defaultPrevented === true; },
4227
- stopImmediatePropagation: function() { this.immediatePropagationStopped = true; },
4228
- isImmediatePropagationStopped: function() { return this.immediatePropagationStopped === true; },
4229
- stopPropagation: noop,
4230
- type: eventName,
4231
- target: element
4232
- };
4233
-
4234
- if (event.type) {
4235
- dummyEvent = extend(dummyEvent, event);
4236
- }
4237
-
4238
- eventFnsCopy = shallowCopy(eventFns);
4239
- handlerArgs = extraParameters ? [dummyEvent].concat(extraParameters) : [dummyEvent];
4240
-
4241
- forEach(eventFnsCopy, function(fn) {
4242
- if (!dummyEvent.isImmediatePropagationStopped()) {
4243
- fn.apply(element, handlerArgs);
4244
- }
4245
- });
4246
- }
4247
- }
4248
- }, function(fn, name) {
4249
- JQLite.prototype[name] = function(arg1, arg2, arg3) {
4250
- var value;
4251
-
4252
- for (var i = 0, ii = this.length; i < ii; i++) {
4253
- if (isUndefined(value)) {
4254
- value = fn(this[i], arg1, arg2, arg3);
4255
- if (isDefined(value)) {
4256
- value = jqLite(value);
4257
- }
4258
- } else {
4259
- jqLiteAddNodes(value, fn(this[i], arg1, arg2, arg3));
4260
- }
4261
- }
4262
- return isDefined(value) ? value : this;
4263
- };
4264
- });
4265
-
4266
- JQLite.prototype.bind = JQLite.prototype.on;
4267
- JQLite.prototype.unbind = JQLite.prototype.off;
4268
-
4269
-
4270
- function $$jqLiteProvider() {
4271
- this.$get = function $$jqLite() {
4272
- return extend(JQLite, {
4273
- hasClass: function(node, classes) {
4274
- if (node.attr) node = node[0];
4275
- return jqLiteHasClass(node, classes);
4276
- },
4277
- addClass: function(node, classes) {
4278
- if (node.attr) node = node[0];
4279
- return jqLiteAddClass(node, classes);
4280
- },
4281
- removeClass: function(node, classes) {
4282
- if (node.attr) node = node[0];
4283
- return jqLiteRemoveClass(node, classes);
4284
- }
4285
- });
4286
- };
4287
- }
4288
-
4289
- function hashKey(obj, nextUidFn) {
4290
- var key = obj && obj.$$hashKey;
4291
-
4292
- if (key) {
4293
- if (typeof key === 'function') {
4294
- key = obj.$$hashKey();
4295
- }
4296
- return key;
4297
- }
4298
-
4299
- var objType = typeof obj;
4300
- if (objType === 'function' || (objType === 'object' && obj !== null)) {
4301
- key = obj.$$hashKey = objType + ':' + (nextUidFn || nextUid)();
4302
- } else {
4303
- key = objType + ':' + obj;
4304
- }
4305
-
4306
- return key;
4307
- }
4308
-
4309
- function HashMap(array, isolatedUid) {
4310
- if (isolatedUid) {
4311
- var uid = 0;
4312
- this.nextUid = function() {
4313
- return ++uid;
4314
- };
4315
- }
4316
- forEach(array, this.put, this);
4317
- }
4318
- HashMap.prototype = {
4319
- put: function(key, value) {
4320
- this[hashKey(key, this.nextUid)] = value;
4321
- },
4322
-
4323
- get: function(key) {
4324
- return this[hashKey(key, this.nextUid)];
4325
- },
4326
-
4327
- remove: function(key) {
4328
- var value = this[key = hashKey(key, this.nextUid)];
4329
- delete this[key];
4330
- return value;
4331
- }
4332
- };
4333
-
4334
- var $$HashMapProvider = [function() {
4335
- this.$get = [function() {
4336
- return HashMap;
4337
- }];
4338
- }];
4339
-
4340
-
4341
-
4342
-
4343
- var ARROW_ARG = /^([^(]+?)=>/;
4344
- var FN_ARGS = /^[^(]*\(\s*([^)]*)\)/m;
4345
- var FN_ARG_SPLIT = /,/;
4346
- var FN_ARG = /^\s*(_?)(\S+?)\1\s*$/;
4347
- var STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg;
4348
- var $injectorMinErr = minErr('$injector');
4349
-
4350
- function stringifyFn(fn) {
4351
- return Function.prototype.toString.call(fn) + ' ';
4352
- }
4353
-
4354
- function extractArgs(fn) {
4355
- var fnText = stringifyFn(fn).replace(STRIP_COMMENTS, ''),
4356
- args = fnText.match(ARROW_ARG) || fnText.match(FN_ARGS);
4357
- return args;
4358
- }
4359
-
4360
- function anonFn(fn) {
4361
- var args = extractArgs(fn);
4362
- if (args) {
4363
- return 'function(' + (args[1] || '').replace(/[\s\r\n]+/, ' ') + ')';
4364
- }
4365
- return 'fn';
4366
- }
4367
-
4368
- function annotate(fn, strictDi, name) {
4369
- var $inject,
4370
- argDecl,
4371
- last;
4372
-
4373
- if (typeof fn === 'function') {
4374
- if (!($inject = fn.$inject)) {
4375
- $inject = [];
4376
- if (fn.length) {
4377
- if (strictDi) {
4378
- if (!isString(name) || !name) {
4379
- name = fn.name || anonFn(fn);
4380
- }
4381
- throw $injectorMinErr('strictdi',
4382
- '{0} is not using explicit annotation and cannot be invoked in strict mode', name);
4383
- }
4384
- argDecl = extractArgs(fn);
4385
- forEach(argDecl[1].split(FN_ARG_SPLIT), function(arg) {
4386
- arg.replace(FN_ARG, function(all, underscore, name) {
4387
- $inject.push(name);
4388
- });
4389
- });
4390
- }
4391
- fn.$inject = $inject;
4392
- }
4393
- } else if (isArray(fn)) {
4394
- last = fn.length - 1;
4395
- assertArgFn(fn[last], 'fn');
4396
- $inject = fn.slice(0, last);
4397
- } else {
4398
- assertArgFn(fn, 'fn', true);
4399
- }
4400
- return $inject;
4401
- }
4402
-
4403
-
4404
-
4405
-
4406
-
4407
-
4408
-
4409
-
4410
-
4411
-
4412
-
4413
-
4414
-
4415
-
4416
-
4417
-
4418
-
4419
-
4420
-
4421
-
4422
-
4423
-
4424
- function createInjector(modulesToLoad, strictDi) {
4425
- strictDi = (strictDi === true);
4426
- var INSTANTIATING = {},
4427
- providerSuffix = 'Provider',
4428
- path = [],
4429
- loadedModules = new HashMap([], true),
4430
- providerCache = {
4431
- $provide: {
4432
- provider: supportObject(provider),
4433
- factory: supportObject(factory),
4434
- service: supportObject(service),
4435
- value: supportObject(value),
4436
- constant: supportObject(constant),
4437
- decorator: decorator
4438
- }
4439
- },
4440
- providerInjector = (providerCache.$injector =
4441
- createInternalInjector(providerCache, function(serviceName, caller) {
4442
- if (angular.isString(caller)) {
4443
- path.push(caller);
4444
- }
4445
- throw $injectorMinErr('unpr', 'Unknown provider: {0}', path.join(' <- '));
4446
- })),
4447
- instanceCache = {},
4448
- protoInstanceInjector =
4449
- createInternalInjector(instanceCache, function(serviceName, caller) {
4450
- var provider = providerInjector.get(serviceName + providerSuffix, caller);
4451
- return instanceInjector.invoke(
4452
- provider.$get, provider, undefined, serviceName);
4453
- }),
4454
- instanceInjector = protoInstanceInjector;
4455
-
4456
- providerCache['$injector' + providerSuffix] = { $get: valueFn(protoInstanceInjector) };
4457
- var runBlocks = loadModules(modulesToLoad);
4458
- instanceInjector = protoInstanceInjector.get('$injector');
4459
- instanceInjector.strictDi = strictDi;
4460
- forEach(runBlocks, function(fn) { if (fn) instanceInjector.invoke(fn); });
4461
-
4462
- return instanceInjector;
4463
-
4464
-
4465
- function supportObject(delegate) {
4466
- return function(key, value) {
4467
- if (isObject(key)) {
4468
- forEach(key, reverseParams(delegate));
4469
- } else {
4470
- return delegate(key, value);
4471
- }
4472
- };
4473
- }
4474
-
4475
- function provider(name, provider_) {
4476
- assertNotHasOwnProperty(name, 'service');
4477
- if (isFunction(provider_) || isArray(provider_)) {
4478
- provider_ = providerInjector.instantiate(provider_);
4479
- }
4480
- if (!provider_.$get) {
4481
- throw $injectorMinErr('pget', 'Provider \'{0}\' must define $get factory method.', name);
4482
- }
4483
- return (providerCache[name + providerSuffix] = provider_);
4484
- }
4485
-
4486
- function enforceReturnValue(name, factory) {
4487
- return function enforcedReturnValue() {
4488
- var result = instanceInjector.invoke(factory, this);
4489
- if (isUndefined(result)) {
4490
- throw $injectorMinErr('undef', 'Provider \'{0}\' must return a value from $get factory method.', name);
4491
- }
4492
- return result;
4493
- };
4494
- }
4495
-
4496
- function factory(name, factoryFn, enforce) {
4497
- return provider(name, {
4498
- $get: enforce !== false ? enforceReturnValue(name, factoryFn) : factoryFn
4499
- });
4500
- }
4501
-
4502
- function service(name, constructor) {
4503
- return factory(name, ['$injector', function($injector) {
4504
- return $injector.instantiate(constructor);
4505
- }]);
4506
- }
4507
-
4508
- function value(name, val) { return factory(name, valueFn(val), false); }
4509
-
4510
- function constant(name, value) {
4511
- assertNotHasOwnProperty(name, 'constant');
4512
- providerCache[name] = value;
4513
- instanceCache[name] = value;
4514
- }
4515
-
4516
- function decorator(serviceName, decorFn) {
4517
- var origProvider = providerInjector.get(serviceName + providerSuffix),
4518
- orig$get = origProvider.$get;
4519
-
4520
- origProvider.$get = function() {
4521
- var origInstance = instanceInjector.invoke(orig$get, origProvider);
4522
- return instanceInjector.invoke(decorFn, null, {$delegate: origInstance});
4523
- };
4524
- }
4525
-
4526
- function loadModules(modulesToLoad) {
4527
- assertArg(isUndefined(modulesToLoad) || isArray(modulesToLoad), 'modulesToLoad', 'not an array');
4528
- var runBlocks = [], moduleFn;
4529
- forEach(modulesToLoad, function(module) {
4530
- if (loadedModules.get(module)) return;
4531
- loadedModules.put(module, true);
4532
-
4533
- function runInvokeQueue(queue) {
4534
- var i, ii;
4535
- for (i = 0, ii = queue.length; i < ii; i++) {
4536
- var invokeArgs = queue[i],
4537
- provider = providerInjector.get(invokeArgs[0]);
4538
-
4539
- provider[invokeArgs[1]].apply(provider, invokeArgs[2]);
4540
- }
4541
- }
4542
-
4543
- try {
4544
- if (isString(module)) {
4545
- moduleFn = angularModule(module);
4546
- runBlocks = runBlocks.concat(loadModules(moduleFn.requires)).concat(moduleFn._runBlocks);
4547
- runInvokeQueue(moduleFn._invokeQueue);
4548
- runInvokeQueue(moduleFn._configBlocks);
4549
- } else if (isFunction(module)) {
4550
- runBlocks.push(providerInjector.invoke(module));
4551
- } else if (isArray(module)) {
4552
- runBlocks.push(providerInjector.invoke(module));
4553
- } else {
4554
- assertArgFn(module, 'module');
4555
- }
4556
- } catch (e) {
4557
- if (isArray(module)) {
4558
- module = module[module.length - 1];
4559
- }
4560
- if (e.message && e.stack && e.stack.indexOf(e.message) === -1) {
4561
- e = e.message + '\n' + e.stack;
4562
- }
4563
- throw $injectorMinErr('modulerr', 'Failed to instantiate module {0} due to:\n{1}',
4564
- module, e.stack || e.message || e);
4565
- }
4566
- });
4567
- return runBlocks;
4568
- }
4569
-
4570
-
4571
- function createInternalInjector(cache, factory) {
4572
-
4573
- function getService(serviceName, caller) {
4574
- if (cache.hasOwnProperty(serviceName)) {
4575
- if (cache[serviceName] === INSTANTIATING) {
4576
- throw $injectorMinErr('cdep', 'Circular dependency found: {0}',
4577
- serviceName + ' <- ' + path.join(' <- '));
4578
- }
4579
- return cache[serviceName];
4580
- } else {
4581
- try {
4582
- path.unshift(serviceName);
4583
- cache[serviceName] = INSTANTIATING;
4584
- cache[serviceName] = factory(serviceName, caller);
4585
- return cache[serviceName];
4586
- } catch (err) {
4587
- if (cache[serviceName] === INSTANTIATING) {
4588
- delete cache[serviceName];
4589
- }
4590
- throw err;
4591
- } finally {
4592
- path.shift();
4593
- }
4594
- }
4595
- }
4596
-
4597
-
4598
- function injectionArgs(fn, locals, serviceName) {
4599
- var args = [],
4600
- $inject = createInjector.$$annotate(fn, strictDi, serviceName);
4601
-
4602
- for (var i = 0, length = $inject.length; i < length; i++) {
4603
- var key = $inject[i];
4604
- if (typeof key !== 'string') {
4605
- throw $injectorMinErr('itkn',
4606
- 'Incorrect injection token! Expected service name as string, got {0}', key);
4607
- }
4608
- args.push(locals && locals.hasOwnProperty(key) ? locals[key] :
4609
- getService(key, serviceName));
4610
- }
4611
- return args;
4612
- }
4613
-
4614
- function isClass(func) {
4615
- if (msie || typeof func !== 'function') {
4616
- return false;
4617
- }
4618
- var result = func.$$ngIsClass;
4619
- if (!isBoolean(result)) {
4620
- result = func.$$ngIsClass = /^(?:class\b|constructor\()/.test(stringifyFn(func));
4621
- }
4622
- return result;
4623
- }
4624
-
4625
- function invoke(fn, self, locals, serviceName) {
4626
- if (typeof locals === 'string') {
4627
- serviceName = locals;
4628
- locals = null;
4629
- }
4630
-
4631
- var args = injectionArgs(fn, locals, serviceName);
4632
- if (isArray(fn)) {
4633
- fn = fn[fn.length - 1];
4634
- }
4635
-
4636
- if (!isClass(fn)) {
4637
- return fn.apply(self, args);
4638
- } else {
4639
- args.unshift(null);
4640
- return new (Function.prototype.bind.apply(fn, args))();
4641
- }
4642
- }
4643
-
4644
-
4645
- function instantiate(Type, locals, serviceName) {
4646
- var ctor = (isArray(Type) ? Type[Type.length - 1] : Type);
4647
- var args = injectionArgs(Type, locals, serviceName);
4648
- args.unshift(null);
4649
- return new (Function.prototype.bind.apply(ctor, args))();
4650
- }
4651
-
4652
-
4653
- return {
4654
- invoke: invoke,
4655
- instantiate: instantiate,
4656
- get: getService,
4657
- annotate: createInjector.$$annotate,
4658
- has: function(name) {
4659
- return providerCache.hasOwnProperty(name + providerSuffix) || cache.hasOwnProperty(name);
4660
- }
4661
- };
4662
- }
4663
- }
4664
-
4665
- createInjector.$$annotate = annotate;
4666
-
4667
- function $AnchorScrollProvider() {
4668
-
4669
- var autoScrollingEnabled = true;
4670
-
4671
- this.disableAutoScrolling = function() {
4672
- autoScrollingEnabled = false;
4673
- };
4674
-
4675
- this.$get = ['$window', '$location', '$rootScope', function($window, $location, $rootScope) {
4676
- var document = $window.document;
4677
-
4678
- function getFirstAnchor(list) {
4679
- var result = null;
4680
- Array.prototype.some.call(list, function(element) {
4681
- if (nodeName_(element) === 'a') {
4682
- result = element;
4683
- return true;
4684
- }
4685
- });
4686
- return result;
4687
- }
4688
-
4689
- function getYOffset() {
4690
-
4691
- var offset = scroll.yOffset;
4692
-
4693
- if (isFunction(offset)) {
4694
- offset = offset();
4695
- } else if (isElement(offset)) {
4696
- var elem = offset[0];
4697
- var style = $window.getComputedStyle(elem);
4698
- if (style.position !== 'fixed') {
4699
- offset = 0;
4700
- } else {
4701
- offset = elem.getBoundingClientRect().bottom;
4702
- }
4703
- } else if (!isNumber(offset)) {
4704
- offset = 0;
4705
- }
4706
-
4707
- return offset;
4708
- }
4709
-
4710
- function scrollTo(elem) {
4711
- if (elem) {
4712
- elem.scrollIntoView();
4713
-
4714
- var offset = getYOffset();
4715
-
4716
- if (offset) {
4717
- var elemTop = elem.getBoundingClientRect().top;
4718
- $window.scrollBy(0, elemTop - offset);
4719
- }
4720
- } else {
4721
- $window.scrollTo(0, 0);
4722
- }
4723
- }
4724
-
4725
- function scroll(hash) {
4726
- hash = isString(hash) ? hash : isNumber(hash) ? hash.toString() : $location.hash();
4727
- var elm;
4728
-
4729
- if (!hash) scrollTo(null);
4730
-
4731
- else if ((elm = document.getElementById(hash))) scrollTo(elm);
4732
-
4733
- else if ((elm = getFirstAnchor(document.getElementsByName(hash)))) scrollTo(elm);
4734
-
4735
- else if (hash === 'top') scrollTo(null);
4736
- }
4737
-
4738
- if (autoScrollingEnabled) {
4739
- $rootScope.$watch(function autoScrollWatch() {return $location.hash();},
4740
- function autoScrollWatchAction(newVal, oldVal) {
4741
- if (newVal === oldVal && newVal === '') return;
4742
-
4743
- jqLiteDocumentLoaded(function() {
4744
- $rootScope.$evalAsync(scroll);
4745
- });
4746
- });
4747
- }
4748
-
4749
- return scroll;
4750
- }];
4751
- }
4752
-
4753
- var $animateMinErr = minErr('$animate');
4754
- var ELEMENT_NODE = 1;
4755
- var NG_ANIMATE_CLASSNAME = 'ng-animate';
4756
-
4757
- function mergeClasses(a,b) {
4758
- if (!a && !b) return '';
4759
- if (!a) return b;
4760
- if (!b) return a;
4761
- if (isArray(a)) a = a.join(' ');
4762
- if (isArray(b)) b = b.join(' ');
4763
- return a + ' ' + b;
4764
- }
4765
-
4766
- function extractElementNode(element) {
4767
- for (var i = 0; i < element.length; i++) {
4768
- var elm = element[i];
4769
- if (elm.nodeType === ELEMENT_NODE) {
4770
- return elm;
4771
- }
4772
- }
4773
- }
4774
-
4775
- function splitClasses(classes) {
4776
- if (isString(classes)) {
4777
- classes = classes.split(' ');
4778
- }
4779
-
4780
- var obj = createMap();
4781
- forEach(classes, function(klass) {
4782
- if (klass.length) {
4783
- obj[klass] = true;
4784
- }
4785
- });
4786
- return obj;
4787
- }
4788
-
4789
- function prepareAnimateOptions(options) {
4790
- return isObject(options)
4791
- ? options
4792
- : {};
4793
- }
4794
-
4795
- var $$CoreAnimateJsProvider = function() {
4796
- this.$get = noop;
4797
- };
4798
-
4799
- var $$CoreAnimateQueueProvider = function() {
4800
- var postDigestQueue = new HashMap();
4801
- var postDigestElements = [];
4802
-
4803
- this.$get = ['$$AnimateRunner', '$rootScope',
4804
- function($$AnimateRunner, $rootScope) {
4805
- return {
4806
- enabled: noop,
4807
- on: noop,
4808
- off: noop,
4809
- pin: noop,
4810
-
4811
- push: function(element, event, options, domOperation) {
4812
- if (domOperation) {
4813
- domOperation();
4814
- }
4815
-
4816
- options = options || {};
4817
- if (options.from) {
4818
- element.css(options.from);
4819
- }
4820
- if (options.to) {
4821
- element.css(options.to);
4822
- }
4823
-
4824
- if (options.addClass || options.removeClass) {
4825
- addRemoveClassesPostDigest(element, options.addClass, options.removeClass);
4826
- }
4827
-
4828
- var runner = new $$AnimateRunner();
4829
-
4830
- runner.complete();
4831
- return runner;
4832
- }
4833
- };
4834
-
4835
-
4836
- function updateData(data, classes, value) {
4837
- var changed = false;
4838
- if (classes) {
4839
- classes = isString(classes) ? classes.split(' ') :
4840
- isArray(classes) ? classes : [];
4841
- forEach(classes, function(className) {
4842
- if (className) {
4843
- changed = true;
4844
- data[className] = value;
4845
- }
4846
- });
4847
- }
4848
- return changed;
4849
- }
4850
-
4851
- function handleCSSClassChanges() {
4852
- forEach(postDigestElements, function(element) {
4853
- var data = postDigestQueue.get(element);
4854
- if (data) {
4855
- var existing = splitClasses(element.attr('class'));
4856
- var toAdd = '';
4857
- var toRemove = '';
4858
- forEach(data, function(status, className) {
4859
- var hasClass = !!existing[className];
4860
- if (status !== hasClass) {
4861
- if (status) {
4862
- toAdd += (toAdd.length ? ' ' : '') + className;
4863
- } else {
4864
- toRemove += (toRemove.length ? ' ' : '') + className;
4865
- }
4866
- }
4867
- });
4868
-
4869
- forEach(element, function(elm) {
4870
- if (toAdd) {
4871
- jqLiteAddClass(elm, toAdd);
4872
- }
4873
- if (toRemove) {
4874
- jqLiteRemoveClass(elm, toRemove);
4875
- }
4876
- });
4877
- postDigestQueue.remove(element);
4878
- }
4879
- });
4880
- postDigestElements.length = 0;
4881
- }
4882
-
4883
-
4884
- function addRemoveClassesPostDigest(element, add, remove) {
4885
- var data = postDigestQueue.get(element) || {};
4886
-
4887
- var classesAdded = updateData(data, add, true);
4888
- var classesRemoved = updateData(data, remove, false);
4889
-
4890
- if (classesAdded || classesRemoved) {
4891
-
4892
- postDigestQueue.put(element, data);
4893
- postDigestElements.push(element);
4894
-
4895
- if (postDigestElements.length === 1) {
4896
- $rootScope.$$postDigest(handleCSSClassChanges);
4897
- }
4898
- }
4899
- }
4900
- }];
4901
- };
4902
-
4903
- var $AnimateProvider = ['$provide', function($provide) {
4904
- var provider = this;
4905
-
4906
- this.$$registeredAnimations = Object.create(null);
4907
-
4908
- this.register = function(name, factory) {
4909
- if (name && name.charAt(0) !== '.') {
4910
- throw $animateMinErr('notcsel', 'Expecting class selector starting with \'.\' got \'{0}\'.', name);
4911
- }
4912
-
4913
- var key = name + '-animation';
4914
- provider.$$registeredAnimations[name.substr(1)] = key;
4915
- $provide.factory(key, factory);
4916
- };
4917
-
4918
- this.classNameFilter = function(expression) {
4919
- if (arguments.length === 1) {
4920
- this.$$classNameFilter = (expression instanceof RegExp) ? expression : null;
4921
- if (this.$$classNameFilter) {
4922
- var reservedRegex = new RegExp('(\\s+|\\/)' + NG_ANIMATE_CLASSNAME + '(\\s+|\\/)');
4923
- if (reservedRegex.test(this.$$classNameFilter.toString())) {
4924
- throw $animateMinErr('nongcls','$animateProvider.classNameFilter(regex) prohibits accepting a regex value which matches/contains the "{0}" CSS class.', NG_ANIMATE_CLASSNAME);
4925
- }
4926
- }
4927
- }
4928
- return this.$$classNameFilter;
4929
- };
4930
-
4931
- this.$get = ['$$animateQueue', function($$animateQueue) {
4932
- function domInsert(element, parentElement, afterElement) {
4933
- if (afterElement) {
4934
- var afterNode = extractElementNode(afterElement);
4935
- if (afterNode && !afterNode.parentNode && !afterNode.previousElementSibling) {
4936
- afterElement = null;
4937
- }
4938
- }
4939
- if (afterElement) {
4940
- afterElement.after(element);
4941
- } else {
4942
- parentElement.prepend(element);
4943
- }
4944
- }
4945
-
4946
- return {
4947
-
4948
- on: $$animateQueue.on,
4949
-
4950
- off: $$animateQueue.off,
4951
-
4952
- pin: $$animateQueue.pin,
4953
-
4954
- enabled: $$animateQueue.enabled,
4955
-
4956
- cancel: function(runner) {
4957
- if (runner.end) {
4958
- runner.end();
4959
- }
4960
- },
4961
-
4962
- enter: function(element, parent, after, options) {
4963
- parent = parent && jqLite(parent);
4964
- after = after && jqLite(after);
4965
- parent = parent || after.parent();
4966
- domInsert(element, parent, after);
4967
- return $$animateQueue.push(element, 'enter', prepareAnimateOptions(options));
4968
- },
4969
-
4970
- move: function(element, parent, after, options) {
4971
- parent = parent && jqLite(parent);
4972
- after = after && jqLite(after);
4973
- parent = parent || after.parent();
4974
- domInsert(element, parent, after);
4975
- return $$animateQueue.push(element, 'move', prepareAnimateOptions(options));
4976
- },
4977
-
4978
- leave: function(element, options) {
4979
- return $$animateQueue.push(element, 'leave', prepareAnimateOptions(options), function() {
4980
- element.remove();
4981
- });
4982
- },
4983
-
4984
- addClass: function(element, className, options) {
4985
- options = prepareAnimateOptions(options);
4986
- options.addClass = mergeClasses(options.addclass, className);
4987
- return $$animateQueue.push(element, 'addClass', options);
4988
- },
4989
-
4990
- removeClass: function(element, className, options) {
4991
- options = prepareAnimateOptions(options);
4992
- options.removeClass = mergeClasses(options.removeClass, className);
4993
- return $$animateQueue.push(element, 'removeClass', options);
4994
- },
4995
-
4996
- setClass: function(element, add, remove, options) {
4997
- options = prepareAnimateOptions(options);
4998
- options.addClass = mergeClasses(options.addClass, add);
4999
- options.removeClass = mergeClasses(options.removeClass, remove);
5000
- return $$animateQueue.push(element, 'setClass', options);
5001
- },
5002
-
5003
- animate: function(element, from, to, className, options) {
5004
- options = prepareAnimateOptions(options);
5005
- options.from = options.from ? extend(options.from, from) : from;
5006
- options.to = options.to ? extend(options.to, to) : to;
5007
-
5008
- className = className || 'ng-inline-animate';
5009
- options.tempClasses = mergeClasses(options.tempClasses, className);
5010
- return $$animateQueue.push(element, 'animate', options);
5011
- }
5012
- };
5013
- }];
5014
- }];
5015
-
5016
- var $$AnimateAsyncRunFactoryProvider = function() {
5017
- this.$get = ['$$rAF', function($$rAF) {
5018
- var waitQueue = [];
5019
-
5020
- function waitForTick(fn) {
5021
- waitQueue.push(fn);
5022
- if (waitQueue.length > 1) return;
5023
- $$rAF(function() {
5024
- for (var i = 0; i < waitQueue.length; i++) {
5025
- waitQueue[i]();
5026
- }
5027
- waitQueue = [];
5028
- });
5029
- }
5030
-
5031
- return function() {
5032
- var passed = false;
5033
- waitForTick(function() {
5034
- passed = true;
5035
- });
5036
- return function(callback) {
5037
- if (passed) {
5038
- callback();
5039
- } else {
5040
- waitForTick(callback);
5041
- }
5042
- };
5043
- };
5044
- }];
5045
- };
5046
-
5047
- var $$AnimateRunnerFactoryProvider = function() {
5048
- this.$get = ['$q', '$sniffer', '$$animateAsyncRun', '$$isDocumentHidden', '$timeout',
5049
- function($q, $sniffer, $$animateAsyncRun, $$isDocumentHidden, $timeout) {
5050
-
5051
- var INITIAL_STATE = 0;
5052
- var DONE_PENDING_STATE = 1;
5053
- var DONE_COMPLETE_STATE = 2;
5054
-
5055
- AnimateRunner.chain = function(chain, callback) {
5056
- var index = 0;
5057
-
5058
- next();
5059
- function next() {
5060
- if (index === chain.length) {
5061
- callback(true);
5062
- return;
5063
- }
5064
-
5065
- chain[index](function(response) {
5066
- if (response === false) {
5067
- callback(false);
5068
- return;
5069
- }
5070
- index++;
5071
- next();
5072
- });
5073
- }
5074
- };
5075
-
5076
- AnimateRunner.all = function(runners, callback) {
5077
- var count = 0;
5078
- var status = true;
5079
- forEach(runners, function(runner) {
5080
- runner.done(onProgress);
5081
- });
5082
-
5083
- function onProgress(response) {
5084
- status = status && response;
5085
- if (++count === runners.length) {
5086
- callback(status);
5087
- }
5088
- }
5089
- };
5090
-
5091
- function AnimateRunner(host) {
5092
- this.setHost(host);
5093
-
5094
- var rafTick = $$animateAsyncRun();
5095
- var timeoutTick = function(fn) {
5096
- $timeout(fn, 0, false);
5097
- };
5098
-
5099
- this._doneCallbacks = [];
5100
- this._tick = function(fn) {
5101
- if ($$isDocumentHidden()) {
5102
- timeoutTick(fn);
5103
- } else {
5104
- rafTick(fn);
5105
- }
5106
- };
5107
- this._state = 0;
5108
- }
5109
-
5110
- AnimateRunner.prototype = {
5111
- setHost: function(host) {
5112
- this.host = host || {};
5113
- },
5114
-
5115
- done: function(fn) {
5116
- if (this._state === DONE_COMPLETE_STATE) {
5117
- fn();
5118
- } else {
5119
- this._doneCallbacks.push(fn);
5120
- }
5121
- },
5122
-
5123
- progress: noop,
5124
-
5125
- getPromise: function() {
5126
- if (!this.promise) {
5127
- var self = this;
5128
- this.promise = $q(function(resolve, reject) {
5129
- self.done(function(status) {
5130
- if (status === false) {
5131
- reject();
5132
- } else {
5133
- resolve();
5134
- }
5135
- });
5136
- });
5137
- }
5138
- return this.promise;
5139
- },
5140
-
5141
- then: function(resolveHandler, rejectHandler) {
5142
- return this.getPromise().then(resolveHandler, rejectHandler);
5143
- },
5144
-
5145
- 'catch': function(handler) {
5146
- return this.getPromise()['catch'](handler);
5147
- },
5148
-
5149
- 'finally': function(handler) {
5150
- return this.getPromise()['finally'](handler);
5151
- },
5152
-
5153
- pause: function() {
5154
- if (this.host.pause) {
5155
- this.host.pause();
5156
- }
5157
- },
5158
-
5159
- resume: function() {
5160
- if (this.host.resume) {
5161
- this.host.resume();
5162
- }
5163
- },
5164
-
5165
- end: function() {
5166
- if (this.host.end) {
5167
- this.host.end();
5168
- }
5169
- this._resolve(true);
5170
- },
5171
-
5172
- cancel: function() {
5173
- if (this.host.cancel) {
5174
- this.host.cancel();
5175
- }
5176
- this._resolve(false);
5177
- },
5178
-
5179
- complete: function(response) {
5180
- var self = this;
5181
- if (self._state === INITIAL_STATE) {
5182
- self._state = DONE_PENDING_STATE;
5183
- self._tick(function() {
5184
- self._resolve(response);
5185
- });
5186
- }
5187
- },
5188
-
5189
- _resolve: function(response) {
5190
- if (this._state !== DONE_COMPLETE_STATE) {
5191
- forEach(this._doneCallbacks, function(fn) {
5192
- fn(response);
5193
- });
5194
- this._doneCallbacks.length = 0;
5195
- this._state = DONE_COMPLETE_STATE;
5196
- }
5197
- }
5198
- };
5199
-
5200
- return AnimateRunner;
5201
- }];
5202
- };
5203
-
5204
-
5205
- var $CoreAnimateCssProvider = function() {
5206
- this.$get = ['$$rAF', '$q', '$$AnimateRunner', function($$rAF, $q, $$AnimateRunner) {
5207
-
5208
- return function(element, initialOptions) {
5209
- var options = initialOptions || {};
5210
- if (!options.$$prepared) {
5211
- options = copy(options);
5212
- }
5213
-
5214
- if (options.cleanupStyles) {
5215
- options.from = options.to = null;
5216
- }
5217
-
5218
- if (options.from) {
5219
- element.css(options.from);
5220
- options.from = null;
5221
- }
5222
-
5223
- var closed, runner = new $$AnimateRunner();
5224
- return {
5225
- start: run,
5226
- end: run
5227
- };
5228
-
5229
- function run() {
5230
- $$rAF(function() {
5231
- applyAnimationContents();
5232
- if (!closed) {
5233
- runner.complete();
5234
- }
5235
- closed = true;
5236
- });
5237
- return runner;
5238
- }
5239
-
5240
- function applyAnimationContents() {
5241
- if (options.addClass) {
5242
- element.addClass(options.addClass);
5243
- options.addClass = null;
5244
- }
5245
- if (options.removeClass) {
5246
- element.removeClass(options.removeClass);
5247
- options.removeClass = null;
5248
- }
5249
- if (options.to) {
5250
- element.css(options.to);
5251
- options.to = null;
5252
- }
5253
- }
5254
- };
5255
- }];
5256
- };
5257
-
5258
-
5259
- function Browser(window, document, $log, $sniffer) {
5260
- var self = this,
5261
- location = window.location,
5262
- history = window.history,
5263
- setTimeout = window.setTimeout,
5264
- clearTimeout = window.clearTimeout,
5265
- pendingDeferIds = {};
5266
-
5267
- self.isMock = false;
5268
-
5269
- var outstandingRequestCount = 0;
5270
- var outstandingRequestCallbacks = [];
5271
-
5272
- self.$$completeOutstandingRequest = completeOutstandingRequest;
5273
- self.$$incOutstandingRequestCount = function() { outstandingRequestCount++; };
5274
-
5275
- function completeOutstandingRequest(fn) {
5276
- try {
5277
- fn.apply(null, sliceArgs(arguments, 1));
5278
- } finally {
5279
- outstandingRequestCount--;
5280
- if (outstandingRequestCount === 0) {
5281
- while (outstandingRequestCallbacks.length) {
5282
- try {
5283
- outstandingRequestCallbacks.pop()();
5284
- } catch (e) {
5285
- $log.error(e);
5286
- }
5287
- }
5288
- }
5289
- }
5290
- }
5291
-
5292
- function getHash(url) {
5293
- var index = url.indexOf('#');
5294
- return index === -1 ? '' : url.substr(index);
5295
- }
5296
-
5297
- self.notifyWhenNoOutstandingRequests = function(callback) {
5298
- if (outstandingRequestCount === 0) {
5299
- callback();
5300
- } else {
5301
- outstandingRequestCallbacks.push(callback);
5302
- }
5303
- };
5304
-
5305
-
5306
- var cachedState, lastHistoryState,
5307
- lastBrowserUrl = location.href,
5308
- baseElement = document.find('base'),
5309
- pendingLocation = null,
5310
- getCurrentState = !$sniffer.history ? noop : function getCurrentState() {
5311
- try {
5312
- return history.state;
5313
- } catch (e) {
5314
- }
5315
- };
5316
-
5317
- cacheState();
5318
- lastHistoryState = cachedState;
5319
-
5320
- self.url = function(url, replace, state) {
5321
- if (isUndefined(state)) {
5322
- state = null;
5323
- }
5324
-
5325
- if (location !== window.location) location = window.location;
5326
- if (history !== window.history) history = window.history;
5327
-
5328
- if (url) {
5329
- var sameState = lastHistoryState === state;
5330
-
5331
- if (lastBrowserUrl === url && (!$sniffer.history || sameState)) {
5332
- return self;
5333
- }
5334
- var sameBase = lastBrowserUrl && stripHash(lastBrowserUrl) === stripHash(url);
5335
- lastBrowserUrl = url;
5336
- lastHistoryState = state;
5337
- if ($sniffer.history && (!sameBase || !sameState)) {
5338
- history[replace ? 'replaceState' : 'pushState'](state, '', url);
5339
- cacheState();
5340
- lastHistoryState = cachedState;
5341
- } else {
5342
- if (!sameBase) {
5343
- pendingLocation = url;
5344
- }
5345
- if (replace) {
5346
- location.replace(url);
5347
- } else if (!sameBase) {
5348
- location.href = url;
5349
- } else {
5350
- location.hash = getHash(url);
5351
- }
5352
- if (location.href !== url) {
5353
- pendingLocation = url;
5354
- }
5355
- }
5356
- if (pendingLocation) {
5357
- pendingLocation = url;
5358
- }
5359
- return self;
5360
- } else {
5361
- return pendingLocation || location.href.replace(/%27/g,'\'');
5362
- }
5363
- };
5364
-
5365
- self.state = function() {
5366
- return cachedState;
5367
- };
5368
-
5369
- var urlChangeListeners = [],
5370
- urlChangeInit = false;
5371
-
5372
- function cacheStateAndFireUrlChange() {
5373
- pendingLocation = null;
5374
- cacheState();
5375
- fireUrlChange();
5376
- }
5377
-
5378
- var lastCachedState = null;
5379
- function cacheState() {
5380
- cachedState = getCurrentState();
5381
- cachedState = isUndefined(cachedState) ? null : cachedState;
5382
-
5383
- if (equals(cachedState, lastCachedState)) {
5384
- cachedState = lastCachedState;
5385
- }
5386
- lastCachedState = cachedState;
5387
- }
5388
-
5389
- function fireUrlChange() {
5390
- if (lastBrowserUrl === self.url() && lastHistoryState === cachedState) {
5391
- return;
5392
- }
5393
-
5394
- lastBrowserUrl = self.url();
5395
- lastHistoryState = cachedState;
5396
- forEach(urlChangeListeners, function(listener) {
5397
- listener(self.url(), cachedState);
5398
- });
5399
- }
5400
-
5401
- self.onUrlChange = function(callback) {
5402
- if (!urlChangeInit) {
5403
-
5404
- if ($sniffer.history) jqLite(window).on('popstate', cacheStateAndFireUrlChange);
5405
- jqLite(window).on('hashchange', cacheStateAndFireUrlChange);
5406
-
5407
- urlChangeInit = true;
5408
- }
5409
-
5410
- urlChangeListeners.push(callback);
5411
- return callback;
5412
- };
5413
-
5414
- self.$$applicationDestroyed = function() {
5415
- jqLite(window).off('hashchange popstate', cacheStateAndFireUrlChange);
5416
- };
5417
-
5418
- self.$$checkUrlChange = fireUrlChange;
5419
-
5420
-
5421
- self.baseHref = function() {
5422
- var href = baseElement.attr('href');
5423
- return href ? href.replace(/^(https?:)?\/\/[^/]*/, '') : '';
5424
- };
5425
-
5426
- self.defer = function(fn, delay) {
5427
- var timeoutId;
5428
- outstandingRequestCount++;
5429
- timeoutId = setTimeout(function() {
5430
- delete pendingDeferIds[timeoutId];
5431
- completeOutstandingRequest(fn);
5432
- }, delay || 0);
5433
- pendingDeferIds[timeoutId] = true;
5434
- return timeoutId;
5435
- };
5436
-
5437
-
5438
- self.defer.cancel = function(deferId) {
5439
- if (pendingDeferIds[deferId]) {
5440
- delete pendingDeferIds[deferId];
5441
- clearTimeout(deferId);
5442
- completeOutstandingRequest(noop);
5443
- return true;
5444
- }
5445
- return false;
5446
- };
5447
-
5448
- }
5449
-
5450
- function $BrowserProvider() {
5451
- this.$get = ['$window', '$log', '$sniffer', '$document',
5452
- function($window, $log, $sniffer, $document) {
5453
- return new Browser($window, $document, $log, $sniffer);
5454
- }];
5455
- }
5456
-
5457
- function $CacheFactoryProvider() {
5458
-
5459
- this.$get = function() {
5460
- var caches = {};
5461
-
5462
- function cacheFactory(cacheId, options) {
5463
- if (cacheId in caches) {
5464
- throw minErr('$cacheFactory')('iid', 'CacheId \'{0}\' is already taken!', cacheId);
5465
- }
5466
-
5467
- var size = 0,
5468
- stats = extend({}, options, {id: cacheId}),
5469
- data = createMap(),
5470
- capacity = (options && options.capacity) || Number.MAX_VALUE,
5471
- lruHash = createMap(),
5472
- freshEnd = null,
5473
- staleEnd = null;
5474
-
5475
- return (caches[cacheId] = {
5476
-
5477
- put: function(key, value) {
5478
- if (isUndefined(value)) return;
5479
- if (capacity < Number.MAX_VALUE) {
5480
- var lruEntry = lruHash[key] || (lruHash[key] = {key: key});
5481
-
5482
- refresh(lruEntry);
5483
- }
5484
-
5485
- if (!(key in data)) size++;
5486
- data[key] = value;
5487
-
5488
- if (size > capacity) {
5489
- this.remove(staleEnd.key);
5490
- }
5491
-
5492
- return value;
5493
- },
5494
-
5495
- get: function(key) {
5496
- if (capacity < Number.MAX_VALUE) {
5497
- var lruEntry = lruHash[key];
5498
-
5499
- if (!lruEntry) return;
5500
-
5501
- refresh(lruEntry);
5502
- }
5503
-
5504
- return data[key];
5505
- },
5506
-
5507
-
5508
- remove: function(key) {
5509
- if (capacity < Number.MAX_VALUE) {
5510
- var lruEntry = lruHash[key];
5511
-
5512
- if (!lruEntry) return;
5513
-
5514
- if (lruEntry === freshEnd) freshEnd = lruEntry.p;
5515
- if (lruEntry === staleEnd) staleEnd = lruEntry.n;
5516
- link(lruEntry.n,lruEntry.p);
5517
-
5518
- delete lruHash[key];
5519
- }
5520
-
5521
- if (!(key in data)) return;
5522
-
5523
- delete data[key];
5524
- size--;
5525
- },
5526
-
5527
-
5528
- removeAll: function() {
5529
- data = createMap();
5530
- size = 0;
5531
- lruHash = createMap();
5532
- freshEnd = staleEnd = null;
5533
- },
5534
-
5535
-
5536
- destroy: function() {
5537
- data = null;
5538
- stats = null;
5539
- lruHash = null;
5540
- delete caches[cacheId];
5541
- },
5542
-
5543
-
5544
- info: function() {
5545
- return extend({}, stats, {size: size});
5546
- }
5547
- });
5548
-
5549
-
5550
- function refresh(entry) {
5551
- if (entry !== freshEnd) {
5552
- if (!staleEnd) {
5553
- staleEnd = entry;
5554
- } else if (staleEnd === entry) {
5555
- staleEnd = entry.n;
5556
- }
5557
-
5558
- link(entry.n, entry.p);
5559
- link(entry, freshEnd);
5560
- freshEnd = entry;
5561
- freshEnd.n = null;
5562
- }
5563
- }
5564
-
5565
-
5566
- function link(nextEntry, prevEntry) {
5567
- if (nextEntry !== prevEntry) {
5568
- if (nextEntry) nextEntry.p = prevEntry;
5569
- if (prevEntry) prevEntry.n = nextEntry;
5570
- }
5571
- }
5572
- }
5573
-
5574
-
5575
- cacheFactory.info = function() {
5576
- var info = {};
5577
- forEach(caches, function(cache, cacheId) {
5578
- info[cacheId] = cache.info();
5579
- });
5580
- return info;
5581
- };
5582
-
5583
-
5584
- cacheFactory.get = function(cacheId) {
5585
- return caches[cacheId];
5586
- };
5587
-
5588
-
5589
- return cacheFactory;
5590
- };
5591
- }
5592
-
5593
- function $TemplateCacheProvider() {
5594
- this.$get = ['$cacheFactory', function($cacheFactory) {
5595
- return $cacheFactory('templates');
5596
- }];
5597
- }
5598
-
5599
-
5600
-
5601
-
5602
-
5603
- var $compileMinErr = minErr('$compile');
5604
-
5605
- function UNINITIALIZED_VALUE() {}
5606
- var _UNINITIALIZED_VALUE = new UNINITIALIZED_VALUE();
5607
-
5608
- $CompileProvider.$inject = ['$provide', '$$sanitizeUriProvider'];
5609
- function $CompileProvider($provide, $$sanitizeUriProvider) {
5610
- var hasDirectives = {},
5611
- Suffix = 'Directive',
5612
- COMMENT_DIRECTIVE_REGEXP = /^\s*directive:\s*([\w-]+)\s+(.*)$/,
5613
- CLASS_DIRECTIVE_REGEXP = /(([\w-]+)(?::([^;]+))?;?)/,
5614
- ALL_OR_NOTHING_ATTRS = makeMap('ngSrc,ngSrcset,src,srcset'),
5615
- REQUIRE_PREFIX_REGEXP = /^(?:(\^\^?)?(\?)?(\^\^?)?)?/;
5616
-
5617
- var EVENT_HANDLER_ATTR_REGEXP = /^(on[a-z]+|formaction)$/;
5618
- var bindingCache = createMap();
5619
-
5620
- function parseIsolateBindings(scope, directiveName, isController) {
5621
- var LOCAL_REGEXP = /^\s*([@&<]|=(\*?))(\??)\s*(\w*)\s*$/;
5622
-
5623
- var bindings = createMap();
5624
-
5625
- forEach(scope, function(definition, scopeName) {
5626
- if (definition in bindingCache) {
5627
- bindings[scopeName] = bindingCache[definition];
5628
- return;
5629
- }
5630
- var match = definition.match(LOCAL_REGEXP);
5631
-
5632
- if (!match) {
5633
- throw $compileMinErr('iscp',
5634
- 'Invalid {3} for directive \'{0}\'.' +
5635
- ' Definition: {... {1}: \'{2}\' ...}',
5636
- directiveName, scopeName, definition,
5637
- (isController ? 'controller bindings definition' :
5638
- 'isolate scope definition'));
5639
- }
5640
-
5641
- bindings[scopeName] = {
5642
- mode: match[1][0],
5643
- collection: match[2] === '*',
5644
- optional: match[3] === '?',
5645
- attrName: match[4] || scopeName
5646
- };
5647
- if (match[4]) {
5648
- bindingCache[definition] = bindings[scopeName];
5649
- }
5650
- });
5651
-
5652
- return bindings;
5653
- }
5654
-
5655
- function parseDirectiveBindings(directive, directiveName) {
5656
- var bindings = {
5657
- isolateScope: null,
5658
- bindToController: null
5659
- };
5660
- if (isObject(directive.scope)) {
5661
- if (directive.bindToController === true) {
5662
- bindings.bindToController = parseIsolateBindings(directive.scope,
5663
- directiveName, true);
5664
- bindings.isolateScope = {};
5665
- } else {
5666
- bindings.isolateScope = parseIsolateBindings(directive.scope,
5667
- directiveName, false);
5668
- }
5669
- }
5670
- if (isObject(directive.bindToController)) {
5671
- bindings.bindToController =
5672
- parseIsolateBindings(directive.bindToController, directiveName, true);
5673
- }
5674
- if (bindings.bindToController && !directive.controller) {
5675
- throw $compileMinErr('noctrl',
5676
- 'Cannot bind to controller without directive \'{0}\'s controller.',
5677
- directiveName);
5678
- }
5679
- return bindings;
5680
- }
5681
-
5682
- function assertValidDirectiveName(name) {
5683
- var letter = name.charAt(0);
5684
- if (!letter || letter !== lowercase(letter)) {
5685
- throw $compileMinErr('baddir', 'Directive/Component name \'{0}\' is invalid. The first character must be a lowercase letter', name);
5686
- }
5687
- if (name !== name.trim()) {
5688
- throw $compileMinErr('baddir',
5689
- 'Directive/Component name \'{0}\' is invalid. The name should not contain leading or trailing whitespaces',
5690
- name);
5691
- }
5692
- }
5693
-
5694
- function getDirectiveRequire(directive) {
5695
- var require = directive.require || (directive.controller && directive.name);
5696
-
5697
- if (!isArray(require) && isObject(require)) {
5698
- forEach(require, function(value, key) {
5699
- var match = value.match(REQUIRE_PREFIX_REGEXP);
5700
- var name = value.substring(match[0].length);
5701
- if (!name) require[key] = match[0] + key;
5702
- });
5703
- }
5704
-
5705
- return require;
5706
- }
5707
-
5708
- function getDirectiveRestrict(restrict, name) {
5709
- if (restrict && !(isString(restrict) && /[EACM]/.test(restrict))) {
5710
- throw $compileMinErr('badrestrict',
5711
- 'Restrict property \'{0}\' of directive \'{1}\' is invalid',
5712
- restrict,
5713
- name);
5714
- }
5715
-
5716
- return restrict || 'EA';
5717
- }
5718
-
5719
- this.directive = function registerDirective(name, directiveFactory) {
5720
- assertArg(name, 'name');
5721
- assertNotHasOwnProperty(name, 'directive');
5722
- if (isString(name)) {
5723
- assertValidDirectiveName(name);
5724
- assertArg(directiveFactory, 'directiveFactory');
5725
- if (!hasDirectives.hasOwnProperty(name)) {
5726
- hasDirectives[name] = [];
5727
- $provide.factory(name + Suffix, ['$injector', '$exceptionHandler',
5728
- function($injector, $exceptionHandler) {
5729
- var directives = [];
5730
- forEach(hasDirectives[name], function(directiveFactory, index) {
5731
- try {
5732
- var directive = $injector.invoke(directiveFactory);
5733
- if (isFunction(directive)) {
5734
- directive = { compile: valueFn(directive) };
5735
- } else if (!directive.compile && directive.link) {
5736
- directive.compile = valueFn(directive.link);
5737
- }
5738
- directive.priority = directive.priority || 0;
5739
- directive.index = index;
5740
- directive.name = directive.name || name;
5741
- directive.require = getDirectiveRequire(directive);
5742
- directive.restrict = getDirectiveRestrict(directive.restrict, name);
5743
- directive.$$moduleName = directiveFactory.$$moduleName;
5744
- directives.push(directive);
5745
- } catch (e) {
5746
- $exceptionHandler(e);
5747
- }
5748
- });
5749
- return directives;
5750
- }]);
5751
- }
5752
- hasDirectives[name].push(directiveFactory);
5753
- } else {
5754
- forEach(name, reverseParams(registerDirective));
5755
- }
5756
- return this;
5757
- };
5758
-
5759
- this.component = function registerComponent(name, options) {
5760
- var controller = options.controller || function() {};
5761
-
5762
- function factory($injector) {
5763
- function makeInjectable(fn) {
5764
- if (isFunction(fn) || isArray(fn)) {
5765
- return function(tElement, tAttrs) {
5766
- return $injector.invoke(fn, this, {$element: tElement, $attrs: tAttrs});
5767
- };
5768
- } else {
5769
- return fn;
5770
- }
5771
- }
5772
-
5773
- var template = (!options.template && !options.templateUrl ? '' : options.template);
5774
- var ddo = {
5775
- controller: controller,
5776
- controllerAs: identifierForController(options.controller) || options.controllerAs || '$ctrl',
5777
- template: makeInjectable(template),
5778
- templateUrl: makeInjectable(options.templateUrl),
5779
- transclude: options.transclude,
5780
- scope: {},
5781
- bindToController: options.bindings || {},
5782
- restrict: 'E',
5783
- require: options.require
5784
- };
5785
-
5786
- forEach(options, function(val, key) {
5787
- if (key.charAt(0) === '$') ddo[key] = val;
5788
- });
5789
-
5790
- return ddo;
5791
- }
5792
-
5793
-
5794
- forEach(options, function(val, key) {
5795
- if (key.charAt(0) === '$') {
5796
- factory[key] = val;
5797
- if (isFunction(controller)) controller[key] = val;
5798
- }
5799
- });
5800
-
5801
- factory.$inject = ['$injector'];
5802
-
5803
- return this.directive(name, factory);
5804
- };
5805
-
5806
-
5807
- this.aHrefSanitizationWhitelist = function(regexp) {
5808
- if (isDefined(regexp)) {
5809
- $$sanitizeUriProvider.aHrefSanitizationWhitelist(regexp);
5810
- return this;
5811
- } else {
5812
- return $$sanitizeUriProvider.aHrefSanitizationWhitelist();
5813
- }
5814
- };
5815
-
5816
-
5817
- this.imgSrcSanitizationWhitelist = function(regexp) {
5818
- if (isDefined(regexp)) {
5819
- $$sanitizeUriProvider.imgSrcSanitizationWhitelist(regexp);
5820
- return this;
5821
- } else {
5822
- return $$sanitizeUriProvider.imgSrcSanitizationWhitelist();
5823
- }
5824
- };
5825
-
5826
- var debugInfoEnabled = true;
5827
- this.debugInfoEnabled = function(enabled) {
5828
- if (isDefined(enabled)) {
5829
- debugInfoEnabled = enabled;
5830
- return this;
5831
- }
5832
- return debugInfoEnabled;
5833
- };
5834
-
5835
- var preAssignBindingsEnabled = false;
5836
- this.preAssignBindingsEnabled = function(enabled) {
5837
- if (isDefined(enabled)) {
5838
- preAssignBindingsEnabled = enabled;
5839
- return this;
5840
- }
5841
- return preAssignBindingsEnabled;
5842
- };
5843
-
5844
-
5845
- var TTL = 10;
5846
- this.onChangesTtl = function(value) {
5847
- if (arguments.length) {
5848
- TTL = value;
5849
- return this;
5850
- }
5851
- return TTL;
5852
- };
5853
-
5854
- var commentDirectivesEnabledConfig = true;
5855
- this.commentDirectivesEnabled = function(value) {
5856
- if (arguments.length) {
5857
- commentDirectivesEnabledConfig = value;
5858
- return this;
5859
- }
5860
- return commentDirectivesEnabledConfig;
5861
- };
5862
-
5863
-
5864
- var cssClassDirectivesEnabledConfig = true;
5865
- this.cssClassDirectivesEnabled = function(value) {
5866
- if (arguments.length) {
5867
- cssClassDirectivesEnabledConfig = value;
5868
- return this;
5869
- }
5870
- return cssClassDirectivesEnabledConfig;
5871
- };
5872
-
5873
- this.$get = [
5874
- '$injector', '$interpolate', '$exceptionHandler', '$templateRequest', '$parse',
5875
- '$controller', '$rootScope', '$sce', '$animate', '$$sanitizeUri',
5876
- function($injector, $interpolate, $exceptionHandler, $templateRequest, $parse,
5877
- $controller, $rootScope, $sce, $animate, $$sanitizeUri) {
5878
-
5879
- var SIMPLE_ATTR_NAME = /^\w/;
5880
- var specialAttrHolder = window.document.createElement('div');
5881
-
5882
-
5883
- var commentDirectivesEnabled = commentDirectivesEnabledConfig;
5884
- var cssClassDirectivesEnabled = cssClassDirectivesEnabledConfig;
5885
-
5886
-
5887
- var onChangesTtl = TTL;
5888
- var onChangesQueue;
5889
-
5890
- function flushOnChangesQueue() {
5891
- try {
5892
- if (!(--onChangesTtl)) {
5893
- onChangesQueue = undefined;
5894
- throw $compileMinErr('infchng', '{0} $onChanges() iterations reached. Aborting!\n', TTL);
5895
- }
5896
- $rootScope.$apply(function() {
5897
- var errors = [];
5898
- for (var i = 0, ii = onChangesQueue.length; i < ii; ++i) {
5899
- try {
5900
- onChangesQueue[i]();
5901
- } catch (e) {
5902
- errors.push(e);
5903
- }
5904
- }
5905
- onChangesQueue = undefined;
5906
- if (errors.length) {
5907
- throw errors;
5908
- }
5909
- });
5910
- } finally {
5911
- onChangesTtl++;
5912
- }
5913
- }
5914
-
5915
-
5916
- function Attributes(element, attributesToCopy) {
5917
- if (attributesToCopy) {
5918
- var keys = Object.keys(attributesToCopy);
5919
- var i, l, key;
5920
-
5921
- for (i = 0, l = keys.length; i < l; i++) {
5922
- key = keys[i];
5923
- this[key] = attributesToCopy[key];
5924
- }
5925
- } else {
5926
- this.$attr = {};
5927
- }
5928
-
5929
- this.$$element = element;
5930
- }
5931
-
5932
- Attributes.prototype = {
5933
- $normalize: directiveNormalize,
5934
-
5935
-
5936
- $addClass: function(classVal) {
5937
- if (classVal && classVal.length > 0) {
5938
- $animate.addClass(this.$$element, classVal);
5939
- }
5940
- },
5941
-
5942
- $removeClass: function(classVal) {
5943
- if (classVal && classVal.length > 0) {
5944
- $animate.removeClass(this.$$element, classVal);
5945
- }
5946
- },
5947
-
5948
- $updateClass: function(newClasses, oldClasses) {
5949
- var toAdd = tokenDifference(newClasses, oldClasses);
5950
- if (toAdd && toAdd.length) {
5951
- $animate.addClass(this.$$element, toAdd);
5952
- }
5953
-
5954
- var toRemove = tokenDifference(oldClasses, newClasses);
5955
- if (toRemove && toRemove.length) {
5956
- $animate.removeClass(this.$$element, toRemove);
5957
- }
5958
- },
5959
-
5960
- $set: function(key, value, writeAttr, attrName) {
5961
-
5962
- var node = this.$$element[0],
5963
- booleanKey = getBooleanAttrName(node, key),
5964
- aliasedKey = getAliasedAttrName(key),
5965
- observer = key,
5966
- nodeName;
5967
-
5968
- if (booleanKey) {
5969
- this.$$element.prop(key, value);
5970
- attrName = booleanKey;
5971
- } else if (aliasedKey) {
5972
- this[aliasedKey] = value;
5973
- observer = aliasedKey;
5974
- }
5975
-
5976
- this[key] = value;
5977
-
5978
- if (attrName) {
5979
- this.$attr[key] = attrName;
5980
- } else {
5981
- attrName = this.$attr[key];
5982
- if (!attrName) {
5983
- this.$attr[key] = attrName = snake_case(key, '-');
5984
- }
5985
- }
5986
-
5987
- nodeName = nodeName_(this.$$element);
5988
-
5989
- if ((nodeName === 'a' && (key === 'href' || key === 'xlinkHref')) ||
5990
- (nodeName === 'img' && key === 'src')) {
5991
- this[key] = value = $$sanitizeUri(value, key === 'src');
5992
- } else if (nodeName === 'img' && key === 'srcset' && isDefined(value)) {
5993
- var result = '';
5994
-
5995
- var trimmedSrcset = trim(value);
5996
- var srcPattern = /(\s+\d+x\s*,|\s+\d+w\s*,|\s+,|,\s+)/;
5997
- var pattern = /\s/.test(trimmedSrcset) ? srcPattern : /(,)/;
5998
-
5999
- var rawUris = trimmedSrcset.split(pattern);
6000
-
6001
- var nbrUrisWith2parts = Math.floor(rawUris.length / 2);
6002
- for (var i = 0; i < nbrUrisWith2parts; i++) {
6003
- var innerIdx = i * 2;
6004
- result += $$sanitizeUri(trim(rawUris[innerIdx]), true);
6005
- result += (' ' + trim(rawUris[innerIdx + 1]));
6006
- }
6007
-
6008
- var lastTuple = trim(rawUris[i * 2]).split(/\s/);
6009
-
6010
- result += $$sanitizeUri(trim(lastTuple[0]), true);
6011
-
6012
- if (lastTuple.length === 2) {
6013
- result += (' ' + trim(lastTuple[1]));
6014
- }
6015
- this[key] = value = result;
6016
- }
6017
-
6018
- if (writeAttr !== false) {
6019
- if (value === null || isUndefined(value)) {
6020
- this.$$element.removeAttr(attrName);
6021
- } else {
6022
- if (SIMPLE_ATTR_NAME.test(attrName)) {
6023
- this.$$element.attr(attrName, value);
6024
- } else {
6025
- setSpecialAttr(this.$$element[0], attrName, value);
6026
- }
6027
- }
6028
- }
6029
-
6030
- var $$observers = this.$$observers;
6031
- if ($$observers) {
6032
- forEach($$observers[observer], function(fn) {
6033
- try {
6034
- fn(value);
6035
- } catch (e) {
6036
- $exceptionHandler(e);
6037
- }
6038
- });
6039
- }
6040
- },
6041
-
6042
-
6043
- $observe: function(key, fn) {
6044
- var attrs = this,
6045
- $$observers = (attrs.$$observers || (attrs.$$observers = createMap())),
6046
- listeners = ($$observers[key] || ($$observers[key] = []));
6047
-
6048
- listeners.push(fn);
6049
- $rootScope.$evalAsync(function() {
6050
- if (!listeners.$$inter && attrs.hasOwnProperty(key) && !isUndefined(attrs[key])) {
6051
- fn(attrs[key]);
6052
- }
6053
- });
6054
-
6055
- return function() {
6056
- arrayRemove(listeners, fn);
6057
- };
6058
- }
6059
- };
6060
-
6061
- function setSpecialAttr(element, attrName, value) {
6062
- specialAttrHolder.innerHTML = '<span ' + attrName + '>';
6063
- var attributes = specialAttrHolder.firstChild.attributes;
6064
- var attribute = attributes[0];
6065
- attributes.removeNamedItem(attribute.name);
6066
- attribute.value = value;
6067
- element.attributes.setNamedItem(attribute);
6068
- }
6069
-
6070
- function safeAddClass($element, className) {
6071
- try {
6072
- $element.addClass(className);
6073
- } catch (e) {
6074
- }
6075
- }
6076
-
6077
-
6078
- var startSymbol = $interpolate.startSymbol(),
6079
- endSymbol = $interpolate.endSymbol(),
6080
- denormalizeTemplate = (startSymbol === '{{' && endSymbol === '}}')
6081
- ? identity
6082
- : function denormalizeTemplate(template) {
6083
- return template.replace(/\{\{/g, startSymbol).replace(/}}/g, endSymbol);
6084
- },
6085
- NG_ATTR_BINDING = /^ngAttr[A-Z]/;
6086
- var MULTI_ELEMENT_DIR_RE = /^(.+)Start$/;
6087
-
6088
- compile.$$addBindingInfo = debugInfoEnabled ? function $$addBindingInfo($element, binding) {
6089
- var bindings = $element.data('$binding') || [];
6090
-
6091
- if (isArray(binding)) {
6092
- bindings = bindings.concat(binding);
6093
- } else {
6094
- bindings.push(binding);
6095
- }
6096
-
6097
- $element.data('$binding', bindings);
6098
- } : noop;
6099
-
6100
- compile.$$addBindingClass = debugInfoEnabled ? function $$addBindingClass($element) {
6101
- safeAddClass($element, 'ng-binding');
6102
- } : noop;
6103
-
6104
- compile.$$addScopeInfo = debugInfoEnabled ? function $$addScopeInfo($element, scope, isolated, noTemplate) {
6105
- var dataName = isolated ? (noTemplate ? '$isolateScopeNoTemplate' : '$isolateScope') : '$scope';
6106
- $element.data(dataName, scope);
6107
- } : noop;
6108
-
6109
- compile.$$addScopeClass = debugInfoEnabled ? function $$addScopeClass($element, isolated) {
6110
- safeAddClass($element, isolated ? 'ng-isolate-scope' : 'ng-scope');
6111
- } : noop;
6112
-
6113
- compile.$$createComment = function(directiveName, comment) {
6114
- var content = '';
6115
- if (debugInfoEnabled) {
6116
- content = ' ' + (directiveName || '') + ': ';
6117
- if (comment) content += comment + ' ';
6118
- }
6119
- return window.document.createComment(content);
6120
- };
6121
-
6122
- return compile;
6123
-
6124
-
6125
- function compile($compileNodes, transcludeFn, maxPriority, ignoreDirective,
6126
- previousCompileContext) {
6127
- if (!($compileNodes instanceof jqLite)) {
6128
- $compileNodes = jqLite($compileNodes);
6129
- }
6130
- var compositeLinkFn =
6131
- compileNodes($compileNodes, transcludeFn, $compileNodes,
6132
- maxPriority, ignoreDirective, previousCompileContext);
6133
- compile.$$addScopeClass($compileNodes);
6134
- var namespace = null;
6135
- return function publicLinkFn(scope, cloneConnectFn, options) {
6136
- if (!$compileNodes) {
6137
- throw $compileMinErr('multilink', 'This element has already been linked.');
6138
- }
6139
- assertArg(scope, 'scope');
6140
-
6141
- if (previousCompileContext && previousCompileContext.needsNewScope) {
6142
- scope = scope.$parent.$new();
6143
- }
6144
-
6145
- options = options || {};
6146
- var parentBoundTranscludeFn = options.parentBoundTranscludeFn,
6147
- transcludeControllers = options.transcludeControllers,
6148
- futureParentElement = options.futureParentElement;
6149
-
6150
- if (parentBoundTranscludeFn && parentBoundTranscludeFn.$$boundTransclude) {
6151
- parentBoundTranscludeFn = parentBoundTranscludeFn.$$boundTransclude;
6152
- }
6153
-
6154
- if (!namespace) {
6155
- namespace = detectNamespaceForChildElements(futureParentElement);
6156
- }
6157
- var $linkNode;
6158
- if (namespace !== 'html') {
6159
- $linkNode = jqLite(
6160
- wrapTemplate(namespace, jqLite('<div>').append($compileNodes).html())
6161
- );
6162
- } else if (cloneConnectFn) {
6163
- $linkNode = JQLitePrototype.clone.call($compileNodes);
6164
- } else {
6165
- $linkNode = $compileNodes;
6166
- }
6167
-
6168
- if (transcludeControllers) {
6169
- for (var controllerName in transcludeControllers) {
6170
- $linkNode.data('$' + controllerName + 'Controller', transcludeControllers[controllerName].instance);
6171
- }
6172
- }
6173
-
6174
- compile.$$addScopeInfo($linkNode, scope);
6175
-
6176
- if (cloneConnectFn) cloneConnectFn($linkNode, scope);
6177
- if (compositeLinkFn) compositeLinkFn(scope, $linkNode, $linkNode, parentBoundTranscludeFn);
6178
-
6179
- if (!cloneConnectFn) {
6180
- $compileNodes = compositeLinkFn = null;
6181
- }
6182
- return $linkNode;
6183
- };
6184
- }
6185
-
6186
- function detectNamespaceForChildElements(parentElement) {
6187
- var node = parentElement && parentElement[0];
6188
- if (!node) {
6189
- return 'html';
6190
- } else {
6191
- return nodeName_(node) !== 'foreignobject' && toString.call(node).match(/SVG/) ? 'svg' : 'html';
6192
- }
6193
- }
6194
-
6195
- function compileNodes(nodeList, transcludeFn, $rootElement, maxPriority, ignoreDirective,
6196
- previousCompileContext) {
6197
- var linkFns = [],
6198
- notLiveList = isArray(nodeList) || (nodeList instanceof jqLite),
6199
- attrs, directives, nodeLinkFn, childNodes, childLinkFn, linkFnFound, nodeLinkFnFound;
6200
-
6201
-
6202
- for (var i = 0; i < nodeList.length; i++) {
6203
- attrs = new Attributes();
6204
-
6205
- if (msie === 11) {
6206
- mergeConsecutiveTextNodes(nodeList, i, notLiveList);
6207
- }
6208
-
6209
- directives = collectDirectives(nodeList[i], [], attrs, i === 0 ? maxPriority : undefined,
6210
- ignoreDirective);
6211
-
6212
- nodeLinkFn = (directives.length)
6213
- ? applyDirectivesToNode(directives, nodeList[i], attrs, transcludeFn, $rootElement,
6214
- null, [], [], previousCompileContext)
6215
- : null;
6216
-
6217
- if (nodeLinkFn && nodeLinkFn.scope) {
6218
- compile.$$addScopeClass(attrs.$$element);
6219
- }
6220
-
6221
- childLinkFn = (nodeLinkFn && nodeLinkFn.terminal ||
6222
- !(childNodes = nodeList[i].childNodes) ||
6223
- !childNodes.length)
6224
- ? null
6225
- : compileNodes(childNodes,
6226
- nodeLinkFn ? (
6227
- (nodeLinkFn.transcludeOnThisElement || !nodeLinkFn.templateOnThisElement)
6228
- && nodeLinkFn.transclude) : transcludeFn);
6229
-
6230
- if (nodeLinkFn || childLinkFn) {
6231
- linkFns.push(i, nodeLinkFn, childLinkFn);
6232
- linkFnFound = true;
6233
- nodeLinkFnFound = nodeLinkFnFound || nodeLinkFn;
6234
- }
6235
-
6236
- previousCompileContext = null;
6237
- }
6238
-
6239
- return linkFnFound ? compositeLinkFn : null;
6240
-
6241
- function compositeLinkFn(scope, nodeList, $rootElement, parentBoundTranscludeFn) {
6242
- var nodeLinkFn, childLinkFn, node, childScope, i, ii, idx, childBoundTranscludeFn;
6243
- var stableNodeList;
6244
-
6245
-
6246
- if (nodeLinkFnFound) {
6247
- var nodeListLength = nodeList.length;
6248
- stableNodeList = new Array(nodeListLength);
6249
-
6250
- for (i = 0; i < linkFns.length; i += 3) {
6251
- idx = linkFns[i];
6252
- stableNodeList[idx] = nodeList[idx];
6253
- }
6254
- } else {
6255
- stableNodeList = nodeList;
6256
- }
6257
-
6258
- for (i = 0, ii = linkFns.length; i < ii;) {
6259
- node = stableNodeList[linkFns[i++]];
6260
- nodeLinkFn = linkFns[i++];
6261
- childLinkFn = linkFns[i++];
6262
-
6263
- if (nodeLinkFn) {
6264
- if (nodeLinkFn.scope) {
6265
- childScope = scope.$new();
6266
- compile.$$addScopeInfo(jqLite(node), childScope);
6267
- } else {
6268
- childScope = scope;
6269
- }
6270
-
6271
- if (nodeLinkFn.transcludeOnThisElement) {
6272
- childBoundTranscludeFn = createBoundTranscludeFn(
6273
- scope, nodeLinkFn.transclude, parentBoundTranscludeFn);
6274
-
6275
- } else if (!nodeLinkFn.templateOnThisElement && parentBoundTranscludeFn) {
6276
- childBoundTranscludeFn = parentBoundTranscludeFn;
6277
-
6278
- } else if (!parentBoundTranscludeFn && transcludeFn) {
6279
- childBoundTranscludeFn = createBoundTranscludeFn(scope, transcludeFn);
6280
-
6281
- } else {
6282
- childBoundTranscludeFn = null;
6283
- }
6284
-
6285
- nodeLinkFn(childLinkFn, childScope, node, $rootElement, childBoundTranscludeFn);
6286
-
6287
- } else if (childLinkFn) {
6288
- childLinkFn(scope, node.childNodes, undefined, parentBoundTranscludeFn);
6289
- }
6290
- }
6291
- }
6292
- }
6293
-
6294
- function mergeConsecutiveTextNodes(nodeList, idx, notLiveList) {
6295
- var node = nodeList[idx];
6296
- var parent = node.parentNode;
6297
- var sibling;
6298
-
6299
- if (node.nodeType !== NODE_TYPE_TEXT) {
6300
- return;
6301
- }
6302
-
6303
- while (true) {
6304
- sibling = parent ? node.nextSibling : nodeList[idx + 1];
6305
- if (!sibling || sibling.nodeType !== NODE_TYPE_TEXT) {
6306
- break;
6307
- }
6308
-
6309
- node.nodeValue = node.nodeValue + sibling.nodeValue;
6310
-
6311
- if (sibling.parentNode) {
6312
- sibling.parentNode.removeChild(sibling);
6313
- }
6314
- if (notLiveList && sibling === nodeList[idx + 1]) {
6315
- nodeList.splice(idx + 1, 1);
6316
- }
6317
- }
6318
- }
6319
-
6320
- function createBoundTranscludeFn(scope, transcludeFn, previousBoundTranscludeFn) {
6321
- function boundTranscludeFn(transcludedScope, cloneFn, controllers, futureParentElement, containingScope) {
6322
-
6323
- if (!transcludedScope) {
6324
- transcludedScope = scope.$new(false, containingScope);
6325
- transcludedScope.$$transcluded = true;
6326
- }
6327
-
6328
- return transcludeFn(transcludedScope, cloneFn, {
6329
- parentBoundTranscludeFn: previousBoundTranscludeFn,
6330
- transcludeControllers: controllers,
6331
- futureParentElement: futureParentElement
6332
- });
6333
- }
6334
-
6335
- var boundSlots = boundTranscludeFn.$$slots = createMap();
6336
- for (var slotName in transcludeFn.$$slots) {
6337
- if (transcludeFn.$$slots[slotName]) {
6338
- boundSlots[slotName] = createBoundTranscludeFn(scope, transcludeFn.$$slots[slotName], previousBoundTranscludeFn);
6339
- } else {
6340
- boundSlots[slotName] = null;
6341
- }
6342
- }
6343
-
6344
- return boundTranscludeFn;
6345
- }
6346
-
6347
- function collectDirectives(node, directives, attrs, maxPriority, ignoreDirective) {
6348
- var nodeType = node.nodeType,
6349
- attrsMap = attrs.$attr,
6350
- match,
6351
- nodeName,
6352
- className;
6353
-
6354
- switch (nodeType) {
6355
- case NODE_TYPE_ELEMENT:
6356
-
6357
- nodeName = nodeName_(node);
6358
-
6359
- addDirective(directives,
6360
- directiveNormalize(nodeName), 'E', maxPriority, ignoreDirective);
6361
-
6362
- for (var attr, name, nName, ngAttrName, value, isNgAttr, nAttrs = node.attributes,
6363
- j = 0, jj = nAttrs && nAttrs.length; j < jj; j++) {
6364
- var attrStartName = false;
6365
- var attrEndName = false;
6366
-
6367
- attr = nAttrs[j];
6368
- name = attr.name;
6369
- value = attr.value;
6370
-
6371
- ngAttrName = directiveNormalize(name);
6372
- isNgAttr = NG_ATTR_BINDING.test(ngAttrName);
6373
- if (isNgAttr) {
6374
- name = name.replace(PREFIX_REGEXP, '')
6375
- .substr(8).replace(/_(.)/g, function(match, letter) {
6376
- return letter.toUpperCase();
6377
- });
6378
- }
6379
-
6380
- var multiElementMatch = ngAttrName.match(MULTI_ELEMENT_DIR_RE);
6381
- if (multiElementMatch && directiveIsMultiElement(multiElementMatch[1])) {
6382
- attrStartName = name;
6383
- attrEndName = name.substr(0, name.length - 5) + 'end';
6384
- name = name.substr(0, name.length - 6);
6385
- }
6386
-
6387
- nName = directiveNormalize(name.toLowerCase());
6388
- attrsMap[nName] = name;
6389
- if (isNgAttr || !attrs.hasOwnProperty(nName)) {
6390
- attrs[nName] = value;
6391
- if (getBooleanAttrName(node, nName)) {
6392
- attrs[nName] = true;
6393
- }
6394
- }
6395
- addAttrInterpolateDirective(node, directives, value, nName, isNgAttr);
6396
- addDirective(directives, nName, 'A', maxPriority, ignoreDirective, attrStartName,
6397
- attrEndName);
6398
- }
6399
-
6400
- if (nodeName === 'input' && node.getAttribute('type') === 'hidden') {
6401
- node.setAttribute('autocomplete', 'off');
6402
- }
6403
-
6404
- if (!cssClassDirectivesEnabled) break;
6405
- className = node.className;
6406
- if (isObject(className)) {
6407
- className = className.animVal;
6408
- }
6409
- if (isString(className) && className !== '') {
6410
- while ((match = CLASS_DIRECTIVE_REGEXP.exec(className))) {
6411
- nName = directiveNormalize(match[2]);
6412
- if (addDirective(directives, nName, 'C', maxPriority, ignoreDirective)) {
6413
- attrs[nName] = trim(match[3]);
6414
- }
6415
- className = className.substr(match.index + match[0].length);
6416
- }
6417
- }
6418
- break;
6419
- case NODE_TYPE_TEXT:
6420
- addTextInterpolateDirective(directives, node.nodeValue);
6421
- break;
6422
- case NODE_TYPE_COMMENT:
6423
- if (!commentDirectivesEnabled) break;
6424
- collectCommentDirectives(node, directives, attrs, maxPriority, ignoreDirective);
6425
- break;
6426
- }
6427
-
6428
- directives.sort(byPriority);
6429
- return directives;
6430
- }
6431
-
6432
- function collectCommentDirectives(node, directives, attrs, maxPriority, ignoreDirective) {
6433
- try {
6434
- var match = COMMENT_DIRECTIVE_REGEXP.exec(node.nodeValue);
6435
- if (match) {
6436
- var nName = directiveNormalize(match[1]);
6437
- if (addDirective(directives, nName, 'M', maxPriority, ignoreDirective)) {
6438
- attrs[nName] = trim(match[2]);
6439
- }
6440
- }
6441
- } catch (e) {
6442
- }
6443
- }
6444
-
6445
- function groupScan(node, attrStart, attrEnd) {
6446
- var nodes = [];
6447
- var depth = 0;
6448
- if (attrStart && node.hasAttribute && node.hasAttribute(attrStart)) {
6449
- do {
6450
- if (!node) {
6451
- throw $compileMinErr('uterdir',
6452
- 'Unterminated attribute, found \'{0}\' but no matching \'{1}\' found.',
6453
- attrStart, attrEnd);
6454
- }
6455
- if (node.nodeType === NODE_TYPE_ELEMENT) {
6456
- if (node.hasAttribute(attrStart)) depth++;
6457
- if (node.hasAttribute(attrEnd)) depth--;
6458
- }
6459
- nodes.push(node);
6460
- node = node.nextSibling;
6461
- } while (depth > 0);
6462
- } else {
6463
- nodes.push(node);
6464
- }
6465
-
6466
- return jqLite(nodes);
6467
- }
6468
-
6469
- function groupElementsLinkFnWrapper(linkFn, attrStart, attrEnd) {
6470
- return function groupedElementsLink(scope, element, attrs, controllers, transcludeFn) {
6471
- element = groupScan(element[0], attrStart, attrEnd);
6472
- return linkFn(scope, element, attrs, controllers, transcludeFn);
6473
- };
6474
- }
6475
-
6476
- function compilationGenerator(eager, $compileNodes, transcludeFn, maxPriority, ignoreDirective, previousCompileContext) {
6477
- var compiled;
6478
-
6479
- if (eager) {
6480
- return compile($compileNodes, transcludeFn, maxPriority, ignoreDirective, previousCompileContext);
6481
- }
6482
- return function lazyCompilation() {
6483
- if (!compiled) {
6484
- compiled = compile($compileNodes, transcludeFn, maxPriority, ignoreDirective, previousCompileContext);
6485
-
6486
- $compileNodes = transcludeFn = previousCompileContext = null;
6487
- }
6488
- return compiled.apply(this, arguments);
6489
- };
6490
- }
6491
-
6492
- function applyDirectivesToNode(directives, compileNode, templateAttrs, transcludeFn,
6493
- jqCollection, originalReplaceDirective, preLinkFns, postLinkFns,
6494
- previousCompileContext) {
6495
- previousCompileContext = previousCompileContext || {};
6496
-
6497
- var terminalPriority = -Number.MAX_VALUE,
6498
- newScopeDirective = previousCompileContext.newScopeDirective,
6499
- controllerDirectives = previousCompileContext.controllerDirectives,
6500
- newIsolateScopeDirective = previousCompileContext.newIsolateScopeDirective,
6501
- templateDirective = previousCompileContext.templateDirective,
6502
- nonTlbTranscludeDirective = previousCompileContext.nonTlbTranscludeDirective,
6503
- hasTranscludeDirective = false,
6504
- hasTemplate = false,
6505
- hasElementTranscludeDirective = previousCompileContext.hasElementTranscludeDirective,
6506
- $compileNode = templateAttrs.$$element = jqLite(compileNode),
6507
- directive,
6508
- directiveName,
6509
- $template,
6510
- replaceDirective = originalReplaceDirective,
6511
- childTranscludeFn = transcludeFn,
6512
- linkFn,
6513
- didScanForMultipleTransclusion = false,
6514
- mightHaveMultipleTransclusionError = false,
6515
- directiveValue;
6516
-
6517
- for (var i = 0, ii = directives.length; i < ii; i++) {
6518
- directive = directives[i];
6519
- var attrStart = directive.$$start;
6520
- var attrEnd = directive.$$end;
6521
-
6522
- if (attrStart) {
6523
- $compileNode = groupScan(compileNode, attrStart, attrEnd);
6524
- }
6525
- $template = undefined;
6526
-
6527
- if (terminalPriority > directive.priority) {
6528
- break;
6529
- }
6530
-
6531
- directiveValue = directive.scope;
6532
-
6533
- if (directiveValue) {
6534
-
6535
- if (!directive.templateUrl) {
6536
- if (isObject(directiveValue)) {
6537
- assertNoDuplicate('new/isolated scope', newIsolateScopeDirective || newScopeDirective,
6538
- directive, $compileNode);
6539
- newIsolateScopeDirective = directive;
6540
- } else {
6541
- assertNoDuplicate('new/isolated scope', newIsolateScopeDirective, directive,
6542
- $compileNode);
6543
- }
6544
- }
6545
-
6546
- newScopeDirective = newScopeDirective || directive;
6547
- }
6548
-
6549
- directiveName = directive.name;
6550
-
6551
- if (!didScanForMultipleTransclusion && ((directive.replace && (directive.templateUrl || directive.template))
6552
- || (directive.transclude && !directive.$$tlb))) {
6553
- var candidateDirective;
6554
-
6555
- for (var scanningIndex = i + 1; (candidateDirective = directives[scanningIndex++]);) {
6556
- if ((candidateDirective.transclude && !candidateDirective.$$tlb)
6557
- || (candidateDirective.replace && (candidateDirective.templateUrl || candidateDirective.template))) {
6558
- mightHaveMultipleTransclusionError = true;
6559
- break;
6560
- }
6561
- }
6562
-
6563
- didScanForMultipleTransclusion = true;
6564
- }
6565
-
6566
- if (!directive.templateUrl && directive.controller) {
6567
- controllerDirectives = controllerDirectives || createMap();
6568
- assertNoDuplicate('\'' + directiveName + '\' controller',
6569
- controllerDirectives[directiveName], directive, $compileNode);
6570
- controllerDirectives[directiveName] = directive;
6571
- }
6572
-
6573
- directiveValue = directive.transclude;
6574
-
6575
- if (directiveValue) {
6576
- hasTranscludeDirective = true;
6577
-
6578
- if (!directive.$$tlb) {
6579
- assertNoDuplicate('transclusion', nonTlbTranscludeDirective, directive, $compileNode);
6580
- nonTlbTranscludeDirective = directive;
6581
- }
6582
-
6583
- if (directiveValue === 'element') {
6584
- hasElementTranscludeDirective = true;
6585
- terminalPriority = directive.priority;
6586
- $template = $compileNode;
6587
- $compileNode = templateAttrs.$$element =
6588
- jqLite(compile.$$createComment(directiveName, templateAttrs[directiveName]));
6589
- compileNode = $compileNode[0];
6590
- replaceWith(jqCollection, sliceArgs($template), compileNode);
6591
-
6592
-
6593
- $template[0].$$parentNode = $template[0].parentNode;
6594
-
6595
- childTranscludeFn = compilationGenerator(mightHaveMultipleTransclusionError, $template, transcludeFn, terminalPriority,
6596
- replaceDirective && replaceDirective.name, {
6597
- nonTlbTranscludeDirective: nonTlbTranscludeDirective
6598
- });
6599
- } else {
6600
-
6601
- var slots = createMap();
6602
-
6603
- if (!isObject(directiveValue)) {
6604
- $template = jqLite(jqLiteClone(compileNode)).contents();
6605
- } else {
6606
-
6607
- $template = [];
6608
-
6609
- var slotMap = createMap();
6610
- var filledSlots = createMap();
6611
-
6612
- forEach(directiveValue, function(elementSelector, slotName) {
6613
- var optional = (elementSelector.charAt(0) === '?');
6614
- elementSelector = optional ? elementSelector.substring(1) : elementSelector;
6615
-
6616
- slotMap[elementSelector] = slotName;
6617
-
6618
- slots[slotName] = null;
6619
-
6620
- filledSlots[slotName] = optional;
6621
- });
6622
-
6623
- forEach($compileNode.contents(), function(node) {
6624
- var slotName = slotMap[directiveNormalize(nodeName_(node))];
6625
- if (slotName) {
6626
- filledSlots[slotName] = true;
6627
- slots[slotName] = slots[slotName] || [];
6628
- slots[slotName].push(node);
6629
- } else {
6630
- $template.push(node);
6631
- }
6632
- });
6633
-
6634
- forEach(filledSlots, function(filled, slotName) {
6635
- if (!filled) {
6636
- throw $compileMinErr('reqslot', 'Required transclusion slot `{0}` was not filled.', slotName);
6637
- }
6638
- });
6639
-
6640
- for (var slotName in slots) {
6641
- if (slots[slotName]) {
6642
- slots[slotName] = compilationGenerator(mightHaveMultipleTransclusionError, slots[slotName], transcludeFn);
6643
- }
6644
- }
6645
- }
6646
-
6647
- $compileNode.empty();
6648
- childTranscludeFn = compilationGenerator(mightHaveMultipleTransclusionError, $template, transcludeFn, undefined,
6649
- undefined, { needsNewScope: directive.$$isolateScope || directive.$$newScope});
6650
- childTranscludeFn.$$slots = slots;
6651
- }
6652
- }
6653
-
6654
- if (directive.template) {
6655
- hasTemplate = true;
6656
- assertNoDuplicate('template', templateDirective, directive, $compileNode);
6657
- templateDirective = directive;
6658
-
6659
- directiveValue = (isFunction(directive.template))
6660
- ? directive.template($compileNode, templateAttrs)
6661
- : directive.template;
6662
-
6663
- directiveValue = denormalizeTemplate(directiveValue);
6664
-
6665
- if (directive.replace) {
6666
- replaceDirective = directive;
6667
- if (jqLiteIsTextNode(directiveValue)) {
6668
- $template = [];
6669
- } else {
6670
- $template = removeComments(wrapTemplate(directive.templateNamespace, trim(directiveValue)));
6671
- }
6672
- compileNode = $template[0];
6673
-
6674
- if ($template.length !== 1 || compileNode.nodeType !== NODE_TYPE_ELEMENT) {
6675
- throw $compileMinErr('tplrt',
6676
- 'Template for directive \'{0}\' must have exactly one root element. {1}',
6677
- directiveName, '');
6678
- }
6679
-
6680
- replaceWith(jqCollection, $compileNode, compileNode);
6681
-
6682
- var newTemplateAttrs = {$attr: {}};
6683
-
6684
- var templateDirectives = collectDirectives(compileNode, [], newTemplateAttrs);
6685
- var unprocessedDirectives = directives.splice(i + 1, directives.length - (i + 1));
6686
-
6687
- if (newIsolateScopeDirective || newScopeDirective) {
6688
- markDirectiveScope(templateDirectives, newIsolateScopeDirective, newScopeDirective);
6689
- }
6690
- directives = directives.concat(templateDirectives).concat(unprocessedDirectives);
6691
- mergeTemplateAttributes(templateAttrs, newTemplateAttrs);
6692
-
6693
- ii = directives.length;
6694
- } else {
6695
- $compileNode.html(directiveValue);
6696
- }
6697
- }
6698
-
6699
- if (directive.templateUrl) {
6700
- hasTemplate = true;
6701
- assertNoDuplicate('template', templateDirective, directive, $compileNode);
6702
- templateDirective = directive;
6703
-
6704
- if (directive.replace) {
6705
- replaceDirective = directive;
6706
- }
6707
-
6708
- nodeLinkFn = compileTemplateUrl(directives.splice(i, directives.length - i), $compileNode,
6709
- templateAttrs, jqCollection, hasTranscludeDirective && childTranscludeFn, preLinkFns, postLinkFns, {
6710
- controllerDirectives: controllerDirectives,
6711
- newScopeDirective: (newScopeDirective !== directive) && newScopeDirective,
6712
- newIsolateScopeDirective: newIsolateScopeDirective,
6713
- templateDirective: templateDirective,
6714
- nonTlbTranscludeDirective: nonTlbTranscludeDirective
6715
- });
6716
- ii = directives.length;
6717
- } else if (directive.compile) {
6718
- try {
6719
- linkFn = directive.compile($compileNode, templateAttrs, childTranscludeFn);
6720
- var context = directive.$$originalDirective || directive;
6721
- if (isFunction(linkFn)) {
6722
- addLinkFns(null, bind(context, linkFn), attrStart, attrEnd);
6723
- } else if (linkFn) {
6724
- addLinkFns(bind(context, linkFn.pre), bind(context, linkFn.post), attrStart, attrEnd);
6725
- }
6726
- } catch (e) {
6727
- $exceptionHandler(e, startingTag($compileNode));
6728
- }
6729
- }
6730
-
6731
- if (directive.terminal) {
6732
- nodeLinkFn.terminal = true;
6733
- terminalPriority = Math.max(terminalPriority, directive.priority);
6734
- }
6735
-
6736
- }
6737
-
6738
- nodeLinkFn.scope = newScopeDirective && newScopeDirective.scope === true;
6739
- nodeLinkFn.transcludeOnThisElement = hasTranscludeDirective;
6740
- nodeLinkFn.templateOnThisElement = hasTemplate;
6741
- nodeLinkFn.transclude = childTranscludeFn;
6742
-
6743
- previousCompileContext.hasElementTranscludeDirective = hasElementTranscludeDirective;
6744
-
6745
- return nodeLinkFn;
6746
-
6747
-
6748
- function addLinkFns(pre, post, attrStart, attrEnd) {
6749
- if (pre) {
6750
- if (attrStart) pre = groupElementsLinkFnWrapper(pre, attrStart, attrEnd);
6751
- pre.require = directive.require;
6752
- pre.directiveName = directiveName;
6753
- if (newIsolateScopeDirective === directive || directive.$$isolateScope) {
6754
- pre = cloneAndAnnotateFn(pre, {isolateScope: true});
6755
- }
6756
- preLinkFns.push(pre);
6757
- }
6758
- if (post) {
6759
- if (attrStart) post = groupElementsLinkFnWrapper(post, attrStart, attrEnd);
6760
- post.require = directive.require;
6761
- post.directiveName = directiveName;
6762
- if (newIsolateScopeDirective === directive || directive.$$isolateScope) {
6763
- post = cloneAndAnnotateFn(post, {isolateScope: true});
6764
- }
6765
- postLinkFns.push(post);
6766
- }
6767
- }
6768
-
6769
- function nodeLinkFn(childLinkFn, scope, linkNode, $rootElement, boundTranscludeFn) {
6770
- var i, ii, linkFn, isolateScope, controllerScope, elementControllers, transcludeFn, $element,
6771
- attrs, scopeBindingInfo;
6772
-
6773
- if (compileNode === linkNode) {
6774
- attrs = templateAttrs;
6775
- $element = templateAttrs.$$element;
6776
- } else {
6777
- $element = jqLite(linkNode);
6778
- attrs = new Attributes($element, templateAttrs);
6779
- }
6780
-
6781
- controllerScope = scope;
6782
- if (newIsolateScopeDirective) {
6783
- isolateScope = scope.$new(true);
6784
- } else if (newScopeDirective) {
6785
- controllerScope = scope.$parent;
6786
- }
6787
-
6788
- if (boundTranscludeFn) {
6789
- transcludeFn = controllersBoundTransclude;
6790
- transcludeFn.$$boundTransclude = boundTranscludeFn;
6791
- transcludeFn.isSlotFilled = function(slotName) {
6792
- return !!boundTranscludeFn.$$slots[slotName];
6793
- };
6794
- }
6795
-
6796
- if (controllerDirectives) {
6797
- elementControllers = setupControllers($element, attrs, transcludeFn, controllerDirectives, isolateScope, scope, newIsolateScopeDirective);
6798
- }
6799
-
6800
- if (newIsolateScopeDirective) {
6801
- compile.$$addScopeInfo($element, isolateScope, true, !(templateDirective && (templateDirective === newIsolateScopeDirective ||
6802
- templateDirective === newIsolateScopeDirective.$$originalDirective)));
6803
- compile.$$addScopeClass($element, true);
6804
- isolateScope.$$isolateBindings =
6805
- newIsolateScopeDirective.$$isolateBindings;
6806
- scopeBindingInfo = initializeDirectiveBindings(scope, attrs, isolateScope,
6807
- isolateScope.$$isolateBindings,
6808
- newIsolateScopeDirective);
6809
- if (scopeBindingInfo.removeWatches) {
6810
- isolateScope.$on('$destroy', scopeBindingInfo.removeWatches);
6811
- }
6812
- }
6813
-
6814
- for (var name in elementControllers) {
6815
- var controllerDirective = controllerDirectives[name];
6816
- var controller = elementControllers[name];
6817
- var bindings = controllerDirective.$$bindings.bindToController;
6818
-
6819
- if (preAssignBindingsEnabled) {
6820
- if (bindings) {
6821
- controller.bindingInfo =
6822
- initializeDirectiveBindings(controllerScope, attrs, controller.instance, bindings, controllerDirective);
6823
- } else {
6824
- controller.bindingInfo = {};
6825
- }
6826
-
6827
- var controllerResult = controller();
6828
- if (controllerResult !== controller.instance) {
6829
- controller.instance = controllerResult;
6830
- $element.data('$' + controllerDirective.name + 'Controller', controllerResult);
6831
- if (controller.bindingInfo.removeWatches) {
6832
- controller.bindingInfo.removeWatches();
6833
- }
6834
- controller.bindingInfo =
6835
- initializeDirectiveBindings(controllerScope, attrs, controller.instance, bindings, controllerDirective);
6836
- }
6837
- } else {
6838
- controller.instance = controller();
6839
- $element.data('$' + controllerDirective.name + 'Controller', controller.instance);
6840
- controller.bindingInfo =
6841
- initializeDirectiveBindings(controllerScope, attrs, controller.instance, bindings, controllerDirective);
6842
- }
6843
- }
6844
-
6845
- forEach(controllerDirectives, function(controllerDirective, name) {
6846
- var require = controllerDirective.require;
6847
- if (controllerDirective.bindToController && !isArray(require) && isObject(require)) {
6848
- extend(elementControllers[name].instance, getControllers(name, require, $element, elementControllers));
6849
- }
6850
- });
6851
-
6852
- forEach(elementControllers, function(controller) {
6853
- var controllerInstance = controller.instance;
6854
- if (isFunction(controllerInstance.$onChanges)) {
6855
- try {
6856
- controllerInstance.$onChanges(controller.bindingInfo.initialChanges);
6857
- } catch (e) {
6858
- $exceptionHandler(e);
6859
- }
6860
- }
6861
- if (isFunction(controllerInstance.$onInit)) {
6862
- try {
6863
- controllerInstance.$onInit();
6864
- } catch (e) {
6865
- $exceptionHandler(e);
6866
- }
6867
- }
6868
- if (isFunction(controllerInstance.$doCheck)) {
6869
- controllerScope.$watch(function() { controllerInstance.$doCheck(); });
6870
- controllerInstance.$doCheck();
6871
- }
6872
- if (isFunction(controllerInstance.$onDestroy)) {
6873
- controllerScope.$on('$destroy', function callOnDestroyHook() {
6874
- controllerInstance.$onDestroy();
6875
- });
6876
- }
6877
- });
6878
-
6879
- for (i = 0, ii = preLinkFns.length; i < ii; i++) {
6880
- linkFn = preLinkFns[i];
6881
- invokeLinkFn(linkFn,
6882
- linkFn.isolateScope ? isolateScope : scope,
6883
- $element,
6884
- attrs,
6885
- linkFn.require && getControllers(linkFn.directiveName, linkFn.require, $element, elementControllers),
6886
- transcludeFn
6887
- );
6888
- }
6889
-
6890
- var scopeToChild = scope;
6891
- if (newIsolateScopeDirective && (newIsolateScopeDirective.template || newIsolateScopeDirective.templateUrl === null)) {
6892
- scopeToChild = isolateScope;
6893
- }
6894
- if (childLinkFn) {
6895
- childLinkFn(scopeToChild, linkNode.childNodes, undefined, boundTranscludeFn);
6896
- }
6897
-
6898
- for (i = postLinkFns.length - 1; i >= 0; i--) {
6899
- linkFn = postLinkFns[i];
6900
- invokeLinkFn(linkFn,
6901
- linkFn.isolateScope ? isolateScope : scope,
6902
- $element,
6903
- attrs,
6904
- linkFn.require && getControllers(linkFn.directiveName, linkFn.require, $element, elementControllers),
6905
- transcludeFn
6906
- );
6907
- }
6908
-
6909
- forEach(elementControllers, function(controller) {
6910
- var controllerInstance = controller.instance;
6911
- if (isFunction(controllerInstance.$postLink)) {
6912
- controllerInstance.$postLink();
6913
- }
6914
- });
6915
-
6916
- function controllersBoundTransclude(scope, cloneAttachFn, futureParentElement, slotName) {
6917
- var transcludeControllers;
6918
- if (!isScope(scope)) {
6919
- slotName = futureParentElement;
6920
- futureParentElement = cloneAttachFn;
6921
- cloneAttachFn = scope;
6922
- scope = undefined;
6923
- }
6924
-
6925
- if (hasElementTranscludeDirective) {
6926
- transcludeControllers = elementControllers;
6927
- }
6928
- if (!futureParentElement) {
6929
- futureParentElement = hasElementTranscludeDirective ? $element.parent() : $element;
6930
- }
6931
- if (slotName) {
6932
- var slotTranscludeFn = boundTranscludeFn.$$slots[slotName];
6933
- if (slotTranscludeFn) {
6934
- return slotTranscludeFn(scope, cloneAttachFn, transcludeControllers, futureParentElement, scopeToChild);
6935
- } else if (isUndefined(slotTranscludeFn)) {
6936
- throw $compileMinErr('noslot',
6937
- 'No parent directive that requires a transclusion with slot name "{0}". ' +
6938
- 'Element: {1}',
6939
- slotName, startingTag($element));
6940
- }
6941
- } else {
6942
- return boundTranscludeFn(scope, cloneAttachFn, transcludeControllers, futureParentElement, scopeToChild);
6943
- }
6944
- }
6945
- }
6946
- }
6947
-
6948
- function getControllers(directiveName, require, $element, elementControllers) {
6949
- var value;
6950
-
6951
- if (isString(require)) {
6952
- var match = require.match(REQUIRE_PREFIX_REGEXP);
6953
- var name = require.substring(match[0].length);
6954
- var inheritType = match[1] || match[3];
6955
- var optional = match[2] === '?';
6956
-
6957
- if (inheritType === '^^') {
6958
- $element = $element.parent();
6959
- } else {
6960
- value = elementControllers && elementControllers[name];
6961
- value = value && value.instance;
6962
- }
6963
-
6964
- if (!value) {
6965
- var dataName = '$' + name + 'Controller';
6966
- value = inheritType ? $element.inheritedData(dataName) : $element.data(dataName);
6967
- }
6968
-
6969
- if (!value && !optional) {
6970
- throw $compileMinErr('ctreq',
6971
- 'Controller \'{0}\', required by directive \'{1}\', can\'t be found!',
6972
- name, directiveName);
6973
- }
6974
- } else if (isArray(require)) {
6975
- value = [];
6976
- for (var i = 0, ii = require.length; i < ii; i++) {
6977
- value[i] = getControllers(directiveName, require[i], $element, elementControllers);
6978
- }
6979
- } else if (isObject(require)) {
6980
- value = {};
6981
- forEach(require, function(controller, property) {
6982
- value[property] = getControllers(directiveName, controller, $element, elementControllers);
6983
- });
6984
- }
6985
-
6986
- return value || null;
6987
- }
6988
-
6989
- function setupControllers($element, attrs, transcludeFn, controllerDirectives, isolateScope, scope, newIsolateScopeDirective) {
6990
- var elementControllers = createMap();
6991
- for (var controllerKey in controllerDirectives) {
6992
- var directive = controllerDirectives[controllerKey];
6993
- var locals = {
6994
- $scope: directive === newIsolateScopeDirective || directive.$$isolateScope ? isolateScope : scope,
6995
- $element: $element,
6996
- $attrs: attrs,
6997
- $transclude: transcludeFn
6998
- };
6999
-
7000
- var controller = directive.controller;
7001
- if (controller === '@') {
7002
- controller = attrs[directive.name];
7003
- }
7004
-
7005
- var controllerInstance = $controller(controller, locals, true, directive.controllerAs);
7006
-
7007
- elementControllers[directive.name] = controllerInstance;
7008
- $element.data('$' + directive.name + 'Controller', controllerInstance.instance);
7009
- }
7010
- return elementControllers;
7011
- }
7012
-
7013
- function markDirectiveScope(directives, isolateScope, newScope) {
7014
- for (var j = 0, jj = directives.length; j < jj; j++) {
7015
- directives[j] = inherit(directives[j], {$$isolateScope: isolateScope, $$newScope: newScope});
7016
- }
7017
- }
7018
-
7019
- function addDirective(tDirectives, name, location, maxPriority, ignoreDirective, startAttrName,
7020
- endAttrName) {
7021
- if (name === ignoreDirective) return null;
7022
- var match = null;
7023
- if (hasDirectives.hasOwnProperty(name)) {
7024
- for (var directive, directives = $injector.get(name + Suffix),
7025
- i = 0, ii = directives.length; i < ii; i++) {
7026
- directive = directives[i];
7027
- if ((isUndefined(maxPriority) || maxPriority > directive.priority) &&
7028
- directive.restrict.indexOf(location) !== -1) {
7029
- if (startAttrName) {
7030
- directive = inherit(directive, {$$start: startAttrName, $$end: endAttrName});
7031
- }
7032
- if (!directive.$$bindings) {
7033
- var bindings = directive.$$bindings =
7034
- parseDirectiveBindings(directive, directive.name);
7035
- if (isObject(bindings.isolateScope)) {
7036
- directive.$$isolateBindings = bindings.isolateScope;
7037
- }
7038
- }
7039
- tDirectives.push(directive);
7040
- match = directive;
7041
- }
7042
- }
7043
- }
7044
- return match;
7045
- }
7046
-
7047
-
7048
- function directiveIsMultiElement(name) {
7049
- if (hasDirectives.hasOwnProperty(name)) {
7050
- for (var directive, directives = $injector.get(name + Suffix),
7051
- i = 0, ii = directives.length; i < ii; i++) {
7052
- directive = directives[i];
7053
- if (directive.multiElement) {
7054
- return true;
7055
- }
7056
- }
7057
- }
7058
- return false;
7059
- }
7060
-
7061
- function mergeTemplateAttributes(dst, src) {
7062
- var srcAttr = src.$attr,
7063
- dstAttr = dst.$attr;
7064
-
7065
- forEach(dst, function(value, key) {
7066
- if (key.charAt(0) !== '$') {
7067
- if (src[key] && src[key] !== value) {
7068
- if (value.length) {
7069
- value += (key === 'style' ? ';' : ' ') + src[key];
7070
- } else {
7071
- value = src[key];
7072
- }
7073
- }
7074
- dst.$set(key, value, true, srcAttr[key]);
7075
- }
7076
- });
7077
-
7078
- forEach(src, function(value, key) {
7079
- if (!dst.hasOwnProperty(key) && key.charAt(0) !== '$') {
7080
- dst[key] = value;
7081
-
7082
- if (key !== 'class' && key !== 'style') {
7083
- dstAttr[key] = srcAttr[key];
7084
- }
7085
- }
7086
- });
7087
- }
7088
-
7089
-
7090
- function compileTemplateUrl(directives, $compileNode, tAttrs,
7091
- $rootElement, childTranscludeFn, preLinkFns, postLinkFns, previousCompileContext) {
7092
- var linkQueue = [],
7093
- afterTemplateNodeLinkFn,
7094
- afterTemplateChildLinkFn,
7095
- beforeTemplateCompileNode = $compileNode[0],
7096
- origAsyncDirective = directives.shift(),
7097
- derivedSyncDirective = inherit(origAsyncDirective, {
7098
- templateUrl: null, transclude: null, replace: null, $$originalDirective: origAsyncDirective
7099
- }),
7100
- templateUrl = (isFunction(origAsyncDirective.templateUrl))
7101
- ? origAsyncDirective.templateUrl($compileNode, tAttrs)
7102
- : origAsyncDirective.templateUrl,
7103
- templateNamespace = origAsyncDirective.templateNamespace;
7104
-
7105
- $compileNode.empty();
7106
-
7107
- $templateRequest(templateUrl)
7108
- .then(function(content) {
7109
- var compileNode, tempTemplateAttrs, $template, childBoundTranscludeFn;
7110
-
7111
- content = denormalizeTemplate(content);
7112
-
7113
- if (origAsyncDirective.replace) {
7114
- if (jqLiteIsTextNode(content)) {
7115
- $template = [];
7116
- } else {
7117
- $template = removeComments(wrapTemplate(templateNamespace, trim(content)));
7118
- }
7119
- compileNode = $template[0];
7120
-
7121
- if ($template.length !== 1 || compileNode.nodeType !== NODE_TYPE_ELEMENT) {
7122
- throw $compileMinErr('tplrt',
7123
- 'Template for directive \'{0}\' must have exactly one root element. {1}',
7124
- origAsyncDirective.name, templateUrl);
7125
- }
7126
-
7127
- tempTemplateAttrs = {$attr: {}};
7128
- replaceWith($rootElement, $compileNode, compileNode);
7129
- var templateDirectives = collectDirectives(compileNode, [], tempTemplateAttrs);
7130
-
7131
- if (isObject(origAsyncDirective.scope)) {
7132
- markDirectiveScope(templateDirectives, true);
7133
- }
7134
- directives = templateDirectives.concat(directives);
7135
- mergeTemplateAttributes(tAttrs, tempTemplateAttrs);
7136
- } else {
7137
- compileNode = beforeTemplateCompileNode;
7138
- $compileNode.html(content);
7139
- }
7140
-
7141
- directives.unshift(derivedSyncDirective);
7142
-
7143
- afterTemplateNodeLinkFn = applyDirectivesToNode(directives, compileNode, tAttrs,
7144
- childTranscludeFn, $compileNode, origAsyncDirective, preLinkFns, postLinkFns,
7145
- previousCompileContext);
7146
- forEach($rootElement, function(node, i) {
7147
- if (node === compileNode) {
7148
- $rootElement[i] = $compileNode[0];
7149
- }
7150
- });
7151
- afterTemplateChildLinkFn = compileNodes($compileNode[0].childNodes, childTranscludeFn);
7152
-
7153
- while (linkQueue.length) {
7154
- var scope = linkQueue.shift(),
7155
- beforeTemplateLinkNode = linkQueue.shift(),
7156
- linkRootElement = linkQueue.shift(),
7157
- boundTranscludeFn = linkQueue.shift(),
7158
- linkNode = $compileNode[0];
7159
-
7160
- if (scope.$$destroyed) continue;
7161
-
7162
- if (beforeTemplateLinkNode !== beforeTemplateCompileNode) {
7163
- var oldClasses = beforeTemplateLinkNode.className;
7164
-
7165
- if (!(previousCompileContext.hasElementTranscludeDirective &&
7166
- origAsyncDirective.replace)) {
7167
- linkNode = jqLiteClone(compileNode);
7168
- }
7169
- replaceWith(linkRootElement, jqLite(beforeTemplateLinkNode), linkNode);
7170
-
7171
- safeAddClass(jqLite(linkNode), oldClasses);
7172
- }
7173
- if (afterTemplateNodeLinkFn.transcludeOnThisElement) {
7174
- childBoundTranscludeFn = createBoundTranscludeFn(scope, afterTemplateNodeLinkFn.transclude, boundTranscludeFn);
7175
- } else {
7176
- childBoundTranscludeFn = boundTranscludeFn;
7177
- }
7178
- afterTemplateNodeLinkFn(afterTemplateChildLinkFn, scope, linkNode, $rootElement,
7179
- childBoundTranscludeFn);
7180
- }
7181
- linkQueue = null;
7182
- }).catch(function(error) {
7183
- if (error instanceof Error) {
7184
- $exceptionHandler(error);
7185
- }
7186
- }).catch(noop);
7187
-
7188
- return function delayedNodeLinkFn(ignoreChildLinkFn, scope, node, rootElement, boundTranscludeFn) {
7189
- var childBoundTranscludeFn = boundTranscludeFn;
7190
- if (scope.$$destroyed) return;
7191
- if (linkQueue) {
7192
- linkQueue.push(scope,
7193
- node,
7194
- rootElement,
7195
- childBoundTranscludeFn);
7196
- } else {
7197
- if (afterTemplateNodeLinkFn.transcludeOnThisElement) {
7198
- childBoundTranscludeFn = createBoundTranscludeFn(scope, afterTemplateNodeLinkFn.transclude, boundTranscludeFn);
7199
- }
7200
- afterTemplateNodeLinkFn(afterTemplateChildLinkFn, scope, node, rootElement, childBoundTranscludeFn);
7201
- }
7202
- };
7203
- }
7204
-
7205
-
7206
- function byPriority(a, b) {
7207
- var diff = b.priority - a.priority;
7208
- if (diff !== 0) return diff;
7209
- if (a.name !== b.name) return (a.name < b.name) ? -1 : 1;
7210
- return a.index - b.index;
7211
- }
7212
-
7213
- function assertNoDuplicate(what, previousDirective, directive, element) {
7214
-
7215
- function wrapModuleNameIfDefined(moduleName) {
7216
- return moduleName ?
7217
- (' (module: ' + moduleName + ')') :
7218
- '';
7219
- }
7220
-
7221
- if (previousDirective) {
7222
- throw $compileMinErr('multidir', 'Multiple directives [{0}{1}, {2}{3}] asking for {4} on: {5}',
7223
- previousDirective.name, wrapModuleNameIfDefined(previousDirective.$$moduleName),
7224
- directive.name, wrapModuleNameIfDefined(directive.$$moduleName), what, startingTag(element));
7225
- }
7226
- }
7227
-
7228
-
7229
- function addTextInterpolateDirective(directives, text) {
7230
- var interpolateFn = $interpolate(text, true);
7231
- if (interpolateFn) {
7232
- directives.push({
7233
- priority: 0,
7234
- compile: function textInterpolateCompileFn(templateNode) {
7235
- var templateNodeParent = templateNode.parent(),
7236
- hasCompileParent = !!templateNodeParent.length;
7237
-
7238
- if (hasCompileParent) compile.$$addBindingClass(templateNodeParent);
7239
-
7240
- return function textInterpolateLinkFn(scope, node) {
7241
- var parent = node.parent();
7242
- if (!hasCompileParent) compile.$$addBindingClass(parent);
7243
- compile.$$addBindingInfo(parent, interpolateFn.expressions);
7244
- scope.$watch(interpolateFn, function interpolateFnWatchAction(value) {
7245
- node[0].nodeValue = value;
7246
- });
7247
- };
7248
- }
7249
- });
7250
- }
7251
- }
7252
-
7253
-
7254
- function wrapTemplate(type, template) {
7255
- type = lowercase(type || 'html');
7256
- switch (type) {
7257
- case 'svg':
7258
- case 'math':
7259
- var wrapper = window.document.createElement('div');
7260
- wrapper.innerHTML = '<' + type + '>' + template + '</' + type + '>';
7261
- return wrapper.childNodes[0].childNodes;
7262
- default:
7263
- return template;
7264
- }
7265
- }
7266
-
7267
-
7268
- function getTrustedContext(node, attrNormalizedName) {
7269
- if (attrNormalizedName === 'srcdoc') {
7270
- return $sce.HTML;
7271
- }
7272
- var tag = nodeName_(node);
7273
- if (attrNormalizedName === 'src' || attrNormalizedName === 'ngSrc') {
7274
- if (['img', 'video', 'audio', 'source', 'track'].indexOf(tag) === -1) {
7275
- return $sce.RESOURCE_URL;
7276
- }
7277
- } else if (attrNormalizedName === 'xlinkHref' ||
7278
- (tag === 'form' && attrNormalizedName === 'action') ||
7279
- (tag === 'link' && attrNormalizedName === 'href')
7280
- ) {
7281
- return $sce.RESOURCE_URL;
7282
- }
7283
- }
7284
-
7285
-
7286
- function addAttrInterpolateDirective(node, directives, value, name, isNgAttr) {
7287
- var trustedContext = getTrustedContext(node, name);
7288
- var mustHaveExpression = !isNgAttr;
7289
- var allOrNothing = ALL_OR_NOTHING_ATTRS[name] || isNgAttr;
7290
-
7291
- var interpolateFn = $interpolate(value, mustHaveExpression, trustedContext, allOrNothing);
7292
-
7293
- if (!interpolateFn) return;
7294
-
7295
- if (name === 'multiple' && nodeName_(node) === 'select') {
7296
- throw $compileMinErr('selmulti',
7297
- 'Binding to the \'multiple\' attribute is not supported. Element: {0}',
7298
- startingTag(node));
7299
- }
7300
-
7301
- if (EVENT_HANDLER_ATTR_REGEXP.test(name)) {
7302
- throw $compileMinErr('nodomevents',
7303
- 'Interpolations for HTML DOM event attributes are disallowed. Please use the ' +
7304
- 'ng- versions (such as ng-click instead of onclick) instead.');
7305
- }
7306
-
7307
- directives.push({
7308
- priority: 100,
7309
- compile: function() {
7310
- return {
7311
- pre: function attrInterpolatePreLinkFn(scope, element, attr) {
7312
- var $$observers = (attr.$$observers || (attr.$$observers = createMap()));
7313
-
7314
- var newValue = attr[name];
7315
- if (newValue !== value) {
7316
- interpolateFn = newValue && $interpolate(newValue, true, trustedContext, allOrNothing);
7317
- value = newValue;
7318
- }
7319
-
7320
- if (!interpolateFn) return;
7321
-
7322
- attr[name] = interpolateFn(scope);
7323
-
7324
- ($$observers[name] || ($$observers[name] = [])).$$inter = true;
7325
- (attr.$$observers && attr.$$observers[name].$$scope || scope).
7326
- $watch(interpolateFn, function interpolateFnWatchAction(newValue, oldValue) {
7327
- if (name === 'class' && newValue !== oldValue) {
7328
- attr.$updateClass(newValue, oldValue);
7329
- } else {
7330
- attr.$set(name, newValue);
7331
- }
7332
- });
7333
- }
7334
- };
7335
- }
7336
- });
7337
- }
7338
-
7339
-
7340
- function replaceWith($rootElement, elementsToRemove, newNode) {
7341
- var firstElementToRemove = elementsToRemove[0],
7342
- removeCount = elementsToRemove.length,
7343
- parent = firstElementToRemove.parentNode,
7344
- i, ii;
7345
-
7346
- if ($rootElement) {
7347
- for (i = 0, ii = $rootElement.length; i < ii; i++) {
7348
- if ($rootElement[i] === firstElementToRemove) {
7349
- $rootElement[i++] = newNode;
7350
- for (var j = i, j2 = j + removeCount - 1,
7351
- jj = $rootElement.length;
7352
- j < jj; j++, j2++) {
7353
- if (j2 < jj) {
7354
- $rootElement[j] = $rootElement[j2];
7355
- } else {
7356
- delete $rootElement[j];
7357
- }
7358
- }
7359
- $rootElement.length -= removeCount - 1;
7360
-
7361
- if ($rootElement.context === firstElementToRemove) {
7362
- $rootElement.context = newNode;
7363
- }
7364
- break;
7365
- }
7366
- }
7367
- }
7368
-
7369
- if (parent) {
7370
- parent.replaceChild(newNode, firstElementToRemove);
7371
- }
7372
-
7373
- var fragment = window.document.createDocumentFragment();
7374
- for (i = 0; i < removeCount; i++) {
7375
- fragment.appendChild(elementsToRemove[i]);
7376
- }
7377
-
7378
- if (jqLite.hasData(firstElementToRemove)) {
7379
- jqLite.data(newNode, jqLite.data(firstElementToRemove));
7380
-
7381
- jqLite(firstElementToRemove).off('$destroy');
7382
- }
7383
-
7384
- jqLite.cleanData(fragment.querySelectorAll('*'));
7385
-
7386
- for (i = 1; i < removeCount; i++) {
7387
- delete elementsToRemove[i];
7388
- }
7389
- elementsToRemove[0] = newNode;
7390
- elementsToRemove.length = 1;
7391
- }
7392
-
7393
-
7394
- function cloneAndAnnotateFn(fn, annotation) {
7395
- return extend(function() { return fn.apply(null, arguments); }, fn, annotation);
7396
- }
7397
-
7398
-
7399
- function invokeLinkFn(linkFn, scope, $element, attrs, controllers, transcludeFn) {
7400
- try {
7401
- linkFn(scope, $element, attrs, controllers, transcludeFn);
7402
- } catch (e) {
7403
- $exceptionHandler(e, startingTag($element));
7404
- }
7405
- }
7406
-
7407
-
7408
- function initializeDirectiveBindings(scope, attrs, destination, bindings, directive) {
7409
- var removeWatchCollection = [];
7410
- var initialChanges = {};
7411
- var changes;
7412
- forEach(bindings, function initializeBinding(definition, scopeName) {
7413
- var attrName = definition.attrName,
7414
- optional = definition.optional,
7415
- mode = definition.mode,
7416
- lastValue,
7417
- parentGet, parentSet, compare, removeWatch;
7418
-
7419
- switch (mode) {
7420
-
7421
- case '@':
7422
- if (!optional && !hasOwnProperty.call(attrs, attrName)) {
7423
- destination[scopeName] = attrs[attrName] = undefined;
7424
- }
7425
- removeWatch = attrs.$observe(attrName, function(value) {
7426
- if (isString(value) || isBoolean(value)) {
7427
- var oldValue = destination[scopeName];
7428
- recordChanges(scopeName, value, oldValue);
7429
- destination[scopeName] = value;
7430
- }
7431
- });
7432
- attrs.$$observers[attrName].$$scope = scope;
7433
- lastValue = attrs[attrName];
7434
- if (isString(lastValue)) {
7435
- destination[scopeName] = $interpolate(lastValue)(scope);
7436
- } else if (isBoolean(lastValue)) {
7437
- destination[scopeName] = lastValue;
7438
- }
7439
- initialChanges[scopeName] = new SimpleChange(_UNINITIALIZED_VALUE, destination[scopeName]);
7440
- removeWatchCollection.push(removeWatch);
7441
- break;
7442
-
7443
- case '=':
7444
- if (!hasOwnProperty.call(attrs, attrName)) {
7445
- if (optional) break;
7446
- attrs[attrName] = undefined;
7447
- }
7448
- if (optional && !attrs[attrName]) break;
7449
-
7450
- parentGet = $parse(attrs[attrName]);
7451
- if (parentGet.literal) {
7452
- compare = equals;
7453
- } else {
7454
- compare = function simpleCompare(a, b) { return a === b || (a !== a && b !== b); };
7455
- }
7456
- parentSet = parentGet.assign || function() {
7457
- lastValue = destination[scopeName] = parentGet(scope);
7458
- throw $compileMinErr('nonassign',
7459
- 'Expression \'{0}\' in attribute \'{1}\' used with directive \'{2}\' is non-assignable!',
7460
- attrs[attrName], attrName, directive.name);
7461
- };
7462
- lastValue = destination[scopeName] = parentGet(scope);
7463
- var parentValueWatch = function parentValueWatch(parentValue) {
7464
- if (!compare(parentValue, destination[scopeName])) {
7465
- if (!compare(parentValue, lastValue)) {
7466
- destination[scopeName] = parentValue;
7467
- } else {
7468
- parentSet(scope, parentValue = destination[scopeName]);
7469
- }
7470
- }
7471
- lastValue = parentValue;
7472
- return lastValue;
7473
- };
7474
- parentValueWatch.$stateful = true;
7475
- if (definition.collection) {
7476
- removeWatch = scope.$watchCollection(attrs[attrName], parentValueWatch);
7477
- } else {
7478
- removeWatch = scope.$watch($parse(attrs[attrName], parentValueWatch), null, parentGet.literal);
7479
- }
7480
- removeWatchCollection.push(removeWatch);
7481
- break;
7482
-
7483
- case '<':
7484
- if (!hasOwnProperty.call(attrs, attrName)) {
7485
- if (optional) break;
7486
- attrs[attrName] = undefined;
7487
- }
7488
- if (optional && !attrs[attrName]) break;
7489
-
7490
- parentGet = $parse(attrs[attrName]);
7491
- var deepWatch = parentGet.literal;
7492
-
7493
- var initialValue = destination[scopeName] = parentGet(scope);
7494
- initialChanges[scopeName] = new SimpleChange(_UNINITIALIZED_VALUE, destination[scopeName]);
7495
-
7496
- removeWatch = scope.$watch(parentGet, function parentValueWatchAction(newValue, oldValue) {
7497
- if (oldValue === newValue) {
7498
- if (oldValue === initialValue || (deepWatch && equals(oldValue, initialValue))) {
7499
- return;
7500
- }
7501
- oldValue = initialValue;
7502
- }
7503
- recordChanges(scopeName, newValue, oldValue);
7504
- destination[scopeName] = newValue;
7505
- }, deepWatch);
7506
-
7507
- removeWatchCollection.push(removeWatch);
7508
- break;
7509
-
7510
- case '&':
7511
- parentGet = attrs.hasOwnProperty(attrName) ? $parse(attrs[attrName]) : noop;
7512
-
7513
- if (parentGet === noop && optional) break;
7514
-
7515
- destination[scopeName] = function(locals) {
7516
- return parentGet(scope, locals);
7517
- };
7518
- break;
7519
- }
7520
- });
7521
-
7522
- function recordChanges(key, currentValue, previousValue) {
7523
- if (isFunction(destination.$onChanges) && currentValue !== previousValue &&
7524
- (currentValue === currentValue || previousValue === previousValue)) {
7525
- if (!onChangesQueue) {
7526
- scope.$$postDigest(flushOnChangesQueue);
7527
- onChangesQueue = [];
7528
- }
7529
- if (!changes) {
7530
- changes = {};
7531
- onChangesQueue.push(triggerOnChangesHook);
7532
- }
7533
- if (changes[key]) {
7534
- previousValue = changes[key].previousValue;
7535
- }
7536
- changes[key] = new SimpleChange(previousValue, currentValue);
7537
- }
7538
- }
7539
-
7540
- function triggerOnChangesHook() {
7541
- destination.$onChanges(changes);
7542
- changes = undefined;
7543
- }
7544
-
7545
- return {
7546
- initialChanges: initialChanges,
7547
- removeWatches: removeWatchCollection.length && function removeWatches() {
7548
- for (var i = 0, ii = removeWatchCollection.length; i < ii; ++i) {
7549
- removeWatchCollection[i]();
7550
- }
7551
- }
7552
- };
7553
- }
7554
- }];
7555
- }
7556
-
7557
- function SimpleChange(previous, current) {
7558
- this.previousValue = previous;
7559
- this.currentValue = current;
7560
- }
7561
- SimpleChange.prototype.isFirstChange = function() { return this.previousValue === _UNINITIALIZED_VALUE; };
7562
-
7563
-
7564
- var PREFIX_REGEXP = /^((?:x|data)[:\-_])/i;
7565
- var SPECIAL_CHARS_REGEXP = /[:\-_]+(.)/g;
7566
-
7567
- function directiveNormalize(name) {
7568
- return name
7569
- .replace(PREFIX_REGEXP, '')
7570
- .replace(SPECIAL_CHARS_REGEXP, fnCamelCaseReplace);
7571
- }
7572
-
7573
-
7574
-
7575
-
7576
-
7577
-
7578
-
7579
-
7580
- function nodesetLinkingFn(
7581
- scope,
7582
- nodeList,
7583
- rootElement,
7584
- boundTranscludeFn
7585
- ) {}
7586
-
7587
- function directiveLinkingFn(
7588
- nodesetLinkingFn,
7589
- scope,
7590
- node,
7591
- rootElement,
7592
- boundTranscludeFn
7593
- ) {}
7594
-
7595
- function tokenDifference(str1, str2) {
7596
- var values = '',
7597
- tokens1 = str1.split(/\s+/),
7598
- tokens2 = str2.split(/\s+/);
7599
-
7600
- outer:
7601
- for (var i = 0; i < tokens1.length; i++) {
7602
- var token = tokens1[i];
7603
- for (var j = 0; j < tokens2.length; j++) {
7604
- if (token === tokens2[j]) continue outer;
7605
- }
7606
- values += (values.length > 0 ? ' ' : '') + token;
7607
- }
7608
- return values;
7609
- }
7610
-
7611
- function removeComments(jqNodes) {
7612
- jqNodes = jqLite(jqNodes);
7613
- var i = jqNodes.length;
7614
-
7615
- if (i <= 1) {
7616
- return jqNodes;
7617
- }
7618
-
7619
- while (i--) {
7620
- var node = jqNodes[i];
7621
- if (node.nodeType === NODE_TYPE_COMMENT ||
7622
- (node.nodeType === NODE_TYPE_TEXT && node.nodeValue.trim() === '')) {
7623
- splice.call(jqNodes, i, 1);
7624
- }
7625
- }
7626
- return jqNodes;
7627
- }
7628
-
7629
- var $controllerMinErr = minErr('$controller');
7630
-
7631
-
7632
- var CNTRL_REG = /^(\S+)(\s+as\s+([\w$]+))?$/;
7633
- function identifierForController(controller, ident) {
7634
- if (ident && isString(ident)) return ident;
7635
- if (isString(controller)) {
7636
- var match = CNTRL_REG.exec(controller);
7637
- if (match) return match[3];
7638
- }
7639
- }
7640
-
7641
-
7642
- function $ControllerProvider() {
7643
- var controllers = {},
7644
- globals = false;
7645
-
7646
- this.has = function(name) {
7647
- return controllers.hasOwnProperty(name);
7648
- };
7649
-
7650
- this.register = function(name, constructor) {
7651
- assertNotHasOwnProperty(name, 'controller');
7652
- if (isObject(name)) {
7653
- extend(controllers, name);
7654
- } else {
7655
- controllers[name] = constructor;
7656
- }
7657
- };
7658
-
7659
- this.allowGlobals = function() {
7660
- globals = true;
7661
- };
7662
-
7663
-
7664
- this.$get = ['$injector', '$window', function($injector, $window) {
7665
-
7666
- return function $controller(expression, locals, later, ident) {
7667
- var instance, match, constructor, identifier;
7668
- later = later === true;
7669
- if (ident && isString(ident)) {
7670
- identifier = ident;
7671
- }
7672
-
7673
- if (isString(expression)) {
7674
- match = expression.match(CNTRL_REG);
7675
- if (!match) {
7676
- throw $controllerMinErr('ctrlfmt',
7677
- 'Badly formed controller string \'{0}\'. ' +
7678
- 'Must match `__name__ as __id__` or `__name__`.', expression);
7679
- }
7680
- constructor = match[1];
7681
- identifier = identifier || match[3];
7682
- expression = controllers.hasOwnProperty(constructor)
7683
- ? controllers[constructor]
7684
- : getter(locals.$scope, constructor, true) ||
7685
- (globals ? getter($window, constructor, true) : undefined);
7686
-
7687
- if (!expression) {
7688
- throw $controllerMinErr('ctrlreg',
7689
- 'The controller with the name \'{0}\' is not registered.', constructor);
7690
- }
7691
-
7692
- assertArgFn(expression, constructor, true);
7693
- }
7694
-
7695
- if (later) {
7696
- var controllerPrototype = (isArray(expression) ?
7697
- expression[expression.length - 1] : expression).prototype;
7698
- instance = Object.create(controllerPrototype || null);
7699
-
7700
- if (identifier) {
7701
- addIdentifier(locals, identifier, instance, constructor || expression.name);
7702
- }
7703
-
7704
- return extend(function $controllerInit() {
7705
- var result = $injector.invoke(expression, instance, locals, constructor);
7706
- if (result !== instance && (isObject(result) || isFunction(result))) {
7707
- instance = result;
7708
- if (identifier) {
7709
- addIdentifier(locals, identifier, instance, constructor || expression.name);
7710
- }
7711
- }
7712
- return instance;
7713
- }, {
7714
- instance: instance,
7715
- identifier: identifier
7716
- });
7717
- }
7718
-
7719
- instance = $injector.instantiate(expression, locals, constructor);
7720
-
7721
- if (identifier) {
7722
- addIdentifier(locals, identifier, instance, constructor || expression.name);
7723
- }
7724
-
7725
- return instance;
7726
- };
7727
-
7728
- function addIdentifier(locals, identifier, instance, name) {
7729
- if (!(locals && isObject(locals.$scope))) {
7730
- throw minErr('$controller')('noscp',
7731
- 'Cannot export controller \'{0}\' as \'{1}\'! No $scope object provided via `locals`.',
7732
- name, identifier);
7733
- }
7734
-
7735
- locals.$scope[identifier] = instance;
7736
- }
7737
- }];
7738
- }
7739
-
7740
- function $DocumentProvider() {
7741
- this.$get = ['$window', function(window) {
7742
- return jqLite(window.document);
7743
- }];
7744
- }
7745
-
7746
-
7747
- function $$IsDocumentHiddenProvider() {
7748
- this.$get = ['$document', '$rootScope', function($document, $rootScope) {
7749
- var doc = $document[0];
7750
- var hidden = doc && doc.hidden;
7751
-
7752
- $document.on('visibilitychange', changeListener);
7753
-
7754
- $rootScope.$on('$destroy', function() {
7755
- $document.off('visibilitychange', changeListener);
7756
- });
7757
-
7758
- function changeListener() {
7759
- hidden = doc.hidden;
7760
- }
7761
-
7762
- return function() {
7763
- return hidden;
7764
- };
7765
- }];
7766
- }
7767
-
7768
- function $ExceptionHandlerProvider() {
7769
- this.$get = ['$log', function($log) {
7770
- return function(exception, cause) {
7771
- $log.error.apply($log, arguments);
7772
- };
7773
- }];
7774
- }
7775
-
7776
- var $$ForceReflowProvider = function() {
7777
- this.$get = ['$document', function($document) {
7778
- return function(domNode) {
7779
- if (domNode) {
7780
- if (!domNode.nodeType && domNode instanceof jqLite) {
7781
- domNode = domNode[0];
7782
- }
7783
- } else {
7784
- domNode = $document[0].body;
7785
- }
7786
- return domNode.offsetWidth + 1;
7787
- };
7788
- }];
7789
- };
7790
-
7791
- var APPLICATION_JSON = 'application/json';
7792
- var CONTENT_TYPE_APPLICATION_JSON = {'Content-Type': APPLICATION_JSON + ';charset=utf-8'};
7793
- var JSON_START = /^\[|^\{(?!\{)/;
7794
- var JSON_ENDS = {
7795
- '[': /]$/,
7796
- '{': /}$/
7797
- };
7798
- var JSON_PROTECTION_PREFIX = /^\)]\}',?\n/;
7799
- var $httpMinErr = minErr('$http');
7800
-
7801
- function serializeValue(v) {
7802
- if (isObject(v)) {
7803
- return isDate(v) ? v.toISOString() : toJson(v);
7804
- }
7805
- return v;
7806
- }
7807
-
7808
-
7809
- function $HttpParamSerializerProvider() {
7810
-
7811
- this.$get = function() {
7812
- return function ngParamSerializer(params) {
7813
- if (!params) return '';
7814
- var parts = [];
7815
- forEachSorted(params, function(value, key) {
7816
- if (value === null || isUndefined(value)) return;
7817
- if (isArray(value)) {
7818
- forEach(value, function(v) {
7819
- parts.push(encodeUriQuery(key) + '=' + encodeUriQuery(serializeValue(v)));
7820
- });
7821
- } else {
7822
- parts.push(encodeUriQuery(key) + '=' + encodeUriQuery(serializeValue(value)));
7823
- }
7824
- });
7825
-
7826
- return parts.join('&');
7827
- };
7828
- };
7829
- }
7830
-
7831
- function $HttpParamSerializerJQLikeProvider() {
7832
- this.$get = function() {
7833
- return function jQueryLikeParamSerializer(params) {
7834
- if (!params) return '';
7835
- var parts = [];
7836
- serialize(params, '', true);
7837
- return parts.join('&');
7838
-
7839
- function serialize(toSerialize, prefix, topLevel) {
7840
- if (toSerialize === null || isUndefined(toSerialize)) return;
7841
- if (isArray(toSerialize)) {
7842
- forEach(toSerialize, function(value, index) {
7843
- serialize(value, prefix + '[' + (isObject(value) ? index : '') + ']');
7844
- });
7845
- } else if (isObject(toSerialize) && !isDate(toSerialize)) {
7846
- forEachSorted(toSerialize, function(value, key) {
7847
- serialize(value, prefix +
7848
- (topLevel ? '' : '[') +
7849
- key +
7850
- (topLevel ? '' : ']'));
7851
- });
7852
- } else {
7853
- parts.push(encodeUriQuery(prefix) + '=' + encodeUriQuery(serializeValue(toSerialize)));
7854
- }
7855
- }
7856
- };
7857
- };
7858
- }
7859
-
7860
- function defaultHttpResponseTransform(data, headers) {
7861
- if (isString(data)) {
7862
- var tempData = data.replace(JSON_PROTECTION_PREFIX, '').trim();
7863
-
7864
- if (tempData) {
7865
- var contentType = headers('Content-Type');
7866
- if ((contentType && (contentType.indexOf(APPLICATION_JSON) === 0)) || isJsonLike(tempData)) {
7867
- data = fromJson(tempData);
7868
- }
7869
- }
7870
- }
7871
-
7872
- return data;
7873
- }
7874
-
7875
- function isJsonLike(str) {
7876
- var jsonStart = str.match(JSON_START);
7877
- return jsonStart && JSON_ENDS[jsonStart[0]].test(str);
7878
- }
7879
-
7880
- function parseHeaders(headers) {
7881
- var parsed = createMap(), i;
7882
-
7883
- function fillInParsed(key, val) {
7884
- if (key) {
7885
- parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
7886
- }
7887
- }
7888
-
7889
- if (isString(headers)) {
7890
- forEach(headers.split('\n'), function(line) {
7891
- i = line.indexOf(':');
7892
- fillInParsed(lowercase(trim(line.substr(0, i))), trim(line.substr(i + 1)));
7893
- });
7894
- } else if (isObject(headers)) {
7895
- forEach(headers, function(headerVal, headerKey) {
7896
- fillInParsed(lowercase(headerKey), trim(headerVal));
7897
- });
7898
- }
7899
-
7900
- return parsed;
7901
- }
7902
-
7903
-
7904
- function headersGetter(headers) {
7905
- var headersObj;
7906
-
7907
- return function(name) {
7908
- if (!headersObj) headersObj = parseHeaders(headers);
7909
-
7910
- if (name) {
7911
- var value = headersObj[lowercase(name)];
7912
- if (value === undefined) {
7913
- value = null;
7914
- }
7915
- return value;
7916
- }
7917
-
7918
- return headersObj;
7919
- };
7920
- }
7921
-
7922
-
7923
- function transformData(data, headers, status, fns) {
7924
- if (isFunction(fns)) {
7925
- return fns(data, headers, status);
7926
- }
7927
-
7928
- forEach(fns, function(fn) {
7929
- data = fn(data, headers, status);
7930
- });
7931
-
7932
- return data;
7933
- }
7934
-
7935
-
7936
- function isSuccess(status) {
7937
- return 200 <= status && status < 300;
7938
- }
7939
-
7940
-
7941
- function $HttpProvider() {
7942
- var defaults = this.defaults = {
7943
- transformResponse: [defaultHttpResponseTransform],
7944
-
7945
- transformRequest: [function(d) {
7946
- return isObject(d) && !isFile(d) && !isBlob(d) && !isFormData(d) ? toJson(d) : d;
7947
- }],
7948
-
7949
- headers: {
7950
- common: {
7951
- 'Accept': 'application/json, text/plain, */*'
7952
- },
7953
- post: shallowCopy(CONTENT_TYPE_APPLICATION_JSON),
7954
- put: shallowCopy(CONTENT_TYPE_APPLICATION_JSON),
7955
- patch: shallowCopy(CONTENT_TYPE_APPLICATION_JSON)
7956
- },
7957
-
7958
- xsrfCookieName: 'XSRF-TOKEN',
7959
- xsrfHeaderName: 'X-XSRF-TOKEN',
7960
-
7961
- paramSerializer: '$httpParamSerializer',
7962
-
7963
- jsonpCallbackParam: 'callback'
7964
- };
7965
-
7966
- var useApplyAsync = false;
7967
- this.useApplyAsync = function(value) {
7968
- if (isDefined(value)) {
7969
- useApplyAsync = !!value;
7970
- return this;
7971
- }
7972
- return useApplyAsync;
7973
- };
7974
-
7975
- var interceptorFactories = this.interceptors = [];
7976
-
7977
- this.$get = ['$browser', '$httpBackend', '$$cookieReader', '$cacheFactory', '$rootScope', '$q', '$injector', '$sce',
7978
- function($browser, $httpBackend, $$cookieReader, $cacheFactory, $rootScope, $q, $injector, $sce) {
7979
-
7980
- var defaultCache = $cacheFactory('$http');
7981
-
7982
- defaults.paramSerializer = isString(defaults.paramSerializer) ?
7983
- $injector.get(defaults.paramSerializer) : defaults.paramSerializer;
7984
-
7985
- var reversedInterceptors = [];
7986
-
7987
- forEach(interceptorFactories, function(interceptorFactory) {
7988
- reversedInterceptors.unshift(isString(interceptorFactory)
7989
- ? $injector.get(interceptorFactory) : $injector.invoke(interceptorFactory));
7990
- });
7991
-
7992
- function $http(requestConfig) {
7993
-
7994
- if (!isObject(requestConfig)) {
7995
- throw minErr('$http')('badreq', 'Http request configuration must be an object. Received: {0}', requestConfig);
7996
- }
7997
-
7998
- if (!isString($sce.valueOf(requestConfig.url))) {
7999
- throw minErr('$http')('badreq', 'Http request configuration url must be a string or a $sce trusted object. Received: {0}', requestConfig.url);
8000
- }
8001
-
8002
- var config = extend({
8003
- method: 'get',
8004
- transformRequest: defaults.transformRequest,
8005
- transformResponse: defaults.transformResponse,
8006
- paramSerializer: defaults.paramSerializer,
8007
- jsonpCallbackParam: defaults.jsonpCallbackParam
8008
- }, requestConfig);
8009
-
8010
- config.headers = mergeHeaders(requestConfig);
8011
- config.method = uppercase(config.method);
8012
- config.paramSerializer = isString(config.paramSerializer) ?
8013
- $injector.get(config.paramSerializer) : config.paramSerializer;
8014
-
8015
- $browser.$$incOutstandingRequestCount();
8016
-
8017
- var requestInterceptors = [];
8018
- var responseInterceptors = [];
8019
- var promise = $q.resolve(config);
8020
-
8021
- forEach(reversedInterceptors, function(interceptor) {
8022
- if (interceptor.request || interceptor.requestError) {
8023
- requestInterceptors.unshift(interceptor.request, interceptor.requestError);
8024
- }
8025
- if (interceptor.response || interceptor.responseError) {
8026
- responseInterceptors.push(interceptor.response, interceptor.responseError);
8027
- }
8028
- });
8029
-
8030
- promise = chainInterceptors(promise, requestInterceptors);
8031
- promise = promise.then(serverRequest);
8032
- promise = chainInterceptors(promise, responseInterceptors);
8033
- promise = promise.finally(completeOutstandingRequest);
8034
-
8035
- return promise;
8036
-
8037
-
8038
- function chainInterceptors(promise, interceptors) {
8039
- for (var i = 0, ii = interceptors.length; i < ii;) {
8040
- var thenFn = interceptors[i++];
8041
- var rejectFn = interceptors[i++];
8042
-
8043
- promise = promise.then(thenFn, rejectFn);
8044
- }
8045
-
8046
- interceptors.length = 0;
8047
-
8048
- return promise;
8049
- }
8050
-
8051
- function completeOutstandingRequest() {
8052
- $browser.$$completeOutstandingRequest(noop);
8053
- }
8054
-
8055
- function executeHeaderFns(headers, config) {
8056
- var headerContent, processedHeaders = {};
8057
-
8058
- forEach(headers, function(headerFn, header) {
8059
- if (isFunction(headerFn)) {
8060
- headerContent = headerFn(config);
8061
- if (headerContent != null) {
8062
- processedHeaders[header] = headerContent;
8063
- }
8064
- } else {
8065
- processedHeaders[header] = headerFn;
8066
- }
8067
- });
8068
-
8069
- return processedHeaders;
8070
- }
8071
-
8072
- function mergeHeaders(config) {
8073
- var defHeaders = defaults.headers,
8074
- reqHeaders = extend({}, config.headers),
8075
- defHeaderName, lowercaseDefHeaderName, reqHeaderName;
8076
-
8077
- defHeaders = extend({}, defHeaders.common, defHeaders[lowercase(config.method)]);
8078
-
8079
- defaultHeadersIteration:
8080
- for (defHeaderName in defHeaders) {
8081
- lowercaseDefHeaderName = lowercase(defHeaderName);
8082
-
8083
- for (reqHeaderName in reqHeaders) {
8084
- if (lowercase(reqHeaderName) === lowercaseDefHeaderName) {
8085
- continue defaultHeadersIteration;
8086
- }
8087
- }
8088
-
8089
- reqHeaders[defHeaderName] = defHeaders[defHeaderName];
8090
- }
8091
-
8092
- return executeHeaderFns(reqHeaders, shallowCopy(config));
8093
- }
8094
-
8095
- function serverRequest(config) {
8096
- var headers = config.headers;
8097
- var reqData = transformData(config.data, headersGetter(headers), undefined, config.transformRequest);
8098
-
8099
- if (isUndefined(reqData)) {
8100
- forEach(headers, function(value, header) {
8101
- if (lowercase(header) === 'content-type') {
8102
- delete headers[header];
8103
- }
8104
- });
8105
- }
8106
-
8107
- if (isUndefined(config.withCredentials) && !isUndefined(defaults.withCredentials)) {
8108
- config.withCredentials = defaults.withCredentials;
8109
- }
8110
-
8111
- return sendReq(config, reqData).then(transformResponse, transformResponse);
8112
- }
8113
-
8114
- function transformResponse(response) {
8115
- var resp = extend({}, response);
8116
- resp.data = transformData(response.data, response.headers, response.status,
8117
- config.transformResponse);
8118
- return (isSuccess(response.status))
8119
- ? resp
8120
- : $q.reject(resp);
8121
- }
8122
- }
8123
-
8124
- $http.pendingRequests = [];
8125
-
8126
-
8127
-
8128
-
8129
- createShortMethods('get', 'delete', 'head', 'jsonp');
8130
-
8131
-
8132
-
8133
- createShortMethodsWithData('post', 'put', 'patch');
8134
-
8135
- $http.defaults = defaults;
8136
-
8137
-
8138
- return $http;
8139
-
8140
-
8141
- function createShortMethods(names) {
8142
- forEach(arguments, function(name) {
8143
- $http[name] = function(url, config) {
8144
- return $http(extend({}, config || {}, {
8145
- method: name,
8146
- url: url
8147
- }));
8148
- };
8149
- });
8150
- }
8151
-
8152
-
8153
- function createShortMethodsWithData(name) {
8154
- forEach(arguments, function(name) {
8155
- $http[name] = function(url, data, config) {
8156
- return $http(extend({}, config || {}, {
8157
- method: name,
8158
- url: url,
8159
- data: data
8160
- }));
8161
- };
8162
- });
8163
- }
8164
-
8165
-
8166
- function sendReq(config, reqData) {
8167
- var deferred = $q.defer(),
8168
- promise = deferred.promise,
8169
- cache,
8170
- cachedResp,
8171
- reqHeaders = config.headers,
8172
- isJsonp = lowercase(config.method) === 'jsonp',
8173
- url = config.url;
8174
-
8175
- if (isJsonp) {
8176
- url = $sce.getTrustedResourceUrl(url);
8177
- } else if (!isString(url)) {
8178
- url = $sce.valueOf(url);
8179
- }
8180
-
8181
- url = buildUrl(url, config.paramSerializer(config.params));
8182
-
8183
- if (isJsonp) {
8184
- url = sanitizeJsonpCallbackParam(url, config.jsonpCallbackParam);
8185
- }
8186
-
8187
- $http.pendingRequests.push(config);
8188
- promise.then(removePendingReq, removePendingReq);
8189
-
8190
- if ((config.cache || defaults.cache) && config.cache !== false &&
8191
- (config.method === 'GET' || config.method === 'JSONP')) {
8192
- cache = isObject(config.cache) ? config.cache
8193
- : isObject(defaults.cache) ? defaults.cache
8194
- : defaultCache;
8195
- }
8196
-
8197
- if (cache) {
8198
- cachedResp = cache.get(url);
8199
- if (isDefined(cachedResp)) {
8200
- if (isPromiseLike(cachedResp)) {
8201
- cachedResp.then(resolvePromiseWithResult, resolvePromiseWithResult);
8202
- } else {
8203
- if (isArray(cachedResp)) {
8204
- resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3]);
8205
- } else {
8206
- resolvePromise(cachedResp, 200, {}, 'OK');
8207
- }
8208
- }
8209
- } else {
8210
- cache.put(url, promise);
8211
- }
8212
- }
8213
-
8214
-
8215
- if (isUndefined(cachedResp)) {
8216
- var xsrfValue = urlIsSameOrigin(config.url)
8217
- ? $$cookieReader()[config.xsrfCookieName || defaults.xsrfCookieName]
8218
- : undefined;
8219
- if (xsrfValue) {
8220
- reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue;
8221
- }
8222
-
8223
- $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,
8224
- config.withCredentials, config.responseType,
8225
- createApplyHandlers(config.eventHandlers),
8226
- createApplyHandlers(config.uploadEventHandlers));
8227
- }
8228
-
8229
- return promise;
8230
-
8231
- function createApplyHandlers(eventHandlers) {
8232
- if (eventHandlers) {
8233
- var applyHandlers = {};
8234
- forEach(eventHandlers, function(eventHandler, key) {
8235
- applyHandlers[key] = function(event) {
8236
- if (useApplyAsync) {
8237
- $rootScope.$applyAsync(callEventHandler);
8238
- } else if ($rootScope.$$phase) {
8239
- callEventHandler();
8240
- } else {
8241
- $rootScope.$apply(callEventHandler);
8242
- }
8243
-
8244
- function callEventHandler() {
8245
- eventHandler(event);
8246
- }
8247
- };
8248
- });
8249
- return applyHandlers;
8250
- }
8251
- }
8252
-
8253
-
8254
- function done(status, response, headersString, statusText) {
8255
- if (cache) {
8256
- if (isSuccess(status)) {
8257
- cache.put(url, [status, response, parseHeaders(headersString), statusText]);
8258
- } else {
8259
- cache.remove(url);
8260
- }
8261
- }
8262
-
8263
- function resolveHttpPromise() {
8264
- resolvePromise(response, status, headersString, statusText);
8265
- }
8266
-
8267
- if (useApplyAsync) {
8268
- $rootScope.$applyAsync(resolveHttpPromise);
8269
- } else {
8270
- resolveHttpPromise();
8271
- if (!$rootScope.$$phase) $rootScope.$apply();
8272
- }
8273
- }
8274
-
8275
-
8276
- function resolvePromise(response, status, headers, statusText) {
8277
- status = status >= -1 ? status : 0;
8278
-
8279
- (isSuccess(status) ? deferred.resolve : deferred.reject)({
8280
- data: response,
8281
- status: status,
8282
- headers: headersGetter(headers),
8283
- config: config,
8284
- statusText: statusText
8285
- });
8286
- }
8287
-
8288
- function resolvePromiseWithResult(result) {
8289
- resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText);
8290
- }
8291
-
8292
- function removePendingReq() {
8293
- var idx = $http.pendingRequests.indexOf(config);
8294
- if (idx !== -1) $http.pendingRequests.splice(idx, 1);
8295
- }
8296
- }
8297
-
8298
-
8299
- function buildUrl(url, serializedParams) {
8300
- if (serializedParams.length > 0) {
8301
- url += ((url.indexOf('?') === -1) ? '?' : '&') + serializedParams;
8302
- }
8303
- return url;
8304
- }
8305
-
8306
- function sanitizeJsonpCallbackParam(url, key) {
8307
- if (/[&?][^=]+=JSON_CALLBACK/.test(url)) {
8308
- throw $httpMinErr('badjsonp', 'Illegal use of JSON_CALLBACK in url, "{0}"', url);
8309
- }
8310
-
8311
- var callbackParamRegex = new RegExp('[&?]' + key + '=');
8312
- if (callbackParamRegex.test(url)) {
8313
- throw $httpMinErr('badjsonp', 'Illegal use of callback param, "{0}", in url, "{1}"', key, url);
8314
- }
8315
-
8316
- url += ((url.indexOf('?') === -1) ? '?' : '&') + key + '=JSON_CALLBACK';
8317
-
8318
- return url;
8319
- }
8320
- }];
8321
- }
8322
-
8323
- function $xhrFactoryProvider() {
8324
- this.$get = function() {
8325
- return function createXhr() {
8326
- return new window.XMLHttpRequest();
8327
- };
8328
- };
8329
- }
8330
-
8331
- function $HttpBackendProvider() {
8332
- this.$get = ['$browser', '$jsonpCallbacks', '$document', '$xhrFactory', function($browser, $jsonpCallbacks, $document, $xhrFactory) {
8333
- return createHttpBackend($browser, $xhrFactory, $browser.defer, $jsonpCallbacks, $document[0]);
8334
- }];
8335
- }
8336
-
8337
- function createHttpBackend($browser, createXhr, $browserDefer, callbacks, rawDocument) {
8338
- return function(method, url, post, callback, headers, timeout, withCredentials, responseType, eventHandlers, uploadEventHandlers) {
8339
- url = url || $browser.url();
8340
-
8341
- if (lowercase(method) === 'jsonp') {
8342
- var callbackPath = callbacks.createCallback(url);
8343
- var jsonpDone = jsonpReq(url, callbackPath, function(status, text) {
8344
- var response = (status === 200) && callbacks.getResponse(callbackPath);
8345
- completeRequest(callback, status, response, '', text);
8346
- callbacks.removeCallback(callbackPath);
8347
- });
8348
- } else {
8349
-
8350
- var xhr = createXhr(method, url);
8351
-
8352
- xhr.open(method, url, true);
8353
- forEach(headers, function(value, key) {
8354
- if (isDefined(value)) {
8355
- xhr.setRequestHeader(key, value);
8356
- }
8357
- });
8358
-
8359
- xhr.onload = function requestLoaded() {
8360
- var statusText = xhr.statusText || '';
8361
-
8362
- var response = ('response' in xhr) ? xhr.response : xhr.responseText;
8363
-
8364
- var status = xhr.status === 1223 ? 204 : xhr.status;
8365
-
8366
- if (status === 0) {
8367
- status = response ? 200 : urlResolve(url).protocol === 'file' ? 404 : 0;
8368
- }
8369
-
8370
- completeRequest(callback,
8371
- status,
8372
- response,
8373
- xhr.getAllResponseHeaders(),
8374
- statusText);
8375
- };
8376
-
8377
- var requestError = function() {
8378
- completeRequest(callback, -1, null, null, '');
8379
- };
8380
-
8381
- xhr.onerror = requestError;
8382
- xhr.onabort = requestError;
8383
- xhr.ontimeout = requestError;
8384
-
8385
- forEach(eventHandlers, function(value, key) {
8386
- xhr.addEventListener(key, value);
8387
- });
8388
-
8389
- forEach(uploadEventHandlers, function(value, key) {
8390
- xhr.upload.addEventListener(key, value);
8391
- });
8392
-
8393
- if (withCredentials) {
8394
- xhr.withCredentials = true;
8395
- }
8396
-
8397
- if (responseType) {
8398
- try {
8399
- xhr.responseType = responseType;
8400
- } catch (e) {
8401
- if (responseType !== 'json') {
8402
- throw e;
8403
- }
8404
- }
8405
- }
8406
-
8407
- xhr.send(isUndefined(post) ? null : post);
8408
- }
8409
-
8410
- if (timeout > 0) {
8411
- var timeoutId = $browserDefer(timeoutRequest, timeout);
8412
- } else if (isPromiseLike(timeout)) {
8413
- timeout.then(timeoutRequest);
8414
- }
8415
-
8416
-
8417
- function timeoutRequest() {
8418
- if (jsonpDone) {
8419
- jsonpDone();
8420
- }
8421
- if (xhr) {
8422
- xhr.abort();
8423
- }
8424
- }
8425
-
8426
- function completeRequest(callback, status, response, headersString, statusText) {
8427
- if (isDefined(timeoutId)) {
8428
- $browserDefer.cancel(timeoutId);
8429
- }
8430
- jsonpDone = xhr = null;
8431
-
8432
- callback(status, response, headersString, statusText);
8433
- }
8434
- };
8435
-
8436
- function jsonpReq(url, callbackPath, done) {
8437
- url = url.replace('JSON_CALLBACK', callbackPath);
8438
- var script = rawDocument.createElement('script'), callback = null;
8439
- script.type = 'text/javascript';
8440
- script.src = url;
8441
- script.async = true;
8442
-
8443
- callback = function(event) {
8444
- script.removeEventListener('load', callback);
8445
- script.removeEventListener('error', callback);
8446
- rawDocument.body.removeChild(script);
8447
- script = null;
8448
- var status = -1;
8449
- var text = 'unknown';
8450
-
8451
- if (event) {
8452
- if (event.type === 'load' && !callbacks.wasCalled(callbackPath)) {
8453
- event = { type: 'error' };
8454
- }
8455
- text = event.type;
8456
- status = event.type === 'error' ? 404 : 200;
8457
- }
8458
-
8459
- if (done) {
8460
- done(status, text);
8461
- }
8462
- };
8463
-
8464
- script.addEventListener('load', callback);
8465
- script.addEventListener('error', callback);
8466
- rawDocument.body.appendChild(script);
8467
- return callback;
8468
- }
8469
- }
8470
-
8471
- var $interpolateMinErr = angular.$interpolateMinErr = minErr('$interpolate');
8472
- $interpolateMinErr.throwNoconcat = function(text) {
8473
- throw $interpolateMinErr('noconcat',
8474
- 'Error while interpolating: {0}\nStrict Contextual Escaping disallows ' +
8475
- 'interpolations that concatenate multiple expressions when a trusted value is ' +
8476
- 'required. See http://docs.angularjs.org/api/ng.$sce', text);
8477
- };
8478
-
8479
- $interpolateMinErr.interr = function(text, err) {
8480
- return $interpolateMinErr('interr', 'Can\'t interpolate: {0}\n{1}', text, err.toString());
8481
- };
8482
-
8483
- function $InterpolateProvider() {
8484
- var startSymbol = '{{';
8485
- var endSymbol = '}}';
8486
-
8487
- this.startSymbol = function(value) {
8488
- if (value) {
8489
- startSymbol = value;
8490
- return this;
8491
- } else {
8492
- return startSymbol;
8493
- }
8494
- };
8495
-
8496
- this.endSymbol = function(value) {
8497
- if (value) {
8498
- endSymbol = value;
8499
- return this;
8500
- } else {
8501
- return endSymbol;
8502
- }
8503
- };
8504
-
8505
-
8506
- this.$get = ['$parse', '$exceptionHandler', '$sce', function($parse, $exceptionHandler, $sce) {
8507
- var startSymbolLength = startSymbol.length,
8508
- endSymbolLength = endSymbol.length,
8509
- escapedStartRegexp = new RegExp(startSymbol.replace(/./g, escape), 'g'),
8510
- escapedEndRegexp = new RegExp(endSymbol.replace(/./g, escape), 'g');
8511
-
8512
- function escape(ch) {
8513
- return '\\\\\\' + ch;
8514
- }
8515
-
8516
- function unescapeText(text) {
8517
- return text.replace(escapedStartRegexp, startSymbol).
8518
- replace(escapedEndRegexp, endSymbol);
8519
- }
8520
-
8521
- function constantWatchDelegate(scope, listener, objectEquality, constantInterp) {
8522
- var unwatch = scope.$watch(function constantInterpolateWatch(scope) {
8523
- unwatch();
8524
- return constantInterp(scope);
8525
- }, listener, objectEquality);
8526
- return unwatch;
8527
- }
8528
-
8529
- function $interpolate(text, mustHaveExpression, trustedContext, allOrNothing) {
8530
- if (!text.length || text.indexOf(startSymbol) === -1) {
8531
- var constantInterp;
8532
- if (!mustHaveExpression) {
8533
- var unescapedText = unescapeText(text);
8534
- constantInterp = valueFn(unescapedText);
8535
- constantInterp.exp = text;
8536
- constantInterp.expressions = [];
8537
- constantInterp.$$watchDelegate = constantWatchDelegate;
8538
- }
8539
- return constantInterp;
8540
- }
8541
-
8542
- allOrNothing = !!allOrNothing;
8543
- var startIndex,
8544
- endIndex,
8545
- index = 0,
8546
- expressions = [],
8547
- parseFns = [],
8548
- textLength = text.length,
8549
- exp,
8550
- concat = [],
8551
- expressionPositions = [];
8552
-
8553
- while (index < textLength) {
8554
- if (((startIndex = text.indexOf(startSymbol, index)) !== -1) &&
8555
- ((endIndex = text.indexOf(endSymbol, startIndex + startSymbolLength)) !== -1)) {
8556
- if (index !== startIndex) {
8557
- concat.push(unescapeText(text.substring(index, startIndex)));
8558
- }
8559
- exp = text.substring(startIndex + startSymbolLength, endIndex);
8560
- expressions.push(exp);
8561
- parseFns.push($parse(exp, parseStringifyInterceptor));
8562
- index = endIndex + endSymbolLength;
8563
- expressionPositions.push(concat.length);
8564
- concat.push('');
8565
- } else {
8566
- if (index !== textLength) {
8567
- concat.push(unescapeText(text.substring(index)));
8568
- }
8569
- break;
8570
- }
8571
- }
8572
-
8573
- if (trustedContext && concat.length > 1) {
8574
- $interpolateMinErr.throwNoconcat(text);
8575
- }
8576
-
8577
- if (!mustHaveExpression || expressions.length) {
8578
- var compute = function(values) {
8579
- for (var i = 0, ii = expressions.length; i < ii; i++) {
8580
- if (allOrNothing && isUndefined(values[i])) return;
8581
- concat[expressionPositions[i]] = values[i];
8582
- }
8583
- return concat.join('');
8584
- };
8585
-
8586
- var getValue = function(value) {
8587
- return trustedContext ?
8588
- $sce.getTrusted(trustedContext, value) :
8589
- $sce.valueOf(value);
8590
- };
8591
-
8592
- return extend(function interpolationFn(context) {
8593
- var i = 0;
8594
- var ii = expressions.length;
8595
- var values = new Array(ii);
8596
-
8597
- try {
8598
- for (; i < ii; i++) {
8599
- values[i] = parseFns[i](context);
8600
- }
8601
-
8602
- return compute(values);
8603
- } catch (err) {
8604
- $exceptionHandler($interpolateMinErr.interr(text, err));
8605
- }
8606
-
8607
- }, {
8608
- exp: text,
8609
- expressions: expressions,
8610
- $$watchDelegate: function(scope, listener) {
8611
- var lastValue;
8612
- return scope.$watchGroup(parseFns, function interpolateFnWatcher(values, oldValues) {
8613
- var currValue = compute(values);
8614
- if (isFunction(listener)) {
8615
- listener.call(this, currValue, values !== oldValues ? lastValue : currValue, scope);
8616
- }
8617
- lastValue = currValue;
8618
- });
8619
- }
8620
- });
8621
- }
8622
-
8623
- function parseStringifyInterceptor(value) {
8624
- try {
8625
- value = getValue(value);
8626
- return allOrNothing && !isDefined(value) ? value : stringify(value);
8627
- } catch (err) {
8628
- $exceptionHandler($interpolateMinErr.interr(text, err));
8629
- }
8630
- }
8631
- }
8632
-
8633
-
8634
- $interpolate.startSymbol = function() {
8635
- return startSymbol;
8636
- };
8637
-
8638
-
8639
- $interpolate.endSymbol = function() {
8640
- return endSymbol;
8641
- };
8642
-
8643
- return $interpolate;
8644
- }];
8645
- }
8646
-
8647
- function $IntervalProvider() {
8648
- this.$get = ['$rootScope', '$window', '$q', '$$q', '$browser',
8649
- function($rootScope, $window, $q, $$q, $browser) {
8650
- var intervals = {};
8651
-
8652
-
8653
- function interval(fn, delay, count, invokeApply) {
8654
- var hasParams = arguments.length > 4,
8655
- args = hasParams ? sliceArgs(arguments, 4) : [],
8656
- setInterval = $window.setInterval,
8657
- clearInterval = $window.clearInterval,
8658
- iteration = 0,
8659
- skipApply = (isDefined(invokeApply) && !invokeApply),
8660
- deferred = (skipApply ? $$q : $q).defer(),
8661
- promise = deferred.promise;
8662
-
8663
- count = isDefined(count) ? count : 0;
8664
-
8665
- promise.$$intervalId = setInterval(function tick() {
8666
- if (skipApply) {
8667
- $browser.defer(callback);
8668
- } else {
8669
- $rootScope.$evalAsync(callback);
8670
- }
8671
- deferred.notify(iteration++);
8672
-
8673
- if (count > 0 && iteration >= count) {
8674
- deferred.resolve(iteration);
8675
- clearInterval(promise.$$intervalId);
8676
- delete intervals[promise.$$intervalId];
8677
- }
8678
-
8679
- if (!skipApply) $rootScope.$apply();
8680
-
8681
- }, delay);
8682
-
8683
- intervals[promise.$$intervalId] = deferred;
8684
-
8685
- return promise;
8686
-
8687
- function callback() {
8688
- if (!hasParams) {
8689
- fn(iteration);
8690
- } else {
8691
- fn.apply(null, args);
8692
- }
8693
- }
8694
- }
8695
-
8696
-
8697
- interval.cancel = function(promise) {
8698
- if (promise && promise.$$intervalId in intervals) {
8699
- intervals[promise.$$intervalId].promise.catch(noop);
8700
- intervals[promise.$$intervalId].reject('canceled');
8701
- $window.clearInterval(promise.$$intervalId);
8702
- delete intervals[promise.$$intervalId];
8703
- return true;
8704
- }
8705
- return false;
8706
- };
8707
-
8708
- return interval;
8709
- }];
8710
- }
8711
-
8712
- var $jsonpCallbacksProvider = function() {
8713
- this.$get = ['$window', function($window) {
8714
- var callbacks = $window.angular.callbacks;
8715
- var callbackMap = {};
8716
-
8717
- function createCallback(callbackId) {
8718
- var callback = function(data) {
8719
- callback.data = data;
8720
- callback.called = true;
8721
- };
8722
- callback.id = callbackId;
8723
- return callback;
8724
- }
8725
-
8726
- return {
8727
- createCallback: function(url) {
8728
- var callbackId = '_' + (callbacks.$$counter++).toString(36);
8729
- var callbackPath = 'angular.callbacks.' + callbackId;
8730
- var callback = createCallback(callbackId);
8731
- callbackMap[callbackPath] = callbacks[callbackId] = callback;
8732
- return callbackPath;
8733
- },
8734
- wasCalled: function(callbackPath) {
8735
- return callbackMap[callbackPath].called;
8736
- },
8737
- getResponse: function(callbackPath) {
8738
- return callbackMap[callbackPath].data;
8739
- },
8740
- removeCallback: function(callbackPath) {
8741
- var callback = callbackMap[callbackPath];
8742
- delete callbacks[callback.id];
8743
- delete callbackMap[callbackPath];
8744
- }
8745
- };
8746
- }];
8747
- };
8748
-
8749
-
8750
- var PATH_MATCH = /^([^?#]*)(\?([^#]*))?(#(.*))?$/,
8751
- DEFAULT_PORTS = {'http': 80, 'https': 443, 'ftp': 21};
8752
- var $locationMinErr = minErr('$location');
8753
-
8754
-
8755
- function encodePath(path) {
8756
- var segments = path.split('/'),
8757
- i = segments.length;
8758
-
8759
- while (i--) {
8760
- segments[i] = encodeUriSegment(segments[i]);
8761
- }
8762
-
8763
- return segments.join('/');
8764
- }
8765
-
8766
- function parseAbsoluteUrl(absoluteUrl, locationObj) {
8767
- var parsedUrl = urlResolve(absoluteUrl);
8768
-
8769
- locationObj.$$protocol = parsedUrl.protocol;
8770
- locationObj.$$host = parsedUrl.hostname;
8771
- locationObj.$$port = toInt(parsedUrl.port) || DEFAULT_PORTS[parsedUrl.protocol] || null;
8772
- }
8773
-
8774
- var DOUBLE_SLASH_REGEX = /^\s*[\\/]{2,}/;
8775
- function parseAppUrl(url, locationObj) {
8776
-
8777
- if (DOUBLE_SLASH_REGEX.test(url)) {
8778
- throw $locationMinErr('badpath', 'Invalid url "{0}".', url);
8779
- }
8780
-
8781
- var prefixed = (url.charAt(0) !== '/');
8782
- if (prefixed) {
8783
- url = '/' + url;
8784
- }
8785
- var match = urlResolve(url);
8786
- locationObj.$$path = decodeURIComponent(prefixed && match.pathname.charAt(0) === '/' ?
8787
- match.pathname.substring(1) : match.pathname);
8788
- locationObj.$$search = parseKeyValue(match.search);
8789
- locationObj.$$hash = decodeURIComponent(match.hash);
8790
-
8791
- if (locationObj.$$path && locationObj.$$path.charAt(0) !== '/') {
8792
- locationObj.$$path = '/' + locationObj.$$path;
8793
- }
8794
- }
8795
-
8796
- function startsWith(str, search) {
8797
- return str.slice(0, search.length) === search;
8798
- }
8799
-
8800
- function stripBaseUrl(base, url) {
8801
- if (startsWith(url, base)) {
8802
- return url.substr(base.length);
8803
- }
8804
- }
8805
-
8806
-
8807
- function stripHash(url) {
8808
- var index = url.indexOf('#');
8809
- return index === -1 ? url : url.substr(0, index);
8810
- }
8811
-
8812
- function trimEmptyHash(url) {
8813
- return url.replace(/(#.+)|#$/, '$1');
8814
- }
8815
-
8816
-
8817
- function stripFile(url) {
8818
- return url.substr(0, stripHash(url).lastIndexOf('/') + 1);
8819
- }
8820
-
8821
- function serverBase(url) {
8822
- return url.substring(0, url.indexOf('/', url.indexOf('//') + 2));
8823
- }
8824
-
8825
-
8826
- function LocationHtml5Url(appBase, appBaseNoFile, basePrefix) {
8827
- this.$$html5 = true;
8828
- basePrefix = basePrefix || '';
8829
- parseAbsoluteUrl(appBase, this);
8830
-
8831
-
8832
- this.$$parse = function(url) {
8833
- var pathUrl = stripBaseUrl(appBaseNoFile, url);
8834
- if (!isString(pathUrl)) {
8835
- throw $locationMinErr('ipthprfx', 'Invalid url "{0}", missing path prefix "{1}".', url,
8836
- appBaseNoFile);
8837
- }
8838
-
8839
- parseAppUrl(pathUrl, this);
8840
-
8841
- if (!this.$$path) {
8842
- this.$$path = '/';
8843
- }
8844
-
8845
- this.$$compose();
8846
- };
8847
-
8848
- this.$$compose = function() {
8849
- var search = toKeyValue(this.$$search),
8850
- hash = this.$$hash ? '#' + encodeUriSegment(this.$$hash) : '';
8851
-
8852
- this.$$url = encodePath(this.$$path) + (search ? '?' + search : '') + hash;
8853
- this.$$absUrl = appBaseNoFile + this.$$url.substr(1);
8854
- };
8855
-
8856
- this.$$parseLinkUrl = function(url, relHref) {
8857
- if (relHref && relHref[0] === '#') {
8858
- this.hash(relHref.slice(1));
8859
- return true;
8860
- }
8861
- var appUrl, prevAppUrl;
8862
- var rewrittenUrl;
8863
-
8864
-
8865
- if (isDefined(appUrl = stripBaseUrl(appBase, url))) {
8866
- prevAppUrl = appUrl;
8867
- if (basePrefix && isDefined(appUrl = stripBaseUrl(basePrefix, appUrl))) {
8868
- rewrittenUrl = appBaseNoFile + (stripBaseUrl('/', appUrl) || appUrl);
8869
- } else {
8870
- rewrittenUrl = appBase + prevAppUrl;
8871
- }
8872
- } else if (isDefined(appUrl = stripBaseUrl(appBaseNoFile, url))) {
8873
- rewrittenUrl = appBaseNoFile + appUrl;
8874
- } else if (appBaseNoFile === url + '/') {
8875
- rewrittenUrl = appBaseNoFile;
8876
- }
8877
- if (rewrittenUrl) {
8878
- this.$$parse(rewrittenUrl);
8879
- }
8880
- return !!rewrittenUrl;
8881
- };
8882
- }
8883
-
8884
-
8885
- function LocationHashbangUrl(appBase, appBaseNoFile, hashPrefix) {
8886
-
8887
- parseAbsoluteUrl(appBase, this);
8888
-
8889
-
8890
- this.$$parse = function(url) {
8891
- var withoutBaseUrl = stripBaseUrl(appBase, url) || stripBaseUrl(appBaseNoFile, url);
8892
- var withoutHashUrl;
8893
-
8894
- if (!isUndefined(withoutBaseUrl) && withoutBaseUrl.charAt(0) === '#') {
8895
-
8896
- withoutHashUrl = stripBaseUrl(hashPrefix, withoutBaseUrl);
8897
- if (isUndefined(withoutHashUrl)) {
8898
- withoutHashUrl = withoutBaseUrl;
8899
- }
8900
-
8901
- } else {
8902
- if (this.$$html5) {
8903
- withoutHashUrl = withoutBaseUrl;
8904
- } else {
8905
- withoutHashUrl = '';
8906
- if (isUndefined(withoutBaseUrl)) {
8907
- appBase = url;
8908
- this.replace();
8909
- }
8910
- }
8911
- }
8912
-
8913
- parseAppUrl(withoutHashUrl, this);
8914
-
8915
- this.$$path = removeWindowsDriveName(this.$$path, withoutHashUrl, appBase);
8916
-
8917
- this.$$compose();
8918
-
8919
- function removeWindowsDriveName(path, url, base) {
8920
- var windowsFilePathExp = /^\/[A-Z]:(\/.*)/;
8921
-
8922
- var firstPathSegmentMatch;
8923
-
8924
- if (startsWith(url, base)) {
8925
- url = url.replace(base, '');
8926
- }
8927
-
8928
- if (windowsFilePathExp.exec(url)) {
8929
- return path;
8930
- }
8931
-
8932
- firstPathSegmentMatch = windowsFilePathExp.exec(path);
8933
- return firstPathSegmentMatch ? firstPathSegmentMatch[1] : path;
8934
- }
8935
- };
8936
-
8937
- this.$$compose = function() {
8938
- var search = toKeyValue(this.$$search),
8939
- hash = this.$$hash ? '#' + encodeUriSegment(this.$$hash) : '';
8940
-
8941
- this.$$url = encodePath(this.$$path) + (search ? '?' + search : '') + hash;
8942
- this.$$absUrl = appBase + (this.$$url ? hashPrefix + this.$$url : '');
8943
- };
8944
-
8945
- this.$$parseLinkUrl = function(url, relHref) {
8946
- if (stripHash(appBase) === stripHash(url)) {
8947
- this.$$parse(url);
8948
- return true;
8949
- }
8950
- return false;
8951
- };
8952
- }
8953
-
8954
-
8955
- function LocationHashbangInHtml5Url(appBase, appBaseNoFile, hashPrefix) {
8956
- this.$$html5 = true;
8957
- LocationHashbangUrl.apply(this, arguments);
8958
-
8959
- this.$$parseLinkUrl = function(url, relHref) {
8960
- if (relHref && relHref[0] === '#') {
8961
- this.hash(relHref.slice(1));
8962
- return true;
8963
- }
8964
-
8965
- var rewrittenUrl;
8966
- var appUrl;
8967
-
8968
- if (appBase === stripHash(url)) {
8969
- rewrittenUrl = url;
8970
- } else if ((appUrl = stripBaseUrl(appBaseNoFile, url))) {
8971
- rewrittenUrl = appBase + hashPrefix + appUrl;
8972
- } else if (appBaseNoFile === url + '/') {
8973
- rewrittenUrl = appBaseNoFile;
8974
- }
8975
- if (rewrittenUrl) {
8976
- this.$$parse(rewrittenUrl);
8977
- }
8978
- return !!rewrittenUrl;
8979
- };
8980
-
8981
- this.$$compose = function() {
8982
- var search = toKeyValue(this.$$search),
8983
- hash = this.$$hash ? '#' + encodeUriSegment(this.$$hash) : '';
8984
-
8985
- this.$$url = encodePath(this.$$path) + (search ? '?' + search : '') + hash;
8986
- this.$$absUrl = appBase + hashPrefix + this.$$url;
8987
- };
8988
-
8989
- }
8990
-
8991
-
8992
- var locationPrototype = {
8993
-
8994
- $$absUrl:'',
8995
-
8996
- $$html5: false,
8997
-
8998
- $$replace: false,
8999
-
9000
- absUrl: locationGetter('$$absUrl'),
9001
-
9002
- url: function(url) {
9003
- if (isUndefined(url)) {
9004
- return this.$$url;
9005
- }
9006
-
9007
- var match = PATH_MATCH.exec(url);
9008
- if (match[1] || url === '') this.path(decodeURIComponent(match[1]));
9009
- if (match[2] || match[1] || url === '') this.search(match[3] || '');
9010
- this.hash(match[5] || '');
9011
-
9012
- return this;
9013
- },
9014
-
9015
- protocol: locationGetter('$$protocol'),
9016
-
9017
- host: locationGetter('$$host'),
9018
-
9019
- port: locationGetter('$$port'),
9020
-
9021
- path: locationGetterSetter('$$path', function(path) {
9022
- path = path !== null ? path.toString() : '';
9023
- return path.charAt(0) === '/' ? path : '/' + path;
9024
- }),
9025
-
9026
- search: function(search, paramValue) {
9027
- switch (arguments.length) {
9028
- case 0:
9029
- return this.$$search;
9030
- case 1:
9031
- if (isString(search) || isNumber(search)) {
9032
- search = search.toString();
9033
- this.$$search = parseKeyValue(search);
9034
- } else if (isObject(search)) {
9035
- search = copy(search, {});
9036
- forEach(search, function(value, key) {
9037
- if (value == null) delete search[key];
9038
- });
9039
-
9040
- this.$$search = search;
9041
- } else {
9042
- throw $locationMinErr('isrcharg',
9043
- 'The first argument of the `$location#search()` call must be a string or an object.');
9044
- }
9045
- break;
9046
- default:
9047
- if (isUndefined(paramValue) || paramValue === null) {
9048
- delete this.$$search[search];
9049
- } else {
9050
- this.$$search[search] = paramValue;
9051
- }
9052
- }
9053
-
9054
- this.$$compose();
9055
- return this;
9056
- },
9057
-
9058
- hash: locationGetterSetter('$$hash', function(hash) {
9059
- return hash !== null ? hash.toString() : '';
9060
- }),
9061
-
9062
- replace: function() {
9063
- this.$$replace = true;
9064
- return this;
9065
- }
9066
- };
9067
-
9068
- forEach([LocationHashbangInHtml5Url, LocationHashbangUrl, LocationHtml5Url], function(Location) {
9069
- Location.prototype = Object.create(locationPrototype);
9070
-
9071
- Location.prototype.state = function(state) {
9072
- if (!arguments.length) {
9073
- return this.$$state;
9074
- }
9075
-
9076
- if (Location !== LocationHtml5Url || !this.$$html5) {
9077
- throw $locationMinErr('nostate', 'History API state support is available only ' +
9078
- 'in HTML5 mode and only in browsers supporting HTML5 History API');
9079
- }
9080
- this.$$state = isUndefined(state) ? null : state;
9081
-
9082
- return this;
9083
- };
9084
- });
9085
-
9086
-
9087
- function locationGetter(property) {
9088
- return function() {
9089
- return this[property];
9090
- };
9091
- }
9092
-
9093
-
9094
- function locationGetterSetter(property, preprocess) {
9095
- return function(value) {
9096
- if (isUndefined(value)) {
9097
- return this[property];
9098
- }
9099
-
9100
- this[property] = preprocess(value);
9101
- this.$$compose();
9102
-
9103
- return this;
9104
- };
9105
- }
9106
-
9107
-
9108
-
9109
- function $LocationProvider() {
9110
- var hashPrefix = '!',
9111
- html5Mode = {
9112
- enabled: false,
9113
- requireBase: true,
9114
- rewriteLinks: true
9115
- };
9116
-
9117
- this.hashPrefix = function(prefix) {
9118
- if (isDefined(prefix)) {
9119
- hashPrefix = prefix;
9120
- return this;
9121
- } else {
9122
- return hashPrefix;
9123
- }
9124
- };
9125
-
9126
- this.html5Mode = function(mode) {
9127
- if (isBoolean(mode)) {
9128
- html5Mode.enabled = mode;
9129
- return this;
9130
- } else if (isObject(mode)) {
9131
-
9132
- if (isBoolean(mode.enabled)) {
9133
- html5Mode.enabled = mode.enabled;
9134
- }
9135
-
9136
- if (isBoolean(mode.requireBase)) {
9137
- html5Mode.requireBase = mode.requireBase;
9138
- }
9139
-
9140
- if (isBoolean(mode.rewriteLinks) || isString(mode.rewriteLinks)) {
9141
- html5Mode.rewriteLinks = mode.rewriteLinks;
9142
- }
9143
-
9144
- return this;
9145
- } else {
9146
- return html5Mode;
9147
- }
9148
- };
9149
-
9150
-
9151
-
9152
- this.$get = ['$rootScope', '$browser', '$sniffer', '$rootElement', '$window',
9153
- function($rootScope, $browser, $sniffer, $rootElement, $window) {
9154
- var $location,
9155
- LocationMode,
9156
- baseHref = $browser.baseHref(),
9157
- initialUrl = $browser.url(),
9158
- appBase;
9159
-
9160
- if (html5Mode.enabled) {
9161
- if (!baseHref && html5Mode.requireBase) {
9162
- throw $locationMinErr('nobase',
9163
- '$location in HTML5 mode requires a <base> tag to be present!');
9164
- }
9165
- appBase = serverBase(initialUrl) + (baseHref || '/');
9166
- LocationMode = $sniffer.history ? LocationHtml5Url : LocationHashbangInHtml5Url;
9167
- } else {
9168
- appBase = stripHash(initialUrl);
9169
- LocationMode = LocationHashbangUrl;
9170
- }
9171
- var appBaseNoFile = stripFile(appBase);
9172
-
9173
- $location = new LocationMode(appBase, appBaseNoFile, '#' + hashPrefix);
9174
- $location.$$parseLinkUrl(initialUrl, initialUrl);
9175
-
9176
- $location.$$state = $browser.state();
9177
-
9178
- var IGNORE_URI_REGEXP = /^\s*(javascript|mailto):/i;
9179
-
9180
- function setBrowserUrlWithFallback(url, replace, state) {
9181
- var oldUrl = $location.url();
9182
- var oldState = $location.$$state;
9183
- try {
9184
- $browser.url(url, replace, state);
9185
-
9186
- $location.$$state = $browser.state();
9187
- } catch (e) {
9188
- $location.url(oldUrl);
9189
- $location.$$state = oldState;
9190
-
9191
- throw e;
9192
- }
9193
- }
9194
-
9195
- $rootElement.on('click', function(event) {
9196
- var rewriteLinks = html5Mode.rewriteLinks;
9197
-
9198
- if (!rewriteLinks || event.ctrlKey || event.metaKey || event.shiftKey || event.which === 2 || event.button === 2) return;
9199
-
9200
- var elm = jqLite(event.target);
9201
-
9202
- while (nodeName_(elm[0]) !== 'a') {
9203
- if (elm[0] === $rootElement[0] || !(elm = elm.parent())[0]) return;
9204
- }
9205
-
9206
- if (isString(rewriteLinks) && isUndefined(elm.attr(rewriteLinks))) return;
9207
-
9208
- var absHref = elm.prop('href');
9209
- var relHref = elm.attr('href') || elm.attr('xlink:href');
9210
-
9211
- if (isObject(absHref) && absHref.toString() === '[object SVGAnimatedString]') {
9212
- absHref = urlResolve(absHref.animVal).href;
9213
- }
9214
-
9215
- if (IGNORE_URI_REGEXP.test(absHref)) return;
9216
-
9217
- if (absHref && !elm.attr('target') && !event.isDefaultPrevented()) {
9218
- if ($location.$$parseLinkUrl(absHref, relHref)) {
9219
- event.preventDefault();
9220
- if ($location.absUrl() !== $browser.url()) {
9221
- $rootScope.$apply();
9222
- $window.angular['ff-684208-preventDefault'] = true;
9223
- }
9224
- }
9225
- }
9226
- });
9227
-
9228
-
9229
- if (trimEmptyHash($location.absUrl()) !== trimEmptyHash(initialUrl)) {
9230
- $browser.url($location.absUrl(), true);
9231
- }
9232
-
9233
- var initializing = true;
9234
-
9235
- $browser.onUrlChange(function(newUrl, newState) {
9236
-
9237
- if (!startsWith(newUrl, appBaseNoFile)) {
9238
- $window.location.href = newUrl;
9239
- return;
9240
- }
9241
-
9242
- $rootScope.$evalAsync(function() {
9243
- var oldUrl = $location.absUrl();
9244
- var oldState = $location.$$state;
9245
- var defaultPrevented;
9246
- newUrl = trimEmptyHash(newUrl);
9247
- $location.$$parse(newUrl);
9248
- $location.$$state = newState;
9249
-
9250
- defaultPrevented = $rootScope.$broadcast('$locationChangeStart', newUrl, oldUrl,
9251
- newState, oldState).defaultPrevented;
9252
-
9253
- if ($location.absUrl() !== newUrl) return;
9254
-
9255
- if (defaultPrevented) {
9256
- $location.$$parse(oldUrl);
9257
- $location.$$state = oldState;
9258
- setBrowserUrlWithFallback(oldUrl, false, oldState);
9259
- } else {
9260
- initializing = false;
9261
- afterLocationChange(oldUrl, oldState);
9262
- }
9263
- });
9264
- if (!$rootScope.$$phase) $rootScope.$digest();
9265
- });
9266
-
9267
- $rootScope.$watch(function $locationWatch() {
9268
- var oldUrl = trimEmptyHash($browser.url());
9269
- var newUrl = trimEmptyHash($location.absUrl());
9270
- var oldState = $browser.state();
9271
- var currentReplace = $location.$$replace;
9272
- var urlOrStateChanged = oldUrl !== newUrl ||
9273
- ($location.$$html5 && $sniffer.history && oldState !== $location.$$state);
9274
-
9275
- if (initializing || urlOrStateChanged) {
9276
- initializing = false;
9277
-
9278
- $rootScope.$evalAsync(function() {
9279
- var newUrl = $location.absUrl();
9280
- var defaultPrevented = $rootScope.$broadcast('$locationChangeStart', newUrl, oldUrl,
9281
- $location.$$state, oldState).defaultPrevented;
9282
-
9283
- if ($location.absUrl() !== newUrl) return;
9284
-
9285
- if (defaultPrevented) {
9286
- $location.$$parse(oldUrl);
9287
- $location.$$state = oldState;
9288
- } else {
9289
- if (urlOrStateChanged) {
9290
- setBrowserUrlWithFallback(newUrl, currentReplace,
9291
- oldState === $location.$$state ? null : $location.$$state);
9292
- }
9293
- afterLocationChange(oldUrl, oldState);
9294
- }
9295
- });
9296
- }
9297
-
9298
- $location.$$replace = false;
9299
-
9300
- });
9301
-
9302
- return $location;
9303
-
9304
- function afterLocationChange(oldUrl, oldState) {
9305
- $rootScope.$broadcast('$locationChangeSuccess', $location.absUrl(), oldUrl,
9306
- $location.$$state, oldState);
9307
- }
9308
- }];
9309
- }
9310
-
9311
-
9312
- function $LogProvider() {
9313
- var debug = true,
9314
- self = this;
9315
-
9316
- this.debugEnabled = function(flag) {
9317
- if (isDefined(flag)) {
9318
- debug = flag;
9319
- return this;
9320
- } else {
9321
- return debug;
9322
- }
9323
- };
9324
-
9325
- this.$get = ['$window', function($window) {
9326
- return {
9327
- log: consoleLog('log'),
9328
-
9329
- info: consoleLog('info'),
9330
-
9331
- warn: consoleLog('warn'),
9332
-
9333
- error: consoleLog('error'),
9334
-
9335
- debug: (function() {
9336
- var fn = consoleLog('debug');
9337
-
9338
- return function() {
9339
- if (debug) {
9340
- fn.apply(self, arguments);
9341
- }
9342
- };
9343
- })()
9344
- };
9345
-
9346
- function formatError(arg) {
9347
- if (arg instanceof Error) {
9348
- if (arg.stack) {
9349
- arg = (arg.message && arg.stack.indexOf(arg.message) === -1)
9350
- ? 'Error: ' + arg.message + '\n' + arg.stack
9351
- : arg.stack;
9352
- } else if (arg.sourceURL) {
9353
- arg = arg.message + '\n' + arg.sourceURL + ':' + arg.line;
9354
- }
9355
- }
9356
- return arg;
9357
- }
9358
-
9359
- function consoleLog(type) {
9360
- var console = $window.console || {},
9361
- logFn = console[type] || console.log || noop,
9362
- hasApply = false;
9363
-
9364
- try {
9365
- hasApply = !!logFn.apply;
9366
- } catch (e) { }
9367
-
9368
- if (hasApply) {
9369
- return function() {
9370
- var args = [];
9371
- forEach(arguments, function(arg) {
9372
- args.push(formatError(arg));
9373
- });
9374
- return logFn.apply(console, args);
9375
- };
9376
- }
9377
-
9378
- return function(arg1, arg2) {
9379
- logFn(arg1, arg2 == null ? '' : arg2);
9380
- };
9381
- }
9382
- }];
9383
- }
9384
-
9385
-
9386
- var $parseMinErr = minErr('$parse');
9387
-
9388
- var objectValueOf = {}.constructor.prototype.valueOf;
9389
-
9390
-
9391
-
9392
- function getStringValue(name) {
9393
- return name + '';
9394
- }
9395
-
9396
-
9397
- var OPERATORS = createMap();
9398
- forEach('+ - * / % === !== == != < > <= >= && || ! = |'.split(' '), function(operator) { OPERATORS[operator] = true; });
9399
- var ESCAPE = {'n':'\n', 'f':'\f', 'r':'\r', 't':'\t', 'v':'\v', '\'':'\'', '"':'"'};
9400
-
9401
-
9402
-
9403
-
9404
- var Lexer = function Lexer(options) {
9405
- this.options = options;
9406
- };
9407
-
9408
- Lexer.prototype = {
9409
- constructor: Lexer,
9410
-
9411
- lex: function(text) {
9412
- this.text = text;
9413
- this.index = 0;
9414
- this.tokens = [];
9415
-
9416
- while (this.index < this.text.length) {
9417
- var ch = this.text.charAt(this.index);
9418
- if (ch === '"' || ch === '\'') {
9419
- this.readString(ch);
9420
- } else if (this.isNumber(ch) || ch === '.' && this.isNumber(this.peek())) {
9421
- this.readNumber();
9422
- } else if (this.isIdentifierStart(this.peekMultichar())) {
9423
- this.readIdent();
9424
- } else if (this.is(ch, '(){}[].,;:?')) {
9425
- this.tokens.push({index: this.index, text: ch});
9426
- this.index++;
9427
- } else if (this.isWhitespace(ch)) {
9428
- this.index++;
9429
- } else {
9430
- var ch2 = ch + this.peek();
9431
- var ch3 = ch2 + this.peek(2);
9432
- var op1 = OPERATORS[ch];
9433
- var op2 = OPERATORS[ch2];
9434
- var op3 = OPERATORS[ch3];
9435
- if (op1 || op2 || op3) {
9436
- var token = op3 ? ch3 : (op2 ? ch2 : ch);
9437
- this.tokens.push({index: this.index, text: token, operator: true});
9438
- this.index += token.length;
9439
- } else {
9440
- this.throwError('Unexpected next character ', this.index, this.index + 1);
9441
- }
9442
- }
9443
- }
9444
- return this.tokens;
9445
- },
9446
-
9447
- is: function(ch, chars) {
9448
- return chars.indexOf(ch) !== -1;
9449
- },
9450
-
9451
- peek: function(i) {
9452
- var num = i || 1;
9453
- return (this.index + num < this.text.length) ? this.text.charAt(this.index + num) : false;
9454
- },
9455
-
9456
- isNumber: function(ch) {
9457
- return ('0' <= ch && ch <= '9') && typeof ch === 'string';
9458
- },
9459
-
9460
- isWhitespace: function(ch) {
9461
- return (ch === ' ' || ch === '\r' || ch === '\t' ||
9462
- ch === '\n' || ch === '\v' || ch === '\u00A0');
9463
- },
9464
-
9465
- isIdentifierStart: function(ch) {
9466
- return this.options.isIdentifierStart ?
9467
- this.options.isIdentifierStart(ch, this.codePointAt(ch)) :
9468
- this.isValidIdentifierStart(ch);
9469
- },
9470
-
9471
- isValidIdentifierStart: function(ch) {
9472
- return ('a' <= ch && ch <= 'z' ||
9473
- 'A' <= ch && ch <= 'Z' ||
9474
- '_' === ch || ch === '$');
9475
- },
9476
-
9477
- isIdentifierContinue: function(ch) {
9478
- return this.options.isIdentifierContinue ?
9479
- this.options.isIdentifierContinue(ch, this.codePointAt(ch)) :
9480
- this.isValidIdentifierContinue(ch);
9481
- },
9482
-
9483
- isValidIdentifierContinue: function(ch, cp) {
9484
- return this.isValidIdentifierStart(ch, cp) || this.isNumber(ch);
9485
- },
9486
-
9487
- codePointAt: function(ch) {
9488
- if (ch.length === 1) return ch.charCodeAt(0);
9489
- return (ch.charCodeAt(0) << 10) + ch.charCodeAt(1) - 0x35FDC00;
9490
- },
9491
-
9492
- peekMultichar: function() {
9493
- var ch = this.text.charAt(this.index);
9494
- var peek = this.peek();
9495
- if (!peek) {
9496
- return ch;
9497
- }
9498
- var cp1 = ch.charCodeAt(0);
9499
- var cp2 = peek.charCodeAt(0);
9500
- if (cp1 >= 0xD800 && cp1 <= 0xDBFF && cp2 >= 0xDC00 && cp2 <= 0xDFFF) {
9501
- return ch + peek;
9502
- }
9503
- return ch;
9504
- },
9505
-
9506
- isExpOperator: function(ch) {
9507
- return (ch === '-' || ch === '+' || this.isNumber(ch));
9508
- },
9509
-
9510
- throwError: function(error, start, end) {
9511
- end = end || this.index;
9512
- var colStr = (isDefined(start)
9513
- ? 's ' + start + '-' + this.index + ' [' + this.text.substring(start, end) + ']'
9514
- : ' ' + end);
9515
- throw $parseMinErr('lexerr', 'Lexer Error: {0} at column{1} in expression [{2}].',
9516
- error, colStr, this.text);
9517
- },
9518
-
9519
- readNumber: function() {
9520
- var number = '';
9521
- var start = this.index;
9522
- while (this.index < this.text.length) {
9523
- var ch = lowercase(this.text.charAt(this.index));
9524
- if (ch === '.' || this.isNumber(ch)) {
9525
- number += ch;
9526
- } else {
9527
- var peekCh = this.peek();
9528
- if (ch === 'e' && this.isExpOperator(peekCh)) {
9529
- number += ch;
9530
- } else if (this.isExpOperator(ch) &&
9531
- peekCh && this.isNumber(peekCh) &&
9532
- number.charAt(number.length - 1) === 'e') {
9533
- number += ch;
9534
- } else if (this.isExpOperator(ch) &&
9535
- (!peekCh || !this.isNumber(peekCh)) &&
9536
- number.charAt(number.length - 1) === 'e') {
9537
- this.throwError('Invalid exponent');
9538
- } else {
9539
- break;
9540
- }
9541
- }
9542
- this.index++;
9543
- }
9544
- this.tokens.push({
9545
- index: start,
9546
- text: number,
9547
- constant: true,
9548
- value: Number(number)
9549
- });
9550
- },
9551
-
9552
- readIdent: function() {
9553
- var start = this.index;
9554
- this.index += this.peekMultichar().length;
9555
- while (this.index < this.text.length) {
9556
- var ch = this.peekMultichar();
9557
- if (!this.isIdentifierContinue(ch)) {
9558
- break;
9559
- }
9560
- this.index += ch.length;
9561
- }
9562
- this.tokens.push({
9563
- index: start,
9564
- text: this.text.slice(start, this.index),
9565
- identifier: true
9566
- });
9567
- },
9568
-
9569
- readString: function(quote) {
9570
- var start = this.index;
9571
- this.index++;
9572
- var string = '';
9573
- var rawString = quote;
9574
- var escape = false;
9575
- while (this.index < this.text.length) {
9576
- var ch = this.text.charAt(this.index);
9577
- rawString += ch;
9578
- if (escape) {
9579
- if (ch === 'u') {
9580
- var hex = this.text.substring(this.index + 1, this.index + 5);
9581
- if (!hex.match(/[\da-f]{4}/i)) {
9582
- this.throwError('Invalid unicode escape [\\u' + hex + ']');
9583
- }
9584
- this.index += 4;
9585
- string += String.fromCharCode(parseInt(hex, 16));
9586
- } else {
9587
- var rep = ESCAPE[ch];
9588
- string = string + (rep || ch);
9589
- }
9590
- escape = false;
9591
- } else if (ch === '\\') {
9592
- escape = true;
9593
- } else if (ch === quote) {
9594
- this.index++;
9595
- this.tokens.push({
9596
- index: start,
9597
- text: rawString,
9598
- constant: true,
9599
- value: string
9600
- });
9601
- return;
9602
- } else {
9603
- string += ch;
9604
- }
9605
- this.index++;
9606
- }
9607
- this.throwError('Unterminated quote', start);
9608
- }
9609
- };
9610
-
9611
- var AST = function AST(lexer, options) {
9612
- this.lexer = lexer;
9613
- this.options = options;
9614
- };
9615
-
9616
- AST.Program = 'Program';
9617
- AST.ExpressionStatement = 'ExpressionStatement';
9618
- AST.AssignmentExpression = 'AssignmentExpression';
9619
- AST.ConditionalExpression = 'ConditionalExpression';
9620
- AST.LogicalExpression = 'LogicalExpression';
9621
- AST.BinaryExpression = 'BinaryExpression';
9622
- AST.UnaryExpression = 'UnaryExpression';
9623
- AST.CallExpression = 'CallExpression';
9624
- AST.MemberExpression = 'MemberExpression';
9625
- AST.Identifier = 'Identifier';
9626
- AST.Literal = 'Literal';
9627
- AST.ArrayExpression = 'ArrayExpression';
9628
- AST.Property = 'Property';
9629
- AST.ObjectExpression = 'ObjectExpression';
9630
- AST.ThisExpression = 'ThisExpression';
9631
- AST.LocalsExpression = 'LocalsExpression';
9632
-
9633
- AST.NGValueParameter = 'NGValueParameter';
9634
-
9635
- AST.prototype = {
9636
- ast: function(text) {
9637
- this.text = text;
9638
- this.tokens = this.lexer.lex(text);
9639
-
9640
- var value = this.program();
9641
-
9642
- if (this.tokens.length !== 0) {
9643
- this.throwError('is an unexpected token', this.tokens[0]);
9644
- }
9645
-
9646
- return value;
9647
- },
9648
-
9649
- program: function() {
9650
- var body = [];
9651
- while (true) {
9652
- if (this.tokens.length > 0 && !this.peek('}', ')', ';', ']'))
9653
- body.push(this.expressionStatement());
9654
- if (!this.expect(';')) {
9655
- return { type: AST.Program, body: body};
9656
- }
9657
- }
9658
- },
9659
-
9660
- expressionStatement: function() {
9661
- return { type: AST.ExpressionStatement, expression: this.filterChain() };
9662
- },
9663
-
9664
- filterChain: function() {
9665
- var left = this.expression();
9666
- while (this.expect('|')) {
9667
- left = this.filter(left);
9668
- }
9669
- return left;
9670
- },
9671
-
9672
- expression: function() {
9673
- return this.assignment();
9674
- },
9675
-
9676
- assignment: function() {
9677
- var result = this.ternary();
9678
- if (this.expect('=')) {
9679
- if (!isAssignable(result)) {
9680
- throw $parseMinErr('lval', 'Trying to assign a value to a non l-value');
9681
- }
9682
-
9683
- result = { type: AST.AssignmentExpression, left: result, right: this.assignment(), operator: '='};
9684
- }
9685
- return result;
9686
- },
9687
-
9688
- ternary: function() {
9689
- var test = this.logicalOR();
9690
- var alternate;
9691
- var consequent;
9692
- if (this.expect('?')) {
9693
- alternate = this.expression();
9694
- if (this.consume(':')) {
9695
- consequent = this.expression();
9696
- return { type: AST.ConditionalExpression, test: test, alternate: alternate, consequent: consequent};
9697
- }
9698
- }
9699
- return test;
9700
- },
9701
-
9702
- logicalOR: function() {
9703
- var left = this.logicalAND();
9704
- while (this.expect('||')) {
9705
- left = { type: AST.LogicalExpression, operator: '||', left: left, right: this.logicalAND() };
9706
- }
9707
- return left;
9708
- },
9709
-
9710
- logicalAND: function() {
9711
- var left = this.equality();
9712
- while (this.expect('&&')) {
9713
- left = { type: AST.LogicalExpression, operator: '&&', left: left, right: this.equality()};
9714
- }
9715
- return left;
9716
- },
9717
-
9718
- equality: function() {
9719
- var left = this.relational();
9720
- var token;
9721
- while ((token = this.expect('==','!=','===','!=='))) {
9722
- left = { type: AST.BinaryExpression, operator: token.text, left: left, right: this.relational() };
9723
- }
9724
- return left;
9725
- },
9726
-
9727
- relational: function() {
9728
- var left = this.additive();
9729
- var token;
9730
- while ((token = this.expect('<', '>', '<=', '>='))) {
9731
- left = { type: AST.BinaryExpression, operator: token.text, left: left, right: this.additive() };
9732
- }
9733
- return left;
9734
- },
9735
-
9736
- additive: function() {
9737
- var left = this.multiplicative();
9738
- var token;
9739
- while ((token = this.expect('+','-'))) {
9740
- left = { type: AST.BinaryExpression, operator: token.text, left: left, right: this.multiplicative() };
9741
- }
9742
- return left;
9743
- },
9744
-
9745
- multiplicative: function() {
9746
- var left = this.unary();
9747
- var token;
9748
- while ((token = this.expect('*','/','%'))) {
9749
- left = { type: AST.BinaryExpression, operator: token.text, left: left, right: this.unary() };
9750
- }
9751
- return left;
9752
- },
9753
-
9754
- unary: function() {
9755
- var token;
9756
- if ((token = this.expect('+', '-', '!'))) {
9757
- return { type: AST.UnaryExpression, operator: token.text, prefix: true, argument: this.unary() };
9758
- } else {
9759
- return this.primary();
9760
- }
9761
- },
9762
-
9763
- primary: function() {
9764
- var primary;
9765
- if (this.expect('(')) {
9766
- primary = this.filterChain();
9767
- this.consume(')');
9768
- } else if (this.expect('[')) {
9769
- primary = this.arrayDeclaration();
9770
- } else if (this.expect('{')) {
9771
- primary = this.object();
9772
- } else if (this.selfReferential.hasOwnProperty(this.peek().text)) {
9773
- primary = copy(this.selfReferential[this.consume().text]);
9774
- } else if (this.options.literals.hasOwnProperty(this.peek().text)) {
9775
- primary = { type: AST.Literal, value: this.options.literals[this.consume().text]};
9776
- } else if (this.peek().identifier) {
9777
- primary = this.identifier();
9778
- } else if (this.peek().constant) {
9779
- primary = this.constant();
9780
- } else {
9781
- this.throwError('not a primary expression', this.peek());
9782
- }
9783
-
9784
- var next;
9785
- while ((next = this.expect('(', '[', '.'))) {
9786
- if (next.text === '(') {
9787
- primary = {type: AST.CallExpression, callee: primary, arguments: this.parseArguments() };
9788
- this.consume(')');
9789
- } else if (next.text === '[') {
9790
- primary = { type: AST.MemberExpression, object: primary, property: this.expression(), computed: true };
9791
- this.consume(']');
9792
- } else if (next.text === '.') {
9793
- primary = { type: AST.MemberExpression, object: primary, property: this.identifier(), computed: false };
9794
- } else {
9795
- this.throwError('IMPOSSIBLE');
9796
- }
9797
- }
9798
- return primary;
9799
- },
9800
-
9801
- filter: function(baseExpression) {
9802
- var args = [baseExpression];
9803
- var result = {type: AST.CallExpression, callee: this.identifier(), arguments: args, filter: true};
9804
-
9805
- while (this.expect(':')) {
9806
- args.push(this.expression());
9807
- }
9808
-
9809
- return result;
9810
- },
9811
-
9812
- parseArguments: function() {
9813
- var args = [];
9814
- if (this.peekToken().text !== ')') {
9815
- do {
9816
- args.push(this.filterChain());
9817
- } while (this.expect(','));
9818
- }
9819
- return args;
9820
- },
9821
-
9822
- identifier: function() {
9823
- var token = this.consume();
9824
- if (!token.identifier) {
9825
- this.throwError('is not a valid identifier', token);
9826
- }
9827
- return { type: AST.Identifier, name: token.text };
9828
- },
9829
-
9830
- constant: function() {
9831
- return { type: AST.Literal, value: this.consume().value };
9832
- },
9833
-
9834
- arrayDeclaration: function() {
9835
- var elements = [];
9836
- if (this.peekToken().text !== ']') {
9837
- do {
9838
- if (this.peek(']')) {
9839
- break;
9840
- }
9841
- elements.push(this.expression());
9842
- } while (this.expect(','));
9843
- }
9844
- this.consume(']');
9845
-
9846
- return { type: AST.ArrayExpression, elements: elements };
9847
- },
9848
-
9849
- object: function() {
9850
- var properties = [], property;
9851
- if (this.peekToken().text !== '}') {
9852
- do {
9853
- if (this.peek('}')) {
9854
- break;
9855
- }
9856
- property = {type: AST.Property, kind: 'init'};
9857
- if (this.peek().constant) {
9858
- property.key = this.constant();
9859
- property.computed = false;
9860
- this.consume(':');
9861
- property.value = this.expression();
9862
- } else if (this.peek().identifier) {
9863
- property.key = this.identifier();
9864
- property.computed = false;
9865
- if (this.peek(':')) {
9866
- this.consume(':');
9867
- property.value = this.expression();
9868
- } else {
9869
- property.value = property.key;
9870
- }
9871
- } else if (this.peek('[')) {
9872
- this.consume('[');
9873
- property.key = this.expression();
9874
- this.consume(']');
9875
- property.computed = true;
9876
- this.consume(':');
9877
- property.value = this.expression();
9878
- } else {
9879
- this.throwError('invalid key', this.peek());
9880
- }
9881
- properties.push(property);
9882
- } while (this.expect(','));
9883
- }
9884
- this.consume('}');
9885
-
9886
- return {type: AST.ObjectExpression, properties: properties };
9887
- },
9888
-
9889
- throwError: function(msg, token) {
9890
- throw $parseMinErr('syntax',
9891
- 'Syntax Error: Token \'{0}\' {1} at column {2} of the expression [{3}] starting at [{4}].',
9892
- token.text, msg, (token.index + 1), this.text, this.text.substring(token.index));
9893
- },
9894
-
9895
- consume: function(e1) {
9896
- if (this.tokens.length === 0) {
9897
- throw $parseMinErr('ueoe', 'Unexpected end of expression: {0}', this.text);
9898
- }
9899
-
9900
- var token = this.expect(e1);
9901
- if (!token) {
9902
- this.throwError('is unexpected, expecting [' + e1 + ']', this.peek());
9903
- }
9904
- return token;
9905
- },
9906
-
9907
- peekToken: function() {
9908
- if (this.tokens.length === 0) {
9909
- throw $parseMinErr('ueoe', 'Unexpected end of expression: {0}', this.text);
9910
- }
9911
- return this.tokens[0];
9912
- },
9913
-
9914
- peek: function(e1, e2, e3, e4) {
9915
- return this.peekAhead(0, e1, e2, e3, e4);
9916
- },
9917
-
9918
- peekAhead: function(i, e1, e2, e3, e4) {
9919
- if (this.tokens.length > i) {
9920
- var token = this.tokens[i];
9921
- var t = token.text;
9922
- if (t === e1 || t === e2 || t === e3 || t === e4 ||
9923
- (!e1 && !e2 && !e3 && !e4)) {
9924
- return token;
9925
- }
9926
- }
9927
- return false;
9928
- },
9929
-
9930
- expect: function(e1, e2, e3, e4) {
9931
- var token = this.peek(e1, e2, e3, e4);
9932
- if (token) {
9933
- this.tokens.shift();
9934
- return token;
9935
- }
9936
- return false;
9937
- },
9938
-
9939
- selfReferential: {
9940
- 'this': {type: AST.ThisExpression },
9941
- '$locals': {type: AST.LocalsExpression }
9942
- }
9943
- };
9944
-
9945
- function ifDefined(v, d) {
9946
- return typeof v !== 'undefined' ? v : d;
9947
- }
9948
-
9949
- function plusFn(l, r) {
9950
- if (typeof l === 'undefined') return r;
9951
- if (typeof r === 'undefined') return l;
9952
- return l + r;
9953
- }
9954
-
9955
- function isStateless($filter, filterName) {
9956
- var fn = $filter(filterName);
9957
- return !fn.$stateful;
9958
- }
9959
-
9960
- function findConstantAndWatchExpressions(ast, $filter) {
9961
- var allConstants;
9962
- var argsToWatch;
9963
- var isStatelessFilter;
9964
- switch (ast.type) {
9965
- case AST.Program:
9966
- allConstants = true;
9967
- forEach(ast.body, function(expr) {
9968
- findConstantAndWatchExpressions(expr.expression, $filter);
9969
- allConstants = allConstants && expr.expression.constant;
9970
- });
9971
- ast.constant = allConstants;
9972
- break;
9973
- case AST.Literal:
9974
- ast.constant = true;
9975
- ast.toWatch = [];
9976
- break;
9977
- case AST.UnaryExpression:
9978
- findConstantAndWatchExpressions(ast.argument, $filter);
9979
- ast.constant = ast.argument.constant;
9980
- ast.toWatch = ast.argument.toWatch;
9981
- break;
9982
- case AST.BinaryExpression:
9983
- findConstantAndWatchExpressions(ast.left, $filter);
9984
- findConstantAndWatchExpressions(ast.right, $filter);
9985
- ast.constant = ast.left.constant && ast.right.constant;
9986
- ast.toWatch = ast.left.toWatch.concat(ast.right.toWatch);
9987
- break;
9988
- case AST.LogicalExpression:
9989
- findConstantAndWatchExpressions(ast.left, $filter);
9990
- findConstantAndWatchExpressions(ast.right, $filter);
9991
- ast.constant = ast.left.constant && ast.right.constant;
9992
- ast.toWatch = ast.constant ? [] : [ast];
9993
- break;
9994
- case AST.ConditionalExpression:
9995
- findConstantAndWatchExpressions(ast.test, $filter);
9996
- findConstantAndWatchExpressions(ast.alternate, $filter);
9997
- findConstantAndWatchExpressions(ast.consequent, $filter);
9998
- ast.constant = ast.test.constant && ast.alternate.constant && ast.consequent.constant;
9999
- ast.toWatch = ast.constant ? [] : [ast];
10000
- break;
10001
- case AST.Identifier:
10002
- ast.constant = false;
10003
- ast.toWatch = [ast];
10004
- break;
10005
- case AST.MemberExpression:
10006
- findConstantAndWatchExpressions(ast.object, $filter);
10007
- if (ast.computed) {
10008
- findConstantAndWatchExpressions(ast.property, $filter);
10009
- }
10010
- ast.constant = ast.object.constant && (!ast.computed || ast.property.constant);
10011
- ast.toWatch = [ast];
10012
- break;
10013
- case AST.CallExpression:
10014
- isStatelessFilter = ast.filter ? isStateless($filter, ast.callee.name) : false;
10015
- allConstants = isStatelessFilter;
10016
- argsToWatch = [];
10017
- forEach(ast.arguments, function(expr) {
10018
- findConstantAndWatchExpressions(expr, $filter);
10019
- allConstants = allConstants && expr.constant;
10020
- if (!expr.constant) {
10021
- argsToWatch.push.apply(argsToWatch, expr.toWatch);
10022
- }
10023
- });
10024
- ast.constant = allConstants;
10025
- ast.toWatch = isStatelessFilter ? argsToWatch : [ast];
10026
- break;
10027
- case AST.AssignmentExpression:
10028
- findConstantAndWatchExpressions(ast.left, $filter);
10029
- findConstantAndWatchExpressions(ast.right, $filter);
10030
- ast.constant = ast.left.constant && ast.right.constant;
10031
- ast.toWatch = [ast];
10032
- break;
10033
- case AST.ArrayExpression:
10034
- allConstants = true;
10035
- argsToWatch = [];
10036
- forEach(ast.elements, function(expr) {
10037
- findConstantAndWatchExpressions(expr, $filter);
10038
- allConstants = allConstants && expr.constant;
10039
- if (!expr.constant) {
10040
- argsToWatch.push.apply(argsToWatch, expr.toWatch);
10041
- }
10042
- });
10043
- ast.constant = allConstants;
10044
- ast.toWatch = argsToWatch;
10045
- break;
10046
- case AST.ObjectExpression:
10047
- allConstants = true;
10048
- argsToWatch = [];
10049
- forEach(ast.properties, function(property) {
10050
- findConstantAndWatchExpressions(property.value, $filter);
10051
- allConstants = allConstants && property.value.constant && !property.computed;
10052
- if (!property.value.constant) {
10053
- argsToWatch.push.apply(argsToWatch, property.value.toWatch);
10054
- }
10055
- });
10056
- ast.constant = allConstants;
10057
- ast.toWatch = argsToWatch;
10058
- break;
10059
- case AST.ThisExpression:
10060
- ast.constant = false;
10061
- ast.toWatch = [];
10062
- break;
10063
- case AST.LocalsExpression:
10064
- ast.constant = false;
10065
- ast.toWatch = [];
10066
- break;
10067
- }
10068
- }
10069
-
10070
- function getInputs(body) {
10071
- if (body.length !== 1) return;
10072
- var lastExpression = body[0].expression;
10073
- var candidate = lastExpression.toWatch;
10074
- if (candidate.length !== 1) return candidate;
10075
- return candidate[0] !== lastExpression ? candidate : undefined;
10076
- }
10077
-
10078
- function isAssignable(ast) {
10079
- return ast.type === AST.Identifier || ast.type === AST.MemberExpression;
10080
- }
10081
-
10082
- function assignableAST(ast) {
10083
- if (ast.body.length === 1 && isAssignable(ast.body[0].expression)) {
10084
- return {type: AST.AssignmentExpression, left: ast.body[0].expression, right: {type: AST.NGValueParameter}, operator: '='};
10085
- }
10086
- }
10087
-
10088
- function isLiteral(ast) {
10089
- return ast.body.length === 0 ||
10090
- ast.body.length === 1 && (
10091
- ast.body[0].expression.type === AST.Literal ||
10092
- ast.body[0].expression.type === AST.ArrayExpression ||
10093
- ast.body[0].expression.type === AST.ObjectExpression);
10094
- }
10095
-
10096
- function isConstant(ast) {
10097
- return ast.constant;
10098
- }
10099
-
10100
- function ASTCompiler(astBuilder, $filter) {
10101
- this.astBuilder = astBuilder;
10102
- this.$filter = $filter;
10103
- }
10104
-
10105
- ASTCompiler.prototype = {
10106
- compile: function(expression) {
10107
- var self = this;
10108
- var ast = this.astBuilder.ast(expression);
10109
- this.state = {
10110
- nextId: 0,
10111
- filters: {},
10112
- fn: {vars: [], body: [], own: {}},
10113
- assign: {vars: [], body: [], own: {}},
10114
- inputs: []
10115
- };
10116
- findConstantAndWatchExpressions(ast, self.$filter);
10117
- var extra = '';
10118
- var assignable;
10119
- this.stage = 'assign';
10120
- if ((assignable = assignableAST(ast))) {
10121
- this.state.computing = 'assign';
10122
- var result = this.nextId();
10123
- this.recurse(assignable, result);
10124
- this.return_(result);
10125
- extra = 'fn.assign=' + this.generateFunction('assign', 's,v,l');
10126
- }
10127
- var toWatch = getInputs(ast.body);
10128
- self.stage = 'inputs';
10129
- forEach(toWatch, function(watch, key) {
10130
- var fnKey = 'fn' + key;
10131
- self.state[fnKey] = {vars: [], body: [], own: {}};
10132
- self.state.computing = fnKey;
10133
- var intoId = self.nextId();
10134
- self.recurse(watch, intoId);
10135
- self.return_(intoId);
10136
- self.state.inputs.push(fnKey);
10137
- watch.watchId = key;
10138
- });
10139
- this.state.computing = 'fn';
10140
- this.stage = 'main';
10141
- this.recurse(ast);
10142
- var fnString =
10143
- '"' + this.USE + ' ' + this.STRICT + '";\n' +
10144
- this.filterPrefix() +
10145
- 'var fn=' + this.generateFunction('fn', 's,l,a,i') +
10146
- extra +
10147
- this.watchFns() +
10148
- 'return fn;';
10149
-
10150
- var fn = (new Function('$filter',
10151
- 'getStringValue',
10152
- 'ifDefined',
10153
- 'plus',
10154
- fnString))(
10155
- this.$filter,
10156
- getStringValue,
10157
- ifDefined,
10158
- plusFn);
10159
- this.state = this.stage = undefined;
10160
- fn.literal = isLiteral(ast);
10161
- fn.constant = isConstant(ast);
10162
- return fn;
10163
- },
10164
-
10165
- USE: 'use',
10166
-
10167
- STRICT: 'strict',
10168
-
10169
- watchFns: function() {
10170
- var result = [];
10171
- var fns = this.state.inputs;
10172
- var self = this;
10173
- forEach(fns, function(name) {
10174
- result.push('var ' + name + '=' + self.generateFunction(name, 's'));
10175
- });
10176
- if (fns.length) {
10177
- result.push('fn.inputs=[' + fns.join(',') + '];');
10178
- }
10179
- return result.join('');
10180
- },
10181
-
10182
- generateFunction: function(name, params) {
10183
- return 'function(' + params + '){' +
10184
- this.varsPrefix(name) +
10185
- this.body(name) +
10186
- '};';
10187
- },
10188
-
10189
- filterPrefix: function() {
10190
- var parts = [];
10191
- var self = this;
10192
- forEach(this.state.filters, function(id, filter) {
10193
- parts.push(id + '=$filter(' + self.escape(filter) + ')');
10194
- });
10195
- if (parts.length) return 'var ' + parts.join(',') + ';';
10196
- return '';
10197
- },
10198
-
10199
- varsPrefix: function(section) {
10200
- return this.state[section].vars.length ? 'var ' + this.state[section].vars.join(',') + ';' : '';
10201
- },
10202
-
10203
- body: function(section) {
10204
- return this.state[section].body.join('');
10205
- },
10206
-
10207
- recurse: function(ast, intoId, nameId, recursionFn, create, skipWatchIdCheck) {
10208
- var left, right, self = this, args, expression, computed;
10209
- recursionFn = recursionFn || noop;
10210
- if (!skipWatchIdCheck && isDefined(ast.watchId)) {
10211
- intoId = intoId || this.nextId();
10212
- this.if_('i',
10213
- this.lazyAssign(intoId, this.computedMember('i', ast.watchId)),
10214
- this.lazyRecurse(ast, intoId, nameId, recursionFn, create, true)
10215
- );
10216
- return;
10217
- }
10218
- switch (ast.type) {
10219
- case AST.Program:
10220
- forEach(ast.body, function(expression, pos) {
10221
- self.recurse(expression.expression, undefined, undefined, function(expr) { right = expr; });
10222
- if (pos !== ast.body.length - 1) {
10223
- self.current().body.push(right, ';');
10224
- } else {
10225
- self.return_(right);
10226
- }
10227
- });
10228
- break;
10229
- case AST.Literal:
10230
- expression = this.escape(ast.value);
10231
- this.assign(intoId, expression);
10232
- recursionFn(intoId || expression);
10233
- break;
10234
- case AST.UnaryExpression:
10235
- this.recurse(ast.argument, undefined, undefined, function(expr) { right = expr; });
10236
- expression = ast.operator + '(' + this.ifDefined(right, 0) + ')';
10237
- this.assign(intoId, expression);
10238
- recursionFn(expression);
10239
- break;
10240
- case AST.BinaryExpression:
10241
- this.recurse(ast.left, undefined, undefined, function(expr) { left = expr; });
10242
- this.recurse(ast.right, undefined, undefined, function(expr) { right = expr; });
10243
- if (ast.operator === '+') {
10244
- expression = this.plus(left, right);
10245
- } else if (ast.operator === '-') {
10246
- expression = this.ifDefined(left, 0) + ast.operator + this.ifDefined(right, 0);
10247
- } else {
10248
- expression = '(' + left + ')' + ast.operator + '(' + right + ')';
10249
- }
10250
- this.assign(intoId, expression);
10251
- recursionFn(expression);
10252
- break;
10253
- case AST.LogicalExpression:
10254
- intoId = intoId || this.nextId();
10255
- self.recurse(ast.left, intoId);
10256
- self.if_(ast.operator === '&&' ? intoId : self.not(intoId), self.lazyRecurse(ast.right, intoId));
10257
- recursionFn(intoId);
10258
- break;
10259
- case AST.ConditionalExpression:
10260
- intoId = intoId || this.nextId();
10261
- self.recurse(ast.test, intoId);
10262
- self.if_(intoId, self.lazyRecurse(ast.alternate, intoId), self.lazyRecurse(ast.consequent, intoId));
10263
- recursionFn(intoId);
10264
- break;
10265
- case AST.Identifier:
10266
- intoId = intoId || this.nextId();
10267
- if (nameId) {
10268
- nameId.context = self.stage === 'inputs' ? 's' : this.assign(this.nextId(), this.getHasOwnProperty('l', ast.name) + '?l:s');
10269
- nameId.computed = false;
10270
- nameId.name = ast.name;
10271
- }
10272
- self.if_(self.stage === 'inputs' || self.not(self.getHasOwnProperty('l', ast.name)),
10273
- function() {
10274
- self.if_(self.stage === 'inputs' || 's', function() {
10275
- if (create && create !== 1) {
10276
- self.if_(
10277
- self.isNull(self.nonComputedMember('s', ast.name)),
10278
- self.lazyAssign(self.nonComputedMember('s', ast.name), '{}'));
10279
- }
10280
- self.assign(intoId, self.nonComputedMember('s', ast.name));
10281
- });
10282
- }, intoId && self.lazyAssign(intoId, self.nonComputedMember('l', ast.name))
10283
- );
10284
- recursionFn(intoId);
10285
- break;
10286
- case AST.MemberExpression:
10287
- left = nameId && (nameId.context = this.nextId()) || this.nextId();
10288
- intoId = intoId || this.nextId();
10289
- self.recurse(ast.object, left, undefined, function() {
10290
- self.if_(self.notNull(left), function() {
10291
- if (ast.computed) {
10292
- right = self.nextId();
10293
- self.recurse(ast.property, right);
10294
- self.getStringValue(right);
10295
- if (create && create !== 1) {
10296
- self.if_(self.not(self.computedMember(left, right)), self.lazyAssign(self.computedMember(left, right), '{}'));
10297
- }
10298
- expression = self.computedMember(left, right);
10299
- self.assign(intoId, expression);
10300
- if (nameId) {
10301
- nameId.computed = true;
10302
- nameId.name = right;
10303
- }
10304
- } else {
10305
- if (create && create !== 1) {
10306
- self.if_(self.isNull(self.nonComputedMember(left, ast.property.name)), self.lazyAssign(self.nonComputedMember(left, ast.property.name), '{}'));
10307
- }
10308
- expression = self.nonComputedMember(left, ast.property.name);
10309
- self.assign(intoId, expression);
10310
- if (nameId) {
10311
- nameId.computed = false;
10312
- nameId.name = ast.property.name;
10313
- }
10314
- }
10315
- }, function() {
10316
- self.assign(intoId, 'undefined');
10317
- });
10318
- recursionFn(intoId);
10319
- }, !!create);
10320
- break;
10321
- case AST.CallExpression:
10322
- intoId = intoId || this.nextId();
10323
- if (ast.filter) {
10324
- right = self.filter(ast.callee.name);
10325
- args = [];
10326
- forEach(ast.arguments, function(expr) {
10327
- var argument = self.nextId();
10328
- self.recurse(expr, argument);
10329
- args.push(argument);
10330
- });
10331
- expression = right + '(' + args.join(',') + ')';
10332
- self.assign(intoId, expression);
10333
- recursionFn(intoId);
10334
- } else {
10335
- right = self.nextId();
10336
- left = {};
10337
- args = [];
10338
- self.recurse(ast.callee, right, left, function() {
10339
- self.if_(self.notNull(right), function() {
10340
- forEach(ast.arguments, function(expr) {
10341
- self.recurse(expr, ast.constant ? undefined : self.nextId(), undefined, function(argument) {
10342
- args.push(argument);
10343
- });
10344
- });
10345
- if (left.name) {
10346
- expression = self.member(left.context, left.name, left.computed) + '(' + args.join(',') + ')';
10347
- } else {
10348
- expression = right + '(' + args.join(',') + ')';
10349
- }
10350
- self.assign(intoId, expression);
10351
- }, function() {
10352
- self.assign(intoId, 'undefined');
10353
- });
10354
- recursionFn(intoId);
10355
- });
10356
- }
10357
- break;
10358
- case AST.AssignmentExpression:
10359
- right = this.nextId();
10360
- left = {};
10361
- this.recurse(ast.left, undefined, left, function() {
10362
- self.if_(self.notNull(left.context), function() {
10363
- self.recurse(ast.right, right);
10364
- expression = self.member(left.context, left.name, left.computed) + ast.operator + right;
10365
- self.assign(intoId, expression);
10366
- recursionFn(intoId || expression);
10367
- });
10368
- }, 1);
10369
- break;
10370
- case AST.ArrayExpression:
10371
- args = [];
10372
- forEach(ast.elements, function(expr) {
10373
- self.recurse(expr, ast.constant ? undefined : self.nextId(), undefined, function(argument) {
10374
- args.push(argument);
10375
- });
10376
- });
10377
- expression = '[' + args.join(',') + ']';
10378
- this.assign(intoId, expression);
10379
- recursionFn(intoId || expression);
10380
- break;
10381
- case AST.ObjectExpression:
10382
- args = [];
10383
- computed = false;
10384
- forEach(ast.properties, function(property) {
10385
- if (property.computed) {
10386
- computed = true;
10387
- }
10388
- });
10389
- if (computed) {
10390
- intoId = intoId || this.nextId();
10391
- this.assign(intoId, '{}');
10392
- forEach(ast.properties, function(property) {
10393
- if (property.computed) {
10394
- left = self.nextId();
10395
- self.recurse(property.key, left);
10396
- } else {
10397
- left = property.key.type === AST.Identifier ?
10398
- property.key.name :
10399
- ('' + property.key.value);
10400
- }
10401
- right = self.nextId();
10402
- self.recurse(property.value, right);
10403
- self.assign(self.member(intoId, left, property.computed), right);
10404
- });
10405
- } else {
10406
- forEach(ast.properties, function(property) {
10407
- self.recurse(property.value, ast.constant ? undefined : self.nextId(), undefined, function(expr) {
10408
- args.push(self.escape(
10409
- property.key.type === AST.Identifier ? property.key.name :
10410
- ('' + property.key.value)) +
10411
- ':' + expr);
10412
- });
10413
- });
10414
- expression = '{' + args.join(',') + '}';
10415
- this.assign(intoId, expression);
10416
- }
10417
- recursionFn(intoId || expression);
10418
- break;
10419
- case AST.ThisExpression:
10420
- this.assign(intoId, 's');
10421
- recursionFn(intoId || 's');
10422
- break;
10423
- case AST.LocalsExpression:
10424
- this.assign(intoId, 'l');
10425
- recursionFn(intoId || 'l');
10426
- break;
10427
- case AST.NGValueParameter:
10428
- this.assign(intoId, 'v');
10429
- recursionFn(intoId || 'v');
10430
- break;
10431
- }
10432
- },
10433
-
10434
- getHasOwnProperty: function(element, property) {
10435
- var key = element + '.' + property;
10436
- var own = this.current().own;
10437
- if (!own.hasOwnProperty(key)) {
10438
- own[key] = this.nextId(false, element + '&&(' + this.escape(property) + ' in ' + element + ')');
10439
- }
10440
- return own[key];
10441
- },
10442
-
10443
- assign: function(id, value) {
10444
- if (!id) return;
10445
- this.current().body.push(id, '=', value, ';');
10446
- return id;
10447
- },
10448
-
10449
- filter: function(filterName) {
10450
- if (!this.state.filters.hasOwnProperty(filterName)) {
10451
- this.state.filters[filterName] = this.nextId(true);
10452
- }
10453
- return this.state.filters[filterName];
10454
- },
10455
-
10456
- ifDefined: function(id, defaultValue) {
10457
- return 'ifDefined(' + id + ',' + this.escape(defaultValue) + ')';
10458
- },
10459
-
10460
- plus: function(left, right) {
10461
- return 'plus(' + left + ',' + right + ')';
10462
- },
10463
-
10464
- return_: function(id) {
10465
- this.current().body.push('return ', id, ';');
10466
- },
10467
-
10468
- if_: function(test, alternate, consequent) {
10469
- if (test === true) {
10470
- alternate();
10471
- } else {
10472
- var body = this.current().body;
10473
- body.push('if(', test, '){');
10474
- alternate();
10475
- body.push('}');
10476
- if (consequent) {
10477
- body.push('else{');
10478
- consequent();
10479
- body.push('}');
10480
- }
10481
- }
10482
- },
10483
-
10484
- not: function(expression) {
10485
- return '!(' + expression + ')';
10486
- },
10487
-
10488
- isNull: function(expression) {
10489
- return expression + '==null';
10490
- },
10491
-
10492
- notNull: function(expression) {
10493
- return expression + '!=null';
10494
- },
10495
-
10496
- nonComputedMember: function(left, right) {
10497
- var SAFE_IDENTIFIER = /^[$_a-zA-Z][$_a-zA-Z0-9]*$/;
10498
- var UNSAFE_CHARACTERS = /[^$_a-zA-Z0-9]/g;
10499
- if (SAFE_IDENTIFIER.test(right)) {
10500
- return left + '.' + right;
10501
- } else {
10502
- return left + '["' + right.replace(UNSAFE_CHARACTERS, this.stringEscapeFn) + '"]';
10503
- }
10504
- },
10505
-
10506
- computedMember: function(left, right) {
10507
- return left + '[' + right + ']';
10508
- },
10509
-
10510
- member: function(left, right, computed) {
10511
- if (computed) return this.computedMember(left, right);
10512
- return this.nonComputedMember(left, right);
10513
- },
10514
-
10515
- getStringValue: function(item) {
10516
- this.assign(item, 'getStringValue(' + item + ')');
10517
- },
10518
-
10519
- lazyRecurse: function(ast, intoId, nameId, recursionFn, create, skipWatchIdCheck) {
10520
- var self = this;
10521
- return function() {
10522
- self.recurse(ast, intoId, nameId, recursionFn, create, skipWatchIdCheck);
10523
- };
10524
- },
10525
-
10526
- lazyAssign: function(id, value) {
10527
- var self = this;
10528
- return function() {
10529
- self.assign(id, value);
10530
- };
10531
- },
10532
-
10533
- stringEscapeRegex: /[^ a-zA-Z0-9]/g,
10534
-
10535
- stringEscapeFn: function(c) {
10536
- return '\\u' + ('0000' + c.charCodeAt(0).toString(16)).slice(-4);
10537
- },
10538
-
10539
- escape: function(value) {
10540
- if (isString(value)) return '\'' + value.replace(this.stringEscapeRegex, this.stringEscapeFn) + '\'';
10541
- if (isNumber(value)) return value.toString();
10542
- if (value === true) return 'true';
10543
- if (value === false) return 'false';
10544
- if (value === null) return 'null';
10545
- if (typeof value === 'undefined') return 'undefined';
10546
-
10547
- throw $parseMinErr('esc', 'IMPOSSIBLE');
10548
- },
10549
-
10550
- nextId: function(skip, init) {
10551
- var id = 'v' + (this.state.nextId++);
10552
- if (!skip) {
10553
- this.current().vars.push(id + (init ? '=' + init : ''));
10554
- }
10555
- return id;
10556
- },
10557
-
10558
- current: function() {
10559
- return this.state[this.state.computing];
10560
- }
10561
- };
10562
-
10563
-
10564
- function ASTInterpreter(astBuilder, $filter) {
10565
- this.astBuilder = astBuilder;
10566
- this.$filter = $filter;
10567
- }
10568
-
10569
- ASTInterpreter.prototype = {
10570
- compile: function(expression) {
10571
- var self = this;
10572
- var ast = this.astBuilder.ast(expression);
10573
- findConstantAndWatchExpressions(ast, self.$filter);
10574
- var assignable;
10575
- var assign;
10576
- if ((assignable = assignableAST(ast))) {
10577
- assign = this.recurse(assignable);
10578
- }
10579
- var toWatch = getInputs(ast.body);
10580
- var inputs;
10581
- if (toWatch) {
10582
- inputs = [];
10583
- forEach(toWatch, function(watch, key) {
10584
- var input = self.recurse(watch);
10585
- watch.input = input;
10586
- inputs.push(input);
10587
- watch.watchId = key;
10588
- });
10589
- }
10590
- var expressions = [];
10591
- forEach(ast.body, function(expression) {
10592
- expressions.push(self.recurse(expression.expression));
10593
- });
10594
- var fn = ast.body.length === 0 ? noop :
10595
- ast.body.length === 1 ? expressions[0] :
10596
- function(scope, locals) {
10597
- var lastValue;
10598
- forEach(expressions, function(exp) {
10599
- lastValue = exp(scope, locals);
10600
- });
10601
- return lastValue;
10602
- };
10603
- if (assign) {
10604
- fn.assign = function(scope, value, locals) {
10605
- return assign(scope, locals, value);
10606
- };
10607
- }
10608
- if (inputs) {
10609
- fn.inputs = inputs;
10610
- }
10611
- fn.literal = isLiteral(ast);
10612
- fn.constant = isConstant(ast);
10613
- return fn;
10614
- },
10615
-
10616
- recurse: function(ast, context, create) {
10617
- var left, right, self = this, args;
10618
- if (ast.input) {
10619
- return this.inputs(ast.input, ast.watchId);
10620
- }
10621
- switch (ast.type) {
10622
- case AST.Literal:
10623
- return this.value(ast.value, context);
10624
- case AST.UnaryExpression:
10625
- right = this.recurse(ast.argument);
10626
- return this['unary' + ast.operator](right, context);
10627
- case AST.BinaryExpression:
10628
- left = this.recurse(ast.left);
10629
- right = this.recurse(ast.right);
10630
- return this['binary' + ast.operator](left, right, context);
10631
- case AST.LogicalExpression:
10632
- left = this.recurse(ast.left);
10633
- right = this.recurse(ast.right);
10634
- return this['binary' + ast.operator](left, right, context);
10635
- case AST.ConditionalExpression:
10636
- return this['ternary?:'](
10637
- this.recurse(ast.test),
10638
- this.recurse(ast.alternate),
10639
- this.recurse(ast.consequent),
10640
- context
10641
- );
10642
- case AST.Identifier:
10643
- return self.identifier(ast.name, context, create);
10644
- case AST.MemberExpression:
10645
- left = this.recurse(ast.object, false, !!create);
10646
- if (!ast.computed) {
10647
- right = ast.property.name;
10648
- }
10649
- if (ast.computed) right = this.recurse(ast.property);
10650
- return ast.computed ?
10651
- this.computedMember(left, right, context, create) :
10652
- this.nonComputedMember(left, right, context, create);
10653
- case AST.CallExpression:
10654
- args = [];
10655
- forEach(ast.arguments, function(expr) {
10656
- args.push(self.recurse(expr));
10657
- });
10658
- if (ast.filter) right = this.$filter(ast.callee.name);
10659
- if (!ast.filter) right = this.recurse(ast.callee, true);
10660
- return ast.filter ?
10661
- function(scope, locals, assign, inputs) {
10662
- var values = [];
10663
- for (var i = 0; i < args.length; ++i) {
10664
- values.push(args[i](scope, locals, assign, inputs));
10665
- }
10666
- var value = right.apply(undefined, values, inputs);
10667
- return context ? {context: undefined, name: undefined, value: value} : value;
10668
- } :
10669
- function(scope, locals, assign, inputs) {
10670
- var rhs = right(scope, locals, assign, inputs);
10671
- var value;
10672
- if (rhs.value != null) {
10673
- var values = [];
10674
- for (var i = 0; i < args.length; ++i) {
10675
- values.push(args[i](scope, locals, assign, inputs));
10676
- }
10677
- value = rhs.value.apply(rhs.context, values);
10678
- }
10679
- return context ? {value: value} : value;
10680
- };
10681
- case AST.AssignmentExpression:
10682
- left = this.recurse(ast.left, true, 1);
10683
- right = this.recurse(ast.right);
10684
- return function(scope, locals, assign, inputs) {
10685
- var lhs = left(scope, locals, assign, inputs);
10686
- var rhs = right(scope, locals, assign, inputs);
10687
- lhs.context[lhs.name] = rhs;
10688
- return context ? {value: rhs} : rhs;
10689
- };
10690
- case AST.ArrayExpression:
10691
- args = [];
10692
- forEach(ast.elements, function(expr) {
10693
- args.push(self.recurse(expr));
10694
- });
10695
- return function(scope, locals, assign, inputs) {
10696
- var value = [];
10697
- for (var i = 0; i < args.length; ++i) {
10698
- value.push(args[i](scope, locals, assign, inputs));
10699
- }
10700
- return context ? {value: value} : value;
10701
- };
10702
- case AST.ObjectExpression:
10703
- args = [];
10704
- forEach(ast.properties, function(property) {
10705
- if (property.computed) {
10706
- args.push({key: self.recurse(property.key),
10707
- computed: true,
10708
- value: self.recurse(property.value)
10709
- });
10710
- } else {
10711
- args.push({key: property.key.type === AST.Identifier ?
10712
- property.key.name :
10713
- ('' + property.key.value),
10714
- computed: false,
10715
- value: self.recurse(property.value)
10716
- });
10717
- }
10718
- });
10719
- return function(scope, locals, assign, inputs) {
10720
- var value = {};
10721
- for (var i = 0; i < args.length; ++i) {
10722
- if (args[i].computed) {
10723
- value[args[i].key(scope, locals, assign, inputs)] = args[i].value(scope, locals, assign, inputs);
10724
- } else {
10725
- value[args[i].key] = args[i].value(scope, locals, assign, inputs);
10726
- }
10727
- }
10728
- return context ? {value: value} : value;
10729
- };
10730
- case AST.ThisExpression:
10731
- return function(scope) {
10732
- return context ? {value: scope} : scope;
10733
- };
10734
- case AST.LocalsExpression:
10735
- return function(scope, locals) {
10736
- return context ? {value: locals} : locals;
10737
- };
10738
- case AST.NGValueParameter:
10739
- return function(scope, locals, assign) {
10740
- return context ? {value: assign} : assign;
10741
- };
10742
- }
10743
- },
10744
-
10745
- 'unary+': function(argument, context) {
10746
- return function(scope, locals, assign, inputs) {
10747
- var arg = argument(scope, locals, assign, inputs);
10748
- if (isDefined(arg)) {
10749
- arg = +arg;
10750
- } else {
10751
- arg = 0;
10752
- }
10753
- return context ? {value: arg} : arg;
10754
- };
10755
- },
10756
- 'unary-': function(argument, context) {
10757
- return function(scope, locals, assign, inputs) {
10758
- var arg = argument(scope, locals, assign, inputs);
10759
- if (isDefined(arg)) {
10760
- arg = -arg;
10761
- } else {
10762
- arg = -0;
10763
- }
10764
- return context ? {value: arg} : arg;
10765
- };
10766
- },
10767
- 'unary!': function(argument, context) {
10768
- return function(scope, locals, assign, inputs) {
10769
- var arg = !argument(scope, locals, assign, inputs);
10770
- return context ? {value: arg} : arg;
10771
- };
10772
- },
10773
- 'binary+': function(left, right, context) {
10774
- return function(scope, locals, assign, inputs) {
10775
- var lhs = left(scope, locals, assign, inputs);
10776
- var rhs = right(scope, locals, assign, inputs);
10777
- var arg = plusFn(lhs, rhs);
10778
- return context ? {value: arg} : arg;
10779
- };
10780
- },
10781
- 'binary-': function(left, right, context) {
10782
- return function(scope, locals, assign, inputs) {
10783
- var lhs = left(scope, locals, assign, inputs);
10784
- var rhs = right(scope, locals, assign, inputs);
10785
- var arg = (isDefined(lhs) ? lhs : 0) - (isDefined(rhs) ? rhs : 0);
10786
- return context ? {value: arg} : arg;
10787
- };
10788
- },
10789
- 'binary*': function(left, right, context) {
10790
- return function(scope, locals, assign, inputs) {
10791
- var arg = left(scope, locals, assign, inputs) * right(scope, locals, assign, inputs);
10792
- return context ? {value: arg} : arg;
10793
- };
10794
- },
10795
- 'binary/': function(left, right, context) {
10796
- return function(scope, locals, assign, inputs) {
10797
- var arg = left(scope, locals, assign, inputs) / right(scope, locals, assign, inputs);
10798
- return context ? {value: arg} : arg;
10799
- };
10800
- },
10801
- 'binary%': function(left, right, context) {
10802
- return function(scope, locals, assign, inputs) {
10803
- var arg = left(scope, locals, assign, inputs) % right(scope, locals, assign, inputs);
10804
- return context ? {value: arg} : arg;
10805
- };
10806
- },
10807
- 'binary===': function(left, right, context) {
10808
- return function(scope, locals, assign, inputs) {
10809
- var arg = left(scope, locals, assign, inputs) === right(scope, locals, assign, inputs);
10810
- return context ? {value: arg} : arg;
10811
- };
10812
- },
10813
- 'binary!==': function(left, right, context) {
10814
- return function(scope, locals, assign, inputs) {
10815
- var arg = left(scope, locals, assign, inputs) !== right(scope, locals, assign, inputs);
10816
- return context ? {value: arg} : arg;
10817
- };
10818
- },
10819
- 'binary==': function(left, right, context) {
10820
- return function(scope, locals, assign, inputs) {
10821
- var arg = left(scope, locals, assign, inputs) == right(scope, locals, assign, inputs);
10822
- return context ? {value: arg} : arg;
10823
- };
10824
- },
10825
- 'binary!=': function(left, right, context) {
10826
- return function(scope, locals, assign, inputs) {
10827
- var arg = left(scope, locals, assign, inputs) != right(scope, locals, assign, inputs);
10828
- return context ? {value: arg} : arg;
10829
- };
10830
- },
10831
- 'binary<': function(left, right, context) {
10832
- return function(scope, locals, assign, inputs) {
10833
- var arg = left(scope, locals, assign, inputs) < right(scope, locals, assign, inputs);
10834
- return context ? {value: arg} : arg;
10835
- };
10836
- },
10837
- 'binary>': function(left, right, context) {
10838
- return function(scope, locals, assign, inputs) {
10839
- var arg = left(scope, locals, assign, inputs) > right(scope, locals, assign, inputs);
10840
- return context ? {value: arg} : arg;
10841
- };
10842
- },
10843
- 'binary<=': function(left, right, context) {
10844
- return function(scope, locals, assign, inputs) {
10845
- var arg = left(scope, locals, assign, inputs) <= right(scope, locals, assign, inputs);
10846
- return context ? {value: arg} : arg;
10847
- };
10848
- },
10849
- 'binary>=': function(left, right, context) {
10850
- return function(scope, locals, assign, inputs) {
10851
- var arg = left(scope, locals, assign, inputs) >= right(scope, locals, assign, inputs);
10852
- return context ? {value: arg} : arg;
10853
- };
10854
- },
10855
- 'binary&&': function(left, right, context) {
10856
- return function(scope, locals, assign, inputs) {
10857
- var arg = left(scope, locals, assign, inputs) && right(scope, locals, assign, inputs);
10858
- return context ? {value: arg} : arg;
10859
- };
10860
- },
10861
- 'binary||': function(left, right, context) {
10862
- return function(scope, locals, assign, inputs) {
10863
- var arg = left(scope, locals, assign, inputs) || right(scope, locals, assign, inputs);
10864
- return context ? {value: arg} : arg;
10865
- };
10866
- },
10867
- 'ternary?:': function(test, alternate, consequent, context) {
10868
- return function(scope, locals, assign, inputs) {
10869
- var arg = test(scope, locals, assign, inputs) ? alternate(scope, locals, assign, inputs) : consequent(scope, locals, assign, inputs);
10870
- return context ? {value: arg} : arg;
10871
- };
10872
- },
10873
- value: function(value, context) {
10874
- return function() { return context ? {context: undefined, name: undefined, value: value} : value; };
10875
- },
10876
- identifier: function(name, context, create) {
10877
- return function(scope, locals, assign, inputs) {
10878
- var base = locals && (name in locals) ? locals : scope;
10879
- if (create && create !== 1 && base && base[name] == null) {
10880
- base[name] = {};
10881
- }
10882
- var value = base ? base[name] : undefined;
10883
- if (context) {
10884
- return {context: base, name: name, value: value};
10885
- } else {
10886
- return value;
10887
- }
10888
- };
10889
- },
10890
- computedMember: function(left, right, context, create) {
10891
- return function(scope, locals, assign, inputs) {
10892
- var lhs = left(scope, locals, assign, inputs);
10893
- var rhs;
10894
- var value;
10895
- if (lhs != null) {
10896
- rhs = right(scope, locals, assign, inputs);
10897
- rhs = getStringValue(rhs);
10898
- if (create && create !== 1) {
10899
- if (lhs && !(lhs[rhs])) {
10900
- lhs[rhs] = {};
10901
- }
10902
- }
10903
- value = lhs[rhs];
10904
- }
10905
- if (context) {
10906
- return {context: lhs, name: rhs, value: value};
10907
- } else {
10908
- return value;
10909
- }
10910
- };
10911
- },
10912
- nonComputedMember: function(left, right, context, create) {
10913
- return function(scope, locals, assign, inputs) {
10914
- var lhs = left(scope, locals, assign, inputs);
10915
- if (create && create !== 1) {
10916
- if (lhs && lhs[right] == null) {
10917
- lhs[right] = {};
10918
- }
10919
- }
10920
- var value = lhs != null ? lhs[right] : undefined;
10921
- if (context) {
10922
- return {context: lhs, name: right, value: value};
10923
- } else {
10924
- return value;
10925
- }
10926
- };
10927
- },
10928
- inputs: function(input, watchId) {
10929
- return function(scope, value, locals, inputs) {
10930
- if (inputs) return inputs[watchId];
10931
- return input(scope, value, locals);
10932
- };
10933
- }
10934
- };
10935
-
10936
- var Parser = function Parser(lexer, $filter, options) {
10937
- this.lexer = lexer;
10938
- this.$filter = $filter;
10939
- this.options = options;
10940
- this.ast = new AST(lexer, options);
10941
- this.astCompiler = options.csp ? new ASTInterpreter(this.ast, $filter) :
10942
- new ASTCompiler(this.ast, $filter);
10943
- };
10944
-
10945
- Parser.prototype = {
10946
- constructor: Parser,
10947
-
10948
- parse: function(text) {
10949
- return this.astCompiler.compile(text);
10950
- }
10951
- };
10952
-
10953
- function getValueOf(value) {
10954
- return isFunction(value.valueOf) ? value.valueOf() : objectValueOf.call(value);
10955
- }
10956
-
10957
-
10958
-
10959
-
10960
- function $ParseProvider() {
10961
- var cache = createMap();
10962
- var literals = {
10963
- 'true': true,
10964
- 'false': false,
10965
- 'null': null,
10966
- 'undefined': undefined
10967
- };
10968
- var identStart, identContinue;
10969
-
10970
- this.addLiteral = function(literalName, literalValue) {
10971
- literals[literalName] = literalValue;
10972
- };
10973
-
10974
- this.setIdentifierFns = function(identifierStart, identifierContinue) {
10975
- identStart = identifierStart;
10976
- identContinue = identifierContinue;
10977
- return this;
10978
- };
10979
-
10980
- this.$get = ['$filter', function($filter) {
10981
- var noUnsafeEval = csp().noUnsafeEval;
10982
- var $parseOptions = {
10983
- csp: noUnsafeEval,
10984
- literals: copy(literals),
10985
- isIdentifierStart: isFunction(identStart) && identStart,
10986
- isIdentifierContinue: isFunction(identContinue) && identContinue
10987
- };
10988
- return $parse;
10989
-
10990
- function $parse(exp, interceptorFn) {
10991
- var parsedExpression, oneTime, cacheKey;
10992
-
10993
- switch (typeof exp) {
10994
- case 'string':
10995
- exp = exp.trim();
10996
- cacheKey = exp;
10997
-
10998
- parsedExpression = cache[cacheKey];
10999
-
11000
- if (!parsedExpression) {
11001
- if (exp.charAt(0) === ':' && exp.charAt(1) === ':') {
11002
- oneTime = true;
11003
- exp = exp.substring(2);
11004
- }
11005
- var lexer = new Lexer($parseOptions);
11006
- var parser = new Parser(lexer, $filter, $parseOptions);
11007
- parsedExpression = parser.parse(exp);
11008
- if (parsedExpression.constant) {
11009
- parsedExpression.$$watchDelegate = constantWatchDelegate;
11010
- } else if (oneTime) {
11011
- parsedExpression.$$watchDelegate = parsedExpression.literal ?
11012
- oneTimeLiteralWatchDelegate : oneTimeWatchDelegate;
11013
- } else if (parsedExpression.inputs) {
11014
- parsedExpression.$$watchDelegate = inputsWatchDelegate;
11015
- }
11016
- cache[cacheKey] = parsedExpression;
11017
- }
11018
- return addInterceptor(parsedExpression, interceptorFn);
11019
-
11020
- case 'function':
11021
- return addInterceptor(exp, interceptorFn);
11022
-
11023
- default:
11024
- return addInterceptor(noop, interceptorFn);
11025
- }
11026
- }
11027
-
11028
- function expressionInputDirtyCheck(newValue, oldValueOfValue) {
11029
-
11030
- if (newValue == null || oldValueOfValue == null) {
11031
- return newValue === oldValueOfValue;
11032
- }
11033
-
11034
- if (typeof newValue === 'object') {
11035
-
11036
- newValue = getValueOf(newValue);
11037
-
11038
- if (typeof newValue === 'object') {
11039
- return false;
11040
- }
11041
-
11042
- }
11043
-
11044
- return newValue === oldValueOfValue || (newValue !== newValue && oldValueOfValue !== oldValueOfValue);
11045
- }
11046
-
11047
- function inputsWatchDelegate(scope, listener, objectEquality, parsedExpression, prettyPrintExpression) {
11048
- var inputExpressions = parsedExpression.inputs;
11049
- var lastResult;
11050
-
11051
- if (inputExpressions.length === 1) {
11052
- var oldInputValueOf = expressionInputDirtyCheck;
11053
- inputExpressions = inputExpressions[0];
11054
- return scope.$watch(function expressionInputWatch(scope) {
11055
- var newInputValue = inputExpressions(scope);
11056
- if (!expressionInputDirtyCheck(newInputValue, oldInputValueOf)) {
11057
- lastResult = parsedExpression(scope, undefined, undefined, [newInputValue]);
11058
- oldInputValueOf = newInputValue && getValueOf(newInputValue);
11059
- }
11060
- return lastResult;
11061
- }, listener, objectEquality, prettyPrintExpression);
11062
- }
11063
-
11064
- var oldInputValueOfValues = [];
11065
- var oldInputValues = [];
11066
- for (var i = 0, ii = inputExpressions.length; i < ii; i++) {
11067
- oldInputValueOfValues[i] = expressionInputDirtyCheck;
11068
- oldInputValues[i] = null;
11069
- }
11070
-
11071
- return scope.$watch(function expressionInputsWatch(scope) {
11072
- var changed = false;
11073
-
11074
- for (var i = 0, ii = inputExpressions.length; i < ii; i++) {
11075
- var newInputValue = inputExpressions[i](scope);
11076
- if (changed || (changed = !expressionInputDirtyCheck(newInputValue, oldInputValueOfValues[i]))) {
11077
- oldInputValues[i] = newInputValue;
11078
- oldInputValueOfValues[i] = newInputValue && getValueOf(newInputValue);
11079
- }
11080
- }
11081
-
11082
- if (changed) {
11083
- lastResult = parsedExpression(scope, undefined, undefined, oldInputValues);
11084
- }
11085
-
11086
- return lastResult;
11087
- }, listener, objectEquality, prettyPrintExpression);
11088
- }
11089
-
11090
- function oneTimeWatchDelegate(scope, listener, objectEquality, parsedExpression, prettyPrintExpression) {
11091
- var unwatch, lastValue;
11092
- if (parsedExpression.inputs) {
11093
- unwatch = inputsWatchDelegate(scope, oneTimeListener, objectEquality, parsedExpression, prettyPrintExpression);
11094
- } else {
11095
- unwatch = scope.$watch(oneTimeWatch, oneTimeListener, objectEquality);
11096
- }
11097
- return unwatch;
11098
-
11099
- function oneTimeWatch(scope) {
11100
- return parsedExpression(scope);
11101
- }
11102
- function oneTimeListener(value, old, scope) {
11103
- lastValue = value;
11104
- if (isFunction(listener)) {
11105
- listener(value, old, scope);
11106
- }
11107
- if (isDefined(value)) {
11108
- scope.$$postDigest(function() {
11109
- if (isDefined(lastValue)) {
11110
- unwatch();
11111
- }
11112
- });
11113
- }
11114
- }
11115
- }
11116
-
11117
- function oneTimeLiteralWatchDelegate(scope, listener, objectEquality, parsedExpression) {
11118
- var unwatch, lastValue;
11119
- unwatch = scope.$watch(function oneTimeWatch(scope) {
11120
- return parsedExpression(scope);
11121
- }, function oneTimeListener(value, old, scope) {
11122
- lastValue = value;
11123
- if (isFunction(listener)) {
11124
- listener(value, old, scope);
11125
- }
11126
- if (isAllDefined(value)) {
11127
- scope.$$postDigest(function() {
11128
- if (isAllDefined(lastValue)) unwatch();
11129
- });
11130
- }
11131
- }, objectEquality);
11132
-
11133
- return unwatch;
11134
-
11135
- function isAllDefined(value) {
11136
- var allDefined = true;
11137
- forEach(value, function(val) {
11138
- if (!isDefined(val)) allDefined = false;
11139
- });
11140
- return allDefined;
11141
- }
11142
- }
11143
-
11144
- function constantWatchDelegate(scope, listener, objectEquality, parsedExpression) {
11145
- var unwatch = scope.$watch(function constantWatch(scope) {
11146
- unwatch();
11147
- return parsedExpression(scope);
11148
- }, listener, objectEquality);
11149
- return unwatch;
11150
- }
11151
-
11152
- function addInterceptor(parsedExpression, interceptorFn) {
11153
- if (!interceptorFn) return parsedExpression;
11154
- var watchDelegate = parsedExpression.$$watchDelegate;
11155
- var useInputs = false;
11156
-
11157
- var regularWatch =
11158
- watchDelegate !== oneTimeLiteralWatchDelegate &&
11159
- watchDelegate !== oneTimeWatchDelegate;
11160
-
11161
- var fn = regularWatch ? function regularInterceptedExpression(scope, locals, assign, inputs) {
11162
- var value = useInputs && inputs ? inputs[0] : parsedExpression(scope, locals, assign, inputs);
11163
- return interceptorFn(value, scope, locals);
11164
- } : function oneTimeInterceptedExpression(scope, locals, assign, inputs) {
11165
- var value = parsedExpression(scope, locals, assign, inputs);
11166
- var result = interceptorFn(value, scope, locals);
11167
- return isDefined(value) ? result : value;
11168
- };
11169
-
11170
- useInputs = !parsedExpression.inputs;
11171
- if (parsedExpression.$$watchDelegate &&
11172
- parsedExpression.$$watchDelegate !== inputsWatchDelegate) {
11173
- fn.$$watchDelegate = parsedExpression.$$watchDelegate;
11174
- fn.inputs = parsedExpression.inputs;
11175
- } else if (!interceptorFn.$stateful) {
11176
- fn.$$watchDelegate = inputsWatchDelegate;
11177
- fn.inputs = parsedExpression.inputs ? parsedExpression.inputs : [parsedExpression];
11178
- }
11179
-
11180
- return fn;
11181
- }
11182
- }];
11183
- }
11184
-
11185
- function $QProvider() {
11186
- var errorOnUnhandledRejections = true;
11187
- this.$get = ['$rootScope', '$exceptionHandler', function($rootScope, $exceptionHandler) {
11188
- return qFactory(function(callback) {
11189
- $rootScope.$evalAsync(callback);
11190
- }, $exceptionHandler, errorOnUnhandledRejections);
11191
- }];
11192
-
11193
- this.errorOnUnhandledRejections = function(value) {
11194
- if (isDefined(value)) {
11195
- errorOnUnhandledRejections = value;
11196
- return this;
11197
- } else {
11198
- return errorOnUnhandledRejections;
11199
- }
11200
- };
11201
- }
11202
-
11203
- function $$QProvider() {
11204
- var errorOnUnhandledRejections = true;
11205
- this.$get = ['$browser', '$exceptionHandler', function($browser, $exceptionHandler) {
11206
- return qFactory(function(callback) {
11207
- $browser.defer(callback);
11208
- }, $exceptionHandler, errorOnUnhandledRejections);
11209
- }];
11210
-
11211
- this.errorOnUnhandledRejections = function(value) {
11212
- if (isDefined(value)) {
11213
- errorOnUnhandledRejections = value;
11214
- return this;
11215
- } else {
11216
- return errorOnUnhandledRejections;
11217
- }
11218
- };
11219
- }
11220
-
11221
- function qFactory(nextTick, exceptionHandler, errorOnUnhandledRejections) {
11222
- var $qMinErr = minErr('$q', TypeError);
11223
- var queueSize = 0;
11224
- var checkQueue = [];
11225
-
11226
- function defer() {
11227
- return new Deferred();
11228
- }
11229
-
11230
- function Deferred() {
11231
- var promise = this.promise = new Promise();
11232
- this.resolve = function(val) { resolvePromise(promise, val); };
11233
- this.reject = function(reason) { rejectPromise(promise, reason); };
11234
- this.notify = function(progress) { notifyPromise(promise, progress); };
11235
- }
11236
-
11237
-
11238
- function Promise() {
11239
- this.$$state = { status: 0 };
11240
- }
11241
-
11242
- extend(Promise.prototype, {
11243
- then: function(onFulfilled, onRejected, progressBack) {
11244
- if (isUndefined(onFulfilled) && isUndefined(onRejected) && isUndefined(progressBack)) {
11245
- return this;
11246
- }
11247
- var result = new Promise();
11248
-
11249
- this.$$state.pending = this.$$state.pending || [];
11250
- this.$$state.pending.push([result, onFulfilled, onRejected, progressBack]);
11251
- if (this.$$state.status > 0) scheduleProcessQueue(this.$$state);
11252
-
11253
- return result;
11254
- },
11255
-
11256
- 'catch': function(callback) {
11257
- return this.then(null, callback);
11258
- },
11259
-
11260
- 'finally': function(callback, progressBack) {
11261
- return this.then(function(value) {
11262
- return handleCallback(value, resolve, callback);
11263
- }, function(error) {
11264
- return handleCallback(error, reject, callback);
11265
- }, progressBack);
11266
- }
11267
- });
11268
-
11269
- function processQueue(state) {
11270
- var fn, promise, pending;
11271
-
11272
- pending = state.pending;
11273
- state.processScheduled = false;
11274
- state.pending = undefined;
11275
- try {
11276
- for (var i = 0, ii = pending.length; i < ii; ++i) {
11277
- state.pur = true;
11278
- promise = pending[i][0];
11279
- fn = pending[i][state.status];
11280
- try {
11281
- if (isFunction(fn)) {
11282
- resolvePromise(promise, fn(state.value));
11283
- } else if (state.status === 1) {
11284
- resolvePromise(promise, state.value);
11285
- } else {
11286
- rejectPromise(promise, state.value);
11287
- }
11288
- } catch (e) {
11289
- rejectPromise(promise, e);
11290
- }
11291
- }
11292
- } finally {
11293
- --queueSize;
11294
- if (errorOnUnhandledRejections && queueSize === 0) {
11295
- nextTick(processChecks);
11296
- }
11297
- }
11298
- }
11299
-
11300
- function processChecks() {
11301
- while (!queueSize && checkQueue.length) {
11302
- var toCheck = checkQueue.shift();
11303
- if (!toCheck.pur) {
11304
- toCheck.pur = true;
11305
- var errorMessage = 'Possibly unhandled rejection: ' + toDebugString(toCheck.value);
11306
- if (toCheck.value instanceof Error) {
11307
- exceptionHandler(toCheck.value, errorMessage);
11308
- } else {
11309
- exceptionHandler(errorMessage);
11310
- }
11311
- }
11312
- }
11313
- }
11314
-
11315
- function scheduleProcessQueue(state) {
11316
- if (errorOnUnhandledRejections && !state.pending && state.status === 2 && !state.pur) {
11317
- if (queueSize === 0 && checkQueue.length === 0) {
11318
- nextTick(processChecks);
11319
- }
11320
- checkQueue.push(state);
11321
- }
11322
- if (state.processScheduled || !state.pending) return;
11323
- state.processScheduled = true;
11324
- ++queueSize;
11325
- nextTick(function() { processQueue(state); });
11326
- }
11327
-
11328
- function resolvePromise(promise, val) {
11329
- if (promise.$$state.status) return;
11330
- if (val === promise) {
11331
- $$reject(promise, $qMinErr(
11332
- 'qcycle',
11333
- 'Expected promise to be resolved with value other than itself \'{0}\'',
11334
- val));
11335
- } else {
11336
- $$resolve(promise, val);
11337
- }
11338
-
11339
- }
11340
-
11341
- function $$resolve(promise, val) {
11342
- var then;
11343
- var done = false;
11344
- try {
11345
- if (isObject(val) || isFunction(val)) then = val.then;
11346
- if (isFunction(then)) {
11347
- promise.$$state.status = -1;
11348
- then.call(val, doResolve, doReject, doNotify);
11349
- } else {
11350
- promise.$$state.value = val;
11351
- promise.$$state.status = 1;
11352
- scheduleProcessQueue(promise.$$state);
11353
- }
11354
- } catch (e) {
11355
- doReject(e);
11356
- }
11357
-
11358
- function doResolve(val) {
11359
- if (done) return;
11360
- done = true;
11361
- $$resolve(promise, val);
11362
- }
11363
- function doReject(val) {
11364
- if (done) return;
11365
- done = true;
11366
- $$reject(promise, val);
11367
- }
11368
- function doNotify(progress) {
11369
- notifyPromise(promise, progress);
11370
- }
11371
- }
11372
-
11373
- function rejectPromise(promise, reason) {
11374
- if (promise.$$state.status) return;
11375
- $$reject(promise, reason);
11376
- }
11377
-
11378
- function $$reject(promise, reason) {
11379
- promise.$$state.value = reason;
11380
- promise.$$state.status = 2;
11381
- scheduleProcessQueue(promise.$$state);
11382
- }
11383
-
11384
- function notifyPromise(promise, progress) {
11385
- var callbacks = promise.$$state.pending;
11386
-
11387
- if ((promise.$$state.status <= 0) && callbacks && callbacks.length) {
11388
- nextTick(function() {
11389
- var callback, result;
11390
- for (var i = 0, ii = callbacks.length; i < ii; i++) {
11391
- result = callbacks[i][0];
11392
- callback = callbacks[i][3];
11393
- try {
11394
- notifyPromise(result, isFunction(callback) ? callback(progress) : progress);
11395
- } catch (e) {
11396
- exceptionHandler(e);
11397
- }
11398
- }
11399
- });
11400
- }
11401
- }
11402
-
11403
- function reject(reason) {
11404
- var result = new Promise();
11405
- rejectPromise(result, reason);
11406
- return result;
11407
- }
11408
-
11409
- function handleCallback(value, resolver, callback) {
11410
- var callbackOutput = null;
11411
- try {
11412
- if (isFunction(callback)) callbackOutput = callback();
11413
- } catch (e) {
11414
- return reject(e);
11415
- }
11416
- if (isPromiseLike(callbackOutput)) {
11417
- return callbackOutput.then(function() {
11418
- return resolver(value);
11419
- }, reject);
11420
- } else {
11421
- return resolver(value);
11422
- }
11423
- }
11424
-
11425
-
11426
-
11427
- function when(value, callback, errback, progressBack) {
11428
- var result = new Promise();
11429
- resolvePromise(result, value);
11430
- return result.then(callback, errback, progressBack);
11431
- }
11432
-
11433
- var resolve = when;
11434
-
11435
-
11436
- function all(promises) {
11437
- var result = new Promise(),
11438
- counter = 0,
11439
- results = isArray(promises) ? [] : {};
11440
-
11441
- forEach(promises, function(promise, key) {
11442
- counter++;
11443
- when(promise).then(function(value) {
11444
- results[key] = value;
11445
- if (!(--counter)) resolvePromise(result, results);
11446
- }, function(reason) {
11447
- rejectPromise(result, reason);
11448
- });
11449
- });
11450
-
11451
- if (counter === 0) {
11452
- resolvePromise(result, results);
11453
- }
11454
-
11455
- return result;
11456
- }
11457
-
11458
-
11459
- function race(promises) {
11460
- var deferred = defer();
11461
-
11462
- forEach(promises, function(promise) {
11463
- when(promise).then(deferred.resolve, deferred.reject);
11464
- });
11465
-
11466
- return deferred.promise;
11467
- }
11468
-
11469
- function $Q(resolver) {
11470
- if (!isFunction(resolver)) {
11471
- throw $qMinErr('norslvr', 'Expected resolverFn, got \'{0}\'', resolver);
11472
- }
11473
-
11474
- var promise = new Promise();
11475
-
11476
- function resolveFn(value) {
11477
- resolvePromise(promise, value);
11478
- }
11479
-
11480
- function rejectFn(reason) {
11481
- rejectPromise(promise, reason);
11482
- }
11483
-
11484
- resolver(resolveFn, rejectFn);
11485
-
11486
- return promise;
11487
- }
11488
-
11489
- $Q.prototype = Promise.prototype;
11490
-
11491
- $Q.defer = defer;
11492
- $Q.reject = reject;
11493
- $Q.when = when;
11494
- $Q.resolve = resolve;
11495
- $Q.all = all;
11496
- $Q.race = race;
11497
-
11498
- return $Q;
11499
- }
11500
-
11501
- function $$RAFProvider() {
11502
- this.$get = ['$window', '$timeout', function($window, $timeout) {
11503
- var requestAnimationFrame = $window.requestAnimationFrame ||
11504
- $window.webkitRequestAnimationFrame;
11505
-
11506
- var cancelAnimationFrame = $window.cancelAnimationFrame ||
11507
- $window.webkitCancelAnimationFrame ||
11508
- $window.webkitCancelRequestAnimationFrame;
11509
-
11510
- var rafSupported = !!requestAnimationFrame;
11511
- var raf = rafSupported
11512
- ? function(fn) {
11513
- var id = requestAnimationFrame(fn);
11514
- return function() {
11515
- cancelAnimationFrame(id);
11516
- };
11517
- }
11518
- : function(fn) {
11519
- var timer = $timeout(fn, 16.66, false);
11520
- return function() {
11521
- $timeout.cancel(timer);
11522
- };
11523
- };
11524
-
11525
- raf.supported = rafSupported;
11526
-
11527
- return raf;
11528
- }];
11529
- }
11530
-
11531
-
11532
-
11533
-
11534
-
11535
-
11536
- function $RootScopeProvider() {
11537
- var TTL = 10;
11538
- var $rootScopeMinErr = minErr('$rootScope');
11539
- var lastDirtyWatch = null;
11540
- var applyAsyncId = null;
11541
-
11542
- this.digestTtl = function(value) {
11543
- if (arguments.length) {
11544
- TTL = value;
11545
- }
11546
- return TTL;
11547
- };
11548
-
11549
- function createChildScopeClass(parent) {
11550
- function ChildScope() {
11551
- this.$$watchers = this.$$nextSibling =
11552
- this.$$childHead = this.$$childTail = null;
11553
- this.$$listeners = {};
11554
- this.$$listenerCount = {};
11555
- this.$$watchersCount = 0;
11556
- this.$id = nextUid();
11557
- this.$$ChildScope = null;
11558
- }
11559
- ChildScope.prototype = parent;
11560
- return ChildScope;
11561
- }
11562
-
11563
- this.$get = ['$exceptionHandler', '$parse', '$browser',
11564
- function($exceptionHandler, $parse, $browser) {
11565
-
11566
- function destroyChildScope($event) {
11567
- $event.currentScope.$$destroyed = true;
11568
- }
11569
-
11570
- function cleanUpScope($scope) {
11571
-
11572
- if (msie === 9) {
11573
- if ($scope.$$childHead) {
11574
- cleanUpScope($scope.$$childHead);
11575
- }
11576
- if ($scope.$$nextSibling) {
11577
- cleanUpScope($scope.$$nextSibling);
11578
- }
11579
- }
11580
-
11581
-
11582
- $scope.$parent = $scope.$$nextSibling = $scope.$$prevSibling = $scope.$$childHead =
11583
- $scope.$$childTail = $scope.$root = $scope.$$watchers = null;
11584
- }
11585
-
11586
- function Scope() {
11587
- this.$id = nextUid();
11588
- this.$$phase = this.$parent = this.$$watchers =
11589
- this.$$nextSibling = this.$$prevSibling =
11590
- this.$$childHead = this.$$childTail = null;
11591
- this.$root = this;
11592
- this.$$destroyed = false;
11593
- this.$$listeners = {};
11594
- this.$$listenerCount = {};
11595
- this.$$watchersCount = 0;
11596
- this.$$isolateBindings = null;
11597
- }
11598
-
11599
-
11600
-
11601
-
11602
- Scope.prototype = {
11603
- constructor: Scope,
11604
- $new: function(isolate, parent) {
11605
- var child;
11606
-
11607
- parent = parent || this;
11608
-
11609
- if (isolate) {
11610
- child = new Scope();
11611
- child.$root = this.$root;
11612
- } else {
11613
- if (!this.$$ChildScope) {
11614
- this.$$ChildScope = createChildScopeClass(this);
11615
- }
11616
- child = new this.$$ChildScope();
11617
- }
11618
- child.$parent = parent;
11619
- child.$$prevSibling = parent.$$childTail;
11620
- if (parent.$$childHead) {
11621
- parent.$$childTail.$$nextSibling = child;
11622
- parent.$$childTail = child;
11623
- } else {
11624
- parent.$$childHead = parent.$$childTail = child;
11625
- }
11626
-
11627
- if (isolate || parent !== this) child.$on('$destroy', destroyChildScope);
11628
-
11629
- return child;
11630
- },
11631
-
11632
- $watch: function(watchExp, listener, objectEquality, prettyPrintExpression) {
11633
- var get = $parse(watchExp);
11634
-
11635
- if (get.$$watchDelegate) {
11636
- return get.$$watchDelegate(this, listener, objectEquality, get, watchExp);
11637
- }
11638
- var scope = this,
11639
- array = scope.$$watchers,
11640
- watcher = {
11641
- fn: listener,
11642
- last: initWatchVal,
11643
- get: get,
11644
- exp: prettyPrintExpression || watchExp,
11645
- eq: !!objectEquality
11646
- };
11647
-
11648
- lastDirtyWatch = null;
11649
-
11650
- if (!isFunction(listener)) {
11651
- watcher.fn = noop;
11652
- }
11653
-
11654
- if (!array) {
11655
- array = scope.$$watchers = [];
11656
- array.$$digestWatchIndex = -1;
11657
- }
11658
- array.unshift(watcher);
11659
- array.$$digestWatchIndex++;
11660
- incrementWatchersCount(this, 1);
11661
-
11662
- return function deregisterWatch() {
11663
- var index = arrayRemove(array, watcher);
11664
- if (index >= 0) {
11665
- incrementWatchersCount(scope, -1);
11666
- if (index < array.$$digestWatchIndex) {
11667
- array.$$digestWatchIndex--;
11668
- }
11669
- }
11670
- lastDirtyWatch = null;
11671
- };
11672
- },
11673
-
11674
- $watchGroup: function(watchExpressions, listener) {
11675
- var oldValues = new Array(watchExpressions.length);
11676
- var newValues = new Array(watchExpressions.length);
11677
- var deregisterFns = [];
11678
- var self = this;
11679
- var changeReactionScheduled = false;
11680
- var firstRun = true;
11681
-
11682
- if (!watchExpressions.length) {
11683
- var shouldCall = true;
11684
- self.$evalAsync(function() {
11685
- if (shouldCall) listener(newValues, newValues, self);
11686
- });
11687
- return function deregisterWatchGroup() {
11688
- shouldCall = false;
11689
- };
11690
- }
11691
-
11692
- if (watchExpressions.length === 1) {
11693
- return this.$watch(watchExpressions[0], function watchGroupAction(value, oldValue, scope) {
11694
- newValues[0] = value;
11695
- oldValues[0] = oldValue;
11696
- listener(newValues, (value === oldValue) ? newValues : oldValues, scope);
11697
- });
11698
- }
11699
-
11700
- forEach(watchExpressions, function(expr, i) {
11701
- var unwatchFn = self.$watch(expr, function watchGroupSubAction(value, oldValue) {
11702
- newValues[i] = value;
11703
- oldValues[i] = oldValue;
11704
- if (!changeReactionScheduled) {
11705
- changeReactionScheduled = true;
11706
- self.$evalAsync(watchGroupAction);
11707
- }
11708
- });
11709
- deregisterFns.push(unwatchFn);
11710
- });
11711
-
11712
- function watchGroupAction() {
11713
- changeReactionScheduled = false;
11714
-
11715
- if (firstRun) {
11716
- firstRun = false;
11717
- listener(newValues, newValues, self);
11718
- } else {
11719
- listener(newValues, oldValues, self);
11720
- }
11721
- }
11722
-
11723
- return function deregisterWatchGroup() {
11724
- while (deregisterFns.length) {
11725
- deregisterFns.shift()();
11726
- }
11727
- };
11728
- },
11729
-
11730
-
11731
- $watchCollection: function(obj, listener) {
11732
- $watchCollectionInterceptor.$stateful = true;
11733
-
11734
- var self = this;
11735
- var newValue;
11736
- var oldValue;
11737
- var veryOldValue;
11738
- var trackVeryOldValue = (listener.length > 1);
11739
- var changeDetected = 0;
11740
- var changeDetector = $parse(obj, $watchCollectionInterceptor);
11741
- var internalArray = [];
11742
- var internalObject = {};
11743
- var initRun = true;
11744
- var oldLength = 0;
11745
-
11746
- function $watchCollectionInterceptor(_value) {
11747
- newValue = _value;
11748
- var newLength, key, bothNaN, newItem, oldItem;
11749
-
11750
- if (isUndefined(newValue)) return;
11751
-
11752
- if (!isObject(newValue)) {
11753
- if (oldValue !== newValue) {
11754
- oldValue = newValue;
11755
- changeDetected++;
11756
- }
11757
- } else if (isArrayLike(newValue)) {
11758
- if (oldValue !== internalArray) {
11759
- oldValue = internalArray;
11760
- oldLength = oldValue.length = 0;
11761
- changeDetected++;
11762
- }
11763
-
11764
- newLength = newValue.length;
11765
-
11766
- if (oldLength !== newLength) {
11767
- changeDetected++;
11768
- oldValue.length = oldLength = newLength;
11769
- }
11770
- for (var i = 0; i < newLength; i++) {
11771
- oldItem = oldValue[i];
11772
- newItem = newValue[i];
11773
-
11774
- bothNaN = (oldItem !== oldItem) && (newItem !== newItem);
11775
- if (!bothNaN && (oldItem !== newItem)) {
11776
- changeDetected++;
11777
- oldValue[i] = newItem;
11778
- }
11779
- }
11780
- } else {
11781
- if (oldValue !== internalObject) {
11782
- oldValue = internalObject = {};
11783
- oldLength = 0;
11784
- changeDetected++;
11785
- }
11786
- newLength = 0;
11787
- for (key in newValue) {
11788
- if (hasOwnProperty.call(newValue, key)) {
11789
- newLength++;
11790
- newItem = newValue[key];
11791
- oldItem = oldValue[key];
11792
-
11793
- if (key in oldValue) {
11794
- bothNaN = (oldItem !== oldItem) && (newItem !== newItem);
11795
- if (!bothNaN && (oldItem !== newItem)) {
11796
- changeDetected++;
11797
- oldValue[key] = newItem;
11798
- }
11799
- } else {
11800
- oldLength++;
11801
- oldValue[key] = newItem;
11802
- changeDetected++;
11803
- }
11804
- }
11805
- }
11806
- if (oldLength > newLength) {
11807
- changeDetected++;
11808
- for (key in oldValue) {
11809
- if (!hasOwnProperty.call(newValue, key)) {
11810
- oldLength--;
11811
- delete oldValue[key];
11812
- }
11813
- }
11814
- }
11815
- }
11816
- return changeDetected;
11817
- }
11818
-
11819
- function $watchCollectionAction() {
11820
- if (initRun) {
11821
- initRun = false;
11822
- listener(newValue, newValue, self);
11823
- } else {
11824
- listener(newValue, veryOldValue, self);
11825
- }
11826
-
11827
- if (trackVeryOldValue) {
11828
- if (!isObject(newValue)) {
11829
- veryOldValue = newValue;
11830
- } else if (isArrayLike(newValue)) {
11831
- veryOldValue = new Array(newValue.length);
11832
- for (var i = 0; i < newValue.length; i++) {
11833
- veryOldValue[i] = newValue[i];
11834
- }
11835
- } else {
11836
- veryOldValue = {};
11837
- for (var key in newValue) {
11838
- if (hasOwnProperty.call(newValue, key)) {
11839
- veryOldValue[key] = newValue[key];
11840
- }
11841
- }
11842
- }
11843
- }
11844
- }
11845
-
11846
- return this.$watch(changeDetector, $watchCollectionAction);
11847
- },
11848
-
11849
- $digest: function() {
11850
- var watch, value, last, fn, get,
11851
- watchers,
11852
- dirty, ttl = TTL,
11853
- next, current, target = this,
11854
- watchLog = [],
11855
- logIdx, asyncTask;
11856
-
11857
- beginPhase('$digest');
11858
- $browser.$$checkUrlChange();
11859
-
11860
- if (this === $rootScope && applyAsyncId !== null) {
11861
- $browser.defer.cancel(applyAsyncId);
11862
- flushApplyAsync();
11863
- }
11864
-
11865
- lastDirtyWatch = null;
11866
-
11867
- do {
11868
- dirty = false;
11869
- current = target;
11870
-
11871
- for (var asyncQueuePosition = 0; asyncQueuePosition < asyncQueue.length; asyncQueuePosition++) {
11872
- try {
11873
- asyncTask = asyncQueue[asyncQueuePosition];
11874
- asyncTask.scope.$eval(asyncTask.expression, asyncTask.locals);
11875
- } catch (e) {
11876
- $exceptionHandler(e);
11877
- }
11878
- lastDirtyWatch = null;
11879
- }
11880
- asyncQueue.length = 0;
11881
-
11882
- traverseScopesLoop:
11883
- do {
11884
- if ((watchers = current.$$watchers)) {
11885
- watchers.$$digestWatchIndex = watchers.length;
11886
- while (watchers.$$digestWatchIndex--) {
11887
- try {
11888
- watch = watchers[watchers.$$digestWatchIndex];
11889
- if (watch) {
11890
- get = watch.get;
11891
- if ((value = get(current)) !== (last = watch.last) &&
11892
- !(watch.eq
11893
- ? equals(value, last)
11894
- : (isNumberNaN(value) && isNumberNaN(last)))) {
11895
- dirty = true;
11896
- lastDirtyWatch = watch;
11897
- watch.last = watch.eq ? copy(value, null) : value;
11898
- fn = watch.fn;
11899
- fn(value, ((last === initWatchVal) ? value : last), current);
11900
- if (ttl < 5) {
11901
- logIdx = 4 - ttl;
11902
- if (!watchLog[logIdx]) watchLog[logIdx] = [];
11903
- watchLog[logIdx].push({
11904
- msg: isFunction(watch.exp) ? 'fn: ' + (watch.exp.name || watch.exp.toString()) : watch.exp,
11905
- newVal: value,
11906
- oldVal: last
11907
- });
11908
- }
11909
- } else if (watch === lastDirtyWatch) {
11910
- dirty = false;
11911
- break traverseScopesLoop;
11912
- }
11913
- }
11914
- } catch (e) {
11915
- $exceptionHandler(e);
11916
- }
11917
- }
11918
- }
11919
-
11920
- if (!(next = ((current.$$watchersCount && current.$$childHead) ||
11921
- (current !== target && current.$$nextSibling)))) {
11922
- while (current !== target && !(next = current.$$nextSibling)) {
11923
- current = current.$parent;
11924
- }
11925
- }
11926
- } while ((current = next));
11927
-
11928
-
11929
- if ((dirty || asyncQueue.length) && !(ttl--)) {
11930
- clearPhase();
11931
- throw $rootScopeMinErr('infdig',
11932
- '{0} $digest() iterations reached. Aborting!\n' +
11933
- 'Watchers fired in the last 5 iterations: {1}',
11934
- TTL, watchLog);
11935
- }
11936
-
11937
- } while (dirty || asyncQueue.length);
11938
-
11939
- clearPhase();
11940
-
11941
- while (postDigestQueuePosition < postDigestQueue.length) {
11942
- try {
11943
- postDigestQueue[postDigestQueuePosition++]();
11944
- } catch (e) {
11945
- $exceptionHandler(e);
11946
- }
11947
- }
11948
- postDigestQueue.length = postDigestQueuePosition = 0;
11949
- },
11950
-
11951
-
11952
-
11953
- $destroy: function() {
11954
- if (this.$$destroyed) return;
11955
- var parent = this.$parent;
11956
-
11957
- this.$broadcast('$destroy');
11958
- this.$$destroyed = true;
11959
-
11960
- if (this === $rootScope) {
11961
- $browser.$$applicationDestroyed();
11962
- }
11963
-
11964
- incrementWatchersCount(this, -this.$$watchersCount);
11965
- for (var eventName in this.$$listenerCount) {
11966
- decrementListenerCount(this, this.$$listenerCount[eventName], eventName);
11967
- }
11968
-
11969
- if (parent && parent.$$childHead === this) parent.$$childHead = this.$$nextSibling;
11970
- if (parent && parent.$$childTail === this) parent.$$childTail = this.$$prevSibling;
11971
- if (this.$$prevSibling) this.$$prevSibling.$$nextSibling = this.$$nextSibling;
11972
- if (this.$$nextSibling) this.$$nextSibling.$$prevSibling = this.$$prevSibling;
11973
-
11974
- this.$destroy = this.$digest = this.$apply = this.$evalAsync = this.$applyAsync = noop;
11975
- this.$on = this.$watch = this.$watchGroup = function() { return noop; };
11976
- this.$$listeners = {};
11977
-
11978
- this.$$nextSibling = null;
11979
- cleanUpScope(this);
11980
- },
11981
-
11982
- $eval: function(expr, locals) {
11983
- return $parse(expr)(this, locals);
11984
- },
11985
-
11986
- $evalAsync: function(expr, locals) {
11987
- if (!$rootScope.$$phase && !asyncQueue.length) {
11988
- $browser.defer(function() {
11989
- if (asyncQueue.length) {
11990
- $rootScope.$digest();
11991
- }
11992
- });
11993
- }
11994
-
11995
- asyncQueue.push({scope: this, expression: $parse(expr), locals: locals});
11996
- },
11997
-
11998
- $$postDigest: function(fn) {
11999
- postDigestQueue.push(fn);
12000
- },
12001
-
12002
- $apply: function(expr) {
12003
- try {
12004
- beginPhase('$apply');
12005
- try {
12006
- return this.$eval(expr);
12007
- } finally {
12008
- clearPhase();
12009
- }
12010
- } catch (e) {
12011
- $exceptionHandler(e);
12012
- } finally {
12013
- try {
12014
- $rootScope.$digest();
12015
- } catch (e) {
12016
- $exceptionHandler(e);
12017
- throw e;
12018
- }
12019
- }
12020
- },
12021
-
12022
- $applyAsync: function(expr) {
12023
- var scope = this;
12024
- if (expr) {
12025
- applyAsyncQueue.push($applyAsyncExpression);
12026
- }
12027
- expr = $parse(expr);
12028
- scheduleApplyAsync();
12029
-
12030
- function $applyAsyncExpression() {
12031
- scope.$eval(expr);
12032
- }
12033
- },
12034
-
12035
- $on: function(name, listener) {
12036
- var namedListeners = this.$$listeners[name];
12037
- if (!namedListeners) {
12038
- this.$$listeners[name] = namedListeners = [];
12039
- }
12040
- namedListeners.push(listener);
12041
-
12042
- var current = this;
12043
- do {
12044
- if (!current.$$listenerCount[name]) {
12045
- current.$$listenerCount[name] = 0;
12046
- }
12047
- current.$$listenerCount[name]++;
12048
- } while ((current = current.$parent));
12049
-
12050
- var self = this;
12051
- return function() {
12052
- var indexOfListener = namedListeners.indexOf(listener);
12053
- if (indexOfListener !== -1) {
12054
- namedListeners[indexOfListener] = null;
12055
- decrementListenerCount(self, 1, name);
12056
- }
12057
- };
12058
- },
12059
-
12060
-
12061
- $emit: function(name, args) {
12062
- var empty = [],
12063
- namedListeners,
12064
- scope = this,
12065
- stopPropagation = false,
12066
- event = {
12067
- name: name,
12068
- targetScope: scope,
12069
- stopPropagation: function() {stopPropagation = true;},
12070
- preventDefault: function() {
12071
- event.defaultPrevented = true;
12072
- },
12073
- defaultPrevented: false
12074
- },
12075
- listenerArgs = concat([event], arguments, 1),
12076
- i, length;
12077
-
12078
- do {
12079
- namedListeners = scope.$$listeners[name] || empty;
12080
- event.currentScope = scope;
12081
- for (i = 0, length = namedListeners.length; i < length; i++) {
12082
-
12083
- if (!namedListeners[i]) {
12084
- namedListeners.splice(i, 1);
12085
- i--;
12086
- length--;
12087
- continue;
12088
- }
12089
- try {
12090
- namedListeners[i].apply(null, listenerArgs);
12091
- } catch (e) {
12092
- $exceptionHandler(e);
12093
- }
12094
- }
12095
- if (stopPropagation) {
12096
- event.currentScope = null;
12097
- return event;
12098
- }
12099
- scope = scope.$parent;
12100
- } while (scope);
12101
-
12102
- event.currentScope = null;
12103
-
12104
- return event;
12105
- },
12106
-
12107
-
12108
- $broadcast: function(name, args) {
12109
- var target = this,
12110
- current = target,
12111
- next = target,
12112
- event = {
12113
- name: name,
12114
- targetScope: target,
12115
- preventDefault: function() {
12116
- event.defaultPrevented = true;
12117
- },
12118
- defaultPrevented: false
12119
- };
12120
-
12121
- if (!target.$$listenerCount[name]) return event;
12122
-
12123
- var listenerArgs = concat([event], arguments, 1),
12124
- listeners, i, length;
12125
-
12126
- while ((current = next)) {
12127
- event.currentScope = current;
12128
- listeners = current.$$listeners[name] || [];
12129
- for (i = 0, length = listeners.length; i < length; i++) {
12130
- if (!listeners[i]) {
12131
- listeners.splice(i, 1);
12132
- i--;
12133
- length--;
12134
- continue;
12135
- }
12136
-
12137
- try {
12138
- listeners[i].apply(null, listenerArgs);
12139
- } catch (e) {
12140
- $exceptionHandler(e);
12141
- }
12142
- }
12143
-
12144
- if (!(next = ((current.$$listenerCount[name] && current.$$childHead) ||
12145
- (current !== target && current.$$nextSibling)))) {
12146
- while (current !== target && !(next = current.$$nextSibling)) {
12147
- current = current.$parent;
12148
- }
12149
- }
12150
- }
12151
-
12152
- event.currentScope = null;
12153
- return event;
12154
- }
12155
- };
12156
-
12157
- var $rootScope = new Scope();
12158
-
12159
- var asyncQueue = $rootScope.$$asyncQueue = [];
12160
- var postDigestQueue = $rootScope.$$postDigestQueue = [];
12161
- var applyAsyncQueue = $rootScope.$$applyAsyncQueue = [];
12162
-
12163
- var postDigestQueuePosition = 0;
12164
-
12165
- return $rootScope;
12166
-
12167
-
12168
- function beginPhase(phase) {
12169
- if ($rootScope.$$phase) {
12170
- throw $rootScopeMinErr('inprog', '{0} already in progress', $rootScope.$$phase);
12171
- }
12172
-
12173
- $rootScope.$$phase = phase;
12174
- }
12175
-
12176
- function clearPhase() {
12177
- $rootScope.$$phase = null;
12178
- }
12179
-
12180
- function incrementWatchersCount(current, count) {
12181
- do {
12182
- current.$$watchersCount += count;
12183
- } while ((current = current.$parent));
12184
- }
12185
-
12186
- function decrementListenerCount(current, count, name) {
12187
- do {
12188
- current.$$listenerCount[name] -= count;
12189
-
12190
- if (current.$$listenerCount[name] === 0) {
12191
- delete current.$$listenerCount[name];
12192
- }
12193
- } while ((current = current.$parent));
12194
- }
12195
-
12196
- function initWatchVal() {}
12197
-
12198
- function flushApplyAsync() {
12199
- while (applyAsyncQueue.length) {
12200
- try {
12201
- applyAsyncQueue.shift()();
12202
- } catch (e) {
12203
- $exceptionHandler(e);
12204
- }
12205
- }
12206
- applyAsyncId = null;
12207
- }
12208
-
12209
- function scheduleApplyAsync() {
12210
- if (applyAsyncId === null) {
12211
- applyAsyncId = $browser.defer(function() {
12212
- $rootScope.$apply(flushApplyAsync);
12213
- });
12214
- }
12215
- }
12216
- }];
12217
- }
12218
-
12219
-
12220
-
12221
-
12222
- function $$SanitizeUriProvider() {
12223
- var aHrefSanitizationWhitelist = /^\s*(https?|ftp|mailto|tel|file):/,
12224
- imgSrcSanitizationWhitelist = /^\s*((https?|ftp|file|blob):|data:image\/)/;
12225
-
12226
- this.aHrefSanitizationWhitelist = function(regexp) {
12227
- if (isDefined(regexp)) {
12228
- aHrefSanitizationWhitelist = regexp;
12229
- return this;
12230
- }
12231
- return aHrefSanitizationWhitelist;
12232
- };
12233
-
12234
-
12235
- this.imgSrcSanitizationWhitelist = function(regexp) {
12236
- if (isDefined(regexp)) {
12237
- imgSrcSanitizationWhitelist = regexp;
12238
- return this;
12239
- }
12240
- return imgSrcSanitizationWhitelist;
12241
- };
12242
-
12243
- this.$get = function() {
12244
- return function sanitizeUri(uri, isImage) {
12245
- var regex = isImage ? imgSrcSanitizationWhitelist : aHrefSanitizationWhitelist;
12246
- var normalizedVal;
12247
- normalizedVal = urlResolve(uri).href;
12248
- if (normalizedVal !== '' && !normalizedVal.match(regex)) {
12249
- return 'unsafe:' + normalizedVal;
12250
- }
12251
- return uri;
12252
- };
12253
- };
12254
- }
12255
-
12256
-
12257
-
12258
- var $sceMinErr = minErr('$sce');
12259
-
12260
- var SCE_CONTEXTS = {
12261
- HTML: 'html',
12262
- CSS: 'css',
12263
- URL: 'url',
12264
- RESOURCE_URL: 'resourceUrl',
12265
- JS: 'js'
12266
- };
12267
-
12268
-
12269
- var UNDERSCORE_LOWERCASE_REGEXP = /_([a-z])/g;
12270
-
12271
- function snakeToCamel(name) {
12272
- return name
12273
- .replace(UNDERSCORE_LOWERCASE_REGEXP, fnCamelCaseReplace);
12274
- }
12275
-
12276
- function adjustMatcher(matcher) {
12277
- if (matcher === 'self') {
12278
- return matcher;
12279
- } else if (isString(matcher)) {
12280
- if (matcher.indexOf('***') > -1) {
12281
- throw $sceMinErr('iwcard',
12282
- 'Illegal sequence *** in string matcher. String: {0}', matcher);
12283
- }
12284
- matcher = escapeForRegexp(matcher).
12285
- replace(/\\\*\\\*/g, '.*').
12286
- replace(/\\\*/g, '[^:/.?&;]*');
12287
- return new RegExp('^' + matcher + '$');
12288
- } else if (isRegExp(matcher)) {
12289
- return new RegExp('^' + matcher.source + '$');
12290
- } else {
12291
- throw $sceMinErr('imatcher',
12292
- 'Matchers may only be "self", string patterns or RegExp objects');
12293
- }
12294
- }
12295
-
12296
-
12297
- function adjustMatchers(matchers) {
12298
- var adjustedMatchers = [];
12299
- if (isDefined(matchers)) {
12300
- forEach(matchers, function(matcher) {
12301
- adjustedMatchers.push(adjustMatcher(matcher));
12302
- });
12303
- }
12304
- return adjustedMatchers;
12305
- }
12306
-
12307
-
12308
-
12309
-
12310
- function $SceDelegateProvider() {
12311
- this.SCE_CONTEXTS = SCE_CONTEXTS;
12312
-
12313
- var resourceUrlWhitelist = ['self'],
12314
- resourceUrlBlacklist = [];
12315
-
12316
- this.resourceUrlWhitelist = function(value) {
12317
- if (arguments.length) {
12318
- resourceUrlWhitelist = adjustMatchers(value);
12319
- }
12320
- return resourceUrlWhitelist;
12321
- };
12322
-
12323
-
12324
- this.resourceUrlBlacklist = function(value) {
12325
- if (arguments.length) {
12326
- resourceUrlBlacklist = adjustMatchers(value);
12327
- }
12328
- return resourceUrlBlacklist;
12329
- };
12330
-
12331
- this.$get = ['$injector', function($injector) {
12332
-
12333
- var htmlSanitizer = function htmlSanitizer(html) {
12334
- throw $sceMinErr('unsafe', 'Attempting to use an unsafe value in a safe context.');
12335
- };
12336
-
12337
- if ($injector.has('$sanitize')) {
12338
- htmlSanitizer = $injector.get('$sanitize');
12339
- }
12340
-
12341
-
12342
- function matchUrl(matcher, parsedUrl) {
12343
- if (matcher === 'self') {
12344
- return urlIsSameOrigin(parsedUrl);
12345
- } else {
12346
- return !!matcher.exec(parsedUrl.href);
12347
- }
12348
- }
12349
-
12350
- function isResourceUrlAllowedByPolicy(url) {
12351
- var parsedUrl = urlResolve(url.toString());
12352
- var i, n, allowed = false;
12353
- for (i = 0, n = resourceUrlWhitelist.length; i < n; i++) {
12354
- if (matchUrl(resourceUrlWhitelist[i], parsedUrl)) {
12355
- allowed = true;
12356
- break;
12357
- }
12358
- }
12359
- if (allowed) {
12360
- for (i = 0, n = resourceUrlBlacklist.length; i < n; i++) {
12361
- if (matchUrl(resourceUrlBlacklist[i], parsedUrl)) {
12362
- allowed = false;
12363
- break;
12364
- }
12365
- }
12366
- }
12367
- return allowed;
12368
- }
12369
-
12370
- function generateHolderType(Base) {
12371
- var holderType = function TrustedValueHolderType(trustedValue) {
12372
- this.$$unwrapTrustedValue = function() {
12373
- return trustedValue;
12374
- };
12375
- };
12376
- if (Base) {
12377
- holderType.prototype = new Base();
12378
- }
12379
- holderType.prototype.valueOf = function sceValueOf() {
12380
- return this.$$unwrapTrustedValue();
12381
- };
12382
- holderType.prototype.toString = function sceToString() {
12383
- return this.$$unwrapTrustedValue().toString();
12384
- };
12385
- return holderType;
12386
- }
12387
-
12388
- var trustedValueHolderBase = generateHolderType(),
12389
- byType = {};
12390
-
12391
- byType[SCE_CONTEXTS.HTML] = generateHolderType(trustedValueHolderBase);
12392
- byType[SCE_CONTEXTS.CSS] = generateHolderType(trustedValueHolderBase);
12393
- byType[SCE_CONTEXTS.URL] = generateHolderType(trustedValueHolderBase);
12394
- byType[SCE_CONTEXTS.JS] = generateHolderType(trustedValueHolderBase);
12395
- byType[SCE_CONTEXTS.RESOURCE_URL] = generateHolderType(byType[SCE_CONTEXTS.URL]);
12396
-
12397
- function trustAs(type, trustedValue) {
12398
- var Constructor = (byType.hasOwnProperty(type) ? byType[type] : null);
12399
- if (!Constructor) {
12400
- throw $sceMinErr('icontext',
12401
- 'Attempted to trust a value in invalid context. Context: {0}; Value: {1}',
12402
- type, trustedValue);
12403
- }
12404
- if (trustedValue === null || isUndefined(trustedValue) || trustedValue === '') {
12405
- return trustedValue;
12406
- }
12407
- if (typeof trustedValue !== 'string') {
12408
- throw $sceMinErr('itype',
12409
- 'Attempted to trust a non-string value in a content requiring a string: Context: {0}',
12410
- type);
12411
- }
12412
- return new Constructor(trustedValue);
12413
- }
12414
-
12415
- function valueOf(maybeTrusted) {
12416
- if (maybeTrusted instanceof trustedValueHolderBase) {
12417
- return maybeTrusted.$$unwrapTrustedValue();
12418
- } else {
12419
- return maybeTrusted;
12420
- }
12421
- }
12422
-
12423
- function getTrusted(type, maybeTrusted) {
12424
- if (maybeTrusted === null || isUndefined(maybeTrusted) || maybeTrusted === '') {
12425
- return maybeTrusted;
12426
- }
12427
- var constructor = (byType.hasOwnProperty(type) ? byType[type] : null);
12428
- if (constructor && maybeTrusted instanceof constructor) {
12429
- return maybeTrusted.$$unwrapTrustedValue();
12430
- }
12431
- if (type === SCE_CONTEXTS.RESOURCE_URL) {
12432
- if (isResourceUrlAllowedByPolicy(maybeTrusted)) {
12433
- return maybeTrusted;
12434
- } else {
12435
- throw $sceMinErr('insecurl',
12436
- 'Blocked loading resource from url not allowed by $sceDelegate policy. URL: {0}',
12437
- maybeTrusted.toString());
12438
- }
12439
- } else if (type === SCE_CONTEXTS.HTML) {
12440
- return htmlSanitizer(maybeTrusted);
12441
- }
12442
- throw $sceMinErr('unsafe', 'Attempting to use an unsafe value in a safe context.');
12443
- }
12444
-
12445
- return { trustAs: trustAs,
12446
- getTrusted: getTrusted,
12447
- valueOf: valueOf };
12448
- }];
12449
- }
12450
-
12451
-
12452
-
12453
-
12454
- function $SceProvider() {
12455
- var enabled = true;
12456
-
12457
- this.enabled = function(value) {
12458
- if (arguments.length) {
12459
- enabled = !!value;
12460
- }
12461
- return enabled;
12462
- };
12463
-
12464
-
12465
-
12466
- this.$get = ['$parse', '$sceDelegate', function(
12467
- $parse, $sceDelegate) {
12468
- if (enabled && msie < 8) {
12469
- throw $sceMinErr('iequirks',
12470
- 'Strict Contextual Escaping does not support Internet Explorer version < 11 in quirks ' +
12471
- 'mode. You can fix this by adding the text <!doctype html> to the top of your HTML ' +
12472
- 'document. See http://docs.angularjs.org/api/ng.$sce for more information.');
12473
- }
12474
-
12475
- var sce = shallowCopy(SCE_CONTEXTS);
12476
-
12477
- sce.isEnabled = function() {
12478
- return enabled;
12479
- };
12480
- sce.trustAs = $sceDelegate.trustAs;
12481
- sce.getTrusted = $sceDelegate.getTrusted;
12482
- sce.valueOf = $sceDelegate.valueOf;
12483
-
12484
- if (!enabled) {
12485
- sce.trustAs = sce.getTrusted = function(type, value) { return value; };
12486
- sce.valueOf = identity;
12487
- }
12488
-
12489
- sce.parseAs = function sceParseAs(type, expr) {
12490
- var parsed = $parse(expr);
12491
- if (parsed.literal && parsed.constant) {
12492
- return parsed;
12493
- } else {
12494
- return $parse(expr, function(value) {
12495
- return sce.getTrusted(type, value);
12496
- });
12497
- }
12498
- };
12499
-
12500
-
12501
-
12502
-
12503
-
12504
-
12505
-
12506
-
12507
-
12508
-
12509
-
12510
-
12511
-
12512
-
12513
-
12514
-
12515
-
12516
- var parse = sce.parseAs,
12517
- getTrusted = sce.getTrusted,
12518
- trustAs = sce.trustAs;
12519
-
12520
- forEach(SCE_CONTEXTS, function(enumValue, name) {
12521
- var lName = lowercase(name);
12522
- sce[snakeToCamel('parse_as_' + lName)] = function(expr) {
12523
- return parse(enumValue, expr);
12524
- };
12525
- sce[snakeToCamel('get_trusted_' + lName)] = function(value) {
12526
- return getTrusted(enumValue, value);
12527
- };
12528
- sce[snakeToCamel('trust_as_' + lName)] = function(value) {
12529
- return trustAs(enumValue, value);
12530
- };
12531
- });
12532
-
12533
- return sce;
12534
- }];
12535
- }
12536
-
12537
-
12538
- function $SnifferProvider() {
12539
- this.$get = ['$window', '$document', function($window, $document) {
12540
- var eventSupport = {},
12541
- isChromePackagedApp =
12542
- $window.chrome &&
12543
- ($window.chrome.app && $window.chrome.app.runtime ||
12544
- !$window.chrome.app && $window.chrome.runtime && $window.chrome.runtime.id),
12545
- hasHistoryPushState = !isChromePackagedApp && $window.history && $window.history.pushState,
12546
- android =
12547
- toInt((/android (\d+)/.exec(lowercase(($window.navigator || {}).userAgent)) || [])[1]),
12548
- boxee = /Boxee/i.test(($window.navigator || {}).userAgent),
12549
- document = $document[0] || {},
12550
- bodyStyle = document.body && document.body.style,
12551
- transitions = false,
12552
- animations = false;
12553
-
12554
- if (bodyStyle) {
12555
- transitions = !!('transition' in bodyStyle || 'webkitTransition' in bodyStyle);
12556
- animations = !!('animation' in bodyStyle || 'webkitAnimation' in bodyStyle);
12557
- }
12558
-
12559
-
12560
- return {
12561
-
12562
- history: !!(hasHistoryPushState && !(android < 4) && !boxee),
12563
- hasEvent: function(event) {
12564
- if (event === 'input' && msie) return false;
12565
-
12566
- if (isUndefined(eventSupport[event])) {
12567
- var divElm = document.createElement('div');
12568
- eventSupport[event] = 'on' + event in divElm;
12569
- }
12570
-
12571
- return eventSupport[event];
12572
- },
12573
- csp: csp(),
12574
- transitions: transitions,
12575
- animations: animations,
12576
- android: android
12577
- };
12578
- }];
12579
- }
12580
-
12581
- var $templateRequestMinErr = minErr('$compile');
12582
-
12583
- function $TemplateRequestProvider() {
12584
-
12585
- var httpOptions;
12586
-
12587
- this.httpOptions = function(val) {
12588
- if (val) {
12589
- httpOptions = val;
12590
- return this;
12591
- }
12592
- return httpOptions;
12593
- };
12594
-
12595
- this.$get = ['$exceptionHandler', '$templateCache', '$http', '$q', '$sce',
12596
- function($exceptionHandler, $templateCache, $http, $q, $sce) {
12597
-
12598
- function handleRequestFn(tpl, ignoreRequestError) {
12599
- handleRequestFn.totalPendingRequests++;
12600
-
12601
- if (!isString(tpl) || isUndefined($templateCache.get(tpl))) {
12602
- tpl = $sce.getTrustedResourceUrl(tpl);
12603
- }
12604
-
12605
- var transformResponse = $http.defaults && $http.defaults.transformResponse;
12606
-
12607
- if (isArray(transformResponse)) {
12608
- transformResponse = transformResponse.filter(function(transformer) {
12609
- return transformer !== defaultHttpResponseTransform;
12610
- });
12611
- } else if (transformResponse === defaultHttpResponseTransform) {
12612
- transformResponse = null;
12613
- }
12614
-
12615
- return $http.get(tpl, extend({
12616
- cache: $templateCache,
12617
- transformResponse: transformResponse
12618
- }, httpOptions))
12619
- .finally(function() {
12620
- handleRequestFn.totalPendingRequests--;
12621
- })
12622
- .then(function(response) {
12623
- $templateCache.put(tpl, response.data);
12624
- return response.data;
12625
- }, handleError);
12626
-
12627
- function handleError(resp) {
12628
- if (!ignoreRequestError) {
12629
- resp = $templateRequestMinErr('tpload',
12630
- 'Failed to load template: {0} (HTTP status: {1} {2})',
12631
- tpl, resp.status, resp.statusText);
12632
-
12633
- $exceptionHandler(resp);
12634
- }
12635
-
12636
- return $q.reject(resp);
12637
- }
12638
- }
12639
-
12640
- handleRequestFn.totalPendingRequests = 0;
12641
-
12642
- return handleRequestFn;
12643
- }
12644
- ];
12645
- }
12646
-
12647
- function $$TestabilityProvider() {
12648
- this.$get = ['$rootScope', '$browser', '$location',
12649
- function($rootScope, $browser, $location) {
12650
-
12651
- var testability = {};
12652
-
12653
- testability.findBindings = function(element, expression, opt_exactMatch) {
12654
- var bindings = element.getElementsByClassName('ng-binding');
12655
- var matches = [];
12656
- forEach(bindings, function(binding) {
12657
- var dataBinding = angular.element(binding).data('$binding');
12658
- if (dataBinding) {
12659
- forEach(dataBinding, function(bindingName) {
12660
- if (opt_exactMatch) {
12661
- var matcher = new RegExp('(^|\\s)' + escapeForRegexp(expression) + '(\\s|\\||$)');
12662
- if (matcher.test(bindingName)) {
12663
- matches.push(binding);
12664
- }
12665
- } else {
12666
- if (bindingName.indexOf(expression) !== -1) {
12667
- matches.push(binding);
12668
- }
12669
- }
12670
- });
12671
- }
12672
- });
12673
- return matches;
12674
- };
12675
-
12676
- testability.findModels = function(element, expression, opt_exactMatch) {
12677
- var prefixes = ['ng-', 'data-ng-', 'ng\\:'];
12678
- for (var p = 0; p < prefixes.length; ++p) {
12679
- var attributeEquals = opt_exactMatch ? '=' : '*=';
12680
- var selector = '[' + prefixes[p] + 'model' + attributeEquals + '"' + expression + '"]';
12681
- var elements = element.querySelectorAll(selector);
12682
- if (elements.length) {
12683
- return elements;
12684
- }
12685
- }
12686
- };
12687
-
12688
- testability.getLocation = function() {
12689
- return $location.url();
12690
- };
12691
-
12692
- testability.setLocation = function(url) {
12693
- if (url !== $location.url()) {
12694
- $location.url(url);
12695
- $rootScope.$digest();
12696
- }
12697
- };
12698
-
12699
- testability.whenStable = function(callback) {
12700
- $browser.notifyWhenNoOutstandingRequests(callback);
12701
- };
12702
-
12703
- return testability;
12704
- }];
12705
- }
12706
-
12707
- function $TimeoutProvider() {
12708
- this.$get = ['$rootScope', '$browser', '$q', '$$q', '$exceptionHandler',
12709
- function($rootScope, $browser, $q, $$q, $exceptionHandler) {
12710
-
12711
- var deferreds = {};
12712
-
12713
-
12714
- function timeout(fn, delay, invokeApply) {
12715
- if (!isFunction(fn)) {
12716
- invokeApply = delay;
12717
- delay = fn;
12718
- fn = noop;
12719
- }
12720
-
12721
- var args = sliceArgs(arguments, 3),
12722
- skipApply = (isDefined(invokeApply) && !invokeApply),
12723
- deferred = (skipApply ? $$q : $q).defer(),
12724
- promise = deferred.promise,
12725
- timeoutId;
12726
-
12727
- timeoutId = $browser.defer(function() {
12728
- try {
12729
- deferred.resolve(fn.apply(null, args));
12730
- } catch (e) {
12731
- deferred.reject(e);
12732
- $exceptionHandler(e);
12733
- } finally {
12734
- delete deferreds[promise.$$timeoutId];
12735
- }
12736
-
12737
- if (!skipApply) $rootScope.$apply();
12738
- }, delay);
12739
-
12740
- promise.$$timeoutId = timeoutId;
12741
- deferreds[timeoutId] = deferred;
12742
-
12743
- return promise;
12744
- }
12745
-
12746
-
12747
- timeout.cancel = function(promise) {
12748
- if (promise && promise.$$timeoutId in deferreds) {
12749
- deferreds[promise.$$timeoutId].promise.catch(noop);
12750
- deferreds[promise.$$timeoutId].reject('canceled');
12751
- delete deferreds[promise.$$timeoutId];
12752
- return $browser.defer.cancel(promise.$$timeoutId);
12753
- }
12754
- return false;
12755
- };
12756
-
12757
- return timeout;
12758
- }];
12759
- }
12760
-
12761
- var urlParsingNode = window.document.createElement('a');
12762
- var originUrl = urlResolve(window.location.href);
12763
-
12764
-
12765
- function urlResolve(url) {
12766
- var href = url;
12767
-
12768
- if (msie) {
12769
- urlParsingNode.setAttribute('href', href);
12770
- href = urlParsingNode.href;
12771
- }
12772
-
12773
- urlParsingNode.setAttribute('href', href);
12774
-
12775
- return {
12776
- href: urlParsingNode.href,
12777
- protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
12778
- host: urlParsingNode.host,
12779
- search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
12780
- hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
12781
- hostname: urlParsingNode.hostname,
12782
- port: urlParsingNode.port,
12783
- pathname: (urlParsingNode.pathname.charAt(0) === '/')
12784
- ? urlParsingNode.pathname
12785
- : '/' + urlParsingNode.pathname
12786
- };
12787
- }
12788
-
12789
- function urlIsSameOrigin(requestUrl) {
12790
- var parsed = (isString(requestUrl)) ? urlResolve(requestUrl) : requestUrl;
12791
- return (parsed.protocol === originUrl.protocol &&
12792
- parsed.host === originUrl.host);
12793
- }
12794
-
12795
- function $WindowProvider() {
12796
- this.$get = valueFn(window);
12797
- }
12798
-
12799
- function $$CookieReader($document) {
12800
- var rawDocument = $document[0] || {};
12801
- var lastCookies = {};
12802
- var lastCookieString = '';
12803
-
12804
- function safeGetCookie(rawDocument) {
12805
- try {
12806
- return rawDocument.cookie || '';
12807
- } catch (e) {
12808
- return '';
12809
- }
12810
- }
12811
-
12812
- function safeDecodeURIComponent(str) {
12813
- try {
12814
- return decodeURIComponent(str);
12815
- } catch (e) {
12816
- return str;
12817
- }
12818
- }
12819
-
12820
- return function() {
12821
- var cookieArray, cookie, i, index, name;
12822
- var currentCookieString = safeGetCookie(rawDocument);
12823
-
12824
- if (currentCookieString !== lastCookieString) {
12825
- lastCookieString = currentCookieString;
12826
- cookieArray = lastCookieString.split('; ');
12827
- lastCookies = {};
12828
-
12829
- for (i = 0; i < cookieArray.length; i++) {
12830
- cookie = cookieArray[i];
12831
- index = cookie.indexOf('=');
12832
- if (index > 0) {
12833
- name = safeDecodeURIComponent(cookie.substring(0, index));
12834
- if (isUndefined(lastCookies[name])) {
12835
- lastCookies[name] = safeDecodeURIComponent(cookie.substring(index + 1));
12836
- }
12837
- }
12838
- }
12839
- }
12840
- return lastCookies;
12841
- };
12842
- }
12843
-
12844
- $$CookieReader.$inject = ['$document'];
12845
-
12846
- function $$CookieReaderProvider() {
12847
- this.$get = $$CookieReader;
12848
- }
12849
-
12850
-
12851
-
12852
- $FilterProvider.$inject = ['$provide'];
12853
- function $FilterProvider($provide) {
12854
- var suffix = 'Filter';
12855
-
12856
- function register(name, factory) {
12857
- if (isObject(name)) {
12858
- var filters = {};
12859
- forEach(name, function(filter, key) {
12860
- filters[key] = register(key, filter);
12861
- });
12862
- return filters;
12863
- } else {
12864
- return $provide.factory(name + suffix, factory);
12865
- }
12866
- }
12867
- this.register = register;
12868
-
12869
- this.$get = ['$injector', function($injector) {
12870
- return function(name) {
12871
- return $injector.get(name + suffix);
12872
- };
12873
- }];
12874
-
12875
-
12876
-
12877
- register('currency', currencyFilter);
12878
- register('date', dateFilter);
12879
- register('filter', filterFilter);
12880
- register('json', jsonFilter);
12881
- register('limitTo', limitToFilter);
12882
- register('lowercase', lowercaseFilter);
12883
- register('number', numberFilter);
12884
- register('orderBy', orderByFilter);
12885
- register('uppercase', uppercaseFilter);
12886
- }
12887
-
12888
-
12889
- function filterFilter() {
12890
- return function(array, expression, comparator, anyPropertyKey) {
12891
- if (!isArrayLike(array)) {
12892
- if (array == null) {
12893
- return array;
12894
- } else {
12895
- throw minErr('filter')('notarray', 'Expected array but received: {0}', array);
12896
- }
12897
- }
12898
-
12899
- anyPropertyKey = anyPropertyKey || '$';
12900
- var expressionType = getTypeForFilter(expression);
12901
- var predicateFn;
12902
- var matchAgainstAnyProp;
12903
-
12904
- switch (expressionType) {
12905
- case 'function':
12906
- predicateFn = expression;
12907
- break;
12908
- case 'boolean':
12909
- case 'null':
12910
- case 'number':
12911
- case 'string':
12912
- matchAgainstAnyProp = true;
12913
- case 'object':
12914
- predicateFn = createPredicateFn(expression, comparator, anyPropertyKey, matchAgainstAnyProp);
12915
- break;
12916
- default:
12917
- return array;
12918
- }
12919
-
12920
- return Array.prototype.filter.call(array, predicateFn);
12921
- };
12922
- }
12923
-
12924
- function createPredicateFn(expression, comparator, anyPropertyKey, matchAgainstAnyProp) {
12925
- var shouldMatchPrimitives = isObject(expression) && (anyPropertyKey in expression);
12926
- var predicateFn;
12927
-
12928
- if (comparator === true) {
12929
- comparator = equals;
12930
- } else if (!isFunction(comparator)) {
12931
- comparator = function(actual, expected) {
12932
- if (isUndefined(actual)) {
12933
- return false;
12934
- }
12935
- if ((actual === null) || (expected === null)) {
12936
- return actual === expected;
12937
- }
12938
- if (isObject(expected) || (isObject(actual) && !hasCustomToString(actual))) {
12939
- return false;
12940
- }
12941
-
12942
- actual = lowercase('' + actual);
12943
- expected = lowercase('' + expected);
12944
- return actual.indexOf(expected) !== -1;
12945
- };
12946
- }
12947
-
12948
- predicateFn = function(item) {
12949
- if (shouldMatchPrimitives && !isObject(item)) {
12950
- return deepCompare(item, expression[anyPropertyKey], comparator, anyPropertyKey, false);
12951
- }
12952
- return deepCompare(item, expression, comparator, anyPropertyKey, matchAgainstAnyProp);
12953
- };
12954
-
12955
- return predicateFn;
12956
- }
12957
-
12958
- function deepCompare(actual, expected, comparator, anyPropertyKey, matchAgainstAnyProp, dontMatchWholeObject) {
12959
- var actualType = getTypeForFilter(actual);
12960
- var expectedType = getTypeForFilter(expected);
12961
-
12962
- if ((expectedType === 'string') && (expected.charAt(0) === '!')) {
12963
- return !deepCompare(actual, expected.substring(1), comparator, anyPropertyKey, matchAgainstAnyProp);
12964
- } else if (isArray(actual)) {
12965
- return actual.some(function(item) {
12966
- return deepCompare(item, expected, comparator, anyPropertyKey, matchAgainstAnyProp);
12967
- });
12968
- }
12969
-
12970
- switch (actualType) {
12971
- case 'object':
12972
- var key;
12973
- if (matchAgainstAnyProp) {
12974
- for (key in actual) {
12975
- if ((key.charAt(0) !== '$') && deepCompare(actual[key], expected, comparator, anyPropertyKey, true)) {
12976
- return true;
12977
- }
12978
- }
12979
- return dontMatchWholeObject ? false : deepCompare(actual, expected, comparator, anyPropertyKey, false);
12980
- } else if (expectedType === 'object') {
12981
- for (key in expected) {
12982
- var expectedVal = expected[key];
12983
- if (isFunction(expectedVal) || isUndefined(expectedVal)) {
12984
- continue;
12985
- }
12986
-
12987
- var matchAnyProperty = key === anyPropertyKey;
12988
- var actualVal = matchAnyProperty ? actual : actual[key];
12989
- if (!deepCompare(actualVal, expectedVal, comparator, anyPropertyKey, matchAnyProperty, matchAnyProperty)) {
12990
- return false;
12991
- }
12992
- }
12993
- return true;
12994
- } else {
12995
- return comparator(actual, expected);
12996
- }
12997
- case 'function':
12998
- return false;
12999
- default:
13000
- return comparator(actual, expected);
13001
- }
13002
- }
13003
-
13004
- function getTypeForFilter(val) {
13005
- return (val === null) ? 'null' : typeof val;
13006
- }
13007
-
13008
- var MAX_DIGITS = 22;
13009
- var DECIMAL_SEP = '.';
13010
- var ZERO_CHAR = '0';
13011
-
13012
- currencyFilter.$inject = ['$locale'];
13013
- function currencyFilter($locale) {
13014
- var formats = $locale.NUMBER_FORMATS;
13015
- return function(amount, currencySymbol, fractionSize) {
13016
- if (isUndefined(currencySymbol)) {
13017
- currencySymbol = formats.CURRENCY_SYM;
13018
- }
13019
-
13020
- if (isUndefined(fractionSize)) {
13021
- fractionSize = formats.PATTERNS[1].maxFrac;
13022
- }
13023
-
13024
- return (amount == null)
13025
- ? amount
13026
- : formatNumber(amount, formats.PATTERNS[1], formats.GROUP_SEP, formats.DECIMAL_SEP, fractionSize).
13027
- replace(/\u00A4/g, currencySymbol);
13028
- };
13029
- }
13030
-
13031
- numberFilter.$inject = ['$locale'];
13032
- function numberFilter($locale) {
13033
- var formats = $locale.NUMBER_FORMATS;
13034
- return function(number, fractionSize) {
13035
-
13036
- return (number == null)
13037
- ? number
13038
- : formatNumber(number, formats.PATTERNS[0], formats.GROUP_SEP, formats.DECIMAL_SEP,
13039
- fractionSize);
13040
- };
13041
- }
13042
-
13043
- function parse(numStr) {
13044
- var exponent = 0, digits, numberOfIntegerDigits;
13045
- var i, j, zeros;
13046
-
13047
- if ((numberOfIntegerDigits = numStr.indexOf(DECIMAL_SEP)) > -1) {
13048
- numStr = numStr.replace(DECIMAL_SEP, '');
13049
- }
13050
-
13051
- if ((i = numStr.search(/e/i)) > 0) {
13052
- if (numberOfIntegerDigits < 0) numberOfIntegerDigits = i;
13053
- numberOfIntegerDigits += +numStr.slice(i + 1);
13054
- numStr = numStr.substring(0, i);
13055
- } else if (numberOfIntegerDigits < 0) {
13056
- numberOfIntegerDigits = numStr.length;
13057
- }
13058
-
13059
- for (i = 0; numStr.charAt(i) === ZERO_CHAR; i++) { }
13060
-
13061
- if (i === (zeros = numStr.length)) {
13062
- digits = [0];
13063
- numberOfIntegerDigits = 1;
13064
- } else {
13065
- zeros--;
13066
- while (numStr.charAt(zeros) === ZERO_CHAR) zeros--;
13067
-
13068
- numberOfIntegerDigits -= i;
13069
- digits = [];
13070
- for (j = 0; i <= zeros; i++, j++) {
13071
- digits[j] = +numStr.charAt(i);
13072
- }
13073
- }
13074
-
13075
- if (numberOfIntegerDigits > MAX_DIGITS) {
13076
- digits = digits.splice(0, MAX_DIGITS - 1);
13077
- exponent = numberOfIntegerDigits - 1;
13078
- numberOfIntegerDigits = 1;
13079
- }
13080
-
13081
- return { d: digits, e: exponent, i: numberOfIntegerDigits };
13082
- }
13083
-
13084
- function roundNumber(parsedNumber, fractionSize, minFrac, maxFrac) {
13085
- var digits = parsedNumber.d;
13086
- var fractionLen = digits.length - parsedNumber.i;
13087
-
13088
- fractionSize = (isUndefined(fractionSize)) ? Math.min(Math.max(minFrac, fractionLen), maxFrac) : +fractionSize;
13089
-
13090
- var roundAt = fractionSize + parsedNumber.i;
13091
- var digit = digits[roundAt];
13092
-
13093
- if (roundAt > 0) {
13094
- digits.splice(Math.max(parsedNumber.i, roundAt));
13095
-
13096
- for (var j = roundAt; j < digits.length; j++) {
13097
- digits[j] = 0;
13098
- }
13099
- } else {
13100
- fractionLen = Math.max(0, fractionLen);
13101
- parsedNumber.i = 1;
13102
- digits.length = Math.max(1, roundAt = fractionSize + 1);
13103
- digits[0] = 0;
13104
- for (var i = 1; i < roundAt; i++) digits[i] = 0;
13105
- }
13106
-
13107
- if (digit >= 5) {
13108
- if (roundAt - 1 < 0) {
13109
- for (var k = 0; k > roundAt; k--) {
13110
- digits.unshift(0);
13111
- parsedNumber.i++;
13112
- }
13113
- digits.unshift(1);
13114
- parsedNumber.i++;
13115
- } else {
13116
- digits[roundAt - 1]++;
13117
- }
13118
- }
13119
-
13120
- for (; fractionLen < Math.max(0, fractionSize); fractionLen++) digits.push(0);
13121
-
13122
-
13123
- var carry = digits.reduceRight(function(carry, d, i, digits) {
13124
- d = d + carry;
13125
- digits[i] = d % 10;
13126
- return Math.floor(d / 10);
13127
- }, 0);
13128
- if (carry) {
13129
- digits.unshift(carry);
13130
- parsedNumber.i++;
13131
- }
13132
- }
13133
-
13134
- function formatNumber(number, pattern, groupSep, decimalSep, fractionSize) {
13135
-
13136
- if (!(isString(number) || isNumber(number)) || isNaN(number)) return '';
13137
-
13138
- var isInfinity = !isFinite(number);
13139
- var isZero = false;
13140
- var numStr = Math.abs(number) + '',
13141
- formattedText = '',
13142
- parsedNumber;
13143
-
13144
- if (isInfinity) {
13145
- formattedText = '\u221e';
13146
- } else {
13147
- parsedNumber = parse(numStr);
13148
-
13149
- roundNumber(parsedNumber, fractionSize, pattern.minFrac, pattern.maxFrac);
13150
-
13151
- var digits = parsedNumber.d;
13152
- var integerLen = parsedNumber.i;
13153
- var exponent = parsedNumber.e;
13154
- var decimals = [];
13155
- isZero = digits.reduce(function(isZero, d) { return isZero && !d; }, true);
13156
-
13157
- while (integerLen < 0) {
13158
- digits.unshift(0);
13159
- integerLen++;
13160
- }
13161
-
13162
- if (integerLen > 0) {
13163
- decimals = digits.splice(integerLen, digits.length);
13164
- } else {
13165
- decimals = digits;
13166
- digits = [0];
13167
- }
13168
-
13169
- var groups = [];
13170
- if (digits.length >= pattern.lgSize) {
13171
- groups.unshift(digits.splice(-pattern.lgSize, digits.length).join(''));
13172
- }
13173
- while (digits.length > pattern.gSize) {
13174
- groups.unshift(digits.splice(-pattern.gSize, digits.length).join(''));
13175
- }
13176
- if (digits.length) {
13177
- groups.unshift(digits.join(''));
13178
- }
13179
- formattedText = groups.join(groupSep);
13180
-
13181
- if (decimals.length) {
13182
- formattedText += decimalSep + decimals.join('');
13183
- }
13184
-
13185
- if (exponent) {
13186
- formattedText += 'e+' + exponent;
13187
- }
13188
- }
13189
- if (number < 0 && !isZero) {
13190
- return pattern.negPre + formattedText + pattern.negSuf;
13191
- } else {
13192
- return pattern.posPre + formattedText + pattern.posSuf;
13193
- }
13194
- }
13195
-
13196
- function padNumber(num, digits, trim, negWrap) {
13197
- var neg = '';
13198
- if (num < 0 || (negWrap && num <= 0)) {
13199
- if (negWrap) {
13200
- num = -num + 1;
13201
- } else {
13202
- num = -num;
13203
- neg = '-';
13204
- }
13205
- }
13206
- num = '' + num;
13207
- while (num.length < digits) num = ZERO_CHAR + num;
13208
- if (trim) {
13209
- num = num.substr(num.length - digits);
13210
- }
13211
- return neg + num;
13212
- }
13213
-
13214
-
13215
- function dateGetter(name, size, offset, trim, negWrap) {
13216
- offset = offset || 0;
13217
- return function(date) {
13218
- var value = date['get' + name]();
13219
- if (offset > 0 || value > -offset) {
13220
- value += offset;
13221
- }
13222
- if (value === 0 && offset === -12) value = 12;
13223
- return padNumber(value, size, trim, negWrap);
13224
- };
13225
- }
13226
-
13227
- function dateStrGetter(name, shortForm, standAlone) {
13228
- return function(date, formats) {
13229
- var value = date['get' + name]();
13230
- var propPrefix = (standAlone ? 'STANDALONE' : '') + (shortForm ? 'SHORT' : '');
13231
- var get = uppercase(propPrefix + name);
13232
-
13233
- return formats[get][value];
13234
- };
13235
- }
13236
-
13237
- function timeZoneGetter(date, formats, offset) {
13238
- var zone = -1 * offset;
13239
- var paddedZone = (zone >= 0) ? '+' : '';
13240
-
13241
- paddedZone += padNumber(Math[zone > 0 ? 'floor' : 'ceil'](zone / 60), 2) +
13242
- padNumber(Math.abs(zone % 60), 2);
13243
-
13244
- return paddedZone;
13245
- }
13246
-
13247
- function getFirstThursdayOfYear(year) {
13248
- var dayOfWeekOnFirst = (new Date(year, 0, 1)).getDay();
13249
- return new Date(year, 0, ((dayOfWeekOnFirst <= 4) ? 5 : 12) - dayOfWeekOnFirst);
13250
- }
13251
-
13252
- function getThursdayThisWeek(datetime) {
13253
- return new Date(datetime.getFullYear(), datetime.getMonth(),
13254
- datetime.getDate() + (4 - datetime.getDay()));
13255
- }
13256
-
13257
- function weekGetter(size) {
13258
- return function(date) {
13259
- var firstThurs = getFirstThursdayOfYear(date.getFullYear()),
13260
- thisThurs = getThursdayThisWeek(date);
13261
-
13262
- var diff = +thisThurs - +firstThurs,
13263
- result = 1 + Math.round(diff / 6.048e8);
13264
-
13265
- return padNumber(result, size);
13266
- };
13267
- }
13268
-
13269
- function ampmGetter(date, formats) {
13270
- return date.getHours() < 12 ? formats.AMPMS[0] : formats.AMPMS[1];
13271
- }
13272
-
13273
- function eraGetter(date, formats) {
13274
- return date.getFullYear() <= 0 ? formats.ERAS[0] : formats.ERAS[1];
13275
- }
13276
-
13277
- function longEraGetter(date, formats) {
13278
- return date.getFullYear() <= 0 ? formats.ERANAMES[0] : formats.ERANAMES[1];
13279
- }
13280
-
13281
- var DATE_FORMATS = {
13282
- yyyy: dateGetter('FullYear', 4, 0, false, true),
13283
- yy: dateGetter('FullYear', 2, 0, true, true),
13284
- y: dateGetter('FullYear', 1, 0, false, true),
13285
- MMMM: dateStrGetter('Month'),
13286
- MMM: dateStrGetter('Month', true),
13287
- MM: dateGetter('Month', 2, 1),
13288
- M: dateGetter('Month', 1, 1),
13289
- LLLL: dateStrGetter('Month', false, true),
13290
- dd: dateGetter('Date', 2),
13291
- d: dateGetter('Date', 1),
13292
- HH: dateGetter('Hours', 2),
13293
- H: dateGetter('Hours', 1),
13294
- hh: dateGetter('Hours', 2, -12),
13295
- h: dateGetter('Hours', 1, -12),
13296
- mm: dateGetter('Minutes', 2),
13297
- m: dateGetter('Minutes', 1),
13298
- ss: dateGetter('Seconds', 2),
13299
- s: dateGetter('Seconds', 1),
13300
- sss: dateGetter('Milliseconds', 3),
13301
- EEEE: dateStrGetter('Day'),
13302
- EEE: dateStrGetter('Day', true),
13303
- a: ampmGetter,
13304
- Z: timeZoneGetter,
13305
- ww: weekGetter(2),
13306
- w: weekGetter(1),
13307
- G: eraGetter,
13308
- GG: eraGetter,
13309
- GGG: eraGetter,
13310
- GGGG: longEraGetter
13311
- };
13312
-
13313
- var DATE_FORMATS_SPLIT = /((?:[^yMLdHhmsaZEwG']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|L+|d+|H+|h+|m+|s+|a|Z|G+|w+))(.*)/,
13314
- NUMBER_STRING = /^-?\d+$/;
13315
-
13316
- dateFilter.$inject = ['$locale'];
13317
- function dateFilter($locale) {
13318
-
13319
-
13320
- var R_ISO8601_STR = /^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/;
13321
- function jsonStringToDate(string) {
13322
- var match;
13323
- if ((match = string.match(R_ISO8601_STR))) {
13324
- var date = new Date(0),
13325
- tzHour = 0,
13326
- tzMin = 0,
13327
- dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear,
13328
- timeSetter = match[8] ? date.setUTCHours : date.setHours;
13329
-
13330
- if (match[9]) {
13331
- tzHour = toInt(match[9] + match[10]);
13332
- tzMin = toInt(match[9] + match[11]);
13333
- }
13334
- dateSetter.call(date, toInt(match[1]), toInt(match[2]) - 1, toInt(match[3]));
13335
- var h = toInt(match[4] || 0) - tzHour;
13336
- var m = toInt(match[5] || 0) - tzMin;
13337
- var s = toInt(match[6] || 0);
13338
- var ms = Math.round(parseFloat('0.' + (match[7] || 0)) * 1000);
13339
- timeSetter.call(date, h, m, s, ms);
13340
- return date;
13341
- }
13342
- return string;
13343
- }
13344
-
13345
-
13346
- return function(date, format, timezone) {
13347
- var text = '',
13348
- parts = [],
13349
- fn, match;
13350
-
13351
- format = format || 'mediumDate';
13352
- format = $locale.DATETIME_FORMATS[format] || format;
13353
- if (isString(date)) {
13354
- date = NUMBER_STRING.test(date) ? toInt(date) : jsonStringToDate(date);
13355
- }
13356
-
13357
- if (isNumber(date)) {
13358
- date = new Date(date);
13359
- }
13360
-
13361
- if (!isDate(date) || !isFinite(date.getTime())) {
13362
- return date;
13363
- }
13364
-
13365
- while (format) {
13366
- match = DATE_FORMATS_SPLIT.exec(format);
13367
- if (match) {
13368
- parts = concat(parts, match, 1);
13369
- format = parts.pop();
13370
- } else {
13371
- parts.push(format);
13372
- format = null;
13373
- }
13374
- }
13375
-
13376
- var dateTimezoneOffset = date.getTimezoneOffset();
13377
- if (timezone) {
13378
- dateTimezoneOffset = timezoneToOffset(timezone, dateTimezoneOffset);
13379
- date = convertTimezoneToLocal(date, timezone, true);
13380
- }
13381
- forEach(parts, function(value) {
13382
- fn = DATE_FORMATS[value];
13383
- text += fn ? fn(date, $locale.DATETIME_FORMATS, dateTimezoneOffset)
13384
- : value === '\'\'' ? '\'' : value.replace(/(^'|'$)/g, '').replace(/''/g, '\'');
13385
- });
13386
-
13387
- return text;
13388
- };
13389
- }
13390
-
13391
-
13392
- function jsonFilter() {
13393
- return function(object, spacing) {
13394
- if (isUndefined(spacing)) {
13395
- spacing = 2;
13396
- }
13397
- return toJson(object, spacing);
13398
- };
13399
- }
13400
-
13401
-
13402
- var lowercaseFilter = valueFn(lowercase);
13403
-
13404
-
13405
- var uppercaseFilter = valueFn(uppercase);
13406
-
13407
- function limitToFilter() {
13408
- return function(input, limit, begin) {
13409
- if (Math.abs(Number(limit)) === Infinity) {
13410
- limit = Number(limit);
13411
- } else {
13412
- limit = toInt(limit);
13413
- }
13414
- if (isNumberNaN(limit)) return input;
13415
-
13416
- if (isNumber(input)) input = input.toString();
13417
- if (!isArrayLike(input)) return input;
13418
-
13419
- begin = (!begin || isNaN(begin)) ? 0 : toInt(begin);
13420
- begin = (begin < 0) ? Math.max(0, input.length + begin) : begin;
13421
-
13422
- if (limit >= 0) {
13423
- return sliceFn(input, begin, begin + limit);
13424
- } else {
13425
- if (begin === 0) {
13426
- return sliceFn(input, limit, input.length);
13427
- } else {
13428
- return sliceFn(input, Math.max(0, begin + limit), begin);
13429
- }
13430
- }
13431
- };
13432
- }
13433
-
13434
- function sliceFn(input, begin, end) {
13435
- if (isString(input)) return input.slice(begin, end);
13436
-
13437
- return slice.call(input, begin, end);
13438
- }
13439
-
13440
- orderByFilter.$inject = ['$parse'];
13441
- function orderByFilter($parse) {
13442
- return function(array, sortPredicate, reverseOrder, compareFn) {
13443
-
13444
- if (array == null) return array;
13445
- if (!isArrayLike(array)) {
13446
- throw minErr('orderBy')('notarray', 'Expected array but received: {0}', array);
13447
- }
13448
-
13449
- if (!isArray(sortPredicate)) { sortPredicate = [sortPredicate]; }
13450
- if (sortPredicate.length === 0) { sortPredicate = ['+']; }
13451
-
13452
- var predicates = processPredicates(sortPredicate);
13453
-
13454
- var descending = reverseOrder ? -1 : 1;
13455
-
13456
- var compare = isFunction(compareFn) ? compareFn : defaultCompare;
13457
-
13458
- var compareValues = Array.prototype.map.call(array, getComparisonObject);
13459
- compareValues.sort(doComparison);
13460
- array = compareValues.map(function(item) { return item.value; });
13461
-
13462
- return array;
13463
-
13464
- function getComparisonObject(value, index) {
13465
- return {
13466
- value: value,
13467
- tieBreaker: {value: index, type: 'number', index: index},
13468
- predicateValues: predicates.map(function(predicate) {
13469
- return getPredicateValue(predicate.get(value), index);
13470
- })
13471
- };
13472
- }
13473
-
13474
- function doComparison(v1, v2) {
13475
- for (var i = 0, ii = predicates.length; i < ii; i++) {
13476
- var result = compare(v1.predicateValues[i], v2.predicateValues[i]);
13477
- if (result) {
13478
- return result * predicates[i].descending * descending;
13479
- }
13480
- }
13481
-
13482
- return compare(v1.tieBreaker, v2.tieBreaker) * descending;
13483
- }
13484
- };
13485
-
13486
- function processPredicates(sortPredicates) {
13487
- return sortPredicates.map(function(predicate) {
13488
- var descending = 1, get = identity;
13489
-
13490
- if (isFunction(predicate)) {
13491
- get = predicate;
13492
- } else if (isString(predicate)) {
13493
- if ((predicate.charAt(0) === '+' || predicate.charAt(0) === '-')) {
13494
- descending = predicate.charAt(0) === '-' ? -1 : 1;
13495
- predicate = predicate.substring(1);
13496
- }
13497
- if (predicate !== '') {
13498
- get = $parse(predicate);
13499
- if (get.constant) {
13500
- var key = get();
13501
- get = function(value) { return value[key]; };
13502
- }
13503
- }
13504
- }
13505
- return {get: get, descending: descending};
13506
- });
13507
- }
13508
-
13509
- function isPrimitive(value) {
13510
- switch (typeof value) {
13511
- case 'number':
13512
- case 'boolean':
13513
- case 'string':
13514
- return true;
13515
- default:
13516
- return false;
13517
- }
13518
- }
13519
-
13520
- function objectValue(value) {
13521
- if (isFunction(value.valueOf)) {
13522
- value = value.valueOf();
13523
- if (isPrimitive(value)) return value;
13524
- }
13525
- if (hasCustomToString(value)) {
13526
- value = value.toString();
13527
- if (isPrimitive(value)) return value;
13528
- }
13529
-
13530
- return value;
13531
- }
13532
-
13533
- function getPredicateValue(value, index) {
13534
- var type = typeof value;
13535
- if (value === null) {
13536
- type = 'string';
13537
- value = 'null';
13538
- } else if (type === 'object') {
13539
- value = objectValue(value);
13540
- }
13541
- return {value: value, type: type, index: index};
13542
- }
13543
-
13544
- function defaultCompare(v1, v2) {
13545
- var result = 0;
13546
- var type1 = v1.type;
13547
- var type2 = v2.type;
13548
-
13549
- if (type1 === type2) {
13550
- var value1 = v1.value;
13551
- var value2 = v2.value;
13552
-
13553
- if (type1 === 'string') {
13554
- value1 = value1.toLowerCase();
13555
- value2 = value2.toLowerCase();
13556
- } else if (type1 === 'object') {
13557
- if (isObject(value1)) value1 = v1.index;
13558
- if (isObject(value2)) value2 = v2.index;
13559
- }
13560
-
13561
- if (value1 !== value2) {
13562
- result = value1 < value2 ? -1 : 1;
13563
- }
13564
- } else {
13565
- result = type1 < type2 ? -1 : 1;
13566
- }
13567
-
13568
- return result;
13569
- }
13570
- }
13571
-
13572
- function ngDirective(directive) {
13573
- if (isFunction(directive)) {
13574
- directive = {
13575
- link: directive
13576
- };
13577
- }
13578
- directive.restrict = directive.restrict || 'AC';
13579
- return valueFn(directive);
13580
- }
13581
-
13582
- var htmlAnchorDirective = valueFn({
13583
- restrict: 'E',
13584
- compile: function(element, attr) {
13585
- if (!attr.href && !attr.xlinkHref) {
13586
- return function(scope, element) {
13587
- if (element[0].nodeName.toLowerCase() !== 'a') return;
13588
-
13589
- var href = toString.call(element.prop('href')) === '[object SVGAnimatedString]' ?
13590
- 'xlink:href' : 'href';
13591
- element.on('click', function(event) {
13592
- if (!element.attr(href)) {
13593
- event.preventDefault();
13594
- }
13595
- });
13596
- };
13597
- }
13598
- }
13599
- });
13600
-
13601
-
13602
-
13603
-
13604
-
13605
-
13606
-
13607
-
13608
-
13609
-
13610
-
13611
-
13612
- var ngAttributeAliasDirectives = {};
13613
-
13614
- forEach(BOOLEAN_ATTR, function(propName, attrName) {
13615
- if (propName === 'multiple') return;
13616
-
13617
- function defaultLinkFn(scope, element, attr) {
13618
- scope.$watch(attr[normalized], function ngBooleanAttrWatchAction(value) {
13619
- attr.$set(attrName, !!value);
13620
- });
13621
- }
13622
-
13623
- var normalized = directiveNormalize('ng-' + attrName);
13624
- var linkFn = defaultLinkFn;
13625
-
13626
- if (propName === 'checked') {
13627
- linkFn = function(scope, element, attr) {
13628
- if (attr.ngModel !== attr[normalized]) {
13629
- defaultLinkFn(scope, element, attr);
13630
- }
13631
- };
13632
- }
13633
-
13634
- ngAttributeAliasDirectives[normalized] = function() {
13635
- return {
13636
- restrict: 'A',
13637
- priority: 100,
13638
- link: linkFn
13639
- };
13640
- };
13641
- });
13642
-
13643
- forEach(ALIASED_ATTR, function(htmlAttr, ngAttr) {
13644
- ngAttributeAliasDirectives[ngAttr] = function() {
13645
- return {
13646
- priority: 100,
13647
- link: function(scope, element, attr) {
13648
- if (ngAttr === 'ngPattern' && attr.ngPattern.charAt(0) === '/') {
13649
- var match = attr.ngPattern.match(REGEX_STRING_REGEXP);
13650
- if (match) {
13651
- attr.$set('ngPattern', new RegExp(match[1], match[2]));
13652
- return;
13653
- }
13654
- }
13655
-
13656
- scope.$watch(attr[ngAttr], function ngAttrAliasWatchAction(value) {
13657
- attr.$set(ngAttr, value);
13658
- });
13659
- }
13660
- };
13661
- };
13662
- });
13663
-
13664
- forEach(['src', 'srcset', 'href'], function(attrName) {
13665
- var normalized = directiveNormalize('ng-' + attrName);
13666
- ngAttributeAliasDirectives[normalized] = function() {
13667
- return {
13668
- priority: 99,
13669
- link: function(scope, element, attr) {
13670
- var propName = attrName,
13671
- name = attrName;
13672
-
13673
- if (attrName === 'href' &&
13674
- toString.call(element.prop('href')) === '[object SVGAnimatedString]') {
13675
- name = 'xlinkHref';
13676
- attr.$attr[name] = 'xlink:href';
13677
- propName = null;
13678
- }
13679
-
13680
- attr.$observe(normalized, function(value) {
13681
- if (!value) {
13682
- if (attrName === 'href') {
13683
- attr.$set(name, null);
13684
- }
13685
- return;
13686
- }
13687
-
13688
- attr.$set(name, value);
13689
-
13690
- if (msie && propName) element.prop(propName, attr[name]);
13691
- });
13692
- }
13693
- };
13694
- };
13695
- });
13696
-
13697
- var nullFormCtrl = {
13698
- $addControl: noop,
13699
- $$renameControl: nullFormRenameControl,
13700
- $removeControl: noop,
13701
- $setValidity: noop,
13702
- $setDirty: noop,
13703
- $setPristine: noop,
13704
- $setSubmitted: noop
13705
- },
13706
- PENDING_CLASS = 'ng-pending',
13707
- SUBMITTED_CLASS = 'ng-submitted';
13708
-
13709
- function nullFormRenameControl(control, name) {
13710
- control.$name = name;
13711
- }
13712
-
13713
- FormController.$inject = ['$element', '$attrs', '$scope', '$animate', '$interpolate'];
13714
- function FormController($element, $attrs, $scope, $animate, $interpolate) {
13715
- this.$$controls = [];
13716
-
13717
- this.$error = {};
13718
- this.$$success = {};
13719
- this.$pending = undefined;
13720
- this.$name = $interpolate($attrs.name || $attrs.ngForm || '')($scope);
13721
- this.$dirty = false;
13722
- this.$pristine = true;
13723
- this.$valid = true;
13724
- this.$invalid = false;
13725
- this.$submitted = false;
13726
- this.$$parentForm = nullFormCtrl;
13727
-
13728
- this.$$element = $element;
13729
- this.$$animate = $animate;
13730
-
13731
- setupValidity(this);
13732
- }
13733
-
13734
- FormController.prototype = {
13735
- $rollbackViewValue: function() {
13736
- forEach(this.$$controls, function(control) {
13737
- control.$rollbackViewValue();
13738
- });
13739
- },
13740
-
13741
- $commitViewValue: function() {
13742
- forEach(this.$$controls, function(control) {
13743
- control.$commitViewValue();
13744
- });
13745
- },
13746
-
13747
- $addControl: function(control) {
13748
- assertNotHasOwnProperty(control.$name, 'input');
13749
- this.$$controls.push(control);
13750
-
13751
- if (control.$name) {
13752
- this[control.$name] = control;
13753
- }
13754
-
13755
- control.$$parentForm = this;
13756
- },
13757
-
13758
- $$renameControl: function(control, newName) {
13759
- var oldName = control.$name;
13760
-
13761
- if (this[oldName] === control) {
13762
- delete this[oldName];
13763
- }
13764
- this[newName] = control;
13765
- control.$name = newName;
13766
- },
13767
-
13768
- $removeControl: function(control) {
13769
- if (control.$name && this[control.$name] === control) {
13770
- delete this[control.$name];
13771
- }
13772
- forEach(this.$pending, function(value, name) {
13773
- this.$setValidity(name, null, control);
13774
- }, this);
13775
- forEach(this.$error, function(value, name) {
13776
- this.$setValidity(name, null, control);
13777
- }, this);
13778
- forEach(this.$$success, function(value, name) {
13779
- this.$setValidity(name, null, control);
13780
- }, this);
13781
-
13782
- arrayRemove(this.$$controls, control);
13783
- control.$$parentForm = nullFormCtrl;
13784
- },
13785
-
13786
- $setDirty: function() {
13787
- this.$$animate.removeClass(this.$$element, PRISTINE_CLASS);
13788
- this.$$animate.addClass(this.$$element, DIRTY_CLASS);
13789
- this.$dirty = true;
13790
- this.$pristine = false;
13791
- this.$$parentForm.$setDirty();
13792
- },
13793
-
13794
- $setPristine: function() {
13795
- this.$$animate.setClass(this.$$element, PRISTINE_CLASS, DIRTY_CLASS + ' ' + SUBMITTED_CLASS);
13796
- this.$dirty = false;
13797
- this.$pristine = true;
13798
- this.$submitted = false;
13799
- forEach(this.$$controls, function(control) {
13800
- control.$setPristine();
13801
- });
13802
- },
13803
-
13804
- $setUntouched: function() {
13805
- forEach(this.$$controls, function(control) {
13806
- control.$setUntouched();
13807
- });
13808
- },
13809
-
13810
- $setSubmitted: function() {
13811
- this.$$animate.addClass(this.$$element, SUBMITTED_CLASS);
13812
- this.$submitted = true;
13813
- this.$$parentForm.$setSubmitted();
13814
- }
13815
- };
13816
-
13817
- addSetValidityMethod({
13818
- clazz: FormController,
13819
- set: function(object, property, controller) {
13820
- var list = object[property];
13821
- if (!list) {
13822
- object[property] = [controller];
13823
- } else {
13824
- var index = list.indexOf(controller);
13825
- if (index === -1) {
13826
- list.push(controller);
13827
- }
13828
- }
13829
- },
13830
- unset: function(object, property, controller) {
13831
- var list = object[property];
13832
- if (!list) {
13833
- return;
13834
- }
13835
- arrayRemove(list, controller);
13836
- if (list.length === 0) {
13837
- delete object[property];
13838
- }
13839
- }
13840
- });
13841
-
13842
-
13843
- var formDirectiveFactory = function(isNgForm) {
13844
- return ['$timeout', '$parse', function($timeout, $parse) {
13845
- var formDirective = {
13846
- name: 'form',
13847
- restrict: isNgForm ? 'EAC' : 'E',
13848
- require: ['form', '^^?form'],
13849
- controller: FormController,
13850
- compile: function ngFormCompile(formElement, attr) {
13851
- formElement.addClass(PRISTINE_CLASS).addClass(VALID_CLASS);
13852
-
13853
- var nameAttr = attr.name ? 'name' : (isNgForm && attr.ngForm ? 'ngForm' : false);
13854
-
13855
- return {
13856
- pre: function ngFormPreLink(scope, formElement, attr, ctrls) {
13857
- var controller = ctrls[0];
13858
-
13859
- if (!('action' in attr)) {
13860
- var handleFormSubmission = function(event) {
13861
- scope.$apply(function() {
13862
- controller.$commitViewValue();
13863
- controller.$setSubmitted();
13864
- });
13865
-
13866
- event.preventDefault();
13867
- };
13868
-
13869
- formElement[0].addEventListener('submit', handleFormSubmission);
13870
-
13871
- formElement.on('$destroy', function() {
13872
- $timeout(function() {
13873
- formElement[0].removeEventListener('submit', handleFormSubmission);
13874
- }, 0, false);
13875
- });
13876
- }
13877
-
13878
- var parentFormCtrl = ctrls[1] || controller.$$parentForm;
13879
- parentFormCtrl.$addControl(controller);
13880
-
13881
- var setter = nameAttr ? getSetter(controller.$name) : noop;
13882
-
13883
- if (nameAttr) {
13884
- setter(scope, controller);
13885
- attr.$observe(nameAttr, function(newValue) {
13886
- if (controller.$name === newValue) return;
13887
- setter(scope, undefined);
13888
- controller.$$parentForm.$$renameControl(controller, newValue);
13889
- setter = getSetter(controller.$name);
13890
- setter(scope, controller);
13891
- });
13892
- }
13893
- formElement.on('$destroy', function() {
13894
- controller.$$parentForm.$removeControl(controller);
13895
- setter(scope, undefined);
13896
- extend(controller, nullFormCtrl);
13897
- });
13898
- }
13899
- };
13900
- }
13901
- };
13902
-
13903
- return formDirective;
13904
-
13905
- function getSetter(expression) {
13906
- if (expression === '') {
13907
- return $parse('this[""]').assign;
13908
- }
13909
- return $parse(expression).assign || noop;
13910
- }
13911
- }];
13912
- };
13913
-
13914
- var formDirective = formDirectiveFactory();
13915
- var ngFormDirective = formDirectiveFactory(true);
13916
-
13917
-
13918
-
13919
- function setupValidity(instance) {
13920
- instance.$$classCache = {};
13921
- instance.$$classCache[INVALID_CLASS] = !(instance.$$classCache[VALID_CLASS] = instance.$$element.hasClass(VALID_CLASS));
13922
- }
13923
- function addSetValidityMethod(context) {
13924
- var clazz = context.clazz,
13925
- set = context.set,
13926
- unset = context.unset;
13927
-
13928
- clazz.prototype.$setValidity = function(validationErrorKey, state, controller) {
13929
- if (isUndefined(state)) {
13930
- createAndSet(this, '$pending', validationErrorKey, controller);
13931
- } else {
13932
- unsetAndCleanup(this, '$pending', validationErrorKey, controller);
13933
- }
13934
- if (!isBoolean(state)) {
13935
- unset(this.$error, validationErrorKey, controller);
13936
- unset(this.$$success, validationErrorKey, controller);
13937
- } else {
13938
- if (state) {
13939
- unset(this.$error, validationErrorKey, controller);
13940
- set(this.$$success, validationErrorKey, controller);
13941
- } else {
13942
- set(this.$error, validationErrorKey, controller);
13943
- unset(this.$$success, validationErrorKey, controller);
13944
- }
13945
- }
13946
- if (this.$pending) {
13947
- cachedToggleClass(this, PENDING_CLASS, true);
13948
- this.$valid = this.$invalid = undefined;
13949
- toggleValidationCss(this, '', null);
13950
- } else {
13951
- cachedToggleClass(this, PENDING_CLASS, false);
13952
- this.$valid = isObjectEmpty(this.$error);
13953
- this.$invalid = !this.$valid;
13954
- toggleValidationCss(this, '', this.$valid);
13955
- }
13956
-
13957
- var combinedState;
13958
- if (this.$pending && this.$pending[validationErrorKey]) {
13959
- combinedState = undefined;
13960
- } else if (this.$error[validationErrorKey]) {
13961
- combinedState = false;
13962
- } else if (this.$$success[validationErrorKey]) {
13963
- combinedState = true;
13964
- } else {
13965
- combinedState = null;
13966
- }
13967
-
13968
- toggleValidationCss(this, validationErrorKey, combinedState);
13969
- this.$$parentForm.$setValidity(validationErrorKey, combinedState, this);
13970
- };
13971
-
13972
- function createAndSet(ctrl, name, value, controller) {
13973
- if (!ctrl[name]) {
13974
- ctrl[name] = {};
13975
- }
13976
- set(ctrl[name], value, controller);
13977
- }
13978
-
13979
- function unsetAndCleanup(ctrl, name, value, controller) {
13980
- if (ctrl[name]) {
13981
- unset(ctrl[name], value, controller);
13982
- }
13983
- if (isObjectEmpty(ctrl[name])) {
13984
- ctrl[name] = undefined;
13985
- }
13986
- }
13987
-
13988
- function cachedToggleClass(ctrl, className, switchValue) {
13989
- if (switchValue && !ctrl.$$classCache[className]) {
13990
- ctrl.$$animate.addClass(ctrl.$$element, className);
13991
- ctrl.$$classCache[className] = true;
13992
- } else if (!switchValue && ctrl.$$classCache[className]) {
13993
- ctrl.$$animate.removeClass(ctrl.$$element, className);
13994
- ctrl.$$classCache[className] = false;
13995
- }
13996
- }
13997
-
13998
- function toggleValidationCss(ctrl, validationErrorKey, isValid) {
13999
- validationErrorKey = validationErrorKey ? '-' + snake_case(validationErrorKey, '-') : '';
14000
-
14001
- cachedToggleClass(ctrl, VALID_CLASS + validationErrorKey, isValid === true);
14002
- cachedToggleClass(ctrl, INVALID_CLASS + validationErrorKey, isValid === false);
14003
- }
14004
- }
14005
-
14006
- function isObjectEmpty(obj) {
14007
- if (obj) {
14008
- for (var prop in obj) {
14009
- if (obj.hasOwnProperty(prop)) {
14010
- return false;
14011
- }
14012
- }
14013
- }
14014
- return true;
14015
- }
14016
-
14017
-
14018
- var ISO_DATE_REGEXP = /^\d{4,}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+(?:[+-][0-2]\d:[0-5]\d|Z)$/;
14019
- var URL_REGEXP = /^[a-z][a-z\d.+-]*:\/*(?:[^:@]+(?::[^@]+)?@)?(?:[^\s:/?#]+|\[[a-f\d:]+])(?::\d+)?(?:\/[^?#]*)?(?:\?[^#]*)?(?:#.*)?$/i;
14020
- var EMAIL_REGEXP = /^(?=.{1,254}$)(?=.{1,64}@)[-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]+(\.[-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]+)*@[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?(\.[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?)*$/;
14021
- var NUMBER_REGEXP = /^\s*(-|\+)?(\d+|(\d*(\.\d*)))([eE][+-]?\d+)?\s*$/;
14022
- var DATE_REGEXP = /^(\d{4,})-(\d{2})-(\d{2})$/;
14023
- var DATETIMELOCAL_REGEXP = /^(\d{4,})-(\d\d)-(\d\d)T(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/;
14024
- var WEEK_REGEXP = /^(\d{4,})-W(\d\d)$/;
14025
- var MONTH_REGEXP = /^(\d{4,})-(\d\d)$/;
14026
- var TIME_REGEXP = /^(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/;
14027
-
14028
- var PARTIAL_VALIDATION_EVENTS = 'keydown wheel mousedown';
14029
- var PARTIAL_VALIDATION_TYPES = createMap();
14030
- forEach('date,datetime-local,month,time,week'.split(','), function(type) {
14031
- PARTIAL_VALIDATION_TYPES[type] = true;
14032
- });
14033
-
14034
- var inputType = {
14035
-
14036
- 'text': textInputType,
14037
-
14038
- 'date': createDateInputType('date', DATE_REGEXP,
14039
- createDateParser(DATE_REGEXP, ['yyyy', 'MM', 'dd']),
14040
- 'yyyy-MM-dd'),
14041
-
14042
- 'datetime-local': createDateInputType('datetimelocal', DATETIMELOCAL_REGEXP,
14043
- createDateParser(DATETIMELOCAL_REGEXP, ['yyyy', 'MM', 'dd', 'HH', 'mm', 'ss', 'sss']),
14044
- 'yyyy-MM-ddTHH:mm:ss.sss'),
14045
-
14046
- 'time': createDateInputType('time', TIME_REGEXP,
14047
- createDateParser(TIME_REGEXP, ['HH', 'mm', 'ss', 'sss']),
14048
- 'HH:mm:ss.sss'),
14049
-
14050
- 'week': createDateInputType('week', WEEK_REGEXP, weekParser, 'yyyy-Www'),
14051
-
14052
- 'month': createDateInputType('month', MONTH_REGEXP,
14053
- createDateParser(MONTH_REGEXP, ['yyyy', 'MM']),
14054
- 'yyyy-MM'),
14055
-
14056
- 'number': numberInputType,
14057
-
14058
-
14059
- 'url': urlInputType,
14060
-
14061
-
14062
- 'email': emailInputType,
14063
-
14064
-
14065
- 'radio': radioInputType,
14066
-
14067
- 'range': rangeInputType,
14068
-
14069
- 'checkbox': checkboxInputType,
14070
-
14071
- 'hidden': noop,
14072
- 'button': noop,
14073
- 'submit': noop,
14074
- 'reset': noop,
14075
- 'file': noop
14076
- };
14077
-
14078
- function stringBasedInputType(ctrl) {
14079
- ctrl.$formatters.push(function(value) {
14080
- return ctrl.$isEmpty(value) ? value : value.toString();
14081
- });
14082
- }
14083
-
14084
- function textInputType(scope, element, attr, ctrl, $sniffer, $browser) {
14085
- baseInputType(scope, element, attr, ctrl, $sniffer, $browser);
14086
- stringBasedInputType(ctrl);
14087
- }
14088
-
14089
- function baseInputType(scope, element, attr, ctrl, $sniffer, $browser) {
14090
- var type = lowercase(element[0].type);
14091
-
14092
- if (!$sniffer.android) {
14093
- var composing = false;
14094
-
14095
- element.on('compositionstart', function() {
14096
- composing = true;
14097
- });
14098
-
14099
- element.on('compositionend', function() {
14100
- composing = false;
14101
- listener();
14102
- });
14103
- }
14104
-
14105
- var timeout;
14106
-
14107
- var listener = function(ev) {
14108
- if (timeout) {
14109
- $browser.defer.cancel(timeout);
14110
- timeout = null;
14111
- }
14112
- if (composing) return;
14113
- var value = element.val(),
14114
- event = ev && ev.type;
14115
-
14116
- if (type !== 'password' && (!attr.ngTrim || attr.ngTrim !== 'false')) {
14117
- value = trim(value);
14118
- }
14119
-
14120
- if (ctrl.$viewValue !== value || (value === '' && ctrl.$$hasNativeValidators)) {
14121
- ctrl.$setViewValue(value, event);
14122
- }
14123
- };
14124
-
14125
- if ($sniffer.hasEvent('input')) {
14126
- element.on('input', listener);
14127
- } else {
14128
- var deferListener = function(ev, input, origValue) {
14129
- if (!timeout) {
14130
- timeout = $browser.defer(function() {
14131
- timeout = null;
14132
- if (!input || input.value !== origValue) {
14133
- listener(ev);
14134
- }
14135
- });
14136
- }
14137
- };
14138
-
14139
- element.on('keydown', function(event) {
14140
- var key = event.keyCode;
14141
-
14142
- if (key === 91 || (15 < key && key < 19) || (37 <= key && key <= 40)) return;
14143
-
14144
- deferListener(event, this, this.value);
14145
- });
14146
-
14147
- if ($sniffer.hasEvent('paste')) {
14148
- element.on('paste cut', deferListener);
14149
- }
14150
- }
14151
-
14152
- element.on('change', listener);
14153
-
14154
- if (PARTIAL_VALIDATION_TYPES[type] && ctrl.$$hasNativeValidators && type === attr.type) {
14155
- element.on(PARTIAL_VALIDATION_EVENTS, function(ev) {
14156
- if (!timeout) {
14157
- var validity = this[VALIDITY_STATE_PROPERTY];
14158
- var origBadInput = validity.badInput;
14159
- var origTypeMismatch = validity.typeMismatch;
14160
- timeout = $browser.defer(function() {
14161
- timeout = null;
14162
- if (validity.badInput !== origBadInput || validity.typeMismatch !== origTypeMismatch) {
14163
- listener(ev);
14164
- }
14165
- });
14166
- }
14167
- });
14168
- }
14169
-
14170
- ctrl.$render = function() {
14171
- var value = ctrl.$isEmpty(ctrl.$viewValue) ? '' : ctrl.$viewValue;
14172
- if (element.val() !== value) {
14173
- element.val(value);
14174
- }
14175
- };
14176
- }
14177
-
14178
- function weekParser(isoWeek, existingDate) {
14179
- if (isDate(isoWeek)) {
14180
- return isoWeek;
14181
- }
14182
-
14183
- if (isString(isoWeek)) {
14184
- WEEK_REGEXP.lastIndex = 0;
14185
- var parts = WEEK_REGEXP.exec(isoWeek);
14186
- if (parts) {
14187
- var year = +parts[1],
14188
- week = +parts[2],
14189
- hours = 0,
14190
- minutes = 0,
14191
- seconds = 0,
14192
- milliseconds = 0,
14193
- firstThurs = getFirstThursdayOfYear(year),
14194
- addDays = (week - 1) * 7;
14195
-
14196
- if (existingDate) {
14197
- hours = existingDate.getHours();
14198
- minutes = existingDate.getMinutes();
14199
- seconds = existingDate.getSeconds();
14200
- milliseconds = existingDate.getMilliseconds();
14201
- }
14202
-
14203
- return new Date(year, 0, firstThurs.getDate() + addDays, hours, minutes, seconds, milliseconds);
14204
- }
14205
- }
14206
-
14207
- return NaN;
14208
- }
14209
-
14210
- function createDateParser(regexp, mapping) {
14211
- return function(iso, date) {
14212
- var parts, map;
14213
-
14214
- if (isDate(iso)) {
14215
- return iso;
14216
- }
14217
-
14218
- if (isString(iso)) {
14219
- if (iso.charAt(0) === '"' && iso.charAt(iso.length - 1) === '"') {
14220
- iso = iso.substring(1, iso.length - 1);
14221
- }
14222
- if (ISO_DATE_REGEXP.test(iso)) {
14223
- return new Date(iso);
14224
- }
14225
- regexp.lastIndex = 0;
14226
- parts = regexp.exec(iso);
14227
-
14228
- if (parts) {
14229
- parts.shift();
14230
- if (date) {
14231
- map = {
14232
- yyyy: date.getFullYear(),
14233
- MM: date.getMonth() + 1,
14234
- dd: date.getDate(),
14235
- HH: date.getHours(),
14236
- mm: date.getMinutes(),
14237
- ss: date.getSeconds(),
14238
- sss: date.getMilliseconds() / 1000
14239
- };
14240
- } else {
14241
- map = { yyyy: 1970, MM: 1, dd: 1, HH: 0, mm: 0, ss: 0, sss: 0 };
14242
- }
14243
-
14244
- forEach(parts, function(part, index) {
14245
- if (index < mapping.length) {
14246
- map[mapping[index]] = +part;
14247
- }
14248
- });
14249
- return new Date(map.yyyy, map.MM - 1, map.dd, map.HH, map.mm, map.ss || 0, map.sss * 1000 || 0);
14250
- }
14251
- }
14252
-
14253
- return NaN;
14254
- };
14255
- }
14256
-
14257
- function createDateInputType(type, regexp, parseDate, format) {
14258
- return function dynamicDateInputType(scope, element, attr, ctrl, $sniffer, $browser, $filter) {
14259
- badInputChecker(scope, element, attr, ctrl);
14260
- baseInputType(scope, element, attr, ctrl, $sniffer, $browser);
14261
- var timezone = ctrl && ctrl.$options.getOption('timezone');
14262
- var previousDate;
14263
-
14264
- ctrl.$$parserName = type;
14265
- ctrl.$parsers.push(function(value) {
14266
- if (ctrl.$isEmpty(value)) return null;
14267
- if (regexp.test(value)) {
14268
- var parsedDate = parseDate(value, previousDate);
14269
- if (timezone) {
14270
- parsedDate = convertTimezoneToLocal(parsedDate, timezone);
14271
- }
14272
- return parsedDate;
14273
- }
14274
- return undefined;
14275
- });
14276
-
14277
- ctrl.$formatters.push(function(value) {
14278
- if (value && !isDate(value)) {
14279
- throw ngModelMinErr('datefmt', 'Expected `{0}` to be a date', value);
14280
- }
14281
- if (isValidDate(value)) {
14282
- previousDate = value;
14283
- if (previousDate && timezone) {
14284
- previousDate = convertTimezoneToLocal(previousDate, timezone, true);
14285
- }
14286
- return $filter('date')(value, format, timezone);
14287
- } else {
14288
- previousDate = null;
14289
- return '';
14290
- }
14291
- });
14292
-
14293
- if (isDefined(attr.min) || attr.ngMin) {
14294
- var minVal;
14295
- ctrl.$validators.min = function(value) {
14296
- return !isValidDate(value) || isUndefined(minVal) || parseDate(value) >= minVal;
14297
- };
14298
- attr.$observe('min', function(val) {
14299
- minVal = parseObservedDateValue(val);
14300
- ctrl.$validate();
14301
- });
14302
- }
14303
-
14304
- if (isDefined(attr.max) || attr.ngMax) {
14305
- var maxVal;
14306
- ctrl.$validators.max = function(value) {
14307
- return !isValidDate(value) || isUndefined(maxVal) || parseDate(value) <= maxVal;
14308
- };
14309
- attr.$observe('max', function(val) {
14310
- maxVal = parseObservedDateValue(val);
14311
- ctrl.$validate();
14312
- });
14313
- }
14314
-
14315
- function isValidDate(value) {
14316
- return value && !(value.getTime && value.getTime() !== value.getTime());
14317
- }
14318
-
14319
- function parseObservedDateValue(val) {
14320
- return isDefined(val) && !isDate(val) ? parseDate(val) || undefined : val;
14321
- }
14322
- };
14323
- }
14324
-
14325
- function badInputChecker(scope, element, attr, ctrl) {
14326
- var node = element[0];
14327
- var nativeValidation = ctrl.$$hasNativeValidators = isObject(node.validity);
14328
- if (nativeValidation) {
14329
- ctrl.$parsers.push(function(value) {
14330
- var validity = element.prop(VALIDITY_STATE_PROPERTY) || {};
14331
- return validity.badInput || validity.typeMismatch ? undefined : value;
14332
- });
14333
- }
14334
- }
14335
-
14336
- function numberFormatterParser(ctrl) {
14337
- ctrl.$$parserName = 'number';
14338
- ctrl.$parsers.push(function(value) {
14339
- if (ctrl.$isEmpty(value)) return null;
14340
- if (NUMBER_REGEXP.test(value)) return parseFloat(value);
14341
- return undefined;
14342
- });
14343
-
14344
- ctrl.$formatters.push(function(value) {
14345
- if (!ctrl.$isEmpty(value)) {
14346
- if (!isNumber(value)) {
14347
- throw ngModelMinErr('numfmt', 'Expected `{0}` to be a number', value);
14348
- }
14349
- value = value.toString();
14350
- }
14351
- return value;
14352
- });
14353
- }
14354
-
14355
- function parseNumberAttrVal(val) {
14356
- if (isDefined(val) && !isNumber(val)) {
14357
- val = parseFloat(val);
14358
- }
14359
- return !isNumberNaN(val) ? val : undefined;
14360
- }
14361
-
14362
- function isNumberInteger(num) {
14363
-
14364
- return (num | 0) === num;
14365
- }
14366
-
14367
- function countDecimals(num) {
14368
- var numString = num.toString();
14369
- var decimalSymbolIndex = numString.indexOf('.');
14370
-
14371
- if (decimalSymbolIndex === -1) {
14372
- if (-1 < num && num < 1) {
14373
- var match = /e-(\d+)$/.exec(numString);
14374
-
14375
- if (match) {
14376
- return Number(match[1]);
14377
- }
14378
- }
14379
-
14380
- return 0;
14381
- }
14382
-
14383
- return numString.length - decimalSymbolIndex - 1;
14384
- }
14385
-
14386
- function isValidForStep(viewValue, stepBase, step) {
14387
- var value = Number(viewValue);
14388
-
14389
- if (!isNumberInteger(value) || !isNumberInteger(stepBase) || !isNumberInteger(step)) {
14390
- var decimalCount = Math.max(countDecimals(value), countDecimals(stepBase), countDecimals(step));
14391
- var multiplier = Math.pow(10, decimalCount);
14392
-
14393
- value = value * multiplier;
14394
- stepBase = stepBase * multiplier;
14395
- step = step * multiplier;
14396
- }
14397
-
14398
- return (value - stepBase) % step === 0;
14399
- }
14400
-
14401
- function numberInputType(scope, element, attr, ctrl, $sniffer, $browser) {
14402
- badInputChecker(scope, element, attr, ctrl);
14403
- numberFormatterParser(ctrl);
14404
- baseInputType(scope, element, attr, ctrl, $sniffer, $browser);
14405
-
14406
- var minVal;
14407
- var maxVal;
14408
-
14409
- if (isDefined(attr.min) || attr.ngMin) {
14410
- ctrl.$validators.min = function(value) {
14411
- return ctrl.$isEmpty(value) || isUndefined(minVal) || value >= minVal;
14412
- };
14413
-
14414
- attr.$observe('min', function(val) {
14415
- minVal = parseNumberAttrVal(val);
14416
- ctrl.$validate();
14417
- });
14418
- }
14419
-
14420
- if (isDefined(attr.max) || attr.ngMax) {
14421
- ctrl.$validators.max = function(value) {
14422
- return ctrl.$isEmpty(value) || isUndefined(maxVal) || value <= maxVal;
14423
- };
14424
-
14425
- attr.$observe('max', function(val) {
14426
- maxVal = parseNumberAttrVal(val);
14427
- ctrl.$validate();
14428
- });
14429
- }
14430
-
14431
- if (isDefined(attr.step) || attr.ngStep) {
14432
- var stepVal;
14433
- ctrl.$validators.step = function(modelValue, viewValue) {
14434
- return ctrl.$isEmpty(viewValue) || isUndefined(stepVal) ||
14435
- isValidForStep(viewValue, minVal || 0, stepVal);
14436
- };
14437
-
14438
- attr.$observe('step', function(val) {
14439
- stepVal = parseNumberAttrVal(val);
14440
- ctrl.$validate();
14441
- });
14442
- }
14443
- }
14444
-
14445
- function rangeInputType(scope, element, attr, ctrl, $sniffer, $browser) {
14446
- badInputChecker(scope, element, attr, ctrl);
14447
- numberFormatterParser(ctrl);
14448
- baseInputType(scope, element, attr, ctrl, $sniffer, $browser);
14449
-
14450
- var supportsRange = ctrl.$$hasNativeValidators && element[0].type === 'range',
14451
- minVal = supportsRange ? 0 : undefined,
14452
- maxVal = supportsRange ? 100 : undefined,
14453
- stepVal = supportsRange ? 1 : undefined,
14454
- validity = element[0].validity,
14455
- hasMinAttr = isDefined(attr.min),
14456
- hasMaxAttr = isDefined(attr.max),
14457
- hasStepAttr = isDefined(attr.step);
14458
-
14459
- var originalRender = ctrl.$render;
14460
-
14461
- ctrl.$render = supportsRange && isDefined(validity.rangeUnderflow) && isDefined(validity.rangeOverflow) ?
14462
- function rangeRender() {
14463
- originalRender();
14464
- ctrl.$setViewValue(element.val());
14465
- } :
14466
- originalRender;
14467
-
14468
- if (hasMinAttr) {
14469
- ctrl.$validators.min = supportsRange ?
14470
- function noopMinValidator() { return true; } :
14471
- function minValidator(modelValue, viewValue) {
14472
- return ctrl.$isEmpty(viewValue) || isUndefined(minVal) || viewValue >= minVal;
14473
- };
14474
-
14475
- setInitialValueAndObserver('min', minChange);
14476
- }
14477
-
14478
- if (hasMaxAttr) {
14479
- ctrl.$validators.max = supportsRange ?
14480
- function noopMaxValidator() { return true; } :
14481
- function maxValidator(modelValue, viewValue) {
14482
- return ctrl.$isEmpty(viewValue) || isUndefined(maxVal) || viewValue <= maxVal;
14483
- };
14484
-
14485
- setInitialValueAndObserver('max', maxChange);
14486
- }
14487
-
14488
- if (hasStepAttr) {
14489
- ctrl.$validators.step = supportsRange ?
14490
- function nativeStepValidator() {
14491
- return !validity.stepMismatch;
14492
- } :
14493
- function stepValidator(modelValue, viewValue) {
14494
- return ctrl.$isEmpty(viewValue) || isUndefined(stepVal) ||
14495
- isValidForStep(viewValue, minVal || 0, stepVal);
14496
- };
14497
-
14498
- setInitialValueAndObserver('step', stepChange);
14499
- }
14500
-
14501
- function setInitialValueAndObserver(htmlAttrName, changeFn) {
14502
- element.attr(htmlAttrName, attr[htmlAttrName]);
14503
- attr.$observe(htmlAttrName, changeFn);
14504
- }
14505
-
14506
- function minChange(val) {
14507
- minVal = parseNumberAttrVal(val);
14508
- if (isNumberNaN(ctrl.$modelValue)) {
14509
- return;
14510
- }
14511
-
14512
- if (supportsRange) {
14513
- var elVal = element.val();
14514
- if (minVal > elVal) {
14515
- elVal = minVal;
14516
- element.val(elVal);
14517
- }
14518
- ctrl.$setViewValue(elVal);
14519
- } else {
14520
- ctrl.$validate();
14521
- }
14522
- }
14523
-
14524
- function maxChange(val) {
14525
- maxVal = parseNumberAttrVal(val);
14526
- if (isNumberNaN(ctrl.$modelValue)) {
14527
- return;
14528
- }
14529
-
14530
- if (supportsRange) {
14531
- var elVal = element.val();
14532
- if (maxVal < elVal) {
14533
- element.val(maxVal);
14534
- elVal = maxVal < minVal ? minVal : maxVal;
14535
- }
14536
- ctrl.$setViewValue(elVal);
14537
- } else {
14538
- ctrl.$validate();
14539
- }
14540
- }
14541
-
14542
- function stepChange(val) {
14543
- stepVal = parseNumberAttrVal(val);
14544
- if (isNumberNaN(ctrl.$modelValue)) {
14545
- return;
14546
- }
14547
-
14548
- if (supportsRange && ctrl.$viewValue !== element.val()) {
14549
- ctrl.$setViewValue(element.val());
14550
- } else {
14551
- ctrl.$validate();
14552
- }
14553
- }
14554
- }
14555
-
14556
- function urlInputType(scope, element, attr, ctrl, $sniffer, $browser) {
14557
- baseInputType(scope, element, attr, ctrl, $sniffer, $browser);
14558
- stringBasedInputType(ctrl);
14559
-
14560
- ctrl.$$parserName = 'url';
14561
- ctrl.$validators.url = function(modelValue, viewValue) {
14562
- var value = modelValue || viewValue;
14563
- return ctrl.$isEmpty(value) || URL_REGEXP.test(value);
14564
- };
14565
- }
14566
-
14567
- function emailInputType(scope, element, attr, ctrl, $sniffer, $browser) {
14568
- baseInputType(scope, element, attr, ctrl, $sniffer, $browser);
14569
- stringBasedInputType(ctrl);
14570
-
14571
- ctrl.$$parserName = 'email';
14572
- ctrl.$validators.email = function(modelValue, viewValue) {
14573
- var value = modelValue || viewValue;
14574
- return ctrl.$isEmpty(value) || EMAIL_REGEXP.test(value);
14575
- };
14576
- }
14577
-
14578
- function radioInputType(scope, element, attr, ctrl) {
14579
- var doTrim = !attr.ngTrim || trim(attr.ngTrim) !== 'false';
14580
- if (isUndefined(attr.name)) {
14581
- element.attr('name', nextUid());
14582
- }
14583
-
14584
- var listener = function(ev) {
14585
- var value;
14586
- if (element[0].checked) {
14587
- value = attr.value;
14588
- if (doTrim) {
14589
- value = trim(value);
14590
- }
14591
- ctrl.$setViewValue(value, ev && ev.type);
14592
- }
14593
- };
14594
-
14595
- element.on('click', listener);
14596
-
14597
- ctrl.$render = function() {
14598
- var value = attr.value;
14599
- if (doTrim) {
14600
- value = trim(value);
14601
- }
14602
- element[0].checked = (value === ctrl.$viewValue);
14603
- };
14604
-
14605
- attr.$observe('value', ctrl.$render);
14606
- }
14607
-
14608
- function parseConstantExpr($parse, context, name, expression, fallback) {
14609
- var parseFn;
14610
- if (isDefined(expression)) {
14611
- parseFn = $parse(expression);
14612
- if (!parseFn.constant) {
14613
- throw ngModelMinErr('constexpr', 'Expected constant expression for `{0}`, but saw ' +
14614
- '`{1}`.', name, expression);
14615
- }
14616
- return parseFn(context);
14617
- }
14618
- return fallback;
14619
- }
14620
-
14621
- function checkboxInputType(scope, element, attr, ctrl, $sniffer, $browser, $filter, $parse) {
14622
- var trueValue = parseConstantExpr($parse, scope, 'ngTrueValue', attr.ngTrueValue, true);
14623
- var falseValue = parseConstantExpr($parse, scope, 'ngFalseValue', attr.ngFalseValue, false);
14624
-
14625
- var listener = function(ev) {
14626
- ctrl.$setViewValue(element[0].checked, ev && ev.type);
14627
- };
14628
-
14629
- element.on('click', listener);
14630
-
14631
- ctrl.$render = function() {
14632
- element[0].checked = ctrl.$viewValue;
14633
- };
14634
-
14635
- ctrl.$isEmpty = function(value) {
14636
- return value === false;
14637
- };
14638
-
14639
- ctrl.$formatters.push(function(value) {
14640
- return equals(value, trueValue);
14641
- });
14642
-
14643
- ctrl.$parsers.push(function(value) {
14644
- return value ? trueValue : falseValue;
14645
- });
14646
- }
14647
-
14648
-
14649
-
14650
-
14651
- var inputDirective = ['$browser', '$sniffer', '$filter', '$parse',
14652
- function($browser, $sniffer, $filter, $parse) {
14653
- return {
14654
- restrict: 'E',
14655
- require: ['?ngModel'],
14656
- link: {
14657
- pre: function(scope, element, attr, ctrls) {
14658
- if (ctrls[0]) {
14659
- (inputType[lowercase(attr.type)] || inputType.text)(scope, element, attr, ctrls[0], $sniffer,
14660
- $browser, $filter, $parse);
14661
- }
14662
- }
14663
- }
14664
- };
14665
- }];
14666
-
14667
-
14668
-
14669
- var CONSTANT_VALUE_REGEXP = /^(true|false|\d+)$/;
14670
- var ngValueDirective = function() {
14671
- function updateElementValue(element, attr, value) {
14672
- element.prop('value', value);
14673
- attr.$set('value', value);
14674
- }
14675
-
14676
- return {
14677
- restrict: 'A',
14678
- priority: 100,
14679
- compile: function(tpl, tplAttr) {
14680
- if (CONSTANT_VALUE_REGEXP.test(tplAttr.ngValue)) {
14681
- return function ngValueConstantLink(scope, elm, attr) {
14682
- var value = scope.$eval(attr.ngValue);
14683
- updateElementValue(elm, attr, value);
14684
- };
14685
- } else {
14686
- return function ngValueLink(scope, elm, attr) {
14687
- scope.$watch(attr.ngValue, function valueWatchAction(value) {
14688
- updateElementValue(elm, attr, value);
14689
- });
14690
- };
14691
- }
14692
- }
14693
- };
14694
- };
14695
-
14696
- var ngBindDirective = ['$compile', function($compile) {
14697
- return {
14698
- restrict: 'AC',
14699
- compile: function ngBindCompile(templateElement) {
14700
- $compile.$$addBindingClass(templateElement);
14701
- return function ngBindLink(scope, element, attr) {
14702
- $compile.$$addBindingInfo(element, attr.ngBind);
14703
- element = element[0];
14704
- scope.$watch(attr.ngBind, function ngBindWatchAction(value) {
14705
- element.textContent = stringify(value);
14706
- });
14707
- };
14708
- }
14709
- };
14710
- }];
14711
-
14712
-
14713
- var ngBindTemplateDirective = ['$interpolate', '$compile', function($interpolate, $compile) {
14714
- return {
14715
- compile: function ngBindTemplateCompile(templateElement) {
14716
- $compile.$$addBindingClass(templateElement);
14717
- return function ngBindTemplateLink(scope, element, attr) {
14718
- var interpolateFn = $interpolate(element.attr(attr.$attr.ngBindTemplate));
14719
- $compile.$$addBindingInfo(element, interpolateFn.expressions);
14720
- element = element[0];
14721
- attr.$observe('ngBindTemplate', function(value) {
14722
- element.textContent = isUndefined(value) ? '' : value;
14723
- });
14724
- };
14725
- }
14726
- };
14727
- }];
14728
-
14729
-
14730
- var ngBindHtmlDirective = ['$sce', '$parse', '$compile', function($sce, $parse, $compile) {
14731
- return {
14732
- restrict: 'A',
14733
- compile: function ngBindHtmlCompile(tElement, tAttrs) {
14734
- var ngBindHtmlGetter = $parse(tAttrs.ngBindHtml);
14735
- var ngBindHtmlWatch = $parse(tAttrs.ngBindHtml, function sceValueOf(val) {
14736
- return $sce.valueOf(val);
14737
- });
14738
- $compile.$$addBindingClass(tElement);
14739
-
14740
- return function ngBindHtmlLink(scope, element, attr) {
14741
- $compile.$$addBindingInfo(element, attr.ngBindHtml);
14742
-
14743
- scope.$watch(ngBindHtmlWatch, function ngBindHtmlWatchAction() {
14744
- var value = ngBindHtmlGetter(scope);
14745
- element.html($sce.getTrustedHtml(value) || '');
14746
- });
14747
- };
14748
- }
14749
- };
14750
- }];
14751
-
14752
- var ngChangeDirective = valueFn({
14753
- restrict: 'A',
14754
- require: 'ngModel',
14755
- link: function(scope, element, attr, ctrl) {
14756
- ctrl.$viewChangeListeners.push(function() {
14757
- scope.$eval(attr.ngChange);
14758
- });
14759
- }
14760
- });
14761
-
14762
-
14763
- function classDirective(name, selector) {
14764
- name = 'ngClass' + name;
14765
- var indexWatchExpression;
14766
-
14767
- return ['$parse', function($parse) {
14768
- return {
14769
- restrict: 'AC',
14770
- link: function(scope, element, attr) {
14771
- var expression = attr[name].trim();
14772
- var isOneTime = (expression.charAt(0) === ':') && (expression.charAt(1) === ':');
14773
-
14774
- var watchInterceptor = isOneTime ? toFlatValue : toClassString;
14775
- var watchExpression = $parse(expression, watchInterceptor);
14776
- var watchAction = isOneTime ? ngClassOneTimeWatchAction : ngClassWatchAction;
14777
-
14778
- var classCounts = element.data('$classCounts');
14779
- var oldModulo = true;
14780
- var oldClassString;
14781
-
14782
- if (!classCounts) {
14783
- classCounts = createMap();
14784
- element.data('$classCounts', classCounts);
14785
- }
14786
-
14787
- if (name !== 'ngClass') {
14788
- if (!indexWatchExpression) {
14789
- indexWatchExpression = $parse('$index', function moduloTwo($index) {
14790
- return $index & 1;
14791
- });
14792
- }
14793
-
14794
- scope.$watch(indexWatchExpression, ngClassIndexWatchAction);
14795
- }
14796
-
14797
- scope.$watch(watchExpression, watchAction, isOneTime);
14798
-
14799
- function addClasses(classString) {
14800
- classString = digestClassCounts(split(classString), 1);
14801
- attr.$addClass(classString);
14802
- }
14803
-
14804
- function removeClasses(classString) {
14805
- classString = digestClassCounts(split(classString), -1);
14806
- attr.$removeClass(classString);
14807
- }
14808
-
14809
- function updateClasses(oldClassString, newClassString) {
14810
- var oldClassArray = split(oldClassString);
14811
- var newClassArray = split(newClassString);
14812
-
14813
- var toRemoveArray = arrayDifference(oldClassArray, newClassArray);
14814
- var toAddArray = arrayDifference(newClassArray, oldClassArray);
14815
-
14816
- var toRemoveString = digestClassCounts(toRemoveArray, -1);
14817
- var toAddString = digestClassCounts(toAddArray, 1);
14818
-
14819
- attr.$addClass(toAddString);
14820
- attr.$removeClass(toRemoveString);
14821
- }
14822
-
14823
- function digestClassCounts(classArray, count) {
14824
- var classesToUpdate = [];
14825
-
14826
- forEach(classArray, function(className) {
14827
- if (count > 0 || classCounts[className]) {
14828
- classCounts[className] = (classCounts[className] || 0) + count;
14829
- if (classCounts[className] === +(count > 0)) {
14830
- classesToUpdate.push(className);
14831
- }
14832
- }
14833
- });
14834
-
14835
- return classesToUpdate.join(' ');
14836
- }
14837
-
14838
- function ngClassIndexWatchAction(newModulo) {
14839
- if (newModulo === selector) {
14840
- addClasses(oldClassString);
14841
- } else {
14842
- removeClasses(oldClassString);
14843
- }
14844
-
14845
- oldModulo = newModulo;
14846
- }
14847
-
14848
- function ngClassOneTimeWatchAction(newClassValue) {
14849
- var newClassString = toClassString(newClassValue);
14850
-
14851
- if (newClassString !== oldClassString) {
14852
- ngClassWatchAction(newClassString);
14853
- }
14854
- }
14855
-
14856
- function ngClassWatchAction(newClassString) {
14857
- if (oldModulo === selector) {
14858
- updateClasses(oldClassString, newClassString);
14859
- }
14860
-
14861
- oldClassString = newClassString;
14862
- }
14863
- }
14864
- };
14865
- }];
14866
-
14867
- function arrayDifference(tokens1, tokens2) {
14868
- if (!tokens1 || !tokens1.length) return [];
14869
- if (!tokens2 || !tokens2.length) return tokens1;
14870
-
14871
- var values = [];
14872
-
14873
- outer:
14874
- for (var i = 0; i < tokens1.length; i++) {
14875
- var token = tokens1[i];
14876
- for (var j = 0; j < tokens2.length; j++) {
14877
- if (token === tokens2[j]) continue outer;
14878
- }
14879
- values.push(token);
14880
- }
14881
-
14882
- return values;
14883
- }
14884
-
14885
- function split(classString) {
14886
- return classString && classString.split(' ');
14887
- }
14888
-
14889
- function toClassString(classValue) {
14890
- var classString = classValue;
14891
-
14892
- if (isArray(classValue)) {
14893
- classString = classValue.map(toClassString).join(' ');
14894
- } else if (isObject(classValue)) {
14895
- classString = Object.keys(classValue).
14896
- filter(function(key) { return classValue[key]; }).
14897
- join(' ');
14898
- }
14899
-
14900
- return classString;
14901
- }
14902
-
14903
- function toFlatValue(classValue) {
14904
- var flatValue = classValue;
14905
-
14906
- if (isArray(classValue)) {
14907
- flatValue = classValue.map(toFlatValue);
14908
- } else if (isObject(classValue)) {
14909
- var hasUndefined = false;
14910
-
14911
- flatValue = Object.keys(classValue).filter(function(key) {
14912
- var value = classValue[key];
14913
-
14914
- if (!hasUndefined && isUndefined(value)) {
14915
- hasUndefined = true;
14916
- }
14917
-
14918
- return value;
14919
- });
14920
-
14921
- if (hasUndefined) {
14922
- flatValue.push(undefined);
14923
- }
14924
- }
14925
-
14926
- return flatValue;
14927
- }
14928
- }
14929
-
14930
- var ngClassDirective = classDirective('', true);
14931
-
14932
- var ngClassOddDirective = classDirective('Odd', 0);
14933
-
14934
- var ngClassEvenDirective = classDirective('Even', 1);
14935
-
14936
- var ngCloakDirective = ngDirective({
14937
- compile: function(element, attr) {
14938
- attr.$set('ngCloak', undefined);
14939
- element.removeClass('ng-cloak');
14940
- }
14941
- });
14942
-
14943
- var ngControllerDirective = [function() {
14944
- return {
14945
- restrict: 'A',
14946
- scope: true,
14947
- controller: '@',
14948
- priority: 500
14949
- };
14950
- }];
14951
-
14952
-
14953
-
14954
- var ngEventDirectives = {};
14955
-
14956
- var forceAsyncEvents = {
14957
- 'blur': true,
14958
- 'focus': true
14959
- };
14960
- forEach(
14961
- 'click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste'.split(' '),
14962
- function(eventName) {
14963
- var directiveName = directiveNormalize('ng-' + eventName);
14964
- ngEventDirectives[directiveName] = ['$parse', '$rootScope', function($parse, $rootScope) {
14965
- return {
14966
- restrict: 'A',
14967
- compile: function($element, attr) {
14968
- var fn = $parse(attr[directiveName], null, true);
14969
- return function ngEventHandler(scope, element) {
14970
- element.on(eventName, function(event) {
14971
- var callback = function() {
14972
- fn(scope, {$event:event});
14973
- };
14974
- if (forceAsyncEvents[eventName] && $rootScope.$$phase) {
14975
- scope.$evalAsync(callback);
14976
- } else {
14977
- scope.$apply(callback);
14978
- }
14979
- });
14980
- };
14981
- }
14982
- };
14983
- }];
14984
- }
14985
- );
14986
-
14987
-
14988
-
14989
-
14990
-
14991
-
14992
-
14993
-
14994
-
14995
-
14996
-
14997
-
14998
-
14999
-
15000
-
15001
-
15002
-
15003
-
15004
-
15005
-
15006
-
15007
-
15008
-
15009
-
15010
-
15011
-
15012
- var ngIfDirective = ['$animate', '$compile', function($animate, $compile) {
15013
- return {
15014
- multiElement: true,
15015
- transclude: 'element',
15016
- priority: 600,
15017
- terminal: true,
15018
- restrict: 'A',
15019
- $$tlb: true,
15020
- link: function($scope, $element, $attr, ctrl, $transclude) {
15021
- var block, childScope, previousElements;
15022
- $scope.$watch($attr.ngIf, function ngIfWatchAction(value) {
15023
-
15024
- if (value) {
15025
- if (!childScope) {
15026
- $transclude(function(clone, newScope) {
15027
- childScope = newScope;
15028
- clone[clone.length++] = $compile.$$createComment('end ngIf', $attr.ngIf);
15029
- block = {
15030
- clone: clone
15031
- };
15032
- $animate.enter(clone, $element.parent(), $element);
15033
- });
15034
- }
15035
- } else {
15036
- if (previousElements) {
15037
- previousElements.remove();
15038
- previousElements = null;
15039
- }
15040
- if (childScope) {
15041
- childScope.$destroy();
15042
- childScope = null;
15043
- }
15044
- if (block) {
15045
- previousElements = getBlockNodes(block.clone);
15046
- $animate.leave(previousElements).done(function(response) {
15047
- if (response !== false) previousElements = null;
15048
- });
15049
- block = null;
15050
- }
15051
- }
15052
- });
15053
- }
15054
- };
15055
- }];
15056
-
15057
-
15058
-
15059
-
15060
-
15061
-
15062
-
15063
- var ngIncludeDirective = ['$templateRequest', '$anchorScroll', '$animate',
15064
- function($templateRequest, $anchorScroll, $animate) {
15065
- return {
15066
- restrict: 'ECA',
15067
- priority: 400,
15068
- terminal: true,
15069
- transclude: 'element',
15070
- controller: angular.noop,
15071
- compile: function(element, attr) {
15072
- var srcExp = attr.ngInclude || attr.src,
15073
- onloadExp = attr.onload || '',
15074
- autoScrollExp = attr.autoscroll;
15075
-
15076
- return function(scope, $element, $attr, ctrl, $transclude) {
15077
- var changeCounter = 0,
15078
- currentScope,
15079
- previousElement,
15080
- currentElement;
15081
-
15082
- var cleanupLastIncludeContent = function() {
15083
- if (previousElement) {
15084
- previousElement.remove();
15085
- previousElement = null;
15086
- }
15087
- if (currentScope) {
15088
- currentScope.$destroy();
15089
- currentScope = null;
15090
- }
15091
- if (currentElement) {
15092
- $animate.leave(currentElement).done(function(response) {
15093
- if (response !== false) previousElement = null;
15094
- });
15095
- previousElement = currentElement;
15096
- currentElement = null;
15097
- }
15098
- };
15099
-
15100
- scope.$watch(srcExp, function ngIncludeWatchAction(src) {
15101
- var afterAnimation = function(response) {
15102
- if (response !== false && isDefined(autoScrollExp) &&
15103
- (!autoScrollExp || scope.$eval(autoScrollExp))) {
15104
- $anchorScroll();
15105
- }
15106
- };
15107
- var thisChangeId = ++changeCounter;
15108
-
15109
- if (src) {
15110
- $templateRequest(src, true).then(function(response) {
15111
- if (scope.$$destroyed) return;
15112
-
15113
- if (thisChangeId !== changeCounter) return;
15114
- var newScope = scope.$new();
15115
- ctrl.template = response;
15116
-
15117
- var clone = $transclude(newScope, function(clone) {
15118
- cleanupLastIncludeContent();
15119
- $animate.enter(clone, null, $element).done(afterAnimation);
15120
- });
15121
-
15122
- currentScope = newScope;
15123
- currentElement = clone;
15124
-
15125
- currentScope.$emit('$includeContentLoaded', src);
15126
- scope.$eval(onloadExp);
15127
- }, function() {
15128
- if (scope.$$destroyed) return;
15129
-
15130
- if (thisChangeId === changeCounter) {
15131
- cleanupLastIncludeContent();
15132
- scope.$emit('$includeContentError', src);
15133
- }
15134
- });
15135
- scope.$emit('$includeContentRequested', src);
15136
- } else {
15137
- cleanupLastIncludeContent();
15138
- ctrl.template = null;
15139
- }
15140
- });
15141
- };
15142
- }
15143
- };
15144
- }];
15145
-
15146
- var ngIncludeFillContentDirective = ['$compile',
15147
- function($compile) {
15148
- return {
15149
- restrict: 'ECA',
15150
- priority: -400,
15151
- require: 'ngInclude',
15152
- link: function(scope, $element, $attr, ctrl) {
15153
- if (toString.call($element[0]).match(/SVG/)) {
15154
- $element.empty();
15155
- $compile(jqLiteBuildFragment(ctrl.template, window.document).childNodes)(scope,
15156
- function namespaceAdaptedClone(clone) {
15157
- $element.append(clone);
15158
- }, {futureParentElement: $element});
15159
- return;
15160
- }
15161
-
15162
- $element.html(ctrl.template);
15163
- $compile($element.contents())(scope);
15164
- }
15165
- };
15166
- }];
15167
-
15168
- var ngInitDirective = ngDirective({
15169
- priority: 450,
15170
- compile: function() {
15171
- return {
15172
- pre: function(scope, element, attrs) {
15173
- scope.$eval(attrs.ngInit);
15174
- }
15175
- };
15176
- }
15177
- });
15178
-
15179
- var ngListDirective = function() {
15180
- return {
15181
- restrict: 'A',
15182
- priority: 100,
15183
- require: 'ngModel',
15184
- link: function(scope, element, attr, ctrl) {
15185
- var ngList = attr.ngList || ', ';
15186
- var trimValues = attr.ngTrim !== 'false';
15187
- var separator = trimValues ? trim(ngList) : ngList;
15188
-
15189
- var parse = function(viewValue) {
15190
- if (isUndefined(viewValue)) return;
15191
-
15192
- var list = [];
15193
-
15194
- if (viewValue) {
15195
- forEach(viewValue.split(separator), function(value) {
15196
- if (value) list.push(trimValues ? trim(value) : value);
15197
- });
15198
- }
15199
-
15200
- return list;
15201
- };
15202
-
15203
- ctrl.$parsers.push(parse);
15204
- ctrl.$formatters.push(function(value) {
15205
- if (isArray(value)) {
15206
- return value.join(ngList);
15207
- }
15208
-
15209
- return undefined;
15210
- });
15211
-
15212
- ctrl.$isEmpty = function(value) {
15213
- return !value || !value.length;
15214
- };
15215
- }
15216
- };
15217
- };
15218
-
15219
-
15220
-
15221
- var VALID_CLASS = 'ng-valid',
15222
- INVALID_CLASS = 'ng-invalid',
15223
- PRISTINE_CLASS = 'ng-pristine',
15224
- DIRTY_CLASS = 'ng-dirty',
15225
- UNTOUCHED_CLASS = 'ng-untouched',
15226
- TOUCHED_CLASS = 'ng-touched',
15227
- EMPTY_CLASS = 'ng-empty',
15228
- NOT_EMPTY_CLASS = 'ng-not-empty';
15229
-
15230
- var ngModelMinErr = minErr('ngModel');
15231
-
15232
- NgModelController.$inject = ['$scope', '$exceptionHandler', '$attrs', '$element', '$parse', '$animate', '$timeout', '$q', '$interpolate'];
15233
- function NgModelController($scope, $exceptionHandler, $attr, $element, $parse, $animate, $timeout, $q, $interpolate) {
15234
- this.$viewValue = Number.NaN;
15235
- this.$modelValue = Number.NaN;
15236
- this.$$rawModelValue = undefined;
15237
- this.$validators = {};
15238
- this.$asyncValidators = {};
15239
- this.$parsers = [];
15240
- this.$formatters = [];
15241
- this.$viewChangeListeners = [];
15242
- this.$untouched = true;
15243
- this.$touched = false;
15244
- this.$pristine = true;
15245
- this.$dirty = false;
15246
- this.$valid = true;
15247
- this.$invalid = false;
15248
- this.$error = {};
15249
- this.$$success = {};
15250
- this.$pending = undefined;
15251
- this.$name = $interpolate($attr.name || '', false)($scope);
15252
- this.$$parentForm = nullFormCtrl;
15253
- this.$options = defaultModelOptions;
15254
-
15255
- this.$$parsedNgModel = $parse($attr.ngModel);
15256
- this.$$parsedNgModelAssign = this.$$parsedNgModel.assign;
15257
- this.$$ngModelGet = this.$$parsedNgModel;
15258
- this.$$ngModelSet = this.$$parsedNgModelAssign;
15259
- this.$$pendingDebounce = null;
15260
- this.$$parserValid = undefined;
15261
-
15262
- this.$$currentValidationRunId = 0;
15263
-
15264
- this.$$scope = $scope;
15265
- this.$$attr = $attr;
15266
- this.$$element = $element;
15267
- this.$$animate = $animate;
15268
- this.$$timeout = $timeout;
15269
- this.$$parse = $parse;
15270
- this.$$q = $q;
15271
- this.$$exceptionHandler = $exceptionHandler;
15272
-
15273
- setupValidity(this);
15274
- setupModelWatcher(this);
15275
- }
15276
-
15277
- NgModelController.prototype = {
15278
- $$initGetterSetters: function() {
15279
- if (this.$options.getOption('getterSetter')) {
15280
- var invokeModelGetter = this.$$parse(this.$$attr.ngModel + '()'),
15281
- invokeModelSetter = this.$$parse(this.$$attr.ngModel + '($$$p)');
15282
-
15283
- this.$$ngModelGet = function($scope) {
15284
- var modelValue = this.$$parsedNgModel($scope);
15285
- if (isFunction(modelValue)) {
15286
- modelValue = invokeModelGetter($scope);
15287
- }
15288
- return modelValue;
15289
- };
15290
- this.$$ngModelSet = function($scope, newValue) {
15291
- if (isFunction(this.$$parsedNgModel($scope))) {
15292
- invokeModelSetter($scope, {$$$p: newValue});
15293
- } else {
15294
- this.$$parsedNgModelAssign($scope, newValue);
15295
- }
15296
- };
15297
- } else if (!this.$$parsedNgModel.assign) {
15298
- throw ngModelMinErr('nonassign', 'Expression \'{0}\' is non-assignable. Element: {1}',
15299
- this.$$attr.ngModel, startingTag(this.$$element));
15300
- }
15301
- },
15302
-
15303
-
15304
- $render: noop,
15305
-
15306
- $isEmpty: function(value) {
15307
- return isUndefined(value) || value === '' || value === null || value !== value;
15308
- },
15309
-
15310
- $$updateEmptyClasses: function(value) {
15311
- if (this.$isEmpty(value)) {
15312
- this.$$animate.removeClass(this.$$element, NOT_EMPTY_CLASS);
15313
- this.$$animate.addClass(this.$$element, EMPTY_CLASS);
15314
- } else {
15315
- this.$$animate.removeClass(this.$$element, EMPTY_CLASS);
15316
- this.$$animate.addClass(this.$$element, NOT_EMPTY_CLASS);
15317
- }
15318
- },
15319
-
15320
- $setPristine: function() {
15321
- this.$dirty = false;
15322
- this.$pristine = true;
15323
- this.$$animate.removeClass(this.$$element, DIRTY_CLASS);
15324
- this.$$animate.addClass(this.$$element, PRISTINE_CLASS);
15325
- },
15326
-
15327
- $setDirty: function() {
15328
- this.$dirty = true;
15329
- this.$pristine = false;
15330
- this.$$animate.removeClass(this.$$element, PRISTINE_CLASS);
15331
- this.$$animate.addClass(this.$$element, DIRTY_CLASS);
15332
- this.$$parentForm.$setDirty();
15333
- },
15334
-
15335
- $setUntouched: function() {
15336
- this.$touched = false;
15337
- this.$untouched = true;
15338
- this.$$animate.setClass(this.$$element, UNTOUCHED_CLASS, TOUCHED_CLASS);
15339
- },
15340
-
15341
- $setTouched: function() {
15342
- this.$touched = true;
15343
- this.$untouched = false;
15344
- this.$$animate.setClass(this.$$element, TOUCHED_CLASS, UNTOUCHED_CLASS);
15345
- },
15346
-
15347
- $rollbackViewValue: function() {
15348
- this.$$timeout.cancel(this.$$pendingDebounce);
15349
- this.$viewValue = this.$$lastCommittedViewValue;
15350
- this.$render();
15351
- },
15352
-
15353
- $validate: function() {
15354
- if (isNumberNaN(this.$modelValue)) {
15355
- return;
15356
- }
15357
-
15358
- var viewValue = this.$$lastCommittedViewValue;
15359
- var modelValue = this.$$rawModelValue;
15360
-
15361
- var prevValid = this.$valid;
15362
- var prevModelValue = this.$modelValue;
15363
-
15364
- var allowInvalid = this.$options.getOption('allowInvalid');
15365
-
15366
- var that = this;
15367
- this.$$runValidators(modelValue, viewValue, function(allValid) {
15368
- if (!allowInvalid && prevValid !== allValid) {
15369
- that.$modelValue = allValid ? modelValue : undefined;
15370
-
15371
- if (that.$modelValue !== prevModelValue) {
15372
- that.$$writeModelToScope();
15373
- }
15374
- }
15375
- });
15376
- },
15377
-
15378
- $$runValidators: function(modelValue, viewValue, doneCallback) {
15379
- this.$$currentValidationRunId++;
15380
- var localValidationRunId = this.$$currentValidationRunId;
15381
- var that = this;
15382
-
15383
- if (!processParseErrors()) {
15384
- validationDone(false);
15385
- return;
15386
- }
15387
- if (!processSyncValidators()) {
15388
- validationDone(false);
15389
- return;
15390
- }
15391
- processAsyncValidators();
15392
-
15393
- function processParseErrors() {
15394
- var errorKey = that.$$parserName || 'parse';
15395
- if (isUndefined(that.$$parserValid)) {
15396
- setValidity(errorKey, null);
15397
- } else {
15398
- if (!that.$$parserValid) {
15399
- forEach(that.$validators, function(v, name) {
15400
- setValidity(name, null);
15401
- });
15402
- forEach(that.$asyncValidators, function(v, name) {
15403
- setValidity(name, null);
15404
- });
15405
- }
15406
- setValidity(errorKey, that.$$parserValid);
15407
- return that.$$parserValid;
15408
- }
15409
- return true;
15410
- }
15411
-
15412
- function processSyncValidators() {
15413
- var syncValidatorsValid = true;
15414
- forEach(that.$validators, function(validator, name) {
15415
- var result = Boolean(validator(modelValue, viewValue));
15416
- syncValidatorsValid = syncValidatorsValid && result;
15417
- setValidity(name, result);
15418
- });
15419
- if (!syncValidatorsValid) {
15420
- forEach(that.$asyncValidators, function(v, name) {
15421
- setValidity(name, null);
15422
- });
15423
- return false;
15424
- }
15425
- return true;
15426
- }
15427
-
15428
- function processAsyncValidators() {
15429
- var validatorPromises = [];
15430
- var allValid = true;
15431
- forEach(that.$asyncValidators, function(validator, name) {
15432
- var promise = validator(modelValue, viewValue);
15433
- if (!isPromiseLike(promise)) {
15434
- throw ngModelMinErr('nopromise',
15435
- 'Expected asynchronous validator to return a promise but got \'{0}\' instead.', promise);
15436
- }
15437
- setValidity(name, undefined);
15438
- validatorPromises.push(promise.then(function() {
15439
- setValidity(name, true);
15440
- }, function() {
15441
- allValid = false;
15442
- setValidity(name, false);
15443
- }));
15444
- });
15445
- if (!validatorPromises.length) {
15446
- validationDone(true);
15447
- } else {
15448
- that.$$q.all(validatorPromises).then(function() {
15449
- validationDone(allValid);
15450
- }, noop);
15451
- }
15452
- }
15453
-
15454
- function setValidity(name, isValid) {
15455
- if (localValidationRunId === that.$$currentValidationRunId) {
15456
- that.$setValidity(name, isValid);
15457
- }
15458
- }
15459
-
15460
- function validationDone(allValid) {
15461
- if (localValidationRunId === that.$$currentValidationRunId) {
15462
-
15463
- doneCallback(allValid);
15464
- }
15465
- }
15466
- },
15467
-
15468
- $commitViewValue: function() {
15469
- var viewValue = this.$viewValue;
15470
-
15471
- this.$$timeout.cancel(this.$$pendingDebounce);
15472
-
15473
- if (this.$$lastCommittedViewValue === viewValue && (viewValue !== '' || !this.$$hasNativeValidators)) {
15474
- return;
15475
- }
15476
- this.$$updateEmptyClasses(viewValue);
15477
- this.$$lastCommittedViewValue = viewValue;
15478
-
15479
- if (this.$pristine) {
15480
- this.$setDirty();
15481
- }
15482
- this.$$parseAndValidate();
15483
- },
15484
-
15485
- $$parseAndValidate: function() {
15486
- var viewValue = this.$$lastCommittedViewValue;
15487
- var modelValue = viewValue;
15488
- var that = this;
15489
-
15490
- this.$$parserValid = isUndefined(modelValue) ? undefined : true;
15491
-
15492
- if (this.$$parserValid) {
15493
- for (var i = 0; i < this.$parsers.length; i++) {
15494
- modelValue = this.$parsers[i](modelValue);
15495
- if (isUndefined(modelValue)) {
15496
- this.$$parserValid = false;
15497
- break;
15498
- }
15499
- }
15500
- }
15501
- if (isNumberNaN(this.$modelValue)) {
15502
- this.$modelValue = this.$$ngModelGet(this.$$scope);
15503
- }
15504
- var prevModelValue = this.$modelValue;
15505
- var allowInvalid = this.$options.getOption('allowInvalid');
15506
- this.$$rawModelValue = modelValue;
15507
-
15508
- if (allowInvalid) {
15509
- this.$modelValue = modelValue;
15510
- writeToModelIfNeeded();
15511
- }
15512
-
15513
- this.$$runValidators(modelValue, this.$$lastCommittedViewValue, function(allValid) {
15514
- if (!allowInvalid) {
15515
- that.$modelValue = allValid ? modelValue : undefined;
15516
- writeToModelIfNeeded();
15517
- }
15518
- });
15519
-
15520
- function writeToModelIfNeeded() {
15521
- if (that.$modelValue !== prevModelValue) {
15522
- that.$$writeModelToScope();
15523
- }
15524
- }
15525
- },
15526
-
15527
- $$writeModelToScope: function() {
15528
- this.$$ngModelSet(this.$$scope, this.$modelValue);
15529
- forEach(this.$viewChangeListeners, function(listener) {
15530
- try {
15531
- listener();
15532
- } catch (e) {
15533
- this.$$exceptionHandler(e);
15534
- }
15535
- }, this);
15536
- },
15537
-
15538
- $setViewValue: function(value, trigger) {
15539
- this.$viewValue = value;
15540
- if (this.$options.getOption('updateOnDefault')) {
15541
- this.$$debounceViewValueCommit(trigger);
15542
- }
15543
- },
15544
-
15545
- $$debounceViewValueCommit: function(trigger) {
15546
- var debounceDelay = this.$options.getOption('debounce');
15547
-
15548
- if (isNumber(debounceDelay[trigger])) {
15549
- debounceDelay = debounceDelay[trigger];
15550
- } else if (isNumber(debounceDelay['default'])) {
15551
- debounceDelay = debounceDelay['default'];
15552
- }
15553
-
15554
- this.$$timeout.cancel(this.$$pendingDebounce);
15555
- var that = this;
15556
- if (debounceDelay > 0) {
15557
- this.$$pendingDebounce = this.$$timeout(function() {
15558
- that.$commitViewValue();
15559
- }, debounceDelay);
15560
- } else if (this.$$scope.$root.$$phase) {
15561
- this.$commitViewValue();
15562
- } else {
15563
- this.$$scope.$apply(function() {
15564
- that.$commitViewValue();
15565
- });
15566
- }
15567
- }
15568
- };
15569
-
15570
- function setupModelWatcher(ctrl) {
15571
- ctrl.$$scope.$watch(function ngModelWatch() {
15572
- var modelValue = ctrl.$$ngModelGet(ctrl.$$scope);
15573
-
15574
- if (modelValue !== ctrl.$modelValue &&
15575
- (ctrl.$modelValue === ctrl.$modelValue || modelValue === modelValue)
15576
- ) {
15577
- ctrl.$modelValue = ctrl.$$rawModelValue = modelValue;
15578
- ctrl.$$parserValid = undefined;
15579
-
15580
- var formatters = ctrl.$formatters,
15581
- idx = formatters.length;
15582
-
15583
- var viewValue = modelValue;
15584
- while (idx--) {
15585
- viewValue = formatters[idx](viewValue);
15586
- }
15587
- if (ctrl.$viewValue !== viewValue) {
15588
- ctrl.$$updateEmptyClasses(viewValue);
15589
- ctrl.$viewValue = ctrl.$$lastCommittedViewValue = viewValue;
15590
- ctrl.$render();
15591
-
15592
- ctrl.$$runValidators(ctrl.$modelValue, ctrl.$viewValue, noop);
15593
- }
15594
- }
15595
-
15596
- return modelValue;
15597
- });
15598
- }
15599
-
15600
- addSetValidityMethod({
15601
- clazz: NgModelController,
15602
- set: function(object, property) {
15603
- object[property] = true;
15604
- },
15605
- unset: function(object, property) {
15606
- delete object[property];
15607
- }
15608
- });
15609
-
15610
-
15611
- var ngModelDirective = ['$rootScope', function($rootScope) {
15612
- return {
15613
- restrict: 'A',
15614
- require: ['ngModel', '^?form', '^?ngModelOptions'],
15615
- controller: NgModelController,
15616
- priority: 1,
15617
- compile: function ngModelCompile(element) {
15618
- element.addClass(PRISTINE_CLASS).addClass(UNTOUCHED_CLASS).addClass(VALID_CLASS);
15619
-
15620
- return {
15621
- pre: function ngModelPreLink(scope, element, attr, ctrls) {
15622
- var modelCtrl = ctrls[0],
15623
- formCtrl = ctrls[1] || modelCtrl.$$parentForm,
15624
- optionsCtrl = ctrls[2];
15625
-
15626
- if (optionsCtrl) {
15627
- modelCtrl.$options = optionsCtrl.$options;
15628
- }
15629
-
15630
- modelCtrl.$$initGetterSetters();
15631
-
15632
- formCtrl.$addControl(modelCtrl);
15633
-
15634
- attr.$observe('name', function(newValue) {
15635
- if (modelCtrl.$name !== newValue) {
15636
- modelCtrl.$$parentForm.$$renameControl(modelCtrl, newValue);
15637
- }
15638
- });
15639
-
15640
- scope.$on('$destroy', function() {
15641
- modelCtrl.$$parentForm.$removeControl(modelCtrl);
15642
- });
15643
- },
15644
- post: function ngModelPostLink(scope, element, attr, ctrls) {
15645
- var modelCtrl = ctrls[0];
15646
- if (modelCtrl.$options.getOption('updateOn')) {
15647
- element.on(modelCtrl.$options.getOption('updateOn'), function(ev) {
15648
- modelCtrl.$$debounceViewValueCommit(ev && ev.type);
15649
- });
15650
- }
15651
-
15652
- function setTouched() {
15653
- modelCtrl.$setTouched();
15654
- }
15655
-
15656
- element.on('blur', function() {
15657
- if (modelCtrl.$touched) return;
15658
-
15659
- if ($rootScope.$$phase) {
15660
- scope.$evalAsync(setTouched);
15661
- } else {
15662
- scope.$apply(setTouched);
15663
- }
15664
- });
15665
- }
15666
- };
15667
- }
15668
- };
15669
- }];
15670
-
15671
- var defaultModelOptions;
15672
- var DEFAULT_REGEXP = /(\s+|^)default(\s+|$)/;
15673
-
15674
- function ModelOptions(options) {
15675
- this.$$options = options;
15676
- }
15677
-
15678
- ModelOptions.prototype = {
15679
-
15680
- getOption: function(name) {
15681
- return this.$$options[name];
15682
- },
15683
-
15684
- createChild: function(options) {
15685
- var inheritAll = false;
15686
-
15687
- options = extend({}, options);
15688
-
15689
- forEach(options, function(option, key) {
15690
- if (option === '$inherit') {
15691
- if (key === '*') {
15692
- inheritAll = true;
15693
- } else {
15694
- options[key] = this.$$options[key];
15695
- if (key === 'updateOn') {
15696
- options.updateOnDefault = this.$$options.updateOnDefault;
15697
- }
15698
- }
15699
- } else {
15700
- if (key === 'updateOn') {
15701
- options.updateOnDefault = false;
15702
- options[key] = trim(option.replace(DEFAULT_REGEXP, function() {
15703
- options.updateOnDefault = true;
15704
- return ' ';
15705
- }));
15706
- }
15707
- }
15708
- }, this);
15709
-
15710
- if (inheritAll) {
15711
- delete options['*'];
15712
- defaults(options, this.$$options);
15713
- }
15714
-
15715
- defaults(options, defaultModelOptions.$$options);
15716
-
15717
- return new ModelOptions(options);
15718
- }
15719
- };
15720
-
15721
-
15722
- defaultModelOptions = new ModelOptions({
15723
- updateOn: '',
15724
- updateOnDefault: true,
15725
- debounce: 0,
15726
- getterSetter: false,
15727
- allowInvalid: false,
15728
- timezone: null
15729
- });
15730
-
15731
-
15732
- var ngModelOptionsDirective = function() {
15733
- NgModelOptionsController.$inject = ['$attrs', '$scope'];
15734
- function NgModelOptionsController($attrs, $scope) {
15735
- this.$$attrs = $attrs;
15736
- this.$$scope = $scope;
15737
- }
15738
- NgModelOptionsController.prototype = {
15739
- $onInit: function() {
15740
- var parentOptions = this.parentCtrl ? this.parentCtrl.$options : defaultModelOptions;
15741
- var modelOptionsDefinition = this.$$scope.$eval(this.$$attrs.ngModelOptions);
15742
-
15743
- this.$options = parentOptions.createChild(modelOptionsDefinition);
15744
- }
15745
- };
15746
-
15747
- return {
15748
- restrict: 'A',
15749
- priority: 10,
15750
- require: {parentCtrl: '?^^ngModelOptions'},
15751
- bindToController: true,
15752
- controller: NgModelOptionsController
15753
- };
15754
- };
15755
-
15756
-
15757
- function defaults(dst, src) {
15758
- forEach(src, function(value, key) {
15759
- if (!isDefined(dst[key])) {
15760
- dst[key] = value;
15761
- }
15762
- });
15763
- }
15764
-
15765
- var ngNonBindableDirective = ngDirective({ terminal: true, priority: 1000 });
15766
-
15767
-
15768
-
15769
- var ngOptionsMinErr = minErr('ngOptions');
15770
-
15771
-
15772
- var NG_OPTIONS_REGEXP = /^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+group\s+by\s+([\s\S]+?))?(?:\s+disable\s+when\s+([\s\S]+?))?\s+for\s+(?:([$\w][$\w]*)|(?:\(\s*([$\w][$\w]*)\s*,\s*([$\w][$\w]*)\s*\)))\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?$/;
15773
-
15774
-
15775
- var ngOptionsDirective = ['$compile', '$document', '$parse', function($compile, $document, $parse) {
15776
-
15777
- function parseOptionsExpression(optionsExp, selectElement, scope) {
15778
-
15779
- var match = optionsExp.match(NG_OPTIONS_REGEXP);
15780
- if (!(match)) {
15781
- throw ngOptionsMinErr('iexp',
15782
- 'Expected expression in form of ' +
15783
- '\'_select_ (as _label_)? for (_key_,)?_value_ in _collection_\'' +
15784
- ' but got \'{0}\'. Element: {1}',
15785
- optionsExp, startingTag(selectElement));
15786
- }
15787
-
15788
-
15789
- var valueName = match[5] || match[7];
15790
- var keyName = match[6];
15791
-
15792
- var selectAs = / as /.test(match[0]) && match[1];
15793
- var trackBy = match[9];
15794
- var valueFn = $parse(match[2] ? match[1] : valueName);
15795
- var selectAsFn = selectAs && $parse(selectAs);
15796
- var viewValueFn = selectAsFn || valueFn;
15797
- var trackByFn = trackBy && $parse(trackBy);
15798
-
15799
- var getTrackByValueFn = trackBy ?
15800
- function(value, locals) { return trackByFn(scope, locals); } :
15801
- function getHashOfValue(value) { return hashKey(value); };
15802
- var getTrackByValue = function(value, key) {
15803
- return getTrackByValueFn(value, getLocals(value, key));
15804
- };
15805
-
15806
- var displayFn = $parse(match[2] || match[1]);
15807
- var groupByFn = $parse(match[3] || '');
15808
- var disableWhenFn = $parse(match[4] || '');
15809
- var valuesFn = $parse(match[8]);
15810
-
15811
- var locals = {};
15812
- var getLocals = keyName ? function(value, key) {
15813
- locals[keyName] = key;
15814
- locals[valueName] = value;
15815
- return locals;
15816
- } : function(value) {
15817
- locals[valueName] = value;
15818
- return locals;
15819
- };
15820
-
15821
-
15822
- function Option(selectValue, viewValue, label, group, disabled) {
15823
- this.selectValue = selectValue;
15824
- this.viewValue = viewValue;
15825
- this.label = label;
15826
- this.group = group;
15827
- this.disabled = disabled;
15828
- }
15829
-
15830
- function getOptionValuesKeys(optionValues) {
15831
- var optionValuesKeys;
15832
-
15833
- if (!keyName && isArrayLike(optionValues)) {
15834
- optionValuesKeys = optionValues;
15835
- } else {
15836
- optionValuesKeys = [];
15837
- for (var itemKey in optionValues) {
15838
- if (optionValues.hasOwnProperty(itemKey) && itemKey.charAt(0) !== '$') {
15839
- optionValuesKeys.push(itemKey);
15840
- }
15841
- }
15842
- }
15843
- return optionValuesKeys;
15844
- }
15845
-
15846
- return {
15847
- trackBy: trackBy,
15848
- getTrackByValue: getTrackByValue,
15849
- getWatchables: $parse(valuesFn, function(optionValues) {
15850
- var watchedArray = [];
15851
- optionValues = optionValues || [];
15852
-
15853
- var optionValuesKeys = getOptionValuesKeys(optionValues);
15854
- var optionValuesLength = optionValuesKeys.length;
15855
- for (var index = 0; index < optionValuesLength; index++) {
15856
- var key = (optionValues === optionValuesKeys) ? index : optionValuesKeys[index];
15857
- var value = optionValues[key];
15858
-
15859
- var locals = getLocals(value, key);
15860
- var selectValue = getTrackByValueFn(value, locals);
15861
- watchedArray.push(selectValue);
15862
-
15863
- if (match[2] || match[1]) {
15864
- var label = displayFn(scope, locals);
15865
- watchedArray.push(label);
15866
- }
15867
-
15868
- if (match[4]) {
15869
- var disableWhen = disableWhenFn(scope, locals);
15870
- watchedArray.push(disableWhen);
15871
- }
15872
- }
15873
- return watchedArray;
15874
- }),
15875
-
15876
- getOptions: function() {
15877
-
15878
- var optionItems = [];
15879
- var selectValueMap = {};
15880
-
15881
- var optionValues = valuesFn(scope) || [];
15882
- var optionValuesKeys = getOptionValuesKeys(optionValues);
15883
- var optionValuesLength = optionValuesKeys.length;
15884
-
15885
- for (var index = 0; index < optionValuesLength; index++) {
15886
- var key = (optionValues === optionValuesKeys) ? index : optionValuesKeys[index];
15887
- var value = optionValues[key];
15888
- var locals = getLocals(value, key);
15889
- var viewValue = viewValueFn(scope, locals);
15890
- var selectValue = getTrackByValueFn(viewValue, locals);
15891
- var label = displayFn(scope, locals);
15892
- var group = groupByFn(scope, locals);
15893
- var disabled = disableWhenFn(scope, locals);
15894
- var optionItem = new Option(selectValue, viewValue, label, group, disabled);
15895
-
15896
- optionItems.push(optionItem);
15897
- selectValueMap[selectValue] = optionItem;
15898
- }
15899
-
15900
- return {
15901
- items: optionItems,
15902
- selectValueMap: selectValueMap,
15903
- getOptionFromViewValue: function(value) {
15904
- return selectValueMap[getTrackByValue(value)];
15905
- },
15906
- getViewValueFromOption: function(option) {
15907
- return trackBy ? copy(option.viewValue) : option.viewValue;
15908
- }
15909
- };
15910
- }
15911
- };
15912
- }
15913
-
15914
-
15915
- var optionTemplate = window.document.createElement('option'),
15916
- optGroupTemplate = window.document.createElement('optgroup');
15917
-
15918
- function ngOptionsPostLink(scope, selectElement, attr, ctrls) {
15919
-
15920
- var selectCtrl = ctrls[0];
15921
- var ngModelCtrl = ctrls[1];
15922
- var multiple = attr.multiple;
15923
-
15924
- for (var i = 0, children = selectElement.children(), ii = children.length; i < ii; i++) {
15925
- if (children[i].value === '') {
15926
- selectCtrl.hasEmptyOption = true;
15927
- selectCtrl.emptyOption = children.eq(i);
15928
- break;
15929
- }
15930
- }
15931
-
15932
- var providedEmptyOption = !!selectCtrl.emptyOption;
15933
-
15934
- var unknownOption = jqLite(optionTemplate.cloneNode(false));
15935
- unknownOption.val('?');
15936
-
15937
- var options;
15938
- var ngOptions = parseOptionsExpression(attr.ngOptions, selectElement, scope);
15939
- var listFragment = $document[0].createDocumentFragment();
15940
-
15941
- selectCtrl.generateUnknownOptionValue = function(val) {
15942
- return '?';
15943
- };
15944
-
15945
- if (!multiple) {
15946
-
15947
- selectCtrl.writeValue = function writeNgOptionsValue(value) {
15948
- var selectedOption = options.selectValueMap[selectElement.val()];
15949
- var option = options.getOptionFromViewValue(value);
15950
-
15951
- if (selectedOption) selectedOption.element.removeAttribute('selected');
15952
-
15953
- if (option) {
15954
-
15955
- if (selectElement[0].value !== option.selectValue) {
15956
- selectCtrl.removeUnknownOption();
15957
- selectCtrl.unselectEmptyOption();
15958
-
15959
- selectElement[0].value = option.selectValue;
15960
- option.element.selected = true;
15961
- }
15962
-
15963
- option.element.setAttribute('selected', 'selected');
15964
- } else {
15965
-
15966
- if (providedEmptyOption) {
15967
- selectCtrl.selectEmptyOption();
15968
- } else if (selectCtrl.unknownOption.parent().length) {
15969
- selectCtrl.updateUnknownOption(value);
15970
- } else {
15971
- selectCtrl.renderUnknownOption(value);
15972
- }
15973
- }
15974
- };
15975
-
15976
- selectCtrl.readValue = function readNgOptionsValue() {
15977
-
15978
- var selectedOption = options.selectValueMap[selectElement.val()];
15979
-
15980
- if (selectedOption && !selectedOption.disabled) {
15981
- selectCtrl.unselectEmptyOption();
15982
- selectCtrl.removeUnknownOption();
15983
- return options.getViewValueFromOption(selectedOption);
15984
- }
15985
- return null;
15986
- };
15987
-
15988
- if (ngOptions.trackBy) {
15989
- scope.$watch(
15990
- function() { return ngOptions.getTrackByValue(ngModelCtrl.$viewValue); },
15991
- function() { ngModelCtrl.$render(); }
15992
- );
15993
- }
15994
-
15995
- } else {
15996
-
15997
- selectCtrl.writeValue = function writeNgOptionsMultiple(values) {
15998
-
15999
- var selectedOptions = values && values.map(getAndUpdateSelectedOption) || [];
16000
-
16001
- options.items.forEach(function(option) {
16002
- if (option.element.selected && !includes(selectedOptions, option)) {
16003
- option.element.selected = false;
16004
- }
16005
- });
16006
- };
16007
-
16008
-
16009
- selectCtrl.readValue = function readNgOptionsMultiple() {
16010
- var selectedValues = selectElement.val() || [],
16011
- selections = [];
16012
-
16013
- forEach(selectedValues, function(value) {
16014
- var option = options.selectValueMap[value];
16015
- if (option && !option.disabled) selections.push(options.getViewValueFromOption(option));
16016
- });
16017
-
16018
- return selections;
16019
- };
16020
-
16021
- if (ngOptions.trackBy) {
16022
-
16023
- scope.$watchCollection(function() {
16024
- if (isArray(ngModelCtrl.$viewValue)) {
16025
- return ngModelCtrl.$viewValue.map(function(value) {
16026
- return ngOptions.getTrackByValue(value);
16027
- });
16028
- }
16029
- }, function() {
16030
- ngModelCtrl.$render();
16031
- });
16032
-
16033
- }
16034
- }
16035
-
16036
- if (providedEmptyOption) {
16037
-
16038
- selectCtrl.emptyOption.remove();
16039
-
16040
- $compile(selectCtrl.emptyOption)(scope);
16041
-
16042
- if (selectCtrl.emptyOption[0].nodeType === NODE_TYPE_COMMENT) {
16043
- selectCtrl.hasEmptyOption = false;
16044
-
16045
- selectCtrl.registerOption = function(optionScope, optionEl) {
16046
- if (optionEl.val() === '') {
16047
- selectCtrl.hasEmptyOption = true;
16048
- selectCtrl.emptyOption = optionEl;
16049
- selectCtrl.emptyOption.removeClass('ng-scope');
16050
- ngModelCtrl.$render();
16051
-
16052
- optionEl.on('$destroy', function() {
16053
- selectCtrl.hasEmptyOption = false;
16054
- selectCtrl.emptyOption = undefined;
16055
- });
16056
- }
16057
- };
16058
-
16059
- } else {
16060
- selectCtrl.emptyOption.removeClass('ng-scope');
16061
- }
16062
-
16063
- }
16064
-
16065
- selectElement.empty();
16066
-
16067
- updateOptions();
16068
-
16069
- scope.$watchCollection(ngOptions.getWatchables, updateOptions);
16070
-
16071
-
16072
- function addOptionElement(option, parent) {
16073
- var optionElement = optionTemplate.cloneNode(false);
16074
- parent.appendChild(optionElement);
16075
- updateOptionElement(option, optionElement);
16076
- }
16077
-
16078
- function getAndUpdateSelectedOption(viewValue) {
16079
- var option = options.getOptionFromViewValue(viewValue);
16080
- var element = option && option.element;
16081
-
16082
- if (element && !element.selected) element.selected = true;
16083
-
16084
- return option;
16085
- }
16086
-
16087
- function updateOptionElement(option, element) {
16088
- option.element = element;
16089
- element.disabled = option.disabled;
16090
- if (option.label !== element.label) {
16091
- element.label = option.label;
16092
- element.textContent = option.label;
16093
- }
16094
- element.value = option.selectValue;
16095
- }
16096
-
16097
- function updateOptions() {
16098
- var previousValue = options && selectCtrl.readValue();
16099
-
16100
- if (options) {
16101
-
16102
- for (var i = options.items.length - 1; i >= 0; i--) {
16103
- var option = options.items[i];
16104
- if (isDefined(option.group)) {
16105
- jqLiteRemove(option.element.parentNode);
16106
- } else {
16107
- jqLiteRemove(option.element);
16108
- }
16109
- }
16110
- }
16111
-
16112
- options = ngOptions.getOptions();
16113
-
16114
- var groupElementMap = {};
16115
-
16116
- if (providedEmptyOption) {
16117
- selectElement.prepend(selectCtrl.emptyOption);
16118
- }
16119
-
16120
- options.items.forEach(function addOption(option) {
16121
- var groupElement;
16122
-
16123
- if (isDefined(option.group)) {
16124
-
16125
- groupElement = groupElementMap[option.group];
16126
-
16127
- if (!groupElement) {
16128
-
16129
- groupElement = optGroupTemplate.cloneNode(false);
16130
- listFragment.appendChild(groupElement);
16131
-
16132
- groupElement.label = option.group === null ? 'null' : option.group;
16133
-
16134
- groupElementMap[option.group] = groupElement;
16135
- }
16136
-
16137
- addOptionElement(option, groupElement);
16138
-
16139
- } else {
16140
-
16141
- addOptionElement(option, listFragment);
16142
- }
16143
- });
16144
-
16145
- selectElement[0].appendChild(listFragment);
16146
-
16147
- ngModelCtrl.$render();
16148
-
16149
- if (!ngModelCtrl.$isEmpty(previousValue)) {
16150
- var nextValue = selectCtrl.readValue();
16151
- var isNotPrimitive = ngOptions.trackBy || multiple;
16152
- if (isNotPrimitive ? !equals(previousValue, nextValue) : previousValue !== nextValue) {
16153
- ngModelCtrl.$setViewValue(nextValue);
16154
- ngModelCtrl.$render();
16155
- }
16156
- }
16157
-
16158
- }
16159
- }
16160
-
16161
- return {
16162
- restrict: 'A',
16163
- terminal: true,
16164
- require: ['select', 'ngModel'],
16165
- link: {
16166
- pre: function ngOptionsPreLink(scope, selectElement, attr, ctrls) {
16167
- ctrls[0].registerOption = noop;
16168
- },
16169
- post: ngOptionsPostLink
16170
- }
16171
- };
16172
- }];
16173
-
16174
- var ngPluralizeDirective = ['$locale', '$interpolate', '$log', function($locale, $interpolate, $log) {
16175
- var BRACE = /{}/g,
16176
- IS_WHEN = /^when(Minus)?(.+)$/;
16177
-
16178
- return {
16179
- link: function(scope, element, attr) {
16180
- var numberExp = attr.count,
16181
- whenExp = attr.$attr.when && element.attr(attr.$attr.when),
16182
- offset = attr.offset || 0,
16183
- whens = scope.$eval(whenExp) || {},
16184
- whensExpFns = {},
16185
- startSymbol = $interpolate.startSymbol(),
16186
- endSymbol = $interpolate.endSymbol(),
16187
- braceReplacement = startSymbol + numberExp + '-' + offset + endSymbol,
16188
- watchRemover = angular.noop,
16189
- lastCount;
16190
-
16191
- forEach(attr, function(expression, attributeName) {
16192
- var tmpMatch = IS_WHEN.exec(attributeName);
16193
- if (tmpMatch) {
16194
- var whenKey = (tmpMatch[1] ? '-' : '') + lowercase(tmpMatch[2]);
16195
- whens[whenKey] = element.attr(attr.$attr[attributeName]);
16196
- }
16197
- });
16198
- forEach(whens, function(expression, key) {
16199
- whensExpFns[key] = $interpolate(expression.replace(BRACE, braceReplacement));
16200
-
16201
- });
16202
-
16203
- scope.$watch(numberExp, function ngPluralizeWatchAction(newVal) {
16204
- var count = parseFloat(newVal);
16205
- var countIsNaN = isNumberNaN(count);
16206
-
16207
- if (!countIsNaN && !(count in whens)) {
16208
- count = $locale.pluralCat(count - offset);
16209
- }
16210
-
16211
- if ((count !== lastCount) && !(countIsNaN && isNumberNaN(lastCount))) {
16212
- watchRemover();
16213
- var whenExpFn = whensExpFns[count];
16214
- if (isUndefined(whenExpFn)) {
16215
- if (newVal != null) {
16216
- $log.debug('ngPluralize: no rule defined for \'' + count + '\' in ' + whenExp);
16217
- }
16218
- watchRemover = noop;
16219
- updateElementText();
16220
- } else {
16221
- watchRemover = scope.$watch(whenExpFn, updateElementText);
16222
- }
16223
- lastCount = count;
16224
- }
16225
- });
16226
-
16227
- function updateElementText(newText) {
16228
- element.text(newText || '');
16229
- }
16230
- }
16231
- };
16232
- }];
16233
-
16234
-
16235
- var ngRepeatDirective = ['$parse', '$animate', '$compile', function($parse, $animate, $compile) {
16236
- var NG_REMOVED = '$$NG_REMOVED';
16237
- var ngRepeatMinErr = minErr('ngRepeat');
16238
-
16239
- var updateScope = function(scope, index, valueIdentifier, value, keyIdentifier, key, arrayLength) {
16240
- scope[valueIdentifier] = value;
16241
- if (keyIdentifier) scope[keyIdentifier] = key;
16242
- scope.$index = index;
16243
- scope.$first = (index === 0);
16244
- scope.$last = (index === (arrayLength - 1));
16245
- scope.$middle = !(scope.$first || scope.$last);
16246
- scope.$odd = !(scope.$even = (index & 1) === 0);
16247
- };
16248
-
16249
- var getBlockStart = function(block) {
16250
- return block.clone[0];
16251
- };
16252
-
16253
- var getBlockEnd = function(block) {
16254
- return block.clone[block.clone.length - 1];
16255
- };
16256
-
16257
-
16258
- return {
16259
- restrict: 'A',
16260
- multiElement: true,
16261
- transclude: 'element',
16262
- priority: 1000,
16263
- terminal: true,
16264
- $$tlb: true,
16265
- compile: function ngRepeatCompile($element, $attr) {
16266
- var expression = $attr.ngRepeat;
16267
- var ngRepeatEndComment = $compile.$$createComment('end ngRepeat', expression);
16268
-
16269
- var match = expression.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+track\s+by\s+([\s\S]+?))?\s*$/);
16270
-
16271
- if (!match) {
16272
- throw ngRepeatMinErr('iexp', 'Expected expression in form of \'_item_ in _collection_[ track by _id_]\' but got \'{0}\'.',
16273
- expression);
16274
- }
16275
-
16276
- var lhs = match[1];
16277
- var rhs = match[2];
16278
- var aliasAs = match[3];
16279
- var trackByExp = match[4];
16280
-
16281
- match = lhs.match(/^(?:(\s*[$\w]+)|\(\s*([$\w]+)\s*,\s*([$\w]+)\s*\))$/);
16282
-
16283
- if (!match) {
16284
- throw ngRepeatMinErr('iidexp', '\'_item_\' in \'_item_ in _collection_\' should be an identifier or \'(_key_, _value_)\' expression, but got \'{0}\'.',
16285
- lhs);
16286
- }
16287
- var valueIdentifier = match[3] || match[1];
16288
- var keyIdentifier = match[2];
16289
-
16290
- if (aliasAs && (!/^[$a-zA-Z_][$a-zA-Z0-9_]*$/.test(aliasAs) ||
16291
- /^(null|undefined|this|\$index|\$first|\$middle|\$last|\$even|\$odd|\$parent|\$root|\$id)$/.test(aliasAs))) {
16292
- throw ngRepeatMinErr('badident', 'alias \'{0}\' is invalid --- must be a valid JS identifier which is not a reserved name.',
16293
- aliasAs);
16294
- }
16295
-
16296
- var trackByExpGetter, trackByIdExpFn, trackByIdArrayFn, trackByIdObjFn;
16297
- var hashFnLocals = {$id: hashKey};
16298
-
16299
- if (trackByExp) {
16300
- trackByExpGetter = $parse(trackByExp);
16301
- } else {
16302
- trackByIdArrayFn = function(key, value) {
16303
- return hashKey(value);
16304
- };
16305
- trackByIdObjFn = function(key) {
16306
- return key;
16307
- };
16308
- }
16309
-
16310
- return function ngRepeatLink($scope, $element, $attr, ctrl, $transclude) {
16311
-
16312
- if (trackByExpGetter) {
16313
- trackByIdExpFn = function(key, value, index) {
16314
- if (keyIdentifier) hashFnLocals[keyIdentifier] = key;
16315
- hashFnLocals[valueIdentifier] = value;
16316
- hashFnLocals.$index = index;
16317
- return trackByExpGetter($scope, hashFnLocals);
16318
- };
16319
- }
16320
-
16321
- var lastBlockMap = createMap();
16322
-
16323
- $scope.$watchCollection(rhs, function ngRepeatAction(collection) {
16324
- var index, length,
16325
- previousNode = $element[0],
16326
- nextNode,
16327
- nextBlockMap = createMap(),
16328
- collectionLength,
16329
- key, value,
16330
- trackById,
16331
- trackByIdFn,
16332
- collectionKeys,
16333
- block,
16334
- nextBlockOrder,
16335
- elementsToRemove;
16336
-
16337
- if (aliasAs) {
16338
- $scope[aliasAs] = collection;
16339
- }
16340
-
16341
- if (isArrayLike(collection)) {
16342
- collectionKeys = collection;
16343
- trackByIdFn = trackByIdExpFn || trackByIdArrayFn;
16344
- } else {
16345
- trackByIdFn = trackByIdExpFn || trackByIdObjFn;
16346
- collectionKeys = [];
16347
- for (var itemKey in collection) {
16348
- if (hasOwnProperty.call(collection, itemKey) && itemKey.charAt(0) !== '$') {
16349
- collectionKeys.push(itemKey);
16350
- }
16351
- }
16352
- }
16353
-
16354
- collectionLength = collectionKeys.length;
16355
- nextBlockOrder = new Array(collectionLength);
16356
-
16357
- for (index = 0; index < collectionLength; index++) {
16358
- key = (collection === collectionKeys) ? index : collectionKeys[index];
16359
- value = collection[key];
16360
- trackById = trackByIdFn(key, value, index);
16361
- if (lastBlockMap[trackById]) {
16362
- block = lastBlockMap[trackById];
16363
- delete lastBlockMap[trackById];
16364
- nextBlockMap[trackById] = block;
16365
- nextBlockOrder[index] = block;
16366
- } else if (nextBlockMap[trackById]) {
16367
- forEach(nextBlockOrder, function(block) {
16368
- if (block && block.scope) lastBlockMap[block.id] = block;
16369
- });
16370
- throw ngRepeatMinErr('dupes',
16371
- 'Duplicates in a repeater are not allowed. Use \'track by\' expression to specify unique keys. Repeater: {0}, Duplicate key: {1}, Duplicate value: {2}',
16372
- expression, trackById, value);
16373
- } else {
16374
- nextBlockOrder[index] = {id: trackById, scope: undefined, clone: undefined};
16375
- nextBlockMap[trackById] = true;
16376
- }
16377
- }
16378
-
16379
- for (var blockKey in lastBlockMap) {
16380
- block = lastBlockMap[blockKey];
16381
- elementsToRemove = getBlockNodes(block.clone);
16382
- $animate.leave(elementsToRemove);
16383
- if (elementsToRemove[0].parentNode) {
16384
- for (index = 0, length = elementsToRemove.length; index < length; index++) {
16385
- elementsToRemove[index][NG_REMOVED] = true;
16386
- }
16387
- }
16388
- block.scope.$destroy();
16389
- }
16390
-
16391
- for (index = 0; index < collectionLength; index++) {
16392
- key = (collection === collectionKeys) ? index : collectionKeys[index];
16393
- value = collection[key];
16394
- block = nextBlockOrder[index];
16395
-
16396
- if (block.scope) {
16397
-
16398
- nextNode = previousNode;
16399
-
16400
- do {
16401
- nextNode = nextNode.nextSibling;
16402
- } while (nextNode && nextNode[NG_REMOVED]);
16403
-
16404
- if (getBlockStart(block) !== nextNode) {
16405
- $animate.move(getBlockNodes(block.clone), null, previousNode);
16406
- }
16407
- previousNode = getBlockEnd(block);
16408
- updateScope(block.scope, index, valueIdentifier, value, keyIdentifier, key, collectionLength);
16409
- } else {
16410
- $transclude(function ngRepeatTransclude(clone, scope) {
16411
- block.scope = scope;
16412
- var endNode = ngRepeatEndComment.cloneNode(false);
16413
- clone[clone.length++] = endNode;
16414
-
16415
- $animate.enter(clone, null, previousNode);
16416
- previousNode = endNode;
16417
- block.clone = clone;
16418
- nextBlockMap[block.id] = block;
16419
- updateScope(block.scope, index, valueIdentifier, value, keyIdentifier, key, collectionLength);
16420
- });
16421
- }
16422
- }
16423
- lastBlockMap = nextBlockMap;
16424
- });
16425
- };
16426
- }
16427
- };
16428
- }];
16429
-
16430
- var NG_HIDE_CLASS = 'ng-hide';
16431
- var NG_HIDE_IN_PROGRESS_CLASS = 'ng-hide-animate';
16432
- var ngShowDirective = ['$animate', function($animate) {
16433
- return {
16434
- restrict: 'A',
16435
- multiElement: true,
16436
- link: function(scope, element, attr) {
16437
- scope.$watch(attr.ngShow, function ngShowWatchAction(value) {
16438
- $animate[value ? 'removeClass' : 'addClass'](element, NG_HIDE_CLASS, {
16439
- tempClasses: NG_HIDE_IN_PROGRESS_CLASS
16440
- });
16441
- });
16442
- }
16443
- };
16444
- }];
16445
-
16446
-
16447
- var ngHideDirective = ['$animate', function($animate) {
16448
- return {
16449
- restrict: 'A',
16450
- multiElement: true,
16451
- link: function(scope, element, attr) {
16452
- scope.$watch(attr.ngHide, function ngHideWatchAction(value) {
16453
- $animate[value ? 'addClass' : 'removeClass'](element,NG_HIDE_CLASS, {
16454
- tempClasses: NG_HIDE_IN_PROGRESS_CLASS
16455
- });
16456
- });
16457
- }
16458
- };
16459
- }];
16460
-
16461
- var ngStyleDirective = ngDirective(function(scope, element, attr) {
16462
- scope.$watch(attr.ngStyle, function ngStyleWatchAction(newStyles, oldStyles) {
16463
- if (oldStyles && (newStyles !== oldStyles)) {
16464
- forEach(oldStyles, function(val, style) { element.css(style, '');});
16465
- }
16466
- if (newStyles) element.css(newStyles);
16467
- }, true);
16468
- });
16469
-
16470
- var ngSwitchDirective = ['$animate', '$compile', function($animate, $compile) {
16471
- return {
16472
- require: 'ngSwitch',
16473
-
16474
- controller: ['$scope', function NgSwitchController() {
16475
- this.cases = {};
16476
- }],
16477
- link: function(scope, element, attr, ngSwitchController) {
16478
- var watchExpr = attr.ngSwitch || attr.on,
16479
- selectedTranscludes = [],
16480
- selectedElements = [],
16481
- previousLeaveAnimations = [],
16482
- selectedScopes = [];
16483
-
16484
- var spliceFactory = function(array, index) {
16485
- return function(response) {
16486
- if (response !== false) array.splice(index, 1);
16487
- };
16488
- };
16489
-
16490
- scope.$watch(watchExpr, function ngSwitchWatchAction(value) {
16491
- var i, ii;
16492
-
16493
- while (previousLeaveAnimations.length) {
16494
- $animate.cancel(previousLeaveAnimations.pop());
16495
- }
16496
-
16497
- for (i = 0, ii = selectedScopes.length; i < ii; ++i) {
16498
- var selected = getBlockNodes(selectedElements[i].clone);
16499
- selectedScopes[i].$destroy();
16500
- var runner = previousLeaveAnimations[i] = $animate.leave(selected);
16501
- runner.done(spliceFactory(previousLeaveAnimations, i));
16502
- }
16503
-
16504
- selectedElements.length = 0;
16505
- selectedScopes.length = 0;
16506
-
16507
- if ((selectedTranscludes = ngSwitchController.cases['!' + value] || ngSwitchController.cases['?'])) {
16508
- forEach(selectedTranscludes, function(selectedTransclude) {
16509
- selectedTransclude.transclude(function(caseElement, selectedScope) {
16510
- selectedScopes.push(selectedScope);
16511
- var anchor = selectedTransclude.element;
16512
- caseElement[caseElement.length++] = $compile.$$createComment('end ngSwitchWhen');
16513
- var block = { clone: caseElement };
16514
-
16515
- selectedElements.push(block);
16516
- $animate.enter(caseElement, anchor.parent(), anchor);
16517
- });
16518
- });
16519
- }
16520
- });
16521
- }
16522
- };
16523
- }];
16524
-
16525
- var ngSwitchWhenDirective = ngDirective({
16526
- transclude: 'element',
16527
- priority: 1200,
16528
- require: '^ngSwitch',
16529
- multiElement: true,
16530
- link: function(scope, element, attrs, ctrl, $transclude) {
16531
-
16532
- var cases = attrs.ngSwitchWhen.split(attrs.ngSwitchWhenSeparator).sort().filter(
16533
- function(element, index, array) { return array[index - 1] !== element; }
16534
- );
16535
-
16536
- forEach(cases, function(whenCase) {
16537
- ctrl.cases['!' + whenCase] = (ctrl.cases['!' + whenCase] || []);
16538
- ctrl.cases['!' + whenCase].push({ transclude: $transclude, element: element });
16539
- });
16540
- }
16541
- });
16542
-
16543
- var ngSwitchDefaultDirective = ngDirective({
16544
- transclude: 'element',
16545
- priority: 1200,
16546
- require: '^ngSwitch',
16547
- multiElement: true,
16548
- link: function(scope, element, attr, ctrl, $transclude) {
16549
- ctrl.cases['?'] = (ctrl.cases['?'] || []);
16550
- ctrl.cases['?'].push({ transclude: $transclude, element: element });
16551
- }
16552
- });
16553
-
16554
- var ngTranscludeMinErr = minErr('ngTransclude');
16555
- var ngTranscludeDirective = ['$compile', function($compile) {
16556
- return {
16557
- restrict: 'EAC',
16558
- terminal: true,
16559
- compile: function ngTranscludeCompile(tElement) {
16560
-
16561
- var fallbackLinkFn = $compile(tElement.contents());
16562
- tElement.empty();
16563
-
16564
- return function ngTranscludePostLink($scope, $element, $attrs, controller, $transclude) {
16565
-
16566
- if (!$transclude) {
16567
- throw ngTranscludeMinErr('orphan',
16568
- 'Illegal use of ngTransclude directive in the template! ' +
16569
- 'No parent directive that requires a transclusion found. ' +
16570
- 'Element: {0}',
16571
- startingTag($element));
16572
- }
16573
-
16574
-
16575
- if ($attrs.ngTransclude === $attrs.$attr.ngTransclude) {
16576
- $attrs.ngTransclude = '';
16577
- }
16578
- var slotName = $attrs.ngTransclude || $attrs.ngTranscludeSlot;
16579
-
16580
- $transclude(ngTranscludeCloneAttachFn, null, slotName);
16581
-
16582
- if (slotName && !$transclude.isSlotFilled(slotName)) {
16583
- useFallbackContent();
16584
- }
16585
-
16586
- function ngTranscludeCloneAttachFn(clone, transcludedScope) {
16587
- if (clone.length && notWhitespace(clone)) {
16588
- $element.append(clone);
16589
- } else {
16590
- useFallbackContent();
16591
- transcludedScope.$destroy();
16592
- }
16593
- }
16594
-
16595
- function useFallbackContent() {
16596
- fallbackLinkFn($scope, function(clone) {
16597
- $element.append(clone);
16598
- });
16599
- }
16600
-
16601
- function notWhitespace(nodes) {
16602
- for (var i = 0, ii = nodes.length; i < ii; i++) {
16603
- var node = nodes[i];
16604
- if (node.nodeType !== NODE_TYPE_TEXT || node.nodeValue.trim()) {
16605
- return true;
16606
- }
16607
- }
16608
- }
16609
- };
16610
- }
16611
- };
16612
- }];
16613
-
16614
- var scriptDirective = ['$templateCache', function($templateCache) {
16615
- return {
16616
- restrict: 'E',
16617
- terminal: true,
16618
- compile: function(element, attr) {
16619
- if (attr.type === 'text/ng-template') {
16620
- var templateUrl = attr.id,
16621
- text = element[0].text;
16622
-
16623
- $templateCache.put(templateUrl, text);
16624
- }
16625
- }
16626
- };
16627
- }];
16628
-
16629
-
16630
- var noopNgModelController = { $setViewValue: noop, $render: noop };
16631
-
16632
- var SelectController =
16633
- ['$element', '$scope', function($element, $scope) {
16634
-
16635
- var self = this,
16636
- optionsMap = new HashMap();
16637
-
16638
- self.selectValueMap = {};
16639
-
16640
- self.ngModelCtrl = noopNgModelController;
16641
- self.multiple = false;
16642
-
16643
- self.unknownOption = jqLite(window.document.createElement('option'));
16644
-
16645
- self.hasEmptyOption = false;
16646
- self.emptyOption = undefined;
16647
-
16648
- self.renderUnknownOption = function(val) {
16649
- var unknownVal = self.generateUnknownOptionValue(val);
16650
- self.unknownOption.val(unknownVal);
16651
- $element.prepend(self.unknownOption);
16652
- setOptionAsSelected(self.unknownOption);
16653
- $element.val(unknownVal);
16654
- };
16655
-
16656
- self.updateUnknownOption = function(val) {
16657
- var unknownVal = self.generateUnknownOptionValue(val);
16658
- self.unknownOption.val(unknownVal);
16659
- setOptionAsSelected(self.unknownOption);
16660
- $element.val(unknownVal);
16661
- };
16662
-
16663
- self.generateUnknownOptionValue = function(val) {
16664
- return '? ' + hashKey(val) + ' ?';
16665
- };
16666
-
16667
- self.removeUnknownOption = function() {
16668
- if (self.unknownOption.parent()) self.unknownOption.remove();
16669
- };
16670
-
16671
- self.selectEmptyOption = function() {
16672
- if (self.emptyOption) {
16673
- $element.val('');
16674
- setOptionAsSelected(self.emptyOption);
16675
- }
16676
- };
16677
-
16678
- self.unselectEmptyOption = function() {
16679
- if (self.hasEmptyOption) {
16680
- self.emptyOption.removeAttr('selected');
16681
- }
16682
- };
16683
-
16684
- $scope.$on('$destroy', function() {
16685
- self.renderUnknownOption = noop;
16686
- });
16687
-
16688
- self.readValue = function readSingleValue() {
16689
- var val = $element.val();
16690
- var realVal = val in self.selectValueMap ? self.selectValueMap[val] : val;
16691
-
16692
- if (self.hasOption(realVal)) {
16693
- return realVal;
16694
- }
16695
-
16696
- return null;
16697
- };
16698
-
16699
-
16700
- self.writeValue = function writeSingleValue(value) {
16701
- var currentlySelectedOption = $element[0].options[$element[0].selectedIndex];
16702
- if (currentlySelectedOption) currentlySelectedOption.removeAttribute('selected');
16703
-
16704
- if (self.hasOption(value)) {
16705
- self.removeUnknownOption();
16706
-
16707
- var hashedVal = hashKey(value);
16708
- $element.val(hashedVal in self.selectValueMap ? hashedVal : value);
16709
-
16710
- var selectedOption = $element[0].options[$element[0].selectedIndex];
16711
- setOptionAsSelected(jqLite(selectedOption));
16712
- } else {
16713
- if (value == null && self.emptyOption) {
16714
- self.removeUnknownOption();
16715
- self.selectEmptyOption();
16716
- } else if (self.unknownOption.parent().length) {
16717
- self.updateUnknownOption(value);
16718
- } else {
16719
- self.renderUnknownOption(value);
16720
- }
16721
- }
16722
- };
16723
-
16724
-
16725
- self.addOption = function(value, element) {
16726
- if (element[0].nodeType === NODE_TYPE_COMMENT) return;
16727
-
16728
- assertNotHasOwnProperty(value, '"option value"');
16729
- if (value === '') {
16730
- self.hasEmptyOption = true;
16731
- self.emptyOption = element;
16732
- }
16733
- var count = optionsMap.get(value) || 0;
16734
- optionsMap.put(value, count + 1);
16735
- scheduleRender();
16736
- };
16737
-
16738
- self.removeOption = function(value) {
16739
- var count = optionsMap.get(value);
16740
- if (count) {
16741
- if (count === 1) {
16742
- optionsMap.remove(value);
16743
- if (value === '') {
16744
- self.hasEmptyOption = false;
16745
- self.emptyOption = undefined;
16746
- }
16747
- } else {
16748
- optionsMap.put(value, count - 1);
16749
- }
16750
- }
16751
- };
16752
-
16753
- self.hasOption = function(value) {
16754
- return !!optionsMap.get(value);
16755
- };
16756
-
16757
-
16758
- var renderScheduled = false;
16759
- function scheduleRender() {
16760
- if (renderScheduled) return;
16761
- renderScheduled = true;
16762
- $scope.$$postDigest(function() {
16763
- renderScheduled = false;
16764
- self.ngModelCtrl.$render();
16765
- });
16766
- }
16767
-
16768
- var updateScheduled = false;
16769
- function scheduleViewValueUpdate(renderAfter) {
16770
- if (updateScheduled) return;
16771
-
16772
- updateScheduled = true;
16773
-
16774
- $scope.$$postDigest(function() {
16775
- if ($scope.$$destroyed) return;
16776
-
16777
- updateScheduled = false;
16778
- self.ngModelCtrl.$setViewValue(self.readValue());
16779
- if (renderAfter) self.ngModelCtrl.$render();
16780
- });
16781
- }
16782
-
16783
-
16784
- self.registerOption = function(optionScope, optionElement, optionAttrs, interpolateValueFn, interpolateTextFn) {
16785
-
16786
- if (optionAttrs.$attr.ngValue) {
16787
- var oldVal, hashedVal = NaN;
16788
- optionAttrs.$observe('value', function valueAttributeObserveAction(newVal) {
16789
-
16790
- var removal;
16791
- var previouslySelected = optionElement.prop('selected');
16792
-
16793
- if (isDefined(hashedVal)) {
16794
- self.removeOption(oldVal);
16795
- delete self.selectValueMap[hashedVal];
16796
- removal = true;
16797
- }
16798
-
16799
- hashedVal = hashKey(newVal);
16800
- oldVal = newVal;
16801
- self.selectValueMap[hashedVal] = newVal;
16802
- self.addOption(newVal, optionElement);
16803
- optionElement.attr('value', hashedVal);
16804
-
16805
- if (removal && previouslySelected) {
16806
- scheduleViewValueUpdate();
16807
- }
16808
-
16809
- });
16810
- } else if (interpolateValueFn) {
16811
- optionAttrs.$observe('value', function valueAttributeObserveAction(newVal) {
16812
- self.readValue();
16813
-
16814
- var removal;
16815
- var previouslySelected = optionElement.prop('selected');
16816
-
16817
- if (isDefined(oldVal)) {
16818
- self.removeOption(oldVal);
16819
- removal = true;
16820
- }
16821
- oldVal = newVal;
16822
- self.addOption(newVal, optionElement);
16823
-
16824
- if (removal && previouslySelected) {
16825
- scheduleViewValueUpdate();
16826
- }
16827
- });
16828
- } else if (interpolateTextFn) {
16829
- optionScope.$watch(interpolateTextFn, function interpolateWatchAction(newVal, oldVal) {
16830
- optionAttrs.$set('value', newVal);
16831
- var previouslySelected = optionElement.prop('selected');
16832
- if (oldVal !== newVal) {
16833
- self.removeOption(oldVal);
16834
- }
16835
- self.addOption(newVal, optionElement);
16836
-
16837
- if (oldVal && previouslySelected) {
16838
- scheduleViewValueUpdate();
16839
- }
16840
- });
16841
- } else {
16842
- self.addOption(optionAttrs.value, optionElement);
16843
- }
16844
-
16845
-
16846
- optionAttrs.$observe('disabled', function(newVal) {
16847
-
16848
-
16849
- if (newVal === 'true' || newVal && optionElement.prop('selected')) {
16850
- if (self.multiple) {
16851
- scheduleViewValueUpdate(true);
16852
- } else {
16853
- self.ngModelCtrl.$setViewValue(null);
16854
- self.ngModelCtrl.$render();
16855
- }
16856
- }
16857
- });
16858
-
16859
- optionElement.on('$destroy', function() {
16860
- var currentValue = self.readValue();
16861
- var removeValue = optionAttrs.value;
16862
-
16863
- self.removeOption(removeValue);
16864
- self.ngModelCtrl.$render();
16865
-
16866
- if (self.multiple && currentValue && currentValue.indexOf(removeValue) !== -1 ||
16867
- currentValue === removeValue
16868
- ) {
16869
- scheduleViewValueUpdate(true);
16870
- }
16871
- });
16872
- };
16873
-
16874
- function setOptionAsSelected(optionEl) {
16875
- optionEl.prop('selected', true);
16876
- optionEl.attr('selected', true);
16877
- }
16878
- }];
16879
-
16880
- var selectDirective = function() {
16881
-
16882
- return {
16883
- restrict: 'E',
16884
- require: ['select', '?ngModel'],
16885
- controller: SelectController,
16886
- priority: 1,
16887
- link: {
16888
- pre: selectPreLink,
16889
- post: selectPostLink
16890
- }
16891
- };
16892
-
16893
- function selectPreLink(scope, element, attr, ctrls) {
16894
-
16895
- var selectCtrl = ctrls[0];
16896
- var ngModelCtrl = ctrls[1];
16897
-
16898
- if (!ngModelCtrl) {
16899
- selectCtrl.registerOption = noop;
16900
- return;
16901
- }
16902
-
16903
-
16904
- selectCtrl.ngModelCtrl = ngModelCtrl;
16905
-
16906
- element.on('change', function() {
16907
- selectCtrl.removeUnknownOption();
16908
- scope.$apply(function() {
16909
- ngModelCtrl.$setViewValue(selectCtrl.readValue());
16910
- });
16911
- });
16912
-
16913
- if (attr.multiple) {
16914
- selectCtrl.multiple = true;
16915
-
16916
- selectCtrl.readValue = function readMultipleValue() {
16917
- var array = [];
16918
- forEach(element.find('option'), function(option) {
16919
- if (option.selected && !option.disabled) {
16920
- var val = option.value;
16921
- array.push(val in selectCtrl.selectValueMap ? selectCtrl.selectValueMap[val] : val);
16922
- }
16923
- });
16924
- return array;
16925
- };
16926
-
16927
- selectCtrl.writeValue = function writeMultipleValue(value) {
16928
- var items = new HashMap(value);
16929
- forEach(element.find('option'), function(option) {
16930
- option.selected = isDefined(items.get(option.value)) || isDefined(items.get(selectCtrl.selectValueMap[option.value]));
16931
- });
16932
- };
16933
-
16934
- var lastView, lastViewRef = NaN;
16935
- scope.$watch(function selectMultipleWatch() {
16936
- if (lastViewRef === ngModelCtrl.$viewValue && !equals(lastView, ngModelCtrl.$viewValue)) {
16937
- lastView = shallowCopy(ngModelCtrl.$viewValue);
16938
- ngModelCtrl.$render();
16939
- }
16940
- lastViewRef = ngModelCtrl.$viewValue;
16941
- });
16942
-
16943
- ngModelCtrl.$isEmpty = function(value) {
16944
- return !value || value.length === 0;
16945
- };
16946
-
16947
- }
16948
- }
16949
-
16950
- function selectPostLink(scope, element, attrs, ctrls) {
16951
- var ngModelCtrl = ctrls[1];
16952
- if (!ngModelCtrl) return;
16953
-
16954
- var selectCtrl = ctrls[0];
16955
-
16956
- ngModelCtrl.$render = function() {
16957
- selectCtrl.writeValue(ngModelCtrl.$viewValue);
16958
- };
16959
- }
16960
- };
16961
-
16962
-
16963
- var optionDirective = ['$interpolate', function($interpolate) {
16964
- return {
16965
- restrict: 'E',
16966
- priority: 100,
16967
- compile: function(element, attr) {
16968
- var interpolateValueFn, interpolateTextFn;
16969
-
16970
- if (isDefined(attr.ngValue)) {
16971
- } else if (isDefined(attr.value)) {
16972
- interpolateValueFn = $interpolate(attr.value, true);
16973
- } else {
16974
- interpolateTextFn = $interpolate(element.text(), true);
16975
- if (!interpolateTextFn) {
16976
- attr.$set('value', element.text());
16977
- }
16978
- }
16979
-
16980
- return function(scope, element, attr) {
16981
- var selectCtrlName = '$selectController',
16982
- parent = element.parent(),
16983
- selectCtrl = parent.data(selectCtrlName) ||
16984
- parent.parent().data(selectCtrlName);
16985
-
16986
- if (selectCtrl) {
16987
- selectCtrl.registerOption(scope, element, attr, interpolateValueFn, interpolateTextFn);
16988
- }
16989
- };
16990
- }
16991
- };
16992
- }];
16993
-
16994
- var requiredDirective = function() {
16995
- return {
16996
- restrict: 'A',
16997
- require: '?ngModel',
16998
- link: function(scope, elm, attr, ctrl) {
16999
- if (!ctrl) return;
17000
- attr.required = true;
17001
-
17002
- ctrl.$validators.required = function(modelValue, viewValue) {
17003
- return !attr.required || !ctrl.$isEmpty(viewValue);
17004
- };
17005
-
17006
- attr.$observe('required', function() {
17007
- ctrl.$validate();
17008
- });
17009
- }
17010
- };
17011
- };
17012
-
17013
- var patternDirective = function() {
17014
- return {
17015
- restrict: 'A',
17016
- require: '?ngModel',
17017
- link: function(scope, elm, attr, ctrl) {
17018
- if (!ctrl) return;
17019
-
17020
- var regexp, patternExp = attr.ngPattern || attr.pattern;
17021
- attr.$observe('pattern', function(regex) {
17022
- if (isString(regex) && regex.length > 0) {
17023
- regex = new RegExp('^' + regex + '$');
17024
- }
17025
-
17026
- if (regex && !regex.test) {
17027
- throw minErr('ngPattern')('noregexp',
17028
- 'Expected {0} to be a RegExp but was {1}. Element: {2}', patternExp,
17029
- regex, startingTag(elm));
17030
- }
17031
-
17032
- regexp = regex || undefined;
17033
- ctrl.$validate();
17034
- });
17035
-
17036
- ctrl.$validators.pattern = function(modelValue, viewValue) {
17037
- return ctrl.$isEmpty(viewValue) || isUndefined(regexp) || regexp.test(viewValue);
17038
- };
17039
- }
17040
- };
17041
- };
17042
-
17043
- var maxlengthDirective = function() {
17044
- return {
17045
- restrict: 'A',
17046
- require: '?ngModel',
17047
- link: function(scope, elm, attr, ctrl) {
17048
- if (!ctrl) return;
17049
-
17050
- var maxlength = -1;
17051
- attr.$observe('maxlength', function(value) {
17052
- var intVal = toInt(value);
17053
- maxlength = isNumberNaN(intVal) ? -1 : intVal;
17054
- ctrl.$validate();
17055
- });
17056
- ctrl.$validators.maxlength = function(modelValue, viewValue) {
17057
- return (maxlength < 0) || ctrl.$isEmpty(viewValue) || (viewValue.length <= maxlength);
17058
- };
17059
- }
17060
- };
17061
- };
17062
-
17063
- var minlengthDirective = function() {
17064
- return {
17065
- restrict: 'A',
17066
- require: '?ngModel',
17067
- link: function(scope, elm, attr, ctrl) {
17068
- if (!ctrl) return;
17069
-
17070
- var minlength = 0;
17071
- attr.$observe('minlength', function(value) {
17072
- minlength = toInt(value) || 0;
17073
- ctrl.$validate();
17074
- });
17075
- ctrl.$validators.minlength = function(modelValue, viewValue) {
17076
- return ctrl.$isEmpty(viewValue) || viewValue.length >= minlength;
17077
- };
17078
- }
17079
- };
17080
- };
17081
-
17082
- if (window.angular.bootstrap) {
17083
- if (window.console) {
17084
- console.log('WARNING: Tried to load angular more than once.');
17085
- }
17086
- return;
17087
- }
17088
-
17089
- bindJQuery();
17090
-
17091
- publishExternalAPI(angular);
17092
-
17093
- angular.module("ngLocale", [], ["$provide", function($provide) {
17094
- var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
17095
- function getDecimals(n) {
17096
- n = n + '';
17097
- var i = n.indexOf('.');
17098
- return (i == -1) ? 0 : n.length - i - 1;
17099
- }
17100
-
17101
- function getVF(n, opt_precision) {
17102
- var v = opt_precision;
17103
-
17104
- if (undefined === v) {
17105
- v = Math.min(getDecimals(n), 3);
17106
- }
17107
-
17108
- var base = Math.pow(10, v);
17109
- var f = ((n * base) | 0) % base;
17110
- return {v: v, f: f};
17111
- }
17112
-
17113
- $provide.value("$locale", {
17114
- "DATETIME_FORMATS": {
17115
- "AMPMS": [
17116
- "AM",
17117
- "PM"
17118
- ],
17119
- "DAY": [
17120
- "Sunday",
17121
- "Monday",
17122
- "Tuesday",
17123
- "Wednesday",
17124
- "Thursday",
17125
- "Friday",
17126
- "Saturday"
17127
- ],
17128
- "ERANAMES": [
17129
- "Before Christ",
17130
- "Anno Domini"
17131
- ],
17132
- "ERAS": [
17133
- "BC",
17134
- "AD"
17135
- ],
17136
- "FIRSTDAYOFWEEK": 6,
17137
- "MONTH": [
17138
- "January",
17139
- "February",
17140
- "March",
17141
- "April",
17142
- "May",
17143
- "June",
17144
- "July",
17145
- "August",
17146
- "September",
17147
- "October",
17148
- "November",
17149
- "December"
17150
- ],
17151
- "SHORTDAY": [
17152
- "Sun",
17153
- "Mon",
17154
- "Tue",
17155
- "Wed",
17156
- "Thu",
17157
- "Fri",
17158
- "Sat"
17159
- ],
17160
- "SHORTMONTH": [
17161
- "Jan",
17162
- "Feb",
17163
- "Mar",
17164
- "Apr",
17165
- "May",
17166
- "Jun",
17167
- "Jul",
17168
- "Aug",
17169
- "Sep",
17170
- "Oct",
17171
- "Nov",
17172
- "Dec"
17173
- ],
17174
- "STANDALONEMONTH": [
17175
- "January",
17176
- "February",
17177
- "March",
17178
- "April",
17179
- "May",
17180
- "June",
17181
- "July",
17182
- "August",
17183
- "September",
17184
- "October",
17185
- "November",
17186
- "December"
17187
- ],
17188
- "WEEKENDRANGE": [
17189
- 5,
17190
- 6
17191
- ],
17192
- "fullDate": "EEEE, MMMM d, y",
17193
- "longDate": "MMMM d, y",
17194
- "medium": "MMM d, y h:mm:ss a",
17195
- "mediumDate": "MMM d, y",
17196
- "mediumTime": "h:mm:ss a",
17197
- "short": "M/d/yy h:mm a",
17198
- "shortDate": "M/d/yy",
17199
- "shortTime": "h:mm a"
17200
- },
17201
- "NUMBER_FORMATS": {
17202
- "CURRENCY_SYM": "$",
17203
- "DECIMAL_SEP": ".",
17204
- "GROUP_SEP": ",",
17205
- "PATTERNS": [
17206
- {
17207
- "gSize": 3,
17208
- "lgSize": 3,
17209
- "maxFrac": 3,
17210
- "minFrac": 0,
17211
- "minInt": 1,
17212
- "negPre": "-",
17213
- "negSuf": "",
17214
- "posPre": "",
17215
- "posSuf": ""
17216
- },
17217
- {
17218
- "gSize": 3,
17219
- "lgSize": 3,
17220
- "maxFrac": 2,
17221
- "minFrac": 2,
17222
- "minInt": 1,
17223
- "negPre": "-\u00a4",
17224
- "negSuf": "",
17225
- "posPre": "\u00a4",
17226
- "posSuf": ""
17227
- }
17228
- ]
17229
- },
17230
- "id": "en-us",
17231
- "localeID": "en_US",
17232
- "pluralCat": function(n, opt_precision) { var i = n | 0; var vf = getVF(n, opt_precision); if (i == 1 && vf.v == 0) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
17233
- });
17234
- }]);
17235
-
17236
- jqLite(function() {
17237
- angularInit(window.document, bootstrap);
17238
- });
17239
-
17240
- })(window);
17241
-
17242
- !window.angular.$$csp().noInlineStyle && window.angular.element(document.head).prepend('<style type="text/css">@charset "UTF-8";[ng\\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak,.ng-hide:not(.ng-hide-animate){display:none !important;}ng\\:form{display:block;}.ng-animate-shim{visibility:hidden;}.ng-anchor{position:absolute;}</style>');
17243
- },{}],42:[function(require,module,exports){
17244
- require('./angular');
17245
- module.exports = angular;
17246
-
17247
- },{"./angular":41}],43:[function(require,module,exports){
17248
-
17249
- (function () {
17250
-
17251
- function patchXHR(fnName, newFn) {
17252
- window.XMLHttpRequest.prototype[fnName] = newFn(window.XMLHttpRequest.prototype[fnName]);
17253
- }
17254
-
17255
- function redefineProp(xhr, prop, fn) {
17256
- try {
17257
- Object.defineProperty(xhr, prop, {get: fn});
17258
- } catch (e) {
17259
- }
17260
- }
17261
-
17262
- if (!window.FileAPI) {
17263
- window.FileAPI = {};
17264
- }
17265
-
17266
- if (!window.XMLHttpRequest) {
17267
- throw 'AJAX is not supported. XMLHttpRequest is not defined.';
17268
- }
17269
-
17270
- FileAPI.shouldLoad = !window.FormData || FileAPI.forceLoad;
17271
- if (FileAPI.shouldLoad) {
17272
- var initializeUploadListener = function (xhr) {
17273
- if (!xhr.__listeners) {
17274
- if (!xhr.upload) xhr.upload = {};
17275
- xhr.__listeners = [];
17276
- var origAddEventListener = xhr.upload.addEventListener;
17277
- xhr.upload.addEventListener = function (t, fn) {
17278
- xhr.__listeners[t] = fn;
17279
- if (origAddEventListener) origAddEventListener.apply(this, arguments);
17280
- };
17281
- }
17282
- };
17283
-
17284
- patchXHR('open', function (orig) {
17285
- return function (m, url, b) {
17286
- initializeUploadListener(this);
17287
- this.__url = url;
17288
- try {
17289
- orig.apply(this, [m, url, b]);
17290
- } catch (e) {
17291
- if (e.message.indexOf('Access is denied') > -1) {
17292
- this.__origError = e;
17293
- orig.apply(this, [m, '_fix_for_ie_crossdomain__', b]);
17294
- }
17295
- }
17296
- };
17297
- });
17298
-
17299
- patchXHR('getResponseHeader', function (orig) {
17300
- return function (h) {
17301
- return this.__fileApiXHR && this.__fileApiXHR.getResponseHeader ? this.__fileApiXHR.getResponseHeader(h) : (orig == null ? null : orig.apply(this, [h]));
17302
- };
17303
- });
17304
-
17305
- patchXHR('getAllResponseHeaders', function (orig) {
17306
- return function () {
17307
- return this.__fileApiXHR && this.__fileApiXHR.getAllResponseHeaders ? this.__fileApiXHR.getAllResponseHeaders() : (orig == null ? null : orig.apply(this));
17308
- };
17309
- });
17310
-
17311
- patchXHR('abort', function (orig) {
17312
- return function () {
17313
- return this.__fileApiXHR && this.__fileApiXHR.abort ? this.__fileApiXHR.abort() : (orig == null ? null : orig.apply(this));
17314
- };
17315
- });
17316
-
17317
- patchXHR('setRequestHeader', function (orig) {
17318
- return function (header, value) {
17319
- if (header === '__setXHR_') {
17320
- initializeUploadListener(this);
17321
- var val = value(this);
17322
- if (val instanceof Function) {
17323
- val(this);
17324
- }
17325
- } else {
17326
- this.__requestHeaders = this.__requestHeaders || {};
17327
- this.__requestHeaders[header] = value;
17328
- orig.apply(this, arguments);
17329
- }
17330
- };
17331
- });
17332
-
17333
- patchXHR('send', function (orig) {
17334
- return function () {
17335
- var xhr = this;
17336
- if (arguments[0] && arguments[0].__isFileAPIShim) {
17337
- var formData = arguments[0];
17338
- var config = {
17339
- url: xhr.__url,
17340
- jsonp: false,
17341
- cache: true,
17342
- complete: function (err, fileApiXHR) {
17343
- if (err && angular.isString(err) && err.indexOf('#2174') !== -1) {
17344
- err = null;
17345
- }
17346
- xhr.__completed = true;
17347
- if (!err && xhr.__listeners.load)
17348
- xhr.__listeners.load({
17349
- type: 'load',
17350
- loaded: xhr.__loaded,
17351
- total: xhr.__total,
17352
- target: xhr,
17353
- lengthComputable: true
17354
- });
17355
- if (!err && xhr.__listeners.loadend)
17356
- xhr.__listeners.loadend({
17357
- type: 'loadend',
17358
- loaded: xhr.__loaded,
17359
- total: xhr.__total,
17360
- target: xhr,
17361
- lengthComputable: true
17362
- });
17363
- if (err === 'abort' && xhr.__listeners.abort)
17364
- xhr.__listeners.abort({
17365
- type: 'abort',
17366
- loaded: xhr.__loaded,
17367
- total: xhr.__total,
17368
- target: xhr,
17369
- lengthComputable: true
17370
- });
17371
- if (fileApiXHR.status !== undefined) redefineProp(xhr, 'status', function () {
17372
- return (fileApiXHR.status === 0 && err && err !== 'abort') ? 500 : fileApiXHR.status;
17373
- });
17374
- if (fileApiXHR.statusText !== undefined) redefineProp(xhr, 'statusText', function () {
17375
- return fileApiXHR.statusText;
17376
- });
17377
- redefineProp(xhr, 'readyState', function () {
17378
- return 4;
17379
- });
17380
- if (fileApiXHR.response !== undefined) redefineProp(xhr, 'response', function () {
17381
- return fileApiXHR.response;
17382
- });
17383
- var resp = fileApiXHR.responseText || (err && fileApiXHR.status === 0 && err !== 'abort' ? err : undefined);
17384
- redefineProp(xhr, 'responseText', function () {
17385
- return resp;
17386
- });
17387
- redefineProp(xhr, 'response', function () {
17388
- return resp;
17389
- });
17390
- if (err) redefineProp(xhr, 'err', function () {
17391
- return err;
17392
- });
17393
- xhr.__fileApiXHR = fileApiXHR;
17394
- if (xhr.onreadystatechange) xhr.onreadystatechange();
17395
- if (xhr.onload) xhr.onload();
17396
- },
17397
- progress: function (e) {
17398
- e.target = xhr;
17399
- if (xhr.__listeners.progress) xhr.__listeners.progress(e);
17400
- xhr.__total = e.total;
17401
- xhr.__loaded = e.loaded;
17402
- if (e.total === e.loaded) {
17403
- var _this = this;
17404
- setTimeout(function () {
17405
- if (!xhr.__completed) {
17406
- xhr.getAllResponseHeaders = function () {
17407
- };
17408
- _this.complete(null, {status: 204, statusText: 'No Content'});
17409
- }
17410
- }, FileAPI.noContentTimeout || 10000);
17411
- }
17412
- },
17413
- headers: xhr.__requestHeaders
17414
- };
17415
- config.data = {};
17416
- config.files = {};
17417
- for (var i = 0; i < formData.data.length; i++) {
17418
- var item = formData.data[i];
17419
- if (item.val != null && item.val.name != null && item.val.size != null && item.val.type != null) {
17420
- config.files[item.key] = item.val;
17421
- } else {
17422
- config.data[item.key] = item.val;
17423
- }
17424
- }
17425
-
17426
- setTimeout(function () {
17427
- if (!FileAPI.hasFlash) {
17428
- throw 'Adode Flash Player need to be installed. To check ahead use "FileAPI.hasFlash"';
17429
- }
17430
- xhr.__fileApiXHR = FileAPI.upload(config);
17431
- }, 1);
17432
- } else {
17433
- if (this.__origError) {
17434
- throw this.__origError;
17435
- }
17436
- orig.apply(xhr, arguments);
17437
- }
17438
- };
17439
- });
17440
- window.XMLHttpRequest.__isFileAPIShim = true;
17441
- window.FormData = FormData = function () {
17442
- return {
17443
- append: function (key, val, name) {
17444
- if (val.__isFileAPIBlobShim) {
17445
- val = val.data[0];
17446
- }
17447
- this.data.push({
17448
- key: key,
17449
- val: val,
17450
- name: name
17451
- });
17452
- },
17453
- data: [],
17454
- __isFileAPIShim: true
17455
- };
17456
- };
17457
-
17458
- window.Blob = Blob = function (b) {
17459
- return {
17460
- data: b,
17461
- __isFileAPIBlobShim: true
17462
- };
17463
- };
17464
- }
17465
-
17466
- })();
17467
-
17468
- (function () {
17469
-
17470
- function isInputTypeFile(elem) {
17471
- return elem[0].tagName.toLowerCase() === 'input' && elem.attr('type') && elem.attr('type').toLowerCase() === 'file';
17472
- }
17473
-
17474
- function hasFlash() {
17475
- try {
17476
- var fo = new ActiveXObject('ShockwaveFlash.ShockwaveFlash');
17477
- if (fo) return true;
17478
- } catch (e) {
17479
- if (navigator.mimeTypes['application/x-shockwave-flash'] !== undefined) return true;
17480
- }
17481
- return false;
17482
- }
17483
-
17484
- function getOffset(obj) {
17485
- var left = 0, top = 0;
17486
-
17487
- if (window.jQuery) {
17488
- return jQuery(obj).offset();
17489
- }
17490
-
17491
- if (obj.offsetParent) {
17492
- do {
17493
- left += (obj.offsetLeft - obj.scrollLeft);
17494
- top += (obj.offsetTop - obj.scrollTop);
17495
- obj = obj.offsetParent;
17496
- } while (obj);
17497
- }
17498
- return {
17499
- left: left,
17500
- top: top
17501
- };
17502
- }
17503
-
17504
- if (FileAPI.shouldLoad) {
17505
- FileAPI.hasFlash = hasFlash();
17506
-
17507
- if (FileAPI.forceLoad) {
17508
- FileAPI.html5 = false;
17509
- }
17510
-
17511
- if (!FileAPI.upload) {
17512
- var jsUrl, basePath, script = document.createElement('script'), allScripts = document.getElementsByTagName('script'), i, index, src;
17513
- if (window.FileAPI.jsUrl) {
17514
- jsUrl = window.FileAPI.jsUrl;
17515
- } else if (window.FileAPI.jsPath) {
17516
- basePath = window.FileAPI.jsPath;
17517
- } else {
17518
- for (i = 0; i < allScripts.length; i++) {
17519
- src = allScripts[i].src;
17520
- index = src.search(/\/ng\-file\-upload[\-a-zA-z0-9\.]*\.js/);
17521
- if (index > -1) {
17522
- basePath = src.substring(0, index + 1);
17523
- break;
17524
- }
17525
- }
17526
- }
17527
-
17528
- if (FileAPI.staticPath == null) FileAPI.staticPath = basePath;
17529
- script.setAttribute('src', jsUrl || basePath + 'FileAPI.min.js');
17530
- document.getElementsByTagName('head')[0].appendChild(script);
17531
- }
17532
-
17533
- FileAPI.ngfFixIE = function (elem, fileElem, changeFn) {
17534
- if (!hasFlash()) {
17535
- throw 'Adode Flash Player need to be installed. To check ahead use "FileAPI.hasFlash"';
17536
- }
17537
- var fixInputStyle = function () {
17538
- var label = fileElem.parent();
17539
- if (elem.attr('disabled')) {
17540
- if (label) label.removeClass('js-fileapi-wrapper');
17541
- } else {
17542
- if (!fileElem.attr('__ngf_flash_')) {
17543
- fileElem.unbind('change');
17544
- fileElem.unbind('click');
17545
- fileElem.bind('change', function (evt) {
17546
- fileApiChangeFn.apply(this, [evt]);
17547
- changeFn.apply(this, [evt]);
17548
- });
17549
- fileElem.attr('__ngf_flash_', 'true');
17550
- }
17551
- label.addClass('js-fileapi-wrapper');
17552
- if (!isInputTypeFile(elem)) {
17553
- label.css('position', 'absolute')
17554
- .css('top', getOffset(elem[0]).top + 'px').css('left', getOffset(elem[0]).left + 'px')
17555
- .css('width', elem[0].offsetWidth + 'px').css('height', elem[0].offsetHeight + 'px')
17556
- .css('filter', 'alpha(opacity=0)').css('display', elem.css('display'))
17557
- .css('overflow', 'hidden').css('z-index', '900000')
17558
- .css('visibility', 'visible');
17559
- fileElem.css('width', elem[0].offsetWidth + 'px').css('height', elem[0].offsetHeight + 'px')
17560
- .css('position', 'absolute').css('top', '0px').css('left', '0px');
17561
- }
17562
- }
17563
- };
17564
-
17565
- elem.bind('mouseenter', fixInputStyle);
17566
-
17567
- var fileApiChangeFn = function (evt) {
17568
- var files = FileAPI.getFiles(evt);
17569
- for (var i = 0; i < files.length; i++) {
17570
- if (files[i].size === undefined) files[i].size = 0;
17571
- if (files[i].name === undefined) files[i].name = 'file';
17572
- if (files[i].type === undefined) files[i].type = 'undefined';
17573
- }
17574
- if (!evt.target) {
17575
- evt.target = {};
17576
- }
17577
- evt.target.files = files;
17578
- if (evt.target.files !== files) {
17579
- evt.__files_ = files;
17580
- }
17581
- (evt.__files_ || evt.target.files).item = function (i) {
17582
- return (evt.__files_ || evt.target.files)[i] || null;
17583
- };
17584
- };
17585
- };
17586
-
17587
- FileAPI.disableFileInput = function (elem, disable) {
17588
- if (disable) {
17589
- elem.removeClass('js-fileapi-wrapper');
17590
- } else {
17591
- elem.addClass('js-fileapi-wrapper');
17592
- }
17593
- };
17594
- }
17595
- })();
17596
-
17597
- if (!window.FileReader) {
17598
- window.FileReader = function () {
17599
- var _this = this, loadStarted = false;
17600
- this.listeners = {};
17601
- this.addEventListener = function (type, fn) {
17602
- _this.listeners[type] = _this.listeners[type] || [];
17603
- _this.listeners[type].push(fn);
17604
- };
17605
- this.removeEventListener = function (type, fn) {
17606
- if (_this.listeners[type]) _this.listeners[type].splice(_this.listeners[type].indexOf(fn), 1);
17607
- };
17608
- this.dispatchEvent = function (evt) {
17609
- var list = _this.listeners[evt.type];
17610
- if (list) {
17611
- for (var i = 0; i < list.length; i++) {
17612
- list[i].call(_this, evt);
17613
- }
17614
- }
17615
- };
17616
- this.onabort = this.onerror = this.onload = this.onloadstart = this.onloadend = this.onprogress = null;
17617
-
17618
- var constructEvent = function (type, evt) {
17619
- var e = {type: type, target: _this, loaded: evt.loaded, total: evt.total, error: evt.error};
17620
- if (evt.result != null) e.target.result = evt.result;
17621
- return e;
17622
- };
17623
- var listener = function (evt) {
17624
- if (!loadStarted) {
17625
- loadStarted = true;
17626
- if (_this.onloadstart) _this.onloadstart(constructEvent('loadstart', evt));
17627
- }
17628
- var e;
17629
- if (evt.type === 'load') {
17630
- if (_this.onloadend) _this.onloadend(constructEvent('loadend', evt));
17631
- e = constructEvent('load', evt);
17632
- if (_this.onload) _this.onload(e);
17633
- _this.dispatchEvent(e);
17634
- } else if (evt.type === 'progress') {
17635
- e = constructEvent('progress', evt);
17636
- if (_this.onprogress) _this.onprogress(e);
17637
- _this.dispatchEvent(e);
17638
- } else {
17639
- e = constructEvent('error', evt);
17640
- if (_this.onerror) _this.onerror(e);
17641
- _this.dispatchEvent(e);
17642
- }
17643
- };
17644
- this.readAsDataURL = function (file) {
17645
- FileAPI.readAsDataURL(file, listener);
17646
- };
17647
- this.readAsText = function (file) {
17648
- FileAPI.readAsText(file, listener);
17649
- };
17650
- };
17651
- }
17652
-
17653
-
17654
- if (window.XMLHttpRequest && !(window.FileAPI && FileAPI.shouldLoad)) {
17655
- window.XMLHttpRequest.prototype.setRequestHeader = (function (orig) {
17656
- return function (header, value) {
17657
- if (header === '__setXHR_') {
17658
- var val = value(this);
17659
- if (val instanceof Function) {
17660
- val(this);
17661
- }
17662
- } else {
17663
- orig.apply(this, arguments);
17664
- }
17665
- };
17666
- })(window.XMLHttpRequest.prototype.setRequestHeader);
17667
- }
17668
-
17669
- var ngFileUpload = angular.module('ngFileUpload', []);
17670
-
17671
- ngFileUpload.version = '12.2.13';
17672
-
17673
- ngFileUpload.service('UploadBase', ['$http', '$q', '$timeout', function ($http, $q, $timeout) {
17674
- var upload = this;
17675
- upload.promisesCount = 0;
17676
-
17677
- this.isResumeSupported = function () {
17678
- return window.Blob && window.Blob.prototype.slice;
17679
- };
17680
-
17681
- var resumeSupported = this.isResumeSupported();
17682
-
17683
- function sendHttp(config) {
17684
- config.method = config.method || 'POST';
17685
- config.headers = config.headers || {};
17686
-
17687
- var deferred = config._deferred = config._deferred || $q.defer();
17688
- var promise = deferred.promise;
17689
-
17690
- function notifyProgress(e) {
17691
- if (deferred.notify) {
17692
- deferred.notify(e);
17693
- }
17694
- if (promise.progressFunc) {
17695
- $timeout(function () {
17696
- promise.progressFunc(e);
17697
- });
17698
- }
17699
- }
17700
-
17701
- function getNotifyEvent(n) {
17702
- if (config._start != null && resumeSupported) {
17703
- return {
17704
- loaded: n.loaded + config._start,
17705
- total: (config._file && config._file.size) || n.total,
17706
- type: n.type, config: config,
17707
- lengthComputable: true, target: n.target
17708
- };
17709
- } else {
17710
- return n;
17711
- }
17712
- }
17713
-
17714
- if (!config.disableProgress) {
17715
- config.headers.__setXHR_ = function () {
17716
- return function (xhr) {
17717
- if (!xhr || !xhr.upload || !xhr.upload.addEventListener) return;
17718
- config.__XHR = xhr;
17719
- if (config.xhrFn) config.xhrFn(xhr);
17720
- xhr.upload.addEventListener('progress', function (e) {
17721
- e.config = config;
17722
- notifyProgress(getNotifyEvent(e));
17723
- }, false);
17724
- xhr.upload.addEventListener('load', function (e) {
17725
- if (e.lengthComputable) {
17726
- e.config = config;
17727
- notifyProgress(getNotifyEvent(e));
17728
- }
17729
- }, false);
17730
- };
17731
- };
17732
- }
17733
-
17734
- function uploadWithAngular() {
17735
- $http(config).then(function (r) {
17736
- if (resumeSupported && config._chunkSize && !config._finished && config._file) {
17737
- var fileSize = config._file && config._file.size || 0;
17738
- notifyProgress({
17739
- loaded: Math.min(config._end, fileSize),
17740
- total: fileSize,
17741
- config: config,
17742
- type: 'progress'
17743
- }
17744
- );
17745
- upload.upload(config, true);
17746
- } else {
17747
- if (config._finished) delete config._finished;
17748
- deferred.resolve(r);
17749
- }
17750
- }, function (e) {
17751
- deferred.reject(e);
17752
- }, function (n) {
17753
- deferred.notify(n);
17754
- }
17755
- );
17756
- }
17757
-
17758
- if (!resumeSupported) {
17759
- uploadWithAngular();
17760
- } else if (config._chunkSize && config._end && !config._finished) {
17761
- config._start = config._end;
17762
- config._end += config._chunkSize;
17763
- uploadWithAngular();
17764
- } else if (config.resumeSizeUrl) {
17765
- $http.get(config.resumeSizeUrl).then(function (resp) {
17766
- if (config.resumeSizeResponseReader) {
17767
- config._start = config.resumeSizeResponseReader(resp.data);
17768
- } else {
17769
- config._start = parseInt((resp.data.size == null ? resp.data : resp.data.size).toString());
17770
- }
17771
- if (config._chunkSize) {
17772
- config._end = config._start + config._chunkSize;
17773
- }
17774
- uploadWithAngular();
17775
- }, function (e) {
17776
- throw e;
17777
- });
17778
- } else if (config.resumeSize) {
17779
- config.resumeSize().then(function (size) {
17780
- config._start = size;
17781
- if (config._chunkSize) {
17782
- config._end = config._start + config._chunkSize;
17783
- }
17784
- uploadWithAngular();
17785
- }, function (e) {
17786
- throw e;
17787
- });
17788
- } else {
17789
- if (config._chunkSize) {
17790
- config._start = 0;
17791
- config._end = config._start + config._chunkSize;
17792
- }
17793
- uploadWithAngular();
17794
- }
17795
-
17796
-
17797
- promise.success = function (fn) {
17798
- promise.then(function (response) {
17799
- fn(response.data, response.status, response.headers, config);
17800
- });
17801
- return promise;
17802
- };
17803
-
17804
- promise.error = function (fn) {
17805
- promise.then(null, function (response) {
17806
- fn(response.data, response.status, response.headers, config);
17807
- });
17808
- return promise;
17809
- };
17810
-
17811
- promise.progress = function (fn) {
17812
- promise.progressFunc = fn;
17813
- promise.then(null, null, function (n) {
17814
- fn(n);
17815
- });
17816
- return promise;
17817
- };
17818
- promise.abort = promise.pause = function () {
17819
- if (config.__XHR) {
17820
- $timeout(function () {
17821
- config.__XHR.abort();
17822
- });
17823
- }
17824
- return promise;
17825
- };
17826
- promise.xhr = function (fn) {
17827
- config.xhrFn = (function (origXhrFn) {
17828
- return function () {
17829
- if (origXhrFn) origXhrFn.apply(promise, arguments);
17830
- fn.apply(promise, arguments);
17831
- };
17832
- })(config.xhrFn);
17833
- return promise;
17834
- };
17835
-
17836
- upload.promisesCount++;
17837
- if (promise['finally'] && promise['finally'] instanceof Function) {
17838
- promise['finally'](function () {
17839
- upload.promisesCount--;
17840
- });
17841
- }
17842
- return promise;
17843
- }
17844
-
17845
- this.isUploadInProgress = function () {
17846
- return upload.promisesCount > 0;
17847
- };
17848
-
17849
- this.rename = function (file, name) {
17850
- file.ngfName = name;
17851
- return file;
17852
- };
17853
-
17854
- this.jsonBlob = function (val) {
17855
- if (val != null && !angular.isString(val)) {
17856
- val = JSON.stringify(val);
17857
- }
17858
- var blob = new window.Blob([val], {type: 'application/json'});
17859
- blob._ngfBlob = true;
17860
- return blob;
17861
- };
17862
-
17863
- this.json = function (val) {
17864
- return angular.toJson(val);
17865
- };
17866
-
17867
- function copy(obj) {
17868
- var clone = {};
17869
- for (var key in obj) {
17870
- if (obj.hasOwnProperty(key)) {
17871
- clone[key] = obj[key];
17872
- }
17873
- }
17874
- return clone;
17875
- }
17876
-
17877
- this.isFile = function (file) {
17878
- return file != null && (file instanceof window.Blob || (file.flashId && file.name && file.size));
17879
- };
17880
-
17881
- this.upload = function (config, internal) {
17882
- function toResumeFile(file, formData) {
17883
- if (file._ngfBlob) return file;
17884
- config._file = config._file || file;
17885
- if (config._start != null && resumeSupported) {
17886
- if (config._end && config._end >= file.size) {
17887
- config._finished = true;
17888
- config._end = file.size;
17889
- }
17890
- var slice = file.slice(config._start, config._end || file.size);
17891
- slice.name = file.name;
17892
- slice.ngfName = file.ngfName;
17893
- if (config._chunkSize) {
17894
- formData.append('_chunkSize', config._chunkSize);
17895
- formData.append('_currentChunkSize', config._end - config._start);
17896
- formData.append('_chunkNumber', Math.floor(config._start / config._chunkSize));
17897
- formData.append('_totalSize', config._file.size);
17898
- }
17899
- return slice;
17900
- }
17901
- return file;
17902
- }
17903
-
17904
- function addFieldToFormData(formData, val, key) {
17905
- if (val !== undefined) {
17906
- if (angular.isDate(val)) {
17907
- val = val.toISOString();
17908
- }
17909
- if (angular.isString(val)) {
17910
- formData.append(key, val);
17911
- } else if (upload.isFile(val)) {
17912
- var file = toResumeFile(val, formData);
17913
- var split = key.split(',');
17914
- if (split[1]) {
17915
- file.ngfName = split[1].replace(/^\s+|\s+$/g, '');
17916
- key = split[0];
17917
- }
17918
- config._fileKey = config._fileKey || key;
17919
- formData.append(key, file, file.ngfName || file.name);
17920
- } else {
17921
- if (angular.isObject(val)) {
17922
- if (val.$$ngfCircularDetection) throw 'ngFileUpload: Circular reference in config.data. Make sure specified data for Upload.upload() has no circular reference: ' + key;
17923
-
17924
- val.$$ngfCircularDetection = true;
17925
- try {
17926
- for (var k in val) {
17927
- if (val.hasOwnProperty(k) && k !== '$$ngfCircularDetection') {
17928
- var objectKey = config.objectKey == null ? '[i]' : config.objectKey;
17929
- if (val.length && parseInt(k) > -1) {
17930
- objectKey = config.arrayKey == null ? objectKey : config.arrayKey;
17931
- }
17932
- addFieldToFormData(formData, val[k], key + objectKey.replace(/[ik]/g, k));
17933
- }
17934
- }
17935
- } finally {
17936
- delete val.$$ngfCircularDetection;
17937
- }
17938
- } else {
17939
- formData.append(key, val);
17940
- }
17941
- }
17942
- }
17943
- }
17944
-
17945
- function digestConfig() {
17946
- config._chunkSize = upload.translateScalars(config.resumeChunkSize);
17947
- config._chunkSize = config._chunkSize ? parseInt(config._chunkSize.toString()) : null;
17948
-
17949
- config.headers = config.headers || {};
17950
- config.headers['Content-Type'] = undefined;
17951
- config.transformRequest = config.transformRequest ?
17952
- (angular.isArray(config.transformRequest) ?
17953
- config.transformRequest : [config.transformRequest]) : [];
17954
- config.transformRequest.push(function (data) {
17955
- var formData = new window.FormData(), key;
17956
- data = data || config.fields || {};
17957
- if (config.file) {
17958
- data.file = config.file;
17959
- }
17960
- for (key in data) {
17961
- if (data.hasOwnProperty(key)) {
17962
- var val = data[key];
17963
- if (config.formDataAppender) {
17964
- config.formDataAppender(formData, key, val);
17965
- } else {
17966
- addFieldToFormData(formData, val, key);
17967
- }
17968
- }
17969
- }
17970
-
17971
- return formData;
17972
- });
17973
- }
17974
-
17975
- if (!internal) config = copy(config);
17976
- if (!config._isDigested) {
17977
- config._isDigested = true;
17978
- digestConfig();
17979
- }
17980
-
17981
- return sendHttp(config);
17982
- };
17983
-
17984
- this.http = function (config) {
17985
- config = copy(config);
17986
- config.transformRequest = config.transformRequest || function (data) {
17987
- if ((window.ArrayBuffer && data instanceof window.ArrayBuffer) || data instanceof window.Blob) {
17988
- return data;
17989
- }
17990
- return $http.defaults.transformRequest[0].apply(this, arguments);
17991
- };
17992
- config._chunkSize = upload.translateScalars(config.resumeChunkSize);
17993
- config._chunkSize = config._chunkSize ? parseInt(config._chunkSize.toString()) : null;
17994
-
17995
- return sendHttp(config);
17996
- };
17997
-
17998
- this.translateScalars = function (str) {
17999
- if (angular.isString(str)) {
18000
- if (str.search(/kb/i) === str.length - 2) {
18001
- return parseFloat(str.substring(0, str.length - 2) * 1024);
18002
- } else if (str.search(/mb/i) === str.length - 2) {
18003
- return parseFloat(str.substring(0, str.length - 2) * 1048576);
18004
- } else if (str.search(/gb/i) === str.length - 2) {
18005
- return parseFloat(str.substring(0, str.length - 2) * 1073741824);
18006
- } else if (str.search(/b/i) === str.length - 1) {
18007
- return parseFloat(str.substring(0, str.length - 1));
18008
- } else if (str.search(/s/i) === str.length - 1) {
18009
- return parseFloat(str.substring(0, str.length - 1));
18010
- } else if (str.search(/m/i) === str.length - 1) {
18011
- return parseFloat(str.substring(0, str.length - 1) * 60);
18012
- } else if (str.search(/h/i) === str.length - 1) {
18013
- return parseFloat(str.substring(0, str.length - 1) * 3600);
18014
- }
18015
- }
18016
- return str;
18017
- };
18018
-
18019
- this.urlToBlob = function(url) {
18020
- var defer = $q.defer();
18021
- $http({url: url, method: 'get', responseType: 'arraybuffer'}).then(function (resp) {
18022
- var arrayBufferView = new Uint8Array(resp.data);
18023
- var type = resp.headers('content-type') || 'image/WebP';
18024
- var blob = new window.Blob([arrayBufferView], {type: type});
18025
- var matches = url.match(/.*\/(.+?)(\?.*)?$/);
18026
- if (matches.length > 1) {
18027
- blob.name = matches[1];
18028
- }
18029
- defer.resolve(blob);
18030
- }, function (e) {
18031
- defer.reject(e);
18032
- });
18033
- return defer.promise;
18034
- };
18035
-
18036
- this.setDefaults = function (defaults) {
18037
- this.defaults = defaults || {};
18038
- };
18039
-
18040
- this.defaults = {};
18041
- this.version = ngFileUpload.version;
18042
- }
18043
-
18044
- ]);
18045
-
18046
- ngFileUpload.service('Upload', ['$parse', '$timeout', '$compile', '$q', 'UploadExif', function ($parse, $timeout, $compile, $q, UploadExif) {
18047
- var upload = UploadExif;
18048
- upload.getAttrWithDefaults = function (attr, name) {
18049
- if (attr[name] != null) return attr[name];
18050
- var def = upload.defaults[name];
18051
- return (def == null ? def : (angular.isString(def) ? def : JSON.stringify(def)));
18052
- };
18053
-
18054
- upload.attrGetter = function (name, attr, scope, params) {
18055
- var attrVal = this.getAttrWithDefaults(attr, name);
18056
- if (scope) {
18057
- try {
18058
- if (params) {
18059
- return $parse(attrVal)(scope, params);
18060
- } else {
18061
- return $parse(attrVal)(scope);
18062
- }
18063
- } catch (e) {
18064
- if (name.search(/min|max|pattern/i)) {
18065
- return attrVal;
18066
- } else {
18067
- throw e;
18068
- }
18069
- }
18070
- } else {
18071
- return attrVal;
18072
- }
18073
- };
18074
-
18075
- upload.shouldUpdateOn = function (type, attr, scope) {
18076
- var modelOptions = upload.attrGetter('ngfModelOptions', attr, scope);
18077
- if (modelOptions && modelOptions.updateOn) {
18078
- return modelOptions.updateOn.split(' ').indexOf(type) > -1;
18079
- }
18080
- return true;
18081
- };
18082
-
18083
- upload.emptyPromise = function () {
18084
- var d = $q.defer();
18085
- var args = arguments;
18086
- $timeout(function () {
18087
- d.resolve.apply(d, args);
18088
- });
18089
- return d.promise;
18090
- };
18091
-
18092
- upload.rejectPromise = function () {
18093
- var d = $q.defer();
18094
- var args = arguments;
18095
- $timeout(function () {
18096
- d.reject.apply(d, args);
18097
- });
18098
- return d.promise;
18099
- };
18100
-
18101
- upload.happyPromise = function (promise, data) {
18102
- var d = $q.defer();
18103
- promise.then(function (result) {
18104
- d.resolve(result);
18105
- }, function (error) {
18106
- $timeout(function () {
18107
- throw error;
18108
- });
18109
- d.resolve(data);
18110
- });
18111
- return d.promise;
18112
- };
18113
-
18114
- function applyExifRotations(files, attr, scope) {
18115
- var promises = [upload.emptyPromise()];
18116
- angular.forEach(files, function (f, i) {
18117
- if (f.type.indexOf('image/jpeg') === 0 && upload.attrGetter('ngfFixOrientation', attr, scope, {$file: f})) {
18118
- promises.push(upload.happyPromise(upload.applyExifRotation(f), f).then(function (fixedFile) {
18119
- files.splice(i, 1, fixedFile);
18120
- }));
18121
- }
18122
- });
18123
- return $q.all(promises);
18124
- }
18125
-
18126
- function resizeFile(files, attr, scope, ngModel) {
18127
- var resizeVal = upload.attrGetter('ngfResize', attr, scope);
18128
- if (!resizeVal || !upload.isResizeSupported() || !files.length) return upload.emptyPromise();
18129
- if (resizeVal instanceof Function) {
18130
- var defer = $q.defer();
18131
- return resizeVal(files).then(function (p) {
18132
- resizeWithParams(p, files, attr, scope, ngModel).then(function (r) {
18133
- defer.resolve(r);
18134
- }, function (e) {
18135
- defer.reject(e);
18136
- });
18137
- }, function (e) {
18138
- defer.reject(e);
18139
- });
18140
- } else {
18141
- return resizeWithParams(resizeVal, files, attr, scope, ngModel);
18142
- }
18143
- }
18144
-
18145
- function resizeWithParams(params, files, attr, scope, ngModel) {
18146
- var promises = [upload.emptyPromise()];
18147
-
18148
- function handleFile(f, i) {
18149
- if (f.type.indexOf('image') === 0) {
18150
- if (params.pattern && !upload.validatePattern(f, params.pattern)) return;
18151
- params.resizeIf = function (width, height) {
18152
- return upload.attrGetter('ngfResizeIf', attr, scope,
18153
- {$width: width, $height: height, $file: f});
18154
- };
18155
- var promise = upload.resize(f, params);
18156
- promises.push(promise);
18157
- promise.then(function (resizedFile) {
18158
- files.splice(i, 1, resizedFile);
18159
- }, function (e) {
18160
- f.$error = 'resize';
18161
- (f.$errorMessages = (f.$errorMessages || {})).resize = true;
18162
- f.$errorParam = (e ? (e.message ? e.message : e) + ': ' : '') + (f && f.name);
18163
- ngModel.$ngfValidations.push({name: 'resize', valid: false});
18164
- upload.applyModelValidation(ngModel, files);
18165
- });
18166
- }
18167
- }
18168
-
18169
- for (var i = 0; i < files.length; i++) {
18170
- handleFile(files[i], i);
18171
- }
18172
- return $q.all(promises);
18173
- }
18174
-
18175
- upload.updateModel = function (ngModel, attr, scope, fileChange, files, evt, noDelay) {
18176
- function update(files, invalidFiles, newFiles, dupFiles, isSingleModel) {
18177
- attr.$$ngfPrevValidFiles = files;
18178
- attr.$$ngfPrevInvalidFiles = invalidFiles;
18179
- var file = files && files.length ? files[0] : null;
18180
- var invalidFile = invalidFiles && invalidFiles.length ? invalidFiles[0] : null;
18181
-
18182
- if (ngModel) {
18183
- upload.applyModelValidation(ngModel, files);
18184
- ngModel.$setViewValue(isSingleModel ? file : files);
18185
- }
18186
-
18187
- if (fileChange) {
18188
- $parse(fileChange)(scope, {
18189
- $files: files,
18190
- $file: file,
18191
- $newFiles: newFiles,
18192
- $duplicateFiles: dupFiles,
18193
- $invalidFiles: invalidFiles,
18194
- $invalidFile: invalidFile,
18195
- $event: evt
18196
- });
18197
- }
18198
-
18199
- var invalidModel = upload.attrGetter('ngfModelInvalid', attr);
18200
- if (invalidModel) {
18201
- $timeout(function () {
18202
- $parse(invalidModel).assign(scope, isSingleModel ? invalidFile : invalidFiles);
18203
- });
18204
- }
18205
- $timeout(function () {
18206
- });
18207
- }
18208
-
18209
- var allNewFiles, dupFiles = [], prevValidFiles, prevInvalidFiles,
18210
- invalids = [], valids = [];
18211
-
18212
- function removeDuplicates() {
18213
- function equals(f1, f2) {
18214
- return f1.name === f2.name && (f1.$ngfOrigSize || f1.size) === (f2.$ngfOrigSize || f2.size) &&
18215
- f1.type === f2.type;
18216
- }
18217
-
18218
- function isInPrevFiles(f) {
18219
- var j;
18220
- for (j = 0; j < prevValidFiles.length; j++) {
18221
- if (equals(f, prevValidFiles[j])) {
18222
- return true;
18223
- }
18224
- }
18225
- for (j = 0; j < prevInvalidFiles.length; j++) {
18226
- if (equals(f, prevInvalidFiles[j])) {
18227
- return true;
18228
- }
18229
- }
18230
- return false;
18231
- }
18232
-
18233
- if (files) {
18234
- allNewFiles = [];
18235
- dupFiles = [];
18236
- for (var i = 0; i < files.length; i++) {
18237
- if (isInPrevFiles(files[i])) {
18238
- dupFiles.push(files[i]);
18239
- } else {
18240
- allNewFiles.push(files[i]);
18241
- }
18242
- }
18243
- }
18244
- }
18245
-
18246
- function toArray(v) {
18247
- return angular.isArray(v) ? v : [v];
18248
- }
18249
-
18250
- function resizeAndUpdate() {
18251
- function updateModel() {
18252
- $timeout(function () {
18253
- update(keep ? prevValidFiles.concat(valids) : valids,
18254
- keep ? prevInvalidFiles.concat(invalids) : invalids,
18255
- files, dupFiles, isSingleModel);
18256
- }, options && options.debounce ? options.debounce.change || options.debounce : 0);
18257
- }
18258
-
18259
- var resizingFiles = validateAfterResize ? allNewFiles : valids;
18260
- resizeFile(resizingFiles, attr, scope, ngModel).then(function () {
18261
- if (validateAfterResize) {
18262
- upload.validate(allNewFiles, keep ? prevValidFiles.length : 0, ngModel, attr, scope)
18263
- .then(function (validationResult) {
18264
- valids = validationResult.validsFiles;
18265
- invalids = validationResult.invalidsFiles;
18266
- updateModel();
18267
- });
18268
- } else {
18269
- updateModel();
18270
- }
18271
- }, function () {
18272
- for (var i = 0; i < resizingFiles.length; i++) {
18273
- var f = resizingFiles[i];
18274
- if (f.$error === 'resize') {
18275
- var index = valids.indexOf(f);
18276
- if (index > -1) {
18277
- valids.splice(index, 1);
18278
- invalids.push(f);
18279
- }
18280
- updateModel();
18281
- }
18282
- }
18283
- });
18284
- }
18285
-
18286
- prevValidFiles = attr.$$ngfPrevValidFiles || [];
18287
- prevInvalidFiles = attr.$$ngfPrevInvalidFiles || [];
18288
- if (ngModel && ngModel.$modelValue) {
18289
- prevValidFiles = toArray(ngModel.$modelValue);
18290
- }
18291
-
18292
- var keep = upload.attrGetter('ngfKeep', attr, scope);
18293
- allNewFiles = (files || []).slice(0);
18294
- if (keep === 'distinct' || upload.attrGetter('ngfKeepDistinct', attr, scope) === true) {
18295
- removeDuplicates(attr, scope);
18296
- }
18297
-
18298
- var isSingleModel = !keep && !upload.attrGetter('ngfMultiple', attr, scope) && !upload.attrGetter('multiple', attr);
18299
-
18300
- if (keep && !allNewFiles.length) return;
18301
-
18302
- upload.attrGetter('ngfBeforeModelChange', attr, scope, {
18303
- $files: files,
18304
- $file: files && files.length ? files[0] : null,
18305
- $newFiles: allNewFiles,
18306
- $duplicateFiles: dupFiles,
18307
- $event: evt
18308
- });
18309
-
18310
- var validateAfterResize = upload.attrGetter('ngfValidateAfterResize', attr, scope);
18311
-
18312
- var options = upload.attrGetter('ngfModelOptions', attr, scope);
18313
- upload.validate(allNewFiles, keep ? prevValidFiles.length : 0, ngModel, attr, scope)
18314
- .then(function (validationResult) {
18315
- if (noDelay) {
18316
- update(allNewFiles, [], files, dupFiles, isSingleModel);
18317
- } else {
18318
- if ((!options || !options.allowInvalid) && !validateAfterResize) {
18319
- valids = validationResult.validFiles;
18320
- invalids = validationResult.invalidFiles;
18321
- } else {
18322
- valids = allNewFiles;
18323
- }
18324
- if (upload.attrGetter('ngfFixOrientation', attr, scope) && upload.isExifSupported()) {
18325
- applyExifRotations(valids, attr, scope).then(function () {
18326
- resizeAndUpdate();
18327
- });
18328
- } else {
18329
- resizeAndUpdate();
18330
- }
18331
- }
18332
- });
18333
- };
18334
-
18335
- return upload;
18336
- }]);
18337
-
18338
- ngFileUpload.directive('ngfSelect', ['$parse', '$timeout', '$compile', 'Upload', function ($parse, $timeout, $compile, Upload) {
18339
- var generatedElems = [];
18340
-
18341
- function isDelayedClickSupported(ua) {
18342
- var m = ua.match(/Android[^\d]*(\d+)\.(\d+)/);
18343
- if (m && m.length > 2) {
18344
- var v = Upload.defaults.androidFixMinorVersion || 4;
18345
- return parseInt(m[1]) < 4 || (parseInt(m[1]) === v && parseInt(m[2]) < v);
18346
- }
18347
-
18348
- return ua.indexOf('Chrome') === -1 && /.*Windows.*Safari.*/.test(ua);
18349
- }
18350
-
18351
- function linkFileSelect(scope, elem, attr, ngModel, $parse, $timeout, $compile, upload) {
18352
- var attrGetter = function (name, scope) {
18353
- return upload.attrGetter(name, attr, scope);
18354
- };
18355
-
18356
- function isInputTypeFile() {
18357
- return elem[0].tagName.toLowerCase() === 'input' && attr.type && attr.type.toLowerCase() === 'file';
18358
- }
18359
-
18360
- function fileChangeAttr() {
18361
- return attrGetter('ngfChange') || attrGetter('ngfSelect');
18362
- }
18363
-
18364
- function changeFn(evt) {
18365
- if (upload.shouldUpdateOn('change', attr, scope)) {
18366
- var fileList = evt.__files_ || (evt.target && evt.target.files), files = [];
18367
- if (!fileList) return;
18368
- for (var i = 0; i < fileList.length; i++) {
18369
- files.push(fileList[i]);
18370
- }
18371
- upload.updateModel(ngModel, attr, scope, fileChangeAttr(),
18372
- files.length ? files : null, evt);
18373
- }
18374
- }
18375
-
18376
- upload.registerModelChangeValidator(ngModel, attr, scope);
18377
-
18378
- var unwatches = [];
18379
- if (attrGetter('ngfMultiple')) {
18380
- unwatches.push(scope.$watch(attrGetter('ngfMultiple'), function () {
18381
- fileElem.attr('multiple', attrGetter('ngfMultiple', scope));
18382
- }));
18383
- }
18384
- if (attrGetter('ngfCapture')) {
18385
- unwatches.push(scope.$watch(attrGetter('ngfCapture'), function () {
18386
- fileElem.attr('capture', attrGetter('ngfCapture', scope));
18387
- }));
18388
- }
18389
- if (attrGetter('ngfAccept')) {
18390
- unwatches.push(scope.$watch(attrGetter('ngfAccept'), function () {
18391
- fileElem.attr('accept', attrGetter('ngfAccept', scope));
18392
- }));
18393
- }
18394
- unwatches.push(attr.$observe('accept', function () {
18395
- fileElem.attr('accept', attrGetter('accept'));
18396
- }));
18397
- function bindAttrToFileInput(fileElem, label) {
18398
- function updateId(val) {
18399
- fileElem.attr('id', 'ngf-' + val);
18400
- label.attr('id', 'ngf-label-' + val);
18401
- }
18402
-
18403
- for (var i = 0; i < elem[0].attributes.length; i++) {
18404
- var attribute = elem[0].attributes[i];
18405
- if (attribute.name !== 'type' && attribute.name !== 'class' && attribute.name !== 'style') {
18406
- if (attribute.name === 'id') {
18407
- updateId(attribute.value);
18408
- unwatches.push(attr.$observe('id', updateId));
18409
- } else {
18410
- fileElem.attr(attribute.name, (!attribute.value && (attribute.name === 'required' ||
18411
- attribute.name === 'multiple')) ? attribute.name : attribute.value);
18412
- }
18413
- }
18414
- }
18415
- }
18416
-
18417
- function createFileInput() {
18418
- if (isInputTypeFile()) {
18419
- return elem;
18420
- }
18421
-
18422
- var fileElem = angular.element('<input type="file">');
18423
-
18424
- var label = angular.element('<label>upload</label>');
18425
- label.css('visibility', 'hidden').css('position', 'absolute').css('overflow', 'hidden')
18426
- .css('width', '0px').css('height', '0px').css('border', 'none')
18427
- .css('margin', '0px').css('padding', '0px').attr('tabindex', '-1');
18428
- bindAttrToFileInput(fileElem, label);
18429
-
18430
- generatedElems.push({el: elem, ref: label});
18431
-
18432
- document.body.appendChild(label.append(fileElem)[0]);
18433
-
18434
- return fileElem;
18435
- }
18436
-
18437
- function clickHandler(evt) {
18438
- if (elem.attr('disabled')) return false;
18439
- if (attrGetter('ngfSelectDisabled', scope)) return;
18440
-
18441
- var r = detectSwipe(evt);
18442
- if (r != null) return r;
18443
-
18444
- resetModel(evt);
18445
-
18446
- try {
18447
- if (!isInputTypeFile() && !document.body.contains(fileElem[0])) {
18448
- generatedElems.push({el: elem, ref: fileElem.parent()});
18449
- document.body.appendChild(fileElem.parent()[0]);
18450
- fileElem.bind('change', changeFn);
18451
- }
18452
- } catch (e) {
18453
- }
18454
-
18455
- if (isDelayedClickSupported(navigator.userAgent)) {
18456
- setTimeout(function () {
18457
- fileElem[0].click();
18458
- }, 0);
18459
- } else {
18460
- fileElem[0].click();
18461
- }
18462
-
18463
- return false;
18464
- }
18465
-
18466
-
18467
- var initialTouchStartY = 0;
18468
- var initialTouchStartX = 0;
18469
-
18470
- function detectSwipe(evt) {
18471
- var touches = evt.changedTouches || (evt.originalEvent && evt.originalEvent.changedTouches);
18472
- if (touches) {
18473
- if (evt.type === 'touchstart') {
18474
- initialTouchStartX = touches[0].clientX;
18475
- initialTouchStartY = touches[0].clientY;
18476
- return true;
18477
- } else {
18478
- if (evt.type === 'touchend') {
18479
- var currentX = touches[0].clientX;
18480
- var currentY = touches[0].clientY;
18481
- if ((Math.abs(currentX - initialTouchStartX) > 20) ||
18482
- (Math.abs(currentY - initialTouchStartY) > 20)) {
18483
- evt.stopPropagation();
18484
- evt.preventDefault();
18485
- return false;
18486
- }
18487
- }
18488
- return true;
18489
- }
18490
- }
18491
- }
18492
-
18493
- var fileElem = elem;
18494
-
18495
- function resetModel(evt) {
18496
- if (upload.shouldUpdateOn('click', attr, scope) && fileElem.val()) {
18497
- fileElem.val(null);
18498
- upload.updateModel(ngModel, attr, scope, fileChangeAttr(), null, evt, true);
18499
- }
18500
- }
18501
-
18502
- if (!isInputTypeFile()) {
18503
- fileElem = createFileInput();
18504
- }
18505
- fileElem.bind('change', changeFn);
18506
-
18507
- if (!isInputTypeFile()) {
18508
- elem.bind('click touchstart touchend', clickHandler);
18509
- } else {
18510
- elem.bind('click', resetModel);
18511
- }
18512
-
18513
- function ie10SameFileSelectFix(evt) {
18514
- if (fileElem && !fileElem.attr('__ngf_ie10_Fix_')) {
18515
- if (!fileElem[0].parentNode) {
18516
- fileElem = null;
18517
- return;
18518
- }
18519
- evt.preventDefault();
18520
- evt.stopPropagation();
18521
- fileElem.unbind('click');
18522
- var clone = fileElem.clone();
18523
- fileElem.replaceWith(clone);
18524
- fileElem = clone;
18525
- fileElem.attr('__ngf_ie10_Fix_', 'true');
18526
- fileElem.bind('change', changeFn);
18527
- fileElem.bind('click', ie10SameFileSelectFix);
18528
- fileElem[0].click();
18529
- return false;
18530
- } else {
18531
- fileElem.removeAttr('__ngf_ie10_Fix_');
18532
- }
18533
- }
18534
-
18535
- if (navigator.appVersion.indexOf('MSIE 10') !== -1) {
18536
- fileElem.bind('click', ie10SameFileSelectFix);
18537
- }
18538
-
18539
- if (ngModel) ngModel.$formatters.push(function (val) {
18540
- if (val == null || val.length === 0) {
18541
- if (fileElem.val()) {
18542
- fileElem.val(null);
18543
- }
18544
- }
18545
- return val;
18546
- });
18547
-
18548
- scope.$on('$destroy', function () {
18549
- if (!isInputTypeFile()) fileElem.parent().remove();
18550
- angular.forEach(unwatches, function (unwatch) {
18551
- unwatch();
18552
- });
18553
- });
18554
-
18555
- $timeout(function () {
18556
- for (var i = 0; i < generatedElems.length; i++) {
18557
- var g = generatedElems[i];
18558
- if (!document.body.contains(g.el[0])) {
18559
- generatedElems.splice(i, 1);
18560
- g.ref.remove();
18561
- }
18562
- }
18563
- });
18564
-
18565
- if (window.FileAPI && window.FileAPI.ngfFixIE) {
18566
- window.FileAPI.ngfFixIE(elem, fileElem, changeFn);
18567
- }
18568
- }
18569
-
18570
- return {
18571
- restrict: 'AEC',
18572
- require: '?ngModel',
18573
- link: function (scope, elem, attr, ngModel) {
18574
- linkFileSelect(scope, elem, attr, ngModel, $parse, $timeout, $compile, Upload);
18575
- }
18576
- };
18577
- }]);
18578
-
18579
- (function () {
18580
-
18581
- ngFileUpload.service('UploadDataUrl', ['UploadBase', '$timeout', '$q', function (UploadBase, $timeout, $q) {
18582
- var upload = UploadBase;
18583
- upload.base64DataUrl = function (file) {
18584
- if (angular.isArray(file)) {
18585
- var d = $q.defer(), count = 0;
18586
- angular.forEach(file, function (f) {
18587
- upload.dataUrl(f, true)['finally'](function () {
18588
- count++;
18589
- if (count === file.length) {
18590
- var urls = [];
18591
- angular.forEach(file, function (ff) {
18592
- urls.push(ff.$ngfDataUrl);
18593
- });
18594
- d.resolve(urls, file);
18595
- }
18596
- });
18597
- });
18598
- return d.promise;
18599
- } else {
18600
- return upload.dataUrl(file, true);
18601
- }
18602
- };
18603
- upload.dataUrl = function (file, disallowObjectUrl) {
18604
- if (!file) return upload.emptyPromise(file, file);
18605
- if ((disallowObjectUrl && file.$ngfDataUrl != null) || (!disallowObjectUrl && file.$ngfBlobUrl != null)) {
18606
- return upload.emptyPromise(disallowObjectUrl ? file.$ngfDataUrl : file.$ngfBlobUrl, file);
18607
- }
18608
- var p = disallowObjectUrl ? file.$$ngfDataUrlPromise : file.$$ngfBlobUrlPromise;
18609
- if (p) return p;
18610
-
18611
- var deferred = $q.defer();
18612
- $timeout(function () {
18613
- if (window.FileReader && file &&
18614
- (!window.FileAPI || navigator.userAgent.indexOf('MSIE 8') === -1 || file.size < 20000) &&
18615
- (!window.FileAPI || navigator.userAgent.indexOf('MSIE 9') === -1 || file.size < 4000000)) {
18616
- var URL = window.URL || window.webkitURL;
18617
- if (URL && URL.createObjectURL && !disallowObjectUrl) {
18618
- var url;
18619
- try {
18620
- url = URL.createObjectURL(file);
18621
- } catch (e) {
18622
- $timeout(function () {
18623
- file.$ngfBlobUrl = '';
18624
- deferred.reject();
18625
- });
18626
- return;
18627
- }
18628
- $timeout(function () {
18629
- file.$ngfBlobUrl = url;
18630
- if (url) {
18631
- deferred.resolve(url, file);
18632
- upload.blobUrls = upload.blobUrls || [];
18633
- upload.blobUrlsTotalSize = upload.blobUrlsTotalSize || 0;
18634
- upload.blobUrls.push({url: url, size: file.size});
18635
- upload.blobUrlsTotalSize += file.size || 0;
18636
- var maxMemory = upload.defaults.blobUrlsMaxMemory || 268435456;
18637
- var maxLength = upload.defaults.blobUrlsMaxQueueSize || 200;
18638
- while ((upload.blobUrlsTotalSize > maxMemory || upload.blobUrls.length > maxLength) && upload.blobUrls.length > 1) {
18639
- var obj = upload.blobUrls.splice(0, 1)[0];
18640
- URL.revokeObjectURL(obj.url);
18641
- upload.blobUrlsTotalSize -= obj.size;
18642
- }
18643
- }
18644
- });
18645
- } else {
18646
- var fileReader = new FileReader();
18647
- fileReader.onload = function (e) {
18648
- $timeout(function () {
18649
- file.$ngfDataUrl = e.target.result;
18650
- deferred.resolve(e.target.result, file);
18651
- $timeout(function () {
18652
- delete file.$ngfDataUrl;
18653
- }, 1000);
18654
- });
18655
- };
18656
- fileReader.onerror = function () {
18657
- $timeout(function () {
18658
- file.$ngfDataUrl = '';
18659
- deferred.reject();
18660
- });
18661
- };
18662
- fileReader.readAsDataURL(file);
18663
- }
18664
- } else {
18665
- $timeout(function () {
18666
- file[disallowObjectUrl ? '$ngfDataUrl' : '$ngfBlobUrl'] = '';
18667
- deferred.reject();
18668
- });
18669
- }
18670
- });
18671
-
18672
- if (disallowObjectUrl) {
18673
- p = file.$$ngfDataUrlPromise = deferred.promise;
18674
- } else {
18675
- p = file.$$ngfBlobUrlPromise = deferred.promise;
18676
- }
18677
- p['finally'](function () {
18678
- delete file[disallowObjectUrl ? '$$ngfDataUrlPromise' : '$$ngfBlobUrlPromise'];
18679
- });
18680
- return p;
18681
- };
18682
- return upload;
18683
- }]);
18684
-
18685
- function getTagType(el) {
18686
- if (el.tagName.toLowerCase() === 'img') return 'image';
18687
- if (el.tagName.toLowerCase() === 'audio') return 'audio';
18688
- if (el.tagName.toLowerCase() === 'video') return 'video';
18689
- return /./;
18690
- }
18691
-
18692
- function linkFileDirective(Upload, $timeout, scope, elem, attr, directiveName, resizeParams, isBackground) {
18693
- function constructDataUrl(file) {
18694
- var disallowObjectUrl = Upload.attrGetter('ngfNoObjectUrl', attr, scope);
18695
- Upload.dataUrl(file, disallowObjectUrl)['finally'](function () {
18696
- $timeout(function () {
18697
- var src = (disallowObjectUrl ? file.$ngfDataUrl : file.$ngfBlobUrl) || file.$ngfDataUrl;
18698
- if (isBackground) {
18699
- elem.css('background-image', 'url(\'' + (src || '') + '\')');
18700
- } else {
18701
- elem.attr('src', src);
18702
- }
18703
- if (src) {
18704
- elem.removeClass('ng-hide');
18705
- } else {
18706
- elem.addClass('ng-hide');
18707
- }
18708
- });
18709
- });
18710
- }
18711
-
18712
- $timeout(function () {
18713
- var unwatch = scope.$watch(attr[directiveName], function (file) {
18714
- var size = resizeParams;
18715
- if (directiveName === 'ngfThumbnail') {
18716
- if (!size) {
18717
- size = {
18718
- width: elem[0].naturalWidth || elem[0].clientWidth,
18719
- height: elem[0].naturalHeight || elem[0].clientHeight
18720
- };
18721
- }
18722
- if (size.width === 0 && window.getComputedStyle) {
18723
- var style = getComputedStyle(elem[0]);
18724
- if (style.width && style.width.indexOf('px') > -1 && style.height && style.height.indexOf('px') > -1) {
18725
- size = {
18726
- width: parseInt(style.width.slice(0, -2)),
18727
- height: parseInt(style.height.slice(0, -2))
18728
- };
18729
- }
18730
- }
18731
- }
18732
-
18733
- if (angular.isString(file)) {
18734
- elem.removeClass('ng-hide');
18735
- if (isBackground) {
18736
- return elem.css('background-image', 'url(\'' + file + '\')');
18737
- } else {
18738
- return elem.attr('src', file);
18739
- }
18740
- }
18741
- if (file && file.type && file.type.search(getTagType(elem[0])) === 0 &&
18742
- (!isBackground || file.type.indexOf('image') === 0)) {
18743
- if (size && Upload.isResizeSupported()) {
18744
- size.resizeIf = function (width, height) {
18745
- return Upload.attrGetter('ngfResizeIf', attr, scope,
18746
- {$width: width, $height: height, $file: file});
18747
- };
18748
- Upload.resize(file, size).then(
18749
- function (f) {
18750
- constructDataUrl(f);
18751
- }, function (e) {
18752
- throw e;
18753
- }
18754
- );
18755
- } else {
18756
- constructDataUrl(file);
18757
- }
18758
- } else {
18759
- elem.addClass('ng-hide');
18760
- }
18761
- });
18762
-
18763
- scope.$on('$destroy', function () {
18764
- unwatch();
18765
- });
18766
- });
18767
- }
18768
-
18769
-
18770
- ngFileUpload.directive('ngfSrc', ['Upload', '$timeout', function (Upload, $timeout) {
18771
- return {
18772
- restrict: 'AE',
18773
- link: function (scope, elem, attr) {
18774
- linkFileDirective(Upload, $timeout, scope, elem, attr, 'ngfSrc',
18775
- Upload.attrGetter('ngfResize', attr, scope), false);
18776
- }
18777
- };
18778
- }]);
18779
-
18780
- ngFileUpload.directive('ngfBackground', ['Upload', '$timeout', function (Upload, $timeout) {
18781
- return {
18782
- restrict: 'AE',
18783
- link: function (scope, elem, attr) {
18784
- linkFileDirective(Upload, $timeout, scope, elem, attr, 'ngfBackground',
18785
- Upload.attrGetter('ngfResize', attr, scope), true);
18786
- }
18787
- };
18788
- }]);
18789
-
18790
- ngFileUpload.directive('ngfThumbnail', ['Upload', '$timeout', function (Upload, $timeout) {
18791
- return {
18792
- restrict: 'AE',
18793
- link: function (scope, elem, attr) {
18794
- var size = Upload.attrGetter('ngfSize', attr, scope);
18795
- linkFileDirective(Upload, $timeout, scope, elem, attr, 'ngfThumbnail', size,
18796
- Upload.attrGetter('ngfAsBackground', attr, scope));
18797
- }
18798
- };
18799
- }]);
18800
-
18801
- ngFileUpload.config(['$compileProvider', function ($compileProvider) {
18802
- if ($compileProvider.imgSrcSanitizationWhitelist) $compileProvider.imgSrcSanitizationWhitelist(/^\s*(https?|ftp|mailto|tel|webcal|local|file|data|blob):/);
18803
- if ($compileProvider.aHrefSanitizationWhitelist) $compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|ftp|mailto|tel|webcal|local|file|data|blob):/);
18804
- }]);
18805
-
18806
- ngFileUpload.filter('ngfDataUrl', ['UploadDataUrl', '$sce', function (UploadDataUrl, $sce) {
18807
- return function (file, disallowObjectUrl, trustedUrl) {
18808
- if (angular.isString(file)) {
18809
- return $sce.trustAsResourceUrl(file);
18810
- }
18811
- var src = file && ((disallowObjectUrl ? file.$ngfDataUrl : file.$ngfBlobUrl) || file.$ngfDataUrl);
18812
- if (file && !src) {
18813
- if (!file.$ngfDataUrlFilterInProgress && angular.isObject(file)) {
18814
- file.$ngfDataUrlFilterInProgress = true;
18815
- UploadDataUrl.dataUrl(file, disallowObjectUrl);
18816
- }
18817
- return '';
18818
- }
18819
- if (file) delete file.$ngfDataUrlFilterInProgress;
18820
- return (file && src ? (trustedUrl ? $sce.trustAsResourceUrl(src) : src) : file) || '';
18821
- };
18822
- }]);
18823
-
18824
- })();
18825
-
18826
- ngFileUpload.service('UploadValidate', ['UploadDataUrl', '$q', '$timeout', function (UploadDataUrl, $q, $timeout) {
18827
- var upload = UploadDataUrl;
18828
-
18829
- function globStringToRegex(str) {
18830
- var regexp = '', excludes = [];
18831
- if (str.length > 2 && str[0] === '/' && str[str.length - 1] === '/') {
18832
- regexp = str.substring(1, str.length - 1);
18833
- } else {
18834
- var split = str.split(',');
18835
- if (split.length > 1) {
18836
- for (var i = 0; i < split.length; i++) {
18837
- var r = globStringToRegex(split[i]);
18838
- if (r.regexp) {
18839
- regexp += '(' + r.regexp + ')';
18840
- if (i < split.length - 1) {
18841
- regexp += '|';
18842
- }
18843
- } else {
18844
- excludes = excludes.concat(r.excludes);
18845
- }
18846
- }
18847
- } else {
18848
- if (str.indexOf('!') === 0) {
18849
- excludes.push('^((?!' + globStringToRegex(str.substring(1)).regexp + ').)*$');
18850
- } else {
18851
- if (str.indexOf('.') === 0) {
18852
- str = '*' + str;
18853
- }
18854
- regexp = '^' + str.replace(new RegExp('[.\\\\+*?\\[\\^\\]$(){}=!<>|:\\-]', 'g'), '\\$&') + '$';
18855
- regexp = regexp.replace(/\\\*/g, '.*').replace(/\\\?/g, '.');
18856
- }
18857
- }
18858
- }
18859
- return {regexp: regexp, excludes: excludes};
18860
- }
18861
-
18862
- upload.validatePattern = function (file, val) {
18863
- if (!val) {
18864
- return true;
18865
- }
18866
- var pattern = globStringToRegex(val), valid = true;
18867
- if (pattern.regexp && pattern.regexp.length) {
18868
- var regexp = new RegExp(pattern.regexp, 'i');
18869
- valid = (file.type != null && regexp.test(file.type)) ||
18870
- (file.name != null && regexp.test(file.name));
18871
- }
18872
- var len = pattern.excludes.length;
18873
- while (len--) {
18874
- var exclude = new RegExp(pattern.excludes[len], 'i');
18875
- valid = valid && (file.type == null || exclude.test(file.type)) &&
18876
- (file.name == null || exclude.test(file.name));
18877
- }
18878
- return valid;
18879
- };
18880
-
18881
- upload.ratioToFloat = function (val) {
18882
- var r = val.toString(), xIndex = r.search(/[x:]/i);
18883
- if (xIndex > -1) {
18884
- r = parseFloat(r.substring(0, xIndex)) / parseFloat(r.substring(xIndex + 1));
18885
- } else {
18886
- r = parseFloat(r);
18887
- }
18888
- return r;
18889
- };
18890
-
18891
- upload.registerModelChangeValidator = function (ngModel, attr, scope) {
18892
- if (ngModel) {
18893
- ngModel.$formatters.push(function (files) {
18894
- if (ngModel.$dirty) {
18895
- var filesArray = files;
18896
- if (files && !angular.isArray(files)) {
18897
- filesArray = [files];
18898
- }
18899
- upload.validate(filesArray, 0, ngModel, attr, scope).then(function () {
18900
- upload.applyModelValidation(ngModel, filesArray);
18901
- });
18902
- }
18903
- return files;
18904
- });
18905
- }
18906
- };
18907
-
18908
- function markModelAsDirty(ngModel, files) {
18909
- if (files != null && !ngModel.$dirty) {
18910
- if (ngModel.$setDirty) {
18911
- ngModel.$setDirty();
18912
- } else {
18913
- ngModel.$dirty = true;
18914
- }
18915
- }
18916
- }
18917
-
18918
- upload.applyModelValidation = function (ngModel, files) {
18919
- markModelAsDirty(ngModel, files);
18920
- angular.forEach(ngModel.$ngfValidations, function (validation) {
18921
- ngModel.$setValidity(validation.name, validation.valid);
18922
- });
18923
- };
18924
-
18925
- upload.getValidationAttr = function (attr, scope, name, validationName, file) {
18926
- var dName = 'ngf' + name[0].toUpperCase() + name.substr(1);
18927
- var val = upload.attrGetter(dName, attr, scope, {$file: file});
18928
- if (val == null) {
18929
- val = upload.attrGetter('ngfValidate', attr, scope, {$file: file});
18930
- if (val) {
18931
- var split = (validationName || name).split('.');
18932
- val = val[split[0]];
18933
- if (split.length > 1) {
18934
- val = val && val[split[1]];
18935
- }
18936
- }
18937
- }
18938
- return val;
18939
- };
18940
-
18941
- upload.validate = function (files, prevLength, ngModel, attr, scope) {
18942
- ngModel = ngModel || {};
18943
- ngModel.$ngfValidations = ngModel.$ngfValidations || [];
18944
-
18945
- angular.forEach(ngModel.$ngfValidations, function (v) {
18946
- v.valid = true;
18947
- });
18948
-
18949
- var attrGetter = function (name, params) {
18950
- return upload.attrGetter(name, attr, scope, params);
18951
- };
18952
-
18953
- var ignoredErrors = (upload.attrGetter('ngfIgnoreInvalid', attr, scope) || '').split(' ');
18954
- var runAllValidation = upload.attrGetter('ngfRunAllValidations', attr, scope);
18955
-
18956
- if (files == null || files.length === 0) {
18957
- return upload.emptyPromise({'validFiles': files, 'invalidFiles': []});
18958
- }
18959
-
18960
- files = files.length === undefined ? [files] : files.slice(0);
18961
- var invalidFiles = [];
18962
-
18963
- function validateSync(name, validationName, fn) {
18964
- if (files) {
18965
- var i = files.length, valid = null;
18966
- while (i--) {
18967
- var file = files[i];
18968
- if (file) {
18969
- var val = upload.getValidationAttr(attr, scope, name, validationName, file);
18970
- if (val != null) {
18971
- if (!fn(file, val, i)) {
18972
- if (ignoredErrors.indexOf(name) === -1) {
18973
- file.$error = name;
18974
- (file.$errorMessages = (file.$errorMessages || {}))[name] = true;
18975
- file.$errorParam = val;
18976
- if (invalidFiles.indexOf(file) === -1) {
18977
- invalidFiles.push(file);
18978
- }
18979
- if (!runAllValidation) {
18980
- files.splice(i, 1);
18981
- }
18982
- valid = false;
18983
- } else {
18984
- files.splice(i, 1);
18985
- }
18986
- }
18987
- }
18988
- }
18989
- }
18990
- if (valid !== null) {
18991
- ngModel.$ngfValidations.push({name: name, valid: valid});
18992
- }
18993
- }
18994
- }
18995
-
18996
- validateSync('pattern', null, upload.validatePattern);
18997
- validateSync('minSize', 'size.min', function (file, val) {
18998
- return file.size + 0.1 >= upload.translateScalars(val);
18999
- });
19000
- validateSync('maxSize', 'size.max', function (file, val) {
19001
- return file.size - 0.1 <= upload.translateScalars(val);
19002
- });
19003
- var totalSize = 0;
19004
- validateSync('maxTotalSize', null, function (file, val) {
19005
- totalSize += file.size;
19006
- if (totalSize > upload.translateScalars(val)) {
19007
- files.splice(0, files.length);
19008
- return false;
19009
- }
19010
- return true;
19011
- });
19012
-
19013
- validateSync('validateFn', null, function (file, r) {
19014
- return r === true || r === null || r === '';
19015
- });
19016
-
19017
- if (!files.length) {
19018
- return upload.emptyPromise({'validFiles': [], 'invalidFiles': invalidFiles});
19019
- }
19020
-
19021
- function validateAsync(name, validationName, type, asyncFn, fn) {
19022
- function resolveResult(defer, file, val) {
19023
- function resolveInternal(fn) {
19024
- if (fn()) {
19025
- if (ignoredErrors.indexOf(name) === -1) {
19026
- file.$error = name;
19027
- (file.$errorMessages = (file.$errorMessages || {}))[name] = true;
19028
- file.$errorParam = val;
19029
- if (invalidFiles.indexOf(file) === -1) {
19030
- invalidFiles.push(file);
19031
- }
19032
- if (!runAllValidation) {
19033
- var i = files.indexOf(file);
19034
- if (i > -1) files.splice(i, 1);
19035
- }
19036
- defer.resolve(false);
19037
- } else {
19038
- var j = files.indexOf(file);
19039
- if (j > -1) files.splice(j, 1);
19040
- defer.resolve(true);
19041
- }
19042
- } else {
19043
- defer.resolve(true);
19044
- }
19045
- }
19046
-
19047
- if (val != null) {
19048
- asyncFn(file, val).then(function (d) {
19049
- resolveInternal(function () {
19050
- return !fn(d, val);
19051
- });
19052
- }, function () {
19053
- resolveInternal(function () {
19054
- return attrGetter('ngfValidateForce', {$file: file});
19055
- });
19056
- });
19057
- } else {
19058
- defer.resolve(true);
19059
- }
19060
- }
19061
-
19062
- var promises = [upload.emptyPromise(true)];
19063
- if (files) {
19064
- files = files.length === undefined ? [files] : files;
19065
- angular.forEach(files, function (file) {
19066
- var defer = $q.defer();
19067
- promises.push(defer.promise);
19068
- if (type && (file.type == null || file.type.search(type) !== 0)) {
19069
- defer.resolve(true);
19070
- return;
19071
- }
19072
- if (name === 'dimensions' && upload.attrGetter('ngfDimensions', attr) != null) {
19073
- upload.imageDimensions(file).then(function (d) {
19074
- resolveResult(defer, file,
19075
- attrGetter('ngfDimensions', {$file: file, $width: d.width, $height: d.height}));
19076
- }, function () {
19077
- defer.resolve(false);
19078
- });
19079
- } else if (name === 'duration' && upload.attrGetter('ngfDuration', attr) != null) {
19080
- upload.mediaDuration(file).then(function (d) {
19081
- resolveResult(defer, file,
19082
- attrGetter('ngfDuration', {$file: file, $duration: d}));
19083
- }, function () {
19084
- defer.resolve(false);
19085
- });
19086
- } else {
19087
- resolveResult(defer, file,
19088
- upload.getValidationAttr(attr, scope, name, validationName, file));
19089
- }
19090
- });
19091
- }
19092
- var deffer = $q.defer();
19093
- $q.all(promises).then(function (values) {
19094
- var isValid = true;
19095
- for (var i = 0; i < values.length; i++) {
19096
- if (!values[i]) {
19097
- isValid = false;
19098
- break;
19099
- }
19100
- }
19101
- ngModel.$ngfValidations.push({name: name, valid: isValid});
19102
- deffer.resolve(isValid);
19103
- });
19104
- return deffer.promise;
19105
- }
19106
-
19107
- var deffer = $q.defer();
19108
- var promises = [];
19109
-
19110
- promises.push(validateAsync('maxHeight', 'height.max', /image/,
19111
- this.imageDimensions, function (d, val) {
19112
- return d.height <= val;
19113
- }));
19114
- promises.push(validateAsync('minHeight', 'height.min', /image/,
19115
- this.imageDimensions, function (d, val) {
19116
- return d.height >= val;
19117
- }));
19118
- promises.push(validateAsync('maxWidth', 'width.max', /image/,
19119
- this.imageDimensions, function (d, val) {
19120
- return d.width <= val;
19121
- }));
19122
- promises.push(validateAsync('minWidth', 'width.min', /image/,
19123
- this.imageDimensions, function (d, val) {
19124
- return d.width >= val;
19125
- }));
19126
- promises.push(validateAsync('dimensions', null, /image/,
19127
- function (file, val) {
19128
- return upload.emptyPromise(val);
19129
- }, function (r) {
19130
- return r;
19131
- }));
19132
- promises.push(validateAsync('ratio', null, /image/,
19133
- this.imageDimensions, function (d, val) {
19134
- var split = val.toString().split(','), valid = false;
19135
- for (var i = 0; i < split.length; i++) {
19136
- if (Math.abs((d.width / d.height) - upload.ratioToFloat(split[i])) < 0.01) {
19137
- valid = true;
19138
- }
19139
- }
19140
- return valid;
19141
- }));
19142
- promises.push(validateAsync('maxRatio', 'ratio.max', /image/,
19143
- this.imageDimensions, function (d, val) {
19144
- return (d.width / d.height) - upload.ratioToFloat(val) < 0.0001;
19145
- }));
19146
- promises.push(validateAsync('minRatio', 'ratio.min', /image/,
19147
- this.imageDimensions, function (d, val) {
19148
- return (d.width / d.height) - upload.ratioToFloat(val) > -0.0001;
19149
- }));
19150
- promises.push(validateAsync('maxDuration', 'duration.max', /audio|video/,
19151
- this.mediaDuration, function (d, val) {
19152
- return d <= upload.translateScalars(val);
19153
- }));
19154
- promises.push(validateAsync('minDuration', 'duration.min', /audio|video/,
19155
- this.mediaDuration, function (d, val) {
19156
- return d >= upload.translateScalars(val);
19157
- }));
19158
- promises.push(validateAsync('duration', null, /audio|video/,
19159
- function (file, val) {
19160
- return upload.emptyPromise(val);
19161
- }, function (r) {
19162
- return r;
19163
- }));
19164
-
19165
- promises.push(validateAsync('validateAsyncFn', null, null,
19166
- function (file, val) {
19167
- return val;
19168
- }, function (r) {
19169
- return r === true || r === null || r === '';
19170
- }));
19171
-
19172
- $q.all(promises).then(function () {
19173
-
19174
- if (runAllValidation) {
19175
- for (var i = 0; i < files.length; i++) {
19176
- var file = files[i];
19177
- if (file.$error) {
19178
- files.splice(i--, 1);
19179
- }
19180
- }
19181
- }
19182
-
19183
- runAllValidation = false;
19184
- validateSync('maxFiles', null, function (file, val, i) {
19185
- return prevLength + i < val;
19186
- });
19187
-
19188
- deffer.resolve({'validFiles': files, 'invalidFiles': invalidFiles});
19189
- });
19190
- return deffer.promise;
19191
- };
19192
-
19193
- upload.imageDimensions = function (file) {
19194
- if (file.$ngfWidth && file.$ngfHeight) {
19195
- var d = $q.defer();
19196
- $timeout(function () {
19197
- d.resolve({width: file.$ngfWidth, height: file.$ngfHeight});
19198
- });
19199
- return d.promise;
19200
- }
19201
- if (file.$ngfDimensionPromise) return file.$ngfDimensionPromise;
19202
-
19203
- var deferred = $q.defer();
19204
- $timeout(function () {
19205
- if (file.type.indexOf('image') !== 0) {
19206
- deferred.reject('not image');
19207
- return;
19208
- }
19209
- upload.dataUrl(file).then(function (dataUrl) {
19210
- var img = angular.element('<img>').attr('src', dataUrl)
19211
- .css('visibility', 'hidden').css('position', 'fixed')
19212
- .css('max-width', 'none !important').css('max-height', 'none !important');
19213
-
19214
- function success() {
19215
- var width = img[0].naturalWidth || img[0].clientWidth;
19216
- var height = img[0].naturalHeight || img[0].clientHeight;
19217
- img.remove();
19218
- file.$ngfWidth = width;
19219
- file.$ngfHeight = height;
19220
- deferred.resolve({width: width, height: height});
19221
- }
19222
-
19223
- function error() {
19224
- img.remove();
19225
- deferred.reject('load error');
19226
- }
19227
-
19228
- img.on('load', success);
19229
- img.on('error', error);
19230
-
19231
- var secondsCounter = 0;
19232
- function checkLoadErrorInCaseOfNoCallback() {
19233
- $timeout(function () {
19234
- if (img[0].parentNode) {
19235
- if (img[0].clientWidth) {
19236
- success();
19237
- } else if (secondsCounter++ > 10) {
19238
- error();
19239
- } else {
19240
- checkLoadErrorInCaseOfNoCallback();
19241
- }
19242
- }
19243
- }, 1000);
19244
- }
19245
-
19246
- checkLoadErrorInCaseOfNoCallback();
19247
-
19248
- angular.element(document.getElementsByTagName('body')[0]).append(img);
19249
- }, function () {
19250
- deferred.reject('load error');
19251
- });
19252
- });
19253
-
19254
- file.$ngfDimensionPromise = deferred.promise;
19255
- file.$ngfDimensionPromise['finally'](function () {
19256
- delete file.$ngfDimensionPromise;
19257
- });
19258
- return file.$ngfDimensionPromise;
19259
- };
19260
-
19261
- upload.mediaDuration = function (file) {
19262
- if (file.$ngfDuration) {
19263
- var d = $q.defer();
19264
- $timeout(function () {
19265
- d.resolve(file.$ngfDuration);
19266
- });
19267
- return d.promise;
19268
- }
19269
- if (file.$ngfDurationPromise) return file.$ngfDurationPromise;
19270
-
19271
- var deferred = $q.defer();
19272
- $timeout(function () {
19273
- if (file.type.indexOf('audio') !== 0 && file.type.indexOf('video') !== 0) {
19274
- deferred.reject('not media');
19275
- return;
19276
- }
19277
- upload.dataUrl(file).then(function (dataUrl) {
19278
- var el = angular.element(file.type.indexOf('audio') === 0 ? '<audio>' : '<video>')
19279
- .attr('src', dataUrl).css('visibility', 'none').css('position', 'fixed');
19280
-
19281
- function success() {
19282
- var duration = el[0].duration;
19283
- file.$ngfDuration = duration;
19284
- el.remove();
19285
- deferred.resolve(duration);
19286
- }
19287
-
19288
- function error() {
19289
- el.remove();
19290
- deferred.reject('load error');
19291
- }
19292
-
19293
- el.on('loadedmetadata', success);
19294
- el.on('error', error);
19295
- var count = 0;
19296
-
19297
- function checkLoadError() {
19298
- $timeout(function () {
19299
- if (el[0].parentNode) {
19300
- if (el[0].duration) {
19301
- success();
19302
- } else if (count > 10) {
19303
- error();
19304
- } else {
19305
- checkLoadError();
19306
- }
19307
- }
19308
- }, 1000);
19309
- }
19310
-
19311
- checkLoadError();
19312
-
19313
- angular.element(document.body).append(el);
19314
- }, function () {
19315
- deferred.reject('load error');
19316
- });
19317
- });
19318
-
19319
- file.$ngfDurationPromise = deferred.promise;
19320
- file.$ngfDurationPromise['finally'](function () {
19321
- delete file.$ngfDurationPromise;
19322
- });
19323
- return file.$ngfDurationPromise;
19324
- };
19325
- return upload;
19326
- }
19327
- ]);
19328
-
19329
- ngFileUpload.service('UploadResize', ['UploadValidate', '$q', function (UploadValidate, $q) {
19330
- var upload = UploadValidate;
19331
-
19332
- var calculateAspectRatioFit = function (srcWidth, srcHeight, maxWidth, maxHeight, centerCrop) {
19333
- var ratio = centerCrop ? Math.max(maxWidth / srcWidth, maxHeight / srcHeight) :
19334
- Math.min(maxWidth / srcWidth, maxHeight / srcHeight);
19335
- return {
19336
- width: srcWidth * ratio, height: srcHeight * ratio,
19337
- marginX: srcWidth * ratio - maxWidth, marginY: srcHeight * ratio - maxHeight
19338
- };
19339
- };
19340
-
19341
- var resize = function (imagen, width, height, quality, type, ratio, centerCrop, resizeIf) {
19342
- var deferred = $q.defer();
19343
- var canvasElement = document.createElement('canvas');
19344
- var imageElement = document.createElement('img');
19345
- imageElement.setAttribute('style', 'visibility:hidden;position:fixed;z-index:-100000');
19346
- document.body.appendChild(imageElement);
19347
-
19348
- imageElement.onload = function () {
19349
- var imgWidth = imageElement.width, imgHeight = imageElement.height;
19350
- imageElement.parentNode.removeChild(imageElement);
19351
- if (resizeIf != null && resizeIf(imgWidth, imgHeight) === false) {
19352
- deferred.reject('resizeIf');
19353
- return;
19354
- }
19355
- try {
19356
- if (ratio) {
19357
- var ratioFloat = upload.ratioToFloat(ratio);
19358
- var imgRatio = imgWidth / imgHeight;
19359
- if (imgRatio < ratioFloat) {
19360
- width = imgWidth;
19361
- height = width / ratioFloat;
19362
- } else {
19363
- height = imgHeight;
19364
- width = height * ratioFloat;
19365
- }
19366
- }
19367
- if (!width) {
19368
- width = imgWidth;
19369
- }
19370
- if (!height) {
19371
- height = imgHeight;
19372
- }
19373
- var dimensions = calculateAspectRatioFit(imgWidth, imgHeight, width, height, centerCrop);
19374
- canvasElement.width = Math.min(dimensions.width, width);
19375
- canvasElement.height = Math.min(dimensions.height, height);
19376
- var context = canvasElement.getContext('2d');
19377
- context.drawImage(imageElement,
19378
- Math.min(0, -dimensions.marginX / 2), Math.min(0, -dimensions.marginY / 2),
19379
- dimensions.width, dimensions.height);
19380
- deferred.resolve(canvasElement.toDataURL(type || 'image/WebP', quality || 0.934));
19381
- } catch (e) {
19382
- deferred.reject(e);
19383
- }
19384
- };
19385
- imageElement.onerror = function () {
19386
- imageElement.parentNode.removeChild(imageElement);
19387
- deferred.reject();
19388
- };
19389
- imageElement.src = imagen;
19390
- return deferred.promise;
19391
- };
19392
-
19393
- upload.dataUrltoBlob = function (dataurl, name, origSize) {
19394
- var arr = dataurl.split(','), mime = arr[0].match(/:(.*?);/)[1],
19395
- bstr = atob(arr[1]), n = bstr.length, u8arr = new Uint8Array(n);
19396
- while (n--) {
19397
- u8arr[n] = bstr.charCodeAt(n);
19398
- }
19399
- var blob = new window.Blob([u8arr], {type: mime});
19400
- blob.name = name;
19401
- blob.$ngfOrigSize = origSize;
19402
- return blob;
19403
- };
19404
-
19405
- upload.isResizeSupported = function () {
19406
- var elem = document.createElement('canvas');
19407
- return window.atob && elem.getContext && elem.getContext('2d') && window.Blob;
19408
- };
19409
-
19410
- if (upload.isResizeSupported()) {
19411
- Object.defineProperty(window.Blob.prototype, 'name', {
19412
- get: function () {
19413
- return this.$ngfName;
19414
- },
19415
- set: function (v) {
19416
- this.$ngfName = v;
19417
- },
19418
- configurable: true
19419
- });
19420
- }
19421
-
19422
- upload.resize = function (file, options) {
19423
- if (file.type.indexOf('image') !== 0) return upload.emptyPromise(file);
19424
-
19425
- var deferred = $q.defer();
19426
- upload.dataUrl(file, true).then(function (url) {
19427
- resize(url, options.width, options.height, options.quality, options.type || file.type,
19428
- options.ratio, options.centerCrop, options.resizeIf)
19429
- .then(function (dataUrl) {
19430
- if (file.type === 'image/jpeg' && options.restoreExif !== false) {
19431
- try {
19432
- dataUrl = upload.restoreExif(url, dataUrl);
19433
- } catch (e) {
19434
- setTimeout(function () {throw e;}, 1);
19435
- }
19436
- }
19437
- try {
19438
- var blob = upload.dataUrltoBlob(dataUrl, file.name, file.size);
19439
- deferred.resolve(blob);
19440
- } catch (e) {
19441
- deferred.reject(e);
19442
- }
19443
- }, function (r) {
19444
- if (r === 'resizeIf') {
19445
- deferred.resolve(file);
19446
- }
19447
- deferred.reject(r);
19448
- });
19449
- }, function (e) {
19450
- deferred.reject(e);
19451
- });
19452
- return deferred.promise;
19453
- };
19454
-
19455
- return upload;
19456
- }]);
19457
-
19458
- (function () {
19459
- ngFileUpload.directive('ngfDrop', ['$parse', '$timeout', '$window', 'Upload', '$http', '$q',
19460
- function ($parse, $timeout, $window, Upload, $http, $q) {
19461
- return {
19462
- restrict: 'AEC',
19463
- require: '?ngModel',
19464
- link: function (scope, elem, attr, ngModel) {
19465
- linkDrop(scope, elem, attr, ngModel, $parse, $timeout, $window, Upload, $http, $q);
19466
- }
19467
- };
19468
- }]);
19469
-
19470
- ngFileUpload.directive('ngfNoFileDrop', function () {
19471
- return function (scope, elem) {
19472
- if (dropAvailable()) elem.css('display', 'none');
19473
- };
19474
- });
19475
-
19476
- ngFileUpload.directive('ngfDropAvailable', ['$parse', '$timeout', 'Upload', function ($parse, $timeout, Upload) {
19477
- return function (scope, elem, attr) {
19478
- if (dropAvailable()) {
19479
- var model = $parse(Upload.attrGetter('ngfDropAvailable', attr));
19480
- $timeout(function () {
19481
- model(scope);
19482
- if (model.assign) {
19483
- model.assign(scope, true);
19484
- }
19485
- });
19486
- }
19487
- };
19488
- }]);
19489
-
19490
- function linkDrop(scope, elem, attr, ngModel, $parse, $timeout, $window, upload, $http, $q) {
19491
- var available = dropAvailable();
19492
-
19493
- var attrGetter = function (name, scope, params) {
19494
- return upload.attrGetter(name, attr, scope, params);
19495
- };
19496
-
19497
- if (attrGetter('dropAvailable')) {
19498
- $timeout(function () {
19499
- if (scope[attrGetter('dropAvailable')]) {
19500
- scope[attrGetter('dropAvailable')].value = available;
19501
- } else {
19502
- scope[attrGetter('dropAvailable')] = available;
19503
- }
19504
- });
19505
- }
19506
- if (!available) {
19507
- if (attrGetter('ngfHideOnDropNotAvailable', scope) === true) {
19508
- elem.css('display', 'none');
19509
- }
19510
- return;
19511
- }
19512
-
19513
- function isDisabled() {
19514
- return elem.attr('disabled') || attrGetter('ngfDropDisabled', scope);
19515
- }
19516
-
19517
- if (attrGetter('ngfSelect') == null) {
19518
- upload.registerModelChangeValidator(ngModel, attr, scope);
19519
- }
19520
-
19521
- var leaveTimeout = null;
19522
- var stopPropagation = $parse(attrGetter('ngfStopPropagation'));
19523
- var dragOverDelay = 1;
19524
- var actualDragOverClass;
19525
-
19526
- elem[0].addEventListener('dragover', function (evt) {
19527
- if (isDisabled() || !upload.shouldUpdateOn('drop', attr, scope)) return;
19528
- evt.preventDefault();
19529
- if (stopPropagation(scope)) evt.stopPropagation();
19530
- if (navigator.userAgent.indexOf('Chrome') > -1) {
19531
- var b = evt.dataTransfer.effectAllowed;
19532
- evt.dataTransfer.dropEffect = ('move' === b || 'linkMove' === b) ? 'move' : 'copy';
19533
- }
19534
- $timeout.cancel(leaveTimeout);
19535
- if (!actualDragOverClass) {
19536
- actualDragOverClass = 'C';
19537
- calculateDragOverClass(scope, attr, evt, function (clazz) {
19538
- actualDragOverClass = clazz;
19539
- elem.addClass(actualDragOverClass);
19540
- attrGetter('ngfDrag', scope, {$isDragging: true, $class: actualDragOverClass, $event: evt});
19541
- });
19542
- }
19543
- }, false);
19544
- elem[0].addEventListener('dragenter', function (evt) {
19545
- if (isDisabled() || !upload.shouldUpdateOn('drop', attr, scope)) return;
19546
- evt.preventDefault();
19547
- if (stopPropagation(scope)) evt.stopPropagation();
19548
- }, false);
19549
- elem[0].addEventListener('dragleave', function (evt) {
19550
- if (isDisabled() || !upload.shouldUpdateOn('drop', attr, scope)) return;
19551
- evt.preventDefault();
19552
- if (stopPropagation(scope)) evt.stopPropagation();
19553
- leaveTimeout = $timeout(function () {
19554
- if (actualDragOverClass) elem.removeClass(actualDragOverClass);
19555
- actualDragOverClass = null;
19556
- attrGetter('ngfDrag', scope, {$isDragging: false, $event: evt});
19557
- }, dragOverDelay || 100);
19558
- }, false);
19559
- elem[0].addEventListener('drop', function (evt) {
19560
- if (isDisabled() || !upload.shouldUpdateOn('drop', attr, scope)) return;
19561
- evt.preventDefault();
19562
- if (stopPropagation(scope)) evt.stopPropagation();
19563
- if (actualDragOverClass) elem.removeClass(actualDragOverClass);
19564
- actualDragOverClass = null;
19565
- extractFilesAndUpdateModel(evt.dataTransfer, evt, 'dropUrl');
19566
- }, false);
19567
- elem[0].addEventListener('paste', function (evt) {
19568
- if (navigator.userAgent.toLowerCase().indexOf('firefox') > -1 &&
19569
- attrGetter('ngfEnableFirefoxPaste', scope)) {
19570
- evt.preventDefault();
19571
- }
19572
- if (isDisabled() || !upload.shouldUpdateOn('paste', attr, scope)) return;
19573
- extractFilesAndUpdateModel(evt.clipboardData || evt.originalEvent.clipboardData, evt, 'pasteUrl');
19574
- }, false);
19575
-
19576
- if (navigator.userAgent.toLowerCase().indexOf('firefox') > -1 &&
19577
- attrGetter('ngfEnableFirefoxPaste', scope)) {
19578
- elem.attr('contenteditable', true);
19579
- elem.on('keypress', function (e) {
19580
- if (!e.metaKey && !e.ctrlKey) {
19581
- e.preventDefault();
19582
- }
19583
- });
19584
- }
19585
-
19586
- function extractFilesAndUpdateModel(source, evt, updateOnType) {
19587
- if (!source) return;
19588
- var html;
19589
- try {
19590
- html = source && source.getData && source.getData('text/html');
19591
- } catch (e) {
19592
- }
19593
- extractFiles(source.items, source.files, attrGetter('ngfAllowDir', scope) !== false,
19594
- attrGetter('multiple') || attrGetter('ngfMultiple', scope)).then(function (files) {
19595
- if (files.length) {
19596
- updateModel(files, evt);
19597
- } else {
19598
- extractFilesFromHtml(updateOnType, html).then(function (files) {
19599
- updateModel(files, evt);
19600
- });
19601
- }
19602
- });
19603
- }
19604
-
19605
- function updateModel(files, evt) {
19606
- upload.updateModel(ngModel, attr, scope, attrGetter('ngfChange') || attrGetter('ngfDrop'), files, evt);
19607
- }
19608
-
19609
- function extractFilesFromHtml(updateOn, html) {
19610
- if (!upload.shouldUpdateOn(updateOn, attr, scope) || typeof html !== 'string') return upload.rejectPromise([]);
19611
- var urls = [];
19612
- html.replace(/<(img src|img [^>]* src) *=\"([^\"]*)\"/gi, function (m, n, src) {
19613
- urls.push(src);
19614
- });
19615
- var promises = [], files = [];
19616
- if (urls.length) {
19617
- angular.forEach(urls, function (url) {
19618
- promises.push(upload.urlToBlob(url).then(function (blob) {
19619
- files.push(blob);
19620
- }));
19621
- });
19622
- var defer = $q.defer();
19623
- $q.all(promises).then(function () {
19624
- defer.resolve(files);
19625
- }, function (e) {
19626
- defer.reject(e);
19627
- });
19628
- return defer.promise;
19629
- }
19630
- return upload.emptyPromise();
19631
- }
19632
-
19633
- function calculateDragOverClass(scope, attr, evt, callback) {
19634
- var obj = attrGetter('ngfDragOverClass', scope, {$event: evt}), dClass = 'dragover';
19635
- if (angular.isString(obj)) {
19636
- dClass = obj;
19637
- } else if (obj) {
19638
- if (obj.delay) dragOverDelay = obj.delay;
19639
- if (obj.accept || obj.reject) {
19640
- var items = evt.dataTransfer.items;
19641
- if (items == null || !items.length) {
19642
- dClass = obj.accept;
19643
- } else {
19644
- var pattern = obj.pattern || attrGetter('ngfPattern', scope, {$event: evt});
19645
- var len = items.length;
19646
- while (len--) {
19647
- if (!upload.validatePattern(items[len], pattern)) {
19648
- dClass = obj.reject;
19649
- break;
19650
- } else {
19651
- dClass = obj.accept;
19652
- }
19653
- }
19654
- }
19655
- }
19656
- }
19657
- callback(dClass);
19658
- }
19659
-
19660
- function extractFiles(items, fileList, allowDir, multiple) {
19661
- var maxFiles = upload.getValidationAttr(attr, scope, 'maxFiles');
19662
- if (maxFiles == null) {
19663
- maxFiles = Number.MAX_VALUE;
19664
- }
19665
- var maxTotalSize = upload.getValidationAttr(attr, scope, 'maxTotalSize');
19666
- if (maxTotalSize == null) {
19667
- maxTotalSize = Number.MAX_VALUE;
19668
- }
19669
- var includeDir = attrGetter('ngfIncludeDir', scope);
19670
- var files = [], totalSize = 0;
19671
-
19672
- function traverseFileTree(entry, path) {
19673
- var defer = $q.defer();
19674
- if (entry != null) {
19675
- if (entry.isDirectory) {
19676
- var promises = [upload.emptyPromise()];
19677
- if (includeDir) {
19678
- var file = {type: 'directory'};
19679
- file.name = file.path = (path || '') + entry.name;
19680
- files.push(file);
19681
- }
19682
- var dirReader = entry.createReader();
19683
- var entries = [];
19684
- var readEntries = function () {
19685
- dirReader.readEntries(function (results) {
19686
- try {
19687
- if (!results.length) {
19688
- angular.forEach(entries.slice(0), function (e) {
19689
- if (files.length <= maxFiles && totalSize <= maxTotalSize) {
19690
- promises.push(traverseFileTree(e, (path ? path : '') + entry.name + '/'));
19691
- }
19692
- });
19693
- $q.all(promises).then(function () {
19694
- defer.resolve();
19695
- }, function (e) {
19696
- defer.reject(e);
19697
- });
19698
- } else {
19699
- entries = entries.concat(Array.prototype.slice.call(results || [], 0));
19700
- readEntries();
19701
- }
19702
- } catch (e) {
19703
- defer.reject(e);
19704
- }
19705
- }, function (e) {
19706
- defer.reject(e);
19707
- });
19708
- };
19709
- readEntries();
19710
- } else {
19711
- entry.file(function (file) {
19712
- try {
19713
- file.path = (path ? path : '') + file.name;
19714
- if (includeDir) {
19715
- file = upload.rename(file, file.path);
19716
- }
19717
- files.push(file);
19718
- totalSize += file.size;
19719
- defer.resolve();
19720
- } catch (e) {
19721
- defer.reject(e);
19722
- }
19723
- }, function (e) {
19724
- defer.reject(e);
19725
- });
19726
- }
19727
- }
19728
- return defer.promise;
19729
- }
19730
-
19731
- var promises = [upload.emptyPromise()];
19732
-
19733
- if (items && items.length > 0 && $window.location.protocol !== 'file:') {
19734
- for (var i = 0; i < items.length; i++) {
19735
- if (items[i].webkitGetAsEntry && items[i].webkitGetAsEntry() && items[i].webkitGetAsEntry().isDirectory) {
19736
- var entry = items[i].webkitGetAsEntry();
19737
- if (entry.isDirectory && !allowDir) {
19738
- continue;
19739
- }
19740
- if (entry != null) {
19741
- promises.push(traverseFileTree(entry));
19742
- }
19743
- } else {
19744
- var f = items[i].getAsFile();
19745
- if (f != null) {
19746
- files.push(f);
19747
- totalSize += f.size;
19748
- }
19749
- }
19750
- if (files.length > maxFiles || totalSize > maxTotalSize ||
19751
- (!multiple && files.length > 0)) break;
19752
- }
19753
- } else {
19754
- if (fileList != null) {
19755
- for (var j = 0; j < fileList.length; j++) {
19756
- var file = fileList.item(j);
19757
- if (file.type || file.size > 0) {
19758
- files.push(file);
19759
- totalSize += file.size;
19760
- }
19761
- if (files.length > maxFiles || totalSize > maxTotalSize ||
19762
- (!multiple && files.length > 0)) break;
19763
- }
19764
- }
19765
- }
19766
-
19767
- var defer = $q.defer();
19768
- $q.all(promises).then(function () {
19769
- if (!multiple && !includeDir && files.length) {
19770
- var i = 0;
19771
- while (files[i] && files[i].type === 'directory') i++;
19772
- defer.resolve([files[i]]);
19773
- } else {
19774
- defer.resolve(files);
19775
- }
19776
- }, function (e) {
19777
- defer.reject(e);
19778
- });
19779
-
19780
- return defer.promise;
19781
- }
19782
- }
19783
-
19784
- function dropAvailable() {
19785
- var div = document.createElement('div');
19786
- return ('draggable' in div) && ('ondrop' in div) && !/Edge\/12./i.test(navigator.userAgent);
19787
- }
19788
-
19789
- })();
19790
-
19791
- ngFileUpload.service('UploadExif', ['UploadResize', '$q', function (UploadResize, $q) {
19792
- var upload = UploadResize;
19793
-
19794
- upload.isExifSupported = function () {
19795
- return window.FileReader && new FileReader().readAsArrayBuffer && upload.isResizeSupported();
19796
- };
19797
-
19798
- function applyTransform(ctx, orientation, width, height) {
19799
- switch (orientation) {
19800
- case 2:
19801
- return ctx.transform(-1, 0, 0, 1, width, 0);
19802
- case 3:
19803
- return ctx.transform(-1, 0, 0, -1, width, height);
19804
- case 4:
19805
- return ctx.transform(1, 0, 0, -1, 0, height);
19806
- case 5:
19807
- return ctx.transform(0, 1, 1, 0, 0, 0);
19808
- case 6:
19809
- return ctx.transform(0, 1, -1, 0, height, 0);
19810
- case 7:
19811
- return ctx.transform(0, -1, -1, 0, height, width);
19812
- case 8:
19813
- return ctx.transform(0, -1, 1, 0, 0, width);
19814
- }
19815
- }
19816
-
19817
- upload.readOrientation = function (file) {
19818
- var defer = $q.defer();
19819
- var reader = new FileReader();
19820
- var slicedFile = file.slice ? file.slice(0, 64 * 1024) : file;
19821
- reader.readAsArrayBuffer(slicedFile);
19822
- reader.onerror = function (e) {
19823
- return defer.reject(e);
19824
- };
19825
- reader.onload = function (e) {
19826
- var result = {orientation: 1};
19827
- var view = new DataView(this.result);
19828
- if (view.getUint16(0, false) !== 0xFFD8) return defer.resolve(result);
19829
-
19830
- var length = view.byteLength,
19831
- offset = 2;
19832
- while (offset < length) {
19833
- var marker = view.getUint16(offset, false);
19834
- offset += 2;
19835
- if (marker === 0xFFE1) {
19836
- if (view.getUint32(offset += 2, false) !== 0x45786966) return defer.resolve(result);
19837
-
19838
- var little = view.getUint16(offset += 6, false) === 0x4949;
19839
- offset += view.getUint32(offset + 4, little);
19840
- var tags = view.getUint16(offset, little);
19841
- offset += 2;
19842
- for (var i = 0; i < tags; i++)
19843
- if (view.getUint16(offset + (i * 12), little) === 0x0112) {
19844
- var orientation = view.getUint16(offset + (i * 12) + 8, little);
19845
- if (orientation >= 2 && orientation <= 8) {
19846
- view.setUint16(offset + (i * 12) + 8, 1, little);
19847
- result.fixedArrayBuffer = e.target.result;
19848
- }
19849
- result.orientation = orientation;
19850
- return defer.resolve(result);
19851
- }
19852
- } else if ((marker & 0xFF00) !== 0xFF00) break;
19853
- else offset += view.getUint16(offset, false);
19854
- }
19855
- return defer.resolve(result);
19856
- };
19857
- return defer.promise;
19858
- };
19859
-
19860
- function arrayBufferToBase64(buffer) {
19861
- var binary = '';
19862
- var bytes = new Uint8Array(buffer);
19863
- var len = bytes.byteLength;
19864
- for (var i = 0; i < len; i++) {
19865
- binary += String.fromCharCode(bytes[i]);
19866
- }
19867
- return window.btoa(binary);
19868
- }
19869
-
19870
- upload.applyExifRotation = function (file) {
19871
- if (file.type.indexOf('image/jpeg') !== 0) {
19872
- return upload.emptyPromise(file);
19873
- }
19874
-
19875
- var deferred = $q.defer();
19876
- upload.readOrientation(file).then(function (result) {
19877
- if (result.orientation < 2 || result.orientation > 8) {
19878
- return deferred.resolve(file);
19879
- }
19880
- upload.dataUrl(file, true).then(function (url) {
19881
- var canvas = document.createElement('canvas');
19882
- var img = document.createElement('img');
19883
-
19884
- img.onload = function () {
19885
- try {
19886
- canvas.width = result.orientation > 4 ? img.height : img.width;
19887
- canvas.height = result.orientation > 4 ? img.width : img.height;
19888
- var ctx = canvas.getContext('2d');
19889
- applyTransform(ctx, result.orientation, img.width, img.height);
19890
- ctx.drawImage(img, 0, 0);
19891
- var dataUrl = canvas.toDataURL(file.type || 'image/WebP', 0.934);
19892
- dataUrl = upload.restoreExif(arrayBufferToBase64(result.fixedArrayBuffer), dataUrl);
19893
- var blob = upload.dataUrltoBlob(dataUrl, file.name);
19894
- deferred.resolve(blob);
19895
- } catch (e) {
19896
- return deferred.reject(e);
19897
- }
19898
- };
19899
- img.onerror = function () {
19900
- deferred.reject();
19901
- };
19902
- img.src = url;
19903
- }, function (e) {
19904
- deferred.reject(e);
19905
- });
19906
- }, function (e) {
19907
- deferred.reject(e);
19908
- });
19909
- return deferred.promise;
19910
- };
19911
-
19912
- upload.restoreExif = function (orig, resized) {
19913
- var ExifRestorer = {};
19914
-
19915
- ExifRestorer.KEY_STR = 'ABCDEFGHIJKLMNOP' +
19916
- 'QRSTUVWXYZabcdef' +
19917
- 'ghijklmnopqrstuv' +
19918
- 'wxyz0123456789+/' +
19919
- '=';
19920
-
19921
- ExifRestorer.encode64 = function (input) {
19922
- var output = '',
19923
- chr1, chr2, chr3 = '',
19924
- enc1, enc2, enc3, enc4 = '',
19925
- i = 0;
19926
-
19927
- do {
19928
- chr1 = input[i++];
19929
- chr2 = input[i++];
19930
- chr3 = input[i++];
19931
-
19932
- enc1 = chr1 >> 2;
19933
- enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
19934
- enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
19935
- enc4 = chr3 & 63;
19936
-
19937
- if (isNaN(chr2)) {
19938
- enc3 = enc4 = 64;
19939
- } else if (isNaN(chr3)) {
19940
- enc4 = 64;
19941
- }
19942
-
19943
- output = output +
19944
- this.KEY_STR.charAt(enc1) +
19945
- this.KEY_STR.charAt(enc2) +
19946
- this.KEY_STR.charAt(enc3) +
19947
- this.KEY_STR.charAt(enc4);
19948
- chr1 = chr2 = chr3 = '';
19949
- enc1 = enc2 = enc3 = enc4 = '';
19950
- } while (i < input.length);
19951
-
19952
- return output;
19953
- };
19954
-
19955
- ExifRestorer.restore = function (origFileBase64, resizedFileBase64) {
19956
- if (origFileBase64.match('data:image/jpeg;base64,')) {
19957
- origFileBase64 = origFileBase64.replace('data:image/jpeg;base64,', '');
19958
- }
19959
-
19960
- var rawImage = this.decode64(origFileBase64);
19961
- var segments = this.slice2Segments(rawImage);
19962
-
19963
- var image = this.exifManipulation(resizedFileBase64, segments);
19964
-
19965
- return 'data:image/jpeg;base64,' + this.encode64(image);
19966
- };
19967
-
19968
-
19969
- ExifRestorer.exifManipulation = function (resizedFileBase64, segments) {
19970
- var exifArray = this.getExifArray(segments),
19971
- newImageArray = this.insertExif(resizedFileBase64, exifArray);
19972
- return new Uint8Array(newImageArray);
19973
- };
19974
-
19975
-
19976
- ExifRestorer.getExifArray = function (segments) {
19977
- var seg;
19978
- for (var x = 0; x < segments.length; x++) {
19979
- seg = segments[x];
19980
- if (seg[0] === 255 & seg[1] === 225)
19981
- {
19982
- return seg;
19983
- }
19984
- }
19985
- return [];
19986
- };
19987
-
19988
-
19989
- ExifRestorer.insertExif = function (resizedFileBase64, exifArray) {
19990
- var imageData = resizedFileBase64.replace('data:image/jpeg;base64,', ''),
19991
- buf = this.decode64(imageData),
19992
- separatePoint = buf.indexOf(255, 3),
19993
- mae = buf.slice(0, separatePoint),
19994
- ato = buf.slice(separatePoint),
19995
- array = mae;
19996
-
19997
- array = array.concat(exifArray);
19998
- array = array.concat(ato);
19999
- return array;
20000
- };
20001
-
20002
-
20003
- ExifRestorer.slice2Segments = function (rawImageArray) {
20004
- var head = 0,
20005
- segments = [];
20006
-
20007
- while (1) {
20008
- if (rawImageArray[head] === 255 & rawImageArray[head + 1] === 218) {
20009
- break;
20010
- }
20011
- if (rawImageArray[head] === 255 & rawImageArray[head + 1] === 216) {
20012
- head += 2;
20013
- }
20014
- else {
20015
- var length = rawImageArray[head + 2] * 256 + rawImageArray[head + 3],
20016
- endPoint = head + length + 2,
20017
- seg = rawImageArray.slice(head, endPoint);
20018
- segments.push(seg);
20019
- head = endPoint;
20020
- }
20021
- if (head > rawImageArray.length) {
20022
- break;
20023
- }
20024
- }
20025
-
20026
- return segments;
20027
- };
20028
-
20029
-
20030
- ExifRestorer.decode64 = function (input) {
20031
- var chr1, chr2, chr3 = '',
20032
- enc1, enc2, enc3, enc4 = '',
20033
- i = 0,
20034
- buf = [];
20035
-
20036
- var base64test = /[^A-Za-z0-9\+\/\=]/g;
20037
- if (base64test.exec(input)) {
20038
- console.log('There were invalid base64 characters in the input text.\n' +
20039
- 'Valid base64 characters are A-Z, a-z, 0-9, ' + ', ' / ',and "="\n' +
20040
- 'Expect errors in decoding.');
20041
- }
20042
- input = input.replace(/[^A-Za-z0-9\+\/\=]/g, '');
20043
-
20044
- do {
20045
- enc1 = this.KEY_STR.indexOf(input.charAt(i++));
20046
- enc2 = this.KEY_STR.indexOf(input.charAt(i++));
20047
- enc3 = this.KEY_STR.indexOf(input.charAt(i++));
20048
- enc4 = this.KEY_STR.indexOf(input.charAt(i++));
20049
-
20050
- chr1 = (enc1 << 2) | (enc2 >> 4);
20051
- chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
20052
- chr3 = ((enc3 & 3) << 6) | enc4;
20053
-
20054
- buf.push(chr1);
20055
-
20056
- if (enc3 !== 64) {
20057
- buf.push(chr2);
20058
- }
20059
- if (enc4 !== 64) {
20060
- buf.push(chr3);
20061
- }
20062
-
20063
- chr1 = chr2 = chr3 = '';
20064
- enc1 = enc2 = enc3 = enc4 = '';
20065
-
20066
- } while (i < input.length);
20067
-
20068
- return buf;
20069
- };
20070
-
20071
- return ExifRestorer.restore(orig, resized);
20072
- };
20073
-
20074
- return upload;
20075
- }]);
20076
-
20077
-
20078
- },{}],44:[function(require,module,exports){
20079
- require('./dist/ng-file-upload-all');
20080
- module.exports = 'ngFileUpload';
20081
- },{"./dist/ng-file-upload-all":43}]},{},[37]);
20082
-
20083
- angular.element(document).ready(function() {
20084
- angular.bootstrap(document.getElementById('jpibfi-container'), ['jpibfi']);
20085
- window.angular = existingWindowDotAngular;
20086
- });
20087
- })()
1
+ !function e(t,n,r){function o(i,s){if(!n[i]){if(!t[i]){var u="function"==typeof require&&require;if(!s&&u)return u(i,!0);if(a)return a(i,!0);var c=new Error("Cannot find module '"+i+"'");throw c.code="MODULE_NOT_FOUND",c}var l=n[i]={exports:{}};t[i][0].call(l.exports,function(e){var n=t[i][1][e];return o(n?n:e)},l,l.exports,e,t,n,r)}return n[i].exports}for(var a="function"==typeof require&&require,i=0;i<r.length;i++)o(r[i]);return o}({1:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(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)}Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=e("react"),c=r(u),l=e("./Components/Navbar"),d=r(l),p=e("./Components/SelectEditor"),f=r(p),h=e("./Components/VisualEditor"),v=r(h),m=e("./Components/AdvancedEditor"),g=r(m),y=e("./Components/ImportExportEditor"),b=r(y),_=function(e){function t(){o(this,t);var e=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.state={config:null},e.renderLicenseTab=e.renderLicenseTab.bind(e),e.renderTab=e.renderTab.bind(e),e.renderSubmitButton=e.renderSubmitButton.bind(e),e}return i(t,e),s(t,[{key:"componentDidMount",value:function(){this.setState({config:window.jpibfi_settings})}},{key:"isCurrentTabIn",value:function(e){var t=this;return e.some(function(e){return t.state.config.currentTab===e})}},{key:"isCurrentTabEqualTo",value:function(e){return this.isCurrentTabIn([e])}},{key:"render",value:function(){if(!this.state.config)return null;var e=this.state.config,t={tabs:e.tabs,page:e.page,currentTab:e.currentTab,links:e.links};return c["default"].createElement("div",{id:"foo"},c["default"].createElement(d["default"],t),c["default"].createElement("form",{method:"POST",encType:"multipart/form-data",id:"jpibfi-form",action:e.save.post_url},c["default"].createElement("input",{name:e.save.action,value:e.save.nonce,type:"hidden"}),c["default"].createElement("input",{name:e.save.tab,value:e.currentTab,type:"hidden"}),this.renderTab(f["default"],"select"),this.renderTab(v["default"],"visual"),this.renderTab(g["default"],"advanced"),this.renderTab(b["default"],"import"),this.renderLicenseTab(),this.renderSubmitButton()))}},{key:"renderTab",value:function(e,t){if(!this.isCurrentTabEqualTo(t))return null;var n=this.state.config,r=n.settings,o=n.i18n;return c["default"].createElement(e,{settings:r,i18n:o.editor})}},{key:"renderSubmitButton",value:function(){return this.isCurrentTabIn(["select","visual","advanced"])?c["default"].createElement("input",{type:"submit",className:"button button-primary",value:this.state.config.save.submit}):null}},{key:"renderLicenseTab",value:function(){return null}}]),t}(u.Component);n["default"]=_},{"./Components/AdvancedEditor":2,"./Components/ImportExportEditor":3,"./Components/Navbar":4,"./Components/SelectEditor":5,"./Components/VisualEditor":7,react:359}],2:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(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)}function s(e){var t=e.name,n=e.priority,r=e.template,o=[{tag:"%name%",editor:l["default"].createElement(d.CheckboxEditor,{key:"name",args:t})},{tag:"%priority%",editor:l["default"].createElement(d.LabeledNumberEditor,{key:"priority",args:n,step:"1"})}];return l["default"].createElement(d.Templated,{items:o,template:r})}Object.defineProperty(n,"__esModule",{value:!0});var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),c=e("react"),l=r(c),d=e("./helpers"),p=function(e){function t(){return o(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return i(t,e),u(t,[{key:"render",value:function(){var e=this.props,t=e.settings,n=e.i18n;return l["default"].createElement("div",null,l["default"].createElement("h2",null,e.i18n.title),l["default"].createElement("table",{className:"form-table"},l["default"].createElement("tbody",null,l["default"].createElement("tr",null,l["default"].createElement("th",null,n.filters_label),l["default"].createElement("td",null,l["default"].createElement(s,{name:t.filter_the_content_on,priority:t.filter_the_content_priority,template:n.filter_template}),l["default"].createElement(s,{name:t.filter_the_excerpt_on,priority:t.filter_the_excerpt_priority,template:n.filter_template}),l["default"].createElement(s,{name:t.filter_post_thumbnail_html_on,priority:t.filter_post_thumbnail_html_priority,template:n.filter_template}),l["default"].createElement(d.Description,{text:n.filters_description}))),this.renderScrollSelectionSetting())))}},{key:"renderScrollSelectionSetting",value:function(){this.props.settings;return null}}]),t}(c.Component);n["default"]=p},{"./helpers":8,react:359}],3:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(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)}Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=e("react"),c=r(u),l=(e("./helpers"),function(e){function t(){return o(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return i(t,e),s(t,[{key:"onUpload",value:function(){document.getElementById("jpibfi-form").submit()}},{key:"render",value:function(){var e=this.props,t=(e.settings,e.i18n);return c["default"].createElement("div",null,c["default"].createElement("h2",null,t.title),c["default"].createElement("table",{className:"form-table"},c["default"].createElement("tbody",null,c["default"].createElement("tr",null,c["default"].createElement("th",null,c["default"].createElement("label",null,t.export_title)),c["default"].createElement("td",null,c["default"].createElement("a",{href:t.export_url,className:"button button-default"},t.export_button_text))),c["default"].createElement("tr",null,c["default"].createElement("th",null,c["default"].createElement("label",null,t.import_title)),c["default"].createElement("td",null,c["default"].createElement("input",{type:"file",name:"import",onChange:this.onUpload,accept:".json"}))))))}}]),t}(u.Component));n["default"]=l},{"./helpers":8,react:359}],4:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){return i["default"].createElement("h2",{className:"nav-tab-wrapper"},e.tabs.map(function(t){return i["default"].createElement("a",{key:t.slug,href:"?page="+e.page+"&tab="+t.slug,className:"nav-tab "+(e.currentTab===t.slug&&"nav-tab-active")},t.name)}),e.links.map(function(e){return i["default"].createElement("a",{key:e.url,target:"_blank",className:"nav-tab",href:e.url},e.label)}))}Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=o;var a=e("react"),i=r(a)},{react:359}],5:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(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)}function s(e){var t=e.height,n=e.width,r=e.template,o=[{tag:"%height%",editor:l["default"].createElement(d.NumberEditor,{key:"height",args:t,step:"1",min:"0"})},{tag:"%width%",editor:l["default"].createElement(d.NumberEditor,{key:"width",args:n,step:"1",min:"0"})}];return l["default"].createElement(d.Templated,{items:o,template:r})}Object.defineProperty(n,"__esModule",{value:!0});var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),c=e("react"),l=r(c),d=e("./helpers"),p=function(e){function t(){return o(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return i(t,e),u(t,[{key:"render",value:function(){var e=this.props,t=e.settings,n=e.i18n;return l["default"].createElement("div",null,l["default"].createElement("h2",null,n.title),l["default"].createElement("table",{className:"form-table"},l["default"].createElement("tbody",null,l["default"].createElement(d.TableRow,{Editor:d.TextareaEditor,setting:t.image_selector}),l["default"].createElement(d.TableRow,{Editor:d.TextEditor,setting:t.disabled_classes}),l["default"].createElement(d.TableRow,{Editor:d.TextEditor,setting:t.enabled_classes}),l["default"].createElement("tr",null,l["default"].createElement("th",null,n.image_resolution_label),l["default"].createElement("td",null,l["default"].createElement(s,{height:t.min_image_height_small,width:t.min_image_width_small,template:n.min_resolution_template_small}),l["default"].createElement(s,{height:t.min_image_height,width:t.min_image_width,template:n.min_resolution_template}),l["default"].createElement(d.Description,{text:n.image_resolution_desc}),l["default"].createElement(d.Description,{text:n.image_resolution_desc_2}))),l["default"].createElement("tr",null,l["default"].createElement("th",null,n.show_on_field_label),l["default"].createElement("td",null,l["default"].createElement("p",null,l["default"].createElement("label",{htmlFor:"show_on"},t.show_on.label,":"),l["default"].createElement("br",null),l["default"].createElement(d.TextareaEditor,{args:t.show_on})),l["default"].createElement("p",null,l["default"].createElement("label",{htmlFor:"disable_on"},t.disable_on.label,":"),l["default"].createElement("br",null),l["default"].createElement(d.TextareaEditor,{args:t.disable_on})),l["default"].createElement(d.Description,{text:n.show_on_field_desc}))))))}}]),t}(c.Component);n["default"]=p},{"./helpers":8,react:359}],6:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(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)}Object.defineProperty(n,"__esModule",{value:!0}),n.SortableItem=void 0;var u,c,l,d,p,f,h=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},v=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),m=e("react"),g=r(m),y=e("react-dnd"),b=e("react-dnd-html5-backend"),_=r(b),E="ListItem",O={beginDrag:function(e){var t=e.item.key,n=e.findItem;return{key:t,originalIndex:n(t).index}},endDrag:function(e,t){var n=t.getItem(),r=n.key,o=n.originalIndex;t.didDrop()||e.moveCard(r,o)}},C={canDrop:function(){return!1},hover:function(e,t){var n=e.item,r=e.findItem,o=e.moveItem,a=t.getItem(),i=a.key,s=n.key;if(i!==s){var u=r(s),c=u.index;o(i,c)}}},D=n.SortableItem=(u=(0,y.DropTarget)(E,C,function(e){return{connectDropTarget:e.dropTarget()}}),c=(0,y.DragSource)(E,O,function(e,t){return{connectDragSource:e.dragSource(),isDragging:t.isDragging()}}),u(l=c(l=function(e){function t(){return a(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return s(t,e),v(t,[{key:"render",value:function(){var e=this.props,t=e.item,n=e.isDragging,r=e.connectDragSource,o=e.connectDropTarget,a=e.changeSelected,i=n?0:1;return r(o(g["default"].createElement("li",{style:{opacity:i}},g["default"].createElement("input",{type:"checkbox",id:t.key,defaultChecked:t.selected,onChange:function(){return a(t.key)}}),g["default"].createElement("label",{htmlFor:t.key},t.label))))}}]),t}(m.Component))||l)||l),N={drop:function(){}},w=(d=(0,y.DragDropContext)(_["default"]),p=(0,y.DropTarget)(E,N,function(e){return{connectDropTarget:e.dropTarget()}}),d(f=p(f=function(e){function t(e){a(this,t);var n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));n.changeSelected=n.changeSelected.bind(n),n.moveItem=n.moveItem.bind(n),n.findItem=n.findItem.bind(n);var r=e.args,o=r.value.slice().concat(Object.keys(r.options).filter(function(e){return r.value.indexOf(e)===-1}));return n.state={items:o.map(function(e){return{key:e,label:r.options[e],selected:r.value.indexOf(e)!==-1}})},n}return s(t,e),v(t,[{key:"changeSelected",value:function(e){this.setState({items:this.state.items.map(function(t){return t.key==e?h({},t,{selected:!t.selected}):t})})}},{key:"moveItem",value:function(e,t){var n=this.findItem(e),r=n.item,a=(n.index,this.state.items.filter(function(e){return e.key!=r.key}));a=[].concat(o(a.slice(0,t)),[r],o(a.slice(t))),this.setState({items:a})}},{key:"findItem",value:function(e){var t=this.state.items,n=t.filter(function(t){return t.key===e})[0];return{item:n,index:t.indexOf(n)}}},{key:"render",value:function(){var e=this,t=this.props,n=t.connectDropTarget,r=t.args,o=this.state.items,a=o.reduce(function(e,t){return t.selected?e.concat([t.key]):e},[]);return n(g["default"].createElement("div",null,g["default"].createElement("input",{type:"hidden",name:r.key,value:a}),g["default"].createElement("ul",{className:"frizzly-sortable"},o.map(function(t,n){return g["default"].createElement(D,{key:t.key,item:t,moveItem:e.moveItem,findItem:e.findItem,changeSelected:e.changeSelected})}))))}}]),t}(m.Component))||f)||f);n["default"]=w},{react:359,"react-dnd":198,"react-dnd-html5-backend":183}],7:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(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)}Object.defineProperty(n,"__esModule",{value:!0});var u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=e("react"),d=r(l),p=e("./helpers"),f=e("./SortableEditor"),h=r(f),v=function(e){function t(e){a(this,t);var n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),r=Object.keys(e.settings).reduce(function(t,n){return u(t,o({},n,e.settings[n].value))},{});return n.state=u({},r,{ui:{marginAvailability:{top:!0,bottom:!0,left:!0,right:!0}}}),n.fileFrame=null,n.buttonPositionChanged=n.buttonPositionChanged.bind(n),n.changeValue=n.changeValue.bind(n),n.upload=n.upload.bind(n),n}return s(t,e),c(t,[{key:"componentDidMount",value:function(){this.buttonPositionChanged(this.props.settings.button_position.value)}},{key:"buttonPositionChanged",value:function(e){this.setState({ui:{marginAvailability:{top:"top-left"===e||"top-right"===e,bottom:"bottom-left"===e||"bottom-right"===e,left:"top-left"===e||"bottom-left"===e,right:"top-right"===e||"bottom-right"===e}}})}},{key:"changeValue",value:function(e,t){this.setState(o({},e,t)),this.props.settings[e]&&(this.props.settings[e].value=t)}},{key:"upload",value:function(){var e=this;return this.fileFrame?void this.fileFrame.open():(this.fileFrame=wp.media.frames.file_frame=wp.media({title:this.props.i18n.custom_button_frame_title,button:{text:this.props.i18n.custom_button_frame_button_text},multiple:!1}).on("select",function(){var t=e.fileFrame.state().get("selection").first().toJSON();e.changeValue("custom_image_url",t.url),e.changeValue("custom_image_width",t.width),e.changeValue("custom_image_height",t.height)}),void this.fileFrame.open())}},{key:"render",value:function(){var e=this,t=this.props,n=t.settings,r=t.i18n,o=this.state.ui.marginAvailability;return d["default"].createElement("div",null,d["default"].createElement("h2",null,r.title),d["default"].createElement("table",{className:"form-table"},d["default"].createElement("tbody",null,d["default"].createElement("tr",null,d["default"].createElement("th",null,d["default"].createElement("label",{htmlFor:"show_button"},n.show_button.label)),d["default"].createElement("td",null,d["default"].createElement(p.SelectEditor,{args:n.show_button,onChange:function(t){return e.changeValue("show_button",t.target.value)}}),d["default"].createElement(p.Description,{text:n.show_button.desc}),this.renderShowButtonError())),d["default"].createElement("tr",null,d["default"].createElement("th",null,d["default"].createElement("label",null,n.description_option.label)),d["default"].createElement("td",null,d["default"].createElement(h["default"],{args:n.description_option}),d["default"].createElement(p.Description,{text:n.description_option.desc}))),d["default"].createElement(p.TableRow,{Editor:p.CheckboxEditor,setting:n.pinLinkedImages}),d["default"].createElement(p.TableRow,{Editor:p.NumberEditor,setting:n.transparency_value,min:"0",max:"1",step:"0.01"}),d["default"].createElement("tr",null,d["default"].createElement("th",null,d["default"].createElement("label",null,n.pin_image.label)),d["default"].createElement("td",null,d["default"].createElement("table",{className:"jpibfi-inner-table"},d["default"].createElement("tbody",null,d["default"].createElement("tr",null,d["default"].createElement("th",null,r.mode),"old_default"!==n.pin_image&&d["default"].createElement("th",null,r.settings),d["default"].createElement("th",null,r.preview)),d["default"].createElement("tr",null,d["default"].createElement("td",null,Object.keys(n.pin_image.options).map(function(t){return d["default"].createElement("p",{key:t},d["default"].createElement("label",null,d["default"].createElement("input",{type:"radio",name:n.pin_image.key,value:t,checked:t===e.state.pin_image,onChange:function(t){return e.changeValue("pin_image",t.target.value)}}),n.pin_image.options[t]))})),d["default"].createElement("td",null,"default"===this.state.pin_image&&this.renderDefaultIconSettings(),"custom"===this.state.pin_image&&this.renderCustomIconSettings()),this.renderIconPreview()))))),d["default"].createElement(p.TableRow,{Editor:p.SelectEditor,setting:n.button_position,onChange:function(t){return e.buttonPositionChanged(t.target.value)}}),d["default"].createElement("tr",null,d["default"].createElement("th",null,d["default"].createElement("label",null,r.margins_label)),d["default"].createElement("td",null,d["default"].createElement("p",null,d["default"].createElement("label",{htmlFor:"button_margin_top"},n.button_margin_top.label),d["default"].createElement(p.LabeledNumberEditor,{disabled:!o.top,args:n.button_margin_top})),d["default"].createElement("p",null,d["default"].createElement("label",{htmlFor:"button_margin_bottom"},n.button_margin_bottom.label),d["default"].createElement(p.LabeledNumberEditor,{disabled:!o.bottom,args:n.button_margin_bottom})),d["default"].createElement("p",null,d["default"].createElement("label",{htmlFor:"button_margin_left"},n.button_margin_left.label),d["default"].createElement(p.LabeledNumberEditor,{disabled:!o.left,args:n.button_margin_left})),d["default"].createElement("p",null,d["default"].createElement("label",{htmlFor:"button_margin_right"},n.button_margin_right.label),d["default"].createElement(p.LabeledNumberEditor,{disabled:!o.right,args:n.button_margin_right})),d["default"].createElement(p.Description,{text:r.margins_desc}))))),d["default"].createElement("p",{dangerouslySetInnerHTML:{__html:r.attribution}}))}},{key:"renderDefaultIconSettings",value:function(){var e=this,t=this.props,n=t.settings,r=t.i18n,o=function(){return null};return o=function(){return"circle"!==e.state.pin_image_icon?d["default"].createElement("p",null,d["default"].createElement("b",{dangerouslySetInnerHTML:{__html:r.pro_feature_error}})):null},d["default"].createElement("div",null,d["default"].createElement("p",null,d["default"].createElement("label",{htmlFor:"pin_image_icon"},n.pin_image_icon.label),d["default"].createElement(p.SelectEditor,{args:n.pin_image_icon,onChange:function(t){return e.changeValue("pin_image_icon",t.target.value)}}),o()),d["default"].createElement("p",null,d["default"].createElement("label",{htmlFor:"pin_image_size"},n.pin_image_size.label),d["default"].createElement(p.SelectEditor,{args:n.pin_image_size,onChange:function(t){return e.changeValue("pin_image_size",t.target.value)}})),d["default"].createElement("p",null,d["default"].createElement("label",{htmlFor:"pin_image_button"},n.pin_image_button.label),d["default"].createElement(p.SelectEditor,{args:n.pin_image_button,onChange:function(t){return e.changeValue("pin_image_button",t.target.value)}})))}},{key:"renderCustomIconSettings",value:function(){var e=this,t=this.props,n=t.settings,r=t.i18n;return d["default"].createElement("div",null,d["default"].createElement("p",null,d["default"].createElement("button",{type:"button",className:"button button-default",onClick:this.upload},r.custom_button_upload)),d["default"].createElement("p",null,d["default"].createElement("label",{htmlFor:"custom_image_url"},n.custom_image_url.label),d["default"].createElement(p.TextEditor,{args:n.custom_image_url,onChange:function(t){return e.changeValue("custom_image_url",t.event.target)}})),d["default"].createElement("p",null,d["default"].createElement("div",{style:"display: inline-block; width: 49%;"},d["default"].createElement("label",{htmlFor:"custom_image_height"},n.custom_image_height.label),d["default"].createElement(p.NumberEditor,{args:n.custom_image_height,onChange:function(t){return e.changeValue("custom_image_height",t.event.target)}})),d["default"].createElement("div",{style:"display: inline-block; width: 49%;"},d["default"].createElement("label",{htmlFor:"custom_image_width"},n.custom_image_width.label),d["default"].createElement(p.NumberEditor,{args:n.custom_image_width,onChange:function(t){return e.changeValue("custom_image_width",t.event.target)}}))),d["default"].createElement(p.Description,{dangerouslySetInnerHTML:{__html:r.custom_button_desc}}))}},{key:"renderIconPreview",value:function(){var e=this.props.i18n,t=this.state,n=t.pin_image,r=t.pin_image_size,o=t.pin_image_button,a=t.pin_image_icon,i=t.custom_image_url,s=t.custom_image_width,u=t.custom_image_height;return d["default"].createElement("td",null,"old_default"===n&&d["default"].createElement("div",null,d["default"].createElement("a",{className:"pinit-button old_default"},d["default"].createElement("span",null))),"default"===n&&d["default"].createElement("div",null,d["default"].createElement("a",{className:"pinit-button default jpibfi-size-"+r+" jpibfi-button-"+o},d["default"].createElement("span",{className:"jpibfi-icon-"+a}))),"custom"===n&&i&&d["default"].createElement("div",null,d["default"].createElement("div",{style:"width: "+s+"px;\n height: "+u+"px;\n background-image: url('"+i+"');\""})),"custom"===n&&!i&&d["default"].createElement("div",{dangerouslySetInnerHTML:{__html:e.custom_button_no_image_to_preview}}))}},{key:"renderShowButtonError",value:function(){return"hover"!==this.state.show_button?d["default"].createElement("p",null,d["default"].createElement("b",{dangerouslySetInnerHTML:{__html:this.props.i18n.pro_feature_error}})):null}}]),t}(l.Component);n["default"]=v},{"./SortableEditor":6,"./helpers":8,react:359}],8:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function a(e){var t=e.text;return m["default"].createElement("p",{className:"description",dangerouslySetInnerHTML:{__html:t}})}function i(e){var t=e.Editor,n=e.setting,r=o(e,["Editor","setting"]);return m["default"].createElement("tr",null,m["default"].createElement("th",null,m["default"].createElement("label",{htmlFor:n.key},n.label)),m["default"].createElement("td",null,m["default"].createElement(t,h({args:n},r)),m["default"].createElement(a,{text:n.desc})))}function s(e){var t=e.template,n=e.items,r=t.split(" ").reduce(function(e,t){if(n.every(function(e){return e.tag!==t}))return e.concat([t+" "]);var r=n.filter(function(e){return e.tag===t})[0];return e.concat([r.editor," "])},[]).reduce(function(e,t){return 0===e.length?[t]:"string"==typeof t&&"string"==typeof e[e.length-1]?e.slice(0,e.length-1).concat([e[e.length-1]+t]):e.concat(t)},[]);return m["default"].createElement("p",[],r)}function u(e){var t=e.args,n=e.className,r=void 0===n?"regular-text":n,a=o(e,["args","className"]);return m["default"].createElement("input",h({type:"text",defaultValue:t.value,className:r},a,{placeholder:t.placeholder||"",name:t.key,id:t.key}))}function c(e){var t=e.args,n=o(e,["args"]);return m["default"].createElement("textarea",h({rows:"3",cols:"50",className:"large-text code",defaultValue:t.value},n,{id:t.key,name:t.key}))}function l(e){var t=e.args,n=o(e,["args"]);return m["default"].createElement("input",h({type:"number",className:"small-text",defaultValue:t.value},n,{id:t.key,name:t.key}))}function d(e){var t=e.args,n=o(e,["args"]);return m["default"].createElement("label",{htmlFor:t.key},t.text,m["default"].createElement(l,h({args:t},n)),t.unit)}function p(e){var t=e.args,n=o(e,["args"]);return m["default"].createElement("select",h({name:t.key,id:t.key},n,{defaultValue:t.value}),Object.keys(t.options).map(function(e){return m["default"].createElement("option",{key:e,value:e},t.options[e])}))}function f(e){var t=e.args;o(e,["args"]);return m["default"].createElement("span",null,m["default"].createElement("input",{type:"checkbox",name:t.key,id:t.key,defaultChecked:t.value}),m["default"].createElement("label",{htmlFor:t.key},t.text),t.tooltip&&m["default"].createElement("span",{tooltips:!0,"tooltip-template":t.tooltip,className:"dashicons dashicons-editor-help"}),t.addBr&&m["default"].createElement("br",null))}Object.defineProperty(n,"__esModule",{value:!0});var h=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};n.Description=a,n.TableRow=i,n.Templated=s,n.TextEditor=u,n.TextareaEditor=c,n.NumberEditor=l,n.LabeledNumberEditor=d,n.SelectEditor=p,n.CheckboxEditor=f;var v=e("react"),m=r(v)},{react:359}],9:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}var o=e("react"),a=r(o),i=e("react-dom"),s=e("./app/App"),u=r(s);jQuery(document).ready(function(){(0,i.render)(a["default"].createElement(u["default"],null),document.getElementById("jpibfi-container"))})},{"./app/App":1,react:359,"react-dom":207}],10:[function(e,t,n){"use strict";function r(){if(u.length)throw u.shift()}function o(e){var t;t=s.length?s.pop():new a,t.task=e,i(t)}function a(){this.task=null}var i=e("./raw"),s=[],u=[],c=i.makeRequestCallFromTimer(r);t.exports=o,a.prototype.call=function(){try{this.task.call()}catch(e){o.onerror?o.onerror(e):(u.push(e),c())}finally{this.task=null,s[s.length]=this}}},{"./raw":11}],11:[function(e,t,n){(function(e){"use strict";function n(e){s.length||(i(),u=!0),s[s.length]=e}function r(){for(;c<s.length;){var e=c;if(c+=1,s[e].call(),c>l){for(var t=0,n=s.length-c;t<n;t++)s[t]=s[t+c];s.length-=c,c=0}}s.length=0,c=0,u=!1}function o(e){var t=1,n=new p(e),r=document.createTextNode("");return n.observe(r,{characterData:!0}),function(){t=-t,r.data=t}}function a(e){return function(){function t(){clearTimeout(n),clearInterval(r),e()}var n=setTimeout(t,0),r=setInterval(t,50)}}t.exports=n;var i,s=[],u=!1,c=0,l=1024,d="undefined"!=typeof e?e:self,p=d.MutationObserver||d.WebKitMutationObserver;i="function"==typeof p?o(r):a(r),n.requestFlush=i,n.makeRequestCallFromTimer=a}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],12:[function(e,t,n){(function(n){"use strict";function r(e){return e}function o(e,t,o){function d(e,t,r){for(var o in t)t.hasOwnProperty(o)&&"production"!==n.env.NODE_ENV&&u("function"==typeof t[o],"%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.",e.displayName||"ReactClass",c[r],o)}function p(e,t){var n=O.hasOwnProperty(t)?O[t]:null;w.hasOwnProperty(t)&&s("OVERRIDE_BASE"===n,"ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.",t),e&&s("DEFINE_MANY"===n||"DEFINE_MANY_MERGED"===n,"ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",t)}function f(e,r){if(r){s("function"!=typeof r,"ReactClass: You're attempting to use a component class or function as a mixin. Instead, just use a regular object."),s(!t(r),"ReactClass: You're attempting to use a component as a mixin. Instead, just use a regular object.");
2
+ var o=e.prototype,a=o.__reactAutoBindPairs;r.hasOwnProperty(l)&&C.mixins(e,r.mixins);for(var i in r)if(r.hasOwnProperty(i)&&i!==l){var c=r[i],d=o.hasOwnProperty(i);if(p(d,i),C.hasOwnProperty(i))C[i](e,c);else{var f=O.hasOwnProperty(i),h="function"==typeof c,v=h&&!f&&!d&&r.autobind!==!1;if(v)a.push(i,c),o[i]=c;else if(d){var y=O[i];s(f&&("DEFINE_MANY_MERGED"===y||"DEFINE_MANY"===y),"ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.",y,i),"DEFINE_MANY_MERGED"===y?o[i]=m(o[i],c):"DEFINE_MANY"===y&&(o[i]=g(o[i],c))}else o[i]=c,"production"!==n.env.NODE_ENV&&"function"==typeof c&&r.displayName&&(o[i].displayName=r.displayName+"_"+i)}}}else if("production"!==n.env.NODE_ENV){var b=typeof r,_="object"===b&&null!==r;"production"!==n.env.NODE_ENV&&u(_,"%s: You're attempting to include a mixin that is either null or not an object. Check the mixins included by the component, as well as any mixins they include themselves. Expected object but got %s.",e.displayName||"ReactClass",null===r?null:b)}}function h(e,t){if(t)for(var n in t){var r=t[n];if(t.hasOwnProperty(n)){var o=n in C;s(!o,'ReactClass: You are attempting to define a reserved property, `%s`, that shouldn\'t be on the "statics" key. Define it as an instance property instead; it will still be accessible on the constructor.',n);var a=n in e;s(!a,"ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",n),e[n]=r}}}function v(e,t){s(e&&t&&"object"==typeof e&&"object"==typeof t,"mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.");for(var n in t)t.hasOwnProperty(n)&&(s(void 0===e[n],"mergeIntoWithNoDuplicateKeys(): Tried to merge two objects with the same key: `%s`. This conflict may be due to a mixin; in particular, this may be caused by two getInitialState() or getDefaultProps() methods returning objects with clashing keys.",n),e[n]=t[n]);return e}function m(e,t){return function(){var n=e.apply(this,arguments),r=t.apply(this,arguments);if(null==n)return r;if(null==r)return n;var o={};return v(o,n),v(o,r),o}}function g(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function y(e,t){var r=t.bind(e);if("production"!==n.env.NODE_ENV){r.__reactBoundContext=e,r.__reactBoundMethod=t,r.__reactBoundArguments=null;var o=e.constructor.displayName,a=r.bind;r.bind=function(i){for(var s=arguments.length,c=Array(s>1?s-1:0),l=1;l<s;l++)c[l-1]=arguments[l];if(i!==e&&null!==i)"production"!==n.env.NODE_ENV&&u(!1,"bind(): React component methods may only be bound to the component instance. See %s",o);else if(!c.length)return"production"!==n.env.NODE_ENV&&u(!1,"bind(): You are binding a component method to the component. React does this for you automatically in a high-performance way, so you can safely remove this call. See %s",o),r;var d=a.apply(r,arguments);return d.__reactBoundContext=e,d.__reactBoundMethod=t,d.__reactBoundArguments=c,d}}return r}function b(e){for(var t=e.__reactAutoBindPairs,n=0;n<t.length;n+=2){var r=t[n],o=t[n+1];e[r]=y(e,o)}}function _(e){var t=r(function(e,r,a){"production"!==n.env.NODE_ENV&&u(this instanceof t,"Something is calling a React component directly. Use a factory or JSX instead. See: https://fb.me/react-legacyfactory"),this.__reactAutoBindPairs.length&&b(this),this.props=e,this.context=r,this.refs=i,this.updater=a||o,this.state=null;var c=this.getInitialState?this.getInitialState():null;"production"!==n.env.NODE_ENV&&void 0===c&&this.getInitialState._isMockFunction&&(c=null),s("object"==typeof c&&!Array.isArray(c),"%s.getInitialState(): must return an object or null",t.displayName||"ReactCompositeComponent"),this.state=c});t.prototype=new T,t.prototype.constructor=t,t.prototype.__reactAutoBindPairs=[],E.forEach(f.bind(null,t)),f(t,D),f(t,e),f(t,N),t.getDefaultProps&&(t.defaultProps=t.getDefaultProps()),"production"!==n.env.NODE_ENV&&(t.getDefaultProps&&(t.getDefaultProps.isReactClassApproved={}),t.prototype.getInitialState&&(t.prototype.getInitialState.isReactClassApproved={})),s(t.prototype.render,"createClass(...): Class specification must implement a `render` method."),"production"!==n.env.NODE_ENV&&(u(!t.prototype.componentShouldUpdate,"%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value.",e.displayName||"A component"),u(!t.prototype.componentWillRecieveProps,"%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?",e.displayName||"A component"));for(var a in O)t.prototype[a]||(t.prototype[a]=null);return t}var E=[],O={mixins:"DEFINE_MANY",statics:"DEFINE_MANY",propTypes:"DEFINE_MANY",contextTypes:"DEFINE_MANY",childContextTypes:"DEFINE_MANY",getDefaultProps:"DEFINE_MANY_MERGED",getInitialState:"DEFINE_MANY_MERGED",getChildContext:"DEFINE_MANY_MERGED",render:"DEFINE_ONCE",componentWillMount:"DEFINE_MANY",componentDidMount:"DEFINE_MANY",componentWillReceiveProps:"DEFINE_MANY",shouldComponentUpdate:"DEFINE_ONCE",componentWillUpdate:"DEFINE_MANY",componentDidUpdate:"DEFINE_MANY",componentWillUnmount:"DEFINE_MANY",updateComponent:"OVERRIDE_BASE"},C={displayName:function(e,t){e.displayName=t},mixins:function(e,t){if(t)for(var n=0;n<t.length;n++)f(e,t[n])},childContextTypes:function(e,t){"production"!==n.env.NODE_ENV&&d(e,t,"childContext"),e.childContextTypes=a({},e.childContextTypes,t)},contextTypes:function(e,t){"production"!==n.env.NODE_ENV&&d(e,t,"context"),e.contextTypes=a({},e.contextTypes,t)},getDefaultProps:function(e,t){e.getDefaultProps?e.getDefaultProps=m(e.getDefaultProps,t):e.getDefaultProps=t},propTypes:function(e,t){"production"!==n.env.NODE_ENV&&d(e,t,"prop"),e.propTypes=a({},e.propTypes,t)},statics:function(e,t){h(e,t)},autobind:function(){}},D={componentDidMount:function(){this.__isMounted=!0}},N={componentWillUnmount:function(){this.__isMounted=!1}},w={replaceState:function(e,t){this.updater.enqueueReplaceState(this,e,t)},isMounted:function(){return"production"!==n.env.NODE_ENV&&(u(this.__didWarnIsMounted,"%s: isMounted is deprecated. Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks.",this.constructor&&this.constructor.displayName||this.name||"Component"),this.__didWarnIsMounted=!0),!!this.__isMounted}},T=function(){};return a(T.prototype,e.prototype,w),_}var a=e("object-assign"),i=e("fbjs/lib/emptyObject"),s=e("fbjs/lib/invariant");if("production"!==n.env.NODE_ENV)var u=e("fbjs/lib/warning");var c,l="mixins";c="production"!==n.env.NODE_ENV?{prop:"prop",context:"context",childContext:"child context"}:{},t.exports=o}).call(this,e("_process"))},{_process:168,"fbjs/lib/emptyObject":43,"fbjs/lib/invariant":50,"fbjs/lib/warning":57,"object-assign":167}],13:[function(e,t,n){"use strict";var r=function(e){return e&&e.__esModule?e:{"default":e}},o=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")};n.__esModule=!0;var a=e("./isDisposable"),i=r(a),s=function(){function e(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];o(this,e),Array.isArray(n[0])&&1===n.length&&(n=n[0]);for(var a=0;a<n.length;a++)if(!i["default"](n[a]))throw new Error("Expected a disposable");this.disposables=n,this.isDisposed=!1}return e.prototype.add=function(e){this.isDisposed?e.dispose():this.disposables.push(e)},e.prototype.remove=function(e){if(this.isDisposed)return!1;var t=this.disposables.indexOf(e);return t!==-1&&(this.disposables.splice(t,1),e.dispose(),!0)},e.prototype.dispose=function(){if(!this.isDisposed){for(var e=this.disposables.length,t=new Array(e),n=0;n<e;n++)t[n]=this.disposables[n];this.isDisposed=!0,this.disposables=[],this.length=0;for(var n=0;n<e;n++)t[n].dispose()}},e}();n["default"]=s,t.exports=n["default"]},{"./isDisposable":17}],14:[function(e,t,n){"use strict";var r=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();n.__esModule=!0;var a=function(){},i=function(){function e(t){r(this,e),this.isDisposed=!1,this.action=t||a}return e.prototype.dispose=function(){this.isDisposed||(this.action.call(null),this.isDisposed=!0)},o(e,null,[{key:"empty",enumerable:!0,value:{dispose:a}}]),e}();n["default"]=i,t.exports=n["default"]},{}],15:[function(e,t,n){"use strict";var r=function(e){return e&&e.__esModule?e:{"default":e}},o=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")};n.__esModule=!0;var a=e("./isDisposable"),i=r(a),s=function(){function e(){o(this,e),this.isDisposed=!1,this.current=null}return e.prototype.getDisposable=function(){return this.current},e.prototype.setDisposable=function(){var e=void 0===arguments[0]?null:arguments[0];if(null!=e&&!i["default"](e))throw new Error("Expected either an empty value or a valid disposable");var t=this.isDisposed,n=void 0;t||(n=this.current,this.current=e),n&&n.dispose(),t&&e&&e.dispose()},e.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var e=this.current;this.current=null,e&&e.dispose()}},e}();n["default"]=s,t.exports=n["default"]},{"./isDisposable":17}],16:[function(e,t,n){"use strict";var r=function(e){return e&&e.__esModule?e:{"default":e}};n.__esModule=!0;var o=e("./isDisposable"),a=r(o);n.isDisposable=a["default"];var i=e("./Disposable"),s=r(i);n.Disposable=s["default"];var u=e("./CompositeDisposable"),c=r(u);n.CompositeDisposable=c["default"];var l=e("./SerialDisposable"),d=r(l);n.SerialDisposable=d["default"]},{"./CompositeDisposable":13,"./Disposable":14,"./SerialDisposable":15,"./isDisposable":17}],17:[function(e,t,n){"use strict";function r(e){return Boolean(e&&"function"==typeof e.dispose)}n.__esModule=!0,n["default"]=r,t.exports=n["default"]},{}],18:[function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}function o(e){return e&&e.__esModule?e:{"default":e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=e("redux/lib/createStore"),u=o(s),c=e("./reducers"),l=o(c),d=e("./actions/dragDrop"),p=r(d),f=e("./DragDropMonitor"),h=o(f),v=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};a(this,e);var r=(0,u["default"])(l["default"]);this.context=n,this.store=r,this.monitor=new h["default"](r),this.registry=this.monitor.registry,this.backend=t(this),r.subscribe(this.handleRefCountChange.bind(this))}return i(e,[{key:"handleRefCountChange",value:function(){var e=this.store.getState().refCount>0;e&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!e&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1)}},{key:"getContext",value:function(){return this.context}},{key:"getMonitor",value:function(){return this.monitor}},{key:"getBackend",value:function(){return this.backend}},{key:"getRegistry",value:function(){return this.registry}},{key:"getActions",value:function(){function e(e){return function(){for(var r=arguments.length,o=Array(r),a=0;a<r;a++)o[a]=arguments[a];var i=e.apply(t,o);"undefined"!=typeof i&&n(i)}}var t=this,n=this.store.dispatch;return Object.keys(p).filter(function(e){return"function"==typeof p[e]}).reduce(function(t,n){var r=p[n];return t[n]=e(r),t},{})}}]),e}();n["default"]=v},{"./DragDropMonitor":19,"./actions/dragDrop":23,"./reducers":30,"redux/lib/createStore":360}],19:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=e("invariant"),s=r(i),u=e("lodash/isArray"),c=r(u),l=e("./utils/matchesType"),d=r(l),p=e("./HandlerRegistry"),f=r(p),h=e("./reducers/dragOffset"),v=e("./reducers/dirtyHandlerIds"),m=function(){function e(t){o(this,e),this.store=t,this.registry=new f["default"](t)}return a(e,[{key:"subscribeToStateChange",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.handlerIds;(0,s["default"])("function"==typeof e,"listener must be a function."),(0,s["default"])("undefined"==typeof r||(0,c["default"])(r),"handlerIds, when specified, must be an array of strings.");var o=this.store.getState().stateId,a=function(){var n=t.store.getState(),a=n.stateId;try{var i=a===o||a===o+1&&!(0,v.areDirty)(n.dirtyHandlerIds,r);i||e()}finally{o=a}};return this.store.subscribe(a)}},{key:"subscribeToOffsetChange",value:function(e){var t=this;(0,s["default"])("function"==typeof e,"listener must be a function.");var n=this.store.getState().dragOffset,r=function(){var r=t.store.getState().dragOffset;r!==n&&(n=r,e())};return this.store.subscribe(r)}},{key:"canDragSource",value:function(e){var t=this.registry.getSource(e);return(0,s["default"])(t,"Expected to find a valid source."),!this.isDragging()&&t.canDrag(this,e)}},{key:"canDropOnTarget",value:function(e){var t=this.registry.getTarget(e);if((0,s["default"])(t,"Expected to find a valid target."),!this.isDragging()||this.didDrop())return!1;var n=this.registry.getTargetType(e),r=this.getItemType();return(0,d["default"])(n,r)&&t.canDrop(this,e)}},{key:"isDragging",value:function(){return Boolean(this.getItemType())}},{key:"isDraggingSource",value:function(e){var t=this.registry.getSource(e,!0);if((0,s["default"])(t,"Expected to find a valid source."),!this.isDragging()||!this.isSourcePublic())return!1;var n=this.registry.getSourceType(e),r=this.getItemType();return n===r&&t.isDragging(this,e)}},{key:"isOverTarget",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{shallow:!1},n=t.shallow;if(!this.isDragging())return!1;var r=this.registry.getTargetType(e),o=this.getItemType();if(!(0,d["default"])(r,o))return!1;var a=this.getTargetIds();if(!a.length)return!1;var i=a.indexOf(e);return n?i===a.length-1:i>-1}},{key:"getItemType",value:function(){return this.store.getState().dragOperation.itemType}},{key:"getItem",value:function(){return this.store.getState().dragOperation.item}},{key:"getSourceId",value:function(){return this.store.getState().dragOperation.sourceId}},{key:"getTargetIds",value:function(){return this.store.getState().dragOperation.targetIds}},{key:"getDropResult",value:function(){return this.store.getState().dragOperation.dropResult}},{key:"didDrop",value:function(){return this.store.getState().dragOperation.didDrop}},{key:"isSourcePublic",value:function(){return this.store.getState().dragOperation.isSourcePublic}},{key:"getInitialClientOffset",value:function(){return this.store.getState().dragOffset.initialClientOffset}},{key:"getInitialSourceClientOffset",value:function(){return this.store.getState().dragOffset.initialSourceClientOffset}},{key:"getClientOffset",value:function(){return this.store.getState().dragOffset.clientOffset}},{key:"getSourceClientOffset",value:function(){return(0,h.getSourceClientOffset)(this.store.getState().dragOffset)}},{key:"getDifferenceFromInitialOffset",value:function(){return(0,h.getDifferenceFromInitialOffset)(this.store.getState().dragOffset)}}]),e}();n["default"]=m},{"./HandlerRegistry":22,"./reducers/dirtyHandlerIds":27,"./reducers/dragOffset":28,"./utils/matchesType":34,invariant:59,"lodash/isArray":150}],20:[function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=function(){function e(){r(this,e)}return o(e,[{key:"canDrag",value:function(){return!0}},{key:"isDragging",value:function(e,t){return t===e.getSourceId()}},{key:"endDrag",value:function(){}}]),e}();n["default"]=a},{}],21:[function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=function(){function e(){r(this,e)}return o(e,[{key:"canDrop",value:function(){return!0}},{key:"hover",value:function(){}},{key:"drop",value:function(){}}]),e}();n["default"]=a},{}],22:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e){(0,f["default"])("function"==typeof e.canDrag,"Expected canDrag to be a function."),(0,f["default"])("function"==typeof e.beginDrag,"Expected beginDrag to be a function."),(0,f["default"])("function"==typeof e.endDrag,"Expected endDrag to be a function.")}function i(e){(0,f["default"])("function"==typeof e.canDrop,"Expected canDrop to be a function."),(0,f["default"])("function"==typeof e.hover,"Expected hover to be a function."),(0,f["default"])("function"==typeof e.drop,"Expected beginDrag to be a function.")}function s(e,t){return t&&(0,v["default"])(e)?void e.forEach(function(e){return s(e,!1)}):void(0,f["default"])("string"==typeof e||"symbol"===("undefined"==typeof e?"undefined":d(e)),t?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}function u(e){var t=(0,_["default"])().toString();switch(e){case E.SOURCE:return"S"+t;case E.TARGET:return"T"+t;default:(0,f["default"])(!1,"Unknown role: "+e)}}function c(e){switch(e[0]){case"S":return E.SOURCE;case"T":return E.TARGET;default:(0,f["default"])(!1,"Cannot parse handler ID: "+e)}}Object.defineProperty(n,"__esModule",{value:!0});var l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p=e("invariant"),f=r(p),h=e("lodash/isArray"),v=r(h),m=e("asap"),g=r(m),y=e("./actions/registry"),b=e("./utils/getNextUniqueId"),_=r(b),E={SOURCE:"SOURCE",TARGET:"TARGET"},O=function(){function e(t){o(this,e),this.store=t,this.types={},this.handlers={},this.pinnedSourceId=null,this.pinnedSource=null}return l(e,[{key:"addSource",value:function(e,t){s(e),a(t);var n=this.addHandler(E.SOURCE,e,t);return this.store.dispatch((0,y.addSource)(n)),n}},{key:"addTarget",value:function(e,t){s(e,!0),i(t);var n=this.addHandler(E.TARGET,e,t);return this.store.dispatch((0,y.addTarget)(n)),n}},{key:"addHandler",value:function(e,t,n){var r=u(e);return this.types[r]=t,this.handlers[r]=n,r}},{key:"containsHandler",value:function(e){var t=this;return Object.keys(this.handlers).some(function(n){return t.handlers[n]===e})}},{key:"getSource",value:function(e,t){(0,f["default"])(this.isSourceId(e),"Expected a valid source ID.");var n=t&&e===this.pinnedSourceId,r=n?this.pinnedSource:this.handlers[e];return r}},{key:"getTarget",value:function(e){return(0,f["default"])(this.isTargetId(e),"Expected a valid target ID."),this.handlers[e]}},{key:"getSourceType",value:function(e){return(0,f["default"])(this.isSourceId(e),"Expected a valid source ID."),this.types[e]}},{key:"getTargetType",value:function(e){return(0,f["default"])(this.isTargetId(e),"Expected a valid target ID."),this.types[e]}},{key:"isSourceId",value:function(e){var t=c(e);return t===E.SOURCE}},{key:"isTargetId",value:function(e){var t=c(e);return t===E.TARGET}},{key:"removeSource",value:function(e){var t=this;(0,f["default"])(this.getSource(e),"Expected an existing source."),this.store.dispatch((0,y.removeSource)(e)),(0,g["default"])(function(){delete t.handlers[e],delete t.types[e]})}},{key:"removeTarget",value:function(e){var t=this;(0,f["default"])(this.getTarget(e),"Expected an existing target."),this.store.dispatch((0,y.removeTarget)(e)),(0,g["default"])(function(){delete t.handlers[e],delete t.types[e]})}},{key:"pinSource",value:function(e){var t=this.getSource(e);(0,f["default"])(t,"Expected an existing source."),this.pinnedSourceId=e,this.pinnedSource=t}},{key:"unpinSource",value:function(){(0,f["default"])(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}}]),e}();n["default"]=O},{"./actions/registry":24,"./utils/getNextUniqueId":33,asap:10,invariant:59,"lodash/isArray":150}],23:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{publishSource:!0,clientOffset:null},n=t.publishSource,r=t.clientOffset,o=t.getSourceClientOffset;(0,d["default"])((0,f["default"])(e),"Expected sourceIds to be an array.");var a=this.getMonitor(),i=this.getRegistry();(0,d["default"])(!a.isDragging(),"Cannot call beginDrag while dragging.");for(var s=0;s<e.length;s++)(0,d["default"])(i.getSource(e[s]),"Expected sourceIds to be registered.");for(var u=null,c=e.length-1;c>=0;c--)if(a.canDragSource(e[c])){u=e[c];break}if(null!==u){var l=null;r&&((0,d["default"])("function"==typeof o,"When clientOffset is provided, getSourceClientOffset must be a function."),l=o(u));var p=i.getSource(u),h=p.beginDrag(a,u);(0,d["default"])((0,v["default"])(h),"Item must be an object."),i.pinSource(u);var m=i.getSourceType(u);return{type:y,itemType:m,item:h,sourceId:u,clientOffset:r,sourceClientOffset:l,isSourcePublic:n}}}function a(){var e=this.getMonitor();if(e.isDragging())return{type:b}}function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.clientOffset,r=void 0===n?null:n;(0,d["default"])((0,f["default"])(e),"Expected targetIds to be an array.");var o=e.slice(0),a=this.getMonitor(),i=this.getRegistry();(0,d["default"])(a.isDragging(),"Cannot call hover while not dragging."),(0,d["default"])(!a.didDrop(),"Cannot call hover after drop.");for(var s=0;s<o.length;s++){var u=o[s];(0,d["default"])(o.lastIndexOf(u)===s,"Expected targetIds to be unique in the passed array.");var c=i.getTarget(u);(0,d["default"])(c,"Expected targetIds to be registered.")}for(var l=a.getItemType(),p=o.length-1;p>=0;p--){var h=o[p],v=i.getTargetType(h);(0,g["default"])(v,l)||o.splice(p,1)}for(var m=0;m<o.length;m++){var y=o[m],b=i.getTarget(y);b.hover(a,y)}return{type:_,targetIds:o,clientOffset:r}}function s(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this.getMonitor(),r=this.getRegistry();(0,d["default"])(n.isDragging(),"Cannot call drop while not dragging."),(0,d["default"])(!n.didDrop(),"Cannot call drop twice during one drag operation.");var o=n.getTargetIds().filter(n.canDropOnTarget,n);o.reverse(),o.forEach(function(o,a){var i=r.getTarget(o),s=i.drop(n,o);(0,d["default"])("undefined"==typeof s||(0,v["default"])(s),"Drop result must either be an object or undefined."),"undefined"==typeof s&&(s=0===a?{}:n.getDropResult()),e.store.dispatch({type:E,dropResult:c({},t,s)})})}function u(){var e=this.getMonitor(),t=this.getRegistry();(0,d["default"])(e.isDragging(),"Cannot call endDrag while not dragging.");var n=e.getSourceId(),r=t.getSource(n,!0);return r.endDrag(e,n),t.unpinSource(),{type:O}}Object.defineProperty(n,"__esModule",{value:!0}),n.END_DRAG=n.DROP=n.HOVER=n.PUBLISH_DRAG_SOURCE=n.BEGIN_DRAG=void 0;var c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};n.beginDrag=o,n.publishDragSource=a,n.hover=i,n.drop=s,n.endDrag=u;var l=e("invariant"),d=r(l),p=e("lodash/isArray"),f=r(p),h=e("lodash/isObject"),v=r(h),m=e("../utils/matchesType"),g=r(m),y=n.BEGIN_DRAG="dnd-core/BEGIN_DRAG",b=n.PUBLISH_DRAG_SOURCE="dnd-core/PUBLISH_DRAG_SOURCE",_=n.HOVER="dnd-core/HOVER",E=n.DROP="dnd-core/DROP",O=n.END_DRAG="dnd-core/END_DRAG"},{"../utils/matchesType":34,invariant:59,"lodash/isArray":150,"lodash/isObject":156}],24:[function(e,t,n){"use strict";function r(e){return{type:s,sourceId:e}}function o(e){return{type:u,targetId:e}}function a(e){return{type:c,sourceId:e}}function i(e){return{type:l,targetId:e}}Object.defineProperty(n,"__esModule",{value:!0}),n.addSource=r,n.addTarget=o,n.removeSource=a,n.removeTarget=i;var s=n.ADD_SOURCE="dnd-core/ADD_SOURCE",u=n.ADD_TARGET="dnd-core/ADD_TARGET",c=n.REMOVE_SOURCE="dnd-core/REMOVE_SOURCE",l=n.REMOVE_TARGET="dnd-core/REMOVE_TARGET"},{}],25:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e){return new c(e)}Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();n["default"]=a;var s=e("lodash/noop"),u=r(s),c=function(){function e(t){o(this,e),this.actions=t.getActions()}return i(e,[{key:"setup",value:function(){this.didCallSetup=!0}},{key:"teardown",value:function(){this.didCallTeardown=!0}},{key:"connectDragSource",value:function(){return u["default"]}},{key:"connectDragPreview",value:function(){return u["default"]}},{key:"connectDropTarget",value:function(){return u["default"]}},{key:"simulateBeginDrag",value:function(e,t){this.actions.beginDrag(e,t)}},{key:"simulatePublishDragSource",value:function(){this.actions.publishDragSource()}},{key:"simulateHover",value:function(e,t){this.actions.hover(e,t)}},{key:"simulateDrop",value:function(){this.actions.drop()}},{key:"simulateEndDrag",value:function(){this.actions.endDrag()}}]),e}()},{"lodash/noop":162}],26:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(n,"__esModule",{value:!0});var o=e("./DragDropManager");Object.defineProperty(n,"DragDropManager",{enumerable:!0,get:function(){return r(o)["default"]}});var a=e("./DragSource");Object.defineProperty(n,"DragSource",{enumerable:!0,get:function(){return r(a)["default"]}});var i=e("./DropTarget");Object.defineProperty(n,"DropTarget",{enumerable:!0,get:function(){return r(i)["default"]}});var s=e("./backends/createTestBackend");Object.defineProperty(n,"createTestBackend",{enumerable:!0,get:function(){return r(s)["default"]}})},{"./DragDropManager":18,"./DragSource":20,"./DropTarget":21,"./backends/createTestBackend":25}],27:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:p,arguments[1]),t=arguments[2];switch(e.type){case l.HOVER:break;case d.ADD_SOURCE:case d.ADD_TARGET:case d.REMOVE_TARGET:case d.REMOVE_SOURCE:return p;case l.BEGIN_DRAG:case l.PUBLISH_DRAG_SOURCE:case l.END_DRAG:case l.DROP:default:return f}var n=e.targetIds,r=t.targetIds,o=(0,s["default"])(n,r),a=!1;if(0===o.length){for(var i=0;i<n.length;i++)if(n[i]!==r[i]){a=!0;break}}else a=!0;if(!a)return p;var u=r[r.length-1],c=n[n.length-1];return u!==c&&(u&&o.push(u),c&&o.push(c)),o}function a(e,t){return e!==p&&(e===f||"undefined"==typeof t||(0,c["default"])(t,e).length>0)}Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=o,n.areDirty=a;var i=e("lodash/xor"),s=r(i),u=e("lodash/intersection"),c=r(u),l=e("../actions/dragDrop"),d=e("../actions/registry"),p=[],f=[]},{"../actions/dragDrop":23,"../actions/registry":24,"lodash/intersection":148,"lodash/xor":166}],28:[function(e,t,n){"use strict";function r(e,t){return e===t||e&&t&&e.x===t.x&&e.y===t.y}function o(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:c,t=arguments[1];switch(t.type){case u.BEGIN_DRAG:return{initialSourceClientOffset:t.sourceClientOffset,initialClientOffset:t.clientOffset,clientOffset:t.clientOffset};case u.HOVER:return r(e.clientOffset,t.clientOffset)?e:s({},e,{clientOffset:t.clientOffset});case u.END_DRAG:case u.DROP:return c;default:return e}}function a(e){var t=e.clientOffset,n=e.initialClientOffset,r=e.initialSourceClientOffset;return t&&n&&r?{x:t.x+r.x-n.x,y:t.y+r.y-n.y}:null}function i(e){var t=e.clientOffset,n=e.initialClientOffset;return t&&n?{x:t.x-n.x,y:t.y-n.y}:null}Object.defineProperty(n,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};n["default"]=o,n.getSourceClientOffset=a,n.getDifferenceFromInitialOffset=i;var u=e("../actions/dragDrop"),c={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null}},{"../actions/dragDrop":23}],29:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l,t=arguments[1];switch(t.type){case u.BEGIN_DRAG:return a({},e,{itemType:t.itemType,item:t.item,sourceId:t.sourceId,isSourcePublic:t.isSourcePublic,dropResult:null,didDrop:!1});case u.PUBLISH_DRAG_SOURCE:return a({},e,{isSourcePublic:!0});case u.HOVER:return a({},e,{targetIds:t.targetIds});case c.REMOVE_TARGET:return e.targetIds.indexOf(t.targetId)===-1?e:a({},e,{targetIds:(0,s["default"])(e.targetIds,t.targetId)});case u.DROP:return a({},e,{dropResult:t.dropResult,didDrop:!0,targetIds:[]});case u.END_DRAG:return a({},e,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}}Object.defineProperty(n,"__esModule",{value:!0});var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};n["default"]=o;var i=e("lodash/without"),s=r(i),u=e("../actions/dragDrop"),c=e("../actions/registry"),l={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null}},{"../actions/dragDrop":23,"../actions/registry":24,"lodash/without":165}],30:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1];return{dirtyHandlerIds:(0,p["default"])(e.dirtyHandlerIds,t,e.dragOperation),dragOffset:(0,i["default"])(e.dragOffset,t),refCount:(0,l["default"])(e.refCount,t),dragOperation:(0,u["default"])(e.dragOperation,t),stateId:(0,h["default"])(e.stateId)}}Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=o;var a=e("./dragOffset"),i=r(a),s=e("./dragOperation"),u=r(s),c=e("./refCount"),l=r(c),d=e("./dirtyHandlerIds"),p=r(d),f=e("./stateId"),h=r(f)},{"./dirtyHandlerIds":27,"./dragOffset":28,"./dragOperation":29,"./refCount":31,"./stateId":32}],31:[function(e,t,n){"use strict";function r(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments[1];switch(t.type){case o.ADD_SOURCE:case o.ADD_TARGET:return e+1;case o.REMOVE_SOURCE:case o.REMOVE_TARGET:return e-1;default:return e;
3
+ }}Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=r;var o=e("../actions/registry")},{"../actions/registry":24}],32:[function(e,t,n){"use strict";function r(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return e+1}Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=r},{}],33:[function(e,t,n){"use strict";function r(){return o++}Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=r;var o=0},{}],34:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){return(0,i["default"])(e)?e.some(function(e){return e===t}):e===t}Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=o;var a=e("lodash/isArray"),i=r(a)},{"lodash/isArray":150}],35:[function(e,t,n){(function(n){"use strict";var r=e("./emptyFunction"),o={listen:function(e,t,n){return e.addEventListener?(e.addEventListener(t,n,!1),{remove:function(){e.removeEventListener(t,n,!1)}}):e.attachEvent?(e.attachEvent("on"+t,n),{remove:function(){e.detachEvent("on"+t,n)}}):void 0},capture:function(e,t,o){return e.addEventListener?(e.addEventListener(t,o,!0),{remove:function(){e.removeEventListener(t,o,!0)}}):("production"!==n.env.NODE_ENV&&console.error("Attempted to listen to events during the capture phase on a browser that does not support the capture phase. Your application will not receive some events."),{remove:r})},registerDefault:function(){}};t.exports=o}).call(this,e("_process"))},{"./emptyFunction":42,_process:168}],36:[function(e,t,n){"use strict";var r=!("undefined"==typeof window||!window.document||!window.document.createElement),o={canUseDOM:r,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:r&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:r&&!!window.screen,isInWorker:!r};t.exports=o},{}],37:[function(e,t,n){"use strict";function r(e){return e.replace(o,function(e,t){return t.toUpperCase()})}var o=/-(.)/g;t.exports=r},{}],38:[function(e,t,n){"use strict";function r(e){return o(e.replace(a,"ms-"))}var o=e("./camelize"),a=/^-ms-/;t.exports=r},{"./camelize":37}],39:[function(e,t,n){"use strict";function r(e,t){return!(!e||!t)&&(e===t||!o(e)&&(o(t)?r(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}var o=e("./isTextNode");t.exports=r},{"./isTextNode":52}],40:[function(e,t,n){(function(n){"use strict";function r(e){var t=e.length;if(Array.isArray(e)||"object"!=typeof e&&"function"!=typeof e?"production"!==n.env.NODE_ENV?i(!1,"toArray: Array-like object expected"):i(!1):void 0,"number"!=typeof t?"production"!==n.env.NODE_ENV?i(!1,"toArray: Object needs a length property"):i(!1):void 0,0===t||t-1 in e?void 0:"production"!==n.env.NODE_ENV?i(!1,"toArray: Object should have keys for indices"):i(!1),"function"==typeof e.callee?"production"!==n.env.NODE_ENV?i(!1,"toArray: Object can't be `arguments`. Use rest params (function(...args) {}) or Array.from() instead."):i(!1):void 0,e.hasOwnProperty)try{return Array.prototype.slice.call(e)}catch(r){}for(var o=Array(t),a=0;a<t;a++)o[a]=e[a];return o}function o(e){return!!e&&("object"==typeof e||"function"==typeof e)&&"length"in e&&!("setInterval"in e)&&"number"!=typeof e.nodeType&&(Array.isArray(e)||"callee"in e||"item"in e)}function a(e){return o(e)?Array.isArray(e)?e.slice():r(e):[e]}var i=e("./invariant");t.exports=a}).call(this,e("_process"))},{"./invariant":50,_process:168}],41:[function(e,t,n){(function(n){"use strict";function r(e){var t=e.match(l);return t&&t[1].toLowerCase()}function o(e,t){var o=c;c?void 0:"production"!==n.env.NODE_ENV?u(!1,"createNodesFromMarkup dummy not initialized"):u(!1);var a=r(e),l=a&&s(a);if(l){o.innerHTML=l[1]+e+l[2];for(var d=l[0];d--;)o=o.lastChild}else o.innerHTML=e;var p=o.getElementsByTagName("script");p.length&&(t?void 0:"production"!==n.env.NODE_ENV?u(!1,"createNodesFromMarkup(...): Unexpected <script> element rendered."):u(!1),i(p).forEach(t));for(var f=Array.from(o.childNodes);o.lastChild;)o.removeChild(o.lastChild);return f}var a=e("./ExecutionEnvironment"),i=e("./createArrayFromMixed"),s=e("./getMarkupWrap"),u=e("./invariant"),c=a.canUseDOM?document.createElement("div"):null,l=/^\s*<(\w+)/;t.exports=o}).call(this,e("_process"))},{"./ExecutionEnvironment":36,"./createArrayFromMixed":40,"./getMarkupWrap":46,"./invariant":50,_process:168}],42:[function(e,t,n){"use strict";function r(e){return function(){return e}}var o=function(){};o.thatReturns=r,o.thatReturnsFalse=r(!1),o.thatReturnsTrue=r(!0),o.thatReturnsNull=r(null),o.thatReturnsThis=function(){return this},o.thatReturnsArgument=function(e){return e},t.exports=o},{}],43:[function(e,t,n){(function(e){"use strict";var n={};"production"!==e.env.NODE_ENV&&Object.freeze(n),t.exports=n}).call(this,e("_process"))},{_process:168}],44:[function(e,t,n){"use strict";function r(e){try{e.focus()}catch(t){}}t.exports=r},{}],45:[function(e,t,n){"use strict";function r(e){if(e=e||("undefined"!=typeof document?document:void 0),"undefined"==typeof e)return null;try{return e.activeElement||e.body}catch(t){return e.body}}t.exports=r},{}],46:[function(e,t,n){(function(n){"use strict";function r(e){return i?void 0:"production"!==n.env.NODE_ENV?a(!1,"Markup wrapping node not initialized"):a(!1),p.hasOwnProperty(e)||(e="*"),s.hasOwnProperty(e)||("*"===e?i.innerHTML="<link />":i.innerHTML="<"+e+"></"+e+">",s[e]=!i.firstChild),s[e]?p[e]:null}var o=e("./ExecutionEnvironment"),a=e("./invariant"),i=o.canUseDOM?document.createElement("div"):null,s={},u=[1,'<select multiple="true">',"</select>"],c=[1,"<table>","</table>"],l=[3,"<table><tbody><tr>","</tr></tbody></table>"],d=[1,'<svg xmlns="http://www.w3.org/2000/svg">',"</svg>"],p={"*":[1,"?<div>","</div>"],area:[1,"<map>","</map>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],legend:[1,"<fieldset>","</fieldset>"],param:[1,"<object>","</object>"],tr:[2,"<table><tbody>","</tbody></table>"],optgroup:u,option:u,caption:c,colgroup:c,tbody:c,tfoot:c,thead:c,td:l,th:l},f=["circle","clipPath","defs","ellipse","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","text","tspan"];f.forEach(function(e){p[e]=d,s[e]=!0}),t.exports=r}).call(this,e("_process"))},{"./ExecutionEnvironment":36,"./invariant":50,_process:168}],47:[function(e,t,n){"use strict";function r(e){return e.Window&&e instanceof e.Window?{x:e.pageXOffset||e.document.documentElement.scrollLeft,y:e.pageYOffset||e.document.documentElement.scrollTop}:{x:e.scrollLeft,y:e.scrollTop}}t.exports=r},{}],48:[function(e,t,n){"use strict";function r(e){return e.replace(o,"-$1").toLowerCase()}var o=/([A-Z])/g;t.exports=r},{}],49:[function(e,t,n){"use strict";function r(e){return o(e).replace(a,"-ms-")}var o=e("./hyphenate"),a=/^ms-/;t.exports=r},{"./hyphenate":48}],50:[function(e,t,n){(function(e){"use strict";function n(e,t,n,o,a,i,s,u){if(r(t),!e){var c;if(void 0===t)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,o,a,i,s,u],d=0;c=new Error(t.replace(/%s/g,function(){return l[d++]})),c.name="Invariant Violation"}throw c.framesToPop=1,c}}var r=function(e){};"production"!==e.env.NODE_ENV&&(r=function(e){if(void 0===e)throw new Error("invariant requires an error message argument")}),t.exports=n}).call(this,e("_process"))},{_process:168}],51:[function(e,t,n){"use strict";function r(e){var t=e?e.ownerDocument||e:document,n=t.defaultView||window;return!(!e||!("function"==typeof n.Node?e instanceof n.Node:"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName))}t.exports=r},{}],52:[function(e,t,n){"use strict";function r(e){return o(e)&&3==e.nodeType}var o=e("./isNode");t.exports=r},{"./isNode":51}],53:[function(e,t,n){"use strict";function r(e){var t={};return function(n){return t.hasOwnProperty(n)||(t[n]=e.call(this,n)),t[n]}}t.exports=r},{}],54:[function(e,t,n){"use strict";var r,o=e("./ExecutionEnvironment");o.canUseDOM&&(r=window.performance||window.msPerformance||window.webkitPerformance),t.exports=r||{}},{"./ExecutionEnvironment":36}],55:[function(e,t,n){"use strict";var r,o=e("./performance");r=o.now?function(){return o.now()}:function(){return Date.now()},t.exports=r},{"./performance":54}],56:[function(e,t,n){"use strict";function r(e,t){return e===t?0!==e||0!==t||1/e===1/t:e!==e&&t!==t}function o(e,t){if(r(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(var i=0;i<n.length;i++)if(!a.call(t,n[i])||!r(e[n[i]],t[n[i]]))return!1;return!0}var a=Object.prototype.hasOwnProperty;t.exports=o},{}],57:[function(e,t,n){(function(n){"use strict";var r=e("./emptyFunction"),o=r;"production"!==n.env.NODE_ENV&&!function(){var e=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=0,a="Warning: "+e.replace(/%s/g,function(){return n[o++]});"undefined"!=typeof console&&console.error(a);try{throw new Error(a)}catch(i){}};o=function(t,n){if(void 0===n)throw new Error("`warning(condition, format, ...args)` requires a warning message argument");if(0!==n.indexOf("Failed Composite propType: ")&&!t){for(var r=arguments.length,o=Array(r>2?r-2:0),a=2;a<r;a++)o[a-2]=arguments[a];e.apply(void 0,[n].concat(o))}}}(),t.exports=o}).call(this,e("_process"))},{"./emptyFunction":42,_process:168}],58:[function(e,t,n){"use strict";var r={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,arguments:!0,arity:!0},a="function"==typeof Object.getOwnPropertySymbols;t.exports=function(e,t,n){if("string"!=typeof t){var i=Object.getOwnPropertyNames(t);a&&(i=i.concat(Object.getOwnPropertySymbols(t)));for(var s=0;s<i.length;++s)if(!(r[i[s]]||o[i[s]]||n&&n[i[s]]))try{e[i[s]]=t[i[s]]}catch(u){}}return e}},{}],59:[function(e,t,n){(function(e){"use strict";var n=function(t,n,r,o,a,i,s,u){if("production"!==e.env.NODE_ENV&&void 0===n)throw new Error("invariant requires an error message argument");if(!t){var c;if(void 0===n)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[r,o,a,i,s,u],d=0;c=new Error(n.replace(/%s/g,function(){return l[d++]})),c.name="Invariant Violation"}throw c.framesToPop=1,c}};t.exports=n}).call(this,e("_process"))},{_process:168}],60:[function(e,t,n){function r(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}var o=e("./_hashClear"),a=e("./_hashDelete"),i=e("./_hashGet"),s=e("./_hashHas"),u=e("./_hashSet");r.prototype.clear=o,r.prototype["delete"]=a,r.prototype.get=i,r.prototype.has=s,r.prototype.set=u,t.exports=r},{"./_hashClear":108,"./_hashDelete":109,"./_hashGet":110,"./_hashHas":111,"./_hashSet":112}],61:[function(e,t,n){function r(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}var o=e("./_listCacheClear"),a=e("./_listCacheDelete"),i=e("./_listCacheGet"),s=e("./_listCacheHas"),u=e("./_listCacheSet");r.prototype.clear=o,r.prototype["delete"]=a,r.prototype.get=i,r.prototype.has=s,r.prototype.set=u,t.exports=r},{"./_listCacheClear":119,"./_listCacheDelete":120,"./_listCacheGet":121,"./_listCacheHas":122,"./_listCacheSet":123}],62:[function(e,t,n){var r=e("./_getNative"),o=e("./_root"),a=r(o,"Map");t.exports=a},{"./_getNative":104,"./_root":135}],63:[function(e,t,n){function r(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}var o=e("./_mapCacheClear"),a=e("./_mapCacheDelete"),i=e("./_mapCacheGet"),s=e("./_mapCacheHas"),u=e("./_mapCacheSet");r.prototype.clear=o,r.prototype["delete"]=a,r.prototype.get=i,r.prototype.has=s,r.prototype.set=u,t.exports=r},{"./_mapCacheClear":124,"./_mapCacheDelete":125,"./_mapCacheGet":126,"./_mapCacheHas":127,"./_mapCacheSet":128}],64:[function(e,t,n){var r=e("./_getNative"),o=e("./_root"),a=r(o,"Set");t.exports=a},{"./_getNative":104,"./_root":135}],65:[function(e,t,n){function r(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new o;++t<n;)this.add(e[t])}var o=e("./_MapCache"),a=e("./_setCacheAdd"),i=e("./_setCacheHas");r.prototype.add=r.prototype.push=a,r.prototype.has=i,t.exports=r},{"./_MapCache":63,"./_setCacheAdd":136,"./_setCacheHas":137}],66:[function(e,t,n){var r=e("./_root"),o=r.Symbol;t.exports=o},{"./_root":135}],67:[function(e,t,n){function r(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}t.exports=r},{}],68:[function(e,t,n){function r(e,t){for(var n=-1,r=null==e?0:e.length,o=0,a=[];++n<r;){var i=e[n];t(i,n,e)&&(a[o++]=i)}return a}t.exports=r},{}],69:[function(e,t,n){function r(e,t){var n=null==e?0:e.length;return!!n&&o(e,t,0)>-1}var o=e("./_baseIndexOf");t.exports=r},{"./_baseIndexOf":81}],70:[function(e,t,n){function r(e,t,n){for(var r=-1,o=null==e?0:e.length;++r<o;)if(n(t,e[r]))return!0;return!1}t.exports=r},{}],71:[function(e,t,n){function r(e,t){var n=i(e),r=!n&&a(e),l=!n&&!r&&s(e),p=!n&&!r&&!l&&c(e),f=n||r||l||p,h=f?o(e.length,String):[],v=h.length;for(var m in e)!t&&!d.call(e,m)||f&&("length"==m||l&&("offset"==m||"parent"==m)||p&&("buffer"==m||"byteLength"==m||"byteOffset"==m)||u(m,v))||h.push(m);return h}var o=e("./_baseTimes"),a=e("./isArguments"),i=e("./isArray"),s=e("./isBuffer"),u=e("./_isIndex"),c=e("./isTypedArray"),l=Object.prototype,d=l.hasOwnProperty;t.exports=r},{"./_baseTimes":90,"./_isIndex":114,"./isArguments":149,"./isArray":150,"./isBuffer":153,"./isTypedArray":159}],72:[function(e,t,n){function r(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}t.exports=r},{}],73:[function(e,t,n){function r(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}t.exports=r},{}],74:[function(e,t,n){function r(e,t,n){var r=e[t];s.call(e,t)&&a(r,n)&&(void 0!==n||t in e)||o(e,t,n)}var o=e("./_baseAssignValue"),a=e("./eq"),i=Object.prototype,s=i.hasOwnProperty;t.exports=r},{"./_baseAssignValue":76,"./eq":146}],75:[function(e,t,n){function r(e,t){for(var n=e.length;n--;)if(o(e[n][0],t))return n;return-1}var o=e("./eq");t.exports=r},{"./eq":146}],76:[function(e,t,n){function r(e,t,n){"__proto__"==t&&o?o(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var o=e("./_defineProperty");t.exports=r},{"./_defineProperty":101}],77:[function(e,t,n){function r(e,t,n,r){var d=-1,p=a,f=!0,h=e.length,v=[],m=t.length;if(!h)return v;n&&(t=s(t,u(n))),r?(p=i,f=!1):t.length>=l&&(p=c,f=!1,t=new o(t));e:for(;++d<h;){var g=e[d],y=null==n?g:n(g);if(g=r||0!==g?g:0,f&&y===y){for(var b=m;b--;)if(t[b]===y)continue e;v.push(g)}else p(t,y,r)||v.push(g)}return v}var o=e("./_SetCache"),a=e("./_arrayIncludes"),i=e("./_arrayIncludesWith"),s=e("./_arrayMap"),u=e("./_baseUnary"),c=e("./_cacheHas"),l=200;t.exports=r},{"./_SetCache":65,"./_arrayIncludes":69,"./_arrayIncludesWith":70,"./_arrayMap":72,"./_baseUnary":91,"./_cacheHas":94}],78:[function(e,t,n){function r(e,t,n,r){for(var o=e.length,a=n+(r?1:-1);r?a--:++a<o;)if(t(e[a],a,e))return a;return-1}t.exports=r},{}],79:[function(e,t,n){function r(e,t,n,i,s){var u=-1,c=e.length;for(n||(n=a),s||(s=[]);++u<c;){var l=e[u];t>0&&n(l)?t>1?r(l,t-1,n,i,s):o(s,l):i||(s[s.length]=l)}return s}var o=e("./_arrayPush"),a=e("./_isFlattenable");t.exports=r},{"./_arrayPush":73,"./_isFlattenable":113}],80:[function(e,t,n){function r(e){return null==e?void 0===e?u:s:c&&c in Object(e)?a(e):i(e)}var o=e("./_Symbol"),a=e("./_getRawTag"),i=e("./_objectToString"),s="[object Null]",u="[object Undefined]",c=o?o.toStringTag:void 0;t.exports=r},{"./_Symbol":66,"./_getRawTag":106,"./_objectToString":132}],81:[function(e,t,n){function r(e,t,n){return t===t?i(e,t,n):o(e,a,n)}var o=e("./_baseFindIndex"),a=e("./_baseIsNaN"),i=e("./_strictIndexOf");t.exports=r},{"./_baseFindIndex":78,"./_baseIsNaN":84,"./_strictIndexOf":141}],82:[function(e,t,n){function r(e,t,n){for(var r=n?i:a,d=e[0].length,p=e.length,f=p,h=Array(p),v=1/0,m=[];f--;){var g=e[f];f&&t&&(g=s(g,u(t))),v=l(g.length,v),h[f]=!n&&(t||d>=120&&g.length>=120)?new o(f&&g):void 0}g=e[0];var y=-1,b=h[0];e:for(;++y<d&&m.length<v;){var _=g[y],E=t?t(_):_;if(_=n||0!==_?_:0,!(b?c(b,E):r(m,E,n))){for(f=p;--f;){var O=h[f];if(!(O?c(O,E):r(e[f],E,n)))continue e}b&&b.push(E),m.push(_)}}return m}var o=e("./_SetCache"),a=e("./_arrayIncludes"),i=e("./_arrayIncludesWith"),s=e("./_arrayMap"),u=e("./_baseUnary"),c=e("./_cacheHas"),l=Math.min;t.exports=r},{"./_SetCache":65,"./_arrayIncludes":69,"./_arrayIncludesWith":70,"./_arrayMap":72,"./_baseUnary":91,"./_cacheHas":94}],83:[function(e,t,n){function r(e){return a(e)&&o(e)==i}var o=e("./_baseGetTag"),a=e("./isObjectLike"),i="[object Arguments]";t.exports=r},{"./_baseGetTag":80,"./isObjectLike":157}],84:[function(e,t,n){function r(e){return e!==e}t.exports=r},{}],85:[function(e,t,n){function r(e){if(!i(e)||a(e))return!1;var t=o(e)?h:c;return t.test(s(e))}var o=e("./isFunction"),a=e("./_isMasked"),i=e("./isObject"),s=e("./_toSource"),u=/[\\^$.*+?()[\]{}|]/g,c=/^\[object .+?Constructor\]$/,l=Function.prototype,d=Object.prototype,p=l.toString,f=d.hasOwnProperty,h=RegExp("^"+p.call(f).replace(u,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=r},{"./_isMasked":117,"./_toSource":142,"./isFunction":154,"./isObject":156}],86:[function(e,t,n){function r(e){return i(e)&&a(e.length)&&!!S[o(e)]}var o=e("./_baseGetTag"),a=e("./isLength"),i=e("./isObjectLike"),s="[object Arguments]",u="[object Array]",c="[object Boolean]",l="[object Date]",d="[object Error]",p="[object Function]",f="[object Map]",h="[object Number]",v="[object Object]",m="[object RegExp]",g="[object Set]",y="[object String]",b="[object WeakMap]",_="[object ArrayBuffer]",E="[object DataView]",O="[object Float32Array]",C="[object Float64Array]",D="[object Int8Array]",N="[object Int16Array]",w="[object Int32Array]",T="[object Uint8Array]",I="[object Uint8ClampedArray]",k="[object Uint16Array]",x="[object Uint32Array]",S={};S[O]=S[C]=S[D]=S[N]=S[w]=S[T]=S[I]=S[k]=S[x]=!0,S[s]=S[u]=S[_]=S[c]=S[E]=S[l]=S[d]=S[p]=S[f]=S[h]=S[v]=S[m]=S[g]=S[y]=S[b]=!1,t.exports=r},{"./_baseGetTag":80,"./isLength":155,"./isObjectLike":157}],87:[function(e,t,n){function r(e){if(!o(e))return i(e);var t=a(e),n=[];for(var r in e)("constructor"!=r||!t&&u.call(e,r))&&n.push(r);return n}var o=e("./isObject"),a=e("./_isPrototype"),i=e("./_nativeKeysIn"),s=Object.prototype,u=s.hasOwnProperty;t.exports=r},{"./_isPrototype":118,"./_nativeKeysIn":130,"./isObject":156}],88:[function(e,t,n){function r(e,t){return i(a(e,t,o),e+"")}var o=e("./identity"),a=e("./_overRest"),i=e("./_setToString");t.exports=r},{"./_overRest":134,"./_setToString":139,"./identity":147}],89:[function(e,t,n){var r=e("./constant"),o=e("./_defineProperty"),a=e("./identity"),i=o?function(e,t){return o(e,"toString",{configurable:!0,enumerable:!1,value:r(t),writable:!0})}:a;t.exports=i},{"./_defineProperty":101,"./constant":144,"./identity":147}],90:[function(e,t,n){function r(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}t.exports=r},{}],91:[function(e,t,n){function r(e){return function(t){return e(t)}}t.exports=r},{}],92:[function(e,t,n){function r(e,t,n){var r=-1,d=a,p=e.length,f=!0,h=[],v=h;if(n)f=!1,d=i;else if(p>=l){var m=t?null:u(e);if(m)return c(m);f=!1,d=s,v=new o}else v=t?[]:h;e:for(;++r<p;){var g=e[r],y=t?t(g):g;if(g=n||0!==g?g:0,f&&y===y){for(var b=v.length;b--;)if(v[b]===y)continue e;t&&v.push(y),h.push(g)}else d(v,y,n)||(v!==h&&v.push(y),h.push(g))}return h}var o=e("./_SetCache"),a=e("./_arrayIncludes"),i=e("./_arrayIncludesWith"),s=e("./_cacheHas"),u=e("./_createSet"),c=e("./_setToArray"),l=200;t.exports=r},{"./_SetCache":65,"./_arrayIncludes":69,"./_arrayIncludesWith":70,"./_cacheHas":94,"./_createSet":99,"./_setToArray":138}],93:[function(e,t,n){function r(e,t,n){var r=e.length;if(r<2)return r?i(e[0]):[];for(var s=-1,u=Array(r);++s<r;)for(var c=e[s],l=-1;++l<r;)l!=s&&(u[s]=o(u[s]||c,e[l],t,n));return i(a(u,1),t,n)}var o=e("./_baseDifference"),a=e("./_baseFlatten"),i=e("./_baseUniq");t.exports=r},{"./_baseDifference":77,"./_baseFlatten":79,"./_baseUniq":92}],94:[function(e,t,n){function r(e,t){return e.has(t)}t.exports=r},{}],95:[function(e,t,n){function r(e){return o(e)?e:[]}var o=e("./isArrayLikeObject");t.exports=r},{"./isArrayLikeObject":152}],96:[function(e,t,n){function r(e,t,n,r){var i=!n;n||(n={});for(var s=-1,u=t.length;++s<u;){var c=t[s],l=r?r(n[c],e[c],c,n,e):void 0;void 0===l&&(l=e[c]),i?a(n,c,l):o(n,c,l)}return n}var o=e("./_assignValue"),a=e("./_baseAssignValue");t.exports=r},{"./_assignValue":74,"./_baseAssignValue":76}],97:[function(e,t,n){var r=e("./_root"),o=r["__core-js_shared__"];t.exports=o},{"./_root":135}],98:[function(e,t,n){function r(e){return o(function(t,n){var r=-1,o=n.length,i=o>1?n[o-1]:void 0,s=o>2?n[2]:void 0;for(i=e.length>3&&"function"==typeof i?(o--,i):void 0,s&&a(n[0],n[1],s)&&(i=o<3?void 0:i,o=1),t=Object(t);++r<o;){var u=n[r];u&&e(t,u,r,i)}return t})}var o=e("./_baseRest"),a=e("./_isIterateeCall");t.exports=r},{"./_baseRest":88,"./_isIterateeCall":115}],99:[function(e,t,n){var r=e("./_Set"),o=e("./noop"),a=e("./_setToArray"),i=1/0,s=r&&1/a(new r([,-0]))[1]==i?function(e){return new r(e)}:o;t.exports=s},{"./_Set":64,"./_setToArray":138,"./noop":162}],100:[function(e,t,n){function r(e,t,n,r){return void 0===e||o(e,a[n])&&!i.call(r,n)?t:e}var o=e("./eq"),a=Object.prototype,i=a.hasOwnProperty;t.exports=r},{"./eq":146}],101:[function(e,t,n){var r=e("./_getNative"),o=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(t){}}();t.exports=o},{"./_getNative":104}],102:[function(e,t,n){(function(e){var n="object"==typeof e&&e&&e.Object===Object&&e;t.exports=n}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],103:[function(e,t,n){function r(e,t){var n=e.__data__;return o(t)?n["string"==typeof t?"string":"hash"]:n.map}var o=e("./_isKeyable");t.exports=r},{"./_isKeyable":116}],104:[function(e,t,n){function r(e,t){var n=a(e,t);return o(n)?n:void 0}var o=e("./_baseIsNative"),a=e("./_getValue");t.exports=r},{"./_baseIsNative":85,"./_getValue":107}],105:[function(e,t,n){var r=e("./_overArg"),o=r(Object.getPrototypeOf,Object);t.exports=o},{"./_overArg":133}],106:[function(e,t,n){function r(e){var t=i.call(e,u),n=e[u];try{e[u]=void 0;var r=!0}catch(o){}var a=s.call(e);return r&&(t?e[u]=n:delete e[u]),a}var o=e("./_Symbol"),a=Object.prototype,i=a.hasOwnProperty,s=a.toString,u=o?o.toStringTag:void 0;t.exports=r},{"./_Symbol":66}],107:[function(e,t,n){function r(e,t){return null==e?void 0:e[t]}t.exports=r},{}],108:[function(e,t,n){function r(){this.__data__=o?o(null):{},this.size=0}var o=e("./_nativeCreate");t.exports=r},{"./_nativeCreate":129}],109:[function(e,t,n){function r(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}t.exports=r},{}],110:[function(e,t,n){function r(e){var t=this.__data__;if(o){var n=t[e];return n===a?void 0:n}return s.call(t,e)?t[e]:void 0}var o=e("./_nativeCreate"),a="__lodash_hash_undefined__",i=Object.prototype,s=i.hasOwnProperty;t.exports=r},{"./_nativeCreate":129}],111:[function(e,t,n){function r(e){var t=this.__data__;return o?void 0!==t[e]:i.call(t,e)}var o=e("./_nativeCreate"),a=Object.prototype,i=a.hasOwnProperty;t.exports=r},{"./_nativeCreate":129}],112:[function(e,t,n){function r(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=o&&void 0===t?a:t,this}var o=e("./_nativeCreate"),a="__lodash_hash_undefined__";t.exports=r},{"./_nativeCreate":129}],113:[function(e,t,n){function r(e){return i(e)||a(e)||!!(s&&e&&e[s])}var o=e("./_Symbol"),a=e("./isArguments"),i=e("./isArray"),s=o?o.isConcatSpreadable:void 0;t.exports=r},{"./_Symbol":66,"./isArguments":149,"./isArray":150}],114:[function(e,t,n){function r(e,t){return t=null==t?o:t,!!t&&("number"==typeof e||a.test(e))&&e>-1&&e%1==0&&e<t}var o=9007199254740991,a=/^(?:0|[1-9]\d*)$/;t.exports=r},{}],115:[function(e,t,n){function r(e,t,n){if(!s(n))return!1;var r=typeof t;return!!("number"==r?a(n)&&i(t,n.length):"string"==r&&t in n)&&o(n[t],e)}var o=e("./eq"),a=e("./isArrayLike"),i=e("./_isIndex"),s=e("./isObject");t.exports=r},{"./_isIndex":114,"./eq":146,"./isArrayLike":151,"./isObject":156}],116:[function(e,t,n){function r(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}t.exports=r},{}],117:[function(e,t,n){function r(e){return!!a&&a in e}var o=e("./_coreJsData"),a=function(){var e=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();t.exports=r},{"./_coreJsData":97}],118:[function(e,t,n){function r(e){var t=e&&e.constructor,n="function"==typeof t&&t.prototype||o;return e===n}var o=Object.prototype;t.exports=r},{}],119:[function(e,t,n){function r(){this.__data__=[],this.size=0}t.exports=r},{}],120:[function(e,t,n){function r(e){var t=this.__data__,n=o(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():i.call(t,n,1),--this.size,!0}var o=e("./_assocIndexOf"),a=Array.prototype,i=a.splice;t.exports=r},{"./_assocIndexOf":75}],121:[function(e,t,n){function r(e){var t=this.__data__,n=o(t,e);return n<0?void 0:t[n][1]}var o=e("./_assocIndexOf");t.exports=r},{"./_assocIndexOf":75}],122:[function(e,t,n){function r(e){return o(this.__data__,e)>-1}var o=e("./_assocIndexOf");t.exports=r},{"./_assocIndexOf":75}],123:[function(e,t,n){function r(e,t){var n=this.__data__,r=o(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var o=e("./_assocIndexOf");t.exports=r},{"./_assocIndexOf":75}],124:[function(e,t,n){function r(){this.size=0,this.__data__={hash:new o,map:new(i||a),string:new o}}var o=e("./_Hash"),a=e("./_ListCache"),i=e("./_Map");t.exports=r},{"./_Hash":60,"./_ListCache":61,"./_Map":62}],125:[function(e,t,n){function r(e){var t=o(this,e)["delete"](e);return this.size-=t?1:0,t}var o=e("./_getMapData");t.exports=r},{"./_getMapData":103}],126:[function(e,t,n){function r(e){return o(this,e).get(e)}var o=e("./_getMapData");t.exports=r},{"./_getMapData":103}],127:[function(e,t,n){function r(e){return o(this,e).has(e)}var o=e("./_getMapData");t.exports=r},{"./_getMapData":103}],128:[function(e,t,n){function r(e,t){var n=o(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}var o=e("./_getMapData");t.exports=r},{"./_getMapData":103}],129:[function(e,t,n){var r=e("./_getNative"),o=r(Object,"create");t.exports=o},{"./_getNative":104}],130:[function(e,t,n){function r(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}t.exports=r},{}],131:[function(e,t,n){var r=e("./_freeGlobal"),o="object"==typeof n&&n&&!n.nodeType&&n,a=o&&"object"==typeof t&&t&&!t.nodeType&&t,i=a&&a.exports===o,s=i&&r.process,u=function(){try{return s&&s.binding&&s.binding("util")}catch(e){}}();t.exports=u},{"./_freeGlobal":102}],132:[function(e,t,n){function r(e){return a.call(e)}var o=Object.prototype,a=o.toString;t.exports=r},{}],133:[function(e,t,n){function r(e,t){return function(n){return e(t(n))}}t.exports=r},{}],134:[function(e,t,n){function r(e,t,n){return t=a(void 0===t?e.length-1:t,0),function(){for(var r=arguments,i=-1,s=a(r.length-t,0),u=Array(s);++i<s;)u[i]=r[t+i];i=-1;for(var c=Array(t+1);++i<t;)c[i]=r[i];return c[t]=n(u),o(e,this,c)}}var o=e("./_apply"),a=Math.max;t.exports=r},{"./_apply":67}],135:[function(e,t,n){var r=e("./_freeGlobal"),o="object"==typeof self&&self&&self.Object===Object&&self,a=r||o||Function("return this")();t.exports=a},{"./_freeGlobal":102}],136:[function(e,t,n){function r(e){return this.__data__.set(e,o),this}var o="__lodash_hash_undefined__";t.exports=r},{}],137:[function(e,t,n){function r(e){return this.__data__.has(e)}t.exports=r},{}],138:[function(e,t,n){function r(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}t.exports=r},{}],139:[function(e,t,n){var r=e("./_baseSetToString"),o=e("./_shortOut"),a=o(r);t.exports=a},{"./_baseSetToString":89,"./_shortOut":140}],140:[function(e,t,n){function r(e){var t=0,n=0;return function(){var r=i(),s=a-(r-n);if(n=r,s>0){if(++t>=o)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var o=800,a=16,i=Date.now;t.exports=r},{}],141:[function(e,t,n){function r(e,t,n){for(var r=n-1,o=e.length;++r<o;)if(e[r]===t)return r;return-1}t.exports=r},{}],142:[function(e,t,n){function r(e){if(null!=e){try{return a.call(e)}catch(t){}try{return e+""}catch(t){}}return""}var o=Function.prototype,a=o.toString;t.exports=r},{}],143:[function(e,t,n){var r=e("./_copyObject"),o=e("./_createAssigner"),a=e("./keysIn"),i=o(function(e,t,n,o){r(t,a(t),e,o)});t.exports=i},{"./_copyObject":96,"./_createAssigner":98,"./keysIn":160}],144:[function(e,t,n){function r(e){return function(){return e}}t.exports=r},{}],145:[function(e,t,n){var r=e("./_apply"),o=e("./assignInWith"),a=e("./_baseRest"),i=e("./_customDefaultsAssignIn"),s=a(function(e){return e.push(void 0,i),r(o,void 0,e)});t.exports=s},{"./_apply":67,"./_baseRest":88,"./_customDefaultsAssignIn":100,"./assignInWith":143}],146:[function(e,t,n){function r(e,t){return e===t||e!==e&&t!==t}t.exports=r},{}],147:[function(e,t,n){function r(e){return e}t.exports=r},{}],148:[function(e,t,n){var r=e("./_arrayMap"),o=e("./_baseIntersection"),a=e("./_baseRest"),i=e("./_castArrayLikeObject"),s=a(function(e){var t=r(e,i);return t.length&&t[0]===e[0]?o(t):[]});t.exports=s},{"./_arrayMap":72,"./_baseIntersection":82,"./_baseRest":88,"./_castArrayLikeObject":95}],149:[function(e,t,n){var r=e("./_baseIsArguments"),o=e("./isObjectLike"),a=Object.prototype,i=a.hasOwnProperty,s=a.propertyIsEnumerable,u=r(function(){return arguments}())?r:function(e){return o(e)&&i.call(e,"callee")&&!s.call(e,"callee")};t.exports=u},{"./_baseIsArguments":83,"./isObjectLike":157}],150:[function(e,t,n){var r=Array.isArray;t.exports=r},{}],151:[function(e,t,n){function r(e){return null!=e&&a(e.length)&&!o(e)}var o=e("./isFunction"),a=e("./isLength");t.exports=r},{"./isFunction":154,"./isLength":155}],152:[function(e,t,n){function r(e){return a(e)&&o(e)}var o=e("./isArrayLike"),a=e("./isObjectLike");t.exports=r},{"./isArrayLike":151,"./isObjectLike":157}],153:[function(e,t,n){var r=e("./_root"),o=e("./stubFalse"),a="object"==typeof n&&n&&!n.nodeType&&n,i=a&&"object"==typeof t&&t&&!t.nodeType&&t,s=i&&i.exports===a,u=s?r.Buffer:void 0,c=u?u.isBuffer:void 0,l=c||o;t.exports=l},{"./_root":135,"./stubFalse":163}],154:[function(e,t,n){function r(e){if(!a(e))return!1;var t=o(e);return t==s||t==u||t==i||t==c}var o=e("./_baseGetTag"),a=e("./isObject"),i="[object AsyncFunction]",s="[object Function]",u="[object GeneratorFunction]",c="[object Proxy]";t.exports=r},{"./_baseGetTag":80,"./isObject":156}],155:[function(e,t,n){function r(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=o}var o=9007199254740991;t.exports=r},{}],156:[function(e,t,n){function r(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}t.exports=r},{}],157:[function(e,t,n){function r(e){return null!=e&&"object"==typeof e}t.exports=r},{}],158:[function(e,t,n){function r(e){if(!i(e)||o(e)!=s)return!1;var t=a(e);if(null===t)return!0;var n=d.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&l.call(n)==p}var o=e("./_baseGetTag"),a=e("./_getPrototype"),i=e("./isObjectLike"),s="[object Object]",u=Function.prototype,c=Object.prototype,l=u.toString,d=c.hasOwnProperty,p=l.call(Object);t.exports=r},{"./_baseGetTag":80,"./_getPrototype":105,"./isObjectLike":157}],159:[function(e,t,n){var r=e("./_baseIsTypedArray"),o=e("./_baseUnary"),a=e("./_nodeUtil"),i=a&&a.isTypedArray,s=i?o(i):r;t.exports=s},{"./_baseIsTypedArray":86,"./_baseUnary":91,"./_nodeUtil":131}],160:[function(e,t,n){function r(e){return i(e)?o(e,!0):a(e)}var o=e("./_arrayLikeKeys"),a=e("./_baseKeysIn"),i=e("./isArrayLike");t.exports=r},{"./_arrayLikeKeys":71,"./_baseKeysIn":87,"./isArrayLike":151}],161:[function(e,t,n){
4
+ function r(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(a);var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],a=n.cache;if(a.has(o))return a.get(o);var i=e.apply(this,r);return n.cache=a.set(o,i)||a,i};return n.cache=new(r.Cache||o),n}var o=e("./_MapCache"),a="Expected a function";r.Cache=o,t.exports=r},{"./_MapCache":63}],162:[function(e,t,n){function r(){}t.exports=r},{}],163:[function(e,t,n){function r(){return!1}t.exports=r},{}],164:[function(e,t,n){var r=e("./_baseFlatten"),o=e("./_baseRest"),a=e("./_baseUniq"),i=e("./isArrayLikeObject"),s=o(function(e){return a(r(e,1,i,!0))});t.exports=s},{"./_baseFlatten":79,"./_baseRest":88,"./_baseUniq":92,"./isArrayLikeObject":152}],165:[function(e,t,n){var r=e("./_baseDifference"),o=e("./_baseRest"),a=e("./isArrayLikeObject"),i=o(function(e,t){return a(e)?r(e,t):[]});t.exports=i},{"./_baseDifference":77,"./_baseRest":88,"./isArrayLikeObject":152}],166:[function(e,t,n){var r=e("./_arrayFilter"),o=e("./_baseRest"),a=e("./_baseXor"),i=e("./isArrayLikeObject"),s=o(function(e){return a(r(e,i))});t.exports=s},{"./_arrayFilter":68,"./_baseRest":88,"./_baseXor":93,"./isArrayLikeObject":152}],167:[function(e,t,n){"use strict";function r(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function o(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;var r=Object.getOwnPropertyNames(t).map(function(e){return t[e]});if("0123456789"!==r.join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(e){o[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(a){return!1}}var a=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable;t.exports=o()?Object.assign:function(e,t){for(var n,o,u=r(e),c=1;c<arguments.length;c++){n=Object(arguments[c]);for(var l in n)i.call(n,l)&&(u[l]=n[l]);if(a){o=a(n);for(var d=0;d<o.length;d++)s.call(n,o[d])&&(u[o[d]]=n[o[d]])}}return u}},{}],168:[function(e,t,n){function r(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function a(e){if(d===setTimeout)return setTimeout(e,0);if((d===r||!d)&&setTimeout)return d=setTimeout,setTimeout(e,0);try{return d(e,0)}catch(t){try{return d.call(null,e,0)}catch(t){return d.call(this,e,0)}}}function i(e){if(p===clearTimeout)return clearTimeout(e);if((p===o||!p)&&clearTimeout)return p=clearTimeout,clearTimeout(e);try{return p(e)}catch(t){try{return p.call(null,e)}catch(t){return p.call(this,e)}}}function s(){m&&h&&(m=!1,h.length?v=h.concat(v):g=-1,v.length&&u())}function u(){if(!m){var e=a(s);m=!0;for(var t=v.length;t;){for(h=v,v=[];++g<t;)h&&h[g].run();g=-1,t=v.length}h=null,m=!1,i(e)}}function c(e,t){this.fun=e,this.array=t}function l(){}var d,p,f=t.exports={};!function(){try{d="function"==typeof setTimeout?setTimeout:r}catch(e){d=r}try{p="function"==typeof clearTimeout?clearTimeout:o}catch(e){p=o}}();var h,v=[],m=!1,g=-1;f.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];v.push(new c(e,t)),1!==v.length||m||a(u)},c.prototype.run=function(){this.fun.apply(null,this.array)},f.title="browser",f.browser=!0,f.env={},f.argv=[],f.version="",f.versions={},f.on=l,f.addListener=l,f.once=l,f.off=l,f.removeListener=l,f.removeAllListeners=l,f.emit=l,f.prependListener=l,f.prependOnceListener=l,f.listeners=function(e){return[]},f.binding=function(e){throw new Error("process.binding is not supported")},f.cwd=function(){return"/"},f.chdir=function(e){throw new Error("process.chdir is not supported")},f.umask=function(){return 0}},{}],169:[function(e,t,n){(function(n){"use strict";function r(e,t,r,u,c){if("production"!==n.env.NODE_ENV)for(var l in e)if(e.hasOwnProperty(l)){var d;try{o("function"==typeof e[l],"%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.",u||"React class",r,l),d=e[l](t,l,u,r,null,i)}catch(p){d=p}if(a(!d||d instanceof Error,"%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",u||"React class",r,l,typeof d),d instanceof Error&&!(d.message in s)){s[d.message]=!0;var f=c?c():"";a(!1,"Failed %s type: %s%s",r,d.message,null!=f?f:"")}}}if("production"!==n.env.NODE_ENV)var o=e("fbjs/lib/invariant"),a=e("fbjs/lib/warning"),i=e("./lib/ReactPropTypesSecret"),s={};t.exports=r}).call(this,e("_process"))},{"./lib/ReactPropTypesSecret":174,_process:168,"fbjs/lib/invariant":50,"fbjs/lib/warning":57}],170:[function(e,t,n){"use strict";var r=e("./factoryWithTypeCheckers");t.exports=function(e){var t=!1;return r(e,t)}},{"./factoryWithTypeCheckers":172}],171:[function(e,t,n){"use strict";var r=e("fbjs/lib/emptyFunction"),o=e("fbjs/lib/invariant"),a=e("./lib/ReactPropTypesSecret");t.exports=function(){function e(e,t,n,r,i,s){s!==a&&o(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t};return n.checkPropTypes=r,n.PropTypes=n,n}},{"./lib/ReactPropTypesSecret":174,"fbjs/lib/emptyFunction":42,"fbjs/lib/invariant":50}],172:[function(e,t,n){(function(n){"use strict";var r=e("fbjs/lib/emptyFunction"),o=e("fbjs/lib/invariant"),a=e("fbjs/lib/warning"),i=e("./lib/ReactPropTypesSecret"),s=e("./checkPropTypes");t.exports=function(e,t){function u(e){var t=e&&(I&&e[I]||e[k]);if("function"==typeof t)return t}function c(e,t){return e===t?0!==e||1/e===1/t:e!==e&&t!==t}function l(e){this.message=e,this.stack=""}function d(e){function r(r,c,d,p,f,h,v){if(p=p||x,h=h||d,v!==i)if(t)o(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");else if("production"!==n.env.NODE_ENV&&"undefined"!=typeof console){var m=p+":"+d;!s[m]&&u<3&&(a(!1,"You are manually calling a React.PropTypes validation function for the `%s` prop on `%s`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details.",h,p),s[m]=!0,u++)}return null==c[d]?r?new l(null===c[d]?"The "+f+" `"+h+"` is marked as required "+("in `"+p+"`, but its value is `null`."):"The "+f+" `"+h+"` is marked as required in "+("`"+p+"`, but its value is `undefined`.")):null:e(c,d,p,f,h)}if("production"!==n.env.NODE_ENV)var s={},u=0;var c=r.bind(null,!1);return c.isRequired=r.bind(null,!0),c}function p(e){function t(t,n,r,o,a,i){var s=t[n],u=D(s);if(u!==e){var c=N(s);return new l("Invalid "+o+" `"+a+"` of type "+("`"+c+"` supplied to `"+r+"`, expected ")+("`"+e+"`."))}return null}return d(t)}function f(){return d(r.thatReturnsNull)}function h(e){function t(t,n,r,o,a){if("function"!=typeof e)return new l("Property `"+a+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var s=t[n];if(!Array.isArray(s)){var u=D(s);return new l("Invalid "+o+" `"+a+"` of type "+("`"+u+"` supplied to `"+r+"`, expected an array."))}for(var c=0;c<s.length;c++){var d=e(s,c,r,o,a+"["+c+"]",i);if(d instanceof Error)return d}return null}return d(t)}function v(){function t(t,n,r,o,a){var i=t[n];if(!e(i)){var s=D(i);return new l("Invalid "+o+" `"+a+"` of type "+("`"+s+"` supplied to `"+r+"`, expected a single ReactElement."))}return null}return d(t)}function m(e){function t(t,n,r,o,a){if(!(t[n]instanceof e)){var i=e.name||x,s=T(t[n]);return new l("Invalid "+o+" `"+a+"` of type "+("`"+s+"` supplied to `"+r+"`, expected ")+("instance of `"+i+"`."))}return null}return d(t)}function g(e){function t(t,n,r,o,a){for(var i=t[n],s=0;s<e.length;s++)if(c(i,e[s]))return null;var u=JSON.stringify(e);return new l("Invalid "+o+" `"+a+"` of value `"+i+"` "+("supplied to `"+r+"`, expected one of "+u+"."))}return Array.isArray(e)?d(t):("production"!==n.env.NODE_ENV?a(!1,"Invalid argument supplied to oneOf, expected an instance of array."):void 0,r.thatReturnsNull)}function y(e){function t(t,n,r,o,a){if("function"!=typeof e)return new l("Property `"+a+"` of component `"+r+"` has invalid PropType notation inside objectOf.");var s=t[n],u=D(s);if("object"!==u)return new l("Invalid "+o+" `"+a+"` of type "+("`"+u+"` supplied to `"+r+"`, expected an object."));for(var c in s)if(s.hasOwnProperty(c)){var d=e(s,c,r,o,a+"."+c,i);if(d instanceof Error)return d}return null}return d(t)}function b(e){function t(t,n,r,o,a){for(var s=0;s<e.length;s++){var u=e[s];if(null==u(t,n,r,o,a,i))return null}return new l("Invalid "+o+" `"+a+"` supplied to "+("`"+r+"`."))}if(!Array.isArray(e))return"production"!==n.env.NODE_ENV?a(!1,"Invalid argument supplied to oneOfType, expected an instance of array."):void 0,r.thatReturnsNull;for(var o=0;o<e.length;o++){var s=e[o];if("function"!=typeof s)return a(!1,"Invalid argument supplid to oneOfType. Expected an array of check functions, but received %s at index %s.",w(s),o),r.thatReturnsNull}return d(t)}function _(){function e(e,t,n,r,o){return O(e[t])?null:new l("Invalid "+r+" `"+o+"` supplied to "+("`"+n+"`, expected a ReactNode."))}return d(e)}function E(e){function t(t,n,r,o,a){var s=t[n],u=D(s);if("object"!==u)return new l("Invalid "+o+" `"+a+"` of type `"+u+"` "+("supplied to `"+r+"`, expected `object`."));for(var c in e){var d=e[c];if(d){var p=d(s,c,r,o,a+"."+c,i);if(p)return p}}return null}return d(t)}function O(t){switch(typeof t){case"number":case"string":case"undefined":return!0;case"boolean":return!t;case"object":if(Array.isArray(t))return t.every(O);if(null===t||e(t))return!0;var n=u(t);if(!n)return!1;var r,o=n.call(t);if(n!==t.entries){for(;!(r=o.next()).done;)if(!O(r.value))return!1}else for(;!(r=o.next()).done;){var a=r.value;if(a&&!O(a[1]))return!1}return!0;default:return!1}}function C(e,t){return"symbol"===e||("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}function D(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":C(t,e)?"symbol":t}function N(e){if("undefined"==typeof e||null===e)return""+e;var t=D(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function w(e){var t=N(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}function T(e){return e.constructor&&e.constructor.name?e.constructor.name:x}var I="function"==typeof Symbol&&Symbol.iterator,k="@@iterator",x="<<anonymous>>",S={array:p("array"),bool:p("boolean"),func:p("function"),number:p("number"),object:p("object"),string:p("string"),symbol:p("symbol"),any:f(),arrayOf:h,element:v(),instanceOf:m,node:_(),objectOf:y,oneOf:g,oneOfType:b,shape:E};return l.prototype=Error.prototype,S.checkPropTypes=s,S.PropTypes=S,S}}).call(this,e("_process"))},{"./checkPropTypes":169,"./lib/ReactPropTypesSecret":174,_process:168,"fbjs/lib/emptyFunction":42,"fbjs/lib/invariant":50,"fbjs/lib/warning":57}],173:[function(e,t,n){(function(n){if("production"!==n.env.NODE_ENV){var r="function"==typeof Symbol&&Symbol["for"]&&Symbol["for"]("react.element")||60103,o=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},a=!0;t.exports=e("./factoryWithTypeCheckers")(o,a)}else t.exports=e("./factoryWithThrowingShims")()}).call(this,e("_process"))},{"./factoryWithThrowingShims":171,"./factoryWithTypeCheckers":172,_process:168}],174:[function(e,t,n){"use strict";var r="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";t.exports=r},{}],175:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(n,"__esModule",{value:!0}),n.isSafari=n.isFirefox=void 0;var o=e("lodash/memoize"),a=r(o);n.isFirefox=(0,a["default"])(function(){return/firefox/i.test(navigator.userAgent)}),n.isSafari=(0,a["default"])(function(){return Boolean(window.safari)})},{"lodash/memoize":161}],176:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=e("lodash/union"),s=r(i),u=e("lodash/without"),c=r(u),l=function(){function e(){o(this,e),this.entered=[]}return a(e,[{key:"enter",value:function(e){var t=this.entered.length,n=function(t){return document.documentElement.contains(t)&&(!t.contains||t.contains(e))};return this.entered=(0,s["default"])(this.entered.filter(n),[e]),0===t&&this.entered.length>0}},{key:"leave",value:function(e){var t=this.entered.length;return this.entered=(0,c["default"])(this.entered.filter(function(e){return document.documentElement.contains(e)}),e),t>0&&0===this.entered.length}},{key:"reset",value:function(){this.entered=[]}}]),e}();n["default"]=l},{"lodash/union":164,"lodash/without":165}],177:[function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}function o(e){return e&&e.__esModule?e:{"default":e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=e("lodash/defaults"),u=o(s),c=e("./shallowEqual"),l=o(c),d=e("./EnterLeaveCounter"),p=o(d),f=e("./BrowserDetector"),h=e("./OffsetUtils"),v=e("./NativeDragSources"),m=e("./NativeTypes"),g=r(m),y=function(){function e(t){a(this,e),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.context=t.getContext(),this.sourcePreviewNodes={},this.sourcePreviewNodeOptions={},this.sourceNodes={},this.sourceNodeOptions={},this.enterLeaveCounter=new p["default"],this.dragStartSourceIds=[],this.dropTargetIds=[],this.dragEnterTargetIds=[],this.currentNativeSource=null,this.currentNativeHandle=null,this.currentDragSourceNode=null,this.currentDragSourceNodeOffset=null,this.currentDragSourceNodeOffsetChanged=!1,this.altKeyPressed=!1,this.getSourceClientOffset=this.getSourceClientOffset.bind(this),this.handleTopDragStart=this.handleTopDragStart.bind(this),this.handleTopDragStartCapture=this.handleTopDragStartCapture.bind(this),this.handleTopDragEndCapture=this.handleTopDragEndCapture.bind(this),this.handleTopDragEnter=this.handleTopDragEnter.bind(this),this.handleTopDragEnterCapture=this.handleTopDragEnterCapture.bind(this),this.handleTopDragLeaveCapture=this.handleTopDragLeaveCapture.bind(this),this.handleTopDragOver=this.handleTopDragOver.bind(this),this.handleTopDragOverCapture=this.handleTopDragOverCapture.bind(this),this.handleTopDrop=this.handleTopDrop.bind(this),this.handleTopDropCapture=this.handleTopDropCapture.bind(this),this.handleSelectStart=this.handleSelectStart.bind(this),this.endDragIfSourceWasRemovedFromDOM=this.endDragIfSourceWasRemovedFromDOM.bind(this),this.endDragNativeItem=this.endDragNativeItem.bind(this),this.asyncEndDragNativeItem=this.asyncEndDragNativeItem.bind(this)}return i(e,[{key:"setup",value:function(){if(void 0!==this.window){if(this.window.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");this.window.__isReactDndBackendSetUp=!0,this.addEventListeners(this.window)}}},{key:"teardown",value:function(){void 0!==this.window&&(this.window.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.window),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId&&this.window.cancelAnimationFrame(this.asyncEndDragFrameId))}},{key:"addEventListeners",value:function(e){e.addEventListener("dragstart",this.handleTopDragStart),e.addEventListener("dragstart",this.handleTopDragStartCapture,!0),e.addEventListener("dragend",this.handleTopDragEndCapture,!0),e.addEventListener("dragenter",this.handleTopDragEnter),e.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.addEventListener("dragover",this.handleTopDragOver),e.addEventListener("dragover",this.handleTopDragOverCapture,!0),e.addEventListener("drop",this.handleTopDrop),e.addEventListener("drop",this.handleTopDropCapture,!0)}},{key:"removeEventListeners",value:function(e){e.removeEventListener("dragstart",this.handleTopDragStart),e.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),e.removeEventListener("dragend",this.handleTopDragEndCapture,!0),e.removeEventListener("dragenter",this.handleTopDragEnter),e.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.removeEventListener("dragover",this.handleTopDragOver),e.removeEventListener("dragover",this.handleTopDragOverCapture,!0),e.removeEventListener("drop",this.handleTopDrop),e.removeEventListener("drop",this.handleTopDropCapture,!0)}},{key:"connectDragPreview",value:function(e,t,n){var r=this;return this.sourcePreviewNodeOptions[e]=n,this.sourcePreviewNodes[e]=t,function(){delete r.sourcePreviewNodes[e],delete r.sourcePreviewNodeOptions[e]}}},{key:"connectDragSource",value:function(e,t,n){var r=this;this.sourceNodes[e]=t,this.sourceNodeOptions[e]=n;var o=function(t){return r.handleDragStart(t,e)},a=function(t){return r.handleSelectStart(t,e)};return t.setAttribute("draggable",!0),t.addEventListener("dragstart",o),t.addEventListener("selectstart",a),function(){delete r.sourceNodes[e],delete r.sourceNodeOptions[e],t.removeEventListener("dragstart",o),t.removeEventListener("selectstart",a),t.setAttribute("draggable",!1)}}},{key:"connectDropTarget",value:function(e,t){var n=this,r=function(t){return n.handleDragEnter(t,e)},o=function(t){return n.handleDragOver(t,e)},a=function(t){return n.handleDrop(t,e)};return t.addEventListener("dragenter",r),t.addEventListener("dragover",o),t.addEventListener("drop",a),function(){t.removeEventListener("dragenter",r),t.removeEventListener("dragover",o),t.removeEventListener("drop",a)}}},{key:"getCurrentSourceNodeOptions",value:function(){var e=this.monitor.getSourceId(),t=this.sourceNodeOptions[e];return(0,u["default"])(t||{},{dropEffect:this.altKeyPressed?"copy":"move"})}},{key:"getCurrentDropEffect",value:function(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}},{key:"getCurrentSourcePreviewNodeOptions",value:function(){var e=this.monitor.getSourceId(),t=this.sourcePreviewNodeOptions[e];return(0,u["default"])(t||{},{anchorX:.5,anchorY:.5,captureDraggingState:!1})}},{key:"getSourceClientOffset",value:function(e){return(0,h.getNodeClientOffset)(this.sourceNodes[e])}},{key:"isDraggingNativeItem",value:function(){var e=this.monitor.getItemType();return Object.keys(g).some(function(t){return g[t]===e})}},{key:"beginDragNativeItem",value:function(e){this.clearCurrentDragSourceNode();var t=(0,v.createNativeDragSource)(e);this.currentNativeSource=new t,this.currentNativeHandle=this.registry.addSource(e,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle]),(0,f.isFirefox)()&&this.window.addEventListener("mouseover",this.asyncEndDragNativeItem,!0)}},{key:"asyncEndDragNativeItem",value:function(){this.asyncEndDragFrameId=this.window.requestAnimationFrame(this.endDragNativeItem),(0,f.isFirefox)()&&(this.window.removeEventListener("mouseover",this.asyncEndDragNativeItem,!0),this.enterLeaveCounter.reset())}},{key:"endDragNativeItem",value:function(){this.isDraggingNativeItem()&&(this.actions.endDrag(),this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)}},{key:"endDragIfSourceWasRemovedFromDOM",value:function(){var e=this.currentDragSourceNode;document.body.contains(e)||this.clearCurrentDragSourceNode()&&this.actions.endDrag()}},{key:"setCurrentDragSourceNode",value:function(e){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=e,this.currentDragSourceNodeOffset=(0,h.getNodeClientOffset)(e),this.currentDragSourceNodeOffsetChanged=!1,this.window.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}},{key:"clearCurrentDragSourceNode",value:function(){return!!this.currentDragSourceNode&&(this.currentDragSourceNode=null,this.currentDragSourceNodeOffset=null,this.currentDragSourceNodeOffsetChanged=!1,this.window.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0),!0)}},{key:"checkIfCurrentDragSourceRectChanged",value:function(){var e=this.currentDragSourceNode;return!!e&&(!!this.currentDragSourceNodeOffsetChanged||(this.currentDragSourceNodeOffsetChanged=!(0,l["default"])((0,h.getNodeClientOffset)(e),this.currentDragSourceNodeOffset),this.currentDragSourceNodeOffsetChanged))}},{key:"handleTopDragStartCapture",value:function(){this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]}},{key:"handleDragStart",value:function(e,t){this.dragStartSourceIds.unshift(t)}},{key:"handleTopDragStart",value:function(e){var t=this,n=this.dragStartSourceIds;this.dragStartSourceIds=null;var r=(0,h.getEventClientOffset)(e);this.actions.beginDrag(n,{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:r});var o=e.dataTransfer,a=(0,v.matchNativeItemType)(o);if(this.monitor.isDragging()){if("function"==typeof o.setDragImage){var i=this.monitor.getSourceId(),s=this.sourceNodes[i],u=this.sourcePreviewNodes[i]||s,c=this.getCurrentSourcePreviewNodeOptions(),l=c.anchorX,d=c.anchorY,p={anchorX:l,anchorY:d},f=(0,h.getDragPreviewOffset)(s,u,r,p);o.setDragImage(u,f.x,f.y)}try{o.setData("application/json",{})}catch(m){}this.setCurrentDragSourceNode(e.target);var g=this.getCurrentSourcePreviewNodeOptions(),y=g.captureDraggingState;y?this.actions.publishDragSource():setTimeout(function(){return t.actions.publishDragSource()})}else if(a)this.beginDragNativeItem(a);else{if(!(o.types||e.target.hasAttribute&&e.target.hasAttribute("draggable")))return;e.preventDefault()}}},{key:"handleTopDragEndCapture",value:function(){this.clearCurrentDragSourceNode()&&this.actions.endDrag()}},{key:"handleTopDragEnterCapture",value:function(e){this.dragEnterTargetIds=[];var t=this.enterLeaveCounter.enter(e.target);if(t&&!this.monitor.isDragging()){var n=e.dataTransfer,r=(0,v.matchNativeItemType)(n);r&&this.beginDragNativeItem(r)}}},{key:"handleDragEnter",value:function(e,t){this.dragEnterTargetIds.unshift(t)}},{key:"handleTopDragEnter",value:function(e){var t=this,n=this.dragEnterTargetIds;if(this.dragEnterTargetIds=[],this.monitor.isDragging()){this.altKeyPressed=e.altKey,(0,f.isFirefox)()||this.actions.hover(n,{clientOffset:(0,h.getEventClientOffset)(e)});var r=n.some(function(e){return t.monitor.canDropOnTarget(e)});r&&(e.preventDefault(),e.dataTransfer.dropEffect=this.getCurrentDropEffect())}}},{key:"handleTopDragOverCapture",value:function(){this.dragOverTargetIds=[]}},{key:"handleDragOver",value:function(e,t){this.dragOverTargetIds.unshift(t)}},{key:"handleTopDragOver",value:function(e){var t=this,n=this.dragOverTargetIds;if(this.dragOverTargetIds=[],!this.monitor.isDragging())return e.preventDefault(),void(e.dataTransfer.dropEffect="none");this.altKeyPressed=e.altKey,this.actions.hover(n,{clientOffset:(0,h.getEventClientOffset)(e)});var r=n.some(function(e){return t.monitor.canDropOnTarget(e)});r?(e.preventDefault(),e.dataTransfer.dropEffect=this.getCurrentDropEffect()):this.isDraggingNativeItem()?(e.preventDefault(),e.dataTransfer.dropEffect="none"):this.checkIfCurrentDragSourceRectChanged()&&(e.preventDefault(),e.dataTransfer.dropEffect="move")}},{key:"handleTopDragLeaveCapture",value:function(e){this.isDraggingNativeItem()&&e.preventDefault();var t=this.enterLeaveCounter.leave(e.target);t&&this.isDraggingNativeItem()&&this.endDragNativeItem()}},{key:"handleTopDropCapture",value:function(e){this.dropTargetIds=[],e.preventDefault(),this.isDraggingNativeItem()&&this.currentNativeSource.mutateItemByReadingDataTransfer(e.dataTransfer),this.enterLeaveCounter.reset()}},{key:"handleDrop",value:function(e,t){this.dropTargetIds.unshift(t)}},{key:"handleTopDrop",value:function(e){var t=this.dropTargetIds;this.dropTargetIds=[],this.actions.hover(t,{clientOffset:(0,h.getEventClientOffset)(e)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.endDragIfSourceWasRemovedFromDOM()}},{key:"handleSelectStart",value:function(e){var t=e.target;"function"==typeof t.dragDrop&&("INPUT"===t.tagName||"SELECT"===t.tagName||"TEXTAREA"===t.tagName||t.isContentEditable||(e.preventDefault(),t.dragDrop()))}},{key:"window",get:function(){return this.context&&this.context.window?this.context.window:"undefined"!=typeof window?window:void 0}}]),e}();n["default"]=y},{"./BrowserDetector":175,"./EnterLeaveCounter":176,"./NativeDragSources":179,"./NativeTypes":180,"./OffsetUtils":181,"./shallowEqual":184,"lodash/defaults":145}],178:[function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=function(){function e(t,n){r(this,e);for(var o=t.length,a=[],i=0;i<o;i++)a.push(i);a.sort(function(e,n){return t[e]<t[n]?-1:1});for(var s=[],u=[],c=[],l=void 0,d=void 0,p=0;p<o-1;p++)l=t[p+1]-t[p],d=n[p+1]-n[p],u.push(l),s.push(d),c.push(d/l);for(var f=[c[0]],h=0;h<u.length-1;h++){var v=c[h],m=c[h+1];if(v*m<=0)f.push(0);else{l=u[h];var g=u[h+1],y=l+g;f.push(3*y/((y+g)/v+(y+l)/m))}}f.push(c[c.length-1]);for(var b=[],_=[],E=void 0,O=0;O<f.length-1;O++){E=c[O];var C=f[O],D=1/u[O],N=C+f[O+1]-E-E;b.push((E-C-N)*D),_.push(N*D*D)}this.xs=t,this.ys=n,this.c1s=f,this.c2s=b,this.c3s=_}return o(e,[{key:"interpolate",value:function(e){var t=this.xs,n=this.ys,r=this.c1s,o=this.c2s,a=this.c3s,i=t.length-1;if(e===t[i])return n[i];for(var s=0,u=a.length-1,c=void 0;s<=u;){c=Math.floor(.5*(s+u));var l=t[c];if(l<e)s=c+1;else{if(!(l>e))return n[c];u=c-1}}i=Math.max(0,u);var d=e-t[i],p=d*d;return n[i]+r[i]*d+o[i]*p+a[i]*d*p}}]),e}();n["default"]=a},{}],179:[function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}function o(e,t){for(var n in t){var r=t[n];r.configurable=r.enumerable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,n,r)}return e}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(e,t,n){var r=t.reduce(function(t,n){return t||e.getData(n)},null);return null!=r?r:n}function u(e){var t=h[e],n=t.exposeProperty,r=t.matchesTypes,i=t.getData;return function(){function e(){var t,r;a(this,e),this.item=(t={},r={},r[n]=r[n]||{},r[n].get=function(){return console.warn("Browser doesn't allow reading \""+n+'" until the drop event.'),null},o(t,r),t)}return d(e,[{key:"mutateItemByReadingDataTransfer",value:function(e){delete this.item[n],this.item[n]=i(e,r)}},{key:"canDrag",value:function(){return!0}},{key:"beginDrag",value:function(){return this.item}},{key:"isDragging",value:function(e,t){return t===e.getSourceId()}},{key:"endDrag",value:function(){}}]),e}()}function c(e){var t=Array.prototype.slice.call(e.types||[]);return Object.keys(h).filter(function(e){var n=h[e].matchesTypes;return n.some(function(e){return t.indexOf(e)>-1})})[0]||null}Object.defineProperty(n,"__esModule",{value:!0});var l,d=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();n.createNativeDragSource=u,n.matchNativeItemType=c;var p=e("./NativeTypes"),f=r(p),h=(l={},i(l,f.FILE,{exposeProperty:"files",matchesTypes:["Files"],getData:function(e){return Array.prototype.slice.call(e.files)}}),i(l,f.URL,{exposeProperty:"urls",matchesTypes:["Url","text/uri-list"],getData:function(e,t){return s(e,t,"").split("\n")}}),i(l,f.TEXT,{exposeProperty:"text",matchesTypes:["Text","text/plain"],getData:function(e,t){return s(e,t,"")}}),l)},{"./NativeTypes":180}],180:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});n.FILE="__NATIVE_FILE__",n.URL="__NATIVE_URL__",n.TEXT="__NATIVE_TEXT__"},{}],181:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){var t=e.nodeType===l?e:e.parentElement;if(!t)return null;var n=t.getBoundingClientRect(),r=n.top,o=n.left;return{x:o,y:r}}function a(e){return{x:e.clientX,y:e.clientY}}function i(e,t,n,r){var a="IMG"===t.nodeName&&((0,s.isFirefox)()||!document.documentElement.contains(t)),i=a?e:t,u=o(i),l={x:n.x-u.x,y:n.y-u.y},d=e.offsetWidth,p=e.offsetHeight,f=r.anchorX,h=r.anchorY,v=a?t.width:d,m=a?t.height:p;(0,s.isSafari)()&&a&&(m/=window.devicePixelRatio,v/=window.devicePixelRatio);var g=new c["default"]([0,.5,1],[l.x,l.x/d*v,l.x+v-d]),y=new c["default"]([0,.5,1],[l.y,l.y/p*m,l.y+m-p]),b=g.interpolate(f),_=y.interpolate(h);return(0,s.isSafari)()&&a&&(_+=(window.devicePixelRatio-1)*m),{x:b,y:_}}Object.defineProperty(n,"__esModule",{value:!0}),n.getNodeClientOffset=o,n.getEventClientOffset=a,n.getDragPreviewOffset=i;var s=e("./BrowserDetector"),u=e("./MonotonicInterpolant"),c=r(u),l=1},{"./BrowserDetector":175,"./MonotonicInterpolant":178}],182:[function(e,t,n){"use strict";function r(){return o||(o=new Image,o.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),o}Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=r;var o=void 0},{}],183:[function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}function o(e){return e&&e.__esModule?e:{"default":e}}function a(e){return new s["default"](e)}Object.defineProperty(n,"__esModule",{value:!0}),n.getEmptyImage=n.NativeTypes=void 0,n["default"]=a;var i=e("./HTML5Backend"),s=o(i),u=e("./getEmptyImage"),c=o(u),l=e("./NativeTypes"),d=r(l);n.NativeTypes=d,n.getEmptyImage=c["default"]},{"./HTML5Backend":177,"./NativeTypes":180,"./getEmptyImage":182}],184:[function(e,t,n){"use strict";function r(e,t){if(e===t)return!0;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var o=Object.prototype.hasOwnProperty,a=0;a<n.length;a+=1){if(!o.call(t,n[a])||e[n[a]]!==t[n[a]])return!1;var i=e[n[a]],s=t[n[a]];if(i!==s)return!1}return!0}Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=r},{}],185:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
5
+ return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(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)}function s(e){E["default"].apply(void 0,["DragDropContext","backend"].concat(Array.prototype.slice.call(arguments)));var t=D(e),n=C(t);return function(e){var t,r,s=e.displayName||e.name||"Component",l=(r=t=function(t){function r(){return o(this,r),a(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return i(r,t),c(r,[{key:"getDecoratedComponentInstance",value:function(){return(0,g["default"])(this.child,"In order to access an instance of the decorated component it can not be a stateless component."),this.child}},{key:"getManager",value:function(){return n.dragDropManager}},{key:"getChildContext",value:function(){return n}},{key:"render",value:function(){var t=this;return p["default"].createElement(e,u({},this.props,{ref:function(e){return t.child=e}}))}}]),r}(d.Component),t.DecoratedComponent=e,t.displayName="DragDropContext("+s+")",t.childContextTypes=O,r);return(0,b["default"])(l,e)}}Object.defineProperty(n,"__esModule",{value:!0}),n.unpackBackendForEs5Users=n.createChildContext=n.CHILD_CONTEXT_TYPES=void 0;var u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};n["default"]=s;var d=e("react"),p=r(d),f=e("prop-types"),h=r(f),v=e("dnd-core"),m=e("invariant"),g=r(m),y=e("hoist-non-react-statics"),b=r(y),_=e("./utils/checkDecoratorArguments"),E=r(_),O=n.CHILD_CONTEXT_TYPES={dragDropManager:h["default"].object.isRequired},C=n.createChildContext=function(e,t){return{dragDropManager:new v.DragDropManager(e,t)}},D=n.unpackBackendForEs5Users=function(e){var t=e;return"object"===("undefined"==typeof t?"undefined":l(t))&&"function"==typeof t["default"]&&(t=t["default"]),(0,g["default"])("function"==typeof t,"Expected the backend to be a function or an ES6 module exporting a default function. Read more: http://react-dnd.github.io/react-dnd/docs-drag-drop-context.html"),t}},{"./utils/checkDecoratorArguments":201,"dnd-core":26,"hoist-non-react-statics":58,invariant:59,"prop-types":173,react:359}],186:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(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)}Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=void 0;var s,u,c=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=e("react"),d=e("prop-types"),p=r(d),f=e("./DragDropContext"),h=(u=s=function(e){function t(e,n){o(this,t);var r=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return r.backend=(0,f.unpackBackendForEs5Users)(e.backend),r}return i(t,e),c(t,[{key:"getChildContext",value:function(){var e=this,t=function(){return e.props&&e.props.window?e.props.window:e.context&&e.context.window?e.context.window:"undefined"!=typeof window?window:void 0};return(0,f.createChildContext)(this.backend,{window:t()})}},{key:"render",value:function(){return l.Children.only(this.props.children)}}]),t}(l.Component),s.propTypes={backend:p["default"].oneOfType([p["default"].func,p["default"].object]).isRequired,children:p["default"].element.isRequired,window:p["default"].object},s.defaultProps={window:void 0},s.childContextTypes=f.CHILD_CONTEXT_TYPES,s.displayName="DragDropContextProvider",s.contextTypes={window:p["default"].object},u);n["default"]=h},{"./DragDropContext":185,"prop-types":173,react:359}],187:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(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)}function s(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return w["default"].apply(void 0,["DragLayer","collect[, options]"].concat(Array.prototype.slice.call(arguments))),(0,_["default"])("function"==typeof e,'Expected "collect" provided as the first argument to DragLayer to be a function that collects props to inject into the component. ',"Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs-drag-layer.html",e),(0,_["default"])((0,y["default"])(t),'Expected "options" provided as the second argument to DragLayer to be a plain object when specified. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs-drag-layer.html',t),function(n){var r,s,f=t.arePropsEqual,v=void 0===f?D["default"]:f,g=n.displayName||n.name||"Component",y=(s=r=function(t){function r(e,t){o(this,r);var n=a(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e));return n.handleChange=n.handleChange.bind(n),n.manager=t.dragDropManager,(0,_["default"])("object"===c(n.manager),"Could not find the drag and drop manager in the context of %s. Make sure to wrap the top-level component of your app with DragDropContext. Read more: http://react-dnd.github.io/react-dnd/docs-troubleshooting.html#could-not-find-the-drag-and-drop-manager-in-the-context",g,g),n.state=n.getCurrentState(),n}return i(r,t),l(r,[{key:"getDecoratedComponentInstance",value:function(){return(0,_["default"])(this.child,"In order to access an instance of the decorated component it can not be a stateless component."),this.child}},{key:"shouldComponentUpdate",value:function(e,t){return!v(e,this.props)||!(0,O["default"])(t,this.state)}}]),l(r,[{key:"componentDidMount",value:function(){this.isCurrentlyMounted=!0;var e=this.manager.getMonitor();this.unsubscribeFromOffsetChange=e.subscribeToOffsetChange(this.handleChange),this.unsubscribeFromStateChange=e.subscribeToStateChange(this.handleChange),this.handleChange()}},{key:"componentWillUnmount",value:function(){this.isCurrentlyMounted=!1,this.unsubscribeFromOffsetChange(),this.unsubscribeFromStateChange()}},{key:"handleChange",value:function(){if(this.isCurrentlyMounted){var e=this.getCurrentState();(0,O["default"])(e,this.state)||this.setState(e)}}},{key:"getCurrentState",value:function(){var t=this.manager.getMonitor();return e(t)}},{key:"render",value:function(){var e=this;return p["default"].createElement(n,u({},this.props,this.state,{ref:function(t){return e.child=t}}))}}]),r}(d.Component),r.DecoratedComponent=n,r.displayName="DragLayer("+g+")",r.contextTypes={dragDropManager:h["default"].object.isRequired},s);return(0,m["default"])(y,n)}}Object.defineProperty(n,"__esModule",{value:!0});var u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},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},l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();n["default"]=s;var d=e("react"),p=r(d),f=e("prop-types"),h=r(f),v=e("hoist-non-react-statics"),m=r(v),g=e("lodash/isPlainObject"),y=r(g),b=e("invariant"),_=r(b),E=e("./utils/shallowEqual"),O=r(E),C=e("./utils/shallowEqualScalar"),D=r(C),N=e("./utils/checkDecoratorArguments"),w=r(N)},{"./utils/checkDecoratorArguments":201,"./utils/shallowEqual":204,"./utils/shallowEqualScalar":205,"hoist-non-react-statics":58,invariant:59,"lodash/isPlainObject":158,"prop-types":173,react:359}],188:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};l["default"].apply(void 0,["DragSource","type, spec, collect[, options]"].concat(Array.prototype.slice.call(arguments)));var o=e;"function"!=typeof e&&((0,i["default"])((0,O["default"])(e),'Expected "type" provided as the first argument to DragSource to be a string, or a function that returns a string given the current props. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs-drag-source.html',e),o=function(){return e}),(0,i["default"])((0,u["default"])(t),'Expected "spec" provided as the second argument to DragSource to be a plain object. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs-drag-source.html',t);var a=(0,m["default"])(t);return(0,i["default"])("function"==typeof n,'Expected "collect" provided as the third argument to DragSource to be a function that returns a plain object of props to inject. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs-drag-source.html',n),(0,i["default"])((0,u["default"])(r),'Expected "options" provided as the fourth argument to DragSource to be a plain object when specified. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs-drag-source.html',n),function(e){return(0,p["default"])({connectBackend:function(e,t){return e.connectDragSource(t)},containerDisplayName:"DragSource",createHandler:a,registerHandler:h["default"],createMonitor:y["default"],createConnector:_["default"],DecoratedComponent:e,getType:o,collect:n,options:r})}}Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=o;var a=e("invariant"),i=r(a),s=e("lodash/isPlainObject"),u=r(s),c=e("./utils/checkDecoratorArguments"),l=r(c),d=e("./decorateHandler"),p=r(d),f=e("./registerSource"),h=r(f),v=e("./createSourceFactory"),m=r(v),g=e("./createSourceMonitor"),y=r(g),b=e("./createSourceConnector"),_=r(b),E=e("./utils/isValidType"),O=r(E)},{"./createSourceConnector":191,"./createSourceFactory":192,"./createSourceMonitor":193,"./decorateHandler":197,"./registerSource":199,"./utils/checkDecoratorArguments":201,"./utils/isValidType":203,invariant:59,"lodash/isPlainObject":158}],189:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};l["default"].apply(void 0,["DropTarget","type, spec, collect[, options]"].concat(Array.prototype.slice.call(arguments)));var o=e;"function"!=typeof e&&((0,i["default"])((0,O["default"])(e,!0),'Expected "type" provided as the first argument to DropTarget to be a string, an array of strings, or a function that returns either given the current props. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs-drop-target.html',e),o=function(){return e}),(0,i["default"])((0,u["default"])(t),'Expected "spec" provided as the second argument to DropTarget to be a plain object. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs-drop-target.html',t);var a=(0,m["default"])(t);return(0,i["default"])("function"==typeof n,'Expected "collect" provided as the third argument to DropTarget to be a function that returns a plain object of props to inject. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs-drop-target.html',n),(0,i["default"])((0,u["default"])(r),'Expected "options" provided as the fourth argument to DropTarget to be a plain object when specified. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs-drop-target.html',n),function(e){return(0,p["default"])({connectBackend:function(e,t){return e.connectDropTarget(t)},containerDisplayName:"DropTarget",createHandler:a,registerHandler:h["default"],createMonitor:y["default"],createConnector:_["default"],DecoratedComponent:e,getType:o,collect:n,options:r})}}Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=o;var a=e("invariant"),i=r(a),s=e("lodash/isPlainObject"),u=r(s),c=e("./utils/checkDecoratorArguments"),l=r(c),d=e("./decorateHandler"),p=r(d),f=e("./registerTarget"),h=r(f),v=e("./createTargetFactory"),m=r(v),g=e("./createTargetMonitor"),y=r(g),b=e("./createTargetConnector"),_=r(b),E=e("./utils/isValidType"),O=r(E)},{"./createTargetConnector":194,"./createTargetFactory":195,"./createTargetMonitor":196,"./decorateHandler":197,"./registerTarget":200,"./utils/checkDecoratorArguments":201,"./utils/isValidType":203,invariant:59,"lodash/isPlainObject":158}],190:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){return t===e||null!==t&&null!==e&&(0,i["default"])(t,e)}Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=o;var a=e("./utils/shallowEqual"),i=r(a)},{"./utils/shallowEqual":204}],191:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){function t(){c&&(c(),c=null),o&&a&&(c=e.connectDragSource(o,a,s))}function n(){p&&(p(),p=null),o&&l&&(p=e.connectDragPreview(o,l,d))}function r(e){e!==o&&(o=e,t(),n())}var o=void 0,a=void 0,s=void 0,c=void 0,l=void 0,d=void 0,p=void 0,f=(0,i["default"])({dragSource:function(e,n){e===a&&(0,u["default"])(n,s)||(a=e,s=n,t())},dragPreview:function(e,t){e===l&&(0,u["default"])(t,d)||(l=e,d=t,n())}});return{receiveHandlerId:r,hooks:f}}Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=o;var a=e("./wrapConnectorHooks"),i=r(a),s=e("./areOptionsEqual"),u=r(s)},{"./areOptionsEqual":190,"./wrapConnectorHooks":206}],192:[function(e,t,n){(function(t){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e){Object.keys(e).forEach(function(t){(0,u["default"])(d.indexOf(t)>-1,'Expected the drag source specification to only have some of the following keys: %s. Instead received a specification with an unexpected "%s" key. Read more: http://react-dnd.github.io/react-dnd/docs-drag-source.html',d.join(", "),t),(0,u["default"])("function"==typeof e[t],"Expected %s in the drag source specification to be a function. Instead received a specification with %s: %s. Read more: http://react-dnd.github.io/react-dnd/docs-drag-source.html",t,t,e[t])}),p.forEach(function(t){(0,u["default"])("function"==typeof e[t],"Expected %s in the drag source specification to be a function. Instead received a specification with %s: %s. Read more: http://react-dnd.github.io/react-dnd/docs-drag-source.html",t,t,e[t])});var n=function(){function n(e){o(this,n),this.monitor=e,this.props=null,this.component=null}return i(n,[{key:"receiveProps",value:function(e){this.props=e}},{key:"receiveComponent",value:function(e){this.component=e}},{key:"canDrag",value:function(){return!e.canDrag||e.canDrag(this.props,this.monitor)}},{key:"isDragging",value:function(t,n){return e.isDragging?e.isDragging(this.props,this.monitor):n===t.getSourceId()}},{key:"beginDrag",value:function(){var n=e.beginDrag(this.props,this.monitor,this.component);return"production"!==t.env.NODE_ENV&&(0,u["default"])((0,l["default"])(n),"beginDrag() must return a plain object that represents the dragged item. Instead received %s. Read more: http://react-dnd.github.io/react-dnd/docs-drag-source.html",n),n}},{key:"endDrag",value:function(){e.endDrag&&e.endDrag(this.props,this.monitor,this.component)}}]),n}();return function(e){return new n(e)}}Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();n["default"]=a;var s=e("invariant"),u=r(s),c=e("lodash/isPlainObject"),l=r(c),d=["canDrag","beginDrag","isDragging","endDrag"],p=["beginDrag"]}).call(this,e("_process"))},{_process:168,invariant:59,"lodash/isPlainObject":158}],193:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e){return new d(e)}Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();n["default"]=a;var s=e("invariant"),u=r(s),c=!1,l=!1,d=function(){function e(t){o(this,e),this.internalMonitor=t.getMonitor()}return i(e,[{key:"receiveHandlerId",value:function(e){this.sourceId=e}},{key:"canDrag",value:function(){(0,u["default"])(!c,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs-drag-source-monitor.html");try{return c=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{c=!1}}},{key:"isDragging",value:function(){(0,u["default"])(!l,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs-drag-source-monitor.html");try{return l=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{l=!1}}},{key:"getItemType",value:function(){return this.internalMonitor.getItemType()}},{key:"getItem",value:function(){return this.internalMonitor.getItem()}},{key:"getDropResult",value:function(){return this.internalMonitor.getDropResult()}},{key:"didDrop",value:function(){return this.internalMonitor.didDrop()}},{key:"getInitialClientOffset",value:function(){return this.internalMonitor.getInitialClientOffset()}},{key:"getInitialSourceClientOffset",value:function(){return this.internalMonitor.getInitialSourceClientOffset()}},{key:"getSourceClientOffset",value:function(){return this.internalMonitor.getSourceClientOffset()}},{key:"getClientOffset",value:function(){return this.internalMonitor.getClientOffset()}},{key:"getDifferenceFromInitialOffset",value:function(){return this.internalMonitor.getDifferenceFromInitialOffset()}}]),e}()},{invariant:59}],194:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){function t(){s&&(s(),s=null),r&&o&&(s=e.connectDropTarget(r,o,a))}function n(e){e!==r&&(r=e,t())}var r=void 0,o=void 0,a=void 0,s=void 0,c=(0,i["default"])({dropTarget:function(e,n){e===o&&(0,u["default"])(n,a)||(o=e,a=n,t())}});return{receiveHandlerId:n,hooks:c}}Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=o;var a=e("./wrapConnectorHooks"),i=r(a),s=e("./areOptionsEqual"),u=r(s)},{"./areOptionsEqual":190,"./wrapConnectorHooks":206}],195:[function(e,t,n){(function(t){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e){Object.keys(e).forEach(function(t){(0,u["default"])(d.indexOf(t)>-1,'Expected the drop target specification to only have some of the following keys: %s. Instead received a specification with an unexpected "%s" key. Read more: http://react-dnd.github.io/react-dnd/docs-drop-target.html',d.join(", "),t),(0,u["default"])("function"==typeof e[t],"Expected %s in the drop target specification to be a function. Instead received a specification with %s: %s. Read more: http://react-dnd.github.io/react-dnd/docs-drop-target.html",t,t,e[t])});var n=function(){function n(e){o(this,n),this.monitor=e,this.props=null,this.component=null}return i(n,[{key:"receiveProps",value:function(e){this.props=e}},{key:"receiveMonitor",value:function(e){this.monitor=e}},{key:"receiveComponent",value:function(e){this.component=e}},{key:"canDrop",value:function(){return!e.canDrop||e.canDrop(this.props,this.monitor)}},{key:"hover",value:function(){e.hover&&e.hover(this.props,this.monitor,this.component)}},{key:"drop",value:function(){if(e.drop){var n=e.drop(this.props,this.monitor,this.component);return"production"!==t.env.NODE_ENV&&(0,u["default"])("undefined"==typeof n||(0,l["default"])(n),"drop() must either return undefined, or an object that represents the drop result. Instead received %s. Read more: http://react-dnd.github.io/react-dnd/docs-drop-target.html",n),n}}}]),n}();return function(e){return new n(e)}}Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();n["default"]=a;var s=e("invariant"),u=r(s),c=e("lodash/isPlainObject"),l=r(c),d=["canDrop","hover","drop"]}).call(this,e("_process"))},{_process:168,invariant:59,"lodash/isPlainObject":158}],196:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e){return new l(e)}Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();n["default"]=a;var s=e("invariant"),u=r(s),c=!1,l=function(){function e(t){o(this,e),this.internalMonitor=t.getMonitor()}return i(e,[{key:"receiveHandlerId",value:function(e){this.targetId=e}},{key:"canDrop",value:function(){(0,u["default"])(!c,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs-drop-target-monitor.html");try{return c=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{c=!1}}},{key:"isOver",value:function(e){return this.internalMonitor.isOverTarget(this.targetId,e)}},{key:"getItemType",value:function(){return this.internalMonitor.getItemType()}},{key:"getItem",value:function(){return this.internalMonitor.getItem()}},{key:"getDropResult",value:function(){return this.internalMonitor.getDropResult()}},{key:"didDrop",value:function(){return this.internalMonitor.didDrop()}},{key:"getInitialClientOffset",value:function(){return this.internalMonitor.getInitialClientOffset()}},{key:"getInitialSourceClientOffset",value:function(){return this.internalMonitor.getInitialSourceClientOffset()}},{key:"getSourceClientOffset",value:function(){return this.internalMonitor.getSourceClientOffset()}},{key:"getClientOffset",value:function(){return this.internalMonitor.getClientOffset()}},{key:"getDifferenceFromInitialOffset",value:function(){return this.internalMonitor.getDifferenceFromInitialOffset()}}]),e}()},{invariant:59}],197:[function(e,t,n){(function(t){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(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)}function s(e){var n,r,s=e.DecoratedComponent,f=e.createHandler,m=e.createMonitor,y=e.createConnector,_=e.registerHandler,O=e.containerDisplayName,D=e.getType,w=e.collect,T=e.options,I=T.arePropsEqual,k=void 0===I?N["default"]:I,x=s.displayName||s.name||"Component",S=(r=n=function(e){function n(e,t){o(this,n);var r=a(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e,t));return r.handleChange=r.handleChange.bind(r),r.handleChildRef=r.handleChildRef.bind(r),(0,b["default"])("object"===c(r.context.dragDropManager),"Could not find the drag and drop manager in the context of %s. Make sure to wrap the top-level component of your app with DragDropContext. Read more: http://react-dnd.github.io/react-dnd/docs-troubleshooting.html#could-not-find-the-drag-and-drop-manager-in-the-context",x,x),r.manager=r.context.dragDropManager,r.handlerMonitor=m(r.manager),r.handlerConnector=y(r.manager.getBackend()),r.handler=f(r.handlerMonitor),r.disposable=new v.SerialDisposable,r.receiveProps(e),r.state=r.getCurrentState(),r.dispose(),r}return i(n,e),l(n,[{key:"getHandlerId",value:function(){return this.handlerId}},{key:"getDecoratedComponentInstance",value:function(){return this.decoratedComponentInstance}},{key:"shouldComponentUpdate",value:function(e,t){return!k(e,this.props)||!(0,C["default"])(t,this.state)}}]),l(n,[{key:"componentDidMount",value:function(){this.isCurrentlyMounted=!0,this.disposable=new v.SerialDisposable,this.currentType=null,this.receiveProps(this.props),this.handleChange()}},{key:"componentWillReceiveProps",value:function(e){k(e,this.props)||(this.receiveProps(e),this.handleChange())}},{key:"componentWillUnmount",value:function(){this.dispose(),this.isCurrentlyMounted=!1}},{key:"receiveProps",value:function(e){this.handler.receiveProps(e),this.receiveType(D(e))}},{key:"receiveType",value:function(e){if(e!==this.currentType){this.currentType=e;var t=_(e,this.handler,this.manager),n=t.handlerId,r=t.unregister;this.handlerId=n,this.handlerMonitor.receiveHandlerId(n),this.handlerConnector.receiveHandlerId(n);var o=this.manager.getMonitor(),a=o.subscribeToStateChange(this.handleChange,{handlerIds:[n]});this.disposable.setDisposable(new v.CompositeDisposable(new v.Disposable(a),new v.Disposable(r)))}}},{key:"handleChange",value:function(){if(this.isCurrentlyMounted){var e=this.getCurrentState();(0,C["default"])(e,this.state)||this.setState(e)}}},{key:"dispose",value:function(){this.disposable.dispose(),this.handlerConnector.receiveHandlerId(null)}},{key:"handleChildRef",value:function(e){this.decoratedComponentInstance=e,this.handler.receiveComponent(e)}},{key:"getCurrentState",value:function(){var e=w(this.handlerConnector.hooks,this.handlerMonitor);return"production"!==t.env.NODE_ENV&&(0,b["default"])((0,g["default"])(e),"Expected `collect` specified as the second argument to %s for %s to return a plain object of props to inject. Instead, received %s.",O,x,e),e}},{key:"render",value:function(){return p["default"].createElement(s,u({},this.props,this.state,{ref:this.handleChildRef}))}}]),n}(d.Component),n.DecoratedComponent=s,n.displayName=O+"("+x+")",n.contextTypes={dragDropManager:h["default"].object.isRequired},r);return(0,E["default"])(S,s)}Object.defineProperty(n,"__esModule",{value:!0});var u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},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},l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();n["default"]=s;var d=e("react"),p=r(d),f=e("prop-types"),h=r(f),v=e("disposables"),m=e("lodash/isPlainObject"),g=r(m),y=e("invariant"),b=r(y),_=e("hoist-non-react-statics"),E=r(_),O=e("./utils/shallowEqual"),C=r(O),D=e("./utils/shallowEqualScalar"),N=r(D)}).call(this,e("_process"))},{"./utils/shallowEqual":204,"./utils/shallowEqualScalar":205,_process:168,disposables:16,"hoist-non-react-statics":58,invariant:59,"lodash/isPlainObject":158,"prop-types":173,react:359}],198:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(n,"__esModule",{value:!0});var o=e("./DragDropContext");Object.defineProperty(n,"DragDropContext",{enumerable:!0,get:function(){return r(o)["default"]}});var a=e("./DragDropContextProvider");Object.defineProperty(n,"DragDropContextProvider",{enumerable:!0,get:function(){return r(a)["default"]}});var i=e("./DragLayer");Object.defineProperty(n,"DragLayer",{enumerable:!0,get:function(){return r(i)["default"]}});var s=e("./DragSource");Object.defineProperty(n,"DragSource",{enumerable:!0,get:function(){return r(s)["default"]}});var u=e("./DropTarget");Object.defineProperty(n,"DropTarget",{enumerable:!0,get:function(){return r(u)["default"]}})},{"./DragDropContext":185,"./DragDropContextProvider":186,"./DragLayer":187,"./DragSource":188,"./DropTarget":189}],199:[function(e,t,n){"use strict";function r(e,t,n){function r(){o.removeSource(a)}var o=n.getRegistry(),a=o.addSource(e,t);return{handlerId:a,unregister:r}}Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=r},{}],200:[function(e,t,n){"use strict";function r(e,t,n){function r(){o.removeTarget(a)}var o=n.getRegistry(),a=o.addTarget(e,t);return{handlerId:a,unregister:r}}Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=r},{}],201:[function(e,t,n){(function(e){"use strict";function t(t,n){if("production"!==e.env.NODE_ENV)for(var r=0;r<(arguments.length<=2?0:arguments.length-2);r+=1){var o=arguments.length<=r+2?void 0:arguments[r+2];if(o&&o.prototype&&o.prototype.render)return void console.error("You seem to be applying the arguments in the wrong order. "+("It should be "+t+"("+n+")(Component), not the other way around. ")+"Read more: http://react-dnd.github.io/react-dnd/docs-troubleshooting.html#you-seem-to-be-applying-the-arguments-in-the-wrong-order")}}Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=t}).call(this,e("_process"))},{_process:168}],202:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){var n=e.ref;return(0,i["default"])("string"!=typeof n,"Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://facebook.github.io/react/docs/more-about-refs.html#the-ref-callback-attribute"),n?(0,s.cloneElement)(e,{ref:function(e){t(e),n&&n(e)}}):(0,s.cloneElement)(e,{ref:t})}Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=o;var a=e("invariant"),i=r(a),s=e("react")},{invariant:59,react:359}],203:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){return"string"==typeof e||"symbol"===("undefined"==typeof e?"undefined":a(e))||t&&(0,s["default"])(e)&&e.every(function(e){return o(e,!1)})}Object.defineProperty(n,"__esModule",{value:!0});var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){
6
+ return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};n["default"]=o;var i=e("lodash/isArray"),s=r(i)},{"lodash/isArray":150}],204:[function(e,t,n){arguments[4][184][0].apply(n,arguments)},{dup:184}],205:[function(e,t,n){"use strict";function r(e,t){if(e===t)return!0;if("object"!==("undefined"==typeof e?"undefined":o(e))||null===e||"object"!==("undefined"==typeof t?"undefined":o(t))||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var a=Object.prototype.hasOwnProperty,i=0;i<n.length;i+=1){if(!a.call(t,n[i]))return!1;var s=e[n[i]],u=t[n[i]];if(s!==u||"object"===("undefined"==typeof s?"undefined":o(s))||"object"===("undefined"==typeof u?"undefined":o(u)))return!1}return!0}Object.defineProperty(n,"__esModule",{value:!0});var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};n["default"]=r},{}],206:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){if("string"!=typeof e.type){var t=e.type.displayName||e.type.name||"the component";throw new Error("Only native element nodes can now be passed to React DnD connectors."+("You can either wrap "+t+" into a <div>, or turn it into a ")+"drag source or a drop target itself.")}}function a(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!(0,s.isValidElement)(t)){var r=t;return void e(r,n)}var a=t;o(a);var i=n?function(t){return e(t,n)}:e;return(0,c["default"])(a,i)}}function i(e){var t={};return Object.keys(e).forEach(function(n){var r=e[n],o=a(r);t[n]=function(){return o}}),t}Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=i;var s=e("react"),u=e("./utils/cloneWithRef"),c=r(u)},{"./utils/cloneWithRef":202,react:359}],207:[function(e,t,n){"use strict";t.exports=e("./lib/ReactDOM")},{"./lib/ReactDOM":237}],208:[function(e,t,n){"use strict";var r={Properties:{"aria-current":0,"aria-details":0,"aria-disabled":0,"aria-hidden":0,"aria-invalid":0,"aria-keyshortcuts":0,"aria-label":0,"aria-roledescription":0,"aria-autocomplete":0,"aria-checked":0,"aria-expanded":0,"aria-haspopup":0,"aria-level":0,"aria-modal":0,"aria-multiline":0,"aria-multiselectable":0,"aria-orientation":0,"aria-placeholder":0,"aria-pressed":0,"aria-readonly":0,"aria-required":0,"aria-selected":0,"aria-sort":0,"aria-valuemax":0,"aria-valuemin":0,"aria-valuenow":0,"aria-valuetext":0,"aria-atomic":0,"aria-busy":0,"aria-live":0,"aria-relevant":0,"aria-dropeffect":0,"aria-grabbed":0,"aria-activedescendant":0,"aria-colcount":0,"aria-colindex":0,"aria-colspan":0,"aria-controls":0,"aria-describedby":0,"aria-errormessage":0,"aria-flowto":0,"aria-labelledby":0,"aria-owns":0,"aria-posinset":0,"aria-rowcount":0,"aria-rowindex":0,"aria-rowspan":0,"aria-setsize":0},DOMAttributeNames:{},DOMPropertyNames:{}};t.exports=r},{}],209:[function(e,t,n){"use strict";var r=e("./ReactDOMComponentTree"),o=e("fbjs/lib/focusNode"),a={focusDOMComponent:function(){o(r.getNodeFromInstance(this))}};t.exports=a},{"./ReactDOMComponentTree":240,"fbjs/lib/focusNode":44}],210:[function(e,t,n){"use strict";function r(){var e=window.opera;return"object"==typeof e&&"function"==typeof e.version&&parseInt(e.version(),10)<=12}function o(e){return(e.ctrlKey||e.altKey||e.metaKey)&&!(e.ctrlKey&&e.altKey)}function a(e){switch(e){case"topCompositionStart":return w.compositionStart;case"topCompositionEnd":return w.compositionEnd;case"topCompositionUpdate":return w.compositionUpdate}}function i(e,t){return"topKeyDown"===e&&t.keyCode===b}function s(e,t){switch(e){case"topKeyUp":return y.indexOf(t.keyCode)!==-1;case"topKeyDown":return t.keyCode!==b;case"topKeyPress":case"topMouseDown":case"topBlur":return!0;default:return!1}}function u(e){var t=e.detail;return"object"==typeof t&&"data"in t?t.data:null}function c(e,t,n,r){var o,c;if(_?o=a(e):I?s(e,n)&&(o=w.compositionEnd):i(e,n)&&(o=w.compositionStart),!o)return null;C&&(I||o!==w.compositionStart?o===w.compositionEnd&&I&&(c=I.getData()):I=v.getPooled(r));var l=m.getPooled(o,t,n,r);if(c)l.data=c;else{var d=u(n);null!==d&&(l.data=d)}return f.accumulateTwoPhaseDispatches(l),l}function l(e,t){switch(e){case"topCompositionEnd":return u(t);case"topKeyPress":var n=t.which;return n!==D?null:(T=!0,N);case"topTextInput":var r=t.data;return r===N&&T?null:r;default:return null}}function d(e,t){if(I){if("topCompositionEnd"===e||!_&&s(e,t)){var n=I.getData();return v.release(I),I=null,n}return null}switch(e){case"topPaste":return null;case"topKeyPress":return t.which&&!o(t)?String.fromCharCode(t.which):null;case"topCompositionEnd":return C?null:t.data;default:return null}}function p(e,t,n,r){var o;if(o=O?l(e,n):d(e,n),!o)return null;var a=g.getPooled(w.beforeInput,t,n,r);return a.data=o,f.accumulateTwoPhaseDispatches(a),a}var f=e("./EventPropagators"),h=e("fbjs/lib/ExecutionEnvironment"),v=e("./FallbackCompositionState"),m=e("./SyntheticCompositionEvent"),g=e("./SyntheticInputEvent"),y=[9,13,27,32],b=229,_=h.canUseDOM&&"CompositionEvent"in window,E=null;h.canUseDOM&&"documentMode"in document&&(E=document.documentMode);var O=h.canUseDOM&&"TextEvent"in window&&!E&&!r(),C=h.canUseDOM&&(!_||E&&E>8&&E<=11),D=32,N=String.fromCharCode(D),w={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["topCompositionEnd","topKeyPress","topTextInput","topPaste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:["topBlur","topCompositionEnd","topKeyDown","topKeyPress","topKeyUp","topMouseDown"]},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",captured:"onCompositionStartCapture"},dependencies:["topBlur","topCompositionStart","topKeyDown","topKeyPress","topKeyUp","topMouseDown"]},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:["topBlur","topCompositionUpdate","topKeyDown","topKeyPress","topKeyUp","topMouseDown"]}},T=!1,I=null,k={eventTypes:w,extractEvents:function(e,t,n,r){return[c(e,t,n,r),p(e,t,n,r)]}};t.exports=k},{"./EventPropagators":226,"./FallbackCompositionState":227,"./SyntheticCompositionEvent":291,"./SyntheticInputEvent":295,"fbjs/lib/ExecutionEnvironment":36}],211:[function(e,t,n){"use strict";function r(e,t){return e+t.charAt(0).toUpperCase()+t.substring(1)}var o={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},a=["Webkit","ms","Moz","O"];Object.keys(o).forEach(function(e){a.forEach(function(t){o[r(t,e)]=o[e]})});var i={background:{backgroundAttachment:!0,backgroundColor:!0,backgroundImage:!0,backgroundPositionX:!0,backgroundPositionY:!0,backgroundRepeat:!0},backgroundPosition:{backgroundPositionX:!0,backgroundPositionY:!0},border:{borderWidth:!0,borderStyle:!0,borderColor:!0},borderBottom:{borderBottomWidth:!0,borderBottomStyle:!0,borderBottomColor:!0},borderLeft:{borderLeftWidth:!0,borderLeftStyle:!0,borderLeftColor:!0},borderRight:{borderRightWidth:!0,borderRightStyle:!0,borderRightColor:!0},borderTop:{borderTopWidth:!0,borderTopStyle:!0,borderTopColor:!0},font:{fontStyle:!0,fontVariant:!0,fontWeight:!0,fontSize:!0,lineHeight:!0,fontFamily:!0},outline:{outlineWidth:!0,outlineStyle:!0,outlineColor:!0}},s={isUnitlessNumber:o,shorthandPropertyExpansions:i};t.exports=s},{}],212:[function(e,t,n){(function(n){"use strict";var r=e("./CSSProperty"),o=e("fbjs/lib/ExecutionEnvironment"),a=e("./ReactInstrumentation"),i=e("fbjs/lib/camelizeStyleName"),s=e("./dangerousStyleValue"),u=e("fbjs/lib/hyphenateStyleName"),c=e("fbjs/lib/memoizeStringOnly"),l=e("fbjs/lib/warning"),d=c(function(e){return u(e)}),p=!1,f="cssFloat";if(o.canUseDOM){var h=document.createElement("div").style;try{h.font=""}catch(v){p=!0}void 0===document.documentElement.style.cssFloat&&(f="styleFloat")}if("production"!==n.env.NODE_ENV)var m=/^(?:webkit|moz|o)[A-Z]/,g=/;\s*$/,y={},b={},_=!1,E=function(e,t){y.hasOwnProperty(e)&&y[e]||(y[e]=!0,"production"!==n.env.NODE_ENV?l(!1,"Unsupported style property %s. Did you mean %s?%s",e,i(e),N(t)):void 0)},O=function(e,t){y.hasOwnProperty(e)&&y[e]||(y[e]=!0,"production"!==n.env.NODE_ENV?l(!1,"Unsupported vendor-prefixed style property %s. Did you mean %s?%s",e,e.charAt(0).toUpperCase()+e.slice(1),N(t)):void 0)},C=function(e,t,r){b.hasOwnProperty(t)&&b[t]||(b[t]=!0,"production"!==n.env.NODE_ENV?l(!1,'Style property values shouldn\'t contain a semicolon.%s Try "%s: %s" instead.',N(r),e,t.replace(g,"")):void 0)},D=function(e,t,r){_||(_=!0,"production"!==n.env.NODE_ENV?l(!1,"`NaN` is an invalid value for the `%s` css style property.%s",e,N(r)):void 0)},N=function(e){if(e){var t=e.getName();if(t)return" Check the render method of `"+t+"`."}return""},w=function(e,t,n){var r;n&&(r=n._currentElement._owner),e.indexOf("-")>-1?E(e,r):m.test(e)?O(e,r):g.test(t)&&C(e,t,r),"number"==typeof t&&isNaN(t)&&D(e,t,r)};var T={createMarkupForStyles:function(e,t){var r="";for(var o in e)if(e.hasOwnProperty(o)){var a=0===o.indexOf("--"),i=e[o];"production"!==n.env.NODE_ENV&&(a||w(o,i,t)),null!=i&&(r+=d(o)+":",r+=s(o,i,t,a)+";")}return r||null},setValueForStyles:function(e,t,o){"production"!==n.env.NODE_ENV&&a.debugTool.onHostOperation({instanceID:o._debugID,type:"update styles",payload:t});var i=e.style;for(var u in t)if(t.hasOwnProperty(u)){var c=0===u.indexOf("--");"production"!==n.env.NODE_ENV&&(c||w(u,t[u],o));var l=s(u,t[u],o,c);if("float"!==u&&"cssFloat"!==u||(u=f),c)i.setProperty(u,l);else if(l)i[u]=l;else{var d=p&&r.shorthandPropertyExpansions[u];if(d)for(var h in d)i[h]="";else i[u]=""}}}};t.exports=T}).call(this,e("_process"))},{"./CSSProperty":211,"./ReactInstrumentation":269,"./dangerousStyleValue":308,_process:168,"fbjs/lib/ExecutionEnvironment":36,"fbjs/lib/camelizeStyleName":38,"fbjs/lib/hyphenateStyleName":49,"fbjs/lib/memoizeStringOnly":53,"fbjs/lib/warning":57}],213:[function(e,t,n){(function(n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=e("./reactProdInvariant"),a=e("./PooledClass"),i=e("fbjs/lib/invariant"),s=function(){function e(t){r(this,e),this._callbacks=null,this._contexts=null,this._arg=t}return e.prototype.enqueue=function(e,t){this._callbacks=this._callbacks||[],this._callbacks.push(e),this._contexts=this._contexts||[],this._contexts.push(t)},e.prototype.notifyAll=function(){var e=this._callbacks,t=this._contexts,r=this._arg;if(e&&t){e.length!==t.length?"production"!==n.env.NODE_ENV?i(!1,"Mismatched list of contexts in callback queue"):o("24"):void 0,this._callbacks=null,this._contexts=null;for(var a=0;a<e.length;a++)e[a].call(t[a],r);e.length=0,t.length=0}},e.prototype.checkpoint=function(){return this._callbacks?this._callbacks.length:0},e.prototype.rollback=function(e){this._callbacks&&this._contexts&&(this._callbacks.length=e,this._contexts.length=e)},e.prototype.reset=function(){this._callbacks=null,this._contexts=null},e.prototype.destructor=function(){this.reset()},e}();t.exports=a.addPoolingTo(s)}).call(this,e("_process"))},{"./PooledClass":231,"./reactProdInvariant":327,_process:168,"fbjs/lib/invariant":50}],214:[function(e,t,n){"use strict";function r(e,t,n){var r=w.getPooled(S.change,e,t,n);return r.type="change",O.accumulateTwoPhaseDispatches(r),r}function o(e){var t=e.nodeName&&e.nodeName.toLowerCase();return"select"===t||"input"===t&&"file"===e.type}function a(e){var t=r(P,e,I(e));N.batchedUpdates(i,t)}function i(e){E.enqueueEvents(e),E.processEventQueue(!1)}function s(e,t){R=e,P=t,R.attachEvent("onchange",a)}function u(){R&&(R.detachEvent("onchange",a),R=null,P=null)}function c(e,t){var n=T.updateValueIfChanged(e),r=t.simulated===!0&&A._allowSimulatedPassThrough;if(n||r)return e}function l(e,t){if("topChange"===e)return t}function d(e,t,n){"topFocus"===e?(u(),s(t,n)):"topBlur"===e&&u()}function p(e,t){R=e,P=t,R.attachEvent("onpropertychange",h)}function f(){R&&(R.detachEvent("onpropertychange",h),R=null,P=null)}function h(e){"value"===e.propertyName&&c(P,e)&&a(e)}function v(e,t,n){"topFocus"===e?(f(),p(t,n)):"topBlur"===e&&f()}function m(e,t,n){if("topSelectionChange"===e||"topKeyUp"===e||"topKeyDown"===e)return c(P,n)}function g(e){var t=e.nodeName;return t&&"input"===t.toLowerCase()&&("checkbox"===e.type||"radio"===e.type)}function y(e,t,n){if("topClick"===e)return c(t,n)}function b(e,t,n){if("topInput"===e||"topChange"===e)return c(t,n)}function _(e,t){if(null!=e){var n=e._wrapperState||t._wrapperState;if(n&&n.controlled&&"number"===t.type){var r=""+t.value;t.getAttribute("value")!==r&&t.setAttribute("value",r)}}}var E=e("./EventPluginHub"),O=e("./EventPropagators"),C=e("fbjs/lib/ExecutionEnvironment"),D=e("./ReactDOMComponentTree"),N=e("./ReactUpdates"),w=e("./SyntheticEvent"),T=e("./inputValueTracking"),I=e("./getEventTarget"),k=e("./isEventSupported"),x=e("./isTextInputElement"),S={change:{phasedRegistrationNames:{bubbled:"onChange",captured:"onChangeCapture"},dependencies:["topBlur","topChange","topClick","topFocus","topInput","topKeyDown","topKeyUp","topSelectionChange"]}},R=null,P=null,M=!1;C.canUseDOM&&(M=k("change")&&(!document.documentMode||document.documentMode>8));var j=!1;C.canUseDOM&&(j=k("input")&&(!("documentMode"in document)||document.documentMode>9));var A={eventTypes:S,_allowSimulatedPassThrough:!0,_isInputEventSupported:j,extractEvents:function(e,t,n,a){var i,s,u=t?D.getNodeFromInstance(t):window;if(o(u)?M?i=l:s=d:x(u)?j?i=b:(i=m,s=v):g(u)&&(i=y),i){var c=i(e,t,n);if(c){var p=r(c,n,a);return p}}s&&s(e,u,t),"topBlur"===e&&_(t,u)}};t.exports=A},{"./EventPluginHub":223,"./EventPropagators":226,"./ReactDOMComponentTree":240,"./ReactUpdates":284,"./SyntheticEvent":293,"./getEventTarget":316,"./inputValueTracking":322,"./isEventSupported":324,"./isTextInputElement":325,"fbjs/lib/ExecutionEnvironment":36}],215:[function(e,t,n){(function(n){"use strict";function r(e,t){return Array.isArray(t)&&(t=t[1]),t?t.nextSibling:e.firstChild}function o(e,t,n){l.insertTreeBefore(e,t,n)}function a(e,t,n){Array.isArray(t)?s(e,t[0],t[1],n):g(e,t,n)}function i(e,t){if(Array.isArray(t)){var n=t[1];t=t[0],u(e,t,n),e.removeChild(n)}e.removeChild(t)}function s(e,t,n,r){for(var o=t;;){var a=o.nextSibling;if(g(e,o,r),o===n)break;o=a}}function u(e,t,n){for(;;){var r=t.nextSibling;if(r===n)break;e.removeChild(r)}}function c(e,t,r){var o=e.parentNode,a=e.nextSibling;a===t?r&&g(o,document.createTextNode(r),a):r?(m(a,r),u(o,a,t)):u(o,e,t),"production"!==n.env.NODE_ENV&&f.debugTool.onHostOperation({instanceID:p.getInstanceFromNode(e)._debugID,type:"replace text",payload:r})}var l=e("./DOMLazyTree"),d=e("./Danger"),p=e("./ReactDOMComponentTree"),f=e("./ReactInstrumentation"),h=e("./createMicrosoftUnsafeLocalFunction"),v=e("./setInnerHTML"),m=e("./setTextContent"),g=h(function(e,t,n){e.insertBefore(t,n)}),y=d.dangerouslyReplaceNodeWithMarkup;"production"!==n.env.NODE_ENV&&(y=function(e,t,n){if(d.dangerouslyReplaceNodeWithMarkup(e,t),0!==n._debugID)f.debugTool.onHostOperation({instanceID:n._debugID,type:"replace with",payload:t.toString()});else{var r=p.getInstanceFromNode(t.node);0!==r._debugID&&f.debugTool.onHostOperation({instanceID:r._debugID,type:"mount",payload:t.toString()})}});var b={dangerouslyReplaceNodeWithMarkup:y,replaceDelimitedText:c,processUpdates:function(e,t){if("production"!==n.env.NODE_ENV)var s=p.getInstanceFromNode(e)._debugID;for(var u=0;u<t.length;u++){var c=t[u];switch(c.type){case"INSERT_MARKUP":o(e,c.content,r(e,c.afterNode)),"production"!==n.env.NODE_ENV&&f.debugTool.onHostOperation({instanceID:s,type:"insert child",payload:{toIndex:c.toIndex,content:c.content.toString()}});break;case"MOVE_EXISTING":a(e,c.fromNode,r(e,c.afterNode)),"production"!==n.env.NODE_ENV&&f.debugTool.onHostOperation({instanceID:s,type:"move child",payload:{fromIndex:c.fromIndex,toIndex:c.toIndex}});break;case"SET_MARKUP":v(e,c.content),"production"!==n.env.NODE_ENV&&f.debugTool.onHostOperation({instanceID:s,type:"replace children",payload:c.content.toString()});break;case"TEXT_CONTENT":m(e,c.content),"production"!==n.env.NODE_ENV&&f.debugTool.onHostOperation({instanceID:s,type:"replace text",payload:c.content.toString()});break;case"REMOVE_NODE":i(e,c.fromNode),"production"!==n.env.NODE_ENV&&f.debugTool.onHostOperation({instanceID:s,type:"remove child",payload:{fromIndex:c.fromIndex}})}}}};t.exports=b}).call(this,e("_process"))},{"./DOMLazyTree":216,"./Danger":220,"./ReactDOMComponentTree":240,"./ReactInstrumentation":269,"./createMicrosoftUnsafeLocalFunction":307,"./setInnerHTML":329,"./setTextContent":330,_process:168}],216:[function(e,t,n){"use strict";function r(e){if(m){var t=e.node,n=e.children;if(n.length)for(var r=0;r<n.length;r++)g(t,n[r],null);else null!=e.html?d(t,e.html):null!=e.text&&f(t,e.text)}}function o(e,t){e.parentNode.replaceChild(t.node,e),r(t)}function a(e,t){m?e.children.push(t):e.node.appendChild(t.node)}function i(e,t){m?e.html=t:d(e.node,t)}function s(e,t){m?e.text=t:f(e.node,t)}function u(){return this.node.nodeName}function c(e){return{node:e,children:[],html:null,text:null,toString:u}}var l=e("./DOMNamespaces"),d=e("./setInnerHTML"),p=e("./createMicrosoftUnsafeLocalFunction"),f=e("./setTextContent"),h=1,v=11,m="undefined"!=typeof document&&"number"==typeof document.documentMode||"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent&&/\bEdge\/\d/.test(navigator.userAgent),g=p(function(e,t,n){t.node.nodeType===v||t.node.nodeType===h&&"object"===t.node.nodeName.toLowerCase()&&(null==t.node.namespaceURI||t.node.namespaceURI===l.html)?(r(t),e.insertBefore(t.node,n)):(e.insertBefore(t.node,n),r(t))});c.insertTreeBefore=g,c.replaceChildWithTree=o,c.queueChild=a,c.queueHTML=i,c.queueText=s,t.exports=c},{"./DOMNamespaces":217,"./createMicrosoftUnsafeLocalFunction":307,"./setInnerHTML":329,"./setTextContent":330}],217:[function(e,t,n){"use strict";var r={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"};t.exports=r},{}],218:[function(e,t,n){(function(n){"use strict";function r(e,t){return(e&t)===t}var o=e("./reactProdInvariant"),a=e("fbjs/lib/invariant"),i={MUST_USE_PROPERTY:1,HAS_BOOLEAN_VALUE:4,HAS_NUMERIC_VALUE:8,HAS_POSITIVE_NUMERIC_VALUE:24,HAS_OVERLOADED_BOOLEAN_VALUE:32,injectDOMPropertyConfig:function(e){var t=i,s=e.Properties||{},c=e.DOMAttributeNamespaces||{},l=e.DOMAttributeNames||{},d=e.DOMPropertyNames||{},p=e.DOMMutationMethods||{};e.isCustomAttribute&&u._isCustomAttributeFunctions.push(e.isCustomAttribute);for(var f in s){u.properties.hasOwnProperty(f)?"production"!==n.env.NODE_ENV?a(!1,"injectDOMPropertyConfig(...): You're trying to inject DOM property '%s' which has already been injected. You may be accidentally injecting the same DOM property config twice, or you may be injecting two configs that have conflicting property names.",f):o("48",f):void 0;var h=f.toLowerCase(),v=s[f],m={attributeName:h,attributeNamespace:null,propertyName:f,mutationMethod:null,mustUseProperty:r(v,t.MUST_USE_PROPERTY),hasBooleanValue:r(v,t.HAS_BOOLEAN_VALUE),hasNumericValue:r(v,t.HAS_NUMERIC_VALUE),hasPositiveNumericValue:r(v,t.HAS_POSITIVE_NUMERIC_VALUE),hasOverloadedBooleanValue:r(v,t.HAS_OVERLOADED_BOOLEAN_VALUE)};if(m.hasBooleanValue+m.hasNumericValue+m.hasOverloadedBooleanValue<=1?void 0:"production"!==n.env.NODE_ENV?a(!1,"DOMProperty: Value can be one of boolean, overloaded boolean, or numeric value, but not a combination: %s",f):o("50",f),"production"!==n.env.NODE_ENV&&(u.getPossibleStandardName[h]=f),l.hasOwnProperty(f)){var g=l[f];m.attributeName=g,"production"!==n.env.NODE_ENV&&(u.getPossibleStandardName[g]=f)}c.hasOwnProperty(f)&&(m.attributeNamespace=c[f]),d.hasOwnProperty(f)&&(m.propertyName=d[f]),p.hasOwnProperty(f)&&(m.mutationMethod=p[f]),u.properties[f]=m}}},s=":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",u={ID_ATTRIBUTE_NAME:"data-reactid",ROOT_ATTRIBUTE_NAME:"data-reactroot",ATTRIBUTE_NAME_START_CHAR:s,ATTRIBUTE_NAME_CHAR:s+"\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",properties:{},getPossibleStandardName:"production"!==n.env.NODE_ENV?{autofocus:"autoFocus"}:null,_isCustomAttributeFunctions:[],isCustomAttribute:function(e){for(var t=0;t<u._isCustomAttributeFunctions.length;t++){var n=u._isCustomAttributeFunctions[t];if(n(e))return!0}return!1},injection:i};t.exports=u}).call(this,e("_process"))},{"./reactProdInvariant":327,_process:168,"fbjs/lib/invariant":50}],219:[function(e,t,n){(function(n){"use strict";function r(e){return!!p.hasOwnProperty(e)||!d.hasOwnProperty(e)&&(l.test(e)?(p[e]=!0,!0):(d[e]=!0,"production"!==n.env.NODE_ENV?c(!1,"Invalid attribute name: `%s`",e):void 0,!1))}function o(e,t){return null==t||e.hasBooleanValue&&!t||e.hasNumericValue&&isNaN(t)||e.hasPositiveNumericValue&&t<1||e.hasOverloadedBooleanValue&&t===!1}var a=e("./DOMProperty"),i=e("./ReactDOMComponentTree"),s=e("./ReactInstrumentation"),u=e("./quoteAttributeValueForBrowser"),c=e("fbjs/lib/warning"),l=new RegExp("^["+a.ATTRIBUTE_NAME_START_CHAR+"]["+a.ATTRIBUTE_NAME_CHAR+"]*$"),d={},p={},f={createMarkupForID:function(e){return a.ID_ATTRIBUTE_NAME+"="+u(e)},setAttributeForID:function(e,t){e.setAttribute(a.ID_ATTRIBUTE_NAME,t)},createMarkupForRoot:function(){return a.ROOT_ATTRIBUTE_NAME+'=""'},setAttributeForRoot:function(e){e.setAttribute(a.ROOT_ATTRIBUTE_NAME,"")},createMarkupForProperty:function(e,t){var n=a.properties.hasOwnProperty(e)?a.properties[e]:null;if(n){if(o(n,t))return"";var r=n.attributeName;return n.hasBooleanValue||n.hasOverloadedBooleanValue&&t===!0?r+'=""':r+"="+u(t)}return a.isCustomAttribute(e)?null==t?"":e+"="+u(t):null},createMarkupForCustomAttribute:function(e,t){return r(e)&&null!=t?e+"="+u(t):""},setValueForProperty:function(e,t,r){var u=a.properties.hasOwnProperty(t)?a.properties[t]:null;if(u){var c=u.mutationMethod;if(c)c(e,r);else{if(o(u,r))return void this.deleteValueForProperty(e,t);if(u.mustUseProperty)e[u.propertyName]=r;else{var l=u.attributeName,d=u.attributeNamespace;d?e.setAttributeNS(d,l,""+r):u.hasBooleanValue||u.hasOverloadedBooleanValue&&r===!0?e.setAttribute(l,""):e.setAttribute(l,""+r)}}}else if(a.isCustomAttribute(t))return void f.setValueForAttribute(e,t,r);if("production"!==n.env.NODE_ENV){var p={};p[t]=r,s.debugTool.onHostOperation({instanceID:i.getInstanceFromNode(e)._debugID,type:"update attribute",payload:p})}},setValueForAttribute:function(e,t,o){if(r(t)&&(null==o?e.removeAttribute(t):e.setAttribute(t,""+o),"production"!==n.env.NODE_ENV)){var a={};a[t]=o,s.debugTool.onHostOperation({instanceID:i.getInstanceFromNode(e)._debugID,type:"update attribute",payload:a})}},deleteValueForAttribute:function(e,t){e.removeAttribute(t),"production"!==n.env.NODE_ENV&&s.debugTool.onHostOperation({instanceID:i.getInstanceFromNode(e)._debugID,type:"remove attribute",payload:t})},deleteValueForProperty:function(e,t){var r=a.properties.hasOwnProperty(t)?a.properties[t]:null;if(r){var o=r.mutationMethod;if(o)o(e,void 0);else if(r.mustUseProperty){var u=r.propertyName;r.hasBooleanValue?e[u]=!1:e[u]=""}else e.removeAttribute(r.attributeName)}else a.isCustomAttribute(t)&&e.removeAttribute(t);"production"!==n.env.NODE_ENV&&s.debugTool.onHostOperation({instanceID:i.getInstanceFromNode(e)._debugID,type:"remove attribute",payload:t})}};t.exports=f}).call(this,e("_process"))},{"./DOMProperty":218,"./ReactDOMComponentTree":240,"./ReactInstrumentation":269,"./quoteAttributeValueForBrowser":326,_process:168,"fbjs/lib/warning":57}],220:[function(e,t,n){(function(n){"use strict";var r=e("./reactProdInvariant"),o=e("./DOMLazyTree"),a=e("fbjs/lib/ExecutionEnvironment"),i=e("fbjs/lib/createNodesFromMarkup"),s=e("fbjs/lib/emptyFunction"),u=e("fbjs/lib/invariant"),c={dangerouslyReplaceNodeWithMarkup:function(e,t){if(a.canUseDOM?void 0:"production"!==n.env.NODE_ENV?u(!1,"dangerouslyReplaceNodeWithMarkup(...): Cannot render markup in a worker thread. Make sure `window` and `document` are available globally before requiring React when unit testing or use ReactDOMServer.renderToString() for server rendering."):r("56"),t?void 0:"production"!==n.env.NODE_ENV?u(!1,"dangerouslyReplaceNodeWithMarkup(...): Missing markup."):r("57"),"HTML"===e.nodeName?"production"!==n.env.NODE_ENV?u(!1,"dangerouslyReplaceNodeWithMarkup(...): Cannot replace markup of the <html> node. This is because browser quirks make this unreliable and/or slow. If you want to render to the root you must use server rendering. See ReactDOMServer.renderToString()."):r("58"):void 0,"string"==typeof t){var c=i(t,s)[0];e.parentNode.replaceChild(c,e)}else o.replaceChildWithTree(e,t)}};t.exports=c}).call(this,e("_process"))},{"./DOMLazyTree":216,"./reactProdInvariant":327,_process:168,"fbjs/lib/ExecutionEnvironment":36,"fbjs/lib/createNodesFromMarkup":41,"fbjs/lib/emptyFunction":42,"fbjs/lib/invariant":50}],221:[function(e,t,n){"use strict";var r=["ResponderEventPlugin","SimpleEventPlugin","TapEventPlugin","EnterLeaveEventPlugin","ChangeEventPlugin","SelectEventPlugin","BeforeInputEventPlugin"];t.exports=r},{}],222:[function(e,t,n){"use strict";var r=e("./EventPropagators"),o=e("./ReactDOMComponentTree"),a=e("./SyntheticMouseEvent"),i={mouseEnter:{registrationName:"onMouseEnter",dependencies:["topMouseOut","topMouseOver"]},mouseLeave:{registrationName:"onMouseLeave",dependencies:["topMouseOut","topMouseOver"]}},s={eventTypes:i,extractEvents:function(e,t,n,s){if("topMouseOver"===e&&(n.relatedTarget||n.fromElement))return null;if("topMouseOut"!==e&&"topMouseOver"!==e)return null;var u;if(s.window===s)u=s;else{var c=s.ownerDocument;u=c?c.defaultView||c.parentWindow:window}var l,d;if("topMouseOut"===e){l=t;var p=n.relatedTarget||n.toElement;d=p?o.getClosestInstanceFromNode(p):null}else l=null,d=t;if(l===d)return null;var f=null==l?u:o.getNodeFromInstance(l),h=null==d?u:o.getNodeFromInstance(d),v=a.getPooled(i.mouseLeave,l,n,s);v.type="mouseleave",v.target=f,v.relatedTarget=h;var m=a.getPooled(i.mouseEnter,d,n,s);return m.type="mouseenter",m.target=h,m.relatedTarget=f,r.accumulateEnterLeaveDispatches(v,m,l,d),[v,m]}};t.exports=s},{"./EventPropagators":226,"./ReactDOMComponentTree":240,"./SyntheticMouseEvent":297}],223:[function(e,t,n){(function(n){"use strict";function r(e){return"button"===e||"input"===e||"select"===e||"textarea"===e}function o(e,t,n){switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":return!(!n.disabled||!r(t));default:return!1}}var a=e("./reactProdInvariant"),i=e("./EventPluginRegistry"),s=e("./EventPluginUtils"),u=e("./ReactErrorUtils"),c=e("./accumulateInto"),l=e("./forEachAccumulated"),d=e("fbjs/lib/invariant"),p={},f=null,h=function(e,t){e&&(s.executeDispatchesInOrder(e,t),e.isPersistent()||e.constructor.release(e))},v=function(e){return h(e,!0)},m=function(e){return h(e,!1)},g=function(e){return"."+e._rootNodeID},y={injection:{injectEventPluginOrder:i.injectEventPluginOrder,injectEventPluginsByName:i.injectEventPluginsByName},putListener:function(e,t,r){"function"!=typeof r?"production"!==n.env.NODE_ENV?d(!1,"Expected %s listener to be a function, instead got type %s",t,typeof r):a("94",t,typeof r):void 0;var o=g(e),s=p[t]||(p[t]={});s[o]=r;var u=i.registrationNameModules[t];u&&u.didPutListener&&u.didPutListener(e,t,r)},getListener:function(e,t){var n=p[t];if(o(t,e._currentElement.type,e._currentElement.props))return null;var r=g(e);return n&&n[r]},deleteListener:function(e,t){var n=i.registrationNameModules[t];n&&n.willDeleteListener&&n.willDeleteListener(e,t);var r=p[t];if(r){var o=g(e);delete r[o]}},deleteAllListeners:function(e){var t=g(e);for(var n in p)if(p.hasOwnProperty(n)&&p[n][t]){var r=i.registrationNameModules[n];r&&r.willDeleteListener&&r.willDeleteListener(e,n),delete p[n][t]}},extractEvents:function(e,t,n,r){for(var o,a=i.plugins,s=0;s<a.length;s++){var u=a[s];if(u){var l=u.extractEvents(e,t,n,r);l&&(o=c(o,l))}}return o},enqueueEvents:function(e){e&&(f=c(f,e))},processEventQueue:function(e){var t=f;f=null,e?l(t,v):l(t,m),f?"production"!==n.env.NODE_ENV?d(!1,"processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented."):a("95"):void 0,u.rethrowCaughtError()},__purge:function(){p={}},__getListenerBank:function(){return p}};t.exports=y}).call(this,e("_process"))},{"./EventPluginRegistry":224,"./EventPluginUtils":225,"./ReactErrorUtils":260,"./accumulateInto":304,"./forEachAccumulated":312,"./reactProdInvariant":327,_process:168,"fbjs/lib/invariant":50}],224:[function(e,t,n){(function(n){"use strict";function r(){if(u)for(var e in c){var t=c[e],r=u.indexOf(e);if(r>-1?void 0:"production"!==n.env.NODE_ENV?s(!1,"EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.",e):i("96",e),!l.plugins[r]){t.extractEvents?void 0:"production"!==n.env.NODE_ENV?s(!1,"EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.",e):i("97",e),l.plugins[r]=t;var a=t.eventTypes;for(var d in a)o(a[d],t,d)?void 0:"production"!==n.env.NODE_ENV?s(!1,"EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.",d,e):i("98",d,e)}}}function o(e,t,r){l.eventNameDispatchConfigs.hasOwnProperty(r)?"production"!==n.env.NODE_ENV?s(!1,"EventPluginHub: More than one plugin attempted to publish the same event name, `%s`.",r):i("99",r):void 0,l.eventNameDispatchConfigs[r]=e;var o=e.phasedRegistrationNames;if(o){for(var u in o)if(o.hasOwnProperty(u)){var c=o[u];a(c,t,r)}return!0}return!!e.registrationName&&(a(e.registrationName,t,r),!0)}function a(e,t,r){if(l.registrationNameModules[e]?"production"!==n.env.NODE_ENV?s(!1,"EventPluginHub: More than one plugin attempted to publish the same registration name, `%s`.",e):i("100",e):void 0,l.registrationNameModules[e]=t,l.registrationNameDependencies[e]=t.eventTypes[r].dependencies,"production"!==n.env.NODE_ENV){var o=e.toLowerCase();l.possibleRegistrationNames[o]=e,"onDoubleClick"===e&&(l.possibleRegistrationNames.ondblclick=e)}}var i=e("./reactProdInvariant"),s=e("fbjs/lib/invariant"),u=null,c={},l={plugins:[],eventNameDispatchConfigs:{},registrationNameModules:{},registrationNameDependencies:{},possibleRegistrationNames:"production"!==n.env.NODE_ENV?{}:null,injectEventPluginOrder:function(e){u?"production"!==n.env.NODE_ENV?s(!1,"EventPluginRegistry: Cannot inject event plugin ordering more than once. You are likely trying to load more than one copy of React."):i("101"):void 0,u=Array.prototype.slice.call(e),r()},injectEventPluginsByName:function(e){var t=!1;for(var o in e)if(e.hasOwnProperty(o)){var a=e[o];c.hasOwnProperty(o)&&c[o]===a||(c[o]?"production"!==n.env.NODE_ENV?s(!1,"EventPluginRegistry: Cannot inject two different event plugins using the same name, `%s`.",o):i("102",o):void 0,c[o]=a,t=!0)}t&&r()},getPluginModuleForEvent:function(e){var t=e.dispatchConfig;if(t.registrationName)return l.registrationNameModules[t.registrationName]||null;if(void 0!==t.phasedRegistrationNames){var n=t.phasedRegistrationNames;for(var r in n)if(n.hasOwnProperty(r)){var o=l.registrationNameModules[n[r]];if(o)return o}}return null;
7
+ },_resetEventPlugins:function(){u=null;for(var e in c)c.hasOwnProperty(e)&&delete c[e];l.plugins.length=0;var t=l.eventNameDispatchConfigs;for(var r in t)t.hasOwnProperty(r)&&delete t[r];var o=l.registrationNameModules;for(var a in o)o.hasOwnProperty(a)&&delete o[a];if("production"!==n.env.NODE_ENV){var i=l.possibleRegistrationNames;for(var s in i)i.hasOwnProperty(s)&&delete i[s]}}};t.exports=l}).call(this,e("_process"))},{"./reactProdInvariant":327,_process:168,"fbjs/lib/invariant":50}],225:[function(e,t,n){(function(n){"use strict";function r(e){return"topMouseUp"===e||"topTouchEnd"===e||"topTouchCancel"===e}function o(e){return"topMouseMove"===e||"topTouchMove"===e}function a(e){return"topMouseDown"===e||"topTouchStart"===e}function i(e,t,n,r){var o=e.type||"unknown-event";e.currentTarget=_.getNodeFromInstance(r),t?m.invokeGuardedCallbackWithCatch(o,n,e):m.invokeGuardedCallback(o,n,e),e.currentTarget=null}function s(e,t){var r=e._dispatchListeners,o=e._dispatchInstances;if("production"!==n.env.NODE_ENV&&h(e),Array.isArray(r))for(var a=0;a<r.length&&!e.isPropagationStopped();a++)i(e,t,r[a],o[a]);else r&&i(e,t,r,o);e._dispatchListeners=null,e._dispatchInstances=null}function u(e){var t=e._dispatchListeners,r=e._dispatchInstances;if("production"!==n.env.NODE_ENV&&h(e),Array.isArray(t)){for(var o=0;o<t.length&&!e.isPropagationStopped();o++)if(t[o](e,r[o]))return r[o]}else if(t&&t(e,r))return r;return null}function c(e){var t=u(e);return e._dispatchInstances=null,e._dispatchListeners=null,t}function l(e){"production"!==n.env.NODE_ENV&&h(e);var t=e._dispatchListeners,r=e._dispatchInstances;Array.isArray(t)?"production"!==n.env.NODE_ENV?g(!1,"executeDirectDispatch(...): Invalid `event`."):v("103"):void 0,e.currentTarget=t?_.getNodeFromInstance(r):null;var o=t?t(e):null;return e.currentTarget=null,e._dispatchListeners=null,e._dispatchInstances=null,o}function d(e){return!!e._dispatchListeners}var p,f,h,v=e("./reactProdInvariant"),m=e("./ReactErrorUtils"),g=e("fbjs/lib/invariant"),y=e("fbjs/lib/warning"),b={injectComponentTree:function(e){p=e,"production"!==n.env.NODE_ENV&&("production"!==n.env.NODE_ENV?y(e&&e.getNodeFromInstance&&e.getInstanceFromNode,"EventPluginUtils.injection.injectComponentTree(...): Injected module is missing getNodeFromInstance or getInstanceFromNode."):void 0)},injectTreeTraversal:function(e){f=e,"production"!==n.env.NODE_ENV&&("production"!==n.env.NODE_ENV?y(e&&e.isAncestor&&e.getLowestCommonAncestor,"EventPluginUtils.injection.injectTreeTraversal(...): Injected module is missing isAncestor or getLowestCommonAncestor."):void 0)}};"production"!==n.env.NODE_ENV&&(h=function(e){var t=e._dispatchListeners,r=e._dispatchInstances,o=Array.isArray(t),a=o?t.length:t?1:0,i=Array.isArray(r),s=i?r.length:r?1:0;"production"!==n.env.NODE_ENV?y(i===o&&s===a,"EventPluginUtils: Invalid `event`."):void 0});var _={isEndish:r,isMoveish:o,isStartish:a,executeDirectDispatch:l,executeDispatchesInOrder:s,executeDispatchesInOrderStopAtTrue:c,hasDispatches:d,getInstanceFromNode:function(e){return p.getInstanceFromNode(e)},getNodeFromInstance:function(e){return p.getNodeFromInstance(e)},isAncestor:function(e,t){return f.isAncestor(e,t)},getLowestCommonAncestor:function(e,t){return f.getLowestCommonAncestor(e,t)},getParentInstance:function(e){return f.getParentInstance(e)},traverseTwoPhase:function(e,t,n){return f.traverseTwoPhase(e,t,n)},traverseEnterLeave:function(e,t,n,r,o){return f.traverseEnterLeave(e,t,n,r,o)},injection:b};t.exports=_}).call(this,e("_process"))},{"./ReactErrorUtils":260,"./reactProdInvariant":327,_process:168,"fbjs/lib/invariant":50,"fbjs/lib/warning":57}],226:[function(e,t,n){(function(n){"use strict";function r(e,t,n){var r=t.dispatchConfig.phasedRegistrationNames[n];return y(e,r)}function o(e,t,o){"production"!==n.env.NODE_ENV&&("production"!==n.env.NODE_ENV?g(e,"Dispatching inst must not be null"):void 0);var a=r(e,o,t);a&&(o._dispatchListeners=v(o._dispatchListeners,a),o._dispatchInstances=v(o._dispatchInstances,e))}function a(e){e&&e.dispatchConfig.phasedRegistrationNames&&h.traverseTwoPhase(e._targetInst,o,e)}function i(e){if(e&&e.dispatchConfig.phasedRegistrationNames){var t=e._targetInst,n=t?h.getParentInstance(t):null;h.traverseTwoPhase(n,o,e)}}function s(e,t,n){if(n&&n.dispatchConfig.registrationName){var r=n.dispatchConfig.registrationName,o=y(e,r);o&&(n._dispatchListeners=v(n._dispatchListeners,o),n._dispatchInstances=v(n._dispatchInstances,e))}}function u(e){e&&e.dispatchConfig.registrationName&&s(e._targetInst,null,e)}function c(e){m(e,a)}function l(e){m(e,i)}function d(e,t,n,r){h.traverseEnterLeave(n,r,s,e,t)}function p(e){m(e,u)}var f=e("./EventPluginHub"),h=e("./EventPluginUtils"),v=e("./accumulateInto"),m=e("./forEachAccumulated"),g=e("fbjs/lib/warning"),y=f.getListener,b={accumulateTwoPhaseDispatches:c,accumulateTwoPhaseDispatchesSkipTarget:l,accumulateDirectDispatches:p,accumulateEnterLeaveDispatches:d};t.exports=b}).call(this,e("_process"))},{"./EventPluginHub":223,"./EventPluginUtils":225,"./accumulateInto":304,"./forEachAccumulated":312,_process:168,"fbjs/lib/warning":57}],227:[function(e,t,n){"use strict";function r(e){this._root=e,this._startText=this.getText(),this._fallbackText=null}var o=e("object-assign"),a=e("./PooledClass"),i=e("./getTextContentAccessor");o(r.prototype,{destructor:function(){this._root=null,this._startText=null,this._fallbackText=null},getText:function(){return"value"in this._root?this._root.value:this._root[i()]},getData:function(){if(this._fallbackText)return this._fallbackText;var e,t,n=this._startText,r=n.length,o=this.getText(),a=o.length;for(e=0;e<r&&n[e]===o[e];e++);var i=r-e;for(t=1;t<=i&&n[r-t]===o[a-t];t++);var s=t>1?1-t:void 0;return this._fallbackText=o.slice(e,s),this._fallbackText}}),a.addPoolingTo(r),t.exports=r},{"./PooledClass":231,"./getTextContentAccessor":320,"object-assign":167}],228:[function(e,t,n){"use strict";var r=e("./DOMProperty"),o=r.injection.MUST_USE_PROPERTY,a=r.injection.HAS_BOOLEAN_VALUE,i=r.injection.HAS_NUMERIC_VALUE,s=r.injection.HAS_POSITIVE_NUMERIC_VALUE,u=r.injection.HAS_OVERLOADED_BOOLEAN_VALUE,c={isCustomAttribute:RegExp.prototype.test.bind(new RegExp("^(data|aria)-["+r.ATTRIBUTE_NAME_CHAR+"]*$")),Properties:{accept:0,acceptCharset:0,accessKey:0,action:0,allowFullScreen:a,allowTransparency:0,alt:0,as:0,async:a,autoComplete:0,autoPlay:a,capture:a,cellPadding:0,cellSpacing:0,charSet:0,challenge:0,checked:o|a,cite:0,classID:0,className:0,cols:s,colSpan:0,content:0,contentEditable:0,contextMenu:0,controls:a,coords:0,crossOrigin:0,data:0,dateTime:0,"default":a,defer:a,dir:0,disabled:a,download:u,draggable:0,encType:0,form:0,formAction:0,formEncType:0,formMethod:0,formNoValidate:a,formTarget:0,frameBorder:0,headers:0,height:0,hidden:a,high:0,href:0,hrefLang:0,htmlFor:0,httpEquiv:0,icon:0,id:0,inputMode:0,integrity:0,is:0,keyParams:0,keyType:0,kind:0,label:0,lang:0,list:0,loop:a,low:0,manifest:0,marginHeight:0,marginWidth:0,max:0,maxLength:0,media:0,mediaGroup:0,method:0,min:0,minLength:0,multiple:o|a,muted:o|a,name:0,nonce:0,noValidate:a,open:a,optimum:0,pattern:0,placeholder:0,playsInline:a,poster:0,preload:0,profile:0,radioGroup:0,readOnly:a,referrerPolicy:0,rel:0,required:a,reversed:a,role:0,rows:s,rowSpan:i,sandbox:0,scope:0,scoped:a,scrolling:0,seamless:a,selected:o|a,shape:0,size:s,sizes:0,span:s,spellCheck:0,src:0,srcDoc:0,srcLang:0,srcSet:0,start:i,step:0,style:0,summary:0,tabIndex:0,target:0,title:0,type:0,useMap:0,value:0,width:0,wmode:0,wrap:0,about:0,datatype:0,inlist:0,prefix:0,property:0,resource:0,"typeof":0,vocab:0,autoCapitalize:0,autoCorrect:0,autoSave:0,color:0,itemProp:0,itemScope:a,itemType:0,itemID:0,itemRef:0,results:0,security:0,unselectable:0},DOMAttributeNames:{acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv"},DOMPropertyNames:{},DOMMutationMethods:{value:function(e,t){return null==t?e.removeAttribute("value"):void("number"!==e.type||e.hasAttribute("value")===!1?e.setAttribute("value",""+t):e.validity&&!e.validity.badInput&&e.ownerDocument.activeElement!==e&&e.setAttribute("value",""+t))}}};t.exports=c},{"./DOMProperty":218}],229:[function(e,t,n){"use strict";function r(e){var t=/[=:]/g,n={"=":"=0",":":"=2"},r=(""+e).replace(t,function(e){return n[e]});return"$"+r}function o(e){var t=/(=0|=2)/g,n={"=0":"=","=2":":"},r="."===e[0]&&"$"===e[1]?e.substring(2):e.substring(1);return(""+r).replace(t,function(e){return n[e]})}var a={escape:r,unescape:o};t.exports=a},{}],230:[function(e,t,n){(function(n){"use strict";function r(e){null!=e.checkedLink&&null!=e.valueLink?"production"!==n.env.NODE_ENV?p(!1,"Cannot provide a checkedLink and a valueLink. If you want to use checkedLink, you probably don't want to use valueLink and vice versa."):s("87"):void 0}function o(e){r(e),null!=e.value||null!=e.onChange?"production"!==n.env.NODE_ENV?p(!1,"Cannot provide a valueLink and a value or onChange event. If you want to use value or onChange, you probably don't want to use valueLink."):s("88"):void 0}function a(e){r(e),null!=e.checked||null!=e.onChange?"production"!==n.env.NODE_ENV?p(!1,"Cannot provide a checkedLink and a checked property or onChange event. If you want to use checked or onChange, you probably don't want to use checkedLink"):s("89"):void 0}function i(e){if(e){var t=e.getName();if(t)return" Check the render method of `"+t+"`."}return""}var s=e("./reactProdInvariant"),u=e("./ReactPropTypesSecret"),c=e("prop-types/factory"),l=e("react/lib/React"),d=c(l.isValidElement),p=e("fbjs/lib/invariant"),f=e("fbjs/lib/warning"),h={button:!0,checkbox:!0,image:!0,hidden:!0,radio:!0,reset:!0,submit:!0},v={value:function(e,t,n){return!e[t]||h[e.type]||e.onChange||e.readOnly||e.disabled?null:new Error("You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`.")},checked:function(e,t,n){return!e[t]||e.onChange||e.readOnly||e.disabled?null:new Error("You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`.")},onChange:d.func},m={},g={checkPropTypes:function(e,t,r){for(var o in v){if(v.hasOwnProperty(o))var a=v[o](t,o,e,"prop",null,u);if(a instanceof Error&&!(a.message in m)){m[a.message]=!0;var s=i(r);"production"!==n.env.NODE_ENV?f(!1,"Failed form propType: %s%s",a.message,s):void 0}}},getValue:function(e){return e.valueLink?(o(e),e.valueLink.value):e.value},getChecked:function(e){return e.checkedLink?(a(e),e.checkedLink.value):e.checked},executeOnChange:function(e,t){return e.valueLink?(o(e),e.valueLink.requestChange(t.target.value)):e.checkedLink?(a(e),e.checkedLink.requestChange(t.target.checked)):e.onChange?e.onChange.call(void 0,t):void 0}};t.exports=g}).call(this,e("_process"))},{"./ReactPropTypesSecret":277,"./reactProdInvariant":327,_process:168,"fbjs/lib/invariant":50,"fbjs/lib/warning":57,"prop-types/factory":170,"react/lib/React":336}],231:[function(e,t,n){(function(n){"use strict";var r=e("./reactProdInvariant"),o=e("fbjs/lib/invariant"),a=function(e){var t=this;if(t.instancePool.length){var n=t.instancePool.pop();return t.call(n,e),n}return new t(e)},i=function(e,t){var n=this;if(n.instancePool.length){var r=n.instancePool.pop();return n.call(r,e,t),r}return new n(e,t)},s=function(e,t,n){var r=this;if(r.instancePool.length){var o=r.instancePool.pop();return r.call(o,e,t,n),o}return new r(e,t,n)},u=function(e,t,n,r){var o=this;if(o.instancePool.length){var a=o.instancePool.pop();return o.call(a,e,t,n,r),a}return new o(e,t,n,r)},c=function(e){var t=this;e instanceof t?void 0:"production"!==n.env.NODE_ENV?o(!1,"Trying to release an instance into a pool of a different type."):r("25"),e.destructor(),t.instancePool.length<t.poolSize&&t.instancePool.push(e)},l=10,d=a,p=function(e,t){var n=e;return n.instancePool=[],n.getPooled=t||d,n.poolSize||(n.poolSize=l),n.release=c,n},f={addPoolingTo:p,oneArgumentPooler:a,twoArgumentPooler:i,threeArgumentPooler:s,fourArgumentPooler:u};t.exports=f}).call(this,e("_process"))},{"./reactProdInvariant":327,_process:168,"fbjs/lib/invariant":50}],232:[function(e,t,n){"use strict";function r(e){return Object.prototype.hasOwnProperty.call(e,v)||(e[v]=f++,d[e[v]]={}),d[e[v]]}var o,a=e("object-assign"),i=e("./EventPluginRegistry"),s=e("./ReactEventEmitterMixin"),u=e("./ViewportMetrics"),c=e("./getVendorPrefixedEventName"),l=e("./isEventSupported"),d={},p=!1,f=0,h={topAbort:"abort",topAnimationEnd:c("animationend")||"animationend",topAnimationIteration:c("animationiteration")||"animationiteration",topAnimationStart:c("animationstart")||"animationstart",topBlur:"blur",topCanPlay:"canplay",topCanPlayThrough:"canplaythrough",topChange:"change",topClick:"click",topCompositionEnd:"compositionend",topCompositionStart:"compositionstart",topCompositionUpdate:"compositionupdate",topContextMenu:"contextmenu",topCopy:"copy",topCut:"cut",topDoubleClick:"dblclick",topDrag:"drag",topDragEnd:"dragend",topDragEnter:"dragenter",topDragExit:"dragexit",topDragLeave:"dragleave",topDragOver:"dragover",topDragStart:"dragstart",topDrop:"drop",topDurationChange:"durationchange",topEmptied:"emptied",topEncrypted:"encrypted",topEnded:"ended",topError:"error",topFocus:"focus",topInput:"input",topKeyDown:"keydown",topKeyPress:"keypress",topKeyUp:"keyup",topLoadedData:"loadeddata",topLoadedMetadata:"loadedmetadata",topLoadStart:"loadstart",topMouseDown:"mousedown",topMouseMove:"mousemove",topMouseOut:"mouseout",topMouseOver:"mouseover",topMouseUp:"mouseup",topPaste:"paste",topPause:"pause",topPlay:"play",topPlaying:"playing",topProgress:"progress",topRateChange:"ratechange",topScroll:"scroll",topSeeked:"seeked",topSeeking:"seeking",topSelectionChange:"selectionchange",topStalled:"stalled",topSuspend:"suspend",topTextInput:"textInput",topTimeUpdate:"timeupdate",topTouchCancel:"touchcancel",topTouchEnd:"touchend",topTouchMove:"touchmove",topTouchStart:"touchstart",topTransitionEnd:c("transitionend")||"transitionend",topVolumeChange:"volumechange",topWaiting:"waiting",topWheel:"wheel"},v="_reactListenersID"+String(Math.random()).slice(2),m=a({},s,{ReactEventListener:null,injection:{injectReactEventListener:function(e){e.setHandleTopLevel(m.handleTopLevel),m.ReactEventListener=e}},setEnabled:function(e){m.ReactEventListener&&m.ReactEventListener.setEnabled(e)},isEnabled:function(){return!(!m.ReactEventListener||!m.ReactEventListener.isEnabled())},listenTo:function(e,t){for(var n=t,o=r(n),a=i.registrationNameDependencies[e],s=0;s<a.length;s++){var u=a[s];o.hasOwnProperty(u)&&o[u]||("topWheel"===u?l("wheel")?m.ReactEventListener.trapBubbledEvent("topWheel","wheel",n):l("mousewheel")?m.ReactEventListener.trapBubbledEvent("topWheel","mousewheel",n):m.ReactEventListener.trapBubbledEvent("topWheel","DOMMouseScroll",n):"topScroll"===u?l("scroll",!0)?m.ReactEventListener.trapCapturedEvent("topScroll","scroll",n):m.ReactEventListener.trapBubbledEvent("topScroll","scroll",m.ReactEventListener.WINDOW_HANDLE):"topFocus"===u||"topBlur"===u?(l("focus",!0)?(m.ReactEventListener.trapCapturedEvent("topFocus","focus",n),m.ReactEventListener.trapCapturedEvent("topBlur","blur",n)):l("focusin")&&(m.ReactEventListener.trapBubbledEvent("topFocus","focusin",n),m.ReactEventListener.trapBubbledEvent("topBlur","focusout",n)),o.topBlur=!0,o.topFocus=!0):h.hasOwnProperty(u)&&m.ReactEventListener.trapBubbledEvent(u,h[u],n),o[u]=!0)}},trapBubbledEvent:function(e,t,n){return m.ReactEventListener.trapBubbledEvent(e,t,n)},trapCapturedEvent:function(e,t,n){return m.ReactEventListener.trapCapturedEvent(e,t,n)},supportsEventPageXY:function(){if(!document.createEvent)return!1;var e=document.createEvent("MouseEvent");return null!=e&&"pageX"in e},ensureScrollValueMonitoring:function(){if(void 0===o&&(o=m.supportsEventPageXY()),!o&&!p){var e=u.refreshScrollValues;m.ReactEventListener.monitorScrollValue(e),p=!0}}});t.exports=m},{"./EventPluginRegistry":224,"./ReactEventEmitterMixin":261,"./ViewportMetrics":303,"./getVendorPrefixedEventName":321,"./isEventSupported":324,"object-assign":167}],233:[function(e,t,n){(function(n){"use strict";function r(t,r,a,u){var c=void 0===t[a];"production"!==n.env.NODE_ENV&&(o||(o=e("react/lib/ReactComponentTreeHook")),c||("production"!==n.env.NODE_ENV?l(!1,"flattenChildren(...): Encountered two children with the same key, `%s`. Child keys must be unique; when two children share a key, only the first child will be used.%s",s.unescape(a),o.getStackAddendumByID(u)):void 0)),null!=r&&c&&(t[a]=i(r,!0))}var o,a=e("./ReactReconciler"),i=e("./instantiateReactComponent"),s=e("./KeyEscapeUtils"),u=e("./shouldUpdateReactComponent"),c=e("./traverseAllChildren"),l=e("fbjs/lib/warning");"undefined"!=typeof n&&n.env&&"test"===n.env.NODE_ENV&&(o=e("react/lib/ReactComponentTreeHook"));var d={instantiateChildren:function(e,t,o,a){if(null==e)return null;var i={};return"production"!==n.env.NODE_ENV?c(e,function(e,t,n){return r(e,t,n,a)},i):c(e,r,i),i},updateChildren:function(e,t,n,r,o,s,c,l,d){if(t||e){var p,f;for(p in t)if(t.hasOwnProperty(p)){f=e&&e[p];var h=f&&f._currentElement,v=t[p];if(null!=f&&u(h,v))a.receiveComponent(f,v,o,l),t[p]=f;else{f&&(r[p]=a.getHostNode(f),a.unmountComponent(f,!1));var m=i(v,!0);t[p]=m;var g=a.mountComponent(m,o,s,c,l,d);n.push(g)}}for(p in e)!e.hasOwnProperty(p)||t&&t.hasOwnProperty(p)||(f=e[p],r[p]=a.getHostNode(f),a.unmountComponent(f,!1))}},unmountChildren:function(e,t){for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];a.unmountComponent(r,t)}}};t.exports=d}).call(this,e("_process"))},{"./KeyEscapeUtils":229,"./ReactReconciler":279,"./instantiateReactComponent":323,"./shouldUpdateReactComponent":331,"./traverseAllChildren":332,_process:168,"fbjs/lib/warning":57,"react/lib/ReactComponentTreeHook":339}],234:[function(e,t,n){"use strict";var r=e("./DOMChildrenOperations"),o=e("./ReactDOMIDOperations"),a={processChildrenUpdates:o.dangerouslyProcessChildrenUpdates,replaceNodeWithMarkup:r.dangerouslyReplaceNodeWithMarkup};t.exports=a},{"./DOMChildrenOperations":215,"./ReactDOMIDOperations":244}],235:[function(e,t,n){(function(n){"use strict";var r=e("./reactProdInvariant"),o=e("fbjs/lib/invariant"),a=!1,i={replaceNodeWithMarkup:null,processChildrenUpdates:null,injection:{injectEnvironment:function(e){a?"production"!==n.env.NODE_ENV?o(!1,"ReactCompositeComponent: injectEnvironment() can only be called once."):r("104"):void 0,i.replaceNodeWithMarkup=e.replaceNodeWithMarkup,i.processChildrenUpdates=e.processChildrenUpdates,a=!0}}};t.exports=i}).call(this,e("_process"))},{"./reactProdInvariant":327,_process:168,"fbjs/lib/invariant":50}],236:[function(e,t,n){(function(n){"use strict";function r(e){}function o(e,t){"production"!==n.env.NODE_ENV&&("production"!==n.env.NODE_ENV?C(null===t||t===!1||l.isValidElement(t),"%s(...): A valid React element (or null) must be returned. You may have returned undefined, an array or some other invalid object.",e.displayName||e.name||"Component"):void 0,"production"!==n.env.NODE_ENV?C(!e.childContextTypes,"%s(...): childContextTypes cannot be defined on a functional component.",e.displayName||e.name||"Component"):void 0)}function a(e){return!(!e.prototype||!e.prototype.isReactComponent)}function i(e){return!(!e.prototype||!e.prototype.isPureReactComponent)}function s(e,t,n){if(0===t)return e();v.debugTool.onBeginLifeCycleTimer(t,n);try{return e()}finally{v.debugTool.onEndLifeCycleTimer(t,n)}}var u=e("./reactProdInvariant"),c=e("object-assign"),l=e("react/lib/React"),d=e("./ReactComponentEnvironment"),p=e("react/lib/ReactCurrentOwner"),f=e("./ReactErrorUtils"),h=e("./ReactInstanceMap"),v=e("./ReactInstrumentation"),m=e("./ReactNodeTypes"),g=e("./ReactReconciler");if("production"!==n.env.NODE_ENV)var y=e("./checkReactTypeSpec");var b=e("fbjs/lib/emptyObject"),_=e("fbjs/lib/invariant"),E=e("fbjs/lib/shallowEqual"),O=e("./shouldUpdateReactComponent"),C=e("fbjs/lib/warning"),D={ImpureClass:0,PureClass:1,StatelessFunctional:2};r.prototype.render=function(){var e=h.get(this)._currentElement.type,t=e(this.props,this.context,this.updater);return o(e,t),t};var N=1,w={construct:function(e){this._currentElement=e,this._rootNodeID=0,this._compositeType=null,this._instance=null,this._hostParent=null,this._hostContainerInfo=null,this._updateBatchNumber=null,this._pendingElement=null,this._pendingStateQueue=null,this._pendingReplaceState=!1,this._pendingForceUpdate=!1,this._renderedNodeType=null,this._renderedComponent=null,this._context=null,this._mountOrder=0,this._topLevelWrapper=null,this._pendingCallbacks=null,this._calledComponentWillUnmount=!1,"production"!==n.env.NODE_ENV&&(this._warnedAboutRefsInRender=!1)},mountComponent:function(e,t,c,d){var p=this;this._context=d,this._mountOrder=N++,this._hostParent=t,this._hostContainerInfo=c;var f,v=this._currentElement.props,m=this._processContext(d),g=this._currentElement.type,y=e.getUpdateQueue(),E=a(g),O=this._constructComponent(E,v,m,y);if(E||null!=O&&null!=O.render?i(g)?this._compositeType=D.PureClass:this._compositeType=D.ImpureClass:(f=O,o(g,f),null===O||O===!1||l.isValidElement(O)?void 0:"production"!==n.env.NODE_ENV?_(!1,"%s(...): A valid React element (or null) must be returned. You may have returned undefined, an array or some other invalid object.",g.displayName||g.name||"Component"):u("105",g.displayName||g.name||"Component"),O=new r(g),this._compositeType=D.StatelessFunctional),"production"!==n.env.NODE_ENV){null==O.render&&("production"!==n.env.NODE_ENV?C(!1,"%s(...): No `render` method found on the returned component instance: you may have forgotten to define `render`.",g.displayName||g.name||"Component"):void 0);var w=O.props!==v,T=g.displayName||g.name||"Component";"production"!==n.env.NODE_ENV?C(void 0===O.props||!w,"%s(...): When calling super() in `%s`, make sure to pass up the same props that your component's constructor was passed.",T,T):void 0}O.props=v,O.context=m,O.refs=b,O.updater=y,this._instance=O,h.set(O,this),"production"!==n.env.NODE_ENV&&("production"!==n.env.NODE_ENV?C(!O.getInitialState||O.getInitialState.isReactClassApproved||O.state,"getInitialState was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Did you mean to define a state property instead?",this.getName()||"a component"):void 0,"production"!==n.env.NODE_ENV?C(!O.getDefaultProps||O.getDefaultProps.isReactClassApproved,"getDefaultProps was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Use a static property to define defaultProps instead.",this.getName()||"a component"):void 0,"production"!==n.env.NODE_ENV?C(!O.propTypes,"propTypes was defined as an instance property on %s. Use a static property to define propTypes instead.",this.getName()||"a component"):void 0,"production"!==n.env.NODE_ENV?C(!O.contextTypes,"contextTypes was defined as an instance property on %s. Use a static property to define contextTypes instead.",this.getName()||"a component"):void 0,"production"!==n.env.NODE_ENV?C("function"!=typeof O.componentShouldUpdate,"%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value.",this.getName()||"A component"):void 0,"production"!==n.env.NODE_ENV?C("function"!=typeof O.componentDidUnmount,"%s has a method called componentDidUnmount(). But there is no such lifecycle method. Did you mean componentWillUnmount()?",this.getName()||"A component"):void 0,"production"!==n.env.NODE_ENV?C("function"!=typeof O.componentWillRecieveProps,"%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?",this.getName()||"A component"):void 0);var I=O.state;void 0===I&&(O.state=I=null),"object"!=typeof I||Array.isArray(I)?"production"!==n.env.NODE_ENV?_(!1,"%s.state: must be set to an object or null",this.getName()||"ReactCompositeComponent"):u("106",this.getName()||"ReactCompositeComponent"):void 0,this._pendingStateQueue=null,this._pendingReplaceState=!1,this._pendingForceUpdate=!1;var k;return k=O.unstable_handleError?this.performInitialMountWithErrorHandling(f,t,c,e,d):this.performInitialMount(f,t,c,e,d),O.componentDidMount&&("production"!==n.env.NODE_ENV?e.getReactMountReady().enqueue(function(){s(function(){return O.componentDidMount()},p._debugID,"componentDidMount")}):e.getReactMountReady().enqueue(O.componentDidMount,O)),k},_constructComponent:function(e,t,r,o){if("production"===n.env.NODE_ENV)return this._constructComponentWithoutOwner(e,t,r,o);p.current=this;try{return this._constructComponentWithoutOwner(e,t,r,o)}finally{p.current=null}},_constructComponentWithoutOwner:function(e,t,r,o){var a=this._currentElement.type;return e?"production"!==n.env.NODE_ENV?s(function(){return new a(t,r,o)},this._debugID,"ctor"):new a(t,r,o):"production"!==n.env.NODE_ENV?s(function(){return a(t,r,o)},this._debugID,"render"):a(t,r,o)},performInitialMountWithErrorHandling:function(e,t,n,r,o){var a,i=r.checkpoint();try{a=this.performInitialMount(e,t,n,r,o)}catch(s){r.rollback(i),this._instance.unstable_handleError(s),this._pendingStateQueue&&(this._instance.state=this._processPendingState(this._instance.props,this._instance.context)),i=r.checkpoint(),this._renderedComponent.unmountComponent(!0),r.rollback(i),a=this.performInitialMount(e,t,n,r,o)}return a},performInitialMount:function(e,t,r,o,a){var i=this._instance,u=0;"production"!==n.env.NODE_ENV&&(u=this._debugID),i.componentWillMount&&("production"!==n.env.NODE_ENV?s(function(){return i.componentWillMount()},u,"componentWillMount"):i.componentWillMount(),this._pendingStateQueue&&(i.state=this._processPendingState(i.props,i.context))),void 0===e&&(e=this._renderValidatedComponent());var c=m.getType(e);this._renderedNodeType=c;var l=this._instantiateReactComponent(e,c!==m.EMPTY);this._renderedComponent=l;var d=g.mountComponent(l,o,t,r,this._processChildContext(a),u);if("production"!==n.env.NODE_ENV&&0!==u){var p=0!==l._debugID?[l._debugID]:[];v.debugTool.onSetChildren(u,p)}return d},getHostNode:function(){return g.getHostNode(this._renderedComponent)},unmountComponent:function(e){if(this._renderedComponent){var t=this._instance;if(t.componentWillUnmount&&!t._calledComponentWillUnmount)if(t._calledComponentWillUnmount=!0,e){var r=this.getName()+".componentWillUnmount()";f.invokeGuardedCallback(r,t.componentWillUnmount.bind(t))}else"production"!==n.env.NODE_ENV?s(function(){return t.componentWillUnmount()},this._debugID,"componentWillUnmount"):t.componentWillUnmount();this._renderedComponent&&(g.unmountComponent(this._renderedComponent,e),this._renderedNodeType=null,this._renderedComponent=null,this._instance=null),this._pendingStateQueue=null,this._pendingReplaceState=!1,this._pendingForceUpdate=!1,this._pendingCallbacks=null,this._pendingElement=null,this._context=null,this._rootNodeID=0,this._topLevelWrapper=null,h.remove(t)}},_maskContext:function(e){var t=this._currentElement.type,n=t.contextTypes;if(!n)return b;var r={};for(var o in n)r[o]=e[o];return r},_processContext:function(e){var t=this._maskContext(e);if("production"!==n.env.NODE_ENV){var r=this._currentElement.type;r.contextTypes&&this._checkContextTypes(r.contextTypes,t,"context")}return t},_processChildContext:function(e){var t,r=this._currentElement.type,o=this._instance;if(o.getChildContext)if("production"!==n.env.NODE_ENV){v.debugTool.onBeginProcessingChildContext();try{t=o.getChildContext()}finally{v.debugTool.onEndProcessingChildContext()}}else t=o.getChildContext();if(t){"object"!=typeof r.childContextTypes?"production"!==n.env.NODE_ENV?_(!1,"%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().",this.getName()||"ReactCompositeComponent"):u("107",this.getName()||"ReactCompositeComponent"):void 0,"production"!==n.env.NODE_ENV&&this._checkContextTypes(r.childContextTypes,t,"child context");for(var a in t)a in r.childContextTypes?void 0:"production"!==n.env.NODE_ENV?_(!1,'%s.getChildContext(): key "%s" is not defined in childContextTypes.',this.getName()||"ReactCompositeComponent",a):u("108",this.getName()||"ReactCompositeComponent",a);return c({},e,t)}return e},_checkContextTypes:function(e,t,r){"production"!==n.env.NODE_ENV&&y(e,t,r,this.getName(),null,this._debugID)},receiveComponent:function(e,t,n){var r=this._currentElement,o=this._context;this._pendingElement=null,this.updateComponent(t,r,e,o,n)},performUpdateIfNecessary:function(e){null!=this._pendingElement?g.receiveComponent(this,this._pendingElement,e,this._context):null!==this._pendingStateQueue||this._pendingForceUpdate?this.updateComponent(e,this._currentElement,this._currentElement,this._context,this._context):this._updateBatchNumber=null},updateComponent:function(e,t,r,o,a){var i=this._instance;null==i?"production"!==n.env.NODE_ENV?_(!1,"Attempted to update component `%s` that has already been unmounted (or failed to mount).",this.getName()||"ReactCompositeComponent"):u("136",this.getName()||"ReactCompositeComponent"):void 0;var c,l=!1;this._context===a?c=i.context:(c=this._processContext(a),l=!0);var d=t.props,p=r.props;t!==r&&(l=!0),l&&i.componentWillReceiveProps&&("production"!==n.env.NODE_ENV?s(function(){return i.componentWillReceiveProps(p,c)},this._debugID,"componentWillReceiveProps"):i.componentWillReceiveProps(p,c));var f=this._processPendingState(p,c),h=!0;this._pendingForceUpdate||(i.shouldComponentUpdate?h="production"!==n.env.NODE_ENV?s(function(){return i.shouldComponentUpdate(p,f,c)},this._debugID,"shouldComponentUpdate"):i.shouldComponentUpdate(p,f,c):this._compositeType===D.PureClass&&(h=!E(d,p)||!E(i.state,f))),"production"!==n.env.NODE_ENV&&("production"!==n.env.NODE_ENV?C(void 0!==h,"%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.",this.getName()||"ReactCompositeComponent"):void 0),this._updateBatchNumber=null,h?(this._pendingForceUpdate=!1,this._performComponentUpdate(r,p,f,c,e,a)):(this._currentElement=r,this._context=a,i.props=p,i.state=f,i.context=c)},_processPendingState:function(e,t){var n=this._instance,r=this._pendingStateQueue,o=this._pendingReplaceState;if(this._pendingReplaceState=!1,this._pendingStateQueue=null,!r)return n.state;if(o&&1===r.length)return r[0];for(var a=c({},o?r[0]:n.state),i=o?1:0;i<r.length;i++){var s=r[i];c(a,"function"==typeof s?s.call(n,a,e,t):s)}return a},_performComponentUpdate:function(e,t,r,o,a,i){var u,c,l,d=this,p=this._instance,f=Boolean(p.componentDidUpdate);f&&(u=p.props,c=p.state,l=p.context),p.componentWillUpdate&&("production"!==n.env.NODE_ENV?s(function(){return p.componentWillUpdate(t,r,o)},this._debugID,"componentWillUpdate"):p.componentWillUpdate(t,r,o)),this._currentElement=e,this._context=i,p.props=t,p.state=r,p.context=o,this._updateRenderedComponent(a,i),f&&("production"!==n.env.NODE_ENV?a.getReactMountReady().enqueue(function(){s(p.componentDidUpdate.bind(p,u,c,l),d._debugID,"componentDidUpdate")}):a.getReactMountReady().enqueue(p.componentDidUpdate.bind(p,u,c,l),p))},_updateRenderedComponent:function(e,t){var r=this._renderedComponent,o=r._currentElement,a=this._renderValidatedComponent(),i=0;if("production"!==n.env.NODE_ENV&&(i=this._debugID),O(o,a))g.receiveComponent(r,a,e,this._processChildContext(t));else{var s=g.getHostNode(r);g.unmountComponent(r,!1);var u=m.getType(a);this._renderedNodeType=u;var c=this._instantiateReactComponent(a,u!==m.EMPTY);this._renderedComponent=c;var l=g.mountComponent(c,e,this._hostParent,this._hostContainerInfo,this._processChildContext(t),i);if("production"!==n.env.NODE_ENV&&0!==i){var d=0!==c._debugID?[c._debugID]:[];v.debugTool.onSetChildren(i,d)}this._replaceNodeWithMarkup(s,l,r)}},_replaceNodeWithMarkup:function(e,t,n){d.replaceNodeWithMarkup(e,t,n)},_renderValidatedComponentWithoutOwnerOrContext:function(){var e,t=this._instance;return e="production"!==n.env.NODE_ENV?s(function(){
8
+ return t.render()},this._debugID,"render"):t.render(),"production"!==n.env.NODE_ENV&&void 0===e&&t.render._isMockFunction&&(e=null),e},_renderValidatedComponent:function(){var e;if("production"!==n.env.NODE_ENV||this._compositeType!==D.StatelessFunctional){p.current=this;try{e=this._renderValidatedComponentWithoutOwnerOrContext()}finally{p.current=null}}else e=this._renderValidatedComponentWithoutOwnerOrContext();return null===e||e===!1||l.isValidElement(e)?void 0:"production"!==n.env.NODE_ENV?_(!1,"%s.render(): A valid React element (or null) must be returned. You may have returned undefined, an array or some other invalid object.",this.getName()||"ReactCompositeComponent"):u("109",this.getName()||"ReactCompositeComponent"),e},attachRef:function(e,t){var r=this.getPublicInstance();null==r?"production"!==n.env.NODE_ENV?_(!1,"Stateless function components cannot have refs."):u("110"):void 0;var o=t.getPublicInstance();if("production"!==n.env.NODE_ENV){var a=t&&t.getName?t.getName():"a component";"production"!==n.env.NODE_ENV?C(null!=o||t._compositeType!==D.StatelessFunctional,'Stateless function components cannot be given refs (See ref "%s" in %s created by %s). Attempts to access this ref will fail.',e,a,this.getName()):void 0}var i=r.refs===b?r.refs={}:r.refs;i[e]=o},detachRef:function(e){var t=this.getPublicInstance().refs;delete t[e]},getName:function(){var e=this._currentElement.type,t=this._instance&&this._instance.constructor;return e.displayName||t&&t.displayName||e.name||t&&t.name||null},getPublicInstance:function(){var e=this._instance;return this._compositeType===D.StatelessFunctional?null:e},_instantiateReactComponent:null};t.exports=w}).call(this,e("_process"))},{"./ReactComponentEnvironment":235,"./ReactErrorUtils":260,"./ReactInstanceMap":268,"./ReactInstrumentation":269,"./ReactNodeTypes":274,"./ReactReconciler":279,"./checkReactTypeSpec":306,"./reactProdInvariant":327,"./shouldUpdateReactComponent":331,_process:168,"fbjs/lib/emptyObject":43,"fbjs/lib/invariant":50,"fbjs/lib/shallowEqual":56,"fbjs/lib/warning":57,"object-assign":167,"react/lib/React":336,"react/lib/ReactCurrentOwner":340}],237:[function(e,t,n){(function(n){"use strict";var r=e("./ReactDOMComponentTree"),o=e("./ReactDefaultInjection"),a=e("./ReactMount"),i=e("./ReactReconciler"),s=e("./ReactUpdates"),u=e("./ReactVersion"),c=e("./findDOMNode"),l=e("./getHostComponentFromComposite"),d=e("./renderSubtreeIntoContainer"),p=e("fbjs/lib/warning");o.inject();var f={findDOMNode:c,render:a.render,unmountComponentAtNode:a.unmountComponentAtNode,version:u,unstable_batchedUpdates:s.batchedUpdates,unstable_renderSubtreeIntoContainer:d};if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.inject&&__REACT_DEVTOOLS_GLOBAL_HOOK__.inject({ComponentTree:{getClosestInstanceFromNode:r.getClosestInstanceFromNode,getNodeFromInstance:function(e){return e._renderedComponent&&(e=l(e)),e?r.getNodeFromInstance(e):null}},Mount:a,Reconciler:i}),"production"!==n.env.NODE_ENV){var h=e("fbjs/lib/ExecutionEnvironment");if(h.canUseDOM&&window.top===window.self){if("undefined"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&(navigator.userAgent.indexOf("Chrome")>-1&&navigator.userAgent.indexOf("Edge")===-1||navigator.userAgent.indexOf("Firefox")>-1)){var v=window.location.protocol.indexOf("http")===-1&&navigator.userAgent.indexOf("Firefox")===-1;console.debug("Download the React DevTools "+(v?"and use an HTTP server (instead of a file: URL) ":"")+"for a better development experience: https://fb.me/react-devtools")}var m=function(){};"production"!==n.env.NODE_ENV?p((m.name||m.toString()).indexOf("testFn")!==-1,"It looks like you're using a minified copy of the development build of React. When deploying React apps to production, make sure to use the production build which skips development warnings and is faster. See https://fb.me/react-minification for more details."):void 0;var g=document.documentMode&&document.documentMode<8;"production"!==n.env.NODE_ENV?p(!g,'Internet Explorer is running in compatibility mode; please add the following tag to your HTML to prevent this from happening: <meta http-equiv="X-UA-Compatible" content="IE=edge" />'):void 0;for(var y=[Array.isArray,Array.prototype.every,Array.prototype.forEach,Array.prototype.indexOf,Array.prototype.map,Date.now,Function.prototype.bind,Object.keys,String.prototype.trim],b=0;b<y.length;b++)if(!y[b]){"production"!==n.env.NODE_ENV?p(!1,"One or more ES5 shims expected by React are not available: https://fb.me/react-warning-polyfills"):void 0;break}}}if("production"!==n.env.NODE_ENV){var _=e("./ReactInstrumentation"),E=e("./ReactDOMUnknownPropertyHook"),O=e("./ReactDOMNullInputValuePropHook"),C=e("./ReactDOMInvalidARIAHook");_.debugTool.addHook(E),_.debugTool.addHook(O),_.debugTool.addHook(C)}t.exports=f}).call(this,e("_process"))},{"./ReactDOMComponentTree":240,"./ReactDOMInvalidARIAHook":246,"./ReactDOMNullInputValuePropHook":247,"./ReactDOMUnknownPropertyHook":254,"./ReactDefaultInjection":257,"./ReactInstrumentation":269,"./ReactMount":272,"./ReactReconciler":279,"./ReactUpdates":284,"./ReactVersion":285,"./findDOMNode":310,"./getHostComponentFromComposite":317,"./renderSubtreeIntoContainer":328,_process:168,"fbjs/lib/ExecutionEnvironment":36,"fbjs/lib/warning":57}],238:[function(e,t,n){(function(n){"use strict";function r(e){if(e){var t=e._currentElement._owner||null;if(t){var n=t.getName();if(n)return" This DOM node was rendered by `"+n+"`."}}return""}function o(e){if("object"==typeof e){if(Array.isArray(e))return"["+e.map(o).join(", ")+"]";var t=[];for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=/^[a-z$_][\w$_]*$/i.test(n)?n:JSON.stringify(n);t.push(r+": "+o(e[n]))}return"{"+t.join(", ")+"}"}return"string"==typeof e?JSON.stringify(e):"function"==typeof e?"[function object]":String(e)}function a(e,t,r){if(null!=e&&null!=t&&!B(e,t)){var a,i=r._tag,s=r._currentElement._owner;s&&(a=s.getName());var u=a+"|"+i;ne.hasOwnProperty(u)||(ne[u]=!0,"production"!==n.env.NODE_ENV?z(!1,"`%s` was passed a style object that has previously been mutated. Mutating `style` is deprecated. Consider cloning it beforehand. Check the `render` %s. Previous style: %s. Mutated style: %s.",i,s?"of `"+a+"`":"using <"+i+">",o(e),o(t)):void 0)}}function i(e,t){t&&(se[e._tag]&&(null!=t.children||null!=t.dangerouslySetInnerHTML?"production"!==n.env.NODE_ENV?F(!1,"%s is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.%s",e._tag,e._currentElement._owner?" Check the render method of "+e._currentElement._owner.getName()+".":""):y("137",e._tag,e._currentElement._owner?" Check the render method of "+e._currentElement._owner.getName()+".":""):void 0),null!=t.dangerouslySetInnerHTML&&(null!=t.children?"production"!==n.env.NODE_ENV?F(!1,"Can only set one of `children` or `props.dangerouslySetInnerHTML`."):y("60"):void 0,"object"==typeof t.dangerouslySetInnerHTML&&Z in t.dangerouslySetInnerHTML?void 0:"production"!==n.env.NODE_ENV?F(!1,"`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://fb.me/react-invariant-dangerously-set-inner-html for more information."):y("61")),"production"!==n.env.NODE_ENV&&("production"!==n.env.NODE_ENV?z(null==t.innerHTML,"Directly setting property `innerHTML` is not permitted. For more information, lookup documentation on `dangerouslySetInnerHTML`."):void 0,"production"!==n.env.NODE_ENV?z(t.suppressContentEditableWarning||!t.contentEditable||null==t.children,"A component is `contentEditable` and contains `children` managed by React. It is now your responsibility to guarantee that none of those nodes are unexpectedly modified or duplicated. This is probably not intentional."):void 0,"production"!==n.env.NODE_ENV?z(null==t.onFocusIn&&null==t.onFocusOut,"React uses onFocus and onBlur instead of onFocusIn and onFocusOut. All React events are normalized to bubble, so onFocusIn and onFocusOut are not needed/supported by React."):void 0),null!=t.style&&"object"!=typeof t.style?"production"!==n.env.NODE_ENV?F(!1,"The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX.%s",r(e)):y("62",r(e)):void 0)}function s(e,t,r,o){if(!(o instanceof V)){"production"!==n.env.NODE_ENV&&("production"!==n.env.NODE_ENV?z("onScroll"!==t||H("scroll",!0),"This browser doesn't support the `onScroll` event"):void 0);var a=e._hostContainerInfo,i=a._node&&a._node.nodeType===te,s=i?a._node:a._ownerDocument;X(t,s),o.getReactMountReady().enqueue(u,{inst:e,registrationName:t,listener:r})}}function u(){var e=this;w.putListener(e.inst,e.registrationName,e.listener)}function c(){var e=this;S.postMountWrapper(e)}function l(){var e=this;M.postMountWrapper(e)}function d(){var e=this;R.postMountWrapper(e)}function p(){W.track(this)}function f(){var e=this;e._rootNodeID?void 0:"production"!==n.env.NODE_ENV?F(!1,"Must be mounted to trap events"):y("63");var t=G(e);switch(t?void 0:"production"!==n.env.NODE_ENV?F(!1,"trapBubbledEvent(...): Requires node to be rendered."):y("64"),e._tag){case"iframe":case"object":e._wrapperState.listeners=[I.trapBubbledEvent("topLoad","load",t)];break;case"video":case"audio":e._wrapperState.listeners=[];for(var r in oe)oe.hasOwnProperty(r)&&e._wrapperState.listeners.push(I.trapBubbledEvent(r,oe[r],t));break;case"source":e._wrapperState.listeners=[I.trapBubbledEvent("topError","error",t)];break;case"img":e._wrapperState.listeners=[I.trapBubbledEvent("topError","error",t),I.trapBubbledEvent("topLoad","load",t)];break;case"form":e._wrapperState.listeners=[I.trapBubbledEvent("topReset","reset",t),I.trapBubbledEvent("topSubmit","submit",t)];break;case"input":case"select":case"textarea":e._wrapperState.listeners=[I.trapBubbledEvent("topInvalid","invalid",t)]}}function h(){P.postUpdateWrapper(this)}function v(e){le.call(ce,e)||(ue.test(e)?void 0:"production"!==n.env.NODE_ENV?F(!1,"Invalid tag: %s",e):y("65",e),ce[e]=!0)}function m(e,t){return e.indexOf("-")>=0||null!=t.is}function g(e){var t=e.type;v(t),this._currentElement=e,this._tag=t.toLowerCase(),this._namespaceURI=null,this._renderedChildren=null,this._previousStyle=null,this._previousStyleCopy=null,this._hostNode=null,this._hostParent=null,this._rootNodeID=0,this._domID=0,this._hostContainerInfo=null,this._wrapperState=null,this._topLevelWrapper=null,this._flags=0,"production"!==n.env.NODE_ENV&&(this._ancestorInfo=null,re.call(this,null))}var y=e("./reactProdInvariant"),b=e("object-assign"),_=e("./AutoFocusUtils"),E=e("./CSSPropertyOperations"),O=e("./DOMLazyTree"),C=e("./DOMNamespaces"),D=e("./DOMProperty"),N=e("./DOMPropertyOperations"),w=e("./EventPluginHub"),T=e("./EventPluginRegistry"),I=e("./ReactBrowserEventEmitter"),k=e("./ReactDOMComponentFlags"),x=e("./ReactDOMComponentTree"),S=e("./ReactDOMInput"),R=e("./ReactDOMOption"),P=e("./ReactDOMSelect"),M=e("./ReactDOMTextarea"),j=e("./ReactInstrumentation"),A=e("./ReactMultiChild"),V=e("./ReactServerRenderingTransaction"),U=e("fbjs/lib/emptyFunction"),L=e("./escapeTextContentForBrowser"),F=e("fbjs/lib/invariant"),H=e("./isEventSupported"),B=e("fbjs/lib/shallowEqual"),W=e("./inputValueTracking"),q=e("./validateDOMNesting"),z=e("fbjs/lib/warning"),K=k,Y=w.deleteListener,G=x.getNodeFromInstance,X=I.listenTo,Q=T.registrationNameModules,$={string:!0,number:!0},J="style",Z="__html",ee={children:null,dangerouslySetInnerHTML:null,suppressContentEditableWarning:null},te=11,ne={},re=U;"production"!==n.env.NODE_ENV&&(re=function(e){var t=null!=this._contentDebugID,n=this._debugID,r=-n;return null==e?(t&&j.debugTool.onUnmountComponent(this._contentDebugID),void(this._contentDebugID=null)):(q(null,String(e),this,this._ancestorInfo),this._contentDebugID=r,void(t?(j.debugTool.onBeforeUpdateComponent(r,e),j.debugTool.onUpdateComponent(r)):(j.debugTool.onBeforeMountComponent(r,e,n),j.debugTool.onMountComponent(r),j.debugTool.onSetChildren(n,[r]))))});var oe={topAbort:"abort",topCanPlay:"canplay",topCanPlayThrough:"canplaythrough",topDurationChange:"durationchange",topEmptied:"emptied",topEncrypted:"encrypted",topEnded:"ended",topError:"error",topLoadedData:"loadeddata",topLoadedMetadata:"loadedmetadata",topLoadStart:"loadstart",topPause:"pause",topPlay:"play",topPlaying:"playing",topProgress:"progress",topRateChange:"ratechange",topSeeked:"seeked",topSeeking:"seeking",topStalled:"stalled",topSuspend:"suspend",topTimeUpdate:"timeupdate",topVolumeChange:"volumechange",topWaiting:"waiting"},ae={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},ie={listing:!0,pre:!0,textarea:!0},se=b({menuitem:!0},ae),ue=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,ce={},le={}.hasOwnProperty,de=1;g.displayName="ReactDOMComponent",g.Mixin={mountComponent:function(e,t,r,o){this._rootNodeID=de++,this._domID=r._idCounter++,this._hostParent=t,this._hostContainerInfo=r;var a=this._currentElement.props;switch(this._tag){case"audio":case"form":case"iframe":case"img":case"link":case"object":case"source":case"video":this._wrapperState={listeners:null},e.getReactMountReady().enqueue(f,this);break;case"input":S.mountWrapper(this,a,t),a=S.getHostProps(this,a),e.getReactMountReady().enqueue(p,this),e.getReactMountReady().enqueue(f,this);break;case"option":R.mountWrapper(this,a,t),a=R.getHostProps(this,a);break;case"select":P.mountWrapper(this,a,t),a=P.getHostProps(this,a),e.getReactMountReady().enqueue(f,this);break;case"textarea":M.mountWrapper(this,a,t),a=M.getHostProps(this,a),e.getReactMountReady().enqueue(p,this),e.getReactMountReady().enqueue(f,this)}i(this,a);var s,u;if(null!=t?(s=t._namespaceURI,u=t._tag):r._tag&&(s=r._namespaceURI,u=r._tag),(null==s||s===C.svg&&"foreignobject"===u)&&(s=C.html),s===C.html&&("svg"===this._tag?s=C.svg:"math"===this._tag&&(s=C.mathml)),this._namespaceURI=s,"production"!==n.env.NODE_ENV){var h;null!=t?h=t._ancestorInfo:r._tag&&(h=r._ancestorInfo),h&&q(this._tag,null,this,h),this._ancestorInfo=q.updatedAncestorInfo(h,this._tag,this)}var v;if(e.useCreateElement){var m,g=r._ownerDocument;if(s===C.html)if("script"===this._tag){var y=g.createElement("div"),b=this._currentElement.type;y.innerHTML="<"+b+"></"+b+">",m=y.removeChild(y.firstChild)}else m=a.is?g.createElement(this._currentElement.type,a.is):g.createElement(this._currentElement.type);else m=g.createElementNS(s,this._currentElement.type);x.precacheNode(this,m),this._flags|=K.hasCachedChildNodes,this._hostParent||N.setAttributeForRoot(m),this._updateDOMProperties(null,a,e);var E=O(m);this._createInitialChildren(e,a,o,E),v=E}else{var D=this._createOpenTagMarkupAndPutListeners(e,a),w=this._createContentMarkup(e,a,o);v=!w&&ae[this._tag]?D+"/>":D+">"+w+"</"+this._currentElement.type+">"}switch(this._tag){case"input":e.getReactMountReady().enqueue(c,this),a.autoFocus&&e.getReactMountReady().enqueue(_.focusDOMComponent,this);break;case"textarea":e.getReactMountReady().enqueue(l,this),a.autoFocus&&e.getReactMountReady().enqueue(_.focusDOMComponent,this);break;case"select":a.autoFocus&&e.getReactMountReady().enqueue(_.focusDOMComponent,this);break;case"button":a.autoFocus&&e.getReactMountReady().enqueue(_.focusDOMComponent,this);break;case"option":e.getReactMountReady().enqueue(d,this)}return v},_createOpenTagMarkupAndPutListeners:function(e,t){var r="<"+this._currentElement.type;for(var o in t)if(t.hasOwnProperty(o)){var a=t[o];if(null!=a)if(Q.hasOwnProperty(o))a&&s(this,o,a,e);else{o===J&&(a&&("production"!==n.env.NODE_ENV&&(this._previousStyle=a),a=this._previousStyleCopy=b({},t.style)),a=E.createMarkupForStyles(a,this));var i=null;null!=this._tag&&m(this._tag,t)?ee.hasOwnProperty(o)||(i=N.createMarkupForCustomAttribute(o,a)):i=N.createMarkupForProperty(o,a),i&&(r+=" "+i)}}return e.renderToStaticMarkup?r:(this._hostParent||(r+=" "+N.createMarkupForRoot()),r+=" "+N.createMarkupForID(this._domID))},_createContentMarkup:function(e,t,r){var o="",a=t.dangerouslySetInnerHTML;if(null!=a)null!=a.__html&&(o=a.__html);else{var i=$[typeof t.children]?t.children:null,s=null!=i?null:t.children;if(null!=i)o=L(i),"production"!==n.env.NODE_ENV&&re.call(this,i);else if(null!=s){var u=this.mountChildren(s,e,r);o=u.join("")}}return ie[this._tag]&&"\n"===o.charAt(0)?"\n"+o:o},_createInitialChildren:function(e,t,r,o){var a=t.dangerouslySetInnerHTML;if(null!=a)null!=a.__html&&O.queueHTML(o,a.__html);else{var i=$[typeof t.children]?t.children:null,s=null!=i?null:t.children;if(null!=i)""!==i&&("production"!==n.env.NODE_ENV&&re.call(this,i),O.queueText(o,i));else if(null!=s)for(var u=this.mountChildren(s,e,r),c=0;c<u.length;c++)O.queueChild(o,u[c])}},receiveComponent:function(e,t,n){var r=this._currentElement;this._currentElement=e,this.updateComponent(t,r,e,n)},updateComponent:function(e,t,n,r){var o=t.props,a=this._currentElement.props;switch(this._tag){case"input":o=S.getHostProps(this,o),a=S.getHostProps(this,a);break;case"option":o=R.getHostProps(this,o),a=R.getHostProps(this,a);break;case"select":o=P.getHostProps(this,o),a=P.getHostProps(this,a);break;case"textarea":o=M.getHostProps(this,o),a=M.getHostProps(this,a)}switch(i(this,a),this._updateDOMProperties(o,a,e),this._updateDOMChildren(o,a,e,r),this._tag){case"input":S.updateWrapper(this);break;case"textarea":M.updateWrapper(this);break;case"select":e.getReactMountReady().enqueue(h,this)}},_updateDOMProperties:function(e,t,r){var o,i,u;for(o in e)if(!t.hasOwnProperty(o)&&e.hasOwnProperty(o)&&null!=e[o])if(o===J){var c=this._previousStyleCopy;for(i in c)c.hasOwnProperty(i)&&(u=u||{},u[i]="");this._previousStyleCopy=null}else Q.hasOwnProperty(o)?e[o]&&Y(this,o):m(this._tag,e)?ee.hasOwnProperty(o)||N.deleteValueForAttribute(G(this),o):(D.properties[o]||D.isCustomAttribute(o))&&N.deleteValueForProperty(G(this),o);for(o in t){var l=t[o],d=o===J?this._previousStyleCopy:null!=e?e[o]:void 0;if(t.hasOwnProperty(o)&&l!==d&&(null!=l||null!=d))if(o===J)if(l?("production"!==n.env.NODE_ENV&&(a(this._previousStyleCopy,this._previousStyle,this),this._previousStyle=l),l=this._previousStyleCopy=b({},l)):this._previousStyleCopy=null,d){for(i in d)!d.hasOwnProperty(i)||l&&l.hasOwnProperty(i)||(u=u||{},u[i]="");for(i in l)l.hasOwnProperty(i)&&d[i]!==l[i]&&(u=u||{},u[i]=l[i])}else u=l;else if(Q.hasOwnProperty(o))l?s(this,o,l,r):d&&Y(this,o);else if(m(this._tag,t))ee.hasOwnProperty(o)||N.setValueForAttribute(G(this),o,l);else if(D.properties[o]||D.isCustomAttribute(o)){var p=G(this);null!=l?N.setValueForProperty(p,o,l):N.deleteValueForProperty(p,o)}}u&&E.setValueForStyles(G(this),u,this)},_updateDOMChildren:function(e,t,r,o){var a=$[typeof e.children]?e.children:null,i=$[typeof t.children]?t.children:null,s=e.dangerouslySetInnerHTML&&e.dangerouslySetInnerHTML.__html,u=t.dangerouslySetInnerHTML&&t.dangerouslySetInnerHTML.__html,c=null!=a?null:e.children,l=null!=i?null:t.children,d=null!=a||null!=s,p=null!=i||null!=u;null!=c&&null==l?this.updateChildren(null,r,o):d&&!p&&(this.updateTextContent(""),"production"!==n.env.NODE_ENV&&j.debugTool.onSetChildren(this._debugID,[])),null!=i?a!==i&&(this.updateTextContent(""+i),"production"!==n.env.NODE_ENV&&re.call(this,i)):null!=u?(s!==u&&this.updateMarkup(""+u),"production"!==n.env.NODE_ENV&&j.debugTool.onSetChildren(this._debugID,[])):null!=l&&("production"!==n.env.NODE_ENV&&re.call(this,null),this.updateChildren(l,r,o))},getHostNode:function(){return G(this)},unmountComponent:function(e){switch(this._tag){case"audio":case"form":case"iframe":case"img":case"link":case"object":case"source":case"video":var t=this._wrapperState.listeners;if(t)for(var r=0;r<t.length;r++)t[r].remove();break;case"input":case"textarea":W.stopTracking(this);break;case"html":case"head":case"body":"production"!==n.env.NODE_ENV?F(!1,"<%s> tried to unmount. Because of cross-browser quirks it is impossible to unmount some top-level components (eg <html>, <head>, and <body>) reliably and efficiently. To fix this, have a single top-level component that never unmounts render these elements.",this._tag):y("66",this._tag)}this.unmountChildren(e),x.uncacheNode(this),w.deleteAllListeners(this),this._rootNodeID=0,this._domID=0,this._wrapperState=null,"production"!==n.env.NODE_ENV&&re.call(this,null)},getPublicInstance:function(){return G(this)}},b(g.prototype,g.Mixin,A.Mixin),t.exports=g}).call(this,e("_process"))},{"./AutoFocusUtils":209,"./CSSPropertyOperations":212,"./DOMLazyTree":216,"./DOMNamespaces":217,"./DOMProperty":218,"./DOMPropertyOperations":219,"./EventPluginHub":223,"./EventPluginRegistry":224,"./ReactBrowserEventEmitter":232,"./ReactDOMComponentFlags":239,"./ReactDOMComponentTree":240,"./ReactDOMInput":245,"./ReactDOMOption":248,"./ReactDOMSelect":249,"./ReactDOMTextarea":252,"./ReactInstrumentation":269,"./ReactMultiChild":273,"./ReactServerRenderingTransaction":281,"./escapeTextContentForBrowser":309,"./inputValueTracking":322,"./isEventSupported":324,"./reactProdInvariant":327,"./validateDOMNesting":333,_process:168,"fbjs/lib/emptyFunction":42,"fbjs/lib/invariant":50,"fbjs/lib/shallowEqual":56,"fbjs/lib/warning":57,"object-assign":167}],239:[function(e,t,n){"use strict";var r={hasCachedChildNodes:1};t.exports=r},{}],240:[function(e,t,n){(function(n){"use strict";function r(e,t){return 1===e.nodeType&&e.getAttribute(v)===String(t)||8===e.nodeType&&e.nodeValue===" react-text: "+t+" "||8===e.nodeType&&e.nodeValue===" react-empty: "+t+" "}function o(e){for(var t;t=e._renderedComponent;)e=t;return e}function a(e,t){var n=o(e);n._hostNode=t,t[g]=n}function i(e){var t=e._hostNode;t&&(delete t[g],e._hostNode=null)}function s(e,t){if(!(e._flags&m.hasCachedChildNodes)){var i=e._renderedChildren,s=t.firstChild;e:for(var u in i)if(i.hasOwnProperty(u)){var c=i[u],l=o(c)._domID;if(0!==l){for(;null!==s;s=s.nextSibling)if(r(s,l)){a(c,s);continue e}"production"!==n.env.NODE_ENV?h(!1,"Unable to find element with ID %s.",l):d("32",l)}}e._flags|=m.hasCachedChildNodes}}function u(e){if(e[g])return e[g];for(var t=[];!e[g];){if(t.push(e),!e.parentNode)return null;e=e.parentNode}for(var n,r;e&&(r=e[g]);e=t.pop())n=r,t.length&&s(r,e);return n}function c(e){var t=u(e);return null!=t&&t._hostNode===e?t:null}function l(e){if(void 0===e._hostNode?"production"!==n.env.NODE_ENV?h(!1,"getNodeFromInstance: Invalid argument."):d("33"):void 0,e._hostNode)return e._hostNode;for(var t=[];!e._hostNode;)t.push(e),e._hostParent?void 0:"production"!==n.env.NODE_ENV?h(!1,"React DOM tree root should always have a node reference."):d("34"),e=e._hostParent;for(;t.length;e=t.pop())s(e,e._hostNode);return e._hostNode}var d=e("./reactProdInvariant"),p=e("./DOMProperty"),f=e("./ReactDOMComponentFlags"),h=e("fbjs/lib/invariant"),v=p.ID_ATTRIBUTE_NAME,m=f,g="__reactInternalInstance$"+Math.random().toString(36).slice(2),y={getClosestInstanceFromNode:u,getInstanceFromNode:c,getNodeFromInstance:l,precacheChildNodes:s,precacheNode:a,uncacheNode:i};t.exports=y}).call(this,e("_process"))},{"./DOMProperty":218,"./ReactDOMComponentFlags":239,"./reactProdInvariant":327,_process:168,"fbjs/lib/invariant":50}],241:[function(e,t,n){(function(n){"use strict";function r(e,t){var r={_topLevelWrapper:e,_idCounter:1,_ownerDocument:t?t.nodeType===a?t:t.ownerDocument:null,_node:t,_tag:t?t.nodeName.toLowerCase():null,_namespaceURI:t?t.namespaceURI:null};return"production"!==n.env.NODE_ENV&&(r._ancestorInfo=t?o.updatedAncestorInfo(null,r._tag,null):null),r}var o=e("./validateDOMNesting"),a=9;t.exports=r}).call(this,e("_process"))},{"./validateDOMNesting":333,_process:168}],242:[function(e,t,n){"use strict";var r=e("object-assign"),o=e("./DOMLazyTree"),a=e("./ReactDOMComponentTree"),i=function(e){this._currentElement=null,this._hostNode=null,this._hostParent=null,this._hostContainerInfo=null,this._domID=0};r(i.prototype,{mountComponent:function(e,t,n,r){var i=n._idCounter++;this._domID=i,this._hostParent=t,this._hostContainerInfo=n;var s=" react-empty: "+this._domID+" ";if(e.useCreateElement){var u=n._ownerDocument,c=u.createComment(s);return a.precacheNode(this,c),o(c)}return e.renderToStaticMarkup?"":"<!--"+s+"-->"},receiveComponent:function(){},getHostNode:function(){return a.getNodeFromInstance(this)},unmountComponent:function(){a.uncacheNode(this)}}),t.exports=i},{"./DOMLazyTree":216,"./ReactDOMComponentTree":240,"object-assign":167}],243:[function(e,t,n){"use strict";var r={useCreateElement:!0,useFiber:!1};t.exports=r},{}],244:[function(e,t,n){"use strict";var r=e("./DOMChildrenOperations"),o=e("./ReactDOMComponentTree"),a={dangerouslyProcessChildrenUpdates:function(e,t){var n=o.getNodeFromInstance(e);r.processUpdates(n,t)}};t.exports=a},{"./DOMChildrenOperations":215,"./ReactDOMComponentTree":240}],245:[function(e,t,n){(function(n){"use strict";function r(){this._rootNodeID&&_.updateWrapper(this)}function o(e){var t="checkbox"===e.type||"radio"===e.type;return t?null!=e.checked:null!=e.value}function a(e){var t=this._currentElement.props,o=c.executeOnChange(t,e);d.asap(r,this);var a=t.name;if("radio"===t.type&&null!=a){for(var s=l.getNodeFromInstance(this),u=s;u.parentNode;)u=u.parentNode;for(var f=u.querySelectorAll("input[name="+JSON.stringify(""+a)+'][type="radio"]'),h=0;h<f.length;h++){var v=f[h];if(v!==s&&v.form===s.form){var m=l.getInstanceFromNode(v);m?void 0:"production"!==n.env.NODE_ENV?p(!1,"ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported."):i("90"),d.asap(r,m)}}}return o}var i=e("./reactProdInvariant"),s=e("object-assign"),u=e("./DOMPropertyOperations"),c=e("./LinkedValueUtils"),l=e("./ReactDOMComponentTree"),d=e("./ReactUpdates"),p=e("fbjs/lib/invariant"),f=e("fbjs/lib/warning"),h=!1,v=!1,m=!1,g=!1,y=!1,b=!1,_={getHostProps:function(e,t){var n=c.getValue(t),r=c.getChecked(t),o=s({type:void 0,step:void 0,min:void 0,max:void 0},t,{defaultChecked:void 0,defaultValue:void 0,value:null!=n?n:e._wrapperState.initialValue,checked:null!=r?r:e._wrapperState.initialChecked,onChange:e._wrapperState.onChange});return o},mountWrapper:function(e,t){if("production"!==n.env.NODE_ENV){c.checkPropTypes("input",t,e._currentElement._owner);var r=e._currentElement._owner;void 0===t.valueLink||h||("production"!==n.env.NODE_ENV?f(!1,"`valueLink` prop on `input` is deprecated; set `value` and `onChange` instead."):void 0,h=!0),void 0===t.checkedLink||v||("production"!==n.env.NODE_ENV?f(!1,"`checkedLink` prop on `input` is deprecated; set `value` and `onChange` instead."):void 0,v=!0),void 0===t.checked||void 0===t.defaultChecked||g||("production"!==n.env.NODE_ENV?f(!1,"%s contains an input of type %s with both checked and defaultChecked props. Input elements must be either controlled or uncontrolled (specify either the checked prop, or the defaultChecked prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://fb.me/react-controlled-components",r&&r.getName()||"A component",t.type):void 0,g=!0),void 0===t.value||void 0===t.defaultValue||m||("production"!==n.env.NODE_ENV?f(!1,"%s contains an input of type %s with both value and defaultValue props. Input elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://fb.me/react-controlled-components",r&&r.getName()||"A component",t.type):void 0,m=!0)}var i=t.defaultValue;e._wrapperState={initialChecked:null!=t.checked?t.checked:t.defaultChecked,initialValue:null!=t.value?t.value:i,listeners:null,onChange:a.bind(e),controlled:o(t)}},updateWrapper:function(e){var t=e._currentElement.props;if("production"!==n.env.NODE_ENV){var r=o(t),a=e._currentElement._owner;e._wrapperState.controlled||!r||b||("production"!==n.env.NODE_ENV?f(!1,"%s is changing an uncontrolled input of type %s to be controlled. Input elements should not switch from uncontrolled to controlled (or vice versa). Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://fb.me/react-controlled-components",a&&a.getName()||"A component",t.type):void 0,b=!0),!e._wrapperState.controlled||r||y||("production"!==n.env.NODE_ENV?f(!1,"%s is changing a controlled input of type %s to be uncontrolled. Input elements should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://fb.me/react-controlled-components",a&&a.getName()||"A component",t.type):void 0,y=!0)}var i=t.checked;null!=i&&u.setValueForProperty(l.getNodeFromInstance(e),"checked",i||!1);var s=l.getNodeFromInstance(e),d=c.getValue(t);if(null!=d)if(0===d&&""===s.value)s.value="0";else if("number"===t.type){var p=parseFloat(s.value,10)||0;(d!=p||d==p&&s.value!=d)&&(s.value=""+d)}else s.value!==""+d&&(s.value=""+d);else null==t.value&&null!=t.defaultValue&&s.defaultValue!==""+t.defaultValue&&(s.defaultValue=""+t.defaultValue),null==t.checked&&null!=t.defaultChecked&&(s.defaultChecked=!!t.defaultChecked)},postMountWrapper:function(e){var t=e._currentElement.props,n=l.getNodeFromInstance(e);switch(t.type){case"submit":case"reset":break;case"color":case"date":case"datetime":case"datetime-local":case"month":case"time":case"week":n.value="",n.value=n.defaultValue;break;default:n.value=n.value}var r=n.name;""!==r&&(n.name=""),n.defaultChecked=!n.defaultChecked,n.defaultChecked=!n.defaultChecked,""!==r&&(n.name=r)}};t.exports=_}).call(this,e("_process"))},{"./DOMPropertyOperations":219,"./LinkedValueUtils":230,"./ReactDOMComponentTree":240,"./ReactUpdates":284,"./reactProdInvariant":327,_process:168,"fbjs/lib/invariant":50,"fbjs/lib/warning":57,"object-assign":167}],246:[function(e,t,n){(function(n){"use strict";function r(e,t,r){if(c.hasOwnProperty(t)&&c[t])return!0;if(l.test(t)){var o=t.toLowerCase(),a=i.getPossibleStandardName.hasOwnProperty(o)?i.getPossibleStandardName[o]:null;if(null==a)return c[t]=!0,!1;if(t!==a)return"production"!==n.env.NODE_ENV?u(!1,"Unknown ARIA attribute %s. Did you mean %s?%s",t,a,s.getStackAddendumByID(r)):void 0,c[t]=!0,!0}return!0}function o(e,t){var o=[];for(var a in t.props){var i=r(t.type,a,e);i||o.push(a)}var c=o.map(function(e){return"`"+e+"`"}).join(", ");1===o.length?"production"!==n.env.NODE_ENV?u(!1,"Invalid aria prop %s on <%s> tag. For details, see https://fb.me/invalid-aria-prop%s",c,t.type,s.getStackAddendumByID(e)):void 0:o.length>1&&("production"!==n.env.NODE_ENV?u(!1,"Invalid aria props %s on <%s> tag. For details, see https://fb.me/invalid-aria-prop%s",c,t.type,s.getStackAddendumByID(e)):void 0)}function a(e,t){null!=t&&"string"==typeof t.type&&(t.type.indexOf("-")>=0||t.props.is||o(e,t))}var i=e("./DOMProperty"),s=e("react/lib/ReactComponentTreeHook"),u=e("fbjs/lib/warning"),c={},l=new RegExp("^(aria)-["+i.ATTRIBUTE_NAME_CHAR+"]*$"),d={onBeforeMountComponent:function(e,t){"production"!==n.env.NODE_ENV&&a(e,t)},onBeforeUpdateComponent:function(e,t){"production"!==n.env.NODE_ENV&&a(e,t)}};t.exports=d}).call(this,e("_process"))},{"./DOMProperty":218,_process:168,"fbjs/lib/warning":57,"react/lib/ReactComponentTreeHook":339}],247:[function(e,t,n){(function(n){"use strict";function r(e,t){null!=t&&("input"!==t.type&&"textarea"!==t.type&&"select"!==t.type||null==t.props||null!==t.props.value||i||("production"!==n.env.NODE_ENV?a(!1,"`value` prop on `%s` should not be null. Consider using the empty string to clear the component or `undefined` for uncontrolled components.%s",t.type,o.getStackAddendumByID(e)):void 0,i=!0))}var o=e("react/lib/ReactComponentTreeHook"),a=e("fbjs/lib/warning"),i=!1,s={onBeforeMountComponent:function(e,t){r(e,t)},onBeforeUpdateComponent:function(e,t){r(e,t)}};t.exports=s}).call(this,e("_process"))},{_process:168,"fbjs/lib/warning":57,"react/lib/ReactComponentTreeHook":339}],248:[function(e,t,n){(function(n){"use strict";function r(e){var t="";return a.Children.forEach(e,function(e){null!=e&&("string"==typeof e||"number"==typeof e?t+=e:c||(c=!0,"production"!==n.env.NODE_ENV?u(!1,"Only strings and numbers are supported as <option> children."):void 0));
9
+ }),t}var o=e("object-assign"),a=e("react/lib/React"),i=e("./ReactDOMComponentTree"),s=e("./ReactDOMSelect"),u=e("fbjs/lib/warning"),c=!1,l={mountWrapper:function(e,t,o){"production"!==n.env.NODE_ENV&&("production"!==n.env.NODE_ENV?u(null==t.selected,"Use the `defaultValue` or `value` props on <select> instead of setting `selected` on <option>."):void 0);var a=null;if(null!=o){var i=o;"optgroup"===i._tag&&(i=i._hostParent),null!=i&&"select"===i._tag&&(a=s.getSelectValueContext(i))}var c=null;if(null!=a){var l;if(l=null!=t.value?t.value+"":r(t.children),c=!1,Array.isArray(a)){for(var d=0;d<a.length;d++)if(""+a[d]===l){c=!0;break}}else c=""+a===l}e._wrapperState={selected:c}},postMountWrapper:function(e){var t=e._currentElement.props;if(null!=t.value){var n=i.getNodeFromInstance(e);n.setAttribute("value",t.value)}},getHostProps:function(e,t){var n=o({selected:void 0,children:void 0},t);null!=e._wrapperState.selected&&(n.selected=e._wrapperState.selected);var a=r(t.children);return a&&(n.children=a),n}};t.exports=l}).call(this,e("_process"))},{"./ReactDOMComponentTree":240,"./ReactDOMSelect":249,_process:168,"fbjs/lib/warning":57,"object-assign":167,"react/lib/React":336}],249:[function(e,t,n){(function(n){"use strict";function r(){if(this._rootNodeID&&this._wrapperState.pendingUpdate){this._wrapperState.pendingUpdate=!1;var e=this._currentElement.props,t=c.getValue(e);null!=t&&i(this,Boolean(e.multiple),t)}}function o(e){if(e){var t=e.getName();if(t)return" Check the render method of `"+t+"`."}return""}function a(e,t){var r=e._currentElement._owner;c.checkPropTypes("select",t,r),void 0===t.valueLink||f||("production"!==n.env.NODE_ENV?p(!1,"`valueLink` prop on `select` is deprecated; set `value` and `onChange` instead."):void 0,f=!0);for(var a=0;a<v.length;a++){var i=v[a];if(null!=t[i]){var s=Array.isArray(t[i]);t.multiple&&!s?"production"!==n.env.NODE_ENV?p(!1,"The `%s` prop supplied to <select> must be an array if `multiple` is true.%s",i,o(r)):void 0:!t.multiple&&s&&("production"!==n.env.NODE_ENV?p(!1,"The `%s` prop supplied to <select> must be a scalar value if `multiple` is false.%s",i,o(r)):void 0)}}}function i(e,t,n){var r,o,a=l.getNodeFromInstance(e).options;if(t){for(r={},o=0;o<n.length;o++)r[""+n[o]]=!0;for(o=0;o<a.length;o++){var i=r.hasOwnProperty(a[o].value);a[o].selected!==i&&(a[o].selected=i)}}else{for(r=""+n,o=0;o<a.length;o++)if(a[o].value===r)return void(a[o].selected=!0);a.length&&(a[0].selected=!0)}}function s(e){var t=this._currentElement.props,n=c.executeOnChange(t,e);return this._rootNodeID&&(this._wrapperState.pendingUpdate=!0),d.asap(r,this),n}var u=e("object-assign"),c=e("./LinkedValueUtils"),l=e("./ReactDOMComponentTree"),d=e("./ReactUpdates"),p=e("fbjs/lib/warning"),f=!1,h=!1,v=["value","defaultValue"],m={getHostProps:function(e,t){return u({},t,{onChange:e._wrapperState.onChange,value:void 0})},mountWrapper:function(e,t){"production"!==n.env.NODE_ENV&&a(e,t);var r=c.getValue(t);e._wrapperState={pendingUpdate:!1,initialValue:null!=r?r:t.defaultValue,listeners:null,onChange:s.bind(e),wasMultiple:Boolean(t.multiple)},void 0===t.value||void 0===t.defaultValue||h||("production"!==n.env.NODE_ENV?p(!1,"Select elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled select element and remove one of these props. More info: https://fb.me/react-controlled-components"):void 0,h=!0)},getSelectValueContext:function(e){return e._wrapperState.initialValue},postUpdateWrapper:function(e){var t=e._currentElement.props;e._wrapperState.initialValue=void 0;var n=e._wrapperState.wasMultiple;e._wrapperState.wasMultiple=Boolean(t.multiple);var r=c.getValue(t);null!=r?(e._wrapperState.pendingUpdate=!1,i(e,Boolean(t.multiple),r)):n!==Boolean(t.multiple)&&(null!=t.defaultValue?i(e,Boolean(t.multiple),t.defaultValue):i(e,Boolean(t.multiple),t.multiple?[]:""))}};t.exports=m}).call(this,e("_process"))},{"./LinkedValueUtils":230,"./ReactDOMComponentTree":240,"./ReactUpdates":284,_process:168,"fbjs/lib/warning":57,"object-assign":167}],250:[function(e,t,n){"use strict";function r(e,t,n,r){return e===n&&t===r}function o(e){var t=document.selection,n=t.createRange(),r=n.text.length,o=n.duplicate();o.moveToElementText(e),o.setEndPoint("EndToStart",n);var a=o.text.length,i=a+r;return{start:a,end:i}}function a(e){var t=window.getSelection&&window.getSelection();if(!t||0===t.rangeCount)return null;var n=t.anchorNode,o=t.anchorOffset,a=t.focusNode,i=t.focusOffset,s=t.getRangeAt(0);try{s.startContainer.nodeType,s.endContainer.nodeType}catch(u){return null}var c=r(t.anchorNode,t.anchorOffset,t.focusNode,t.focusOffset),l=c?0:s.toString().length,d=s.cloneRange();d.selectNodeContents(e),d.setEnd(s.startContainer,s.startOffset);var p=r(d.startContainer,d.startOffset,d.endContainer,d.endOffset),f=p?0:d.toString().length,h=f+l,v=document.createRange();v.setStart(n,o),v.setEnd(a,i);var m=v.collapsed;return{start:m?h:f,end:m?f:h}}function i(e,t){var n,r,o=document.selection.createRange().duplicate();void 0===t.end?(n=t.start,r=n):t.start>t.end?(n=t.end,r=t.start):(n=t.start,r=t.end),o.moveToElementText(e),o.moveStart("character",n),o.setEndPoint("EndToStart",o),o.moveEnd("character",r-n),o.select()}function s(e,t){if(window.getSelection){var n=window.getSelection(),r=e[l()].length,o=Math.min(t.start,r),a=void 0===t.end?o:Math.min(t.end,r);if(!n.extend&&o>a){var i=a;a=o,o=i}var s=c(e,o),u=c(e,a);if(s&&u){var d=document.createRange();d.setStart(s.node,s.offset),n.removeAllRanges(),o>a?(n.addRange(d),n.extend(u.node,u.offset)):(d.setEnd(u.node,u.offset),n.addRange(d))}}}var u=e("fbjs/lib/ExecutionEnvironment"),c=e("./getNodeForCharacterOffset"),l=e("./getTextContentAccessor"),d=u.canUseDOM&&"selection"in document&&!("getSelection"in window),p={getOffsets:d?o:a,setOffsets:d?i:s};t.exports=p},{"./getNodeForCharacterOffset":319,"./getTextContentAccessor":320,"fbjs/lib/ExecutionEnvironment":36}],251:[function(e,t,n){(function(n){"use strict";var r=e("./reactProdInvariant"),o=e("object-assign"),a=e("./DOMChildrenOperations"),i=e("./DOMLazyTree"),s=e("./ReactDOMComponentTree"),u=e("./escapeTextContentForBrowser"),c=e("fbjs/lib/invariant"),l=e("./validateDOMNesting"),d=function(e){this._currentElement=e,this._stringText=""+e,this._hostNode=null,this._hostParent=null,this._domID=0,this._mountIndex=0,this._closingComment=null,this._commentNodes=null};o(d.prototype,{mountComponent:function(e,t,r,o){if("production"!==n.env.NODE_ENV){var a;null!=t?a=t._ancestorInfo:null!=r&&(a=r._ancestorInfo),a&&l(null,this._stringText,this,a)}var c=r._idCounter++,d=" react-text: "+c+" ",p=" /react-text ";if(this._domID=c,this._hostParent=t,e.useCreateElement){var f=r._ownerDocument,h=f.createComment(d),v=f.createComment(p),m=i(f.createDocumentFragment());return i.queueChild(m,i(h)),this._stringText&&i.queueChild(m,i(f.createTextNode(this._stringText))),i.queueChild(m,i(v)),s.precacheNode(this,h),this._closingComment=v,m}var g=u(this._stringText);return e.renderToStaticMarkup?g:"<!--"+d+"-->"+g+"<!--"+p+"-->"},receiveComponent:function(e,t){if(e!==this._currentElement){this._currentElement=e;var n=""+e;if(n!==this._stringText){this._stringText=n;var r=this.getHostNode();a.replaceDelimitedText(r[0],r[1],n)}}},getHostNode:function(){var e=this._commentNodes;if(e)return e;if(!this._closingComment)for(var t=s.getNodeFromInstance(this),o=t.nextSibling;;){if(null==o?"production"!==n.env.NODE_ENV?c(!1,"Missing closing comment for text component %s",this._domID):r("67",this._domID):void 0,8===o.nodeType&&" /react-text "===o.nodeValue){this._closingComment=o;break}o=o.nextSibling}return e=[this._hostNode,this._closingComment],this._commentNodes=e,e},unmountComponent:function(){this._closingComment=null,this._commentNodes=null,s.uncacheNode(this)}}),t.exports=d}).call(this,e("_process"))},{"./DOMChildrenOperations":215,"./DOMLazyTree":216,"./ReactDOMComponentTree":240,"./escapeTextContentForBrowser":309,"./reactProdInvariant":327,"./validateDOMNesting":333,_process:168,"fbjs/lib/invariant":50,"object-assign":167}],252:[function(e,t,n){(function(n){"use strict";function r(){this._rootNodeID&&h.updateWrapper(this)}function o(e){var t=this._currentElement.props,n=s.executeOnChange(t,e);return c.asap(r,this),n}var a=e("./reactProdInvariant"),i=e("object-assign"),s=e("./LinkedValueUtils"),u=e("./ReactDOMComponentTree"),c=e("./ReactUpdates"),l=e("fbjs/lib/invariant"),d=e("fbjs/lib/warning"),p=!1,f=!1,h={getHostProps:function(e,t){null!=t.dangerouslySetInnerHTML?"production"!==n.env.NODE_ENV?l(!1,"`dangerouslySetInnerHTML` does not make sense on <textarea>."):a("91"):void 0;var r=i({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue,onChange:e._wrapperState.onChange});return r},mountWrapper:function(e,t){"production"!==n.env.NODE_ENV&&(s.checkPropTypes("textarea",t,e._currentElement._owner),void 0===t.valueLink||p||("production"!==n.env.NODE_ENV?d(!1,"`valueLink` prop on `textarea` is deprecated; set `value` and `onChange` instead."):void 0,p=!0),void 0===t.value||void 0===t.defaultValue||f||("production"!==n.env.NODE_ENV?d(!1,"Textarea elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled textarea and remove one of these props. More info: https://fb.me/react-controlled-components"):void 0,f=!0));var r=s.getValue(t),i=r;if(null==r){var u=t.defaultValue,c=t.children;null!=c&&("production"!==n.env.NODE_ENV&&("production"!==n.env.NODE_ENV?d(!1,"Use the `defaultValue` or `value` props instead of setting children on <textarea>."):void 0),null!=u?"production"!==n.env.NODE_ENV?l(!1,"If you supply `defaultValue` on a <textarea>, do not pass children."):a("92"):void 0,Array.isArray(c)&&(c.length<=1?void 0:"production"!==n.env.NODE_ENV?l(!1,"<textarea> can only have at most one child."):a("93"),c=c[0]),u=""+c),null==u&&(u=""),i=u}e._wrapperState={initialValue:""+i,listeners:null,onChange:o.bind(e)}},updateWrapper:function(e){var t=e._currentElement.props,n=u.getNodeFromInstance(e),r=s.getValue(t);if(null!=r){var o=""+r;o!==n.value&&(n.value=o),null==t.defaultValue&&(n.defaultValue=o)}null!=t.defaultValue&&(n.defaultValue=t.defaultValue)},postMountWrapper:function(e){var t=u.getNodeFromInstance(e),n=t.textContent;n===e._wrapperState.initialValue&&(t.value=n)}};t.exports=h}).call(this,e("_process"))},{"./LinkedValueUtils":230,"./ReactDOMComponentTree":240,"./ReactUpdates":284,"./reactProdInvariant":327,_process:168,"fbjs/lib/invariant":50,"fbjs/lib/warning":57,"object-assign":167}],253:[function(e,t,n){(function(n){"use strict";function r(e,t){"_hostNode"in e?void 0:"production"!==n.env.NODE_ENV?c(!1,"getNodeFromInstance: Invalid argument."):u("33"),"_hostNode"in t?void 0:"production"!==n.env.NODE_ENV?c(!1,"getNodeFromInstance: Invalid argument."):u("33");for(var r=0,o=e;o;o=o._hostParent)r++;for(var a=0,i=t;i;i=i._hostParent)a++;for(;r-a>0;)e=e._hostParent,r--;for(;a-r>0;)t=t._hostParent,a--;for(var s=r;s--;){if(e===t)return e;e=e._hostParent,t=t._hostParent}return null}function o(e,t){"_hostNode"in e?void 0:"production"!==n.env.NODE_ENV?c(!1,"isAncestor: Invalid argument."):u("35"),"_hostNode"in t?void 0:"production"!==n.env.NODE_ENV?c(!1,"isAncestor: Invalid argument."):u("35");for(;t;){if(t===e)return!0;t=t._hostParent}return!1}function a(e){return"_hostNode"in e?void 0:"production"!==n.env.NODE_ENV?c(!1,"getParentInstance: Invalid argument."):u("36"),e._hostParent}function i(e,t,n){for(var r=[];e;)r.push(e),e=e._hostParent;var o;for(o=r.length;o-- >0;)t(r[o],"captured",n);for(o=0;o<r.length;o++)t(r[o],"bubbled",n)}function s(e,t,n,o,a){for(var i=e&&t?r(e,t):null,s=[];e&&e!==i;)s.push(e),e=e._hostParent;for(var u=[];t&&t!==i;)u.push(t),t=t._hostParent;var c;for(c=0;c<s.length;c++)n(s[c],"bubbled",o);for(c=u.length;c-- >0;)n(u[c],"captured",a)}var u=e("./reactProdInvariant"),c=e("fbjs/lib/invariant");t.exports={isAncestor:o,getLowestCommonAncestor:r,getParentInstance:a,traverseTwoPhase:i,traverseEnterLeave:s}}).call(this,e("_process"))},{"./reactProdInvariant":327,_process:168,"fbjs/lib/invariant":50}],254:[function(e,t,n){(function(n){"use strict";function r(e,t){null!=t&&"string"==typeof t.type&&(t.type.indexOf("-")>=0||t.props.is||d(e,t))}var o=e("./DOMProperty"),a=e("./EventPluginRegistry"),i=e("react/lib/ReactComponentTreeHook"),s=e("fbjs/lib/warning");if("production"!==n.env.NODE_ENV)var u={children:!0,dangerouslySetInnerHTML:!0,key:!0,ref:!0,autoFocus:!0,defaultValue:!0,valueLink:!0,defaultChecked:!0,checkedLink:!0,innerHTML:!0,suppressContentEditableWarning:!0,onFocusIn:!0,onFocusOut:!0},c={},l=function(e,t,r){if(o.properties.hasOwnProperty(t)||o.isCustomAttribute(t))return!0;if(u.hasOwnProperty(t)&&u[t]||c.hasOwnProperty(t)&&c[t])return!0;if(a.registrationNameModules.hasOwnProperty(t))return!0;c[t]=!0;var l=t.toLowerCase(),d=o.isCustomAttribute(l)?l:o.getPossibleStandardName.hasOwnProperty(l)?o.getPossibleStandardName[l]:null,p=a.possibleRegistrationNames.hasOwnProperty(l)?a.possibleRegistrationNames[l]:null;return null!=d?("production"!==n.env.NODE_ENV?s(!1,"Unknown DOM property %s. Did you mean %s?%s",t,d,i.getStackAddendumByID(r)):void 0,!0):null!=p&&("production"!==n.env.NODE_ENV?s(!1,"Unknown event handler property %s. Did you mean `%s`?%s",t,p,i.getStackAddendumByID(r)):void 0,!0)};var d=function(e,t){var r=[];for(var o in t.props){var a=l(t.type,o,e);a||r.push(o)}var u=r.map(function(e){return"`"+e+"`"}).join(", ");1===r.length?"production"!==n.env.NODE_ENV?s(!1,"Unknown prop %s on <%s> tag. Remove this prop from the element. For details, see https://fb.me/react-unknown-prop%s",u,t.type,i.getStackAddendumByID(e)):void 0:r.length>1&&("production"!==n.env.NODE_ENV?s(!1,"Unknown props %s on <%s> tag. Remove these props from the element. For details, see https://fb.me/react-unknown-prop%s",u,t.type,i.getStackAddendumByID(e)):void 0)},p={onBeforeMountComponent:function(e,t){r(e,t)},onBeforeUpdateComponent:function(e,t){r(e,t)}};t.exports=p}).call(this,e("_process"))},{"./DOMProperty":218,"./EventPluginRegistry":224,_process:168,"fbjs/lib/warning":57,"react/lib/ReactComponentTreeHook":339}],255:[function(e,t,n){(function(n){"use strict";function r(e,t,r,o,a,i,s,u){try{t.call(r,o,a,i,s,u)}catch(c){"production"!==n.env.NODE_ENV?E(C[e],"Exception thrown by hook while handling %s: %s",e,c+"\n"+c.stack):void 0,C[e]=!0}}function o(e,t,n,o,a,i){for(var s=0;s<O.length;s++){var u=O[s],c=u[e];c&&r(e,c,u,t,n,o,a,i)}}function a(){y.purgeUnmountedComponents(),g.clearHistory()}function i(e){return e.reduce(function(e,t){var n=y.getOwnerID(t),r=y.getParentID(t);return e[t]={displayName:y.getDisplayName(t),text:y.getText(t),updateCount:y.getUpdateCount(t),childIDs:y.getChildIDs(t),ownerID:n||r&&y.getOwnerID(r)||0,parentID:r},e},{})}function s(){var e=k,t=I,n=g.getHistory();if(0===T)return k=0,I=[],void a();if(t.length||n.length){var r=y.getRegisteredIDs();N.push({duration:_()-e,measurements:t||[],operations:n||[],treeSnapshot:i(r)})}a(),k=_(),I=[]}function u(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t&&0===e||e||("production"!==n.env.NODE_ENV?E(!1,"ReactDebugTool: debugID may not be empty."):void 0)}function c(e,t){0!==T&&(P&&!M&&("production"!==n.env.NODE_ENV?E(!1,"There is an internal error in the React performance measurement code. Did not expect %s timer to start while %s timer is still in progress for %s instance.",t,P||"no",e===x?"the same":"another"):void 0,M=!0),S=_(),R=0,x=e,P=t)}function l(e,t){0!==T&&(P===t||M||("production"!==n.env.NODE_ENV?E(!1,"There is an internal error in the React performance measurement code. We did not expect %s timer to stop while %s timer is still in progress for %s instance. Please report this as a bug in React.",t,P||"no",e===x?"the same":"another"):void 0,M=!0),D&&I.push({timerType:t,instanceID:e,duration:_()-S-R}),S=0,R=0,x=null,P=null)}function d(){var e={startTime:S,nestedFlushStartTime:_(),debugID:x,timerType:P};w.push(e),S=0,R=0,x=null,P=null}function p(){var e=w.pop(),t=e.startTime,n=e.nestedFlushStartTime,r=e.debugID,o=e.timerType,a=_()-n;S=t,R+=a,x=r,P=o}function f(e){if(!D||!A)return!1;var t=y.getElement(e);if(null==t||"object"!=typeof t)return!1;var n="string"==typeof t.type;return!n}function h(e,t){if(f(e)){var n=e+"::"+t;j=_(),performance.mark(n)}}function v(e,t){if(f(e)){var n=e+"::"+t,r=y.getDisplayName(e)||"Unknown",o=_();if(o-j>.1){var a=r+" ["+t+"]";performance.measure(a,n)}performance.clearMarks(n),a&&performance.clearMeasures(a)}}var m=e("./ReactInvalidSetStateWarningHook"),g=e("./ReactHostOperationHistoryHook"),y=e("react/lib/ReactComponentTreeHook"),b=e("fbjs/lib/ExecutionEnvironment"),_=e("fbjs/lib/performanceNow"),E=e("fbjs/lib/warning"),O=[],C={},D=!1,N=[],w=[],T=0,I=[],k=0,x=null,S=0,R=0,P=null,M=!1,j=0,A="undefined"!=typeof performance&&"function"==typeof performance.mark&&"function"==typeof performance.clearMarks&&"function"==typeof performance.measure&&"function"==typeof performance.clearMeasures,V={addHook:function(e){O.push(e)},removeHook:function(e){for(var t=0;t<O.length;t++)O[t]===e&&(O.splice(t,1),t--)},isProfiling:function(){return D},beginProfiling:function(){D||(D=!0,N.length=0,s(),V.addHook(g))},endProfiling:function(){D&&(D=!1,s(),V.removeHook(g))},getFlushHistory:function(){return N},onBeginFlush:function(){T++,s(),d(),o("onBeginFlush")},onEndFlush:function(){s(),T--,p(),o("onEndFlush")},onBeginLifeCycleTimer:function(e,t){u(e),o("onBeginLifeCycleTimer",e,t),h(e,t),c(e,t)},onEndLifeCycleTimer:function(e,t){u(e),l(e,t),v(e,t),o("onEndLifeCycleTimer",e,t)},onBeginProcessingChildContext:function(){o("onBeginProcessingChildContext")},onEndProcessingChildContext:function(){o("onEndProcessingChildContext")},onHostOperation:function(e){u(e.instanceID),o("onHostOperation",e)},onSetState:function(){o("onSetState")},onSetChildren:function(e,t){u(e),t.forEach(u),o("onSetChildren",e,t)},onBeforeMountComponent:function(e,t,n){u(e),u(n,!0),o("onBeforeMountComponent",e,t,n),h(e,"mount")},onMountComponent:function(e){u(e),v(e,"mount"),o("onMountComponent",e)},onBeforeUpdateComponent:function(e,t){u(e),o("onBeforeUpdateComponent",e,t),h(e,"update")},onUpdateComponent:function(e){u(e),v(e,"update"),o("onUpdateComponent",e)},onBeforeUnmountComponent:function(e){u(e),o("onBeforeUnmountComponent",e),h(e,"unmount")},onUnmountComponent:function(e){u(e),v(e,"unmount"),o("onUnmountComponent",e)},onTestEvent:function(){o("onTestEvent")}};V.addDevtool=V.addHook,V.removeDevtool=V.removeHook,V.addHook(m),V.addHook(y);var U=b.canUseDOM&&window.location.href||"";/[?&]react_perf\b/.test(U)&&V.beginProfiling(),t.exports=V}).call(this,e("_process"))},{"./ReactHostOperationHistoryHook":265,"./ReactInvalidSetStateWarningHook":270,_process:168,"fbjs/lib/ExecutionEnvironment":36,"fbjs/lib/performanceNow":55,"fbjs/lib/warning":57,"react/lib/ReactComponentTreeHook":339}],256:[function(e,t,n){"use strict";function r(){this.reinitializeTransaction()}var o=e("object-assign"),a=e("./ReactUpdates"),i=e("./Transaction"),s=e("fbjs/lib/emptyFunction"),u={initialize:s,close:function(){p.isBatchingUpdates=!1}},c={initialize:s,close:a.flushBatchedUpdates.bind(a)},l=[c,u];o(r.prototype,i,{getTransactionWrappers:function(){return l}});var d=new r,p={isBatchingUpdates:!1,batchedUpdates:function(e,t,n,r,o,a){var i=p.isBatchingUpdates;return p.isBatchingUpdates=!0,i?e(t,n,r,o,a):d.perform(e,null,t,n,r,o,a)}};t.exports=p},{"./ReactUpdates":284,"./Transaction":302,"fbjs/lib/emptyFunction":42,"object-assign":167}],257:[function(e,t,n){"use strict";function r(){C||(C=!0,y.EventEmitter.injectReactEventListener(g),y.EventPluginHub.injectEventPluginOrder(s),y.EventPluginUtils.injectComponentTree(p),y.EventPluginUtils.injectTreeTraversal(h),y.EventPluginHub.injectEventPluginsByName({SimpleEventPlugin:O,EnterLeaveEventPlugin:u,ChangeEventPlugin:i,SelectEventPlugin:E,BeforeInputEventPlugin:a}),y.HostComponent.injectGenericComponentClass(d),y.HostComponent.injectTextComponentClass(v),y.DOMProperty.injectDOMPropertyConfig(o),y.DOMProperty.injectDOMPropertyConfig(c),y.DOMProperty.injectDOMPropertyConfig(_),y.EmptyComponent.injectEmptyComponentFactory(function(e){return new f(e)}),y.Updates.injectReconcileTransaction(b),y.Updates.injectBatchingStrategy(m),y.Component.injectEnvironment(l))}var o=e("./ARIADOMPropertyConfig"),a=e("./BeforeInputEventPlugin"),i=e("./ChangeEventPlugin"),s=e("./DefaultEventPluginOrder"),u=e("./EnterLeaveEventPlugin"),c=e("./HTMLDOMPropertyConfig"),l=e("./ReactComponentBrowserEnvironment"),d=e("./ReactDOMComponent"),p=e("./ReactDOMComponentTree"),f=e("./ReactDOMEmptyComponent"),h=e("./ReactDOMTreeTraversal"),v=e("./ReactDOMTextComponent"),m=e("./ReactDefaultBatchingStrategy"),g=e("./ReactEventListener"),y=e("./ReactInjection"),b=e("./ReactReconcileTransaction"),_=e("./SVGDOMPropertyConfig"),E=e("./SelectEventPlugin"),O=e("./SimpleEventPlugin"),C=!1;t.exports={inject:r}},{"./ARIADOMPropertyConfig":208,"./BeforeInputEventPlugin":210,"./ChangeEventPlugin":214,"./DefaultEventPluginOrder":221,"./EnterLeaveEventPlugin":222,"./HTMLDOMPropertyConfig":228,"./ReactComponentBrowserEnvironment":234,"./ReactDOMComponent":238,"./ReactDOMComponentTree":240,"./ReactDOMEmptyComponent":242,"./ReactDOMTextComponent":251,"./ReactDOMTreeTraversal":253,"./ReactDefaultBatchingStrategy":256,"./ReactEventListener":262,"./ReactInjection":266,"./ReactReconcileTransaction":278,"./SVGDOMPropertyConfig":286,"./SelectEventPlugin":287,"./SimpleEventPlugin":288}],258:[function(e,t,n){"use strict";var r="function"==typeof Symbol&&Symbol["for"]&&Symbol["for"]("react.element")||60103;t.exports=r},{}],259:[function(e,t,n){"use strict";var r,o={injectEmptyComponentFactory:function(e){r=e}},a={create:function(e){return r(e)}};a.injection=o,t.exports=a},{}],260:[function(e,t,n){(function(e){"use strict";function n(e,t,n){try{t(n)}catch(o){null===r&&(r=o)}}var r=null,o={invokeGuardedCallback:n,invokeGuardedCallbackWithCatch:n,rethrowCaughtError:function(){if(r){var e=r;throw r=null,e}}};if("production"!==e.env.NODE_ENV&&"undefined"!=typeof window&&"function"==typeof window.dispatchEvent&&"undefined"!=typeof document&&"function"==typeof document.createEvent){var a=document.createElement("react");o.invokeGuardedCallback=function(e,t,n){var r=t.bind(null,n),o="react-"+e;a.addEventListener(o,r,!1);var i=document.createEvent("Event");i.initEvent(o,!1,!1),a.dispatchEvent(i),a.removeEventListener(o,r,!1)}}t.exports=o}).call(this,e("_process"))},{_process:168}],261:[function(e,t,n){"use strict";function r(e){o.enqueueEvents(e),o.processEventQueue(!1)}var o=e("./EventPluginHub"),a={handleTopLevel:function(e,t,n,a){var i=o.extractEvents(e,t,n,a);r(i)}};t.exports=a},{"./EventPluginHub":223}],262:[function(e,t,n){"use strict";function r(e){for(;e._hostParent;)e=e._hostParent;var t=d.getNodeFromInstance(e),n=t.parentNode;return d.getClosestInstanceFromNode(n)}function o(e,t){this.topLevelType=e,this.nativeEvent=t,this.ancestors=[]}function a(e){var t=f(e.nativeEvent),n=d.getClosestInstanceFromNode(t),o=n;do e.ancestors.push(o),o=o&&r(o);while(o);for(var a=0;a<e.ancestors.length;a++)n=e.ancestors[a],v._handleTopLevel(e.topLevelType,n,e.nativeEvent,f(e.nativeEvent))}function i(e){var t=h(window);e(t)}var s=e("object-assign"),u=e("fbjs/lib/EventListener"),c=e("fbjs/lib/ExecutionEnvironment"),l=e("./PooledClass"),d=e("./ReactDOMComponentTree"),p=e("./ReactUpdates"),f=e("./getEventTarget"),h=e("fbjs/lib/getUnboundedScrollPosition");s(o.prototype,{destructor:function(){this.topLevelType=null,this.nativeEvent=null,this.ancestors.length=0}}),l.addPoolingTo(o,l.twoArgumentPooler);var v={_enabled:!0,_handleTopLevel:null,WINDOW_HANDLE:c.canUseDOM?window:null,setHandleTopLevel:function(e){v._handleTopLevel=e},setEnabled:function(e){v._enabled=!!e},isEnabled:function(){return v._enabled},trapBubbledEvent:function(e,t,n){return n?u.listen(n,t,v.dispatchEvent.bind(null,e)):null},trapCapturedEvent:function(e,t,n){return n?u.capture(n,t,v.dispatchEvent.bind(null,e)):null},monitorScrollValue:function(e){var t=i.bind(null,e);u.listen(window,"scroll",t)},dispatchEvent:function(e,t){if(v._enabled){var n=o.getPooled(e,t);try{p.batchedUpdates(a,n)}finally{o.release(n)}}}};t.exports=v},{"./PooledClass":231,"./ReactDOMComponentTree":240,"./ReactUpdates":284,"./getEventTarget":316,"fbjs/lib/EventListener":35,"fbjs/lib/ExecutionEnvironment":36,"fbjs/lib/getUnboundedScrollPosition":47,"object-assign":167}],263:[function(e,t,n){"use strict";var r={logTopLevelRenders:!1};t.exports=r},{}],264:[function(e,t,n){(function(n){"use strict";function r(e){return u?void 0:"production"!==n.env.NODE_ENV?s(!1,"There is no registered component for the tag %s",e.type):i("111",e.type),new u(e)}function o(e){return new c(e)}function a(e){return e instanceof c}var i=e("./reactProdInvariant"),s=e("fbjs/lib/invariant"),u=null,c=null,l={injectGenericComponentClass:function(e){u=e},injectTextComponentClass:function(e){c=e}},d={createInternalComponent:r,createInstanceForText:o,isTextComponent:a,injection:l};t.exports=d}).call(this,e("_process"))},{"./reactProdInvariant":327,_process:168,"fbjs/lib/invariant":50}],265:[function(e,t,n){"use strict";var r=[],o={onHostOperation:function(e){r.push(e)},clearHistory:function(){o._preventClearing||(r=[])},getHistory:function(){return r}};t.exports=o},{}],266:[function(e,t,n){"use strict";var r=e("./DOMProperty"),o=e("./EventPluginHub"),a=e("./EventPluginUtils"),i=e("./ReactComponentEnvironment"),s=e("./ReactEmptyComponent"),u=e("./ReactBrowserEventEmitter"),c=e("./ReactHostComponent"),l=e("./ReactUpdates"),d={Component:i.injection,DOMProperty:r.injection,EmptyComponent:s.injection,EventPluginHub:o.injection,EventPluginUtils:a.injection,EventEmitter:u.injection,HostComponent:c.injection,Updates:l.injection};t.exports=d},{"./DOMProperty":218,"./EventPluginHub":223,"./EventPluginUtils":225,"./ReactBrowserEventEmitter":232,"./ReactComponentEnvironment":235,"./ReactEmptyComponent":259,"./ReactHostComponent":264,"./ReactUpdates":284}],267:[function(e,t,n){"use strict";function r(e){return a(document.documentElement,e)}var o=e("./ReactDOMSelection"),a=e("fbjs/lib/containsNode"),i=e("fbjs/lib/focusNode"),s=e("fbjs/lib/getActiveElement"),u={hasSelectionCapabilities:function(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&"text"===e.type||"textarea"===t||"true"===e.contentEditable)},getSelectionInformation:function(){var e=s();return{focusedElem:e,selectionRange:u.hasSelectionCapabilities(e)?u.getSelection(e):null}},restoreSelection:function(e){var t=s(),n=e.focusedElem,o=e.selectionRange;t!==n&&r(n)&&(u.hasSelectionCapabilities(n)&&u.setSelection(n,o),i(n))},getSelection:function(e){var t;if("selectionStart"in e)t={start:e.selectionStart,end:e.selectionEnd};else if(document.selection&&e.nodeName&&"input"===e.nodeName.toLowerCase()){var n=document.selection.createRange();n.parentElement()===e&&(t={start:-n.moveStart("character",-e.value.length),end:-n.moveEnd("character",-e.value.length)})}else t=o.getOffsets(e);return t||{start:0,end:0}},setSelection:function(e,t){var n=t.start,r=t.end;if(void 0===r&&(r=n),"selectionStart"in e)e.selectionStart=n,e.selectionEnd=Math.min(r,e.value.length);else if(document.selection&&e.nodeName&&"input"===e.nodeName.toLowerCase()){var a=e.createTextRange();a.collapse(!0),a.moveStart("character",n),a.moveEnd("character",r-n),a.select()}else o.setOffsets(e,t)}};t.exports=u},{"./ReactDOMSelection":250,"fbjs/lib/containsNode":39,"fbjs/lib/focusNode":44,"fbjs/lib/getActiveElement":45}],268:[function(e,t,n){"use strict";var r={remove:function(e){e._reactInternalInstance=void 0},get:function(e){return e._reactInternalInstance},has:function(e){return void 0!==e._reactInternalInstance},set:function(e,t){e._reactInternalInstance=t}};t.exports=r},{}],269:[function(e,t,n){(function(n){"use strict";var r=null;if("production"!==n.env.NODE_ENV){var o=e("./ReactDebugTool");r=o}t.exports={debugTool:r}}).call(this,e("_process"))},{"./ReactDebugTool":255,_process:168}],270:[function(e,t,n){(function(n){"use strict";var r=e("fbjs/lib/warning");if("production"!==n.env.NODE_ENV)var o=!1,a=function(){"production"!==n.env.NODE_ENV?r(!o,"setState(...): Cannot call setState() inside getChildContext()"):void 0};var i={onBeginProcessingChildContext:function(){o=!0},onEndProcessingChildContext:function(){o=!1},onSetState:function(){a()}};t.exports=i}).call(this,e("_process"))},{_process:168,"fbjs/lib/warning":57}],271:[function(e,t,n){"use strict";var r=e("./adler32"),o=/\/?>/,a=/^<\!\-\-/,i={CHECKSUM_ATTR_NAME:"data-react-checksum",addChecksumToMarkup:function(e){var t=r(e);return a.test(e)?e:e.replace(o," "+i.CHECKSUM_ATTR_NAME+'="'+t+'"$&')},canReuseMarkup:function(e,t){var n=t.getAttribute(i.CHECKSUM_ATTR_NAME);n=n&&parseInt(n,10);var o=r(e);return o===n}};t.exports=i},{"./adler32":305}],272:[function(e,t,n){(function(n){"use strict";function r(e,t){for(var n=Math.min(e.length,t.length),r=0;r<n;r++)if(e.charAt(r)!==t.charAt(r))return r;return e.length===t.length?-1:n}function o(e){return e?e.nodeType===F?e.documentElement:e.firstChild:null}function a(e){return e.getAttribute&&e.getAttribute(V)||""}function i(e,t,n,r,o){var a;if(D.logTopLevelRenders){var i=e._currentElement.props.child,s=i.type;a="React mount: "+("string"==typeof s?s:s.displayName||s.name),console.time(a)}var u=I.mountComponent(e,n,null,O(e,t),o,0);a&&console.timeEnd(a),e._renderedComponent._topLevelWrapper=e,z._mountImageIntoNode(u,t,e,r,n)}function s(e,t,n,r){var o=x.ReactReconcileTransaction.getPooled(!n&&C.useCreateElement);o.perform(i,null,e,t,o,n,r),x.ReactReconcileTransaction.release(o)}function u(e,t,r){for("production"!==n.env.NODE_ENV&&w.debugTool.onBeginFlush(),I.unmountComponent(e,r),"production"!==n.env.NODE_ENV&&w.debugTool.onEndFlush(),t.nodeType===F&&(t=t.documentElement);t.lastChild;)t.removeChild(t.lastChild)}function c(e){var t=o(e);if(t){var n=E.getInstanceFromNode(t);return!(!n||!n._hostParent)}}function l(e){var t=o(e);return!(!t||!p(t)||E.getInstanceFromNode(t))}function d(e){return!(!e||e.nodeType!==L&&e.nodeType!==F&&e.nodeType!==H)}function p(e){return d(e)&&(e.hasAttribute(U)||e.hasAttribute(V))}function f(e){var t=o(e),n=t&&E.getInstanceFromNode(t);return n&&!n._hostParent?n:null}function h(e){var t=f(e);return t?t._hostContainerInfo._topLevelWrapper:null}var v=e("./reactProdInvariant"),m=e("./DOMLazyTree"),g=e("./DOMProperty"),y=e("react/lib/React"),b=e("./ReactBrowserEventEmitter"),_=e("react/lib/ReactCurrentOwner"),E=e("./ReactDOMComponentTree"),O=e("./ReactDOMContainerInfo"),C=e("./ReactDOMFeatureFlags"),D=e("./ReactFeatureFlags"),N=e("./ReactInstanceMap"),w=e("./ReactInstrumentation"),T=e("./ReactMarkupChecksum"),I=e("./ReactReconciler"),k=e("./ReactUpdateQueue"),x=e("./ReactUpdates"),S=e("fbjs/lib/emptyObject"),R=e("./instantiateReactComponent"),P=e("fbjs/lib/invariant"),M=e("./setInnerHTML"),j=e("./shouldUpdateReactComponent"),A=e("fbjs/lib/warning"),V=g.ID_ATTRIBUTE_NAME,U=g.ROOT_ATTRIBUTE_NAME,L=1,F=9,H=11,B={},W=1,q=function(){this.rootID=W++};q.prototype.isReactComponent={},"production"!==n.env.NODE_ENV&&(q.displayName="TopLevelWrapper"),q.prototype.render=function(){return this.props.child},q.isReactTopLevelWrapper=!0;var z={TopLevelWrapper:q,_instancesByReactRootID:B,scrollMonitor:function(e,t){t()},_updateRootComponent:function(e,t,n,r,o){return z.scrollMonitor(r,function(){k.enqueueElementInternal(e,t,n),o&&k.enqueueCallbackInternal(e,o)}),e},_renderNewRootComponent:function(e,t,r,o){"production"!==n.env.NODE_ENV?A(null==_.current,"_renderNewRootComponent(): Render methods should be a pure function of props and state; triggering nested component updates from render is not allowed. If necessary, trigger nested updates in componentDidUpdate. Check the render method of %s.",_.current&&_.current.getName()||"ReactCompositeComponent"):void 0,d(t)?void 0:"production"!==n.env.NODE_ENV?P(!1,"_registerComponent(...): Target container is not a DOM element."):v("37"),
10
+ b.ensureScrollValueMonitoring();var a=R(e,!1);x.batchedUpdates(s,a,t,r,o);var i=a._instance.rootID;return B[i]=a,a},renderSubtreeIntoContainer:function(e,t,r,o){return null!=e&&N.has(e)?void 0:"production"!==n.env.NODE_ENV?P(!1,"parentComponent must be a valid React Component"):v("38"),z._renderSubtreeIntoContainer(e,t,r,o)},_renderSubtreeIntoContainer:function(e,t,r,i){k.validateCallback(i,"ReactDOM.render"),y.isValidElement(t)?void 0:"production"!==n.env.NODE_ENV?P(!1,"ReactDOM.render(): Invalid component element.%s","string"==typeof t?" Instead of passing a string like 'div', pass React.createElement('div') or <div />.":"function"==typeof t?" Instead of passing a class like Foo, pass React.createElement(Foo) or <Foo />.":null!=t&&void 0!==t.props?" This may be caused by unintentionally loading two independent copies of React.":""):v("39","string"==typeof t?" Instead of passing a string like 'div', pass React.createElement('div') or <div />.":"function"==typeof t?" Instead of passing a class like Foo, pass React.createElement(Foo) or <Foo />.":null!=t&&void 0!==t.props?" This may be caused by unintentionally loading two independent copies of React.":""),"production"!==n.env.NODE_ENV?A(!r||!r.tagName||"BODY"!==r.tagName.toUpperCase(),"render(): Rendering components directly into document.body is discouraged, since its children are often manipulated by third-party scripts and browser extensions. This may lead to subtle reconciliation issues. Try rendering into a container element created for your app."):void 0;var s,u=y.createElement(q,{child:t});if(e){var l=N.get(e);s=l._processChildContext(l._context)}else s=S;var d=h(r);if(d){var p=d._currentElement,f=p.props.child;if(j(f,t)){var m=d._renderedComponent.getPublicInstance(),g=i&&function(){i.call(m)};return z._updateRootComponent(d,u,s,r,g),m}z.unmountComponentAtNode(r)}var b=o(r),_=b&&!!a(b),E=c(r);if("production"!==n.env.NODE_ENV&&("production"!==n.env.NODE_ENV?A(!E,"render(...): Replacing React-rendered children with a new root component. If you intended to update the children of this node, you should instead have the existing children update their state and render the new components instead of calling ReactDOM.render."):void 0,!_||b.nextSibling))for(var O=b;O;){if(a(O)){"production"!==n.env.NODE_ENV?A(!1,"render(): Target node has markup rendered by React, but there are unrelated nodes as well. This is most commonly caused by white-space inserted around server-rendered markup."):void 0;break}O=O.nextSibling}var C=_&&!d&&!E,D=z._renderNewRootComponent(u,r,C,s)._renderedComponent.getPublicInstance();return i&&i.call(D),D},render:function(e,t,n){return z._renderSubtreeIntoContainer(null,e,t,n)},unmountComponentAtNode:function(e){"production"!==n.env.NODE_ENV?A(null==_.current,"unmountComponentAtNode(): Render methods should be a pure function of props and state; triggering nested component updates from render is not allowed. If necessary, trigger nested updates in componentDidUpdate. Check the render method of %s.",_.current&&_.current.getName()||"ReactCompositeComponent"):void 0,d(e)?void 0:"production"!==n.env.NODE_ENV?P(!1,"unmountComponentAtNode(...): Target container is not a DOM element."):v("40"),"production"!==n.env.NODE_ENV&&("production"!==n.env.NODE_ENV?A(!l(e),"unmountComponentAtNode(): The node you're attempting to unmount was rendered by another copy of React."):void 0);var t=h(e);if(!t){var r=c(e),o=1===e.nodeType&&e.hasAttribute(U);return"production"!==n.env.NODE_ENV&&("production"!==n.env.NODE_ENV?A(!r,"unmountComponentAtNode(): The node you're attempting to unmount was rendered by React and is not a top-level container. %s",o?"You may have accidentally passed in a React root node instead of its container.":"Instead, have the parent component update its state and rerender in order to remove this component."):void 0),!1}return delete B[t._instance.rootID],x.batchedUpdates(u,t,e,!1),!0},_mountImageIntoNode:function(e,t,a,i,s){if(d(t)?void 0:"production"!==n.env.NODE_ENV?P(!1,"mountComponentIntoNode(...): Target container is not valid."):v("41"),i){var u=o(t);if(T.canReuseMarkup(e,u))return void E.precacheNode(a,u);var c=u.getAttribute(T.CHECKSUM_ATTR_NAME);u.removeAttribute(T.CHECKSUM_ATTR_NAME);var l=u.outerHTML;u.setAttribute(T.CHECKSUM_ATTR_NAME,c);var p=e;if("production"!==n.env.NODE_ENV){var f;t.nodeType===L?(f=document.createElement("div"),f.innerHTML=e,p=f.innerHTML):(f=document.createElement("iframe"),document.body.appendChild(f),f.contentDocument.write(e),p=f.contentDocument.documentElement.outerHTML,document.body.removeChild(f))}var h=r(p,l),g=" (client) "+p.substring(h-20,h+20)+"\n (server) "+l.substring(h-20,h+20);t.nodeType===F?"production"!==n.env.NODE_ENV?P(!1,"You're trying to render a component to the document using server rendering but the checksum was invalid. This usually means you rendered a different component type or props on the client from the one on the server, or your render() methods are impure. React cannot handle this case due to cross-browser quirks by rendering at the document root. You should look for environment dependent code in your components and ensure the props are the same client and server side:\n%s",g):v("42",g):void 0,"production"!==n.env.NODE_ENV&&("production"!==n.env.NODE_ENV?A(!1,"React attempted to reuse markup in a container but the checksum was invalid. This generally means that you are using server rendering and the markup generated on the server was not what the client was expecting. React injected new markup to compensate which works but you have lost many of the benefits of server rendering. Instead, figure out why the markup being generated is different on the client or server:\n%s",g):void 0)}if(t.nodeType===F?"production"!==n.env.NODE_ENV?P(!1,"You're trying to render a component to the document but you didn't use server rendering. We can't do this without using server rendering due to cross-browser quirks. See ReactDOMServer.renderToString() for server rendering."):v("43"):void 0,s.useCreateElement){for(;t.lastChild;)t.removeChild(t.lastChild);m.insertTreeBefore(t,e,null)}else M(t,e),E.precacheNode(a,t.firstChild);if("production"!==n.env.NODE_ENV){var y=E.getInstanceFromNode(t.firstChild);0!==y._debugID&&w.debugTool.onHostOperation({instanceID:y._debugID,type:"mount",payload:e.toString()})}}};t.exports=z}).call(this,e("_process"))},{"./DOMLazyTree":216,"./DOMProperty":218,"./ReactBrowserEventEmitter":232,"./ReactDOMComponentTree":240,"./ReactDOMContainerInfo":241,"./ReactDOMFeatureFlags":243,"./ReactFeatureFlags":263,"./ReactInstanceMap":268,"./ReactInstrumentation":269,"./ReactMarkupChecksum":271,"./ReactReconciler":279,"./ReactUpdateQueue":283,"./ReactUpdates":284,"./instantiateReactComponent":323,"./reactProdInvariant":327,"./setInnerHTML":329,"./shouldUpdateReactComponent":331,_process:168,"fbjs/lib/emptyObject":43,"fbjs/lib/invariant":50,"fbjs/lib/warning":57,"react/lib/React":336,"react/lib/ReactCurrentOwner":340}],273:[function(e,t,n){(function(n){"use strict";function r(e,t,n){return{type:"INSERT_MARKUP",content:e,fromIndex:null,fromNode:null,toIndex:n,afterNode:t}}function o(e,t,n){return{type:"MOVE_EXISTING",content:null,fromIndex:e._mountIndex,fromNode:v.getHostNode(e),toIndex:n,afterNode:t}}function a(e,t){return{type:"REMOVE_NODE",content:null,fromIndex:e._mountIndex,fromNode:t,toIndex:null,afterNode:null}}function i(e){return{type:"SET_MARKUP",content:e,fromIndex:null,fromNode:null,toIndex:null,afterNode:null}}function s(e){return{type:"TEXT_CONTENT",content:e,fromIndex:null,fromNode:null,toIndex:null,afterNode:null}}function u(e,t){return t&&(e=e||[],e.push(t)),e}function c(e,t){d.processChildrenUpdates(e,t)}var l=e("./reactProdInvariant"),d=e("./ReactComponentEnvironment"),p=e("./ReactInstanceMap"),f=e("./ReactInstrumentation"),h=e("react/lib/ReactCurrentOwner"),v=e("./ReactReconciler"),m=e("./ReactChildReconciler"),g=e("fbjs/lib/emptyFunction"),y=e("./flattenChildren"),b=e("fbjs/lib/invariant"),_=g;if("production"!==n.env.NODE_ENV){var E=function(e){if(!e._debugID){var t;(t=p.get(e))&&(e=t)}return e._debugID};_=function(e){var t=E(this);0!==t&&f.debugTool.onSetChildren(t,e?Object.keys(e).map(function(t){return e[t]._debugID}):[])}}var O={Mixin:{_reconcilerInstantiateChildren:function(e,t,r){if("production"!==n.env.NODE_ENV){var o=E(this);if(this._currentElement)try{return h.current=this._currentElement._owner,m.instantiateChildren(e,t,r,o)}finally{h.current=null}}return m.instantiateChildren(e,t,r)},_reconcilerUpdateChildren:function(e,t,r,o,a,i){var s,u=0;if("production"!==n.env.NODE_ENV&&(u=E(this),this._currentElement)){try{h.current=this._currentElement._owner,s=y(t,u)}finally{h.current=null}return m.updateChildren(e,s,r,o,a,this,this._hostContainerInfo,i,u),s}return s=y(t,u),m.updateChildren(e,s,r,o,a,this,this._hostContainerInfo,i,u),s},mountChildren:function(e,t,r){var o=this._reconcilerInstantiateChildren(e,t,r);this._renderedChildren=o;var a=[],i=0;for(var s in o)if(o.hasOwnProperty(s)){var u=o[s],c=0;"production"!==n.env.NODE_ENV&&(c=E(this));var l=v.mountComponent(u,t,this,this._hostContainerInfo,r,c);u._mountIndex=i++,a.push(l)}return"production"!==n.env.NODE_ENV&&_.call(this,o),a},updateTextContent:function(e){var t=this._renderedChildren;m.unmountChildren(t,!1);for(var r in t)t.hasOwnProperty(r)&&("production"!==n.env.NODE_ENV?b(!1,"updateTextContent called on non-empty component."):l("118"));var o=[s(e)];c(this,o)},updateMarkup:function(e){var t=this._renderedChildren;m.unmountChildren(t,!1);for(var r in t)t.hasOwnProperty(r)&&("production"!==n.env.NODE_ENV?b(!1,"updateTextContent called on non-empty component."):l("118"));var o=[i(e)];c(this,o)},updateChildren:function(e,t,n){this._updateChildren(e,t,n)},_updateChildren:function(e,t,r){var o=this._renderedChildren,a={},i=[],s=this._reconcilerUpdateChildren(o,e,i,a,t,r);if(s||o){var l,d=null,p=0,f=0,h=0,m=null;for(l in s)if(s.hasOwnProperty(l)){var g=o&&o[l],y=s[l];g===y?(d=u(d,this.moveChild(g,m,p,f)),f=Math.max(g._mountIndex,f),g._mountIndex=p):(g&&(f=Math.max(g._mountIndex,f)),d=u(d,this._mountChildAtIndex(y,i[h],m,p,t,r)),h++),p++,m=v.getHostNode(y)}for(l in a)a.hasOwnProperty(l)&&(d=u(d,this._unmountChild(o[l],a[l])));d&&c(this,d),this._renderedChildren=s,"production"!==n.env.NODE_ENV&&_.call(this,s)}},unmountChildren:function(e){var t=this._renderedChildren;m.unmountChildren(t,e),this._renderedChildren=null},moveChild:function(e,t,n,r){if(e._mountIndex<r)return o(e,t,n)},createChild:function(e,t,n){return r(n,t,e._mountIndex)},removeChild:function(e,t){return a(e,t)},_mountChildAtIndex:function(e,t,n,r,o,a){return e._mountIndex=r,this.createChild(e,n,t)},_unmountChild:function(e,t){var n=this.removeChild(e,t);return e._mountIndex=null,n}}};t.exports=O}).call(this,e("_process"))},{"./ReactChildReconciler":233,"./ReactComponentEnvironment":235,"./ReactInstanceMap":268,"./ReactInstrumentation":269,"./ReactReconciler":279,"./flattenChildren":311,"./reactProdInvariant":327,_process:168,"fbjs/lib/emptyFunction":42,"fbjs/lib/invariant":50,"react/lib/ReactCurrentOwner":340}],274:[function(e,t,n){(function(n){"use strict";var r=e("./reactProdInvariant"),o=e("react/lib/React"),a=e("fbjs/lib/invariant"),i={HOST:0,COMPOSITE:1,EMPTY:2,getType:function(e){return null===e||e===!1?i.EMPTY:o.isValidElement(e)?"function"==typeof e.type?i.COMPOSITE:i.HOST:void("production"!==n.env.NODE_ENV?a(!1,"Unexpected node: %s",e):r("26",e))}};t.exports=i}).call(this,e("_process"))},{"./reactProdInvariant":327,_process:168,"fbjs/lib/invariant":50,"react/lib/React":336}],275:[function(e,t,n){(function(n){"use strict";function r(e){return!(!e||"function"!=typeof e.attachRef||"function"!=typeof e.detachRef)}var o=e("./reactProdInvariant"),a=e("fbjs/lib/invariant"),i={addComponentAsRefTo:function(e,t,i){r(i)?void 0:"production"!==n.env.NODE_ENV?a(!1,"addComponentAsRefTo(...): Only a ReactOwner can have refs. You might be adding a ref to a component that was not created inside a component's `render` method, or you have multiple copies of React loaded (details: https://fb.me/react-refs-must-have-owner)."):o("119"),i.attachRef(t,e)},removeComponentAsRefFrom:function(e,t,i){r(i)?void 0:"production"!==n.env.NODE_ENV?a(!1,"removeComponentAsRefFrom(...): Only a ReactOwner can have refs. You might be removing a ref to a component that was not created inside a component's `render` method, or you have multiple copies of React loaded (details: https://fb.me/react-refs-must-have-owner)."):o("120");var s=i.getPublicInstance();s&&s.refs[t]===e.getPublicInstance()&&i.detachRef(t)}};t.exports=i}).call(this,e("_process"))},{"./reactProdInvariant":327,_process:168,"fbjs/lib/invariant":50}],276:[function(e,t,n){(function(e){"use strict";var n={};"production"!==e.env.NODE_ENV&&(n={prop:"prop",context:"context",childContext:"child context"}),t.exports=n}).call(this,e("_process"))},{_process:168}],277:[function(e,t,n){"use strict";var r="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";t.exports=r},{}],278:[function(e,t,n){(function(n){"use strict";function r(e){this.reinitializeTransaction(),this.renderToStaticMarkup=!1,this.reactMountReady=a.getPooled(null),this.useCreateElement=e}var o=e("object-assign"),a=e("./CallbackQueue"),i=e("./PooledClass"),s=e("./ReactBrowserEventEmitter"),u=e("./ReactInputSelection"),c=e("./ReactInstrumentation"),l=e("./Transaction"),d=e("./ReactUpdateQueue"),p={initialize:u.getSelectionInformation,close:u.restoreSelection},f={initialize:function(){var e=s.isEnabled();return s.setEnabled(!1),e},close:function(e){s.setEnabled(e)}},h={initialize:function(){this.reactMountReady.reset()},close:function(){this.reactMountReady.notifyAll()}},v=[p,f,h];"production"!==n.env.NODE_ENV&&v.push({initialize:c.debugTool.onBeginFlush,close:c.debugTool.onEndFlush});var m={getTransactionWrappers:function(){return v},getReactMountReady:function(){return this.reactMountReady},getUpdateQueue:function(){return d},checkpoint:function(){return this.reactMountReady.checkpoint()},rollback:function(e){this.reactMountReady.rollback(e)},destructor:function(){a.release(this.reactMountReady),this.reactMountReady=null}};o(r.prototype,l,m),i.addPoolingTo(r),t.exports=r}).call(this,e("_process"))},{"./CallbackQueue":213,"./PooledClass":231,"./ReactBrowserEventEmitter":232,"./ReactInputSelection":267,"./ReactInstrumentation":269,"./ReactUpdateQueue":283,"./Transaction":302,_process:168,"object-assign":167}],279:[function(e,t,n){(function(n){"use strict";function r(){o.attachRefs(this,this._currentElement)}var o=e("./ReactRef"),a=e("./ReactInstrumentation"),i=e("fbjs/lib/warning"),s={mountComponent:function(e,t,o,i,s,u){"production"!==n.env.NODE_ENV&&0!==e._debugID&&a.debugTool.onBeforeMountComponent(e._debugID,e._currentElement,u);var c=e.mountComponent(t,o,i,s,u);return e._currentElement&&null!=e._currentElement.ref&&t.getReactMountReady().enqueue(r,e),"production"!==n.env.NODE_ENV&&0!==e._debugID&&a.debugTool.onMountComponent(e._debugID),c},getHostNode:function(e){return e.getHostNode()},unmountComponent:function(e,t){"production"!==n.env.NODE_ENV&&0!==e._debugID&&a.debugTool.onBeforeUnmountComponent(e._debugID),o.detachRefs(e,e._currentElement),e.unmountComponent(t),"production"!==n.env.NODE_ENV&&0!==e._debugID&&a.debugTool.onUnmountComponent(e._debugID)},receiveComponent:function(e,t,i,s){var u=e._currentElement;if(t!==u||s!==e._context){"production"!==n.env.NODE_ENV&&0!==e._debugID&&a.debugTool.onBeforeUpdateComponent(e._debugID,t);var c=o.shouldUpdateRefs(u,t);c&&o.detachRefs(e,u),e.receiveComponent(t,i,s),c&&e._currentElement&&null!=e._currentElement.ref&&i.getReactMountReady().enqueue(r,e),"production"!==n.env.NODE_ENV&&0!==e._debugID&&a.debugTool.onUpdateComponent(e._debugID)}},performUpdateIfNecessary:function(e,t,r){return e._updateBatchNumber!==r?void("production"!==n.env.NODE_ENV?i(null==e._updateBatchNumber||e._updateBatchNumber===r+1,"performUpdateIfNecessary: Unexpected batch number (current %s, pending %s)",r,e._updateBatchNumber):void 0):("production"!==n.env.NODE_ENV&&0!==e._debugID&&a.debugTool.onBeforeUpdateComponent(e._debugID,e._currentElement),e.performUpdateIfNecessary(t),void("production"!==n.env.NODE_ENV&&0!==e._debugID&&a.debugTool.onUpdateComponent(e._debugID)))}};t.exports=s}).call(this,e("_process"))},{"./ReactInstrumentation":269,"./ReactRef":280,_process:168,"fbjs/lib/warning":57}],280:[function(e,t,n){"use strict";function r(e,t,n){"function"==typeof e?e(t.getPublicInstance()):a.addComponentAsRefTo(t,e,n)}function o(e,t,n){"function"==typeof e?e(null):a.removeComponentAsRefFrom(t,e,n)}var a=e("./ReactOwner"),i={};i.attachRefs=function(e,t){if(null!==t&&"object"==typeof t){var n=t.ref;null!=n&&r(n,e,t._owner)}},i.shouldUpdateRefs=function(e,t){var n=null,r=null;null!==e&&"object"==typeof e&&(n=e.ref,r=e._owner);var o=null,a=null;return null!==t&&"object"==typeof t&&(o=t.ref,a=t._owner),n!==o||"string"==typeof o&&a!==r},i.detachRefs=function(e,t){if(null!==t&&"object"==typeof t){var n=t.ref;null!=n&&o(n,e,t._owner)}},t.exports=i},{"./ReactOwner":275}],281:[function(e,t,n){(function(n){"use strict";function r(e){this.reinitializeTransaction(),this.renderToStaticMarkup=e,this.useCreateElement=!1,this.updateQueue=new u(this)}var o=e("object-assign"),a=e("./PooledClass"),i=e("./Transaction"),s=e("./ReactInstrumentation"),u=e("./ReactServerUpdateQueue"),c=[];"production"!==n.env.NODE_ENV&&c.push({initialize:s.debugTool.onBeginFlush,close:s.debugTool.onEndFlush});var l={enqueue:function(){}},d={getTransactionWrappers:function(){return c},getReactMountReady:function(){return l},getUpdateQueue:function(){return this.updateQueue},destructor:function(){},checkpoint:function(){},rollback:function(){}};o(r.prototype,i,d),a.addPoolingTo(r),t.exports=r}).call(this,e("_process"))},{"./PooledClass":231,"./ReactInstrumentation":269,"./ReactServerUpdateQueue":282,"./Transaction":302,_process:168,"object-assign":167}],282:[function(e,t,n){(function(n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("production"!==n.env.NODE_ENV){var r=e.constructor;"production"!==n.env.NODE_ENV?i(!1,"%s(...): Can only update a mounting component. This usually means you called %s() outside componentWillMount() on the server. This is a no-op. Please check the code for the %s component.",t,t,r&&(r.displayName||r.name)||"ReactClass"):void 0}}var a=e("./ReactUpdateQueue"),i=e("fbjs/lib/warning"),s=function(){function e(t){r(this,e),this.transaction=t}return e.prototype.isMounted=function(e){return!1},e.prototype.enqueueCallback=function(e,t,n){this.transaction.isInTransaction()&&a.enqueueCallback(e,t,n)},e.prototype.enqueueForceUpdate=function(e){this.transaction.isInTransaction()?a.enqueueForceUpdate(e):o(e,"forceUpdate")},e.prototype.enqueueReplaceState=function(e,t){this.transaction.isInTransaction()?a.enqueueReplaceState(e,t):o(e,"replaceState")},e.prototype.enqueueSetState=function(e,t){this.transaction.isInTransaction()?a.enqueueSetState(e,t):o(e,"setState")},e}();t.exports=s}).call(this,e("_process"))},{"./ReactUpdateQueue":283,_process:168,"fbjs/lib/warning":57}],283:[function(e,t,n){(function(n){"use strict";function r(e){l.enqueueUpdate(e)}function o(e){var t=typeof e;if("object"!==t)return t;var n=e.constructor&&e.constructor.name||t,r=Object.keys(e);return r.length>0&&r.length<20?n+" (keys: "+r.join(", ")+")":n}function a(e,t){var r=u.get(e);if(!r){if("production"!==n.env.NODE_ENV){var o=e.constructor;"production"!==n.env.NODE_ENV?p(!t,"%s(...): Can only update a mounted or mounting component. This usually means you called %s() on an unmounted component. This is a no-op. Please check the code for the %s component.",t,t,o&&(o.displayName||o.name)||"ReactClass"):void 0}return null}return"production"!==n.env.NODE_ENV&&("production"!==n.env.NODE_ENV?p(null==s.current,"%s(...): Cannot update during an existing state transition (such as within `render` or another component's constructor). Render methods should be a pure function of props and state; constructor side-effects are an anti-pattern, but can be moved to `componentWillMount`.",t):void 0),r}var i=e("./reactProdInvariant"),s=e("react/lib/ReactCurrentOwner"),u=e("./ReactInstanceMap"),c=e("./ReactInstrumentation"),l=e("./ReactUpdates"),d=e("fbjs/lib/invariant"),p=e("fbjs/lib/warning"),f={isMounted:function(e){if("production"!==n.env.NODE_ENV){var t=s.current;null!==t&&("production"!==n.env.NODE_ENV?p(t._warnedAboutRefsInRender,"%s is accessing isMounted inside its render() function. render() should be a pure function of props and state. It should never access something that requires stale data from the previous render, such as refs. Move this logic to componentDidMount and componentDidUpdate instead.",t.getName()||"A component"):void 0,t._warnedAboutRefsInRender=!0)}var r=u.get(e);return!!r&&!!r._renderedComponent},enqueueCallback:function(e,t,n){f.validateCallback(t,n);var o=a(e);return o?(o._pendingCallbacks?o._pendingCallbacks.push(t):o._pendingCallbacks=[t],void r(o)):null},enqueueCallbackInternal:function(e,t){e._pendingCallbacks?e._pendingCallbacks.push(t):e._pendingCallbacks=[t],r(e)},enqueueForceUpdate:function(e){var t=a(e,"forceUpdate");t&&(t._pendingForceUpdate=!0,r(t))},enqueueReplaceState:function(e,t,n){var o=a(e,"replaceState");o&&(o._pendingStateQueue=[t],o._pendingReplaceState=!0,void 0!==n&&null!==n&&(f.validateCallback(n,"replaceState"),o._pendingCallbacks?o._pendingCallbacks.push(n):o._pendingCallbacks=[n]),r(o))},enqueueSetState:function(e,t){"production"!==n.env.NODE_ENV&&(c.debugTool.onSetState(),"production"!==n.env.NODE_ENV?p(null!=t,"setState(...): You passed an undefined or null state object; instead, use forceUpdate()."):void 0);var o=a(e,"setState");if(o){var i=o._pendingStateQueue||(o._pendingStateQueue=[]);i.push(t),r(o)}},enqueueElementInternal:function(e,t,n){e._pendingElement=t,e._context=n,r(e)},validateCallback:function(e,t){e&&"function"!=typeof e?"production"!==n.env.NODE_ENV?d(!1,"%s(...): Expected the last optional `callback` argument to be a function. Instead received: %s.",t,o(e)):i("122",t,o(e)):void 0}};t.exports=f}).call(this,e("_process"))},{"./ReactInstanceMap":268,"./ReactInstrumentation":269,"./ReactUpdates":284,"./reactProdInvariant":327,_process:168,"fbjs/lib/invariant":50,"fbjs/lib/warning":57,"react/lib/ReactCurrentOwner":340}],284:[function(e,t,n){(function(n){"use strict";function r(){I.ReactReconcileTransaction&&O?void 0:"production"!==n.env.NODE_ENV?g(!1,"ReactUpdates: must inject a reconcile transaction class and batching strategy"):l("123")}function o(){this.reinitializeTransaction(),this.dirtyComponentsLength=null,this.callbackQueue=p.getPooled(),this.reconcileTransaction=I.ReactReconcileTransaction.getPooled(!0)}function a(e,t,n,o,a,i){return r(),O.batchedUpdates(e,t,n,o,a,i)}function i(e,t){return e._mountOrder-t._mountOrder}function s(e){var t=e.dirtyComponentsLength;t!==y.length?"production"!==n.env.NODE_ENV?g(!1,"Expected flush transaction's stored dirty-components length (%s) to match dirty-components array length (%s).",t,y.length):l("124",t,y.length):void 0,y.sort(i),b++;for(var r=0;r<t;r++){var o=y[r],a=o._pendingCallbacks;o._pendingCallbacks=null;var s;if(h.logTopLevelRenders){var u=o;o._currentElement.type.isReactTopLevelWrapper&&(u=o._renderedComponent),s="React update: "+u.getName(),console.time(s)}if(v.performUpdateIfNecessary(o,e.reconcileTransaction,b),s&&console.timeEnd(s),a)for(var c=0;c<a.length;c++)e.callbackQueue.enqueue(a[c],o.getPublicInstance())}}function u(e){return r(),O.isBatchingUpdates?(y.push(e),void(null==e._updateBatchNumber&&(e._updateBatchNumber=b+1))):void O.batchedUpdates(u,e)}function c(e,t){O.isBatchingUpdates?void 0:"production"!==n.env.NODE_ENV?g(!1,"ReactUpdates.asap: Can't enqueue an asap callback in a context whereupdates are not being batched."):l("125"),_.enqueue(e,t),E=!0}var l=e("./reactProdInvariant"),d=e("object-assign"),p=e("./CallbackQueue"),f=e("./PooledClass"),h=e("./ReactFeatureFlags"),v=e("./ReactReconciler"),m=e("./Transaction"),g=e("fbjs/lib/invariant"),y=[],b=0,_=p.getPooled(),E=!1,O=null,C={initialize:function(){this.dirtyComponentsLength=y.length},close:function(){this.dirtyComponentsLength!==y.length?(y.splice(0,this.dirtyComponentsLength),w()):y.length=0}},D={initialize:function(){this.callbackQueue.reset()},close:function(){this.callbackQueue.notifyAll()}},N=[C,D];d(o.prototype,m,{getTransactionWrappers:function(){return N},destructor:function(){this.dirtyComponentsLength=null,p.release(this.callbackQueue),this.callbackQueue=null,I.ReactReconcileTransaction.release(this.reconcileTransaction),this.reconcileTransaction=null},perform:function(e,t,n){return m.perform.call(this,this.reconcileTransaction.perform,this.reconcileTransaction,e,t,n)}}),f.addPoolingTo(o);var w=function(){for(;y.length||E;){if(y.length){var e=o.getPooled();e.perform(s,null,e),o.release(e)}if(E){E=!1;var t=_;_=p.getPooled(),t.notifyAll(),p.release(t)}}},T={injectReconcileTransaction:function(e){e?void 0:"production"!==n.env.NODE_ENV?g(!1,"ReactUpdates: must provide a reconcile transaction class"):l("126"),I.ReactReconcileTransaction=e},injectBatchingStrategy:function(e){e?void 0:"production"!==n.env.NODE_ENV?g(!1,"ReactUpdates: must provide a batching strategy"):l("127"),"function"!=typeof e.batchedUpdates?"production"!==n.env.NODE_ENV?g(!1,"ReactUpdates: must provide a batchedUpdates() function"):l("128"):void 0,"boolean"!=typeof e.isBatchingUpdates?"production"!==n.env.NODE_ENV?g(!1,"ReactUpdates: must provide an isBatchingUpdates boolean attribute"):l("129"):void 0,O=e}},I={ReactReconcileTransaction:null,batchedUpdates:a,enqueueUpdate:u,flushBatchedUpdates:w,injection:T,asap:c};t.exports=I}).call(this,e("_process"))},{"./CallbackQueue":213,"./PooledClass":231,"./ReactFeatureFlags":263,"./ReactReconciler":279,"./Transaction":302,"./reactProdInvariant":327,_process:168,"fbjs/lib/invariant":50,"object-assign":167}],285:[function(e,t,n){"use strict";t.exports="15.6.1"},{}],286:[function(e,t,n){"use strict";var r={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"},o={accentHeight:"accent-height",accumulate:0,additive:0,alignmentBaseline:"alignment-baseline",allowReorder:"allowReorder",alphabetic:0,amplitude:0,arabicForm:"arabic-form",ascent:0,attributeName:"attributeName",attributeType:"attributeType",autoReverse:"autoReverse",azimuth:0,baseFrequency:"baseFrequency",baseProfile:"baseProfile",baselineShift:"baseline-shift",bbox:0,begin:0,bias:0,by:0,calcMode:"calcMode",capHeight:"cap-height",clip:0,clipPath:"clip-path",clipRule:"clip-rule",clipPathUnits:"clipPathUnits",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",contentScriptType:"contentScriptType",contentStyleType:"contentStyleType",cursor:0,cx:0,cy:0,d:0,decelerate:0,descent:0,diffuseConstant:"diffuseConstant",direction:0,display:0,divisor:0,dominantBaseline:"dominant-baseline",dur:0,dx:0,dy:0,edgeMode:"edgeMode",elevation:0,enableBackground:"enable-background",end:0,exponent:0,externalResourcesRequired:"externalResourcesRequired",fill:0,fillOpacity:"fill-opacity",fillRule:"fill-rule",filter:0,filterRes:"filterRes",filterUnits:"filterUnits",floodColor:"flood-color",floodOpacity:"flood-opacity",focusable:0,fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",format:0,from:0,fx:0,fy:0,g1:0,g2:0,glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",glyphRef:"glyphRef",gradientTransform:"gradientTransform",gradientUnits:"gradientUnits",hanging:0,horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",ideographic:0,imageRendering:"image-rendering","in":0,in2:0,intercept:0,k:0,k1:0,k2:0,k3:0,k4:0,kernelMatrix:"kernelMatrix",kernelUnitLength:"kernelUnitLength",kerning:0,keyPoints:"keyPoints",keySplines:"keySplines",keyTimes:"keyTimes",lengthAdjust:"lengthAdjust",letterSpacing:"letter-spacing",lightingColor:"lighting-color",limitingConeAngle:"limitingConeAngle",local:0,markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",markerHeight:"markerHeight",markerUnits:"markerUnits",markerWidth:"markerWidth",mask:0,maskContentUnits:"maskContentUnits",maskUnits:"maskUnits",mathematical:0,mode:0,numOctaves:"numOctaves",offset:0,opacity:0,operator:0,order:0,orient:0,orientation:0,origin:0,overflow:0,overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pathLength:"pathLength",patternContentUnits:"patternContentUnits",patternTransform:"patternTransform",patternUnits:"patternUnits",pointerEvents:"pointer-events",points:0,pointsAtX:"pointsAtX",pointsAtY:"pointsAtY",pointsAtZ:"pointsAtZ",preserveAlpha:"preserveAlpha",preserveAspectRatio:"preserveAspectRatio",primitiveUnits:"primitiveUnits",r:0,radius:0,refX:"refX",refY:"refY",renderingIntent:"rendering-intent",repeatCount:"repeatCount",repeatDur:"repeatDur",requiredExtensions:"requiredExtensions",requiredFeatures:"requiredFeatures",restart:0,result:0,rotate:0,rx:0,ry:0,scale:0,seed:0,shapeRendering:"shape-rendering",slope:0,spacing:0,specularConstant:"specularConstant",specularExponent:"specularExponent",speed:0,spreadMethod:"spreadMethod",startOffset:"startOffset",stdDeviation:"stdDeviation",stemh:0,stemv:0,stitchTiles:"stitchTiles",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",string:0,stroke:0,strokeDasharray:"stroke-dasharray",strokeDashoffset:"stroke-dashoffset",strokeLinecap:"stroke-linecap",strokeLinejoin:"stroke-linejoin",strokeMiterlimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",surfaceScale:"surfaceScale",systemLanguage:"systemLanguage",tableValues:"tableValues",targetX:"targetX",targetY:"targetY",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",textLength:"textLength",to:0,transform:0,u1:0,u2:0,underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicode:0,unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",values:0,vectorEffect:"vector-effect",version:0,vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",viewBox:"viewBox",viewTarget:"viewTarget",visibility:0,widths:0,wordSpacing:"word-spacing",writingMode:"writing-mode",x:0,xHeight:"x-height",x1:0,x2:0,xChannelSelector:"xChannelSelector",xlinkActuate:"xlink:actuate",xlinkArcrole:"xlink:arcrole",xlinkHref:"xlink:href",xlinkRole:"xlink:role",xlinkShow:"xlink:show",xlinkTitle:"xlink:title",xlinkType:"xlink:type",xmlBase:"xml:base",xmlns:0,xmlnsXlink:"xmlns:xlink",xmlLang:"xml:lang",xmlSpace:"xml:space",y:0,y1:0,y2:0,yChannelSelector:"yChannelSelector",z:0,zoomAndPan:"zoomAndPan"},a={Properties:{},DOMAttributeNamespaces:{xlinkActuate:r.xlink,xlinkArcrole:r.xlink,xlinkHref:r.xlink,xlinkRole:r.xlink,xlinkShow:r.xlink,xlinkTitle:r.xlink,xlinkType:r.xlink,xmlBase:r.xml,xmlLang:r.xml,xmlSpace:r.xml},DOMAttributeNames:{}};Object.keys(o).forEach(function(e){a.Properties[e]=0,o[e]&&(a.DOMAttributeNames[e]=o[e])}),t.exports=a},{}],287:[function(e,t,n){"use strict";function r(e){if("selectionStart"in e&&u.hasSelectionCapabilities(e))return{start:e.selectionStart,end:e.selectionEnd};if(window.getSelection){var t=window.getSelection();return{anchorNode:t.anchorNode,anchorOffset:t.anchorOffset,focusNode:t.focusNode,focusOffset:t.focusOffset}}if(document.selection){var n=document.selection.createRange();return{parentElement:n.parentElement(),text:n.text,top:n.boundingTop,left:n.boundingLeft}}}function o(e,t){
11
+ if(y||null==v||v!==l())return null;var n=r(v);if(!g||!p(g,n)){g=n;var o=c.getPooled(h.select,m,e,t);return o.type="select",o.target=v,a.accumulateTwoPhaseDispatches(o),o}return null}var a=e("./EventPropagators"),i=e("fbjs/lib/ExecutionEnvironment"),s=e("./ReactDOMComponentTree"),u=e("./ReactInputSelection"),c=e("./SyntheticEvent"),l=e("fbjs/lib/getActiveElement"),d=e("./isTextInputElement"),p=e("fbjs/lib/shallowEqual"),f=i.canUseDOM&&"documentMode"in document&&document.documentMode<=11,h={select:{phasedRegistrationNames:{bubbled:"onSelect",captured:"onSelectCapture"},dependencies:["topBlur","topContextMenu","topFocus","topKeyDown","topKeyUp","topMouseDown","topMouseUp","topSelectionChange"]}},v=null,m=null,g=null,y=!1,b=!1,_={eventTypes:h,extractEvents:function(e,t,n,r){if(!b)return null;var a=t?s.getNodeFromInstance(t):window;switch(e){case"topFocus":(d(a)||"true"===a.contentEditable)&&(v=a,m=t,g=null);break;case"topBlur":v=null,m=null,g=null;break;case"topMouseDown":y=!0;break;case"topContextMenu":case"topMouseUp":return y=!1,o(n,r);case"topSelectionChange":if(f)break;case"topKeyDown":case"topKeyUp":return o(n,r)}return null},didPutListener:function(e,t,n){"onSelect"===t&&(b=!0)}};t.exports=_},{"./EventPropagators":226,"./ReactDOMComponentTree":240,"./ReactInputSelection":267,"./SyntheticEvent":293,"./isTextInputElement":325,"fbjs/lib/ExecutionEnvironment":36,"fbjs/lib/getActiveElement":45,"fbjs/lib/shallowEqual":56}],288:[function(e,t,n){(function(n){"use strict";function r(e){return"."+e._rootNodeID}function o(e){return"button"===e||"input"===e||"select"===e||"textarea"===e}var a=e("./reactProdInvariant"),i=e("fbjs/lib/EventListener"),s=e("./EventPropagators"),u=e("./ReactDOMComponentTree"),c=e("./SyntheticAnimationEvent"),l=e("./SyntheticClipboardEvent"),d=e("./SyntheticEvent"),p=e("./SyntheticFocusEvent"),f=e("./SyntheticKeyboardEvent"),h=e("./SyntheticMouseEvent"),v=e("./SyntheticDragEvent"),m=e("./SyntheticTouchEvent"),g=e("./SyntheticTransitionEvent"),y=e("./SyntheticUIEvent"),b=e("./SyntheticWheelEvent"),_=e("fbjs/lib/emptyFunction"),E=e("./getEventCharCode"),O=e("fbjs/lib/invariant"),C={},D={};["abort","animationEnd","animationIteration","animationStart","blur","canPlay","canPlayThrough","click","contextMenu","copy","cut","doubleClick","drag","dragEnd","dragEnter","dragExit","dragLeave","dragOver","dragStart","drop","durationChange","emptied","encrypted","ended","error","focus","input","invalid","keyDown","keyPress","keyUp","load","loadedData","loadedMetadata","loadStart","mouseDown","mouseMove","mouseOut","mouseOver","mouseUp","paste","pause","play","playing","progress","rateChange","reset","scroll","seeked","seeking","stalled","submit","suspend","timeUpdate","touchCancel","touchEnd","touchMove","touchStart","transitionEnd","volumeChange","waiting","wheel"].forEach(function(e){var t=e[0].toUpperCase()+e.slice(1),n="on"+t,r="top"+t,o={phasedRegistrationNames:{bubbled:n,captured:n+"Capture"},dependencies:[r]};C[e]=o,D[r]=o});var N={},w={eventTypes:C,extractEvents:function(e,t,r,o){var i=D[e];if(!i)return null;var u;switch(e){case"topAbort":case"topCanPlay":case"topCanPlayThrough":case"topDurationChange":case"topEmptied":case"topEncrypted":case"topEnded":case"topError":case"topInput":case"topInvalid":case"topLoad":case"topLoadedData":case"topLoadedMetadata":case"topLoadStart":case"topPause":case"topPlay":case"topPlaying":case"topProgress":case"topRateChange":case"topReset":case"topSeeked":case"topSeeking":case"topStalled":case"topSubmit":case"topSuspend":case"topTimeUpdate":case"topVolumeChange":case"topWaiting":u=d;break;case"topKeyPress":if(0===E(r))return null;case"topKeyDown":case"topKeyUp":u=f;break;case"topBlur":case"topFocus":u=p;break;case"topClick":if(2===r.button)return null;case"topDoubleClick":case"topMouseDown":case"topMouseMove":case"topMouseUp":case"topMouseOut":case"topMouseOver":case"topContextMenu":u=h;break;case"topDrag":case"topDragEnd":case"topDragEnter":case"topDragExit":case"topDragLeave":case"topDragOver":case"topDragStart":case"topDrop":u=v;break;case"topTouchCancel":case"topTouchEnd":case"topTouchMove":case"topTouchStart":u=m;break;case"topAnimationEnd":case"topAnimationIteration":case"topAnimationStart":u=c;break;case"topTransitionEnd":u=g;break;case"topScroll":u=y;break;case"topWheel":u=b;break;case"topCopy":case"topCut":case"topPaste":u=l}u?void 0:"production"!==n.env.NODE_ENV?O(!1,"SimpleEventPlugin: Unhandled event type, `%s`.",e):a("86",e);var _=u.getPooled(i,t,r,o);return s.accumulateTwoPhaseDispatches(_),_},didPutListener:function(e,t,n){if("onClick"===t&&!o(e._tag)){var a=r(e),s=u.getNodeFromInstance(e);N[a]||(N[a]=i.listen(s,"click",_))}},willDeleteListener:function(e,t){if("onClick"===t&&!o(e._tag)){var n=r(e);N[n].remove(),delete N[n]}}};t.exports=w}).call(this,e("_process"))},{"./EventPropagators":226,"./ReactDOMComponentTree":240,"./SyntheticAnimationEvent":289,"./SyntheticClipboardEvent":290,"./SyntheticDragEvent":292,"./SyntheticEvent":293,"./SyntheticFocusEvent":294,"./SyntheticKeyboardEvent":296,"./SyntheticMouseEvent":297,"./SyntheticTouchEvent":298,"./SyntheticTransitionEvent":299,"./SyntheticUIEvent":300,"./SyntheticWheelEvent":301,"./getEventCharCode":313,"./reactProdInvariant":327,_process:168,"fbjs/lib/EventListener":35,"fbjs/lib/emptyFunction":42,"fbjs/lib/invariant":50}],289:[function(e,t,n){"use strict";function r(e,t,n,r){return o.call(this,e,t,n,r)}var o=e("./SyntheticEvent"),a={animationName:null,elapsedTime:null,pseudoElement:null};o.augmentClass(r,a),t.exports=r},{"./SyntheticEvent":293}],290:[function(e,t,n){"use strict";function r(e,t,n,r){return o.call(this,e,t,n,r)}var o=e("./SyntheticEvent"),a={clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}};o.augmentClass(r,a),t.exports=r},{"./SyntheticEvent":293}],291:[function(e,t,n){"use strict";function r(e,t,n,r){return o.call(this,e,t,n,r)}var o=e("./SyntheticEvent"),a={data:null};o.augmentClass(r,a),t.exports=r},{"./SyntheticEvent":293}],292:[function(e,t,n){"use strict";function r(e,t,n,r){return o.call(this,e,t,n,r)}var o=e("./SyntheticMouseEvent"),a={dataTransfer:null};o.augmentClass(r,a),t.exports=r},{"./SyntheticMouseEvent":297}],293:[function(e,t,n){(function(n){"use strict";function r(e,t,r,o){"production"!==n.env.NODE_ENV&&(delete this.nativeEvent,delete this.preventDefault,delete this.stopPropagation),this.dispatchConfig=e,this._targetInst=t,this.nativeEvent=r;var a=this.constructor.Interface;for(var i in a)if(a.hasOwnProperty(i)){"production"!==n.env.NODE_ENV&&delete this[i];var u=a[i];u?this[i]=u(r):"target"===i?this.target=o:this[i]=r[i]}var c=null!=r.defaultPrevented?r.defaultPrevented:r.returnValue===!1;return c?this.isDefaultPrevented=s.thatReturnsTrue:this.isDefaultPrevented=s.thatReturnsFalse,this.isPropagationStopped=s.thatReturnsFalse,this}function o(e,t){function r(e){var t=i?"setting the method":"setting the property";return a(t,"This is effectively a no-op"),e}function o(){var e=i?"accessing the method":"accessing the property",n=i?"This is a no-op function":"This is set to null";return a(e,n),t}function a(t,r){var o=!1;"production"!==n.env.NODE_ENV?u(o,"This synthetic event is reused for performance reasons. If you're seeing this, you're %s `%s` on a released/nullified synthetic event. %s. If you must keep the original synthetic event around, use event.persist(). See https://fb.me/react-event-pooling for more information.",t,e,r):void 0}var i="function"==typeof t;return{configurable:!0,set:r,get:o}}var a=e("object-assign"),i=e("./PooledClass"),s=e("fbjs/lib/emptyFunction"),u=e("fbjs/lib/warning"),c=!1,l="function"==typeof Proxy,d=["dispatchConfig","_targetInst","nativeEvent","isDefaultPrevented","isPropagationStopped","_dispatchListeners","_dispatchInstances"],p={type:null,target:null,currentTarget:s.thatReturnsNull,eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null};a(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=s.thatReturnsTrue)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=s.thatReturnsTrue)},persist:function(){this.isPersistent=s.thatReturnsTrue},isPersistent:s.thatReturnsFalse,destructor:function(){var e=this.constructor.Interface;for(var t in e)"production"!==n.env.NODE_ENV?Object.defineProperty(this,t,o(t,e[t])):this[t]=null;for(var r=0;r<d.length;r++)this[d[r]]=null;"production"!==n.env.NODE_ENV&&(Object.defineProperty(this,"nativeEvent",o("nativeEvent",null)),Object.defineProperty(this,"preventDefault",o("preventDefault",s)),Object.defineProperty(this,"stopPropagation",o("stopPropagation",s)))}}),r.Interface=p,"production"!==n.env.NODE_ENV&&l&&(r=new Proxy(r,{construct:function(e,t){return this.apply(e,Object.create(e.prototype),t)},apply:function(e,t,r){return new Proxy(e.apply(t,r),{set:function(e,t,r){return"isPersistent"===t||e.constructor.Interface.hasOwnProperty(t)||d.indexOf(t)!==-1||("production"!==n.env.NODE_ENV?u(c||e.isPersistent(),"This synthetic event is reused for performance reasons. If you're seeing this, you're adding a new property in the synthetic event object. The property is never released. See https://fb.me/react-event-pooling for more information."):void 0,c=!0),e[t]=r,!0}})}})),r.augmentClass=function(e,t){var n=this,r=function(){};r.prototype=n.prototype;var o=new r;a(o,e.prototype),e.prototype=o,e.prototype.constructor=e,e.Interface=a({},n.Interface,t),e.augmentClass=n.augmentClass,i.addPoolingTo(e,i.fourArgumentPooler)},i.addPoolingTo(r,i.fourArgumentPooler),t.exports=r}).call(this,e("_process"))},{"./PooledClass":231,_process:168,"fbjs/lib/emptyFunction":42,"fbjs/lib/warning":57,"object-assign":167}],294:[function(e,t,n){"use strict";function r(e,t,n,r){return o.call(this,e,t,n,r)}var o=e("./SyntheticUIEvent"),a={relatedTarget:null};o.augmentClass(r,a),t.exports=r},{"./SyntheticUIEvent":300}],295:[function(e,t,n){"use strict";function r(e,t,n,r){return o.call(this,e,t,n,r)}var o=e("./SyntheticEvent"),a={data:null};o.augmentClass(r,a),t.exports=r},{"./SyntheticEvent":293}],296:[function(e,t,n){"use strict";function r(e,t,n,r){return o.call(this,e,t,n,r)}var o=e("./SyntheticUIEvent"),a=e("./getEventCharCode"),i=e("./getEventKey"),s=e("./getEventModifierState"),u={key:i,location:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,repeat:null,locale:null,getModifierState:s,charCode:function(e){return"keypress"===e.type?a(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?a(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}};o.augmentClass(r,u),t.exports=r},{"./SyntheticUIEvent":300,"./getEventCharCode":313,"./getEventKey":314,"./getEventModifierState":315}],297:[function(e,t,n){"use strict";function r(e,t,n,r){return o.call(this,e,t,n,r)}var o=e("./SyntheticUIEvent"),a=e("./ViewportMetrics"),i=e("./getEventModifierState"),s={screenX:null,screenY:null,clientX:null,clientY:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,getModifierState:i,button:function(e){var t=e.button;return"which"in e?t:2===t?2:4===t?1:0},buttons:null,relatedTarget:function(e){return e.relatedTarget||(e.fromElement===e.srcElement?e.toElement:e.fromElement)},pageX:function(e){return"pageX"in e?e.pageX:e.clientX+a.currentScrollLeft},pageY:function(e){return"pageY"in e?e.pageY:e.clientY+a.currentScrollTop}};o.augmentClass(r,s),t.exports=r},{"./SyntheticUIEvent":300,"./ViewportMetrics":303,"./getEventModifierState":315}],298:[function(e,t,n){"use strict";function r(e,t,n,r){return o.call(this,e,t,n,r)}var o=e("./SyntheticUIEvent"),a=e("./getEventModifierState"),i={touches:null,targetTouches:null,changedTouches:null,altKey:null,metaKey:null,ctrlKey:null,shiftKey:null,getModifierState:a};o.augmentClass(r,i),t.exports=r},{"./SyntheticUIEvent":300,"./getEventModifierState":315}],299:[function(e,t,n){"use strict";function r(e,t,n,r){return o.call(this,e,t,n,r)}var o=e("./SyntheticEvent"),a={propertyName:null,elapsedTime:null,pseudoElement:null};o.augmentClass(r,a),t.exports=r},{"./SyntheticEvent":293}],300:[function(e,t,n){"use strict";function r(e,t,n,r){return o.call(this,e,t,n,r)}var o=e("./SyntheticEvent"),a=e("./getEventTarget"),i={view:function(e){if(e.view)return e.view;var t=a(e);if(t.window===t)return t;var n=t.ownerDocument;return n?n.defaultView||n.parentWindow:window},detail:function(e){return e.detail||0}};o.augmentClass(r,i),t.exports=r},{"./SyntheticEvent":293,"./getEventTarget":316}],301:[function(e,t,n){"use strict";function r(e,t,n,r){return o.call(this,e,t,n,r)}var o=e("./SyntheticMouseEvent"),a={deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:null,deltaMode:null};o.augmentClass(r,a),t.exports=r},{"./SyntheticMouseEvent":297}],302:[function(e,t,n){(function(n){"use strict";var r=e("./reactProdInvariant"),o=e("fbjs/lib/invariant"),a={},i={reinitializeTransaction:function(){this.transactionWrappers=this.getTransactionWrappers(),this.wrapperInitData?this.wrapperInitData.length=0:this.wrapperInitData=[],this._isInTransaction=!1},_isInTransaction:!1,getTransactionWrappers:null,isInTransaction:function(){return!!this._isInTransaction},perform:function(e,t,a,i,s,u,c,l){this.isInTransaction()?"production"!==n.env.NODE_ENV?o(!1,"Transaction.perform(...): Cannot initialize a transaction when there is already an outstanding transaction."):r("27"):void 0;var d,p;try{this._isInTransaction=!0,d=!0,this.initializeAll(0),p=e.call(t,a,i,s,u,c,l),d=!1}finally{try{if(d)try{this.closeAll(0)}catch(f){}else this.closeAll(0)}finally{this._isInTransaction=!1}}return p},initializeAll:function(e){for(var t=this.transactionWrappers,n=e;n<t.length;n++){var r=t[n];try{this.wrapperInitData[n]=a,this.wrapperInitData[n]=r.initialize?r.initialize.call(this):null}finally{if(this.wrapperInitData[n]===a)try{this.initializeAll(n+1)}catch(o){}}}},closeAll:function(e){this.isInTransaction()?void 0:"production"!==n.env.NODE_ENV?o(!1,"Transaction.closeAll(): Cannot close transaction when none are open."):r("28");for(var t=this.transactionWrappers,i=e;i<t.length;i++){var s,u=t[i],c=this.wrapperInitData[i];try{s=!0,c!==a&&u.close&&u.close.call(this,c),s=!1}finally{if(s)try{this.closeAll(i+1)}catch(l){}}}this.wrapperInitData.length=0}};t.exports=i}).call(this,e("_process"))},{"./reactProdInvariant":327,_process:168,"fbjs/lib/invariant":50}],303:[function(e,t,n){"use strict";var r={currentScrollLeft:0,currentScrollTop:0,refreshScrollValues:function(e){r.currentScrollLeft=e.x,r.currentScrollTop=e.y}};t.exports=r},{}],304:[function(e,t,n){(function(n){"use strict";function r(e,t){return null==t?"production"!==n.env.NODE_ENV?a(!1,"accumulateInto(...): Accumulated items must not be null or undefined."):o("30"):void 0,null==e?t:Array.isArray(e)?Array.isArray(t)?(e.push.apply(e,t),e):(e.push(t),e):Array.isArray(t)?[e].concat(t):[e,t]}var o=e("./reactProdInvariant"),a=e("fbjs/lib/invariant");t.exports=r}).call(this,e("_process"))},{"./reactProdInvariant":327,_process:168,"fbjs/lib/invariant":50}],305:[function(e,t,n){"use strict";function r(e){for(var t=1,n=0,r=0,a=e.length,i=a&-4;r<i;){for(var s=Math.min(r+4096,i);r<s;r+=4)n+=(t+=e.charCodeAt(r))+(t+=e.charCodeAt(r+1))+(t+=e.charCodeAt(r+2))+(t+=e.charCodeAt(r+3));t%=o,n%=o}for(;r<a;r++)n+=t+=e.charCodeAt(r);return t%=o,n%=o,t|n<<16}var o=65521;t.exports=r},{}],306:[function(e,t,n){(function(n){"use strict";function r(t,r,d,p,f,h){for(var v in t)if(t.hasOwnProperty(v)){var m;try{"function"!=typeof t[v]?"production"!==n.env.NODE_ENV?u(!1,"%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.",p||"React class",i[d],v):a("84",p||"React class",i[d],v):void 0,m=t[v](r,v,p,d,null,s)}catch(g){m=g}if("production"!==n.env.NODE_ENV?c(!m||m instanceof Error,"%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",p||"React class",i[d],v,typeof m):void 0,m instanceof Error&&!(m.message in l)){l[m.message]=!0;var y="";"production"!==n.env.NODE_ENV&&(o||(o=e("react/lib/ReactComponentTreeHook")),null!==h?y=o.getStackAddendumByID(h):null!==f&&(y=o.getCurrentStackAddendum(f))),"production"!==n.env.NODE_ENV?c(!1,"Failed %s type: %s%s",d,m.message,y):void 0}}}var o,a=e("./reactProdInvariant"),i=e("./ReactPropTypeLocationNames"),s=e("./ReactPropTypesSecret"),u=e("fbjs/lib/invariant"),c=e("fbjs/lib/warning");"undefined"!=typeof n&&n.env&&"test"===n.env.NODE_ENV&&(o=e("react/lib/ReactComponentTreeHook"));var l={};t.exports=r}).call(this,e("_process"))},{"./ReactPropTypeLocationNames":276,"./ReactPropTypesSecret":277,"./reactProdInvariant":327,_process:168,"fbjs/lib/invariant":50,"fbjs/lib/warning":57,"react/lib/ReactComponentTreeHook":339}],307:[function(e,t,n){"use strict";var r=function(e){return"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(t,n,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,o)})}:e};t.exports=r},{}],308:[function(e,t,n){(function(n){"use strict";function r(e,t,r,o){var u=null==t||"boolean"==typeof t||""===t;if(u)return"";var c=isNaN(t);if(o||c||0===t||i.hasOwnProperty(e)&&i[e])return""+t;if("string"==typeof t){if("production"!==n.env.NODE_ENV&&r&&"0"!==t){var l=r._currentElement._owner,d=l?l.getName():null;d&&!s[d]&&(s[d]={});var p=!1;if(d){var f=s[d];p=f[e],p||(f[e]=!0)}p||("production"!==n.env.NODE_ENV?a(!1,"a `%s` tag (owner: `%s`) was passed a numeric string value for CSS property `%s` (value: `%s`) which will be treated as a unitless number in a future version of React.",r._currentElement.type,d||"unknown",e,t):void 0)}t=t.trim()}return t+"px"}var o=e("./CSSProperty"),a=e("fbjs/lib/warning"),i=o.isUnitlessNumber,s={};t.exports=r}).call(this,e("_process"))},{"./CSSProperty":211,_process:168,"fbjs/lib/warning":57}],309:[function(e,t,n){"use strict";function r(e){var t=""+e,n=a.exec(t);if(!n)return t;var r,o="",i=0,s=0;for(i=n.index;i<t.length;i++){switch(t.charCodeAt(i)){case 34:r="&quot;";break;case 38:r="&amp;";break;case 39:r="&#x27;";break;case 60:r="&lt;";break;case 62:r="&gt;";break;default:continue}s!==i&&(o+=t.substring(s,i)),s=i+1,o+=r}return s!==i?o+t.substring(s,i):o}function o(e){return"boolean"==typeof e||"number"==typeof e?""+e:r(e)}var a=/["'&<>]/;t.exports=o},{}],310:[function(e,t,n){(function(n){"use strict";function r(e){if("production"!==n.env.NODE_ENV){var t=a.current;null!==t&&("production"!==n.env.NODE_ENV?l(t._warnedAboutRefsInRender,"%s is accessing findDOMNode inside its render(). render() should be a pure function of props and state. It should never access something that requires stale data from the previous render, such as refs. Move this logic to componentDidMount and componentDidUpdate instead.",t.getName()||"A component"):void 0,t._warnedAboutRefsInRender=!0)}if(null==e)return null;if(1===e.nodeType)return e;var r=s.get(e);return r?(r=u(r),r?i.getNodeFromInstance(r):null):void("function"==typeof e.render?"production"!==n.env.NODE_ENV?c(!1,"findDOMNode was called on an unmounted component."):o("44"):"production"!==n.env.NODE_ENV?c(!1,"Element appears to be neither ReactComponent nor DOMNode (keys: %s)",Object.keys(e)):o("45",Object.keys(e)))}var o=e("./reactProdInvariant"),a=e("react/lib/ReactCurrentOwner"),i=e("./ReactDOMComponentTree"),s=e("./ReactInstanceMap"),u=e("./getHostComponentFromComposite"),c=e("fbjs/lib/invariant"),l=e("fbjs/lib/warning");t.exports=r}).call(this,e("_process"))},{"./ReactDOMComponentTree":240,"./ReactInstanceMap":268,"./getHostComponentFromComposite":317,"./reactProdInvariant":327,_process:168,"fbjs/lib/invariant":50,"fbjs/lib/warning":57,"react/lib/ReactCurrentOwner":340}],311:[function(e,t,n){(function(n){"use strict";function r(t,r,o,s){if(t&&"object"==typeof t){var c=t,l=void 0===c[o];"production"!==n.env.NODE_ENV&&(a||(a=e("react/lib/ReactComponentTreeHook")),l||("production"!==n.env.NODE_ENV?u(!1,"flattenChildren(...): Encountered two children with the same key, `%s`. Child keys must be unique; when two children share a key, only the first child will be used.%s",i.unescape(o),a.getStackAddendumByID(s)):void 0)),l&&null!=r&&(c[o]=r)}}function o(e,t){if(null==e)return e;var o={};return"production"!==n.env.NODE_ENV?s(e,function(e,n,o){return r(e,n,o,t)},o):s(e,r,o),o}var a,i=e("./KeyEscapeUtils"),s=e("./traverseAllChildren"),u=e("fbjs/lib/warning");"undefined"!=typeof n&&n.env&&"test"===n.env.NODE_ENV&&(a=e("react/lib/ReactComponentTreeHook")),t.exports=o}).call(this,e("_process"))},{"./KeyEscapeUtils":229,"./traverseAllChildren":332,_process:168,"fbjs/lib/warning":57,"react/lib/ReactComponentTreeHook":339}],312:[function(e,t,n){"use strict";function r(e,t,n){Array.isArray(e)?e.forEach(t,n):e&&t.call(n,e)}t.exports=r},{}],313:[function(e,t,n){"use strict";function r(e){var t,n=e.keyCode;return"charCode"in e?(t=e.charCode,0===t&&13===n&&(t=13)):t=n,t>=32||13===t?t:0}t.exports=r},{}],314:[function(e,t,n){"use strict";function r(e){if(e.key){var t=a[e.key]||e.key;if("Unidentified"!==t)return t}if("keypress"===e.type){var n=o(e);return 13===n?"Enter":String.fromCharCode(n)}return"keydown"===e.type||"keyup"===e.type?i[e.keyCode]||"Unidentified":""}var o=e("./getEventCharCode"),a={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},i={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"};t.exports=r},{"./getEventCharCode":313}],315:[function(e,t,n){"use strict";function r(e){var t=this,n=t.nativeEvent;if(n.getModifierState)return n.getModifierState(e);var r=a[e];return!!r&&!!n[r]}function o(e){return r}var a={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};t.exports=o},{}],316:[function(e,t,n){"use strict";function r(e){var t=e.target||e.srcElement||window;return t.correspondingUseElement&&(t=t.correspondingUseElement),3===t.nodeType?t.parentNode:t}t.exports=r},{}],317:[function(e,t,n){"use strict";function r(e){for(var t;(t=e._renderedNodeType)===o.COMPOSITE;)e=e._renderedComponent;return t===o.HOST?e._renderedComponent:t===o.EMPTY?null:void 0}var o=e("./ReactNodeTypes");t.exports=r},{"./ReactNodeTypes":274}],318:[function(e,t,n){"use strict";function r(e){var t=e&&(o&&e[o]||e[a]);if("function"==typeof t)return t}var o="function"==typeof Symbol&&Symbol.iterator,a="@@iterator";t.exports=r},{}],319:[function(e,t,n){"use strict";function r(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function o(e){for(;e;){if(e.nextSibling)return e.nextSibling;e=e.parentNode}}function a(e,t){for(var n=r(e),a=0,i=0;n;){if(3===n.nodeType){if(i=a+n.textContent.length,a<=t&&i>=t)return{node:n,offset:t-a};a=i}n=r(o(n))}}t.exports=a},{}],320:[function(e,t,n){"use strict";function r(){return!a&&o.canUseDOM&&(a="textContent"in document.documentElement?"textContent":"innerText"),a}var o=e("fbjs/lib/ExecutionEnvironment"),a=null;t.exports=r},{"fbjs/lib/ExecutionEnvironment":36}],321:[function(e,t,n){"use strict";function r(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n["ms"+e]="MS"+t,n["O"+e]="o"+t.toLowerCase(),n}function o(e){if(s[e])return s[e];if(!i[e])return e;var t=i[e];for(var n in t)if(t.hasOwnProperty(n)&&n in u)return s[e]=t[n];return""}var a=e("fbjs/lib/ExecutionEnvironment"),i={animationend:r("Animation","AnimationEnd"),animationiteration:r("Animation","AnimationIteration"),animationstart:r("Animation","AnimationStart"),transitionend:r("Transition","TransitionEnd")},s={},u={};a.canUseDOM&&(u=document.createElement("div").style,"AnimationEvent"in window||(delete i.animationend.animation,delete i.animationiteration.animation,delete i.animationstart.animation),"TransitionEvent"in window||delete i.transitionend.transition),t.exports=o},{"fbjs/lib/ExecutionEnvironment":36}],322:[function(e,t,n){"use strict";function r(e){var t=e.type,n=e.nodeName;return n&&"input"===n.toLowerCase()&&("checkbox"===t||"radio"===t)}function o(e){return e._wrapperState.valueTracker}function a(e,t){e._wrapperState.valueTracker=t}function i(e){delete e._wrapperState.valueTracker}function s(e){var t;return e&&(t=r(e)?""+e.checked:e.value),t}var u=e("./ReactDOMComponentTree"),c={_getTrackerFromNode:function(e){return o(u.getInstanceFromNode(e))},track:function(e){if(!o(e)){var t=u.getNodeFromInstance(e),n=r(t)?"checked":"value",s=Object.getOwnPropertyDescriptor(t.constructor.prototype,n),c=""+t[n];t.hasOwnProperty(n)||"function"!=typeof s.get||"function"!=typeof s.set||(Object.defineProperty(t,n,{enumerable:s.enumerable,configurable:!0,get:function(){return s.get.call(this)},set:function(e){c=""+e,s.set.call(this,e)}}),a(e,{getValue:function(){return c},setValue:function(e){c=""+e},stopTracking:function(){i(e),delete t[n]}}))}},updateValueIfChanged:function(e){if(!e)return!1;var t=o(e);if(!t)return c.track(e),!0;var n=t.getValue(),r=s(u.getNodeFromInstance(e));return r!==n&&(t.setValue(r),!0)},stopTracking:function(e){var t=o(e);t&&t.stopTracking()}};t.exports=c},{"./ReactDOMComponentTree":240}],323:[function(e,t,n){(function(n){"use strict";function r(e){if(e){var t=e.getName();if(t)return" Check the render method of `"+t+"`."}return""}function o(e){return"function"==typeof e&&"undefined"!=typeof e.prototype&&"function"==typeof e.prototype.mountComponent&&"function"==typeof e.prototype.receiveComponent}function a(e,t){var s;if(null===e||e===!1)s=c.create(a);else if("object"==typeof e){var u=e,v=u.type;if("function"!=typeof v&&"string"!=typeof v){var m="";"production"!==n.env.NODE_ENV&&(void 0===v||"object"==typeof v&&null!==v&&0===Object.keys(v).length)&&(m+=" You likely forgot to export your component from the file it's defined in."),m+=r(u._owner),"production"!==n.env.NODE_ENV?p(!1,"Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",null==v?v:typeof v,m):i("130",null==v?v:typeof v,m)}"string"==typeof u.type?s=l.createInternalComponent(u):o(u.type)?(s=new u.type(u),s.getHostNode||(s.getHostNode=s.getNativeNode)):s=new h(u)}else"string"==typeof e||"number"==typeof e?s=l.createInstanceForText(e):"production"!==n.env.NODE_ENV?p(!1,"Encountered invalid React node of type %s",typeof e):i("131",typeof e);return"production"!==n.env.NODE_ENV&&("production"!==n.env.NODE_ENV?f("function"==typeof s.mountComponent&&"function"==typeof s.receiveComponent&&"function"==typeof s.getHostNode&&"function"==typeof s.unmountComponent,"Only React Components can be mounted."):void 0),s._mountIndex=0,s._mountImage=null,"production"!==n.env.NODE_ENV&&(s._debugID=t?d():0),"production"!==n.env.NODE_ENV&&Object.preventExtensions&&Object.preventExtensions(s),s}var i=e("./reactProdInvariant"),s=e("object-assign"),u=e("./ReactCompositeComponent"),c=e("./ReactEmptyComponent"),l=e("./ReactHostComponent"),d=e("react/lib/getNextDebugID"),p=e("fbjs/lib/invariant"),f=e("fbjs/lib/warning"),h=function(e){this.construct(e)};s(h.prototype,u,{_instantiateReactComponent:a}),t.exports=a}).call(this,e("_process"))},{"./ReactCompositeComponent":236,"./ReactEmptyComponent":259,"./ReactHostComponent":264,"./reactProdInvariant":327,_process:168,"fbjs/lib/invariant":50,"fbjs/lib/warning":57,"object-assign":167,"react/lib/getNextDebugID":354}],324:[function(e,t,n){"use strict";function r(e,t){if(!a.canUseDOM||t&&!("addEventListener"in document))return!1;var n="on"+e,r=n in document;if(!r){var i=document.createElement("div");i.setAttribute(n,"return;"),r="function"==typeof i[n]}return!r&&o&&"wheel"===e&&(r=document.implementation.hasFeature("Events.wheel","3.0")),r}var o,a=e("fbjs/lib/ExecutionEnvironment");a.canUseDOM&&(o=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0),t.exports=r},{"fbjs/lib/ExecutionEnvironment":36}],325:[function(e,t,n){"use strict";function r(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!o[e.type]:"textarea"===t}var o={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};t.exports=r},{}],326:[function(e,t,n){"use strict";function r(e){return'"'+o(e)+'"'}var o=e("./escapeTextContentForBrowser");t.exports=r},{"./escapeTextContentForBrowser":309}],327:[function(e,t,n){"use strict";function r(e){for(var t=arguments.length-1,n="Minified React error #"+e+"; visit http://facebook.github.io/react/docs/error-decoder.html?invariant="+e,r=0;r<t;r++)n+="&args[]="+encodeURIComponent(arguments[r+1]);n+=" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";var o=new Error(n);throw o.name="Invariant Violation",o.framesToPop=1,o}t.exports=r},{}],328:[function(e,t,n){"use strict";var r=e("./ReactMount");t.exports=r.renderSubtreeIntoContainer},{"./ReactMount":272}],329:[function(e,t,n){"use strict";var r,o=e("fbjs/lib/ExecutionEnvironment"),a=e("./DOMNamespaces"),i=/^[ \r\n\t\f]/,s=/<(!--|link|noscript|meta|script|style)[ \r\n\t\f\/>]/,u=e("./createMicrosoftUnsafeLocalFunction"),c=u(function(e,t){if(e.namespaceURI!==a.svg||"innerHTML"in e)e.innerHTML=t;else{r=r||document.createElement("div"),r.innerHTML="<svg>"+t+"</svg>";for(var n=r.firstChild;n.firstChild;)e.appendChild(n.firstChild)}});if(o.canUseDOM){var l=document.createElement("div");l.innerHTML=" ",""===l.innerHTML&&(c=function(e,t){if(e.parentNode&&e.parentNode.replaceChild(e,e),i.test(t)||"<"===t[0]&&s.test(t)){e.innerHTML=String.fromCharCode(65279)+t;var n=e.firstChild;1===n.data.length?e.removeChild(n):n.deleteData(0,1)}else e.innerHTML=t}),l=null}t.exports=c},{"./DOMNamespaces":217,"./createMicrosoftUnsafeLocalFunction":307,"fbjs/lib/ExecutionEnvironment":36}],330:[function(e,t,n){"use strict";var r=e("fbjs/lib/ExecutionEnvironment"),o=e("./escapeTextContentForBrowser"),a=e("./setInnerHTML"),i=function(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t};r.canUseDOM&&("textContent"in document.documentElement||(i=function(e,t){return 3===e.nodeType?void(e.nodeValue=t):void a(e,o(t))})),t.exports=i},{"./escapeTextContentForBrowser":309,"./setInnerHTML":329,"fbjs/lib/ExecutionEnvironment":36}],331:[function(e,t,n){"use strict";function r(e,t){var n=null===e||e===!1,r=null===t||t===!1;if(n||r)return n===r;var o=typeof e,a=typeof t;return"string"===o||"number"===o?"string"===a||"number"===a:"object"===a&&e.type===t.type&&e.key===t.key}t.exports=r},{}],332:[function(e,t,n){(function(n){"use strict";function r(e,t){return e&&"object"==typeof e&&null!=e.key?d.escape(e.key):t.toString(36)}function o(e,t,a,m){var g=typeof e;if("undefined"!==g&&"boolean"!==g||(e=null),null===e||"string"===g||"number"===g||"object"===g&&e.$$typeof===u)return a(m,e,""===t?f+r(e,0):t),1;var y,b,_=0,E=""===t?f:t+h;if(Array.isArray(e))for(var O=0;O<e.length;O++)y=e[O],b=E+r(y,O),_+=o(y,b,a,m);else{var C=c(e);if(C){var D,N=C.call(e);if(C!==e.entries)for(var w=0;!(D=N.next()).done;)y=D.value,b=E+r(y,w++),_+=o(y,b,a,m);else{if("production"!==n.env.NODE_ENV){var T="";if(s.current){var I=s.current.getName();
12
+ I&&(T=" Check the render method of `"+I+"`.")}"production"!==n.env.NODE_ENV?p(v,"Using Maps as children is not yet fully supported. It is an experimental feature that might be removed. Convert it to a sequence / iterable of keyed ReactElements instead.%s",T):void 0,v=!0}for(;!(D=N.next()).done;){var k=D.value;k&&(y=k[1],b=E+d.escape(k[0])+h+r(y,0),_+=o(y,b,a,m))}}}else if("object"===g){var x="";if("production"!==n.env.NODE_ENV&&(x=" If you meant to render a collection of children, use an array instead or wrap the object using createFragment(object) from the React add-ons.",e._isReactElement&&(x=" It looks like you're using an element created by a different version of React. Make sure to use only one copy of React."),s.current)){var S=s.current.getName();S&&(x+=" Check the render method of `"+S+"`.")}var R=String(e);"production"!==n.env.NODE_ENV?l(!1,"Objects are not valid as a React child (found: %s).%s","[object Object]"===R?"object with keys {"+Object.keys(e).join(", ")+"}":R,x):i("31","[object Object]"===R?"object with keys {"+Object.keys(e).join(", ")+"}":R,x)}}return _}function a(e,t,n){return null==e?0:o(e,"",t,n)}var i=e("./reactProdInvariant"),s=e("react/lib/ReactCurrentOwner"),u=e("./ReactElementSymbol"),c=e("./getIteratorFn"),l=e("fbjs/lib/invariant"),d=e("./KeyEscapeUtils"),p=e("fbjs/lib/warning"),f=".",h=":",v=!1;t.exports=a}).call(this,e("_process"))},{"./KeyEscapeUtils":229,"./ReactElementSymbol":258,"./getIteratorFn":318,"./reactProdInvariant":327,_process:168,"fbjs/lib/invariant":50,"fbjs/lib/warning":57,"react/lib/ReactCurrentOwner":340}],333:[function(e,t,n){(function(n){"use strict";var r=e("object-assign"),o=e("fbjs/lib/emptyFunction"),a=e("fbjs/lib/warning"),i=o;if("production"!==n.env.NODE_ENV){var s=["address","applet","area","article","aside","base","basefont","bgsound","blockquote","body","br","button","caption","center","col","colgroup","dd","details","dir","div","dl","dt","embed","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","iframe","img","input","isindex","li","link","listing","main","marquee","menu","menuitem","meta","nav","noembed","noframes","noscript","object","ol","p","param","plaintext","pre","script","section","select","source","style","summary","table","tbody","td","template","textarea","tfoot","th","thead","title","tr","track","ul","wbr","xmp"],u=["applet","caption","html","table","td","th","marquee","object","template","foreignObject","desc","title"],c=u.concat(["button"]),l=["dd","dt","li","option","optgroup","p","rp","rt"],d={current:null,formTag:null,aTagInScope:null,buttonTagInScope:null,nobrTagInScope:null,pTagInButtonScope:null,listItemTagAutoclosing:null,dlItemTagAutoclosing:null},p=function(e,t,n){var o=r({},e||d),a={tag:t,instance:n};return u.indexOf(t)!==-1&&(o.aTagInScope=null,o.buttonTagInScope=null,o.nobrTagInScope=null),c.indexOf(t)!==-1&&(o.pTagInButtonScope=null),s.indexOf(t)!==-1&&"address"!==t&&"div"!==t&&"p"!==t&&(o.listItemTagAutoclosing=null,o.dlItemTagAutoclosing=null),o.current=a,"form"===t&&(o.formTag=a),"a"===t&&(o.aTagInScope=a),"button"===t&&(o.buttonTagInScope=a),"nobr"===t&&(o.nobrTagInScope=a),"p"===t&&(o.pTagInButtonScope=a),"li"===t&&(o.listItemTagAutoclosing=a),"dd"!==t&&"dt"!==t||(o.dlItemTagAutoclosing=a),o},f=function(e,t){switch(t){case"select":return"option"===e||"optgroup"===e||"#text"===e;case"optgroup":return"option"===e||"#text"===e;case"option":return"#text"===e;case"tr":return"th"===e||"td"===e||"style"===e||"script"===e||"template"===e;case"tbody":case"thead":case"tfoot":return"tr"===e||"style"===e||"script"===e||"template"===e;case"colgroup":return"col"===e||"template"===e;case"table":return"caption"===e||"colgroup"===e||"tbody"===e||"tfoot"===e||"thead"===e||"style"===e||"script"===e||"template"===e;case"head":return"base"===e||"basefont"===e||"bgsound"===e||"link"===e||"meta"===e||"title"===e||"noscript"===e||"noframes"===e||"style"===e||"script"===e||"template"===e;case"html":return"head"===e||"body"===e;case"#document":return"html"===e}switch(e){case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":return"h1"!==t&&"h2"!==t&&"h3"!==t&&"h4"!==t&&"h5"!==t&&"h6"!==t;case"rp":case"rt":return l.indexOf(t)===-1;case"body":case"caption":case"col":case"colgroup":case"frame":case"head":case"html":case"tbody":case"td":case"tfoot":case"th":case"thead":case"tr":return null==t}return!0},h=function(e,t){switch(e){case"address":case"article":case"aside":case"blockquote":case"center":case"details":case"dialog":case"dir":case"div":case"dl":case"fieldset":case"figcaption":case"figure":case"footer":case"header":case"hgroup":case"main":case"menu":case"nav":case"ol":case"p":case"section":case"summary":case"ul":case"pre":case"listing":case"table":case"hr":case"xmp":case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":return t.pTagInButtonScope;case"form":return t.formTag||t.pTagInButtonScope;case"li":return t.listItemTagAutoclosing;case"dd":case"dt":return t.dlItemTagAutoclosing;case"button":return t.buttonTagInScope;case"a":return t.aTagInScope;case"nobr":return t.nobrTagInScope}return null},v=function(e){if(!e)return[];var t=[];do t.push(e);while(e=e._currentElement._owner);return t.reverse(),t},m={};i=function(e,t,r,o){o=o||d;var i=o.current,s=i&&i.tag;null!=t&&("production"!==n.env.NODE_ENV?a(null==e,"validateDOMNesting: when childText is passed, childTag should be null"):void 0,e="#text");var u=f(e,s)?null:i,c=u?null:h(e,o),l=u||c;if(l){var p,g=l.tag,y=l.instance,b=r&&r._currentElement._owner,_=y&&y._currentElement._owner,E=v(b),O=v(_),C=Math.min(E.length,O.length),D=-1;for(p=0;p<C&&E[p]===O[p];p++)D=p;var N="(unknown)",w=E.slice(D+1).map(function(e){return e.getName()||N}),T=O.slice(D+1).map(function(e){return e.getName()||N}),I=[].concat(D!==-1?E[D].getName()||N:[],T,g,c?["..."]:[],w,e).join(" > "),k=!!u+"|"+e+"|"+g+"|"+I;if(m[k])return;m[k]=!0;var x=e,S="";if("#text"===e?/\S/.test(t)?x="Text nodes":(x="Whitespace text nodes",S=" Make sure you don't have any extra whitespace between tags on each line of your source code."):x="<"+e+">",u){var R="";"table"===g&&"tr"===e&&(R+=" Add a <tbody> to your code to match the DOM tree generated by the browser."),"production"!==n.env.NODE_ENV?a(!1,"validateDOMNesting(...): %s cannot appear as a child of <%s>.%s See %s.%s",x,g,S,I,R):void 0}else"production"!==n.env.NODE_ENV?a(!1,"validateDOMNesting(...): %s cannot appear as a descendant of <%s>. See %s.",x,g,I):void 0}},i.updatedAncestorInfo=p,i.isTagValidInContext=function(e,t){t=t||d;var n=t.current,r=n&&n.tag;return f(e,r)&&!h(e,t)}}t.exports=i}).call(this,e("_process"))},{_process:168,"fbjs/lib/emptyFunction":42,"fbjs/lib/warning":57,"object-assign":167}],334:[function(e,t,n){arguments[4][229][0].apply(n,arguments)},{dup:229}],335:[function(e,t,n){(function(n){"use strict";var r=e("./reactProdInvariant"),o=e("fbjs/lib/invariant"),a=function(e){var t=this;if(t.instancePool.length){var n=t.instancePool.pop();return t.call(n,e),n}return new t(e)},i=function(e,t){var n=this;if(n.instancePool.length){var r=n.instancePool.pop();return n.call(r,e,t),r}return new n(e,t)},s=function(e,t,n){var r=this;if(r.instancePool.length){var o=r.instancePool.pop();return r.call(o,e,t,n),o}return new r(e,t,n)},u=function(e,t,n,r){var o=this;if(o.instancePool.length){var a=o.instancePool.pop();return o.call(a,e,t,n,r),a}return new o(e,t,n,r)},c=function(e){var t=this;e instanceof t?void 0:"production"!==n.env.NODE_ENV?o(!1,"Trying to release an instance into a pool of a different type."):r("25"),e.destructor(),t.instancePool.length<t.poolSize&&t.instancePool.push(e)},l=10,d=a,p=function(e,t){var n=e;return n.instancePool=[],n.getPooled=t||d,n.poolSize||(n.poolSize=l),n.release=c,n},f={addPoolingTo:p,oneArgumentPooler:a,twoArgumentPooler:i,threeArgumentPooler:s,fourArgumentPooler:u};t.exports=f}).call(this,e("_process"))},{"./reactProdInvariant":357,_process:168,"fbjs/lib/invariant":50}],336:[function(e,t,n){(function(n){"use strict";var r=e("object-assign"),o=e("./ReactBaseClasses"),a=e("./ReactChildren"),i=e("./ReactDOMFactories"),s=e("./ReactElement"),u=e("./ReactPropTypes"),c=e("./ReactVersion"),l=e("./createClass"),d=e("./onlyChild"),p=s.createElement,f=s.createFactory,h=s.cloneElement;if("production"!==n.env.NODE_ENV){var v=e("./lowPriorityWarning"),m=e("./canDefineProperty"),g=e("./ReactElementValidator"),y=!1;p=g.createElement,f=g.createFactory,h=g.cloneElement}var b=r,_=function(e){return e};if("production"!==n.env.NODE_ENV){var E=!1,O=!1;b=function(){return v(E,"React.__spread is deprecated and should not be used. Use Object.assign directly or another helper function with similar semantics. You may be seeing this warning due to your compiler. See https://fb.me/react-spread-deprecation for more details."),E=!0,r.apply(null,arguments)},_=function(e){return v(O,"React.createMixin is deprecated and should not be used. In React v16.0, it will be removed. You can use this mixin directly instead. See https://fb.me/createmixin-was-never-implemented for more info."),O=!0,e}}var C={Children:{map:a.map,forEach:a.forEach,count:a.count,toArray:a.toArray,only:d},Component:o.Component,PureComponent:o.PureComponent,createElement:p,cloneElement:h,isValidElement:s.isValidElement,PropTypes:u,createClass:l,createFactory:f,createMixin:_,DOM:i,version:c,__spread:b};if("production"!==n.env.NODE_ENV){var D=!1;m&&(Object.defineProperty(C,"PropTypes",{get:function(){return v(y,"Accessing PropTypes via the main React package is deprecated, and will be removed in React v16.0. Use the latest available v15.* prop-types package from npm instead. For info on usage, compatibility, migration and more, see https://fb.me/prop-types-docs"),y=!0,u}}),Object.defineProperty(C,"createClass",{get:function(){return v(D,"Accessing createClass via the main React package is deprecated, and will be removed in React v16.0. Use a plain JavaScript class instead. If you're not yet ready to migrate, create-react-class v15.* is available on npm as a temporary, drop-in replacement. For more info see https://fb.me/react-create-class"),D=!0,l}})),C.DOM={};var N=!1;Object.keys(i).forEach(function(e){C.DOM[e]=function(){return N||(v(!1,"Accessing factories like React.DOM.%s has been deprecated and will be removed in v16.0+. Use the react-dom-factories package instead. Version 1.0 provides a drop-in replacement. For more info, see https://fb.me/react-dom-factories",e),N=!0),i[e].apply(i,arguments)}})}t.exports=C}).call(this,e("_process"))},{"./ReactBaseClasses":337,"./ReactChildren":338,"./ReactDOMFactories":341,"./ReactElement":342,"./ReactElementValidator":344,"./ReactPropTypes":347,"./ReactVersion":349,"./canDefineProperty":350,"./createClass":352,"./lowPriorityWarning":355,"./onlyChild":356,_process:168,"object-assign":167}],337:[function(e,t,n){(function(n){"use strict";function r(e,t,n){this.props=e,this.context=t,this.refs=l,this.updater=n||u}function o(e,t,n){this.props=e,this.context=t,this.refs=l,this.updater=n||u}function a(){}var i=e("./reactProdInvariant"),s=e("object-assign"),u=e("./ReactNoopUpdateQueue"),c=e("./canDefineProperty"),l=e("fbjs/lib/emptyObject"),d=e("fbjs/lib/invariant"),p=e("./lowPriorityWarning");if(r.prototype.isReactComponent={},r.prototype.setState=function(e,t){"object"!=typeof e&&"function"!=typeof e&&null!=e?"production"!==n.env.NODE_ENV?d(!1,"setState(...): takes an object of state variables to update or a function which returns an object of state variables."):i("85"):void 0,this.updater.enqueueSetState(this,e),t&&this.updater.enqueueCallback(this,t,"setState")},r.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this),e&&this.updater.enqueueCallback(this,e,"forceUpdate")},"production"!==n.env.NODE_ENV){var f={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]},h=function(e,t){c&&Object.defineProperty(r.prototype,e,{get:function(){p(!1,"%s(...) is deprecated in plain JavaScript React classes. %s",t[0],t[1])}})};for(var v in f)f.hasOwnProperty(v)&&h(v,f[v])}a.prototype=r.prototype,o.prototype=new a,o.prototype.constructor=o,s(o.prototype,r.prototype),o.prototype.isPureReactComponent=!0,t.exports={Component:r,PureComponent:o}}).call(this,e("_process"))},{"./ReactNoopUpdateQueue":345,"./canDefineProperty":350,"./lowPriorityWarning":355,"./reactProdInvariant":357,_process:168,"fbjs/lib/emptyObject":43,"fbjs/lib/invariant":50,"object-assign":167}],338:[function(e,t,n){"use strict";function r(e){return(""+e).replace(_,"$&/")}function o(e,t){this.func=e,this.context=t,this.count=0}function a(e,t,n){var r=e.func,o=e.context;r.call(o,t,e.count++)}function i(e,t,n){if(null==e)return e;var r=o.getPooled(t,n);g(e,a,r),o.release(r)}function s(e,t,n,r){this.result=e,this.keyPrefix=t,this.func=n,this.context=r,this.count=0}function u(e,t,n){var o=e.result,a=e.keyPrefix,i=e.func,s=e.context,u=i.call(s,t,e.count++);Array.isArray(u)?c(u,o,n,m.thatReturnsArgument):null!=u&&(v.isValidElement(u)&&(u=v.cloneAndReplaceKey(u,a+(!u.key||t&&t.key===u.key?"":r(u.key)+"/")+n)),o.push(u))}function c(e,t,n,o,a){var i="";null!=n&&(i=r(n)+"/");var c=s.getPooled(t,i,o,a);g(e,u,c),s.release(c)}function l(e,t,n){if(null==e)return e;var r=[];return c(e,r,null,t,n),r}function d(e,t,n){return null}function p(e,t){return g(e,d,null)}function f(e){var t=[];return c(e,t,null,m.thatReturnsArgument),t}var h=e("./PooledClass"),v=e("./ReactElement"),m=e("fbjs/lib/emptyFunction"),g=e("./traverseAllChildren"),y=h.twoArgumentPooler,b=h.fourArgumentPooler,_=/\/+/g;o.prototype.destructor=function(){this.func=null,this.context=null,this.count=0},h.addPoolingTo(o,y),s.prototype.destructor=function(){this.result=null,this.keyPrefix=null,this.func=null,this.context=null,this.count=0},h.addPoolingTo(s,b);var E={forEach:i,map:l,mapIntoWithKeyPrefixInternal:c,count:p,toArray:f};t.exports=E},{"./PooledClass":335,"./ReactElement":342,"./traverseAllChildren":358,"fbjs/lib/emptyFunction":42}],339:[function(e,t,n){(function(n){"use strict";function r(e){var t=Function.prototype.toString,n=Object.prototype.hasOwnProperty,r=RegExp("^"+t.call(n).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");try{var o=t.call(e);return r.test(o)}catch(a){return!1}}function o(e){var t=c(e);if(t){var n=t.childIDs;l(e),n.forEach(o)}}function a(e,t,n){return"\n in "+(e||"Unknown")+(t?" (at "+t.fileName.replace(/^.*[\\\/]/,"")+":"+t.lineNumber+")":n?" (created by "+n+")":"")}function i(e){return null==e?"#empty":"string"==typeof e||"number"==typeof e?"#text":"string"==typeof e.type?e.type:e.type.displayName||e.type.name||"Unknown"}function s(e){var t,r=T.getDisplayName(e),o=T.getElement(e),i=T.getOwnerID(e);return i&&(t=T.getDisplayName(i)),"production"!==n.env.NODE_ENV?y(o,"ReactComponentTreeHook: Missing React element for debugID %s when building stack",e):void 0,a(r,o&&o._source,t)}var u,c,l,d,p,f,h,v=e("./reactProdInvariant"),m=e("./ReactCurrentOwner"),g=e("fbjs/lib/invariant"),y=e("fbjs/lib/warning"),b="function"==typeof Array.from&&"function"==typeof Map&&r(Map)&&null!=Map.prototype&&"function"==typeof Map.prototype.keys&&r(Map.prototype.keys)&&"function"==typeof Set&&r(Set)&&null!=Set.prototype&&"function"==typeof Set.prototype.keys&&r(Set.prototype.keys);if(b){var _=new Map,E=new Set;u=function(e,t){_.set(e,t)},c=function(e){return _.get(e)},l=function(e){_["delete"](e)},d=function(){return Array.from(_.keys())},p=function(e){E.add(e)},f=function(e){E["delete"](e)},h=function(){return Array.from(E.keys())}}else{var O={},C={},D=function(e){return"."+e},N=function(e){return parseInt(e.substr(1),10)};u=function(e,t){var n=D(e);O[n]=t},c=function(e){var t=D(e);return O[t]},l=function(e){var t=D(e);delete O[t]},d=function(){return Object.keys(O).map(N)},p=function(e){var t=D(e);C[t]=!0},f=function(e){var t=D(e);delete C[t]},h=function(){return Object.keys(C).map(N)}}var w=[],T={onSetChildren:function(e,t){var r=c(e);r?void 0:"production"!==n.env.NODE_ENV?g(!1,"Item must have been set"):v("144"),r.childIDs=t;for(var o=0;o<t.length;o++){var a=t[o],i=c(a);i?void 0:"production"!==n.env.NODE_ENV?g(!1,"Expected hook events to fire for the child before its parent includes it in onSetChildren()."):v("140"),null==i.childIDs&&"object"==typeof i.element&&null!=i.element?"production"!==n.env.NODE_ENV?g(!1,"Expected onSetChildren() to fire for a container child before its parent includes it in onSetChildren()."):v("141"):void 0,i.isMounted?void 0:"production"!==n.env.NODE_ENV?g(!1,"Expected onMountComponent() to fire for the child before its parent includes it in onSetChildren()."):v("71"),null==i.parentID&&(i.parentID=e),i.parentID!==e?"production"!==n.env.NODE_ENV?g(!1,"Expected onBeforeMountComponent() parent and onSetChildren() to be consistent (%s has parents %s and %s).",a,i.parentID,e):v("142",a,i.parentID,e):void 0}},onBeforeMountComponent:function(e,t,n){var r={element:t,parentID:n,text:null,childIDs:[],isMounted:!1,updateCount:0};u(e,r)},onBeforeUpdateComponent:function(e,t){var n=c(e);n&&n.isMounted&&(n.element=t)},onMountComponent:function(e){var t=c(e);t?void 0:"production"!==n.env.NODE_ENV?g(!1,"Item must have been set"):v("144"),t.isMounted=!0;var r=0===t.parentID;r&&p(e)},onUpdateComponent:function(e){var t=c(e);t&&t.isMounted&&t.updateCount++},onUnmountComponent:function(e){var t=c(e);if(t){t.isMounted=!1;var n=0===t.parentID;n&&f(e)}w.push(e)},purgeUnmountedComponents:function(){if(!T._preventPurging){for(var e=0;e<w.length;e++){var t=w[e];o(t)}w.length=0}},isMounted:function(e){var t=c(e);return!!t&&t.isMounted},getCurrentStackAddendum:function(e){var t="";if(e){var n=i(e),r=e._owner;t+=a(n,e._source,r&&r.getName())}var o=m.current,s=o&&o._debugID;return t+=T.getStackAddendumByID(s)},getStackAddendumByID:function(e){for(var t="";e;)t+=s(e),e=T.getParentID(e);return t},getChildIDs:function(e){var t=c(e);return t?t.childIDs:[]},getDisplayName:function(e){var t=T.getElement(e);return t?i(t):null},getElement:function(e){var t=c(e);return t?t.element:null},getOwnerID:function(e){var t=T.getElement(e);return t&&t._owner?t._owner._debugID:null},getParentID:function(e){var t=c(e);return t?t.parentID:null},getSource:function(e){var t=c(e),n=t?t.element:null,r=null!=n?n._source:null;return r},getText:function(e){var t=T.getElement(e);return"string"==typeof t?t:"number"==typeof t?""+t:null},getUpdateCount:function(e){var t=c(e);return t?t.updateCount:0},getRootIDs:h,getRegisteredIDs:d,pushNonStandardWarningStack:function(e,t){if("function"==typeof console.reactStack){var n=[],r=m.current,o=r&&r._debugID;try{for(e&&n.push({name:o?T.getDisplayName(o):null,fileName:t?t.fileName:null,lineNumber:t?t.lineNumber:null});o;){var a=T.getElement(o),i=T.getParentID(o),s=T.getOwnerID(o),u=s?T.getDisplayName(s):null,c=a&&a._source;n.push({name:u,fileName:c?c.fileName:null,lineNumber:c?c.lineNumber:null}),o=i}}catch(l){}console.reactStack(n)}},popNonStandardWarningStack:function(){"function"==typeof console.reactStackEnd&&console.reactStackEnd()}};t.exports=T}).call(this,e("_process"))},{"./ReactCurrentOwner":340,"./reactProdInvariant":357,_process:168,"fbjs/lib/invariant":50,"fbjs/lib/warning":57}],340:[function(e,t,n){"use strict";var r={current:null};t.exports=r},{}],341:[function(e,t,n){(function(n){"use strict";var r=e("./ReactElement"),o=r.createFactory;if("production"!==n.env.NODE_ENV){var a=e("./ReactElementValidator");o=a.createFactory}var i={a:o("a"),abbr:o("abbr"),address:o("address"),area:o("area"),article:o("article"),aside:o("aside"),audio:o("audio"),b:o("b"),base:o("base"),bdi:o("bdi"),bdo:o("bdo"),big:o("big"),blockquote:o("blockquote"),body:o("body"),br:o("br"),button:o("button"),canvas:o("canvas"),caption:o("caption"),cite:o("cite"),code:o("code"),col:o("col"),colgroup:o("colgroup"),data:o("data"),datalist:o("datalist"),dd:o("dd"),del:o("del"),details:o("details"),dfn:o("dfn"),dialog:o("dialog"),div:o("div"),dl:o("dl"),dt:o("dt"),em:o("em"),embed:o("embed"),fieldset:o("fieldset"),figcaption:o("figcaption"),figure:o("figure"),footer:o("footer"),form:o("form"),h1:o("h1"),h2:o("h2"),h3:o("h3"),h4:o("h4"),h5:o("h5"),h6:o("h6"),head:o("head"),header:o("header"),hgroup:o("hgroup"),hr:o("hr"),html:o("html"),i:o("i"),iframe:o("iframe"),img:o("img"),input:o("input"),ins:o("ins"),kbd:o("kbd"),keygen:o("keygen"),label:o("label"),legend:o("legend"),li:o("li"),link:o("link"),main:o("main"),map:o("map"),mark:o("mark"),menu:o("menu"),menuitem:o("menuitem"),meta:o("meta"),meter:o("meter"),nav:o("nav"),noscript:o("noscript"),object:o("object"),ol:o("ol"),optgroup:o("optgroup"),option:o("option"),output:o("output"),p:o("p"),param:o("param"),picture:o("picture"),pre:o("pre"),progress:o("progress"),q:o("q"),rp:o("rp"),rt:o("rt"),ruby:o("ruby"),s:o("s"),samp:o("samp"),script:o("script"),section:o("section"),select:o("select"),small:o("small"),source:o("source"),span:o("span"),strong:o("strong"),style:o("style"),sub:o("sub"),summary:o("summary"),sup:o("sup"),table:o("table"),tbody:o("tbody"),td:o("td"),textarea:o("textarea"),tfoot:o("tfoot"),th:o("th"),thead:o("thead"),time:o("time"),title:o("title"),tr:o("tr"),track:o("track"),u:o("u"),ul:o("ul"),"var":o("var"),video:o("video"),wbr:o("wbr"),circle:o("circle"),clipPath:o("clipPath"),defs:o("defs"),ellipse:o("ellipse"),g:o("g"),image:o("image"),line:o("line"),linearGradient:o("linearGradient"),mask:o("mask"),path:o("path"),pattern:o("pattern"),polygon:o("polygon"),polyline:o("polyline"),radialGradient:o("radialGradient"),rect:o("rect"),stop:o("stop"),svg:o("svg"),text:o("text"),tspan:o("tspan")};t.exports=i}).call(this,e("_process"))},{"./ReactElement":342,"./ReactElementValidator":344,_process:168}],342:[function(e,t,n){(function(n){"use strict";function r(e){if("production"!==n.env.NODE_ENV&&f.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return!1}return void 0!==e.ref}function o(e){if("production"!==n.env.NODE_ENV&&f.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return void 0!==e.key}function a(e,t){var r=function(){s||(s=!0,"production"!==n.env.NODE_ENV?d(!1,"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://fb.me/react-special-props)",t):void 0)};r.isReactWarning=!0,Object.defineProperty(e,"key",{get:r,configurable:!0})}function i(e,t){var r=function(){u||(u=!0,"production"!==n.env.NODE_ENV?d(!1,"%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://fb.me/react-special-props)",t):void 0)};r.isReactWarning=!0,Object.defineProperty(e,"ref",{get:r,configurable:!0})}var s,u,c=e("object-assign"),l=e("./ReactCurrentOwner"),d=e("fbjs/lib/warning"),p=e("./canDefineProperty"),f=Object.prototype.hasOwnProperty,h=e("./ReactElementSymbol"),v={key:!0,ref:!0,__self:!0,__source:!0},m=function(e,t,r,o,a,i,s){var u={$$typeof:h,type:e,key:t,ref:r,props:s,_owner:i};return"production"!==n.env.NODE_ENV&&(u._store={},p?(Object.defineProperty(u._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(u,"_self",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.defineProperty(u,"_source",{configurable:!1,enumerable:!1,writable:!1,value:a})):(u._store.validated=!1,u._self=o,u._source=a),Object.freeze&&(Object.freeze(u.props),Object.freeze(u))),u};m.createElement=function(e,t,s){var u,c={},d=null,p=null,g=null,y=null;if(null!=t){r(t)&&(p=t.ref),o(t)&&(d=""+t.key),g=void 0===t.__self?null:t.__self,y=void 0===t.__source?null:t.__source;for(u in t)f.call(t,u)&&!v.hasOwnProperty(u)&&(c[u]=t[u])}var b=arguments.length-2;if(1===b)c.children=s;else if(b>1){for(var _=Array(b),E=0;E<b;E++)_[E]=arguments[E+2];"production"!==n.env.NODE_ENV&&Object.freeze&&Object.freeze(_),c.children=_}if(e&&e.defaultProps){var O=e.defaultProps;for(u in O)void 0===c[u]&&(c[u]=O[u])}if("production"!==n.env.NODE_ENV&&(d||p)&&("undefined"==typeof c.$$typeof||c.$$typeof!==h)){var C="function"==typeof e?e.displayName||e.name||"Unknown":e;d&&a(c,C),p&&i(c,C)}return m(e,d,p,g,y,l.current,c)},m.createFactory=function(e){var t=m.createElement.bind(null,e);return t.type=e,t},m.cloneAndReplaceKey=function(e,t){var n=m(e.type,t,e.ref,e._self,e._source,e._owner,e.props);return n},m.cloneElement=function(e,t,n){var a,i=c({},e.props),s=e.key,u=e.ref,d=e._self,p=e._source,h=e._owner;if(null!=t){r(t)&&(u=t.ref,h=l.current),o(t)&&(s=""+t.key);var g;e.type&&e.type.defaultProps&&(g=e.type.defaultProps);for(a in t)f.call(t,a)&&!v.hasOwnProperty(a)&&(void 0===t[a]&&void 0!==g?i[a]=g[a]:i[a]=t[a])}var y=arguments.length-2;if(1===y)i.children=n;else if(y>1){for(var b=Array(y),_=0;_<y;_++)b[_]=arguments[_+2];i.children=b}return m(e.type,s,u,d,p,h,i)},m.isValidElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===h},t.exports=m}).call(this,e("_process"))},{"./ReactCurrentOwner":340,"./ReactElementSymbol":343,"./canDefineProperty":350,_process:168,"fbjs/lib/warning":57,"object-assign":167}],343:[function(e,t,n){arguments[4][258][0].apply(n,arguments)},{dup:258}],344:[function(e,t,n){(function(n){"use strict";function r(){if(c.current){var e=c.current.getName();if(e)return" Check the render method of `"+e+"`."}return""}function o(e){if(null!==e&&void 0!==e&&void 0!==e.__source){var t=e.__source,n=t.fileName.replace(/^.*[\\\/]/,""),r=t.lineNumber;return" Check your code at "+n+":"+r+"."}return""}function a(e){var t=r();if(!t){var n="string"==typeof e?e:e.displayName||e.name;n&&(t=" Check the top-level render call using <"+n+">.")}return t}function i(e,t){if(e._store&&!e._store.validated&&null==e.key){e._store.validated=!0;var r=g.uniqueKey||(g.uniqueKey={}),o=a(t);if(!r[o]){r[o]=!0;var i="";e&&e._owner&&e._owner!==c.current&&(i=" It was passed a child from "+e._owner.getName()+"."),"production"!==n.env.NODE_ENV?v(!1,'Each child in an array or iterator should have a unique "key" prop.%s%s See https://fb.me/react-warning-keys for more information.%s',o,i,l.getCurrentStackAddendum(e)):void 0}}}function s(e,t){if("object"==typeof e)if(Array.isArray(e))for(var n=0;n<e.length;n++){var r=e[n];d.isValidElement(r)&&i(r,t)}else if(d.isValidElement(e))e._store&&(e._store.validated=!0);else if(e){var o=h(e);if(o&&o!==e.entries)for(var a,s=o.call(e);!(a=s.next()).done;)d.isValidElement(a.value)&&i(a.value,t)}}function u(e){var t=e.type;if("function"==typeof t){var r=t.displayName||t.name;t.propTypes&&p(t.propTypes,e.props,"prop",r,e,null),"function"==typeof t.getDefaultProps&&("production"!==n.env.NODE_ENV?v(t.getDefaultProps.isReactClassApproved,"getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead."):void 0)}}var c=e("./ReactCurrentOwner"),l=e("./ReactComponentTreeHook"),d=e("./ReactElement"),p=e("./checkReactTypeSpec"),f=e("./canDefineProperty"),h=e("./getIteratorFn"),v=e("fbjs/lib/warning"),m=e("./lowPriorityWarning"),g={},y={createElement:function(e,t,a){var i="string"==typeof e||"function"==typeof e;if(!i&&"function"!=typeof e&&"string"!=typeof e){var c="";(void 0===e||"object"==typeof e&&null!==e&&0===Object.keys(e).length)&&(c+=" You likely forgot to export your component from the file it's defined in.");var p=o(t);c+=p?p:r(),c+=l.getCurrentStackAddendum();var f=null!==t&&void 0!==t&&void 0!==t.__source?t.__source:null;l.pushNonStandardWarningStack(!0,f),"production"!==n.env.NODE_ENV?v(!1,"React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",null==e?e:typeof e,c):void 0,l.popNonStandardWarningStack()}var h=d.createElement.apply(this,arguments);if(null==h)return h;if(i)for(var m=2;m<arguments.length;m++)s(arguments[m],e);return u(h),h},createFactory:function(e){var t=y.createElement.bind(null,e);return t.type=e,"production"!==n.env.NODE_ENV&&f&&Object.defineProperty(t,"type",{enumerable:!1,get:function(){return m(!1,"Factory.type is deprecated. Access the class directly before passing it to createFactory."),Object.defineProperty(this,"type",{value:e}),e}}),t},cloneElement:function(e,t,n){for(var r=d.cloneElement.apply(this,arguments),o=2;o<arguments.length;o++)s(arguments[o],r.type);return u(r),r}};t.exports=y}).call(this,e("_process"))},{"./ReactComponentTreeHook":339,"./ReactCurrentOwner":340,"./ReactElement":342,"./canDefineProperty":350,"./checkReactTypeSpec":351,"./getIteratorFn":353,"./lowPriorityWarning":355,_process:168,"fbjs/lib/warning":57}],345:[function(e,t,n){(function(n){"use strict";function r(e,t){if("production"!==n.env.NODE_ENV){var r=e.constructor;"production"!==n.env.NODE_ENV?o(!1,"%s(...): Can only update a mounted or mounting component. This usually means you called %s() on an unmounted component. This is a no-op. Please check the code for the %s component.",t,t,r&&(r.displayName||r.name)||"ReactClass"):void 0}}var o=e("fbjs/lib/warning"),a={isMounted:function(e){return!1},enqueueCallback:function(e,t){},enqueueForceUpdate:function(e){r(e,"forceUpdate")},enqueueReplaceState:function(e,t){r(e,"replaceState")},enqueueSetState:function(e,t){r(e,"setState")}};t.exports=a}).call(this,e("_process"))},{_process:168,"fbjs/lib/warning":57}],346:[function(e,t,n){(function(e){"use strict";var n={};"production"!==e.env.NODE_ENV&&(n={prop:"prop",context:"context",childContext:"child context"}),t.exports=n}).call(this,e("_process"))},{_process:168}],347:[function(e,t,n){"use strict";var r=e("./ReactElement"),o=r.isValidElement,a=e("prop-types/factory");t.exports=a(o)},{"./ReactElement":342,"prop-types/factory":170}],348:[function(e,t,n){arguments[4][277][0].apply(n,arguments)},{dup:277}],349:[function(e,t,n){arguments[4][285][0].apply(n,arguments)},{dup:285}],350:[function(e,t,n){(function(e){"use strict";var n=!1;if("production"!==e.env.NODE_ENV)try{Object.defineProperty({},"x",{get:function(){}}),n=!0}catch(r){}t.exports=n}).call(this,e("_process"))},{_process:168}],351:[function(e,t,n){(function(n){"use strict";function r(t,r,d,p,f,h){for(var v in t)if(t.hasOwnProperty(v)){var m;try{"function"!=typeof t[v]?"production"!==n.env.NODE_ENV?u(!1,"%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.",p||"React class",i[d],v):a("84",p||"React class"