内容正文:
(第一课时)
3.1.2椭圆的简单几何性质
1
观察分析给出定义
1.问题引入
2
阅读教材,完成下表
3
4
问题1:请用圆规作出图中椭圆焦点的位置。并说明依据。
分析如下
5
问题2:离心率定义的合理性探究并求适合下列条件的椭圆的长短轴、焦点坐标和离心率:
6
【活动要求】受上面问题启发,我们分成A、B组:A组给出椭圆标准方程B组画出椭圆的图像并说明特征;然后交换:A组给出椭圆的图形B组写出标准方程。
学生分组探究活动
标准方程 几何性质
7
例1 求椭圆16x2+25y2=400的长轴长短轴长,离心率,焦点和顶点坐标
2.初步应用
例3求适合下列条件的椭圆的标准方程.
(1)短轴长,离心率e=;
(2)在x轴上的一个焦点与短轴两个端点的连线互相垂直,且焦距为6.
例2 求适合下列条件的椭圆的标准方程:
(1)经过点P(-3,0),Q(0,-2)
(2)长轴长等于10,离心率等于3/5
8
例1 求椭圆16x2+25y2=400的长轴长短轴长,离心率,焦点和顶点坐标
例题分析
解
9
例2 求适合下列条件的椭圆的标准方程:
(1)经过点P(-3,0),Q(0,-2)
(2)长轴长等于10,离心率等于3/5
(2)
10
例3求适合下列条件的椭圆的标准方程.
(1)短轴长,离心率e=;
(2)在x轴上的一个焦点与短轴两个端点的连线互相垂直,且焦距为6.
11
1.方程(a>b>0)
2.方程(a>b>0)
3.为什么b2= a2-c2
4.数形结合思想的形成
2.如何理解数形结合思想
3.归纳小结,文化渗透
12
课外作业:
教材P112
13
再会!
14
mindmap_kityminder_1.0.0.2035/assets/img/background/bg.png
mindmap_kityminder_1.0.0.2035/assets/img/background/bg0.png
mindmap_kityminder_1.0.0.2035/assets/img/mind_icons.png
mindmap_kityminder_1.0.0.2035/assets/img/theme/theme_1.png
mindmap_kityminder_1.0.0.2035/assets/img/theme/theme_2.png
mindmap_kityminder_1.0.0.2035/assets/img/theme/theme_3.png
mindmap_kityminder_1.0.0.2035/assets/img/theme/theme_4.png
mindmap_kityminder_1.0.0.2035/assets/img/theme/thumb_1.png
mindmap_kityminder_1.0.0.2035/assets/img/theme/thumb_2.png
mindmap_kityminder_1.0.0.2035/assets/img/theme/thumb_3.png
mindmap_kityminder_1.0.0.2035/assets/img/theme/thumb_4.png
mindmap_kityminder_1.0.0.2035/assets/img/theme/thumb_5.png
mindmap_kityminder_1.0.0.2035/assets/img/theme/thumb_6.png
mindmap_kityminder_1.0.0.2035/assets/img/theme/thumb_7.png
mindmap_kityminder_1.0.0.2035/assets/img/theme/thumb_8.png
mindmap_kityminder_1.0.0.2035/assets/img/type/mind_default.png
mindmap_kityminder_1.0.0.2035/assets/img/type/mind_filetree.png
mindmap_kityminder_1.0.0.2035/assets/img/type/mind_fish-bone.png
mindmap_kityminder_1.0.0.2035/assets/img/type/mind_fish-tail.png
mindmap_kityminder_1.0.0.2035/assets/img/type/mind_right.png
mindmap_kityminder_1.0.0.2035/assets/img/type/mind_structure.png
mindmap_kityminder_1.0.0.2035/assets/img/type/mind_tianpan.png
mindmap_kityminder_1.0.0.2035/assets/img/type/mind_tree-branch-divergency.png
mindmap_kityminder_1.0.0.2035/assets/img/type/mind_tree-branch.png
mindmap_kityminder_1.0.0.2035/images/iconpriority.png
mindmap_kityminder_1.0.0.2035/libs/editor.js
var dtkmEditor = {
ui : {
'templates': {
'default' : '思维导图',
'tianpan' : '天盘图',
'structure': '组织结构图',
'filetree' : '目录组织图',
'right' : '逻辑结构图',
'fish-bone': '鱼骨头图'
},
'themes' : {
'classic' : '脑图经典',
'classic-compact' : '紧凑经典',
'snow' : '温柔冷光',
'snow-compact' : '紧凑冷光',
'fish' : '鱼骨图',
'wire' : '线框',
'fresh-red' : '清新红',
'fresh-soil' : '泥土黄',
'fresh-green' : '文艺绿',
'fresh-blue' : '天空蓝',
'fresh-purple' : '浪漫紫',
'fresh-pink' : '脑残粉',
'fresh-red-compat' : '紧凑红',
'fresh-soil-compat' : '紧凑黄',
'fresh-green-compat' : '紧凑绿',
'fresh-blue-compat' : '紧凑蓝',
'fresh-purple-compat': '紧凑紫',
'fresh-pink-compat' : '紧凑粉',
'tianpan' : '经典天盘',
'tianpan-compact' : '紧凑天盘'
}
},
/**
* 配置项
*/
options : {
enableKeyReceiver: false,
enableAnimation : true,
zoom : [10, 20, 30, 50, 80, 100, 120, 150, 200]
},
/**
* 编辑框对象
*/
receiver : {
listeners : [],
/**
* 初始化编辑框
*/
init : function () {
var _this = this;
_this.editor = dtkmEditor;
_this.utils = dtkmEditor.utils;
_this.minder = dtkmEditor.minder;
_this.element = document.createElement('div');
_this.element.setAttribute('tabindex', -1);
_this.element.classList.add('receiver');
_this.element.setAttribute('contenteditable', true);
_this.editor.container.appendChild(_this.element);
_this.setupReciverElement();
_this.bindEvent();
},
/**
* 编辑框事件
*/
bindEvent : function () {
var _this = this;
_this.minder.on('beforemousedown', _this.selectAll);
_this.minder.on('receiverfocus', _this.selectAll);
_this.minder.on('readonly', function () {
// 屏蔽minder的事件接受,删除receiver
_this.minder.disable();
_this.element.parentElement.removeChild(_this.element);
});
_this.element.onblur = function (e) {
if (_this.utils.hasClass(_this.element, 'input')) {
_this.commitInputResult();
}
};
_this.minder.on('beforemousedown', function () {
if (_this.utils.hasClass(_this.element, 'input')) {
_this.commitInputResult();
}
});
},
/**
* 开启编辑功能
*/
enable : function () {
this.element.setAttribute('contenteditable', true);
},
/**
* 禁用编辑功能
*/
disable : function () {
this.element.setAttribute('contenteditable', false);
},
setupReciverElement : function () {
var _this = this;
_this.element.onmousedown = function (e) {
e.stopPropagation();
};
_this.minder.on('layoutallfinish viewchange viewchanged selectionchange', function (e) {
// viewchange event is too frequenced, lazy it
if (e.type == 'viewchange') return;
_this.updatePosition();
});
_this.updatePosition();
},
updatePosition : function () {
var _this = this;
var planed = _this.updatePosition;
var focusNode = _this.minder.getSelectedNode();
if (!focusNode) return;
if (!planed.timer) {
planed.timer = setTimeout(function () {
var box = focusNode.getRenderBox('TextRenderer');
_this.element.style.left = Math.round(box.x) + 'px';
_this.element.style.top = Math.round(box.y) + 'px';
planed.timer = 0;
});
}
},
enterInputMode : function () {
var _this = this;
var node = _this.minder.getSelectedNode();
if (node && !this.isMobileMode()) {
var fontSize = node.getData('font-size') || node.getStyle('font-size');
fontSize = fontSize * _this.minder.getZoomValue() / 100;
fontSize = fontSize < 16 ? 16 : fontSize;
_this.element.style.fontSize = fontSize + 'px';
_this.element.style.minWidth = 0;
_this.element.style.minWidth = _this.element.clientWidth + 'px';
_this.element.style.fontWeight = node.getData('font-weight') || '';
_this.element.style.fontStyle = node.getData('font-style') || '';
_this.element.classList.add('input');
_this.element.focus();
}
},
isMobileMode : function () {
return navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i);
},
commitInputResult : function () {
var _this = this;
var textNodes = [].slice.call(_this.element.childNodes);
setTimeout(function () {
// 解决过大内容导致SVG窜位问题
_this.element.innerHTML = '';
}, 0);
var node = _this.minder.getSelectedNode();
textNodes = _this.commitInputText(textNodes);
_this.commitInputNode(node, textNodes);
if (node.type == 'root') {
var rootText = _this.minder.getRoot().getText();
_this.minder.fire('initChangeRoot', {
text: rootText
});
}
},
commitInputText : function (textNodes) {
var _this = this;
var text = '';
var TAB_CHAR = '\t',
ENTER_CHAR = '
',
STR_CHECK = /\S/,
SPACE_CHAR = '\u0020',
// 针对FF,SG,BD,LB,IE等浏览器下SPACE的charCode存在为32和160的情况做处理
SPACE_CHAR_REGEXP = new RegExp('(\u0020|' + String.fromCharCode(160) + ')'),
BR = document.createElement('br');
for (var i = 0, l = textNodes.length; i < l; i++) {
if (i < textNodes.length - 1 && textNodes[i].nodeName == '#text' && textNodes[i + 1].nodeName == 'DIV') {
textNodes.splice(i + 1, 0, BR);
}
}
var isBold = false,
isItalic = false;
for (var str, _divChildNodes, space_l, space_num, tab_num, i = 0, l = textNodes.length; i < l; i++) {
str = textNodes[i];
switch (Object.prototype.toString.call(str)) {
// 正常情况处理
case '[object HTMLBRElement]': {
text += ENTER_CHAR;
break;
}
case '[object Text]': {
// SG下会莫名其妙的加上 影响后续判断,干掉!
/**
* FF下的wholeText会导致如下问题:
* |123| -> 在一个节点中输入一段字符,此时TextNode为[#Text 123]
* 提交并重新编辑,在后面追加几个字符
* |123abc| -> 此时123为一个TextNode为[#Text 123, #Text abc],但是对这两个任意取值wholeText均为全部内容123abc
* 上述BUG仅存在在FF中,故将wholeText更改为textContent
*/
str = str.textContent.replace(' ', ' ');
if (!STR_CHECK.test(str)) {
space_l = str.length;
while (space_l--) {
if (SPACE_CHAR_REGEXP.test(str[space_l])) {
text += SPACE_CHAR;
} else if (str[space_l] === TAB_CHAR) {
text += TAB_CHAR;
}
}
} else {
text += str;
}
break;
}
// ctrl + b/i 会给字体加上<b>/<i>标签来实现黑体和斜体
case '[object HTMLElement]': {
switch (str.nodeName) {
case 'B': {
isBold = true;
break;
}
case 'I': {
isItalic = true;
break;
}
default: {
}
}
[].splice.apply(textNodes, [i, 1].concat([].slice.call(str.childNodes)));
l = textNodes.length;
i--;
break;
}
// 被增加span标签的情况会被处理成正常情况并会推交给上面处理
case '[object HTMLSpanElement]': {
[].splice.apply(textNodes, [i, 1].concat([].slice.call(str.childNodes)));
l = textNodes.length;
i--;
break;
}
// 若标签为image标签,则判断是否为合法url,是将其加载进来
case '[object HTMLImageElement]': {
if (str.src) {
if (/http(|s):\/\//.test(str.src)) {
minder.execCommand('Image', str.src, str.alt);
} else {
// data:image协议情况
}
}
;
break;
}
// 被增加div标签的情况会被处理成正常情况并会推交给上面处理
case '[object HTMLDivElement]': {
_divChildNodes = [];
for (var di = 0, l = str.childNodes.length; di < l; di++) {
_divChildNodes.push(str.childNodes[di]);
}
_divChildNodes.push(BR);
[].splice.apply(textNodes, [i, 1].concat(_divChildNodes));
l = textNodes.length;
i--;
break;
}
default: {
if (str && str.childNodes.length) {
_divChildNodes = [];
for (var di = 0, l = str.childNodes.length; di < l; di++) {
_divChildNodes.push(str.childNodes[di]);
}
_divChildNodes.push(BR);
[].splice.apply(textNodes, [i, 1].concat(_divChildNodes));
l = textNodes.length;
i--;
} else {
if (str && str.textContent !== undefined) {
text += str.textContent;
} else {
text += '';
}
}
}
}
}
;
text = text.replace(/^
*|
*$/g, '');
text = text.replace(new RegExp('(
|\r|
\r)(\u0020|' + String.fromCharCode(160) + '){4}', 'g'), '$1\t');
_this.minder.getSelectedNode().setText(text);
if (isBold) {
_this.minder.queryCommandState('bold') || _this.minder.execCommand('bold');
} else {
_this.minder.queryCommandState('bold') && _this.minder.execCommand('bold');
}
if (isItalic) {
_this.minder.queryCommandState('italic') || _this.minder.execCommand('italic');
} else {
_this.minder.queryCommandState('italic') && _this.minder.execCommand('italic');
}
_this.exitInputMode();
return text;
},
commitInputNode : function (node, text) {
var _this = this;
try {
_this.minder.decodeData('text', text).then(function (json) {
function importText (node, json, minder) {
var data = json.data;
node.setText(data.text || '');
var childrenTreeData = json.children || [];
for (var i = 0; i < childrenTreeData.length; i++) {
var childNode = minder.createNode(null, node);
importText(childNode, childrenTreeData[i], minder);
}
return node;
}
importText(node, json, minder);
_this.minder.fire('contentchange');
_this.minder.getRoot().renderTree();
_this.minder.layout(300);
});
} catch (e) {
_this.minder.fire('contentchange');
_this.minder.getRoot().renderTree();
// 无法被转换成脑图节点则不处理
if (e.toString() !== 'Error: Invalid local format') {
throw e;
}
}
},
exitInputMode : function () {
this.element.classList.remove('input');
this.selectAll();
},
selectAll : function () {
var _this = dtkmEditor.receiver;
if (_this.isMobileMode()) return;
// 保证有被选中的
if (!_this.element.innerHTML) _this.element.innerHTML = ' ';
var range = document.createRange();
var selection = window.getSelection();
range.selectNodeContents(_this.element);
selection.removeAllRanges();
selection.addRange(range);
_this.element.focus();
},
/**
* hack FF下div contenteditable的光标丢失BUG
*/
fixFFCaretDisappeared: function () {
this.element.removeAttribute('contenteditable');
this.element.setAttribute('contenteditable', 'true');
this.element.blur();
this.element.focus();
}
},
/**
* 初始化dtkmEditor
* @param {*} selector
*/
init : function (selector) {
var _this = this;
//_this.options.zoom = _this.utils.getZooms();
_this.minder = window.minder = new kityminder.Minder(_this.options);
_this.setGlobalVar(selector);
_this.minder.renderTo(selector);
_this.minder.setTheme('fresh-blue');
_this.minder.select(_this.minder.getRoot(), true);
_this.minder.execCommand('text', '中心主题');
_this.minder.execCommand('template', 'default');
_this.receiver.init();
_this.bindEvent();
},
setGlobalVar : function (selector) {
this.container = selector;
},
/**
* 绑定事件
*/
bindEvent : function () {
var _this = this;
_this.minder.on('dblclick', (e) => {
if (this.receiver.isMobileMode()) return;
if(location.hash === '#/play' || _this.minder._root.data.previewMode) return
if (_this.minder.getSelectedNode() && _this.minder._status !== 'readonly') {
_this.editText();
}
});
},
/**
* svg
* @param {*} tag
* @param {*} attrs
*/
makeSVG : function (tag, attrs) {
var el = document.createElementNS('http://www.w3.org/2000/svg', tag);
for (var k in attrs)
el.setAttribute(k, attrs[k]);
return el;
},
/**
* 节点添加操作按钮
*/
addOptButton : function () {
var _this = this, topg = document.getElementById('top-add'), btmg = document.getElementById('bottom-add'),
lrg = document.getElementById('lr-add'), rg = document.getElementById('r-add'),
lg = document.getElementById('l-add');
if (topg) topg.remove();
if (btmg) btmg.remove();
if (lrg) lrg.remove();
if (rg) rg.remove();
if (lg) lg.remove();
if(location.hash === '#/play' || this.minder._root.data.previewMode) return
var focusNode = _this.minder.getSelectedNode();
if (focusNode) {
var isHasImg = false, imgHeight = 0;
if (focusNode.data.image != undefined) {
isHasImg = true;
imgHeight = focusNode.data.imageSize.height;
}
var isVertical = _this.minder._template === 'filetree' || _this.minder._template === 'structure'
var isMain = focusNode.getType() === 'main'
var e = focusNode.isRoot() ? 1 : focusNode._layoutTransform.m.e;
var topg = _this.makeSVG('g', {
id : 'top-add',
transform: 'translate(' + Math.round((focusNode._contentBox.width + focusNode._contentBox.left * 2) / 2) + ' -' + (isHasImg ? Math.round(focusNode._contentBox.height / 2 + imgHeight / 2 + 3) : Math.round(focusNode._contentBox.height / 2)) + ')',
style : 'cursor: pointer;'
}),
btmg = _this.makeSVG('g', {
id : 'bottom-add',
transform: 'translate(' + Math.round((focusNode._contentBox.width + focusNode._contentBox.left * 2) / 2) + ' ' + (isHasImg ? Math.round(focusNode._contentBox.height / 2 - imgHeight / 2 - 3) + (isVertical ? (isMain ? 10 : 12) : 0) : Math.round(focusNode._contentBox.height / 2) + (isVertical ? (isMain ? 10 : 12) : 0)) + ')',
style : 'cursor: pointer;'
}),
lrg = _this.makeSVG('g', {
id : 'lr-add',
transform: 'translate(' + (e > 0 ? Math.round(focusNode._contentBox.width + focusNode._contentBox.left) + 8 + ' ' + (isHasImg ? '-' + parseInt(imgHeight / 2 + 3) : '0') : Math.round(focusNode._contentBox.left) - 8 + ' ' + (isHasImg ? '-' + parseInt(imgHeight / 2 + 3) : '0')) + ')',
style : 'cursor: pointer;'
}),
rg = _this.makeSVG('g', {
id : 'r-add',
transform: 'translate(' + Math.round(focusNode._contentBox.width + focusNode._contentBox.left) + ' ' + (isHasImg ? '-' + parseInt(imgHeight / 2 + 3) : '0') + ')',
style : 'cursor: pointer;'
}),
lg = _this.makeSVG('g', {
id : 'l-add',
transform: 'translate(' + Math.round(focusNode._contentBox.left) + ' ' + (isHasImg ? '-' + parseInt(imgHeight / 2 + 3) : '0') + ')',
style : 'cursor: pointer;'
}),
path1 = _this.makeSVG('path', {fill: 'white', stroke: 'gray', d: 'M6,0A6,6,0,1,1,-6,0A6,6,0,1,1,6,0'}),
path2 = _this.makeSVG('path', {fill: 'none', stroke: 'gray', d: 'M-4.5,0L4.5,0M0,-4.5L0,4.5'}),
path3 = _this.makeSVG('path', {fill: 'white', stroke: 'gray', d: 'M6,0A6,6,0,1,1,-6,0A6,6,0,1,1,6,0'}),
path4 = _this.makeSVG('path', {fill: 'none', stroke: 'gray', d: 'M-4.5,0L4.5,0M0,-4.5L0,4.5'}),
path5 = _this.makeSVG('path', {fill: 'white', stroke: 'gray', d: 'M6,0A6,6,0,1,1,-6,0A6,6,0,1,1,6,0'}),
path6 = _this.makeSVG('path', {fill: 'none', stroke: 'gray', d: 'M-4.5,0L4.5,0M0,-4.5L0,4.5'}),
path7 = _this.makeSVG('path', {fill: 'white', stroke: 'gray', d: 'M6,0A6,6,0,1,1,-6,0A6,6,0,1,1,6,0'}),
path8 = _this.makeSVG('path', {fill: 'none', stroke: 'gray', d: 'M-4.5,0L4.5,0M0,-4.5L0,4.5'}),
path9 = _this.makeSVG('path', {fill: 'white', stroke: 'gray', d: 'M6,0A6,6,0,1,1,-6,0A6,6,0,1,1,6,0'}),
path10 = _this.makeSVG('path', {fill: 'none', stroke: 'gray', d: 'M-4.5,0L4.5,0M0,-4.5L0,4.5'});
topg.appendChild(path1);
topg.appendChild(path2);
btmg.appendChild(path3);
btmg.appendChild(path4);
lrg.appendChild(path5);
lrg.appendChild(path6);
rg.appendChild(path7);
rg.appendChild(path8);
lg.appendChild(path9);
lg.appendChild(path10);
if (!focusNode.isRoot()) {
switch (_this.minder._template) {
case 'structure' :
case 'filetree' :
document.getElementById(focusNode.rc.node.id).appendChild(lg);
document.getElementById(focusNode.rc.node.id).appendChild(rg);
document.getElementById(focusNode.rc.node.id).appendChild(btmg);
document.getElementById('bottom-add').onclick = function () {
_this.addChildNode(focusNode, 'bottom');
};
document.getElementById('r-add').onclick = function () {
_this.addSiblingNode(focusNode, 'right');
};
document.getElementById('l-add').onclick = function () {
_this.addSiblingNode(focusNode, 'left');
};
break;
default:
document.getElementById(focusNode.rc.node.id).appendChild(topg);
document.getElementById(focusNode.rc.node.id).appendChild(btmg);
document.getElementById(focusNode.rc.node.id).appendChild(lrg);
document.getElementById('top-add').onclick = function () {
_this.addSiblingNode(focusNode, 'top');
};
document.getElementById('bottom-add').onclick = function () {
_this.addSiblingNode(focusNode, 'bottom');
};
}
}
// document.getElementById(focusNode.rc.node.id).appendChild(lrg);
document.getElementById('lr-add').onclick = function () {
_this.addChildNode(focusNode, '');
};
}
},
/**
* 添加兄弟主题
*/
addSiblingNode: function (focusNode, type) {
var _this = this;
var parent = focusNode.parent;
var node = null;
if (!parent) {
return _this.minder.execCommand('AppendChildNode', '分支主题');
}
if (type === 'top' || type === 'left') {
node = _this.minder.createNode('分支主题', parent, focusNode.getIndex());
} else if (type === 'bottom' || type === 'right') {
node = _this.minder.createNode('分支主题', parent, focusNode.getIndex() + 1);
}
node.setGlobalLayoutTransform(focusNode.getGlobalLayoutTransform());
//字体大小跟选中节点一样,默认18
focusNode.getData()['font-size'] && node.setData('font-size',focusNode.getData()['font-size'])
_this.minder.select(node, true);
node.render();
_this.minder.layout(600);
setTimeout(function () {
_this.editText();
}, 500);
},
/**
* 添加子主题
*/
addChildNode : function (focusNode, type) {
var _this = this;
if (!focusNode) {
return null;
}
var node = _this.minder.createNode('分支主题', focusNode);
//字体大小跟选中节点一样,默认18
focusNode.getData()['font-size'] && node.setData('font-size',focusNode.getData()['font-size'])
_this.minder.select(node, true);
if (focusNode.isExpanded()) {
node.render();
} else {
focusNode.expand();
focusNode.renderTree();
}
_this.minder.layout(600);
setTimeout(function () {
_this.editText();
}, 500);
},
/**
* 编辑文本
*/
editText : function () {
var _this = this;
_this.receiver.enable();
var node = _this.minder.getSelectedNode();
if (!node) {
return;
}
var receiverElement = _this.receiver.element;
receiverElement.innerText = '';
if (node.getData('font-weight') === 'bold') {
var b = document.createElement('b');
receiverElement.appendChild(b);
receiverElement = b;
}
if (node.getData('font-style') === 'italic') {
var i = document.createElement('i');
receiverElement.appendChild(i);
receiverElement = i;
}
receiverElement.innerText = minder.queryCommandValue('text');
if (window.kity.Browser.gecko) {
_this.receiver.fixFFCaretDisappeared();
}
;
_this.receiver.enterInputMode();
_this.receiver.selectAll();
},
utils : {
hasClass: function (element, cls) {
return (' ' + element.className + ' ').indexOf(' ' + cls + ' ') > -1;
}
}
};
window.dtkmEditor = dtkmEditor;
mindmap_kityminder_1.0.0.2035/libs/editor.js.gz
mindmap_kityminder_1.0.0.2035/libs/editor.js
var dtkmEditor = {
ui : {
'templates': {
'default' : '思维导图',
'tianpan' : '天盘图',
'structure': '组织结构图',
'filetree' : '目录组织图',
'right' : '逻辑结构图',
'fish-bone': '鱼骨头图'
},
'themes' : {
'classic' : '脑图经典',
'classic-compact' : '紧凑经典',
'snow' : '温柔冷光',
'snow-compact' : '紧凑冷光',
'fish' : '鱼骨图',
'wire' : '线框',
'fresh-red' : '清新红',
'fresh-soil' : '泥土黄',
'fresh-green' : '文艺绿',
'fresh-blue' : '天空蓝',
'fresh-purple' : '浪漫紫',
'fresh-pink' : '脑残粉',
'fresh-red-compat' : '紧凑红',
'fresh-soil-compat' : '紧凑黄',
'fresh-green-compat' : '紧凑绿',
'fresh-blue-compat' : '紧凑蓝',
'fresh-purple-compat': '紧凑紫',
'fresh-pink-compat' : '紧凑粉',
'tianpan' : '经典天盘',
'tianpan-compact' : '紧凑天盘'
}
},
/**
* 配置项
*/
options : {
enableKeyReceiver: false,
enableAnimation : true,
zoom : [10, 20, 30, 50, 80, 100, 120, 150, 200]
},
/**
* 编辑框对象
*/
receiver : {
listeners : [],
/**
* 初始化编辑框
*/
init : function () {
var _this = this;
_this.editor = dtkmEditor;
_this.utils = dtkmEditor.utils;
_this.minder = dtkmEditor.minder;
_this.element = document.createElement('div');
_this.element.setAttribute('tabindex', -1);
_this.element.classList.add('receiver');
_this.element.setAttribute('contenteditable', true);
_this.editor.container.appendChild(_this.element);
_this.setupReciverElement();
_this.bindEvent();
},
/**
* 编辑框事件
*/
bindEvent : function () {
var _this = this;
_this.minder.on('beforemousedown', _this.selectAll);
_this.minder.on('receiverfocus', _this.selectAll);
_this.minder.on('readonly', function () {
// 屏蔽minder的事件接受,删除receiver
_this.minder.disable();
_this.element.parentElement.removeChild(_this.element);
});
_this.element.onblur = function (e) {
if (_this.utils.hasClass(_this.element, 'input')) {
_this.commitInputResult();
}
};
_this.minder.on('beforemousedown', function () {
if (_this.utils.hasClass(_this.element, 'input')) {
_this.commitInputResult();
}
});
},
/**
* 开启编辑功能
*/
enable : function () {
this.element.setAttribute('contenteditable', true);
},
/**
* 禁用编辑功能
*/
disable : function () {
this.element.setAttribute('contenteditable', false);
},
setupReciverElement : function () {
var _this = this;
_this.element.onmousedown = function (e) {
e.stopPropagation();
};
_this.minder.on('layoutallfinish viewchange viewchanged selectionchange', function (e) {
// viewchange event is too frequenced, lazy it
if (e.type == 'viewchange') return;
_this.updatePosition();
});
_this.updatePosition();
},
updatePosition : function () {
var _this = this;
var planed = _this.updatePosition;
var focusNode = _this.minder.getSelectedNode();
if (!focusNode) return;
if (!planed.timer) {
planed.timer = setTimeout(function () {
var box = focusNode.getRenderBox('TextRenderer');
_this.element.style.left = Math.round(box.x) + 'px';
_this.element.style.top = Math.round(box.y) + 'px';
planed.timer = 0;
});
}
},
enterInputMode : function () {
var _this = this;
var node = _this.minder.getSelectedNode();
if (node && !this.isMobileMode()) {
var fontSize = node.getData('font-size') || node.getStyle('font-size');
fontSize = fontSize * _this.minder.getZoomValue() / 100;
fontSize = fontSize < 16 ? 16 : fontSize;
_this.element.style.fontSize = fontSize + 'px';
_this.element.style.minWidth = 0;
_this.element.style.minWidth = _this.element.clientWidth + 'px';
_this.element.style.fontWeight = node.getData('font-weight') || '';
_this.element.style.fontStyle = node.getData('font-style') || '';
_this.element.classList.add('input');
_this.element.focus();
}
},
isMobileMode : function () {
return navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i);
},
commitInputResult : function () {
var _this = this;
var textNodes = [].slice.call(_this.element.childNodes);
setTimeout(function () {
// 解决过大内容导致SVG窜位问题
_this.element.innerHTML = '';
}, 0);
var node = _this.minder.getSelectedNode();
textNodes = _this.commitInputText(textNodes);
_this.commitInputNode(node, textNodes);
if (node.type == 'root') {
var rootText = _this.minder.getRoot().getText();
_this.minder.fire('initChangeRoot', {
text: rootText
});
}
},
commitInputText : function (textNodes) {
var _this = this;
var text = '';
var TAB_CHAR = '\t',
ENTER_CHAR = '
',
STR_CHECK = /\S/,
SPACE_CHAR = '\u0020',
// 针对FF,SG,BD,LB,IE等浏览器下SPACE的charCode存在为32和160的情况做处理
SPACE_CHAR_REGEXP = new RegExp('(\u0020|' + String.fromCharCode(160) + ')'),
BR = document.createElement('br');
for (var i = 0, l = textNodes.length; i < l; i++) {
if (i < textNodes.length - 1 && textNodes[i].nodeName == '#text' && textNodes[i + 1].nodeName == 'DIV') {
textNodes.splice(i + 1, 0, BR);
}
}
var isBold = false,
isItalic = false;
for (var str, _divChildNodes, space_l, space_num, tab_num, i = 0, l = textNodes.length; i < l; i++) {
str = textNodes[i];
switch (Object.prototype.toString.call(str)) {
// 正常情况处理
case '[object HTMLBRElement]': {
text += ENTER_CHAR;
break;
}
case '[object Text]': {
// SG下会莫名其妙的加上 影响后续判断,干掉!
/**
* FF下的wholeText会导致如下问题:
* |123| -> 在一个节点中输入一段字符,此时TextNode为[#Text 123]
* 提交并重新编辑,在后面追加几个字符
* |123abc| -> 此时123为一个TextNode为[#Text 123, #Text abc],但是对这两个任意取值wholeText均为全部内容123abc
* 上述BUG仅存在在FF中,故将wholeText更改为textContent
*/
str = str.textContent.replace(' ', ' ');
if (!STR_CHECK.test(str)) {
space_l = str.length;
while (space_l--) {
if (SPACE_CHAR_REGEXP.test(str[space_l])) {
text += SPACE_CHAR;
} else if (str[space_l] === TAB_CHAR) {
text += TAB_CHAR;
}
}
} else {
text += str;
}
break;
}
// ctrl + b/i 会给字体加上<b>/<i>标签来实现黑体和斜体
case '[object HTMLElement]': {
switch (str.nodeName) {
case 'B': {
isBold = true;
break;
}
case 'I': {
isItalic = true;
break;
}
default: {
}
}
[].splice.apply(textNodes, [i, 1].concat([].slice.call(str.childNodes)));
l = textNodes.length;
i--;
break;
}
// 被增加span标签的情况会被处理成正常情况并会推交给上面处理
case '[object HTMLSpanElement]': {
[].splice.apply(textNodes, [i, 1].concat([].slice.call(str.childNodes)));
l = textNodes.length;
i--;
break;
}
// 若标签为image标签,则判断是否为合法url,是将其加载进来
case '[object HTMLImageElement]': {
if (str.src) {
if (/http(|s):\/\//.test(str.src)) {
minder.execCommand('Image', str.src, str.alt);
} else {
// data:image协议情况
}
}
;
break;
}
// 被增加div标签的情况会被处理成正常情况并会推交给上面处理
case '[object HTMLDivElement]': {
_divChildNodes = [];
for (var di = 0, l = str.childNodes.length; di < l; di++) {
_divChildNodes.push(str.childNodes[di]);
}
_divChildNodes.push(BR);
[].splice.apply(textNodes, [i, 1].concat(_divChildNodes));
l = textNodes.length;
i--;
break;
}
default: {
if (str && str.childNodes.length) {
_divChildNodes = [];
for (var di = 0, l = str.childNodes.length; di < l; di++) {
_divChildNodes.push(str.childNodes[di]);
}
_divChildNodes.push(BR);
[].splice.apply(textNodes, [i, 1].concat(_divChildNodes));
l = textNodes.length;
i--;
} else {
if (str && str.textContent !== undefined) {
text += str.textContent;
} else {
text += '';
}
}
}
}
}
;
text = text.replace(/^
*|
*$/g, '');
text = text.replace(new RegExp('(
|\r|
\r)(\u0020|' + String.fromCharCode(160) + '){4}', 'g'), '$1\t');
_this.minder.getSelectedNode().setText(text);
if (isBold) {
_this.minder.queryCommandState('bold') || _this.minder.execCommand('bold');
} else {
_this.minder.queryCommandState('bold') && _this.minder.execCommand('bold');
}
if (isItalic) {
_this.minder.queryCommandState('italic') || _this.minder.execCommand('italic');
} else {
_this.minder.queryCommandState('italic') && _this.minder.execCommand('italic');
}
_this.exitInputMode();
return text;
},
commitInputNode : function (node, text) {
var _this = this;
try {
_this.minder.decodeData('text', text).then(function (json) {
function importText (node, json, minder) {
var data = json.data;
node.setText(data.text || '');
var childrenTreeData = json.children || [];
for (var i = 0; i < childrenTreeData.length; i++) {
var childNode = minder.createNode(null, node);
importText(childNode, childrenTreeData[i], minder);
}
return node;
}
importText(node, json, minder);
_this.minder.fire('contentchange');
_this.minder.getRoot().renderTree();
_this.minder.layout(300);
});
} catch (e) {
_this.minder.fire('contentchange');
_this.minder.getRoot().renderTree();
// 无法被转换成脑图节点则不处理
if (e.toString() !== 'Error: Invalid local format') {
throw e;
}
}
},
exitInputMode : function () {
this.element.classList.remove('input');
this.selectAll();
},
selectAll : function () {
var _this = dtkmEditor.receiver;
if (_this.isMobileMode()) return;
// 保证有被选中的
if (!_this.element.innerHTML) _this.element.innerHTML = ' ';
var range = document.createRange();
var selection = window.getSelection();
range.selectNodeContents(_this.element);
selection.removeAllRanges();
selection.addRange(range);
_this.element.focus();
},
/**
* hack FF下div contenteditable的光标丢失BUG
*/
fixFFCaretDisappeared: function () {
this.element.removeAttribute('contenteditable');
this.element.setAttribute('contenteditable', 'true');
this.element.blur();
this.element.focus();
}
},
/**
* 初始化dtkmEditor
* @param {*} selector
*/
init : function (selector) {
var _this = this;
//_this.options.zoom = _this.utils.getZooms();
_this.minder = window.minder = new kityminder.Minder(_this.options);
_this.setGlobalVar(selector);
_this.minder.renderTo(selector);
_this.minder.setTheme('fresh-blue');
_this.minder.select(_this.minder.getRoot(), true);
_this.minder.execCommand('text', '中心主题');
_this.minder.execCommand('template', 'default');
_this.receiver.init();
_this.bindEvent();
},
setGlobalVar : function (selector) {
this.container = selector;
},
/**
* 绑定事件
*/
bindEvent : function () {
var _this = this;
_this.minder.on('dblclick', (e) => {
if (this.receiver.isMobileMode()) return;
if(location.hash === '#/play' || _this.minder._root.data.previewMode) return
if (_this.minder.getSelectedNode() && _this.minder._status !== 'readonly') {
_this.editText();
}
});
},
/**
* svg
* @param {*} tag
* @param {*} attrs
*/
makeSVG : function (tag, attrs) {
var el = document.createElementNS('http://www.w3.org/2000/svg', tag);
for (var k in attrs)
el.setAttribute(k, attrs[k]);
return el;
},
/**
* 节点添加操作按钮
*/
addOptButton : function () {
var _this = this, topg = document.getElementById('top-add'), btmg = document.getElementById('bottom-add'),
lrg = document.getElementById('lr-add'), rg = document.getElementById('r-add'),
lg = document.getElementById('l-add');
if (topg) topg.remove();
if (btmg) btmg.remove();
if (lrg) lrg.remove();
if (rg) rg.remove();
if (lg) lg.remove();
if(location.hash === '#/play' || this.minder._root.data.previewMode) return
var focusNode = _this.minder.getSelectedNode();
if (focusNode) {
var isHasImg = false, imgHeight = 0;
if (focusNode.data.image != undefined) {
isHasImg = true;
imgHeight = focusNode.data.imageSize.height;
}
var isVertical = _this.minder._template === 'filetree' || _this.minder._template === 'structure'
var isMain = focusNode.getType() === 'main'
var e = focusNode.isRoot() ? 1 : focusNode._layoutTransform.m.e;
var topg = _this.makeSVG('g', {
id : 'top-add',
transform: 'translate(' + Math.round((focusNode._contentBox.width + focusNode._contentBox.left * 2) / 2) + ' -' + (isHasImg ? Math.round(focusNode._contentBox.height / 2 + imgHeight / 2 + 3) : Math.round(focusNode._contentBox.height / 2)) + ')',
style : 'cursor: pointer;'
}),
btmg = _this.makeSVG('g', {
id : 'bottom-add',
transform: 'translate(' + Math.round((focusNode._contentBox.width + focusNode._contentBox.left * 2) / 2) + ' ' + (isHasImg ? Math.round(focusNode._contentBox.height / 2 - imgHeight / 2 - 3) + (isVertical ? (isMain ? 10 : 12) : 0) : Math.round(focusNode._contentBox.height / 2) + (isVertical ? (isMain ? 10 : 12) : 0)) + ')',
style : 'cursor: pointer;'
}),
lrg = _this.makeSVG('g', {
id : 'lr-add',
transform: 'translate(' + (e > 0 ? Math.round(focusNode._contentBox.width + focusNode._contentBox.left) + 8 + ' ' + (isHasImg ? '-' + parseInt(imgHeight / 2 + 3) : '0') : Math.round(focusNode._contentBox.left) - 8 + ' ' + (isHasImg ? '-' + parseInt(imgHeight / 2 + 3) : '0')) + ')',
style : 'cursor: pointer;'
}),
rg = _this.makeSVG('g', {
id : 'r-add',
transform: 'translate(' + Math.round(focusNode._contentBox.width + focusNode._contentBox.left) + ' ' + (isHasImg ? '-' + parseInt(imgHeight / 2 + 3) : '0') + ')',
style : 'cursor: pointer;'
}),
lg = _this.makeSVG('g', {
id : 'l-add',
transform: 'translate(' + Math.round(focusNode._contentBox.left) + ' ' + (isHasImg ? '-' + parseInt(imgHeight / 2 + 3) : '0') + ')',
style : 'cursor: pointer;'
}),
path1 = _this.makeSVG('path', {fill: 'white', stroke: 'gray', d: 'M6,0A6,6,0,1,1,-6,0A6,6,0,1,1,6,0'}),
path2 = _this.makeSVG('path', {fill: 'none', stroke: 'gray', d: 'M-4.5,0L4.5,0M0,-4.5L0,4.5'}),
path3 = _this.makeSVG('path', {fill: 'white', stroke: 'gray', d: 'M6,0A6,6,0,1,1,-6,0A6,6,0,1,1,6,0'}),
path4 = _this.makeSVG('path', {fill: 'none', stroke: 'gray', d: 'M-4.5,0L4.5,0M0,-4.5L0,4.5'}),
path5 = _this.makeSVG('path', {fill: 'white', stroke: 'gray', d: 'M6,0A6,6,0,1,1,-6,0A6,6,0,1,1,6,0'}),
path6 = _this.makeSVG('path', {fill: 'none', stroke: 'gray', d: 'M-4.5,0L4.5,0M0,-4.5L0,4.5'}),
path7 = _this.makeSVG('path', {fill: 'white', stroke: 'gray', d: 'M6,0A6,6,0,1,1,-6,0A6,6,0,1,1,6,0'}),
path8 = _this.makeSVG('path', {fill: 'none', stroke: 'gray', d: 'M-4.5,0L4.5,0M0,-4.5L0,4.5'}),
path9 = _this.makeSVG('path', {fill: 'white', stroke: 'gray', d: 'M6,0A6,6,0,1,1,-6,0A6,6,0,1,1,6,0'}),
path10 = _this.makeSVG('path', {fill: 'none', stroke: 'gray', d: 'M-4.5,0L4.5,0M0,-4.5L0,4.5'});
topg.appendChild(path1);
topg.appendChild(path2);
btmg.appendChild(path3);
btmg.appendChild(path4);
lrg.appendChild(path5);
lrg.appendChild(path6);
rg.appendChild(path7);
rg.appendChild(path8);
lg.appendChild(path9);
lg.appendChild(path10);
if (!focusNode.isRoot()) {
switch (_this.minder._template) {
case 'structure' :
case 'filetree' :
document.getElementById(focusNode.rc.node.id).appendChild(lg);
document.getElementById(focusNode.rc.node.id).appendChild(rg);
document.getElementById(focusNode.rc.node.id).appendChild(btmg);
document.getElementById('bottom-add').onclick = function () {
_this.addChildNode(focusNode, 'bottom');
};
document.getElementById('r-add').onclick = function () {
_this.addSiblingNode(focusNode, 'right');
};
document.getElementById('l-add').onclick = function () {
_this.addSiblingNode(focusNode, 'left');
};
break;
default:
document.getElementById(focusNode.rc.node.id).appendChild(topg);
document.getElementById(focusNode.rc.node.id).appendChild(btmg);
document.getElementById(focusNode.rc.node.id).appendChild(lrg);
document.getElementById('top-add').onclick = function () {
_this.addSiblingNode(focusNode, 'top');
};
document.getElementById('bottom-add').onclick = function () {
_this.addSiblingNode(focusNode, 'bottom');
};
}
}
// document.getElementById(focusNode.rc.node.id).appendChild(lrg);
document.getElementById('lr-add').onclick = function () {
_this.addChildNode(focusNode, '');
};
}
},
/**
* 添加兄弟主题
*/
addSiblingNode: function (focusNode, type) {
var _this = this;
var parent = focusNode.parent;
var node = null;
if (!parent) {
return _this.minder.execCommand('AppendChildNode', '分支主题');
}
if (type === 'top' || type === 'left') {
node = _this.minder.createNode('分支主题', parent, focusNode.getIndex());
} else if (type === 'bottom' || type === 'right') {
node = _this.minder.createNode('分支主题', parent, focusNode.getIndex() + 1);
}
node.setGlobalLayoutTransform(focusNode.getGlobalLayoutTransform());
//字体大小跟选中节点一样,默认18
focusNode.getData()['font-size'] && node.setData('font-size',focusNode.getData()['font-size'])
_this.minder.select(node, true);
node.render();
_this.minder.layout(600);
setTimeout(function () {
_this.editText();
}, 500);
},
/**
* 添加子主题
*/
addChildNode : function (focusNode, type) {
var _this = this;
if (!focusNode) {
return null;
}
var node = _this.minder.createNode('分支主题', focusNode);
//字体大小跟选中节点一样,默认18
focusNode.getData()['font-size'] && node.setData('font-size',focusNode.getData()['font-size'])
_this.minder.select(node, true);
if (focusNode.isExpanded()) {
node.render();
} else {
focusNode.expand();
focusNode.renderTree();
}
_this.minder.layout(600);
setTimeout(function () {
_this.editText();
}, 500);
},
/**
* 编辑文本
*/
editText : function () {
var _this = this;
_this.receiver.enable();
var node = _this.minder.getSelectedNode();
if (!node) {
return;
}
var receiverElement = _this.receiver.element;
receiverElement.innerText = '';
if (node.getData('font-weight') === 'bold') {
var b = document.createElement('b');
receiverElement.appendChild(b);
receiverElement = b;
}
if (node.getData('font-style') === 'italic') {
var i = document.createElement('i');
receiverElement.appendChild(i);
receiverElement = i;
}
receiverElement.innerText = minder.queryCommandValue('text');
if (window.kity.Browser.gecko) {
_this.receiver.fixFFCaretDisappeared();
}
;
_this.receiver.enterInputMode();
_this.receiver.selectAll();
},
utils : {
hasClass: function (element, cls) {
return (' ' + element.className + ' ').indexOf(' ' + cls + ' ') > -1;
}
}
};
window.dtkmEditor = dtkmEditor;
mindmap_kityminder_1.0.0.2035/libs/hammer.min.js
/*! Hammer.JS - v2.0.8 - 2016-04-23
* http://hammerjs.github.io/
*
* Copyright (c) 2016 Jorik Tangelder;
* Licensed under the MIT license */
!function(a,b,c,d){"use strict";function e(a,b,c){return setTimeout(j(a,c),b)}function f(a,b,c){return Array.isArray(a)?(g(a,c[b],c),!0):!1}function g(a,b,c){var e;if(a)if(a.forEach)a.forEach(b,c);else if(a.length!==d)for(e=0;e<a.length;)b.call(c,a[e],e,a),e++;else for(e in a)a.hasOwnProperty(e)&&b.call(c,a[e],e,a)}function h(b,c,d){var e="DEPRECATED METHOD: "+c+"
"+d+" AT
";return function(){var c=new Error("get-stack-trace"),d=c&&c.stack?c.stack.replace(/^[^\(]+?[
$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",f=a.console&&(a.console.warn||a.console.log);return f&&f.call(a.console,e,d),b.apply(this,arguments)}}function i(a,b,c){var d,e=b.prototype;d=a.prototype=Object.create(e),d.constructor=a,d._super=e,c&&la(d,c)}function j(a,b){return function(){return a.apply(b,arguments)}}function k(a,b){return typeof a==oa?a.apply(b?b[0]||d:d,b):a}function l(a,b){return a===d?b:a}function m(a,b,c){g(q(b),function(b){a.addEventListener(b,c,!1)})}function n(a,b,c){g(q(b),function(b){a.removeEventListener(b,c,!1)})}function o(a,b){for(;a;){if(a==b)return!0;a=a.parentNode}return!1}function p(a,b){return a.indexOf(b)>-1}function q(a){return a.trim().split(/\s+/g)}function r(a,b,c){if(a.indexOf&&!c)return a.indexOf(b);for(var d=0;d<a.length;){if(c&&a[d][c]==b||!c&&a[d]===b)return d;d++}return-1}function s(a){return Array.prototype.slice.call(a,0)}function t(a,b,c){for(var d=[],e=[],f=0;f<a.length;){var g=b?a[f][b]:a[f];r(e,g)<0&&d.push(a[f]),e[f]=g,f++}return c&&(d=b?d.sort(function(a,c){return a[b]>c[b]}):d.sort()),d}function u(a,b){for(var c,e,f=b[0].toUpperCase()+b.slice(1),g=0;g<ma.length;){if(c=ma[g],e=c?c+f:b,e in a)return e;g++}return d}function v(){return ua++}function w(b){var c=b.ownerDocument||b;return c.defaultView||c.parentWindow||a}function x(a,b){var c=this;this.manager=a,this.callback=b,this.element=a.element,this.target=a.options.inputTarget,this.domHandler=function(b){k(a.options.enable,[a])&&c.handler(b)},this.init()}function y(a){var b,c=a.options.inputClass;return new(b=c?c:xa?M:ya?P:wa?R:L)(a,z)}function z(a,b,c){var d=c.pointers.length,e=c.changedPointers.length,f=b&Ea&&d-e===0,g=b&(Ga|Ha)&&d-e===0;c.isFirst=!!f,c.isFinal=!!g,f&&(a.session={}),c.eventType=b,A(a,c),a.emit("hammer.input",c),a.recognize(c),a.session.prevInput=c}function A(a,b){var c=a.session,d=b.pointers,e=d.length;c.firstInput||(c.firstInput=D(b)),e>1&&!c.firstMultiple?c.firstMultiple=D(b):1===e&&(c.firstMultiple=!1);var f=c.firstInput,g=c.firstMultiple,h=g?g.center:f.center,i=b.center=E(d);b.timeStamp=ra(),b.deltaTime=b.timeStamp-f.timeStamp,b.angle=I(h,i),b.distance=H(h,i),B(c,b),b.offsetDirection=G(b.deltaX,b.deltaY);var j=F(b.deltaTime,b.deltaX,b.deltaY);b.overallVelocityX=j.x,b.overallVelocityY=j.y,b.overallVelocity=qa(j.x)>qa(j.y)?j.x:j.y,b.scale=g?K(g.pointers,d):1,b.rotation=g?J(g.pointers,d):0,b.maxPointers=c.prevInput?b.pointers.length>c.prevInput.maxPointers?b.pointers.length:c.prevInput.maxPointers:b.pointers.length,C(c,b);var k=a.element;o(b.srcEvent.target,k)&&(k=b.srcEvent.target),b.target=k}function B(a,b){var c=b.center,d=a.offsetDelta||{},e=a.prevDelta||{},f=a.prevInput||{};b.eventType!==Ea&&f.eventType!==Ga||(e=a.prevDelta={x:f.deltaX||0,y:f.deltaY||0},d=a.offsetDelta={x:c.x,y:c.y}),b.deltaX=e.x+(c.x-d.x),b.deltaY=e.y+(c.y-d.y)}function C(a,b){var c,e,f,g,h=a.lastInterval||b,i=b.timeStamp-h.timeStamp;if(b.eventType!=Ha&&(i>Da||h.velocity===d)){var j=b.deltaX-h.deltaX,k=b.deltaY-h.deltaY,l=F(i,j,k);e=l.x,f=l.y,c=qa(l.x)>qa(l.y)?l.x:l.y,g=G(j,k),a.lastInterval=b}else c=h.velocity,e=h.velocityX,f=h.velocityY,g=h.direction;b.velocity=c,b.velocityX=e,b.velocityY=f,b.direction=g}function D(a){for(var b=[],c=0;c<a.pointers.length;)b[c]={clientX:pa(a.pointers[c].clientX),clientY:pa(a.pointers[c].clientY)},c++;return{timeStamp:ra(),pointers:b,center:E(b),deltaX:a.deltaX,deltaY:a.deltaY}}function E(a){var b=a.length;if(1===b)return{x:pa(a[0].clientX),y:pa(a[0].clientY)};for(var c=0,d=0,e=0;b>e;)c+=a[e].clientX,d+=a[e].clientY,e++;return{x:pa(c/b),y:pa(d/b)}}function F(a,b,c){return{x:b/a||0,y:c/a||0}}function G(a,b){return a===b?Ia:qa(a)>=qa(b)?0>a?Ja:Ka:0>b?La:Ma}function H(a,b,c){c||(c=Qa);var d=b[c[0]]-a[c[0]],e=b[c[1]]-a[c[1]];return Math.sqrt(d*d+e*e)}function I(a,b,c){c||(c=Qa);var d=b[c[0]]-a[c[0]],e=b[c[1]]-a[c[1]];return 180*Math.atan2(e,d)/Math.PI}function J(a,b){return I(b[1],b[0],Ra)+I(a[1],a[0],Ra)}function K(a,b){return H(b[0],b[1],Ra)/H(a[0],a[1],Ra)}function L(){this.evEl=Ta,this.evWin=Ua,this.pressed=!1,x.apply(this,arguments)}function M(){this.evEl=Xa,this.evWin=Ya,x.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function N(){this.evTarget=$a,this.evWin=_a,this.started=!1,x.apply(this,arguments)}function O(a,b){var c=s(a.touches),d=s(a.changedTouches);return b&(Ga|Ha)&&(c=t(c.concat(d),"identifier",!0)),[c,d]}function P(){this.evTarget=bb,this.targetIds={},x.apply(this,arguments)}function Q(a,b){var c=s(a.touches),d=this.targetIds;if(b&(Ea|Fa)&&1===c.length)return d[c[0].identifier]=!0,[c,c];var e,f,g=s(a.changedTouches),h=[],i=this.target;if(f=c.filter(function(a){return o(a.target,i)}),b===Ea)for(e=0;e<f.length;)d[f[e].identifier]=!0,e++;for(e=0;e<g.length;)d[g[e].identifier]&&h.push(g[e]),b&(Ga|Ha)&&delete d[g[e].identifier],e++;return h.length?[t(f.concat(h),"identifier",!0),h]:void 0}function R(){x.apply(this,arguments);var a=j(this.handler,this);this.touch=new P(this.manager,a),this.mouse=new L(this.manager,a),this.primaryTouch=null,this.lastTouches=[]}function S(a,b){a&Ea?(this.primaryTouch=b.changedPointers[0].identifier,T.call(this,b)):a&(Ga|Ha)&&T.call(this,b)}function T(a){var b=a.changedPointers[0];if(b.identifier===this.primaryTouch){var c={x:b.clientX,y:b.clientY};this.lastTouches.push(c);var d=this.lastTouches,e=function(){var a=d.indexOf(c);a>-1&&d.splice(a,1)};setTimeout(e,cb)}}function U(a){for(var b=a.srcEvent.clientX,c=a.srcEvent.clientY,d=0;d<this.lastTouches.length;d++){var e=this.lastTouches[d],f=Math.abs(b-e.x),g=Math.abs(c-e.y);if(db>=f&&db>=g)return!0}return!1}function V(a,b){this.manager=a,this.set(b)}function W(a){if(p(a,jb))return jb;var b=p(a,kb),c=p(a,lb);return b&&c?jb:b||c?b?kb:lb:p(a,ib)?ib:hb}function X(){if(!fb)return!1;var b={},c=a.CSS&&a.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(d){b[d]=c?a.CSS.supports("touch-action",d):!0}),b}function Y(a){this.options=la({},this.defaults,a||{}),this.id=v(),this.manager=null,this.options.enable=l(this.options.enable,!0),this.state=nb,this.simultaneous={},this.requireFail=[]}function Z(a){return a&sb?"cancel":a&qb?"end":a&pb?"move":a&ob?"start":""}function $(a){return a==Ma?"down":a==La?"up":a==Ja?"left":a==Ka?"right":""}function _(a,b){var c=b.manager;return c?c.get(a):a}function aa(){Y.apply(this,arguments)}function ba(){aa.apply(this,arguments),this.pX=null,this.pY=null}function ca(){aa.apply(this,arguments)}function da(){Y.apply(this,arguments),this._timer=null,this._input=null}function ea(){aa.apply(this,arguments)}function fa(){aa.apply(this,arguments)}function ga(){Y.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function ha(a,b){return b=b||{},b.recognizers=l(b.recognizers,ha.defaults.preset),new ia(a,b)}function ia(a,b){this.options=la({},ha.defaults,b||{}),this.options.inputTarget=this.options.inputTarget||a,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=a,this.input=y(this),this.touchAction=new V(this,this.options.touchAction),ja(this,!0),g(this.options.recognizers,function(a){var b=this.add(new a[0](a[1]));a[2]&&b.recognizeWith(a[2]),a[3]&&b.requireFailure(a[3])},this)}function ja(a,b){var c=a.element;if(c.style){var d;g(a.options.cssProps,function(e,f){d=u(c.style,f),b?(a.oldCssProps[d]=c.style[d],c.style[d]=e):c.style[d]=a.oldCssProps[d]||""}),b||(a.oldCssProps={})}}function ka(a,c){var d=b.createEvent("Event");d.initEvent(a,!0,!0),d.gesture=c,c.target.dispatchEvent(d)}var la,ma=["","webkit","Moz","MS","ms","o"],na=b.createElement("div"),oa="function",pa=Math.round,qa=Math.abs,ra=Date.now;la="function"!=typeof Object.assign?function(a){if(a===d||null===a)throw new TypeError("Cannot convert undefined or null to object");for(var b=Object(a),c=1;c<arguments.length;c++){var e=arguments[c];if(e!==d&&null!==e)for(var f in e)e.hasOwnProperty(f)&&(b[f]=e[f])}return b}:Object.assign;var sa=h(function(a,b,c){for(var e=Object.keys(b),f=0;f<e.length;)(!c||c&&a[e[f]]===d)&&(a[e[f]]=b[e[f]]),f++;return a},"extend","Use `assign`."),ta=h(function(a,b){return sa(a,b,!0)},"merge","Use `assign`."),ua=1,va=/mobile|tablet|ip(ad|hone|od)|android/i,wa="ontouchstart"in a,xa=u(a,"PointerEvent")!==d,ya=wa&&va.test(navigator.userAgent),za="touch",Aa="pen",Ba="mouse",Ca="kinect",Da=25,Ea=1,Fa=2,Ga=4,Ha=8,Ia=1,Ja=2,Ka=4,La=8,Ma=16,Na=Ja|Ka,Oa=La|Ma,Pa=Na|Oa,Qa=["x","y"],Ra=["clientX","clientY"];x.prototype={handler:function(){},init:function(){this.evEl&&m(this.element,this.evEl,this.domHandler),this.evTarget&&m(this.target,this.evTarget,this.domHandler),this.evWin&&m(w(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&n(this.element,this.evEl,this.domHandler),this.evTarget&&n(this.target,this.evTarget,this.domHandler),this.evWin&&n(w(this.element),this.evWin,this.domHandler)}};var Sa={mousedown:Ea,mousemove:Fa,mouseup:Ga},Ta="mousedown",Ua="mousemove mouseup";i(L,x,{handler:function(a){var b=Sa[a.type];b&Ea&&0===a.button&&(this.pressed=!0),b&Fa&&1!==a.which&&(b=Ga),this.pressed&&(b&Ga&&(this.pressed=!1),this.callback(this.manager,b,{pointers:[a],changedPointers:[a],pointerType:Ba,srcEvent:a}))}});var Va={pointerdown:Ea,pointermove:Fa,pointerup:Ga,pointercancel:Ha,pointerout:Ha},Wa={2:za,3:Aa,4:Ba,5:Ca},Xa="pointerdown",Ya="pointermove pointerup pointercancel";a.MSPointerEvent&&!a.PointerEvent&&(Xa="MSPointerDown",Ya="MSPointerMove MSPointerUp MSPointerCancel"),i(M,x,{handler:function(a){var b=this.store,c=!1,d=a.type.toLowerCase().replace("ms",""),e=Va[d],f=Wa[a.pointerType]||a.pointerType,g=f==za,h=r(b,a.pointerId,"pointerId");e&Ea&&(0===a.button||g)?0>h&&(b.push(a),h=b.length-1):e&(Ga|Ha)&&(c=!0),0>h||(b[h]=a,this.callback(this.manager,e,{pointers:b,changedPointers:[a],pointerType:f,srcEvent:a}),c&&b.splice(h,1))}});var Za={touchstart:Ea,touchmove:Fa,touchend:Ga,touchcancel:Ha},$a="touchstart",_a="touchstart touchmove touchend touchcancel";i(N,x,{handler:function(a){var b=Za[a.type];if(b===Ea&&(this.started=!0),this.started){var c=O.call(this,a,b);b&(Ga|Ha)&&c[0].length-c[1].length===0&&(this.started=!1),this.callback(this.manager,b,{pointers:c[0],changedPointers:c[1],pointerType:za,srcEvent:a})}}});var ab={touchstart:Ea,touchmove:Fa,touchend:Ga,touchcancel:Ha},bb="touchstart touchmove touchend touchcancel";i(P,x,{handler:function(a){var b=ab[a.type],c=Q.call(this,a,b);c&&this.callback(this.manager,b,{pointers:c[0],changedPointers:c[1],pointerType:za,srcEvent:a})}});var cb=2500,db=25;i(R,x,{handler:function(a,b,c){var d=c.pointerType==za,e=c.pointerType==Ba;if(!(e&&c.sourceCapabilities&&c.sourceCapabilities.firesTouchEvents)){if(d)S.call(this,b,c);else if(e&&U.call(this,c))return;this.callback(a,b,c)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var eb=u(na.style,"touchAction"),fb=eb!==d,gb="compute",hb="auto",ib="manipulation",jb="none",kb="pan-x",lb="pan-y",mb=X();V.prototype={set:function(a){a==gb&&(a=this.compute()),fb&&this.manager.element.style&&mb[a]&&(this.manager.element.style[eb]=a),this.actions=a.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var a=[];return g(this.manager.recognizers,function(b){k(b.options.enable,[b])&&(a=a.concat(b.getTouchAction()))}),W(a.join(" "))},preventDefaults:function(a){var b=a.srcEvent,c=a.offsetDirection;if(this.manager.session.prevented)return void b.preventDefault();var d=this.actions,e=p(d,jb)&&!mb[jb],f=p(d,lb)&&!mb[lb],g=p(d,kb)&&!mb[kb];if(e){var h=1===a.pointers.length,i=a.distance<2,j=a.deltaTime<250;if(h&&i&&j)return}return g&&f?void 0:e||f&&c&Na||g&&c&Oa?this.preventSrc(b):void 0},preventSrc:function(a){this.manager.session.prevented=!0,a.preventDefault()}};var nb=1,ob=2,pb=4,qb=8,rb=qb,sb=16,tb=32;Y.prototype={defaults:{},set:function(a){return la(this.options,a),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(a){if(f(a,"recognizeWith",this))return this;var b=this.simultaneous;return a=_(a,this),b[a.id]||(b[a.id]=a,a.recognizeWith(this)),this},dropRecognizeWith:function(a){return f(a,"dropRecognizeWith",this)?this:(a=_(a,this),delete this.simultaneous[a.id],this)},requireFailure:function(a){if(f(a,"requireFailure",this))return this;var b=this.requireFail;return a=_(a,this),-1===r(b,a)&&(b.push(a),a.requireFailure(this)),this},dropRequireFailure:function(a){if(f(a,"dropRequireFailure",this))return this;a=_(a,this);var b=r(this.requireFail,a);return b>-1&&this.requireFail.splice(b,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(a){return!!this.simultaneous[a.id]},emit:function(a){function b(b){c.manager.emit(b,a)}var c=this,d=this.state;qb>d&&b(c.options.event+Z(d)),b(c.options.event),a.additionalEvent&&b(a.additionalEvent),d>=qb&&b(c.options.event+Z(d))},tryEmit:function(a){return this.canEmit()?this.emit(a):void(this.state=tb)},canEmit:function(){for(var a=0;a<this.requireFail.length;){if(!(this.requireFail[a].state&(tb|nb)))return!1;a++}return!0},recognize:function(a){var b=la({},a);return k(this.options.enable,[this,b])?(this.state&(rb|sb|tb)&&(this.state=nb),this.state=this.process(b),void(this.state&(ob|pb|qb|sb)&&this.tryEmit(b))):(this.reset(),void(this.state=tb))},process:function(a){},getTouchAction:function(){},reset:function(){}},i(aa,Y,{defaults:{pointers:1},attrTest:function(a){var b=this.options.pointers;return 0===b||a.pointers.length===b},process:function(a){var b=this.state,c=a.eventType,d=b&(ob|pb),e=this.attrTest(a);return d&&(c&Ha||!e)?b|sb:d||e?c&Ga?b|qb:b&ob?b|pb:ob:tb}}),i(ba,aa,{defaults:{event:"pan",threshold:10,pointers:1,direction:Pa},getTouchAction:function(){var a=this.options.direction,b=[];return a&Na&&b.push(lb),a&Oa&&b.push(kb),b},directionTest:function(a){var b=this.options,c=!0,d=a.distance,e=a.direction,f=a.deltaX,g=a.deltaY;return e&b.direction||(b.direction&Na?(e=0===f?Ia:0>f?Ja:Ka,c=f!=this.pX,d=Math.abs(a.deltaX)):(e=0===g?Ia:0>g?La:Ma,c=g!=this.pY,d=Math.abs(a.deltaY))),a.direction=e,c&&d>b.threshold&&e&b.direction},attrTest:function(a){return aa.prototype.attrTest.call(this,a)&&(this.state&ob||!(this.state&ob)&&this.directionTest(a))},emit:function(a){this.pX=a.deltaX,this.pY=a.deltaY;var b=$(a.direction);b&&(a.additionalEvent=this.options.event+b),this._super.emit.call(this,a)}}),i(ca,aa,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[jb]},attrTest:function(a){return this._super.attrTest.call(this,a)&&(Math.abs(a.scale-1)>this.options.threshold||this.state&ob)},emit:function(a){if(1!==a.scale){var b=a.scale<1?"in":"out";a.additionalEvent=this.options.event+b}this._super.emit.call(this,a)}}),i(da,Y,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[hb]},process:function(a){var b=this.options,c=a.pointers.length===b.pointers,d=a.distance<b.threshold,f=a.deltaTime>b.time;if(this._input=a,!d||!c||a.eventType&(Ga|Ha)&&!f)this.reset();else if(a.eventType&Ea)this.reset(),this._timer=e(function(){this.state=rb,this.tryEmit()},b.time,this);else if(a.eventType&Ga)return rb;return tb},reset:function(){clearTimeout(this._timer)},emit:function(a){this.state===rb&&(a&&a.eventType&Ga?this.manager.emit(this.options.event+"up",a):(this._input.timeStamp=ra(),this.manager.emit(this.options.event,this._input)))}}),i(ea,aa,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[jb]},attrTest:function(a){return this._super.attrTest.call(this,a)&&(Math.abs(a.rotation)>this.options.threshold||this.state&ob)}}),i(fa,aa,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Na|Oa,pointers:1},getTouchAction:function(){return ba.prototype.getTouchAction.call(this)},attrTest:function(a){var b,c=this.options.direction;return c&(Na|Oa)?b=a.overallVelocity:c&Na?b=a.overallVelocityX:c&Oa&&(b=a.overallVelocityY),this._super.attrTest.call(this,a)&&c&a.offsetDirection&&a.distance>this.options.threshold&&a.maxPointers==this.options.pointers&&qa(b)>this.options.velocity&&a.eventType&Ga},emit:function(a){var b=$(a.offsetDirection);b&&this.manager.emit(this.options.event+b,a),this.manager.emit(this.options.event,a)}}),i(ga,Y,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[ib]},process:function(a){var b=this.options,c=a.pointers.length===b.pointers,d=a.distance<b.threshold,f=a.deltaTime<b.time;if(this.reset(),a.eventType&Ea&&0===this.count)return this.failTimeout();if(d&&f&&c){if(a.eventType!=Ga)return this.failTimeout();var g=this.pTime?a.timeStamp-this.pTime<b.interval:!0,h=!this.pCenter||H(this.pCenter,a.center)<b.posThreshold;this.pTime=a.timeStamp,this.pCenter=a.center,h&&g?this.count+=1:this.count=1,this._input=a;var i=this.count%b.taps;if(0===i)return this.hasRequireFailures()?(this._timer=e(function(){this.state=rb,this.tryEmit()},b.interval,this),ob):rb}return tb},failTimeout:function(){return this._timer=e(function(){this.state=tb},this.options.interval,this),tb},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==rb&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),ha.VERSION="2.0.8",ha.defaults={domEvents:!1,touchAction:gb,enable:!0,inputTarget:null,inputClass:null,preset:[[ea,{enable:!1}],[ca,{enable:!1},["rotate"]],[fa,{direction:Na}],[ba,{direction:Na},["swipe"]],[ga],[ga,{event:"doubletap",taps:2},["tap"]],[da]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var ub=1,vb=2;ia.prototype={set:function(a){return la(this.options,a),a.touchAction&&this.touchAction.update(),a.inputTarget&&(this.input.destroy(),this.input.target=a.inputTarget,this.input.init()),this},stop:function(a){this.session.stopped=a?vb:ub},recognize:function(a){var b=this.session;if(!b.stopped){this.touchAction.preventDefaults(a);var c,d=this.recognizers,e=b.curRecognizer;(!e||e&&e.state&rb)&&(e=b.curRecognizer=null);for(var f=0;f<d.length;)c=d[f],b.stopped===vb||e&&c!=e&&!c.canRecognizeWith(e)?c.reset():c.recognize(a),!e&&c.state&(ob|pb|qb)&&(e=b.curRecognizer=c),f++}},get:function(a){if(a instanceof Y)return a;for(var b=this.recognizers,c=0;c<b.length;c++)if(b[c].options.event==a)return b[c];return null},add:function(a){if(f(a,"add",this))return this;var b=this.get(a.options.event);return b&&this.remove(b),this.recognizers.push(a),a.manager=this,this.touchAction.update(),a},remove:function(a){if(f(a,"remove",this))return this;if(a=this.get(a)){var b=this.recognizers,c=r(b,a);-1!==c&&(b.splice(c,1),this.touchAction.update())}return this},on:function(a,b){if(a!==d&&b!==d){var c=this.handlers;return g(q(a),function(a){c[a]=c[a]||[],c[a].push(b)}),this}},off:function(a,b){if(a!==d){var c=this.handlers;return g(q(a),function(a){b?c[a]&&c[a].splice(r(c[a],b),1):delete c[a]}),this}},emit:function(a,b){this.options.domEvents&&ka(a,b);var c=this.handlers[a]&&this.handlers[a].slice();if(c&&c.length){b.type=a,b.preventDefault=function(){b.srcEvent.preventDefault()};for(var d=0;d<c.length;)c[d](b),d++}},destroy:function(){this.element&&ja(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},la(ha,{INPUT_START:Ea,INPUT_MOVE:Fa,INPUT_END:Ga,INPUT_CANCEL:Ha,STATE_POSSIBLE:nb,STATE_BEGAN:ob,STATE_CHANGED:pb,STATE_ENDED:qb,STATE_RECOGNIZED:rb,STATE_CANCELLED:sb,STATE_FAILED:tb,DIRECTION_NONE:Ia,DIRECTION_LEFT:Ja,DIRECTION_RIGHT:Ka,DIRECTION_UP:La,DIRECTION_DOWN:Ma,DIRECTION_HORIZONTAL:Na,DIRECTION_VERTICAL:Oa,DIRECTION_ALL:Pa,Manager:ia,Input:x,TouchAction:V,TouchInput:P,MouseInput:L,PointerEventInput:M,TouchMouseInput:R,SingleTouchInput:N,Recognizer:Y,AttrRecognizer:aa,Tap:ga,Pan:ba,Swipe:fa,Pinch:ca,Rotate:ea,Press:da,on:m,off:n,each:g,merge:ta,extend:sa,assign:la,inherit:i,bindFn:j,prefixed:u});var wb="undefined"!=typeof a?a:"undefined"!=typeof self?self:{};wb.Hammer=ha,"function"==typeof define&&define.amd?define(function(){return ha}):"undefined"!=typeof module&&module.exports?module.exports=ha:a[c]=ha}(window,document,"Hammer");
//# sourceMappingURL=hammer.min.js.map
mindmap_kityminder_1.0.0.2035/libs/hammer.min.js.gz
mindmap_kityminder_1.0.0.2035/libs/hammer.min.js
/*! Hammer.JS - v2.0.8 - 2016-04-23
* http://hammerjs.github.io/
*
* Copyright (c) 2016 Jorik Tangelder;
* Licensed under the MIT license */
!function(a,b,c,d){"use strict";function e(a,b,c){return setTimeout(j(a,c),b)}function f(a,b,c){return Array.isArray(a)?(g(a,c[b],c),!0):!1}function g(a,b,c){var e;if(a)if(a.forEach)a.forEach(b,c);else if(a.length!==d)for(e=0;e<a.length;)b.call(c,a[e],e,a),e++;else for(e in a)a.hasOwnProperty(e)&&b.call(c,a[e],e,a)}function h(b,c,d){var e="DEPRECATED METHOD: "+c+"
"+d+" AT
";return function(){var c=new Error("get-stack-trace"),d=c&&c.stack?c.stack.replace(/^[^\(]+?[
$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",f=a.console&&(a.console.warn||a.console.log);return f&&f.call(a.console,e,d),b.apply(this,arguments)}}function i(a,b,c){var d,e=b.prototype;d=a.prototype=Object.create(e),d.constructor=a,d._super=e,c&&la(d,c)}function j(a,b){return function(){return a.apply(b,arguments)}}function k(a,b){return typeof a==oa?a.apply(b?b[0]||d:d,b):a}function l(a,b){return a===d?b:a}function m(a,b,c){g(q(b),function(b){a.addEventListener(b,c,!1)})}function n(a,b,c){g(q(b),function(b){a.removeEventListener(b,c,!1)})}function o(a,b){for(;a;){if(a==b)return!0;a=a.parentNode}return!1}function p(a,b){return a.indexOf(b)>-1}function q(a){return a.trim().split(/\s+/g)}function r(a,b,c){if(a.indexOf&&!c)return a.indexOf(b);for(var d=0;d<a.length;){if(c&&a[d][c]==b||!c&&a[d]===b)return d;d++}return-1}function s(a){return Array.prototype.slice.call(a,0)}function t(a,b,c){for(var d=[],e=[],f=0;f<a.length;){var g=b?a[f][b]:a[f];r(e,g)<0&&d.push(a[f]),e[f]=g,f++}return c&&(d=b?d.sort(function(a,c){return a[b]>c[b]}):d.sort()),d}function u(a,b){for(var c,e,f=b[0].toUpperCase()+b.slice(1),g=0;g<ma.length;){if(c=ma[g],e=c?c+f:b,e in a)return e;g++}return d}function v(){return ua++}function w(b){var c=b.ownerDocument||b;return c.defaultView||c.parentWindow||a}function x(a,b){var c=this;this.manager=a,this.callback=b,this.element=a.element,this.target=a.options.inputTarget,this.domHandler=function(b){k(a.options.enable,[a])&&c.handler(b)},this.init()}function y(a){var b,c=a.options.inputClass;return new(b=c?c:xa?M:ya?P:wa?R:L)(a,z)}function z(a,b,c){var d=c.pointers.length,e=c.changedPointers.length,f=b&Ea&&d-e===0,g=b&(Ga|Ha)&&d-e===0;c.isFirst=!!f,c.isFinal=!!g,f&&(a.session={}),c.eventType=b,A(a,c),a.emit("hammer.input",c),a.recognize(c),a.session.prevInput=c}function A(a,b){var c=a.session,d=b.pointers,e=d.length;c.firstInput||(c.firstInput=D(b)),e>1&&!c.firstMultiple?c.firstMultiple=D(b):1===e&&(c.firstMultiple=!1);var f=c.firstInput,g=c.firstMultiple,h=g?g.center:f.center,i=b.center=E(d);b.timeStamp=ra(),b.deltaTime=b.timeStamp-f.timeStamp,b.angle=I(h,i),b.distance=H(h,i),B(c,b),b.offsetDirection=G(b.deltaX,b.deltaY);var j=F(b.deltaTime,b.deltaX,b.deltaY);b.overallVelocityX=j.x,b.overallVelocityY=j.y,b.overallVelocity=qa(j.x)>qa(j.y)?j.x:j.y,b.scale=g?K(g.pointers,d):1,b.rotation=g?J(g.pointers,d):0,b.maxPointers=c.prevInput?b.pointers.length>c.prevInput.maxPointers?b.pointers.length:c.prevInput.maxPointers:b.pointers.length,C(c,b);var k=a.element;o(b.srcEvent.target,k)&&(k=b.srcEvent.target),b.target=k}function B(a,b){var c=b.center,d=a.offsetDelta||{},e=a.prevDelta||{},f=a.prevInput||{};b.eventType!==Ea&&f.eventType!==Ga||(e=a.prevDelta={x:f.deltaX||0,y:f.deltaY||0},d=a.offsetDelta={x:c.x,y:c.y}),b.deltaX=e.x+(c.x-d.x),b.deltaY=e.y+(c.y-d.y)}function C(a,b){var c,e,f,g,h=a.lastInterval||b,i=b.timeStamp-h.timeStamp;if(b.eventType!=Ha&&(i>Da||h.velocity===d)){var j=b.deltaX-h.deltaX,k=b.deltaY-h.deltaY,l=F(i,j,k);e=l.x,f=l.y,c=qa(l.x)>qa(l.y)?l.x:l.y,g=G(j,k),a.lastInterval=b}else c=h.velocity,e=h.velocityX,f=h.velocityY,g=h.direction;b.velocity=c,b.velocityX=e,b.velocityY=f,b.direction=g}function D(a){for(var b=[],c=0;c<a.pointers.length;)b[c]={clientX:pa(a.pointers[c].clientX),clientY:pa(a.pointers[c].clientY)},c++;return{timeStamp:ra(),pointers:b,center:E(b),deltaX:a.deltaX,deltaY:a.deltaY}}function E(a){var b=a.length;if(1===b)return{x:pa(a[0].clientX),y:pa(a[0].clientY)};for(var c=0,d=0,e=0;b>e;)c+=a[e].clientX,d+=a[e].clientY,e++;return{x:pa(c/b),y:pa(d/b)}}function F(a,b,c){return{x:b/a||0,y:c/a||0}}function G(a,b){return a===b?Ia:qa(a)>=qa(b)?0>a?Ja:Ka:0>b?La:Ma}function H(a,b,c){c||(c=Qa);var d=b[c[0]]-a[c[0]],e=b[c[1]]-a[c[1]];return Math.sqrt(d*d+e*e)}function I(a,b,c){c||(c=Qa);var d=b[c[0]]-a[c[0]],e=b[c[1]]-a[c[1]];return 180*Math.atan2(e,d)/Math.PI}function J(a,b){return I(b[1],b[0],Ra)+I(a[1],a[0],Ra)}function K(a,b){return H(b[0],b[1],Ra)/H(a[0],a[1],Ra)}function L(){this.evEl=Ta,this.evWin=Ua,this.pressed=!1,x.apply(this,arguments)}function M(){this.evEl=Xa,this.evWin=Ya,x.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function N(){this.evTarget=$a,this.evWin=_a,this.started=!1,x.apply(this,arguments)}function O(a,b){var c=s(a.touches),d=s(a.changedTouches);return b&(Ga|Ha)&&(c=t(c.concat(d),"identifier",!0)),[c,d]}function P(){this.evTarget=bb,this.targetIds={},x.apply(this,arguments)}function Q(a,b){var c=s(a.touches),d=this.targetIds;if(b&(Ea|Fa)&&1===c.length)return d[c[0].identifier]=!0,[c,c];var e,f,g=s(a.changedTouches),h=[],i=this.target;if(f=c.filter(function(a){return o(a.target,i)}),b===Ea)for(e=0;e<f.length;)d[f[e].identifier]=!0,e++;for(e=0;e<g.length;)d[g[e].identifier]&&h.push(g[e]),b&(Ga|Ha)&&delete d[g[e].identifier],e++;return h.length?[t(f.concat(h),"identifier",!0),h]:void 0}function R(){x.apply(this,arguments);var a=j(this.handler,this);this.touch=new P(this.manager,a),this.mouse=new L(this.manager,a),this.primaryTouch=null,this.lastTouches=[]}function S(a,b){a&Ea?(this.primaryTouch=b.changedPointers[0].identifier,T.call(this,b)):a&(Ga|Ha)&&T.call(this,b)}function T(a){var b=a.changedPointers[0];if(b.identifier===this.primaryTouch){var c={x:b.clientX,y:b.clientY};this.lastTouches.push(c);var d=this.lastTouches,e=function(){var a=d.indexOf(c);a>-1&&d.splice(a,1)};setTimeout(e,cb)}}function U(a){for(var b=a.srcEvent.clientX,c=a.srcEvent.clientY,d=0;d<this.lastTouches.length;d++){var e=this.lastTouches[d],f=Math.abs(b-e.x),g=Math.abs(c-e.y);if(db>=f&&db>=g)return!0}return!1}function V(a,b){this.manager=a,this.set(b)}function W(a){if(p(a,jb))return jb;var b=p(a,kb),c=p(a,lb);return b&&c?jb:b||c?b?kb:lb:p(a,ib)?ib:hb}function X(){if(!fb)return!1;var b={},c=a.CSS&&a.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(d){b[d]=c?a.CSS.supports("touch-action",d):!0}),b}function Y(a){this.options=la({},this.defaults,a||{}),this.id=v(),this.manager=null,this.options.enable=l(this.options.enable,!0),this.state=nb,this.simultaneous={},this.requireFail=[]}function Z(a){return a&sb?"cancel":a&qb?"end":a&pb?"move":a&ob?"start":""}function $(a){return a==Ma?"down":a==La?"up":a==Ja?"left":a==Ka?"right":""}function _(a,b){var c=b.manager;return c?c.get(a):a}function aa(){Y.apply(this,arguments)}function ba(){aa.apply(this,arguments),this.pX=null,this.pY=null}function ca(){aa.apply(this,arguments)}function da(){Y.apply(this,arguments),this._timer=null,this._input=null}function ea(){aa.apply(this,arguments)}function fa(){aa.apply(this,arguments)}function ga(){Y.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function ha(a,b){return b=b||{},b.recognizers=l(b.recognizers,ha.defaults.preset),new ia(a,b)}function ia(a,b){this.options=la({},ha.defaults,b||{}),this.options.inputTarget=this.options.inputTarget||a,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=a,this.input=y(this),this.touchAction=new V(this,this.options.touchAction),ja(this,!0),g(this.options.recognizers,function(a){var b=this.add(new a[0](a[1]));a[2]&&b.recognizeWith(a[2]),a[3]&&b.requireFailure(a[3])},this)}function ja(a,b){var c=a.element;if(c.style){var d;g(a.options.cssProps,function(e,f){d=u(c.style,f),b?(a.oldCssProps[d]=c.style[d],c.style[d]=e):c.style[d]=a.oldCssProps[d]||""}),b||(a.oldCssProps={})}}function ka(a,c){var d=b.createEvent("Event");d.initEvent(a,!0,!0),d.gesture=c,c.target.dispatchEvent(d)}var la,ma=["","webkit","Moz","MS","ms","o"],na=b.createElement("div"),oa="function",pa=Math.round,qa=Math.abs,ra=Date.now;la="function"!=typeof Object.assign?function(a){if(a===d||null===a)throw new TypeError("Cannot convert undefined or null to object");for(var b=Object(a),c=1;c<arguments.length;c++){var e=arguments[c];if(e!==d&&null!==e)for(var f in e)e.hasOwnProperty(f)&&(b[f]=e[f])}return b}:Object.assign;var sa=h(function(a,b,c){for(var e=Object.keys(b),f=0;f<e.length;)(!c||c&&a[e[f]]===d)&&(a[e[f]]=b[e[f]]),f++;return a},"extend","Use `assign`."),ta=h(function(a,b){return sa(a,b,!0)},"merge","Use `assign`."),ua=1,va=/mobile|tablet|ip(ad|hone|od)|android/i,wa="ontouchstart"in a,xa=u(a,"PointerEvent")!==d,ya=wa&&va.test(navigator.userAgent),za="touch",Aa="pen",Ba="mouse",Ca="kinect",Da=25,Ea=1,Fa=2,Ga=4,Ha=8,Ia=1,Ja=2,Ka=4,La=8,Ma=16,Na=Ja|Ka,Oa=La|Ma,Pa=Na|Oa,Qa=["x","y"],Ra=["clientX","clientY"];x.prototype={handler:function(){},init:function(){this.evEl&&m(this.element,this.evEl,this.domHandler),this.evTarget&&m(this.target,this.evTarget,this.domHandler),this.evWin&&m(w(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&n(this.element,this.evEl,this.domHandler),this.evTarget&&n(this.target,this.evTarget,this.domHandler),this.evWin&&n(w(this.element),this.evWin,this.domHandler)}};var Sa={mousedown:Ea,mousemove:Fa,mouseup:Ga},Ta="mousedown",Ua="mousemove mouseup";i(L,x,{handler:function(a){var b=Sa[a.type];b&Ea&&0===a.button&&(this.pressed=!0),b&Fa&&1!==a.which&&(b=Ga),this.pressed&&(b&Ga&&(this.pressed=!1),this.callback(this.manager,b,{pointers:[a],changedPointers:[a],pointerType:Ba,srcEvent:a}))}});var Va={pointerdown:Ea,pointermove:Fa,pointerup:Ga,pointercancel:Ha,pointerout:Ha},Wa={2:za,3:Aa,4:Ba,5:Ca},Xa="pointerdown",Ya="pointermove pointerup pointercancel";a.MSPointerEvent&&!a.PointerEvent&&(Xa="MSPointerDown",Ya="MSPointerMove MSPointerUp MSPointerCancel"),i(M,x,{handler:function(a){var b=this.store,c=!1,d=a.type.toLowerCase().replace("ms",""),e=Va[d],f=Wa[a.pointerType]||a.pointerType,g=f==za,h=r(b,a.pointerId,"pointerId");e&Ea&&(0===a.button||g)?0>h&&(b.push(a),h=b.length-1):e&(Ga|Ha)&&(c=!0),0>h||(b[h]=a,this.callback(this.manager,e,{pointers:b,changedPointers:[a],pointerType:f,srcEvent:a}),c&&b.splice(h,1))}});var Za={touchstart:Ea,touchmove:Fa,touchend:Ga,touchcancel:Ha},$a="touchstart",_a="touchstart touchmove touchend touchcancel";i(N,x,{handler:function(a){var b=Za[a.type];if(b===Ea&&(this.started=!0),this.started){var c=O.call(this,a,b);b&(Ga|Ha)&&c[0].length-c[1].length===0&&(this.started=!1),this.callback(this.manager,b,{pointers:c[0],changedPointers:c[1],pointerType:za,srcEvent:a})}}});var ab={touchstart:Ea,touchmove:Fa,touchend:Ga,touchcancel:Ha},bb="touchstart touchmove touchend touchcancel";i(P,x,{handler:function(a){var b=ab[a.type],c=Q.call(this,a,b);c&&this.callback(this.manager,b,{pointers:c[0],changedPointers:c[1],pointerType:za,srcEvent:a})}});var cb=2500,db=25;i(R,x,{handler:function(a,b,c){var d=c.pointerType==za,e=c.pointerType==Ba;if(!(e&&c.sourceCapabilities&&c.sourceCapabilities.firesTouchEvents)){if(d)S.call(this,b,c);else if(e&&U.call(this,c))return;this.callback(a,b,c)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var eb=u(na.style,"touchAction"),fb=eb!==d,gb="compute",hb="auto",ib="manipulation",jb="none",kb="pan-x",lb="pan-y",mb=X();V.prototype={set:function(a){a==gb&&(a=this.compute()),fb&&this.manager.element.style&&mb[a]&&(this.manager.element.style[eb]=a),this.actions=a.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var a=[];return g(this.manager.recognizers,function(b){k(b.options.enable,[b])&&(a=a.concat(b.getTouchAction()))}),W(a.join(" "))},preventDefaults:function(a){var b=a.srcEvent,c=a.offsetDirection;if(this.manager.session.prevented)return void b.preventDefault();var d=this.actions,e=p(d,jb)&&!mb[jb],f=p(d,lb)&&!mb[lb],g=p(d,kb)&&!mb[kb];if(e){var h=1===a.pointers.length,i=a.distance<2,j=a.deltaTime<250;if(h&&i&&j)return}return g&&f?void 0:e||f&&c&Na||g&&c&Oa?this.preventSrc(b):void 0},preventSrc:function(a){this.manager.session.prevented=!0,a.preventDefault()}};var nb=1,ob=2,pb=4,qb=8,rb=qb,sb=16,tb=32;Y.prototype={defaults:{},set:function(a){return la(this.options,a),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(a){if(f(a,"recognizeWith",this))return this;var b=this.simultaneous;return a=_(a,this),b[a.id]||(b[a.id]=a,a.recognizeWith(this)),this},dropRecognizeWith:function(a){return f(a,"dropRecognizeWith",this)?this:(a=_(a,this),delete this.simultaneous[a.id],this)},requireFailure:function(a){if(f(a,"requireFailure",this))return this;var b=this.requireFail;return a=_(a,this),-1===r(b,a)&&(b.push(a),a.requireFailure(this)),this},dropRequireFailure:function(a){if(f(a,"dropRequireFailure",this))return this;a=_(a,this);var b=r(this.requireFail,a);return b>-1&&this.requireFail.splice(b,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(a){return!!this.simultaneous[a.id]},emit:function(a){function b(b){c.manager.emit(b,a)}var c=this,d=this.state;qb>d&&b(c.options.event+Z(d)),b(c.options.event),a.additionalEvent&&b(a.additionalEvent),d>=qb&&b(c.options.event+Z(d))},tryEmit:function(a){return this.canEmit()?this.emit(a):void(this.state=tb)},canEmit:function(){for(var a=0;a<this.requireFail.length;){if(!(this.requireFail[a].state&(tb|nb)))return!1;a++}return!0},recognize:function(a){var b=la({},a);return k(this.options.enable,[this,b])?(this.state&(rb|sb|tb)&&(this.state=nb),this.state=this.process(b),void(this.state&(ob|pb|qb|sb)&&this.tryEmit(b))):(this.reset(),void(this.state=tb))},process:function(a){},getTouchAction:function(){},reset:function(){}},i(aa,Y,{defaults:{pointers:1},attrTest:function(a){var b=this.options.pointers;return 0===b||a.pointers.length===b},process:function(a){var b=this.state,c=a.eventType,d=b&(ob|pb),e=this.attrTest(a);return d&&(c&Ha||!e)?b|sb:d||e?c&Ga?b|qb:b&ob?b|pb:ob:tb}}),i(ba,aa,{defaults:{event:"pan",threshold:10,pointers:1,direction:Pa},getTouchAction:function(){var a=this.options.direction,b=[];return a&Na&&b.push(lb),a&Oa&&b.push(kb),b},directionTest:function(a){var b=this.options,c=!0,d=a.distance,e=a.direction,f=a.deltaX,g=a.deltaY;return e&b.direction||(b.direction&Na?(e=0===f?Ia:0>f?Ja:Ka,c=f!=this.pX,d=Math.abs(a.deltaX)):(e=0===g?Ia:0>g?La:Ma,c=g!=this.pY,d=Math.abs(a.deltaY))),a.direction=e,c&&d>b.threshold&&e&b.direction},attrTest:function(a){return aa.prototype.attrTest.call(this,a)&&(this.state&ob||!(this.state&ob)&&this.directionTest(a))},emit:function(a){this.pX=a.deltaX,this.pY=a.deltaY;var b=$(a.direction);b&&(a.additionalEvent=this.options.event+b),this._super.emit.call(this,a)}}),i(ca,aa,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[jb]},attrTest:function(a){return this._super.attrTest.call(this,a)&&(Math.abs(a.scale-1)>this.options.threshold||this.state&ob)},emit:function(a){if(1!==a.scale){var b=a.scale<1?"in":"out";a.additionalEvent=this.options.event+b}this._super.emit.call(this,a)}}),i(da,Y,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[hb]},process:function(a){var b=this.options,c=a.pointers.length===b.pointers,d=a.distance<b.threshold,f=a.deltaTime>b.time;if(this._input=a,!d||!c||a.eventType&(Ga|Ha)&&!f)this.reset();else if(a.eventType&Ea)this.reset(),this._timer=e(function(){this.state=rb,this.tryEmit()},b.time,this);else if(a.eventType&Ga)return rb;return tb},reset:function(){clearTimeout(this._timer)},emit:function(a){this.state===rb&&(a&&a.eventType&Ga?this.manager.emit(this.options.event+"up",a):(this._input.timeStamp=ra(),this.manager.emit(this.options.event,this._input)))}}),i(ea,aa,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[jb]},attrTest:function(a){return this._super.attrTest.call(this,a)&&(Math.abs(a.rotation)>this.options.threshold||this.state&ob)}}),i(fa,aa,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Na|Oa,pointers:1},getTouchAction:function(){return ba.prototype.getTouchAction.call(this)},attrTest:function(a){var b,c=this.options.direction;return c&(Na|Oa)?b=a.overallVelocity:c&Na?b=a.overallVelocityX:c&Oa&&(b=a.overallVelocityY),this._super.attrTest.call(this,a)&&c&a.offsetDirection&&a.distance>this.options.threshold&&a.maxPointers==this.options.pointers&&qa(b)>this.options.velocity&&a.eventType&Ga},emit:function(a){var b=$(a.offsetDirection);b&&this.manager.emit(this.options.event+b,a),this.manager.emit(this.options.event,a)}}),i(ga,Y,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[ib]},process:function(a){var b=this.options,c=a.pointers.length===b.pointers,d=a.distance<b.threshold,f=a.deltaTime<b.time;if(this.reset(),a.eventType&Ea&&0===this.count)return this.failTimeout();if(d&&f&&c){if(a.eventType!=Ga)return this.failTimeout();var g=this.pTime?a.timeStamp-this.pTime<b.interval:!0,h=!this.pCenter||H(this.pCenter,a.center)<b.posThreshold;this.pTime=a.timeStamp,this.pCenter=a.center,h&&g?this.count+=1:this.count=1,this._input=a;var i=this.count%b.taps;if(0===i)return this.hasRequireFailures()?(this._timer=e(function(){this.state=rb,this.tryEmit()},b.interval,this),ob):rb}return tb},failTimeout:function(){return this._timer=e(function(){this.state=tb},this.options.interval,this),tb},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==rb&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),ha.VERSION="2.0.8",ha.defaults={domEvents:!1,touchAction:gb,enable:!0,inputTarget:null,inputClass:null,preset:[[ea,{enable:!1}],[ca,{enable:!1},["rotate"]],[fa,{direction:Na}],[ba,{direction:Na},["swipe"]],[ga],[ga,{event:"doubletap",taps:2},["tap"]],[da]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var ub=1,vb=2;ia.prototype={set:function(a){return la(this.options,a),a.touchAction&&this.touchAction.update(),a.inputTarget&&(this.input.destroy(),this.input.target=a.inputTarget,this.input.init()),this},stop:function(a){this.session.stopped=a?vb:ub},recognize:function(a){var b=this.session;if(!b.stopped){this.touchAction.preventDefaults(a);var c,d=this.recognizers,e=b.curRecognizer;(!e||e&&e.state&rb)&&(e=b.curRecognizer=null);for(var f=0;f<d.length;)c=d[f],b.stopped===vb||e&&c!=e&&!c.canRecognizeWith(e)?c.reset():c.recognize(a),!e&&c.state&(ob|pb|qb)&&(e=b.curRecognizer=c),f++}},get:function(a){if(a instanceof Y)return a;for(var b=this.recognizers,c=0;c<b.length;c++)if(b[c].options.event==a)return b[c];return null},add:function(a){if(f(a,"add",this))return this;var b=this.get(a.options.event);return b&&this.remove(b),this.recognizers.push(a),a.manager=this,this.touchAction.update(),a},remove:function(a){if(f(a,"remove",this))return this;if(a=this.get(a)){var b=this.recognizers,c=r(b,a);-1!==c&&(b.splice(c,1),this.touchAction.update())}return this},on:function(a,b){if(a!==d&&b!==d){var c=this.handlers;return g(q(a),function(a){c[a]=c[a]||[],c[a].push(b)}),this}},off:function(a,b){if(a!==d){var c=this.handlers;return g(q(a),function(a){b?c[a]&&c[a].splice(r(c[a],b),1):delete c[a]}),this}},emit:function(a,b){this.options.domEvents&&ka(a,b);var c=this.handlers[a]&&this.handlers[a].slice();if(c&&c.length){b.type=a,b.preventDefault=function(){b.srcEvent.preventDefault()};for(var d=0;d<c.length;)c[d](b),d++}},destroy:function(){this.element&&ja(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},la(ha,{INPUT_START:Ea,INPUT_MOVE:Fa,INPUT_END:Ga,INPUT_CANCEL:Ha,STATE_POSSIBLE:nb,STATE_BEGAN:ob,STATE_CHANGED:pb,STATE_ENDED:qb,STATE_RECOGNIZED:rb,STATE_CANCELLED:sb,STATE_FAILED:tb,DIRECTION_NONE:Ia,DIRECTION_LEFT:Ja,DIRECTION_RIGHT:Ka,DIRECTION_UP:La,DIRECTION_DOWN:Ma,DIRECTION_HORIZONTAL:Na,DIRECTION_VERTICAL:Oa,DIRECTION_ALL:Pa,Manager:ia,Input:x,TouchAction:V,TouchInput:P,MouseInput:L,PointerEventInput:M,TouchMouseInput:R,SingleTouchInput:N,Recognizer:Y,AttrRecognizer:aa,Tap:ga,Pan:ba,Swipe:fa,Pinch:ca,Rotate:ea,Press:da,on:m,off:n,each:g,merge:ta,extend:sa,assign:la,inherit:i,bindFn:j,prefixed:u});var wb="undefined"!=typeof a?a:"undefined"!=typeof self?self:{};wb.Hammer=ha,"function"==typeof define&&define.amd?define(function(){return ha}):"undefined"!=typeof module&&module.exports?module.exports=ha:a[c]=ha}(window,document,"Hammer");
//# sourceMappingURL=hammer.min.js.map
mindmap_kityminder_1.0.0.2035/libs/kityminder-core/kity.js
/*!
* ====================================================
* kity - v2.0.5 - 2015-11-12
* https://github.com/fex-team/kity
* GitHub: https://github.com/fex-team/kity.git
* Copyright (c) 2015 Baidu FEX; Licensed BSD
* ====================================================
*/
(function () {
var _p = {
r: function (index) {
if (_p[index].inited) {
return _p[index].value;
}
if (typeof _p[index].value === 'function') {
var module = {
exports: {}
}, returnValue = _p[index].value(null, module.exports, module);
_p[index].inited = true;
_p[index].value = returnValue;
if (returnValue !== undefined) {
return returnValue;
} else {
for (var key in module.exports) {
if (module.exports.hasOwnProperty(key)) {
_p[index].inited = true;
_p[index].value = module.exports;
return module.exports;
}
}
}
} else {
_p[index].inited = true;
return _p[index].value;
}
}
};
//src/animate/animator.js
/**
* @fileOverview
*
* 提供基本的动画支持
*/
_p[0] = {
value: function (require) {
function parseTime (str) {
var value = parseFloat(str, 10);
if (/ms/.test(str)) {
return value;
}
if (/s/.test(str)) {
return value * 1e3;
}
if (/min/.test(str)) {
return value * 60 * 1e3;
}
return value;
}
var Timeline = _p.r(8);
var easingTable = _p.r(1);
/**
* @class kity.Animator
* @catalog animate
* @description 表示一个动画启动器,可以作用于不同的对象进行动画
*/
var Animator = _p.r(11).createClass('Animator', {
/**
* @constructor
* @for kity.Animator
* @catalog animate
*
* @grammar new kity.Animator(beginValue, finishValue, setter)
* @grammar new kity.Animator(option)
*
* @param {any} beginValue|opt.beginValue
* 动画的起始值,允许的类型有数字、数组、字面量、kity.Point、kity.Vector、kity.Box、kity.Matrix
*
* @param {any} finishValue|opt.beginValue
* 动画的结束值,类型应于起始值相同
*
* @param {Function} setter|opt.setter
* 值的使用函数,接受三个参数: function(target, value, timeline)
* target {object} 动画的目标
* value {any} 动画的当前值
* timeline {kity.Timeline} 动画当前的时间线对象
*/
constructor: function (beginValue, finishValue, setter) {
if (arguments.length == 1) {
var opt = arguments[0];
this.beginValue = opt.beginValue;
this.finishValue = opt.finishValue;
this.setter = opt.setter;
} else {
this.beginValue = beginValue;
this.finishValue = finishValue;
this.setter = setter;
}
},
/**
* @method start()
* @for kity.Animator
* @description 使用当前的动画器启动在指定目标上启动动画
*
* @grammar start(target, duration, easing, delay, callback) => {kity.Timeline}
* @grammar start(target, option) => {kity.Timeline}
*
* @param {object} target
* 启动动画的目标
*
* @param {Number|String} duration|option.duration
* [Optional] 动画的持续时间,如 300、"300ms"、"1.5min"
*
* @param {String|Function} easing|option.easing
* [Optional] 动画使用的缓动函数,如 "ease"、"linear"、"swing"
*
$$