Commit d4147374 by lmf

优化手机版产品图片查看

parent c39ce46c
<?xml version="1.0"?>
<!--
/**
* @author JaJuMa GmbH <info@jajuma.de>
* @copyright Copyright (c) 2020 JaJuMa GmbH <https://www.jajuma.de>. All rights reserved.
* @license http://opensource.org/licenses/mit-license.php MIT License
*/
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<css src="css/smartphoto.min.css" rel="stylesheet" type="text/css" />
</head>
</page>
var config = {
map: {
'*': {
smartphoto: 'Magento_Catalog/js/smartphoto.min'
}
}
};
......@@ -27,6 +27,34 @@ $srcset = $responsiveImageHelper->getSrcset($block->getProduct(), 'product_page_
$sizes = $responsiveImageHelper->getSizes('product_page_image_medium');
$thumbSizes = $responsiveImageHelper->getSizes('product_page_image_small');
?>
<style>
@media (min-width: 768px){
.main-image-wrapper .mobile-pic{
display: none !important;
}
}
@media (max-width: 768px){
.breeze-gallery .thumbnails,.breeze-gallery .prev, .breeze-gallery .next {
display:none;
}
.main-image-wrapper > img{
display:none;
}
.main-image-wrapper .mobile-pic{
display: block !important;
height: auto;
overflow-x: auto;
overflow-y: hidden;
white-space: nowrap;
}
.main-image-wrapper .mobile-pic > a{
width: 400px;
margin-left:2px;
height: auto;
}
}
</style>
<div class="breeze-gallery <?= $block->getGalleryOptions()->getVar('gallery/navdir') ?>">
<div class="stage <?= $mainImage && $mainImage->getVideoUrl() ? 'video' : '' ?>"
data-gallery-role="gallery-placeholder">
......@@ -41,6 +69,23 @@ $thumbSizes = $responsiveImageHelper->getSizes('product_page_image_small');
sizes="<?= $sizes ?>"
<?php endif ?>
/>
<div class="mobile-pic" >
<?php foreach ($images as $image) : ?>
<?php
$classes = array_filter([
'item',
$block->isMainImage($image) ? 'active' : '',
$image->getVideoUrl() ? 'video' : ''
]);
?>
<a class="<?= implode(' ', $classes) ?>" href="#" name="<?= $image->getLargeImageUrl() ?>" title="<?= $image->getLabel() ?: __('View Image') ?>" class="js-smartPhoto" data-caption="bear" data-id="bear" data-group="animal">
<img alt="<?= $image->getLabel() ?>"
src="<?= $image->getData('medium_image_url') ?>"
/>
</a>
<?php endforeach ?>
</div>
</div>
<?php if (count($images) > 1) : ?>
......@@ -103,13 +148,6 @@ $thumbSizes = $responsiveImageHelper->getSizes('product_page_image_small');
<?php endforeach ?>
<?php endif ?>
</div>
<div class="thumbnails-2" style="display: none">
<?php
foreach ($images as $key => $image) : ?>
<a href="#" name="<?= $image->getLargeImageUrl() ?>" title="<?= $image->getLabel() ?: __('View Image') ?>">
<?= $key + 1 ;?></a>
<?php endforeach ?>
</div>
</div>
<script type="text/x-magento-init">
......@@ -142,21 +180,17 @@ $thumbSizes = $responsiveImageHelper->getSizes('product_page_image_small');
border-radius: 50%;
background-color: #fff;
}
@media (max-width: 768px){
.breeze-gallery {
display: flex;
flex-direction: column;
margin-top: -20px;
}
}
</style>
<script>
require([
'jquery'
'jquery','smartphoto'
], function ($) {
$(".thumbnails > a").mouseover(function (s) {
var main_img = $(this).attr("name");
......@@ -192,6 +226,7 @@ $thumbSizes = $responsiveImageHelper->getSizes('product_page_image_small');
}
$(".main-image").attr("src",sd);
});
$(".js-smartPhoto").SmartPhoto();
});
</script>
@keyframes smartphoto{from{opacity:0}to{opacity:1}}@keyframes smartphoto-img-wrap{from{opacity:0}to{opacity:1}}@keyframes smartphoto-inner{from{transform:translate(0, 100px)}to{transform:translate(0, 0)}}@keyframes smartphoto-loader{0%{opacity:.4;transform:rotate(0deg)}50%{opacity:1;transform:rotate(180deg)}100%{opacity:.4;transform:rotate(360deg)}}@keyframes smartphoto-appear{0%{display:none;opacity:0}1%{display:block;opacity:0}100%{display:block;opacity:1}}@keyframes smartphoto-hide{0%{display:block;opacity:1}99%{display:block;opacity:0}100%{display:none;opacity:0}}.smartphoto{position:fixed;z-index:100;top:0;left:0;width:100%;height:100%;background-color:#000;opacity:1;font-family:sans-serif;cursor:pointer;-webkit-transition:opacity .3s ease-out;-moz-transition:opacity .3s ease-out;-ms-transition:opacity .3s ease-out;-o-transition:opacity .3s ease-out;transition:opacity .3s ease-out;transition:all 0.3s ease-out;animation-name:smartphoto;animation-duration:.3s;animation-timing-function:ease-out}.smartphoto[aria-hidden="true"]{display:none}.smartphoto-close{opacity:0}.smartphoto-count{display:inline-block;color:#FFF;font-size:16px}.smartphoto-header{display:block;box-sizing:border-box;position:fixed;z-index:102;top:0;left:0;width:100%;height:50px;padding:15px;background-color:rgba(0,0,0,0.2)}.smartphoto-content{display:block;position:absolute;top:0;left:0;width:100%;height:100%}.smartphoto-dismiss{display:block;position:absolute;top:15px;right:10px;width:20px;height:20px;padding:0;border:none;background-color:transparent;background-image:url(data:image/svg+xml;base64,PHN2ZyBpZD0i44Os44Kk44Ok44O8XzEiIGRhdGEtbmFtZT0i44Os44Kk44Ok44O8IDEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDI4MzQuNjUgMjgzNC42NSIgZmlsbD0iI0ZGRiI+PHRpdGxlPmljb248L3RpdGxlPjxwYXRoIGQ9Ik0xNTc2LjQyLDE0MDYuNzYsMjc4NCwxOTkuMTlhNTYuODYsNTYuODYsMCwwLDAsMC04MC4xOGwtNzguOTItNzguOTJhNTYuODYsNTYuODYsMCwwLDAtODAuMTgsMEwxNDE3LjMyLDEyNDcuNjYsMjA5Ljc1LDQwLjA5YTU2Ljg2LDU2Ljg2LDAsMCwwLTgwLjE4LDBMNTAuNjUsMTE5YTU2Ljg2LDU2Ljg2LDAsMCwwLDAsODAuMThMMTI1OC4yMywxNDA2Ljc2LDUwLjY1LDI2MTQuMzRhNTYuODYsNTYuODYsMCwwLDAsMCw4MC4xOGw3OC45Miw3OC45MmE1Ni44Niw1Ni44NiwwLDAsMCw4MC4xOCwwTDE0MTcuMzIsMTU2NS44NiwyNjI0LjksMjc3My40NGE1Ni44Niw1Ni44NiwwLDAsMCw4MC4xOCwwbDc4LjkyLTc4LjkyYTU2Ljg2LDU2Ljg2LDAsMCwwLDAtODAuMThaIi8+PC9zdmc+);text-shadow:0 1px 0 #FFF;color:#FFF;font-size:30px;text-decoration:none;cursor:pointer;line-height:1}.smartphoto-body{position:relative;z-index:102;width:100%;height:100%;margin:0 auto}.smartphoto-inner{position:relative;width:100%;height:100%;vertical-align:top}.smartphoto-img{display:none;max-width:none;width:auto;height:auto;cursor:zoom-in;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;transition:transform 0.3s ease-out;-webkit-user-drag:none}.smartphoto-img.active{display:block}.smartphoto-img-onmove{cursor:grab;cursor:-webkit-grab;transition:none}.smartphoto-img-elasticmove{transition:transform 0.3s ease-out}.smartphoto-img-wrap{display:inline-block;opacity:1;-webkit-transition:opacity .3s ease-out;-moz-transition:opacity .3s ease-out;-ms-transition:opacity .3s ease-out;-o-transition:opacity .3s ease-out;transition:opacity .3s ease-out;animation-name:smartphoto-img-wrap;animation-duration:.3s;animation-timing-function:ease-out}.smartphoto-img-left{transform:translateX(150%) !important}.smartphoto-img-right{transform:translateX(-150%) !important}.smartphoto-arrows{list-style-type:none;margin:0;padding:0;position:relative;z-index:1002;top:50%;left:0;opacity:1;animation-name:smartphoto-appear;animation-duration:.3s;animation-timing-function:ease-out}.smartphoto-arrows[aria-hidden="true"]{animation-name:smartphoto-hide;display:none}.smartphoto-arrows li{display:block;position:absolute;top:50%;width:30px;height:30px;animation-duration:.3s;animation-timing-function:ease-out;animation-name:smartphoto-appear}.smartphoto-arrows li:focus{outline:none}.smartphoto-arrows [aria-hidden="true"]{animation-name:smartphoto-hide;display:none}.smartphoto-arrows a{display:block;width:100%;height:100%;text-decoration:none}.smartphoto-arrow-right{right:0;background-image:url(data:image/svg+xml;base64,PHN2ZyBpZD0i44Os44Kk44Ok44O8XzEiIGRhdGEtbmFtZT0i44Os44Kk44Ok44O8IDEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDI4MzQuNjUgMjgzNC42NSIgZmlsbD0iI0ZGRiAiPjx0aXRsZT5pY29uPC90aXRsZT48cGF0aCBkPSJNMTgzNy44OCwxNDE3LjMyLDY0My41OSwyMjNhNzIuMjEsNzIuMjEsMCwwLDEsMC0xMDEuODJMNzQzLjgyLDIxYTcyLjIxLDcyLjIxLDAsMCwxLDEwMS44MiwwTDIwOTAuODMsMTI2Ni4xOWwxMDAuMjMsMTAwLjIzYTcyLjIxLDcyLjIxLDAsMCwxLDAsMTAxLjgyTDg0NS42NCwyODEzLjY1YTcyLjIxLDcyLjIxLDAsMCwxLTEwMS44MiwwTDY0My41OSwyNzEzLjQyYTcyLjIxLDcyLjIxLDAsMCwxLDAtMTAxLjgyWiIvPjwvc3ZnPg==)}.smartphoto-arrow-left{left:0;background-image:url(data:image/svg+xml;base64,PHN2ZyBpZD0i44Os44Kk44Ok44O8XzEiIGRhdGEtbmFtZT0i44Os44Kk44Ok44O8IDEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDI4MzQuNjUgMjgzNC42NSIgZmlsbD0iI0ZGRiI+PHRpdGxlPmljb248L3RpdGxlPjxwYXRoIGQ9Ik05OTYuNzcsMTQxNy4zMiwyMTkxLjA2LDIyM2E3Mi4yMSw3Mi4yMSwwLDAsMCwwLTEwMS44MkwyMDkwLjgzLDIxQTcyLjIxLDcyLjIxLDAsMCwwLDE5ODksMjFMNzQzLjgyLDEyNjYuMTksNjQzLjU5LDEzNjYuNDJhNzIuMjEsNzIuMjEsMCwwLDAsMCwxMDEuODJMMTk4OSwyODEzLjY1YTcyLjIxLDcyLjIxLDAsMCwwLDEwMS44MiwwbDEwMC4yMy0xMDAuMjNhNzIuMjEsNzIuMjEsMCwwLDAsMC0xMDEuODJaIi8+PC9zdmc+)}.smartphoto-nav{position:absolute;bottom:0;left:0;width:100%;opacity:1;animation-name:smartphoto-appear;animation-duration:.3s;animation-timing-function:ease-out}.smartphoto-nav[aria-hidden="true"]{animation-name:smartphoto-hide;display:none}.smartphoto-nav ul{display:block;overflow-x:scroll;list-style:none;margin:0;padding:0;text-align:center;white-space:nowrap;-webkit-overflow-scrolling:touch}.smartphoto-nav li{display:inline-block;overflow:hidden;width:50px;height:50px}.smartphoto-nav a{display:block;width:100%;height:100%;background-color:#FFF;background-position:center center;background-size:cover;opacity:.5}.smartphoto-nav a:focus{opacity:.8}.smartphoto-nav a.current{opacity:1}.smartphoto-nav img{width:auto;height:100%}.smartphoto-list{list-style-type:none;position:absolute;z-index:101;top:0;left:0;margin:0;padding:0;white-space:nowrap}.smartphoto-list li{display:block;position:absolute;top:0;left:0;width:100%;height:100%;transition:all 0.3s ease-out}.smartphoto-list li:focus{outline:none}.smartphoto-list-onmove{transition:all 0.3s ease-out}.smartphoto-caption{overflow:hidden;box-sizing:border-box;position:absolute;top:0;left:0;width:100%;height:50px;padding:0 50px;color:#FFF;font-size:12px;text-align:center;line-height:50px;white-space:nowrap;text-overflow:ellipsis}.smartphoto-caption:focus{outline:none}.smartphoto-loader-wrap{display:block;position:relative;z-index:103;width:0;height:0;transform:translate(50vw, 50vh)}.smartphoto-loader{position:absolute;z-index:101;top:0;left:0;width:30px;height:30px;margin-top:-25px;margin-left:-25px;border:8px solid #17CDDD;border-right-color:transparent;border-radius:50%;animation:smartphoto-loader .5s infinite linear}.smartphoto-img-clone{position:fixed;z-index:100;top:0;left:0;transition:all .3s ease-out}.smartphoto-sr-only{overflow:hidden;position:absolute;width:1px;height:1px;margin:-1px;padding:0;border:0;clip:rect(0, 0, 0, 0)}
/**
* Modules in this bundle
* @license
*
* smartphoto:
* license: MIT (http://opensource.org/licenses/MIT)
* author: appleple
* homepage: http://developer.a-blogcms.jp
* version: 1.1.0
*
* a-template:
* license: MIT (http://opensource.org/licenses/MIT)
* author: steelydylan
* version: 0.4.4
*
* array.prototype.find:
* license: MIT (http://opensource.org/licenses/MIT)
* author: Paul Miller <http://paulmillr.com>
* contributors: Duncan Hall <himself@duncanhall.net>
* version: 2.0.4
*
* custom-event-polyfill:
* license: MIT (http://opensource.org/licenses/MIT)
* author: NO AUTHOR!
* contributors: Frank Panetta (http://www.savvi.io), Mikhail Reenko <reenko@yandex.ru>, Joscha Feth <joscha@feth.com> (http://www.feth.com)
* version: 0.3.0
*
* define-properties:
* license: MIT (http://opensource.org/licenses/MIT)
* author: Jordan Harband
* version: 1.1.2
*
* es-abstract:
* license: MIT (http://opensource.org/licenses/MIT)
* author: Jordan Harband <ljharb@gmail.com>
* contributors: Jordan Harband <ljharb@gmail.com>
* version: 1.7.0
*
* es-to-primitive:
* license: MIT (http://opensource.org/licenses/MIT)
* author: Jordan Harband
* version: 1.1.1
*
* es6-promise-polyfill:
* license: MIT (http://opensource.org/licenses/MIT)
* author: Roman Dvornov <rdvornov@gmail.com>
* version: 1.2.0
*
* foreach:
* license: MIT (http://opensource.org/licenses/MIT)
* author: Manuel Stofer <manuel@takimata.ch>
* contributors: Manuel Stofer, Jordan Harband
* version: 2.0.5
*
* function-bind:
* licenses: MIT (http://opensource.org/licenses/MIT)
* author: Raynos <raynos2@gmail.com>
* contributors: Raynos, Jordan Harband
* homepage: https://github.com/Raynos/function-bind
* version: 1.1.0
*
* has:
* licenses: MIT (http://opensource.org/licenses/MIT)
* author: Thiago de Arruda <tpadilha84@gmail.com>
* homepage: https://github.com/tarruda/has
* version: 1.0.1
*
* is-callable:
* license: MIT (http://opensource.org/licenses/MIT)
* author: Jordan Harband <ljharb@gmail.com>
* contributors: Jordan Harband <ljharb@gmail.com>
* version: 1.1.3
*
* is-date-object:
* license: MIT (http://opensource.org/licenses/MIT)
* author: Jordan Harband
* version: 1.0.1
*
* is-regex:
* license: MIT (http://opensource.org/licenses/MIT)
* author: Jordan Harband
* homepage: https://github.com/ljharb/is-regex
* version: 1.0.4
*
* is-symbol:
* license: MIT (http://opensource.org/licenses/MIT)
* author: Jordan Harband
* version: 1.0.1
*
* morphdom:
* license: MIT (http://opensource.org/licenses/MIT)
* author: Patrick Steele-Idem <pnidem@gmail.com>
* version: 2.3.1
*
* object-keys:
* license: MIT (http://opensource.org/licenses/MIT)
* author: Jordan Harband <ljharb@gmail.com>
* contributors: Jordan Harband <ljharb@gmail.com>, Raynos <raynos2@gmail.com>, Nathan Rajlich <nathan@tootallnate.net>, Ivan Starkov <istarkov@gmail.com>, Gary Katsevman <git@gkatsev.com>
* version: 1.0.11
*
* This header is generated by licensify (https://github.com/twada/licensify)
*/
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.SmartPhoto=t()}}(function(){var t;return function t(e,o,r){function n(i,s){if(!o[i]){if(!e[i]){var c="function"==typeof require&&require;if(!s&&c)return c(i,!0);if(a)return a(i,!0);var l=new Error("Cannot find module '"+i+"'");throw l.code="MODULE_NOT_FOUND",l}var u=o[i]={exports:{}};e[i][0].call(u.exports,function(t){var o=e[i][1][t];return n(o||t)},u,u.exports,t,e,o,r)}return o[i].exports}for(var a="function"==typeof require&&require,i=0;i<r.length;i++)n(r[i]);return n}({1:[function(t,e,o){"use strict";function r(t){if(Array.isArray(t)){for(var e=0,o=Array(t.length);e<t.length;e++)o[e]=t[e];return o}return Array.from(t)}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(o,"__esModule",{value:!0});var a=function(){function t(t,e){for(var o=0;o<e.length;o++){var r=e[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,o,r){return o&&t(e.prototype,o),r&&t(e,r),e}}(),i=t("./util"),s=t("morphdom"),c=t("array.prototype.find"),l="input paste copy click change keydown keyup contextmenu mouseup mousedown mousemove touchstart touchend touchmove compositionstart compositionend focus",u=l.replace(/([a-z]+)/g,"[data-action-$1],")+"[data-action]",h=function(){function t(e){var o=this;n(this,t),this.atemplate=[],e&&Object.keys(e).forEach(function(t){o[t]=e[t]}),this.data||(this.data={}),this.templates||(this.templates=[]);for(var r=this.templates,a=r.length,s=0,c=a;s<c;s+=1){var l=this.templates[s],u=(0,i.selector)("#"+l).innerHTML;this.atemplate.push({id:l,html:u,binded:!1})}}return a(t,[{key:"addDataBind",value:function(t){var e=this;(0,i.on)(t,"[data-bind]","input change click",function(t){var o=t.delegateTarget,r=o.getAttribute("data-bind"),n=o.getAttribute("href"),a=o.value;n&&(a=a.replace("#","")),"checkbox"===o.getAttribute("type")?function(){var t=[],e=document.querySelectorAll('[data-bind="'+r+'"]');[].forEach.call(e,function(e){e.checked&&t.push(e.value)})}():"radio"!==o.getAttribute("type")&&e.updateDataByString(r,a)})}},{key:"addActionBind",value:function(t){var e=this;(0,i.on)(t,u,l,function(t){var o=t.delegateTarget,n=l.split(" "),a="action";n.forEach(function(e){o.getAttribute("data-action-"+e)&&t.type===e&&(a+="-"+e)});var i=o.getAttribute("data-"+a);if(i){var s=i.replace(/\(.*?\);?/,""),c=i.replace(/(.*?)\((.*?)\);?/,"$2"),u=c.split(",");if(e.e=t,e.method&&e.method[s]){var h;(h=e.method)[s].apply(h,r(u))}else e[s]&&e[s].apply(e,r(u))}})}},{key:"addTemplate",value:function(t,e){this.atemplate.push({id:t,html:e,binded:!1}),this.templates.push(t)}},{key:"getData",value:function(){return JSON.parse(JSON.stringify(this.data))}},{key:"saveData",value:function(t){var e=JSON.stringify(this.data);localStorage.setItem(t,e)}},{key:"setData",value:function(t){var e=this;Object.keys(t).forEach(function(o){"function"!=typeof t[o]&&(e.data[o]=t[o])})}},{key:"loadData",value:function(t){var e=JSON.parse(localStorage.getItem(t));e&&this.setData(e)}},{key:"getRand",value:function(t,e){return~~(Math.random()*(e-t+1))+t}},{key:"getRandText",value:function(t){for(var e="",o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r=o.length,n=0;n<t;n+=1)e+=o.charAt(Math.floor(this.getRand(0,r)));return e}},{key:"getDataFromObj",value:function(t,e){t=t.replace(/\[([\w\-\.ぁ-んァ-ヶ亜-熙]+)\]/g,".$1"),t=t.replace(/^\./,"");for(var o=t.split(".");o.length;){var r=o.shift();if(!(r in e))return null;e=e[r]}return e}},{key:"getDataByString",value:function(t){var e=this.data;return this.getDataFromObj(t,e)}},{key:"updateDataByString",value:function(t,e){for(var o=this.data,r=t.split(".");r.length>1;)o=o[r.shift()];o[r.shift()]=e}},{key:"removeDataByString",value:function(t){for(var e=this.data,o=t.split(".");o.length>1;)e=e[o.shift()];var r=o.shift();r.match(/^\d+$/)?e.splice(Number(r),1):delete e[r]}},{key:"resolveBlock",value:function(t,e,o){var r=this,n=t.match(/<!-- BEGIN ([\w\-\.ぁ-んァ-ヶ亜-熙]+):touch#([\w\-\.ぁ-んァ-ヶ亜-熙]+) -->/g),a=t.match(/<!-- BEGIN ([\w\-\.ぁ-んァ-ヶ亜-熙]+):touchnot#([\w\-\.ぁ-んァ-ヶ亜-熙]+) -->/g),i=t.match(/<!-- BEGIN ([\w\-\.ぁ-んァ-ヶ亜-熙]+):exist -->/g),s=t.match(/<!-- BEGIN ([\w\-\.ぁ-んァ-ヶ亜-熙]+):empty -->/g);if(n)for(var c=0,l=n.length;c<l;c+=1){var u=n[c];u=u.replace(/([\w\-\.ぁ-んァ-ヶ亜-熙]+):touch#([\w\-\.ぁ-んァ-ヶ亜-熙]+)/,"($1):touch#($2)");var h=u.replace(/BEGIN/,"END"),d=new RegExp(u+"(([\\n\\r\\t]|.)*?)"+h,"g");t=t.replace(d,function(t,o,n,a){return""+("function"==typeof e[o]?e[o].apply(r):r.getDataFromObj(o,e))===n?a:""})}if(a)for(var f=0,p=a.length;f<p;f+=1){var m=a[f];m=m.replace(/([\w\-\.ぁ-んァ-ヶ亜-熙]+):touchnot#([\w\-\.ぁ-んァ-ヶ亜-熙]+)/,"($1):touchnot#($2)");var v=m.replace(/BEGIN/,"END"),y=new RegExp(m+"(([\\n\\r\\t]|.)*?)"+v,"g");t=t.replace(y,function(t,o,n,a){return""+("function"==typeof e[o]?e[o].apply(r):r.getDataFromObj(o,e))!==n?a:""})}if(i)for(var g=0,b=i.length;g<b;g+=1){var x=i[g];x=x.replace(/([\w\-\.ぁ-んァ-ヶ亜-熙]+):exist/,"($1):exist");var w=x.replace(/BEGIN/,"END"),P=new RegExp(x+"(([\\n\\r\\t]|.)*?)"+w,"g");t=t.replace(P,function(t,o,n){var a="function"==typeof e[o]?e[o].apply(r):r.getDataFromObj(o,e);return a||0===a?n:""})}if(s)for(var E=0,S=s.length;E<S;E+=1){var N=s[E];N=N.replace(/([\w\-\.ぁ-んァ-ヶ亜-熙]+):empty/,"($1):empty");var I=N.replace(/BEGIN/,"END"),_=new RegExp(N+"(([\\n\\r\\t]|.)*?)"+I,"g");t=t.replace(_,function(t,o,n){var a="function"==typeof e[o]?e[o].apply(r):r.getDataFromObj(o,e);return a||0===a?"":n})}return t=t.replace(/{([\w\-\.ぁ-んァ-ヶ亜-熙]+)}(\[([\w\-\.ぁ-んァ-ヶ亜-熙]+)\])*/g,function(t,n,a,i){var s=void 0;if(""+n=="i")s=o;else{if(!e[n]&&0!==e[n])return i&&r.convert&&r.convert[i]?r.convert[i].call(r,""):"";s="function"==typeof e[n]?e[n].apply(r):e[n]}return i&&r.convert&&r.convert[i]?r.convert[i].call(r,s):s})}},{key:"resolveAbsBlock",value:function(t){var e=this;return t=t.replace(/{(.*?)}/g,function(t,o){var r=e.getDataByString(o);return void 0!==r?"function"==typeof r?r.apply(e):r:t})}},{key:"resolveInclude",value:function(t){return t=t.replace(/<!-- #include id="(.*?)" -->/g,function(t,e){return(0,i.selector)("#"+e).innerHTML})}},{key:"resolveWith",value:function(t){return t=t.replace(/<!-- BEGIN ([\w\-\.ぁ-んァ-ヶ亜-熙]+):with -->(([\n\r\t]|.)*?)<!-- END ([\w\-\.ぁ-んァ-ヶ亜-熙]+):with -->/g,function(t,e){return t=t.replace(/data\-bind=['"](.*?)['"]/g,"data-bind='"+e+".$1'")})}},{key:"resolveLoop",value:function(t){var e=this;return t=t.replace(/<!-- BEGIN ([\w\-\.ぁ-んァ-ヶ亜-熙]+?):loop -->(([\n\r\t]|.)*?)<!-- END ([\w\-\.ぁ-んァ-ヶ亜-熙]+?):loop -->/g,function(t,o,r){var n=e.getDataByString(o),a=[];a="function"==typeof n?n.apply(e):n;var i="";if(a instanceof Array)for(var s=0,c=a.length;s<c;s+=1)i+=e.resolveBlock(r,a[s],s);return i=i.replace(/\\([^\\])/g,"$1")})}},{key:"removeData",value:function(t){var e=this.data;return Object.keys(e).forEach(function(o){for(var r=0,n=t.length;r<n;r+=1)o===t[r]&&delete e[o]}),this}},{key:"hasLoop",value:function(t){return!!t.match(/<!-- BEGIN ([\w\-\.ぁ-んァ-ヶ亜-熙]+?):loop -->(([\n\r\t]|.)*?)<!-- END ([\w\-\.ぁ-んァ-ヶ亜-熙]+?):loop -->/g)}},{key:"getHtml",value:function(t,e){var o=c(this.atemplate,function(e){return e.id===t}),r="";if(o&&o.html&&(r=o.html),e&&(r=t),!r)return"";var n=this.data;for(r=this.resolveInclude(r),r=this.resolveWith(r);this.hasLoop(r);)r=this.resolveLoop(r);return r=this.resolveBlock(r,n),r=r.replace(/\\([^\\])/g,"$1"),r=this.resolveAbsBlock(r),r.replace(/^([\t ])*\n/gm,"")}},{key:"update",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"html",o=arguments[1],r=this.templates;this.beforeUpdated&&this.beforeUpdated();for(var n=0,a=r.length;n<a;n+=1)!function(n,a){var l=r[n],u="#"+l,h=t.getHtml(l),d=(0,i.selector)("[data-id='"+l+"']");if(d)if("text"===e)d.innerText=h;else if(o){var f=new DOMParser,p=f.parseFromString(h,"text/html"),m=p.querySelector(o).outerHTML;s(d.querySelector(o),m)}else s(d,"<div data-id='"+l+"'>"+h+"</div>");else(0,i.selector)(u).insertAdjacentHTML("afterend",'<div data-id="'+l+'"></div>'),"text"===e?(0,i.selector)("[data-id='"+l+"']").innerText=h:(0,i.selector)("[data-id='"+l+"']").innerHTML=h;var v=c(t.atemplate,function(t){return t.id===l});v.binded||(v.binded=!0,t.addDataBind((0,i.selector)("[data-id='"+l+"']")),t.addActionBind((0,i.selector)("[data-id='"+l+"']")))}(n);return this.updateBindingData(o),this.onUpdated&&this.onUpdated(o),this}},{key:"updateBindingData",value:function(t){for(var e=this,o=this.templates,r=0,n=o.length;r<n;r+=1){var a=o[r],s=(0,i.selector)("[data-id='"+a+"']");t&&(s=s.querySelector(t));var c=s.querySelectorAll("[data-bind]");[].forEach.call(c,function(t){var o=e.getDataByString(t.getAttribute("data-bind"));"checkbox"===t.getAttribute("type")||"radio"===t.getAttribute("type")?o===t.value&&(t.checked=!0):t.value=o})}return this}},{key:"applyMethod",value:function(t){for(var e,o=arguments.length,r=Array(o>1?o-1:0),n=1;n<o;n++)r[n-1]=arguments[n];return(e=this.method)[t].apply(e,r)}},{key:"getComputedProp",value:function(t){return this.data[t].apply(this)}},{key:"remove",value:function(t){for(var e=this.data,o=t.split(".");o.length>1;)e=e[o.shift()];var r=o.shift();return r.match(/^\d+$/)?e.splice(Number(r),1):delete e[r],this}}]),t}();o.default=h,e.exports=o.default},{"./util":2,"array.prototype.find":4,morphdom:29}],2:[function(t,e,o){"use strict";Object.defineProperty(o,"__esModule",{value:!0});var r=o.matches=function(t,e){for(var o=(t.document||t.ownerDocument).querySelectorAll(e),r=o.length;--r>=0&&o.item(r)!==t;);return r>-1},n=(o.selector=function(t){return document.querySelector(t)},o.findAncestor=function(t,e){if("function"==typeof t.closest)return t.closest(e)||null;for(;t&&t!==document;){if(r(t,e))return t;t=t.parentElement}return null});o.on=function(t,e,o,r){o.split(" ").forEach(function(o){t.addEventListener(o,function(t){var o=(t.target,n(t.target,e));o&&(t.delegateTarget=o,r(t))})})}},{}],3:[function(t,e,o){"use strict";var r=t("es-abstract/es6");e.exports=function(t){var e=r.ToObject(this),o=r.ToInteger(r.ToLength(e.length));if(!r.IsCallable(t))throw new TypeError("Array#find: predicate must be a function");if(0!==o)for(var n,a=arguments[1],i=0;i<o;i++)if(n=e[i],r.Call(t,a,[n,i,e]))return n}},{"es-abstract/es6":10}],4:[function(t,e,o){"use strict";var r=t("define-properties"),n=t("es-abstract/es6"),a=t("./implementation"),i=t("./polyfill"),s=t("./shim"),c=Array.prototype.slice,l=i(),u=function(t,e){n.RequireObjectCoercible(t);var o=c.call(arguments,1);return l.apply(t,o)};r(u,{getPolyfill:i,implementation:a,shim:s}),e.exports=u},{"./implementation":3,"./polyfill":5,"./shim":6,"define-properties":8,"es-abstract/es6":10}],5:[function(t,e,o){"use strict";e.exports=function(){return Array.prototype.find&&1!==[,1].find(function(){return!0})?Array.prototype.find:t("./implementation")}},{"./implementation":3}],6:[function(t,e,o){"use strict";var r=t("define-properties"),n=t("./polyfill");e.exports=function(){var t=n();return r(Array.prototype,{find:t},{find:function(){return Array.prototype.find!==t}}),t}},{"./polyfill":5,"define-properties":8}],7:[function(t,e,o){try{var r=new window.CustomEvent("test");if(r.preventDefault(),!0!==r.defaultPrevented)throw new Error("Could not prevent default")}catch(t){var n=function(t,e){var o,r;return e=e||{bubbles:!1,cancelable:!1,detail:void 0},o=document.createEvent("CustomEvent"),o.initCustomEvent(t,e.bubbles,e.cancelable,e.detail),r=o.preventDefault,o.preventDefault=function(){r.call(this);try{Object.defineProperty(this,"defaultPrevented",{get:function(){return!0}})}catch(t){this.defaultPrevented=!0}},o};n.prototype=window.Event.prototype,window.CustomEvent=n}},{}],8:[function(t,e,o){"use strict";var r=t("object-keys"),n=t("foreach"),a="function"==typeof Symbol&&"symbol"==typeof Symbol(),i=Object.prototype.toString,s=function(t){return"function"==typeof t&&"[object Function]"===i.call(t)},c=Object.defineProperty&&function(){var t={};try{Object.defineProperty(t,"x",{enumerable:!1,value:t});for(var e in t)return!1;return t.x===t}catch(t){return!1}}(),l=function(t,e,o,r){(!(e in t)||s(r)&&r())&&(c?Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value:o,writable:!0}):t[e]=o)},u=function(t,e){var o=arguments.length>2?arguments[2]:{},i=r(e);a&&(i=i.concat(Object.getOwnPropertySymbols(e))),n(i,function(r){l(t,r,e[r],o[r])})};u.supportsDescriptors=!!c,e.exports=u},{foreach:21,"object-keys":30}],9:[function(t,e,o){"use strict";var r=t("./helpers/isNaN"),n=t("./helpers/isFinite"),a=t("./helpers/sign"),i=t("./helpers/mod"),s=t("is-callable"),c=t("es-to-primitive/es5"),l={ToPrimitive:c,ToBoolean:function(t){return Boolean(t)},ToNumber:function(t){return Number(t)},ToInteger:function(t){var e=this.ToNumber(t);return r(e)?0:0!==e&&n(e)?a(e)*Math.floor(Math.abs(e)):e},ToInt32:function(t){return this.ToNumber(t)>>0},ToUint32:function(t){return this.ToNumber(t)>>>0},ToUint16:function(t){var e=this.ToNumber(t);if(r(e)||0===e||!n(e))return 0;var o=a(e)*Math.floor(Math.abs(e));return i(o,65536)},ToString:function(t){return String(t)},ToObject:function(t){return this.CheckObjectCoercible(t),Object(t)},CheckObjectCoercible:function(t,e){if(null==t)throw new TypeError(e||"Cannot call method on "+t);return t},IsCallable:s,SameValue:function(t,e){return t===e?0!==t||1/t==1/e:r(t)&&r(e)},Type:function(t){return null===t?"Null":void 0===t?"Undefined":"function"==typeof t||"object"==typeof t?"Object":"number"==typeof t?"Number":"boolean"==typeof t?"Boolean":"string"==typeof t?"String":void 0}};e.exports=l},{"./helpers/isFinite":12,"./helpers/isNaN":13,"./helpers/mod":15,"./helpers/sign":16,"es-to-primitive/es5":17,"is-callable":25}],10:[function(t,e,o){"use strict";var r=Object.prototype.toString,n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,a=n?Symbol.prototype.toString:r,i=t("./helpers/isNaN"),s=t("./helpers/isFinite"),c=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,l=t("./helpers/assign"),u=t("./helpers/sign"),h=t("./helpers/mod"),d=t("./helpers/isPrimitive"),f=t("es-to-primitive/es6"),p=parseInt,m=t("function-bind"),v=m.call(Function.call,String.prototype.slice),y=m.call(Function.call,RegExp.prototype.test,/^0b[01]+$/i),g=m.call(Function.call,RegExp.prototype.test,/^0o[0-7]+$/i),b=["…","​","￾"].join(""),x=new RegExp("["+b+"]","g"),w=m.call(Function.call,RegExp.prototype.test,x),P=m.call(Function.call,RegExp.prototype.test,/^[-+]0x[0-9a-f]+$/i),E=["\t\n\v\f\r   ᠎    ","          \u2028","\u2029\ufeff"].join(""),S=new RegExp("(^["+E+"]+)|(["+E+"]+$)","g"),N=m.call(Function.call,String.prototype.replace),I=function(t){return N(t,S,"")},_=t("./es5"),k=t("is-regex"),O=l(l({},_),{Call:function(t,e){var o=arguments.length>2?arguments[2]:[];if(!this.IsCallable(t))throw new TypeError(t+" is not a function");return t.apply(e,o)},ToPrimitive:f,ToNumber:function(t){var e=d(t)?t:f(t,"number");if("symbol"==typeof e)throw new TypeError("Cannot convert a Symbol value to a number");if("string"==typeof e){if(y(e))return this.ToNumber(p(v(e,2),2));if(g(e))return this.ToNumber(p(v(e,2),8));if(w(e)||P(e))return NaN;var o=I(e);if(o!==e)return this.ToNumber(o)}return Number(e)},ToInt16:function(t){var e=this.ToUint16(t);return e>=32768?e-65536:e},ToInt8:function(t){var e=this.ToUint8(t);return e>=128?e-256:e},ToUint8:function(t){var e=this.ToNumber(t);if(i(e)||0===e||!s(e))return 0;var o=u(e)*Math.floor(Math.abs(e));return h(o,256)},ToUint8Clamp:function(t){var e=this.ToNumber(t);if(i(e)||e<=0)return 0;if(e>=255)return 255;var o=Math.floor(t);return o+.5<e?o+1:e<o+.5?o:o%2!=0?o+1:o},ToString:function(t){if("symbol"==typeof t)throw new TypeError("Cannot convert a Symbol value to a string");return String(t)},ToObject:function(t){return this.RequireObjectCoercible(t),Object(t)},ToPropertyKey:function(t){var e=this.ToPrimitive(t,String);return"symbol"==typeof e?a.call(e):this.ToString(e)},ToLength:function(t){var e=this.ToInteger(t);return e<=0?0:e>c?c:e},CanonicalNumericIndexString:function(t){if("[object String]"!==r.call(t))throw new TypeError("must be a string");if("-0"===t)return-0;var e=this.ToNumber(t);return this.SameValue(this.ToString(e),t)?e:void 0},RequireObjectCoercible:_.CheckObjectCoercible,IsArray:Array.isArray||function(t){return"[object Array]"===r.call(t)},IsConstructor:function(t){return"function"==typeof t&&!!t.prototype},IsExtensible:function(t){return!Object.preventExtensions||!d(t)&&Object.isExtensible(t)},IsInteger:function(t){if("number"!=typeof t||i(t)||!s(t))return!1;var e=Math.abs(t);return Math.floor(e)===e},IsPropertyKey:function(t){return"string"==typeof t||"symbol"==typeof t},IsRegExp:function(t){if(!t||"object"!=typeof t)return!1;if(n){var e=t[Symbol.match];if(void 0!==e)return _.ToBoolean(e)}return k(t)},SameValueZero:function(t,e){return t===e||i(t)&&i(e)},GetV:function(t,e){if(!this.IsPropertyKey(e))throw new TypeError("Assertion failed: IsPropertyKey(P) is not true");return this.ToObject(t)[e]},GetMethod:function(t,e){if(!this.IsPropertyKey(e))throw new TypeError("Assertion failed: IsPropertyKey(P) is not true");var o=this.GetV(t,e);if(null!=o){if(!this.IsCallable(o))throw new TypeError(e+"is not a function");return o}},Get:function(t,e){if("Object"!==this.Type(t))throw new TypeError("Assertion failed: Type(O) is not Object");if(!this.IsPropertyKey(e))throw new TypeError("Assertion failed: IsPropertyKey(P) is not true");return t[e]},Type:function(t){return"symbol"==typeof t?"Symbol":_.Type(t)},SpeciesConstructor:function(t,e){if("Object"!==this.Type(t))throw new TypeError("Assertion failed: Type(O) is not Object");var o=t.constructor;if(void 0===o)return e;if("Object"!==this.Type(o))throw new TypeError("O.constructor is not an Object");var r=n&&Symbol.species?o[Symbol.species]:void 0;if(null==r)return e;if(this.IsConstructor(r))return r;throw new TypeError("no constructor found")}});delete O.CheckObjectCoercible,e.exports=O},{"./es5":9,"./helpers/assign":11,"./helpers/isFinite":12,"./helpers/isNaN":13,"./helpers/isPrimitive":14,"./helpers/mod":15,"./helpers/sign":16,"es-to-primitive/es6":18,"function-bind":23,"is-regex":27}],11:[function(t,e,o){var r=Object.prototype.hasOwnProperty;e.exports=Object.assign||function(t,e){for(var o in e)r.call(e,o)&&(t[o]=e[o]);return t}},{}],12:[function(t,e,o){var r=Number.isNaN||function(t){return t!==t};e.exports=Number.isFinite||function(t){return"number"==typeof t&&!r(t)&&t!==1/0&&t!==-1/0}},{}],13:[function(t,e,o){e.exports=Number.isNaN||function(t){return t!==t}},{}],14:[function(t,e,o){e.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},{}],15:[function(t,e,o){e.exports=function(t,e){var o=t%e;return Math.floor(o>=0?o:o+e)}},{}],16:[function(t,e,o){e.exports=function(t){return t>=0?1:-1}},{}],17:[function(t,e,o){"use strict";var r=Object.prototype.toString,n=t("./helpers/isPrimitive"),a=t("is-callable"),i={"[[DefaultValue]]":function(t,e){var o=e||("[object Date]"===r.call(t)?String:Number);if(o===String||o===Number){var i,s,c=o===String?["toString","valueOf"]:["valueOf","toString"];for(s=0;s<c.length;++s)if(a(t[c[s]])&&(i=t[c[s]](),n(i)))return i;throw new TypeError("No default value")}throw new TypeError("invalid [[DefaultValue]] hint supplied")}};e.exports=function(t,e){return n(t)?t:i["[[DefaultValue]]"](t,e)}},{"./helpers/isPrimitive":19,"is-callable":25}],18:[function(t,e,o){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,n=t("./helpers/isPrimitive"),a=t("is-callable"),i=t("is-date-object"),s=t("is-symbol"),c=function(t,e){if(void 0===t||null===t)throw new TypeError("Cannot call method on "+t);if("string"!=typeof e||"number"!==e&&"string"!==e)throw new TypeError('hint must be "string" or "number"');var o,r,i,s="string"===e?["toString","valueOf"]:["valueOf","toString"];for(i=0;i<s.length;++i)if(o=t[s[i]],a(o)&&(r=o.call(t),n(r)))return r;throw new TypeError("No default value")},l=function(t,e){var o=t[e];if(null!==o&&void 0!==o){if(!a(o))throw new TypeError(o+" returned for property "+e+" of object "+t+" is not a function");return o}};e.exports=function(t,e){if(n(t))return t;var o="default";arguments.length>1&&(e===String?o="string":e===Number&&(o="number"));var a;if(r&&(Symbol.toPrimitive?a=l(t,Symbol.toPrimitive):s(t)&&(a=Symbol.prototype.valueOf)),void 0!==a){var u=a.call(t,o);if(n(u))return u;throw new TypeError("unable to convert exotic object to primitive")}return"default"===o&&(i(t)||s(t))&&(o="string"),c(t,"default"===o?"number":o)}},{"./helpers/isPrimitive":19,"is-callable":25,"is-date-object":26,"is-symbol":28}],19:[function(t,e,o){arguments[4][14][0].apply(o,arguments)},{dup:14}],20:[function(e,o,r){(function(e){!function(e){function o(t){return"[object Array]"===Object.prototype.toString.call(t)}function n(){for(var t=0;t<N.length;t++)N[t][0](N[t][1]);N=[],g=!1}function a(t,e){N.push([t,e]),g||(g=!0,S(n,0))}function i(t,e){function o(t){l(e,t)}function r(t){h(e,t)}try{t(o,r)}catch(t){r(t)}}function s(t){var e=t.owner,o=e.state_,r=e.data_,n=t[o],a=t.then;if("function"==typeof n){o=w;try{r=n(r)}catch(t){h(a,t)}}c(a,r)||(o===w&&l(a,r),o===P&&h(a,r))}function c(t,e){var o;try{if(t===e)throw new TypeError("A promises callback cannot return that same promise.");if(e&&("function"==typeof e||"object"==typeof e)){var r=e.then;if("function"==typeof r)return r.call(e,function(r){o||(o=!0,e!==r?l(t,r):u(t,r))},function(e){o||(o=!0,h(t,e))}),!0}}catch(e){return o||h(t,e),!0}return!1}function l(t,e){t!==e&&c(t,e)||u(t,e)}function u(t,e){t.state_===b&&(t.state_=x,t.data_=e,a(f,t))}function h(t,e){t.state_===b&&(t.state_=x,t.data_=e,a(p,t))}function d(t){var e=t.then_;t.then_=void 0;for(var o=0;o<e.length;o++)s(e[o])}function f(t){t.state_=w,d(t)}function p(t){t.state_=P,d(t)}function m(t){if("function"!=typeof t)throw new TypeError("Promise constructor takes a function argument");if(this instanceof m==!1)throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");this.then_=[],i(t,this)}var v=e.Promise,y=v&&"resolve"in v&&"reject"in v&&"all"in v&&"race"in v&&function(){var t;return new v(function(e){t=e}),"function"==typeof t}();void 0!==r&&r?(r.Promise=y?v:m,r.Polyfill=m):"function"==typeof t&&t.amd?t(function(){return y?v:m}):y||(e.Promise=m);var g,b="pending",x="sealed",w="fulfilled",P="rejected",E=function(){},S="undefined"!=typeof setImmediate?setImmediate:setTimeout,N=[];m.prototype={constructor:m,state_:b,then_:null,data_:void 0,then:function(t,e){var o={owner:this,then:new this.constructor(E),fulfilled:t,rejected:e};return this.state_===w||this.state_===P?a(s,o):this.then_.push(o),o.then},catch:function(t){return this.then(null,t)}},m.all=function(t){var e=this;if(!o(t))throw new TypeError("You must pass an array to Promise.all().");return new e(function(e,o){for(var r,n=[],a=0,i=0;i<t.length;i++)r=t[i],r&&"function"==typeof r.then?r.then(function(t){return a++,function(o){n[t]=o,--a||e(n)}}(i),o):n[i]=r;a||e(n)})},m.race=function(t){var e=this;if(!o(t))throw new TypeError("You must pass an array to Promise.race().");return new e(function(e,o){for(var r,n=0;n<t.length;n++)r=t[n],r&&"function"==typeof r.then?r.then(e,o):e(r)})},m.resolve=function(t){var e=this;return t&&"object"==typeof t&&t.constructor===e?t:new e(function(e){e(t)})},m.reject=function(t){return new this(function(e,o){o(t)})}}("undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],21:[function(t,e,o){var r=Object.prototype.hasOwnProperty,n=Object.prototype.toString;e.exports=function(t,e,o){if("[object Function]"!==n.call(e))throw new TypeError("iterator must be a function");var a=t.length;if(a===+a)for(var i=0;i<a;i++)e.call(o,t[i],i,t);else for(var s in t)r.call(t,s)&&e.call(o,t[s],s,t)}},{}],22:[function(t,e,o){var r=Array.prototype.slice,n=Object.prototype.toString;e.exports=function(t){var e=this;if("function"!=typeof e||"[object Function]"!==n.call(e))throw new TypeError("Function.prototype.bind called on incompatible "+e);for(var o,a=r.call(arguments,1),i=function(){if(this instanceof o){var n=e.apply(this,a.concat(r.call(arguments)));return Object(n)===n?n:this}return e.apply(t,a.concat(r.call(arguments)))},s=Math.max(0,e.length-a.length),c=[],l=0;l<s;l++)c.push("$"+l);if(o=Function("binder","return function ("+c.join(",")+"){ return binder.apply(this,arguments); }")(i),e.prototype){var u=function(){};u.prototype=e.prototype,o.prototype=new u,u.prototype=null}return o}},{}],23:[function(t,e,o){var r=t("./implementation");e.exports=Function.prototype.bind||r},{"./implementation":22}],24:[function(t,e,o){var r=t("function-bind");e.exports=r.call(Function.call,Object.prototype.hasOwnProperty)},{"function-bind":23}],25:[function(t,e,o){"use strict";var r=Function.prototype.toString,n=/^\s*class /,a=function(t){try{var e=r.call(t),o=e.replace(/\/\/.*\n/g,""),a=o.replace(/\/\*[.\s\S]*\*\//g,""),i=a.replace(/\n/gm," ").replace(/ {2}/g," ");return n.test(i)}catch(t){return!1}},i=function(t){try{return!a(t)&&(r.call(t),!0)}catch(t){return!1}},s=Object.prototype.toString,c="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;e.exports=function(t){if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if(c)return i(t);if(a(t))return!1;var e=s.call(t);return"[object Function]"===e||"[object GeneratorFunction]"===e}},{}],26:[function(t,e,o){"use strict";var r=Date.prototype.getDay,n=function(t){try{return r.call(t),!0}catch(t){return!1}},a=Object.prototype.toString,i="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;e.exports=function(t){return"object"==typeof t&&null!==t&&(i?n(t):"[object Date]"===a.call(t))}},{}],27:[function(t,e,o){"use strict";var r=t("has"),n=RegExp.prototype.exec,a=Object.getOwnPropertyDescriptor,i=function(t){try{var e=t.lastIndex;return t.lastIndex=0,n.call(t),!0}catch(t){return!1}finally{t.lastIndex=e}},s=Object.prototype.toString,c="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;e.exports=function(t){if(!t||"object"!=typeof t)return!1;if(!c)return"[object RegExp]"===s.call(t);var e=a(t,"lastIndex");return!(!e||!r(e,"value"))&&i(t)}},{has:24}],28:[function(t,e,o){"use strict";var r=Object.prototype.toString;if("function"==typeof Symbol&&"symbol"==typeof Symbol()){var n=Symbol.prototype.toString,a=/^Symbol\(.*\)$/,i=function(t){return"symbol"==typeof t.valueOf()&&a.test(n.call(t))};e.exports=function(t){if("symbol"==typeof t)return!0;if("[object Symbol]"!==r.call(t))return!1;try{return i(t)}catch(t){return!1}}}else e.exports=function(t){return!1}},{}],29:[function(t,e,o){"use strict";function r(t){!h&&p.createRange&&(h=p.createRange(),h.selectNode(p.body));var e;return h&&h.createContextualFragment?e=h.createContextualFragment(t):(e=p.createElement("body"),e.innerHTML=t),e.childNodes[0]}function n(t,e){var o=t.nodeName,r=e.nodeName;return o===r||!!(e.actualize&&o.charCodeAt(0)<91&&r.charCodeAt(0)>90)&&o===r.toUpperCase()}function a(t,e){return e&&e!==f?p.createElementNS(e,t):p.createElement(t)}function i(t,e){for(var o=t.firstChild;o;){var r=o.nextSibling;e.appendChild(o),o=r}return e}function s(t,e){var o,r,n,a,i,s=e.attributes;for(o=s.length-1;o>=0;--o)r=s[o],n=r.name,a=r.namespaceURI,i=r.value,a?(n=r.localName||n,t.getAttributeNS(a,n)!==i&&t.setAttributeNS(a,n,i)):t.getAttribute(n)!==i&&t.setAttribute(n,i);for(s=t.attributes,o=s.length-1;o>=0;--o)r=s[o],!1!==r.specified&&(n=r.name,a=r.namespaceURI,a?(n=r.localName||n,v(e,a,n)||t.removeAttributeNS(a,n)):v(e,null,n)||t.removeAttribute(n))}function c(t,e,o){t[o]!==e[o]&&(t[o]=e[o],t[o]?t.setAttribute(o,""):t.removeAttribute(o,""))}function l(){}function u(t){return t.id}var h,d,f="http://www.w3.org/1999/xhtml",p="undefined"==typeof document?void 0:document,m=p?p.body||p.createElement("div"):{};d=m.hasAttributeNS?function(t,e,o){return t.hasAttributeNS(e,o)}:m.hasAttribute?function(t,e,o){return t.hasAttribute(o)}:function(t,e,o){return null!=t.getAttributeNode(e,o)};var v=d,y={OPTION:function(t,e){c(t,e,"selected")},INPUT:function(t,e){c(t,e,"checked"),c(t,e,"disabled"),t.value!==e.value&&(t.value=e.value),v(e,null,"value")||t.removeAttribute("value")},TEXTAREA:function(t,e){var o=e.value;if(t.value!==o&&(t.value=o),t.firstChild){if(""===o&&t.firstChild.nodeValue===t.placeholder)return;t.firstChild.nodeValue=o}},SELECT:function(t,e){if(!v(e,null,"multiple")){for(var o=0,r=e.firstChild;r;){var n=r.nodeName;if(n&&"OPTION"===n.toUpperCase()){if(v(r,null,"selected")){o;break}o++}r=r.nextSibling}t.selectedIndex=o}}},g=1,b=3,x=8,w=function(t){return function(e,o,s){function c(t){P?P.push(t):P=[t]}function h(t,e){if(t.nodeType===g)for(var o=t.firstChild;o;){var r=void 0;e&&(r=E(o))?c(r):(O(o),o.firstChild&&h(o,e)),o=o.nextSibling}}function d(t,e,o){!1!==k(t)&&(e&&e.removeChild(t),O(t),h(t,o))}function f(t){if(t.nodeType===g)for(var e=t.firstChild;e;){var o=E(e);o&&(j[o]=e),f(e),e=e.nextSibling}}function m(t){N(t);for(var e=t.firstChild;e;){var o=e.nextSibling,r=E(e);if(r){var a=j[r];a&&n(e,a)&&(e.parentNode.replaceChild(a,e),v(a,e))}m(e),e=o}}function v(r,a,i){var s,l=E(a);if(l&&delete j[l],!o.isSameNode||!o.isSameNode(e)){if(!i){if(!1===I(r,a))return;if(t(r,a),_(r),!1===T(r,a))return}if("TEXTAREA"!==r.nodeName){var u,h,f,w,P=a.firstChild,N=r.firstChild;t:for(;P;){for(f=P.nextSibling,u=E(P);N;){if(h=N.nextSibling,P.isSameNode&&P.isSameNode(N)){P=f,N=h;continue t}s=E(N);var k=N.nodeType,O=void 0;if(k===P.nodeType&&(k===g?(u?u!==s&&((w=j[u])?N.nextSibling===w?O=!1:(r.insertBefore(w,N),h=N.nextSibling,s?c(s):d(N,r,!0),N=w):O=!1):s&&(O=!1),(O=!1!==O&&n(N,P))&&v(N,P)):k!==b&&k!=x||(O=!0,N.nodeValue=P.nodeValue)),O){P=f,N=h;continue t}s?c(s):d(N,r,!0),N=h}if(u&&(w=j[u])&&n(w,P))r.appendChild(w),v(w,P);else{var D=S(P);!1!==D&&(D&&(P=D),P.actualize&&(P=P.actualize(r.ownerDocument||p)),r.appendChild(P),m(P))}P=f,N=h}for(;N;)h=N.nextSibling,(s=E(N))?c(s):d(N,r,!0),N=h}var A=y[r.nodeName];A&&A(r,a)}}if(s||(s={}),"string"==typeof o)if("#document"===e.nodeName||"HTML"===e.nodeName){var w=o;o=p.createElement("html"),o.innerHTML=w}else o=r(o);var P,E=s.getNodeKey||u,S=s.onBeforeNodeAdded||l,N=s.onNodeAdded||l,I=s.onBeforeElUpdated||l,_=s.onElUpdated||l,k=s.onBeforeNodeDiscarded||l,O=s.onNodeDiscarded||l,T=s.onBeforeElChildrenUpdated||l,D=!0===s.childrenOnly,j={};f(e);var A=e,B=A.nodeType,C=o.nodeType;if(!D)if(B===g)C===g?n(e,o)||(O(e),A=i(e,a(o.nodeName,o.namespaceURI))):A=o;else if(B===b||B===x){if(C===B)return A.nodeValue=o.nodeValue,A;A=o}if(A===o)O(e);else if(v(A,o,D),P)for(var G=0,M=P.length;G<M;G++){var X=j[P[G]];X&&d(X,X.parentNode,!1)}return!D&&A!==e&&e.parentNode&&(A.actualize&&(A=A.actualize(e.ownerDocument||p)),e.parentNode.replaceChild(A,e)),A}}(s);e.exports=w},{}],30:[function(t,e,o){"use strict";var r=Object.prototype.hasOwnProperty,n=Object.prototype.toString,a=Array.prototype.slice,i=t("./isArguments"),s=Object.prototype.propertyIsEnumerable,c=!s.call({toString:null},"toString"),l=s.call(function(){},"prototype"),u=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],h=function(t){var e=t.constructor;return e&&e.prototype===t},d={$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},f=function(){if("undefined"==typeof window)return!1;for(var t in window)try{if(!d["$"+t]&&r.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{h(window[t])}catch(t){return!0}}catch(t){return!0}return!1}(),p=function(t){if("undefined"==typeof window||!f)return h(t);try{return h(t)}catch(t){return!1}
},m=function(t){var e=null!==t&&"object"==typeof t,o="[object Function]"===n.call(t),a=i(t),s=e&&"[object String]"===n.call(t),h=[];if(!e&&!o&&!a)throw new TypeError("Object.keys called on a non-object");var d=l&&o;if(s&&t.length>0&&!r.call(t,0))for(var f=0;f<t.length;++f)h.push(String(f));if(a&&t.length>0)for(var m=0;m<t.length;++m)h.push(String(m));else for(var v in t)d&&"prototype"===v||!r.call(t,v)||h.push(String(v));if(c)for(var y=p(t),g=0;g<u.length;++g)y&&"constructor"===u[g]||!r.call(t,u[g])||h.push(u[g]);return h};m.shim=function(){if(Object.keys){if(!function(){return 2===(Object.keys(arguments)||"").length}(1,2)){var t=Object.keys;Object.keys=function(e){return t(i(e)?a.call(e):e)}}}else Object.keys=m;return Object.keys||m},e.exports=m},{"./isArguments":31}],31:[function(t,e,o){"use strict";var r=Object.prototype.toString;e.exports=function(t){var e=r.call(t),o="[object Arguments]"===e;return o||(o="[object Array]"!==e&&null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Function]"===r.call(t.callee)),o}},{}],32:[function(t,e,o){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function n(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(o,"__esModule",{value:!0});var i=function(){function t(t,e){for(var o=0;o<e.length;o++){var r=e[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,o,r){return o&&t(e.prototype,o),r&&t(e,r),e}}(),s=t("a-template"),c=function(t){return t&&t.__esModule?t:{default:t}}(s);t("custom-event-polyfill");var l='<div class="\\{classNames.smartPhoto\\}"\x3c!-- BEGIN hide:exist --\x3e aria-hidden="true"\x3c!-- END hide:exist --\x3e\x3c!-- BEGIN hide:empty --\x3e aria-hidden="false"\x3c!-- END hide:empty --\x3e role="dialog">\n\t<div class="\\{classNames.smartPhotoBody\\}">\n\t\t<div class="\\{classNames.smartPhotoInner\\}">\n\t\t\t <div class="\\{classNames.smartPhotoHeader\\}">\n\t\t\t\t\t<span class="\\{classNames.smartPhotoCount\\}">{currentIndex}[increment]/{total}</span>\n\t\t\t\t\t<span class="\\{classNames.smartPhotoCaption\\}" aria-live="polite" tabindex="-1">\x3c!-- BEGIN groupItems:loop --\x3e\x3c!-- \\BEGIN currentIndex:touch#{index} --\x3e{caption}\x3c!-- \\END currentIndex:touch#{index} --\x3e\x3c!-- END groupItems:loop --\x3e</span>\n\t\t\t\t\t<button class="\\{classNames.smartPhotoDismiss\\}" data-action-click="hidePhoto()"><span class="smartphoto-sr-only">\\{message.closeDialog\\}</span></button>\n\t\t\t\t</div>\n\t\t\t\t<div class="\\{classNames.smartPhotoContent\\}"\x3c!-- BEGIN isSmartPhone:exist --\x3e data-action-touchstart="beforeDrag" data-action-touchmove="onDrag" data-action-touchend="afterDrag(false)"\x3c!-- END isSmartPhone:exist --\x3e\x3c!-- BEGIN isSmartPhone:empty --\x3e data-action-click="hidePhoto()"\x3c!-- END isSmartPhone:empty --\x3e>\n\t\t\t\t</div>\n\t\t\t\t<ul style="transform:translate({translateX}px,{translateY}px);" class="\\{classNames.smartPhotoList\\}\x3c!-- BEGIN onMoveClass:exist --\x3e \\{classNames.smartPhotoListOnMove\\}\x3c!-- END onMoveClass:exist --\x3e">\n\t\t\t\t\t\x3c!-- BEGIN groupItems:loop --\x3e\n\t\t\t\t\t<li style="transform:translate({translateX}px,{translateY}px);" class="\x3c!-- \\BEGIN currentIndex:touch#{index} --\x3ecurrent\x3c!-- \\END currentIndex:touch#{index} --\x3e">\n\t\t\t\t\t\t\x3c!-- BEGIN processed:exist --\x3e\n\t\t\t\t\t\t<div style="transform:translate({x}px,{y}px) scale({scale});" class="\\\\{classNames.smartPhotoImgWrap\\\\}"\x3c!-- \\BEGIN isSmartPhone:empty --\x3e data-action-mousemove="onDrag" data-action-mousedown="beforeDrag" data-action-mouseup="afterDrag"\x3c!-- \\END isSmartPhone:empty --\x3e\x3c!-- \\BEGIN isSmartPhone:exist --\x3e data-action-touchstart="beforeDrag" data-action-touchmove="onDrag" data-action-touchend="afterDrag"\x3c!-- \\END isSmartPhone:exist --\x3e>\n\t\t\t\t\t\t\t<img style="\x3c!-- \\BEGIN currentIndex:touch#{index} --\x3etransform:translate(\\{photoPosX\\}[virtualPos]px,\\{photoPosY\\}[virtualPos]px) scale(\\{scaleSize\\});\x3c!-- \\END currentIndex:touch#{index} --\x3ewidth:{width}px;" src="{src}" class="\\\\{classNames.smartPhotoImg\\\\}\x3c!-- \\BEGIN scale:exist --\x3e \\\\{classNames.smartPhotoImgOnMove\\\\}\x3c!-- \\END scale:exist --\x3e\x3c!-- \\BEGIN elastic:exist --\x3e \\\\{classNames.smartPhotoImgElasticMove\\\\}\x3c!-- \\END elastic:exist --\x3e\x3c!-- \\BEGIN appear:exist --\x3e active\x3c!-- \\END appear:exist --\x3e" ondragstart="return false;">\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\x3c!-- END processed:exist --\x3e\n\t\t\t\t\t\t\x3c!-- BEGIN processed:empty --\x3e\n\t\t\t\t\t\t<div class="\\\\{classNames.smartPhotoLoaderWrap\\\\}">\n\t\t\t\t\t\t\t<span class="\\\\{classNames.smartPhotoLoader\\\\}"></span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\x3c!-- END processed:empty --\x3e\n\t\t\t\t\t</li>\n\t\t\t\t\t\x3c!-- END groupItems:loop --\x3e\n\t\t\t\t</ul>\n\t\t\t\t\x3c!-- BEGIN arrows:exist --\x3e\n\t\t\t\t<ul class="\\{classNames.smartPhotoArrows\\}"\x3c!-- BEGIN hideUi:exist --\x3e aria-hidden="true"\x3c!-- END hideUi:exist --\x3e\x3c!-- BEGIN hideUi:exist --\x3e aria-hidden="false"\x3c!-- END hideUi:exist --\x3e>\n\t\t\t\t\t<li class="\\{classNames.smartPhotoArrowLeft\\}"\x3c!-- BEGIN showPrevArrow:empty --\x3e aria-hidden="true"\x3c!-- END showPrevArrow:empty --\x3e><a href="#" data-action-click="gotoSlide({prev})" role="button"><span class="smartphoto-sr-only">\\{message.gotoPrevImage\\}</span></a></li>\n\t\t\t\t\t<li class="\\{classNames.smartPhotoArrowRight\\}"\x3c!-- BEGIN showNextArrow:empty --\x3e aria-hidden="true"\x3c!-- END showNextArrow:empty --\x3e><a href="#" data-action-click="gotoSlide({next})" role="button"><span class="smartphoto-sr-only">\\{message.gotoNextImage\\}</span></a></li>\n\t\t\t\t</ul>\n\t\t\t\t\x3c!-- END arrows:exist --\x3e\n\t\t\t\t\x3c!-- BEGIN nav:exist --\x3e\n\t\t\t\t<nav class="\\{classNames.smartPhotoNav\\}"\x3c!-- BEGIN hideUi:exist --\x3e aria-hidden="true"\x3c!-- END hideUi:exist --\x3e\x3c!-- BEGIN hideUi:exist --\x3e aria-hidden="false"\x3c!-- END hideUi:exist --\x3e>\n\t\t\t\t\t<ul>\n\t\t\t\t\t\t\x3c!-- BEGIN groupItems:loop --\x3e\n\t\t\t\t\t\t<li><a href="#" data-action-click="gotoSlide({index})" class="\x3c!-- \\BEGIN currentIndex:touch#{index} --\x3ecurrent\x3c!-- \\END currentIndex:touch#{index} --\x3e" style="background-image:url({src});" role="button"><span class="smartphoto-sr-only">go to {caption}</span></a></li>\n\t\t\t\t\t\t\x3c!-- END groupItems:loop --\x3e\n\t\t\t\t\t</ul>\n\t\t\t\t</nav>\n\t\t\t\t\x3c!-- END nav:exist --\x3e\n\t\t</div>\n\t\t\x3c!-- BEGIN appearEffect:exist --\x3e\n\t\t<img src=\\{appearEffect.img\\}\n\t\tclass="\\{classNames.smartPhotoImgClone\\}"\n\t\tstyle="width:\\{appearEffect.width\\}px;height:\\{appearEffect.height\\}px;transform:translate(\\{appearEffect.left\\}px,\\{appearEffect.top\\}px) scale(1)" />\n\t\t\x3c!-- END appearEffect:exist --\x3e\n\t</div>\n</div>\n',u=t("../lib/util"),h=t("es6-promise-polyfill").Promise,d={classNames:{smartPhoto:"smartphoto",smartPhotoClose:"smartphoto-close",smartPhotoBody:"smartphoto-body",smartPhotoInner:"smartphoto-inner",smartPhotoContent:"smartphoto-content",smartPhotoImg:"smartphoto-img",smartPhotoImgOnMove:"smartphoto-img-onmove",smartPhotoImgElasticMove:"smartphoto-img-elasticmove",smartPhotoImgWrap:"smartphoto-img-wrap",smartPhotoArrows:"smartphoto-arrows",smartPhotoNav:"smartphoto-nav",smartPhotoArrowRight:"smartphoto-arrow-right",smartPhotoArrowLeft:"smartphoto-arrow-left",smartPhotoImgLeft:"smartphoto-img-left",smartPhotoImgRight:"smartphoto-img-right",smartPhotoList:"smartphoto-list",smartPhotoListOnMove:"smartphoto-list-onmove",smartPhotoHeader:"smartphoto-header",smartPhotoCount:"smartphoto-count",smartPhotoCaption:"smartphoto-caption",smartPhotoDismiss:"smartphoto-dismiss",smartPhotoLoader:"smartphoto-loader",smartPhotoLoaderWrap:"smartphoto-loader-wrap",smartPhotoImgClone:"smartphoto-img-clone"},message:{gotoNextImage:"go to the next image",gotoPrevImage:"go to the previous image",closeDialog:"close the image dialog"},arrows:!0,nav:!0,showAnimation:!0,verticalGravity:!1,useOrientationApi:!1,useHistoryApi:!0,swipeOffset:100,headerHeight:60,footerHeight:60,forceInterval:10,registance:.5,resizeStyle:"fit"},f=function(t){function e(t,o){r(this,e);var a=n(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));a.data=u.extend({},d,o),a.data.currentIndex=0,a.data.oldIndex=0,a.data.hide=!0,a.data.group={},a.data.scaleSize=1,a.data.scale=!1,a.pos={x:0,y:0},a.data.photoPosX=0,a.data.photoPosY=0,a.convert={increment:a.increment,virtualPos:a.virtualPos},a.data.groupItems=a.groupItems,a.elements="string"==typeof t?document.querySelectorAll(t):t;var i=new Date;a.tapSecond=i.getTime(),a.onListMove=!1,a.clicked=!1,a.id=a._getUniqId(),a.vx=0,a.vy=0,a.data.appearEffect=null,a.addTemplate(a.id,l),a.data.isSmartPhone=a._isSmartPhone();var s=document.querySelector("body");return u.append(s,"<div data-id='"+a.id+"'></div>"),[].forEach.call(a.elements,function(t){a.addNewItem(t)}),a.update(),a._getEachImageSize().then(function(){a._fireEvent("loadall");var t=a._getCurrentItemByHash();t&&u.triggerEvent(t.element,"click")}),setInterval(function(){a._doAnim()},a.data.forceInterval),a.data.isSmartPhone?(window.addEventListener("orientationchange",function(){a.groupItems()&&(a._resetTranslate(),a._setPosByCurrentIndex(),a._setHashByCurrentIndex(),a._setSizeByScreen(),a.update())}),a.data.useOrientationApi?(window.addEventListener("deviceorientation",function(t){var e=window.orientation;t&&t.gamma&&!a.data.appearEffect&&(a.isBeingZoomed||a.photoSwipable||a.data.elastic||!a.data.scale||(0===e?a._calcGravity(t.gamma,t.beta):90===e?a._calcGravity(t.beta,t.gamma):-90===e?a._calcGravity(-t.beta,-t.gamma):180===e&&a._calcGravity(-t.gamma,-t.beta)))}),a):n(a)):(window.addEventListener("resize",function(){a.groupItems()&&(a._resetTranslate(),a._setPosByCurrentIndex(),a._setSizeByScreen(),a.update())}),window.addEventListener("keydown",function(t){var e=t.keyCode||t.which;!0!==a.data.hide&&(37===e?a.gotoSlide(a.data.prev):39===e?a.gotoSlide(a.data.next):27===e&&a.hidePhoto())}),n(a))}return a(e,t),i(e,[{key:"on",value:function(t,e){var o=this;this._getElementByClass(this.data.classNames.smartPhoto).addEventListener(t,function(t){e.call(o,t)})}},{key:"increment",value:function(t){return t+1}},{key:"virtualPos",value:function(t){return(t=parseInt(t,10))/this._getSelectedItem().scale/this.data.scaleSize}},{key:"groupItems",value:function(){return this.data.group[this.data.currentGroup]}},{key:"_getEachImageSize",value:function(){var t=[],e=this.data.group,o=function(e){var o=new h(function(t,o){var r=new Image;r.onload=function(){e.width=r.width,e.height=r.height,e.loaded=!0,t()},r.onerror=function(){o()},r.src=e.src});t.push(o)};return Object.keys(e).forEach(function(t){e[t].forEach(o)}),h.all(t)}},{key:"_resetTranslate",value:function(){var t=this;this.groupItems().forEach(function(e,o){e.translateX=t._getWindowWidth()*o})}},{key:"addNewItem",value:function(t){var e=this,o=t.getAttribute("data-group")||"nogroup",r=this.data.group;"nogroup"===o&&t.setAttribute("data-group","nogroup"),r[o]||(r[o]=[]);var n=r[o].length,a=document.querySelector("body"),i={src:t.getAttribute("href"),caption:t.getAttribute("data-caption"),groupId:o,translateX:this._getWindowWidth()*n,index:n,translateY:0,width:50,height:50,id:t.getAttribute("data-id")||n,loaded:!1,processed:!1,element:t};r[o].push(i),this.data.currentGroup=o,t.getAttribute("data-id")||t.setAttribute("data-id",n),t.setAttribute("data-index",n),t.addEventListener("click",function(o){o.preventDefault(),e.data.currentGroup=t.getAttribute("data-group"),e.data.currentIndex=parseInt(t.getAttribute("data-index"),10),e._setHashByCurrentIndex();var r=e._getSelectedItem();r.loaded?(e._initPhoto(),e.addAppearEffect(t,r),e.clicked=!0,e.update(),a.style.overflow="hidden",e._fireEvent("open")):e._loadItem(r).then(function(){e._initPhoto(),e.addAppearEffect(t,r),e.clicked=!0,e.update(),a.style.overflow="hidden",e._fireEvent("open")})})}},{key:"_initPhoto",value:function(){this.data.total=this.groupItems().length,this.data.hide=!1,this.data.photoPosX=0,this.data.photoPosY=0,this._setPosByCurrentIndex(),this._setSizeByScreen(),this.setArrow(),"fill"===this.data.resizeStyle&&this.data.isSmartPhone&&(this.data.scale=!0,this.data.hideUi=!0,this.data.scaleSize=this._getScaleBoarder())}},{key:"onUpdated",value:function(){var t=this;if(this.data.appearEffect&&this.data.appearEffect.once&&(this.data.appearEffect.once=!1,this.execEffect().then(function(){t.data.appearEffect=null,t.data.appear=!0,t.update()})),this.clicked){this.clicked=!1;var e=this.data.classNames;this._getElementByClass(e.smartPhotoCaption).focus()}}},{key:"execEffect",value:function(){var t=this;return new h(function(e){var o=t.data.appearEffect,r=t.data.classNames,n=t._getElementByClass(r.smartPhotoImgClone),a=function t(){n.removeEventListener("transitionend",t,!0),e()};n.addEventListener("transitionend",a,!0),setTimeout(function(){n.style.transform="translate("+o.afterX+"px, "+o.afterY+"px) scale("+o.scale+")"},10)})}},{key:"addAppearEffect",value:function(t,e){if(!1===this.data.showAnimation)return void(this.data.appear=!0);var o=t.querySelector("img"),r=u.getViewPos(o),n={},a=1;n.width=o.offsetWidth,n.height=o.offsetHeight,n.top=r.top,n.left=r.left,n.once=!0,n.img=o.getAttribute("src");var i=this._getWindowWidth(),s=this._getWindowHeight(),c=s-this.data.headerHeight-this.data.footerHeight;"fill"===this.data.resizeStyle&&this.data.isSmartPhone?a=o.offsetWidth>o.offsetHeight?s/o.offsetHeight:i/o.offsetWidth:(n.width>n.height?a=e.height<c?e.width/n.width:c/n.height:n.height>n.width&&(a=e.height<c?e.height/n.height:c/n.height),n.width*a>i&&(a=i/n.width));var l=(a-1)/2*o.offsetWidth+(i-o.offsetWidth*a)/2,h=(a-1)/2*o.offsetHeight+(s-o.offsetHeight*a)/2;n.afterX=l,n.afterY=h,n.scale=a,this.data.appearEffect=n}},{key:"hidePhoto",value:function(){var t=this;this.data.hide=!0,this.data.appear=!1,this.data.appearEffect=null,this.data.hideUi=!1,this.data.scale=!1,this.data.scaleSize=1;var e=window.scrollX,o=window.scrollY,r=document.querySelector("body");location.hash&&this._setHash(""),window.scroll(e,o),this._doHideEffect().then(function(){t.update(),r.style.overflow="",t._fireEvent("close")})}},{key:"_doHideEffect",value:function(){var t=this;return new h(function(e){var o=t.data.classNames,r=t._getElementByClass(o.smartPhoto),n=t._getElementByQuery(".current ."+o.smartPhotoImg),a=t._getWindowHeight(),i=function t(){r.removeEventListener("transitionend",t,!0),e()};r.style.opacity=0,n.style.transform="translateY("+a+"px)",r.addEventListener("transitionend",i,!0)})}},{key:"_getElementByClass",value:function(t){return document.querySelector('[data-id="'+this.id+'"] .'+t)}},{key:"_getElementByQuery",value:function(t){return document.querySelector('[data-id="'+this.id+'"] '+t)}},{key:"_getTouchPos",value:function(){var t=0,e=0,o="undefined"==typeof event?this.e:event;return this._isTouched(o)?(t=o.touches[0].pageX,e=o.touches[0].pageY):o.pageX&&(t=o.pageX,e=o.pageY),{x:t,y:e}}},{key:"_getGesturePos",value:function(t){var e=t.touches;return[{x:e[0].pageX,y:e[0].pageY},{x:e[1].pageX,y:e[1].pageY}]}},{key:"_setPosByCurrentIndex",value:function(){var t=this,e=this.groupItems(),o=-1*e[this.data.currentIndex].translateX;this.pos.x=o,setTimeout(function(){t.data.translateX=o,t.data.translateY=0,t._listUpdate()},1)}},{key:"_setHashByCurrentIndex",value:function(){var t=window.scrollX,e=window.scrollY,o=this.groupItems(),r=o[this.data.currentIndex].id,n=this.data.currentGroup,a="group="+n+"&photo="+r;this._setHash(a),window.scroll(t,e)}},{key:"_setHash",value:function(t){window.history&&window.history.pushState&&this.data.useHistoryApi&&(t?window.history.replaceState(null,null,""+location.pathname+location.search+"#"+t):window.history.replaceState(null,null,""+location.pathname+location.search))}},{key:"_getCurrentItemByHash",value:function(){var t=this.data.group,e=location.hash.substr(1),o=u.parseQuery(e),r=null,n=function(t){o.group===t.groupId&&o.photo===t.id&&(r=t)};return Object.keys(t).forEach(function(e){t[e].forEach(n)}),r}},{key:"_loadItem",value:function(t){return new h(function(e){var o=new Image;o.onload=function(){t.width=o.width,t.height=o.height,t.loaded=!0,e()},o.onerror=function(){e()},o.src=t.src})}},{key:"_setSizeByScreen",value:function(){var t=this._getWindowWidth(),e=this._getWindowHeight(),o=this.data.headerHeight,r=this.data.footerHeight,n=e-(o+r);this.groupItems().forEach(function(o){o.loaded&&(o.processed=!0,o.scale=n/o.height,o.height<n&&(o.scale=1),o.x=(o.scale-1)/2*o.width+(t-o.width*o.scale)/2,o.y=(o.scale-1)/2*o.height+(e-o.height*o.scale)/2,o.width*o.scale>t&&(o.scale=t/o.width,o.x=(o.scale-1)/2*o.width))})}},{key:"_slideList",value:function(){var t=this;this.data.scaleSize=1,this.isBeingZoomed=!1,this.data.hideUi=!1,this.data.scale=!1,this.data.photoPosX=0,this.data.photoPosY=0,this.data.onMoveClass=!0,this._setPosByCurrentIndex(),this._setHashByCurrentIndex(),this._setSizeByScreen(),setTimeout(function(){t.data.onMoveClass=!1,t.setArrow(),t.update(),t.data.oldIndex!==t.data.currentIndex&&t._fireEvent("change"),t.data.oldIndex=t.data.currentIndex},200)}},{key:"gotoSlide",value:function(t){this.e&&this.e.preventDefault&&this.e.preventDefault(),this.data.currentIndex=parseInt(t,10),this.data.currentIndex||(this.data.currentIndex=0),this._slideList()}},{key:"setArrow",value:function(){var t=this.groupItems(),e=t.length,o=this.data.currentIndex+1,r=this.data.currentIndex-1;this.data.showNextArrow=!1,this.data.showPrevArrow=!1,o!==e&&(this.data.next=o,this.data.showNextArrow=!0),-1!==r&&(this.data.prev=r,this.data.showPrevArrow=!0)}},{key:"beforeDrag",value:function(){if(this._isGestured(this.e))return void this.beforeGesture();if(this.isBeingZoomed=!1,this.data.scale)return void this.beforePhotoDrag();var t=this._getTouchPos();this.isSwipable=!0,this.dragStart=!0,this.firstPos=t,this.oldPos=t}},{key:"afterDrag",value:function(){var t=this.groupItems(),e=new Date,o=e.getTime(),r=this.tapSecond-o,n=0,a=0;return this.isSwipable=!1,this.onListMove=!1,this.oldPos&&(n=this.oldPos.x-this.firstPos.x,a=this.oldPos.y-this.firstPos.y),this.isBeingZoomed?void this.afterGesture():this.data.scale?void this.afterPhotoDrag():u.isSmartPhone()||0!==n||0!==a?Math.abs(r)<=500&&0===n&&0===a?(this.e.preventDefault(),void this.zoomPhoto()):(this.tapSecond=o,this._fireEvent("swipeend"),"horizontal"===this.moveDir&&(n>=this.data.swipeOffset&&0!==this.data.currentIndex?this.data.currentIndex-=1:n<=-this.data.swipeOffset&&this.data.currentIndex!==t.length-1&&(this.data.currentIndex+=1),this._slideList()),void("vertical"===this.moveDir&&(a>=this.data.swipeOffset?this.hidePhoto():(this.data.translateY=0,this._slideList())))):void this.zoomPhoto()}},{key:"onDrag",value:function(){if(this.e.preventDefault(),this._isGestured(this.e)&&!1===this.onListMove)return void this.onGesture();if(!this.isBeingZoomed){if(this.data.scale)return void this.onPhotoDrag();if(this.isSwipable){var t=this._getTouchPos(),e=t.x-this.oldPos.x,o=t.y-this.firstPos.y;this.dragStart&&(this._fireEvent("swipestart"),this.dragStart=!1,Math.abs(e)>Math.abs(o)?this.moveDir="horizontal":this.moveDir="vertical"),"horizontal"===this.moveDir?(this.pos.x+=e,this.data.translateX=this.pos.x):this.data.translateY=o,this.onListMove=!0,this.oldPos=t,this._listUpdate()}}}},{key:"zoomPhoto",value:function(){var t=this;this.data.hideUi=!0,this.data.scaleSize=this._getScaleBoarder(),this.data.scaleSize<=1||(this.data.photoPosX=0,this.data.photoPosY=0,this._photoUpdate(),setTimeout(function(){t.data.scale=!0,t._photoUpdate(),t._fireEvent("zoomin")},300))}},{key:"zoomOutPhoto",value:function(){this.data.scaleSize=1,this.isBeingZoomed=!1,this.data.hideUi=!1,this.data.scale=!1,this.data.photoPosX=0,this.data.photoPosY=0,this._photoUpdate(),this._fireEvent("zoomout")}},{key:"beforePhotoDrag",value:function(){var t=this._getTouchPos();this.photoSwipable=!0,this.data.photoPosX||(this.data.photoPosX=0),this.data.photoPosY||(this.data.photoPosY=0),this.oldPhotoPos=t,this.firstPhotoPos=t}},{key:"onPhotoDrag",value:function(){if(this.photoSwipable){this.e.preventDefault();var t=this._getTouchPos(),e=t.x-this.oldPhotoPos.x,o=t.y-this.oldPhotoPos.y,r=this._round(this.data.scaleSize*e,6),n=this._round(this.data.scaleSize*o,6);"number"==typeof r&&(this.data.photoPosX+=r,this.photoVX=r),"number"==typeof n&&(this.data.photoPosY+=n,this.photoVY=n),this.oldPhotoPos=t,this._photoUpdate()}}},{key:"afterPhotoDrag",value:function(){if(this.oldPhotoPos.x===this.firstPhotoPos.x&&this.photoSwipable)this.photoSwipable=!1,this.zoomOutPhoto();else{this.photoSwipable=!1;var t=this._getSelectedItem(),e=this._makeBound(t),o=this.data.swipeOffset*this.data.scaleSize,r=0,n=0;if(this.data.photoPosX>e.maxX?r=-1:this.data.photoPosX<e.minX&&(r=1),this.data.photoPosY>e.maxY?n=-1:this.data.photoPosY<e.minY&&(n=1),this.data.photoPosX-e.maxX>o&&0!==this.data.currentIndex)return void this.gotoSlide(this.data.prev);if(e.minX-this.data.photoPosX>o&&this.data.currentIndex+1!==this.data.total)return void this.gotoSlide(this.data.next);0===r&&0===n?(this.vx=this.photoVX/5,this.vy=this.photoVY/5):this._registerElasticForce(r,n)}}},{key:"beforeGesture",value:function(){this._fireEvent("gesturestart");var t=this._getGesturePos(this.e),e=this._getDistance(t[0],t[1]);this.isBeingZoomed=!0,this.oldDistance=e,this.data.scale=!0,this.e.preventDefault()}},{key:"onGesture",value:function(){var t=this._getGesturePos(this.e),e=this._getDistance(t[0],t[1]),o=(e-this.oldDistance)/100,r=this.data.scaleSize,n=this.data.photoPosX,a=this.data.photoPosY;this.isBeingZoomed=!0,this.data.scaleSize+=this._round(o,6),this.data.scaleSize<.2&&(this.data.scaleSize=.2),this.data.scaleSize<r&&(this.data.photoPosX=(1+this.data.scaleSize-r)*n,this.data.photoPosY=(1+this.data.scaleSize-r)*a),this.data.scaleSize<1||this.data.scaleSize>this._getScaleBoarder()?this.data.hideUi=!0:this.data.hideUi=!1,this.oldDistance=e,this.e.preventDefault(),this._photoUpdate()}},{key:"afterGesture",value:function(){this.data.scaleSize>this._getScaleBoarder()||(this.data.photoPosX=0,this.data.photoPosY=0,this.data.scale=!1,this.data.scaleSize=1,this.data.hideUi=!1,this._fireEvent("gestureend"),this._photoUpdate())}},{key:"_getForceAndTheta",value:function(t,e){return{force:Math.sqrt(t*t+e*e),theta:Math.atan2(e,t)}}},{key:"_getScaleBoarder",value:function(){var t=this._getSelectedItem(),e=this._getWindowWidth(),o=this._getWindowHeight();return u.isSmartPhone()?t.width>t.height?o/(t.height*t.scale):e/(t.width*t.scale):1/t.scale}},{key:"_makeBound",value:function(t){var e=t.width*t.scale*this.data.scaleSize,o=t.height*t.scale*this.data.scaleSize,r=void 0,n=void 0,a=void 0,i=void 0,s=this._getWindowWidth(),c=this._getWindowHeight();return s>e?(a=(s-e)/2,r=-1*a):(a=(e-s)/2,r=-1*a),c>o?(i=(c-o)/2,n=-1*i):(i=(o-c)/2,n=-1*i),{minX:this._round(r,6)*this.data.scaleSize,minY:this._round(n,6)*this.data.scaleSize,maxX:this._round(a,6)*this.data.scaleSize,maxY:this._round(i,6)*this.data.scaleSize}}},{key:"_registerElasticForce",value:function(t,e){var o=this,r=this._getSelectedItem(),n=this._makeBound(r);this.data.elastic=!0,1===t?this.data.photoPosX=n.minX:-1===t&&(this.data.photoPosX=n.maxX),1===e?this.data.photoPosY=n.minY:-1===e&&(this.data.photoPosY=n.maxY),this._photoUpdate(),setTimeout(function(){o.data.elastic=!1,o._photoUpdate()},300)}},{key:"_getSelectedItem",value:function(){var t=this.data,e=t.currentIndex;return t.group[t.currentGroup][e]}},{key:"_getUniqId",value:function(){return(Date.now().toString(36)+Math.random().toString(36).substr(2,5)).toUpperCase()}},{key:"_getDistance",value:function(t,e){var o=t.x-e.x,r=t.y-e.y;return Math.sqrt(o*o+r*r)}},{key:"_round",value:function(t,e){var o=Math.pow(10,e);return t*=o,t=Math.round(t),t/=o}},{key:"_isTouched",value:function(t){return!(!t||!t.touches)}},{key:"_isGestured",value:function(t){return!!(t&&t.touches&&t.touches.length>1)}},{key:"_isSmartPhone",value:function(){var t=navigator.userAgent;return t.indexOf("iPhone")>0||t.indexOf("iPad")>0||t.indexOf("ipod")>0||t.indexOf("Android")>0}},{key:"_calcGravity",value:function(t,e){(t>5||t<-5)&&(this.vx+=.05*t),!1!==this.data.verticalGravity&&(e>5||e<-5)&&(this.vy+=.05*e)}},{key:"_photoUpdate",value:function(){var t=this.data.classNames,e=this._getElementByQuery(".current"),o=e.querySelector("."+t.smartPhotoImg),r=this._getElementByQuery("."+t.smartPhotoNav),n=this._getElementByQuery("."+t.smartPhotoArrows),a=this.virtualPos(this.data.photoPosX),i=this.virtualPos(this.data.photoPosY),s=this.data.scaleSize,c="translate("+a+"px,"+i+"px) scale("+s+")";o.style.transform=c,this.data.scale?u.addClass(o,t.smartPhotoImgOnMove):u.removeClass(o,t.smartPhotoImgOnMove),this.data.elastic?u.addClass(o,t.smartPhotoImgElasticMove):u.removeClass(o,t.smartPhotoImgElasticMove),this.data.hideUi?(r&&r.setAttribute("aria-hidden","true"),n&&n.setAttribute("aria-hidden","true")):(r&&r.setAttribute("aria-hidden","false"),n&&n.setAttribute("aria-hidden","false"))}},{key:"_getWindowWidth",value:function(){return document.documentElement.clientWidth}},{key:"_getWindowHeight",value:function(){return window.innerHeight}},{key:"_listUpdate",value:function(){var t=this.data.classNames,e=this._getElementByQuery("."+t.smartPhotoList),o="translate("+this.data.translateX+"px,"+this.data.translateY+"px)";e.style.transform=o,this.data.onMoveClass?u.addClass(e,t.smartPhotoListOnMove):u.removeClass(e,t.smartPhotoListOnMove)}},{key:"_fireEvent",value:function(t){var e=this._getElementByClass(this.data.classNames.smartPhoto);u.triggerEvent(e,t)}},{key:"_doAnim",value:function(){if(!(this.isBeingZoomed||this.isSwipable||this.photoSwipable||this.data.elastic)&&this.data.scale){this.data.photoPosX+=this.vx,this.data.photoPosY+=this.vy;var t=this._getSelectedItem(),e=this._makeBound(t);this.data.photoPosX<e.minX?(this.data.photoPosX=e.minX,this.vx*=-.2):this.data.photoPosX>e.maxX&&(this.data.photoPosX=e.maxX,this.vx*=-.2),this.data.photoPosY<e.minY?(this.data.photoPosY=e.minY,this.vy*=-.2):this.data.photoPosY>e.maxY&&(this.data.photoPosY=e.maxY,this.vy*=-.2);var o=this._getForceAndTheta(this.vx,this.vy),r=o.force,n=o.theta;r-=this.data.registance,Math.abs(r)<.5||(this.vx=Math.cos(n)*r,this.vy=Math.sin(n)*r,this._photoUpdate())}}}]),e}(c.default);o.default=f,e.exports=o.default},{"../lib/util":34,"a-template":1,"custom-event-polyfill":7,"es6-promise-polyfill":20}],33:[function(t,e,o){"use strict";e.exports=t("./core/")},{"./core/":32}],34:[function(t,e,o){"use strict";function r(t){t=t||{};for(var e=1;e<arguments.length;e++){var o=arguments[e];if(o)for(var a in o)o.hasOwnProperty(a)&&("object"===n(o[a])?t[a]=r(t[a],o[a]):t[a]=o[a])}return t}var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};e.exports.isSmartPhone=function(){var t=navigator.userAgent;return t.indexOf("iPhone")>0||t.indexOf("iPad")>0||t.indexOf("ipod")>0||t.indexOf("Android")>0},e.exports.extend=r,e.exports.triggerEvent=function(t,e,o){var r=void 0;window.CustomEvent?r=new CustomEvent(e,{cancelable:!0}):(r=document.createEvent("CustomEvent"),r.initCustomEvent(e,!1,!1,o)),t.dispatchEvent(r)},e.exports.parseQuery=function(t){for(var e,o,r,n=t.split("&"),a={},i=0,s=n.length;i<s;i++)e=n[i].split("="),void 0!==e[0]&&(o=e[0],r=void 0!==e[1]?e.slice(1).join("="):o,a[o]=decodeURIComponent(r));return a},e.exports.getViewPos=function(t){return{left:t.getBoundingClientRect().left,top:t.getBoundingClientRect().top}},e.exports.removeElement=function(t){t&&t.parentNode&&t.parentNode.removeChild(t)},e.exports.append=function(t,e){var o=new DOMParser,r=o.parseFromString(e,"text/html");t.appendChild(r.querySelector("body").childNodes[0])},e.exports.addClass=function(t,e){t.classList?t.classList.add(e):t.className+=" "+e},e.exports.removeClass=function(t,e){t.classList?t.classList.remove(e):t.className=t.className.replace(new RegExp("(^|\\b)"+e.split(" ").join("|")+"(\\b|$)","gi")," ")}},{}]},{},[33])(33)});
\ No newline at end of file
{
"http-basic": {
"composer.aitoc.com": {
"username": "aa523d03adfcd5c0bbc4c282c826de9f",
"password": "ff2d3462d4628f15f6f5e64a8807cd84"
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment