diff --git a/_config.yml b/_config.yml
new file mode 100644
index 0000000..2f7efbe
--- /dev/null
+++ b/_config.yml
@@ -0,0 +1 @@
+theme: jekyll-theme-minimal
\ No newline at end of file
diff --git a/index.html b/index.html
index 5bb45f4..f1328a9 100644
--- a/index.html
+++ b/index.html
@@ -1,6 +1,39 @@
-
+-->
+
+
+
+
+
+
+
+
+ StringSpliter Blog
+
+
+
+ Grow your business
+ Get your business discovered on TikTok
+ Get Started
+ Reach your target customers and drive results quickly with TikTok Ads Manager. With our large audience base and easy-to-use tools, anyone can be a marketing expert.
+ Don't Make Ads. Make TikToks.
+ Create An TikTok for Business Account
+ ** Recommandation from StringSpliter.
+ Flollow Me
+ https://github.com/StringSpliter/
+
+
+
+
+
diff --git a/js/ZeroClipboard.Core.js b/js/ZeroClipboard.Core.js
new file mode 100644
index 0000000..4c49d47
--- /dev/null
+++ b/js/ZeroClipboard.Core.js
@@ -0,0 +1,2144 @@
+/*!
+ * ZeroClipboard
+ * The ZeroClipboard library provides an easy way to copy text to the clipboard using an invisible Adobe Flash movie and a JavaScript interface
+ * Copyright (c) 2009-2017 Jon Rohan, James M. Greene
+ * Licensed MIT
+ * http://zeroclipboard.github.io/
+ * v2.4.0-beta.1
+ */
+(function(window, undefined) {
+ "use strict";
+ /**
+ * Store references to critically important global functions that may be
+ * overridden on certain web pages.
+ */
+ var _window = window, _document = _window.document, _navigator = _window.navigator, _setTimeout = _window.setTimeout, _clearTimeout = _window.clearTimeout, _setInterval = _window.setInterval, _clearInterval = _window.clearInterval, _getComputedStyle = _window.getComputedStyle, _encodeURIComponent = _window.encodeURIComponent, _ActiveXObject = _window.ActiveXObject, _Error = _window.Error, _parseInt = _window.Number.parseInt || _window.parseInt, _parseFloat = _window.Number.parseFloat || _window.parseFloat, _isNaN = _window.Number.isNaN || _window.isNaN, _now = _window.Date.now, _keys = _window.Object.keys, _hasOwn = _window.Object.prototype.hasOwnProperty, _slice = _window.Array.prototype.slice, _unwrap = function() {
+ var unwrapper = function(el) {
+ return el;
+ };
+ if (typeof _window.wrap === "function" && typeof _window.unwrap === "function") {
+ try {
+ var div = _document.createElement("div");
+ var unwrappedDiv = _window.unwrap(div);
+ if (div.nodeType === 1 && unwrappedDiv && unwrappedDiv.nodeType === 1) {
+ unwrapper = _window.unwrap;
+ }
+ } catch (e) {}
+ }
+ return unwrapper;
+ }();
+ /**
+ * Convert an `arguments` object into an Array.
+ *
+ * @returns The arguments as an Array
+ * @private
+ */
+ var _args = function(argumentsObj) {
+ return _slice.call(argumentsObj, 0);
+ };
+ /**
+ * Shallow-copy the owned, enumerable properties of one object over to another, similar to jQuery's `$.extend`.
+ *
+ * @returns The target object, augmented
+ * @private
+ */
+ var _extend = function() {
+ var i, len, arg, prop, src, copy, args = _args(arguments), target = args[0] || {};
+ for (i = 1, len = args.length; i < len; i++) {
+ if ((arg = args[i]) != null) {
+ for (prop in arg) {
+ if (_hasOwn.call(arg, prop)) {
+ src = target[prop];
+ copy = arg[prop];
+ if (target !== copy && copy !== undefined) {
+ target[prop] = copy;
+ }
+ }
+ }
+ }
+ }
+ return target;
+ };
+ /**
+ * Return a deep copy of the source object or array.
+ *
+ * @returns Object or Array
+ * @private
+ */
+ var _deepCopy = function(source) {
+ var copy, i, len, prop;
+ if (typeof source !== "object" || source == null || typeof source.nodeType === "number") {
+ copy = source;
+ } else if (typeof source.length === "number") {
+ copy = [];
+ for (i = 0, len = source.length; i < len; i++) {
+ if (_hasOwn.call(source, i)) {
+ copy[i] = _deepCopy(source[i]);
+ }
+ }
+ } else {
+ copy = {};
+ for (prop in source) {
+ if (_hasOwn.call(source, prop)) {
+ copy[prop] = _deepCopy(source[prop]);
+ }
+ }
+ }
+ return copy;
+ };
+ /**
+ * Makes a shallow copy of `obj` (like `_extend`) but filters its properties based on a list of `keys` to keep.
+ * The inverse of `_omit`, mostly. The big difference is that these properties do NOT need to be enumerable to
+ * be kept.
+ *
+ * @returns A new filtered object.
+ * @private
+ */
+ var _pick = function(obj, keys) {
+ var newObj = {};
+ for (var i = 0, len = keys.length; i < len; i++) {
+ if (keys[i] in obj) {
+ newObj[keys[i]] = obj[keys[i]];
+ }
+ }
+ return newObj;
+ };
+ /**
+ * Makes a shallow copy of `obj` (like `_extend`) but filters its properties based on a list of `keys` to omit.
+ * The inverse of `_pick`.
+ *
+ * @returns A new filtered object.
+ * @private
+ */
+ var _omit = function(obj, keys) {
+ var newObj = {};
+ for (var prop in obj) {
+ if (keys.indexOf(prop) === -1) {
+ newObj[prop] = obj[prop];
+ }
+ }
+ return newObj;
+ };
+ /**
+ * Remove all owned, enumerable properties from an object.
+ *
+ * @returns The original object without its owned, enumerable properties.
+ * @private
+ */
+ var _deleteOwnProperties = function(obj) {
+ if (obj) {
+ for (var prop in obj) {
+ if (_hasOwn.call(obj, prop)) {
+ delete obj[prop];
+ }
+ }
+ }
+ return obj;
+ };
+ /**
+ * Determine if an element is contained within another element.
+ *
+ * @returns Boolean
+ * @private
+ */
+ var _containedBy = function(el, ancestorEl) {
+ if (el && el.nodeType === 1 && el.ownerDocument && ancestorEl && (ancestorEl.nodeType === 1 && ancestorEl.ownerDocument && ancestorEl.ownerDocument === el.ownerDocument || ancestorEl.nodeType === 9 && !ancestorEl.ownerDocument && ancestorEl === el.ownerDocument)) {
+ do {
+ if (el === ancestorEl) {
+ return true;
+ }
+ el = el.parentNode;
+ } while (el);
+ }
+ return false;
+ };
+ /**
+ * Get the URL path's parent directory.
+ *
+ * @returns String or `undefined`
+ * @private
+ */
+ var _getDirPathOfUrl = function(url) {
+ var dir;
+ if (typeof url === "string" && url) {
+ dir = url.split("#")[0].split("?")[0];
+ dir = url.slice(0, url.lastIndexOf("/") + 1);
+ }
+ return dir;
+ };
+ /**
+ * Get the current script's URL by throwing an `Error` and analyzing it.
+ *
+ * @returns String or `undefined`
+ * @private
+ */
+ var _getCurrentScriptUrlFromErrorStack = function(stack) {
+ var url, matches;
+ if (typeof stack === "string" && stack) {
+ matches = stack.match(/^(?:|[^:@]*@|.+\)@(?=http[s]?|file)|.+?\s+(?: at |@)(?:[^:\(]+ )*[\(]?)((?:http[s]?|file):\/\/[\/]?.+?\/[^:\)]*?)(?::\d+)(?::\d+)?/);
+ if (matches && matches[1]) {
+ url = matches[1];
+ } else {
+ matches = stack.match(/\)@((?:http[s]?|file):\/\/[\/]?.+?\/[^:\)]*?)(?::\d+)(?::\d+)?/);
+ if (matches && matches[1]) {
+ url = matches[1];
+ }
+ }
+ }
+ return url;
+ };
+ /**
+ * Get the current script's URL by throwing an `Error` and analyzing it.
+ *
+ * @returns String or `undefined`
+ * @private
+ */
+ var _getCurrentScriptUrlFromError = function() {
+ var url, err;
+ try {
+ throw new _Error();
+ } catch (e) {
+ err = e;
+ }
+ if (err) {
+ url = err.sourceURL || err.fileName || _getCurrentScriptUrlFromErrorStack(err.stack);
+ }
+ return url;
+ };
+ /**
+ * Get the current script's URL.
+ *
+ * @returns String or `undefined`
+ * @private
+ */
+ var _getCurrentScriptUrl = function() {
+ var jsPath, scripts, i;
+ if (_document.currentScript && (jsPath = _document.currentScript.src)) {
+ return jsPath;
+ }
+ scripts = _document.getElementsByTagName("script");
+ if (scripts.length === 1) {
+ return scripts[0].src || undefined;
+ }
+ if ("readyState" in (scripts[0] || document.createElement("script"))) {
+ for (i = scripts.length; i--; ) {
+ if (scripts[i].readyState === "interactive" && (jsPath = scripts[i].src)) {
+ return jsPath;
+ }
+ }
+ }
+ if (_document.readyState === "loading" && (jsPath = scripts[scripts.length - 1].src)) {
+ return jsPath;
+ }
+ if (jsPath = _getCurrentScriptUrlFromError()) {
+ return jsPath;
+ }
+ return undefined;
+ };
+ /**
+ * Get the unanimous parent directory of ALL script tags.
+ * If any script tags are either (a) inline or (b) from differing parent
+ * directories, this method must return `undefined`.
+ *
+ * @returns String or `undefined`
+ * @private
+ */
+ var _getUnanimousScriptParentDir = function() {
+ var i, jsDir, jsPath, scripts = _document.getElementsByTagName("script");
+ for (i = scripts.length; i--; ) {
+ if (!(jsPath = scripts[i].src)) {
+ jsDir = null;
+ break;
+ }
+ jsPath = _getDirPathOfUrl(jsPath);
+ if (jsDir == null) {
+ jsDir = jsPath;
+ } else if (jsDir !== jsPath) {
+ jsDir = null;
+ break;
+ }
+ }
+ return jsDir || undefined;
+ };
+ /**
+ * Get the presumed location of the "ZeroClipboard.swf" file, based on the location
+ * of the executing JavaScript file (e.g. "ZeroClipboard.js", etc.).
+ *
+ * @returns String
+ * @private
+ */
+ var _getDefaultSwfPath = function() {
+ var jsDir = _getDirPathOfUrl(_getCurrentScriptUrl()) || _getUnanimousScriptParentDir() || "";
+ return jsDir + "ZeroClipboard.swf";
+ };
+ /**
+ * Is the client's operating system some version of Windows?
+ *
+ * @returns Boolean
+ * @private
+ */
+ var _isWindows = function() {
+ var isWindowsRegex = /win(dows|[\s]?(nt|me|ce|xp|vista|[\d]+))/i;
+ return !!_navigator && (isWindowsRegex.test(_navigator.appVersion || "") || isWindowsRegex.test(_navigator.platform || "") || (_navigator.userAgent || "").indexOf("Windows") !== -1);
+ };
+ /**
+ * Keep track of if the page is framed (in an `iframe`). This can never change.
+ * @private
+ */
+ var _pageIsFramed = function() {
+ return _window.opener == null && (!!_window.top && _window != _window.top || !!_window.parent && _window != _window.parent);
+ }();
+ /**
+ * Keep track of if the page is XHTML (vs. HTML), which requires that everything
+ * be rendering in XML mode.
+ * @private
+ */
+ var _pageIsXhtml = _document.documentElement.nodeName === "html";
+ /**
+ * Keep track of the state of the Flash object.
+ * @private
+ */
+ var _flashState = {
+ bridge: null,
+ version: "0.0.0",
+ pluginType: "unknown",
+ sandboxed: null,
+ disabled: null,
+ outdated: null,
+ insecure: null,
+ unavailable: null,
+ degraded: null,
+ deactivated: null,
+ overdue: null,
+ ready: null
+ };
+ /**
+ * The minimum Flash Player version required to use ZeroClipboard completely.
+ * @readonly
+ * @private
+ */
+ var _minimumFlashVersion = "11.0.0";
+ /**
+ * The ZeroClipboard library version number, as reported by Flash, at the time the SWF was compiled.
+ */
+ var _zcSwfVersion;
+ /**
+ * Keep track of all event listener registrations.
+ * @private
+ */
+ var _handlers = {};
+ /**
+ * Keep track of the currently activated element.
+ * @private
+ */
+ var _currentElement;
+ /**
+ * Keep track of the element that was activated when a `copy` process started.
+ * @private
+ */
+ var _copyTarget;
+ /**
+ * Keep track of data for the pending clipboard transaction.
+ * @private
+ */
+ var _clipData = {};
+ /**
+ * Keep track of data formats for the pending clipboard transaction.
+ * @private
+ */
+ var _clipDataFormatMap = null;
+ /**
+ * Keep track of the Flash availability check timeout.
+ * @private
+ */
+ var _flashCheckTimeout = 0;
+ /**
+ * Keep track of SWF network errors interval polling.
+ * @private
+ */
+ var _swfFallbackCheckInterval = 0;
+ /**
+ * The `message` store for events
+ * @private
+ */
+ var _eventMessages = {
+ ready: "Flash communication is established",
+ error: {
+ "flash-sandboxed": "Attempting to run Flash in a sandboxed iframe, which is impossible",
+ "flash-disabled": "Flash is disabled or not installed. May also be attempting to run Flash in a sandboxed iframe, which is impossible.",
+ "flash-outdated": "Flash is too outdated to support ZeroClipboard",
+ "flash-insecure": "Flash will be unable to communicate due to a protocol mismatch between your `swfPath` configuration and the page",
+ "flash-unavailable": "Flash is unable to communicate bidirectionally with JavaScript",
+ "flash-degraded": "Flash is unable to preserve data fidelity when communicating with JavaScript",
+ "flash-deactivated": "Flash is too outdated for your browser and/or is configured as click-to-activate.\nThis may also mean that the ZeroClipboard SWF object could not be loaded, so please check your `swfPath` configuration and/or network connectivity.\nMay also be attempting to run Flash in a sandboxed iframe, which is impossible.",
+ "flash-overdue": "Flash communication was established but NOT within the acceptable time limit",
+ "version-mismatch": "ZeroClipboard JS version number does not match ZeroClipboard SWF version number",
+ "clipboard-error": "At least one error was thrown while ZeroClipboard was attempting to inject your data into the clipboard",
+ "config-mismatch": "ZeroClipboard configuration does not match Flash's reality",
+ "swf-not-found": "The ZeroClipboard SWF object could not be loaded, so please check your `swfPath` configuration and/or network connectivity",
+ "browser-unsupported": "The browser does not support the required HTML DOM and JavaScript features"
+ }
+ };
+ /**
+ * The `name`s of `error` events that can only occur is Flash has at least
+ * been able to load the SWF successfully.
+ * @private
+ */
+ var _errorsThatOnlyOccurAfterFlashLoads = [ "flash-unavailable", "flash-degraded", "flash-overdue", "version-mismatch", "config-mismatch", "clipboard-error" ];
+ /**
+ * The `name`s of `error` events that should likely result in the `_flashState`
+ * variable's property values being updated.
+ * @private
+ */
+ var _flashStateErrorNames = [ "flash-sandboxed", "flash-disabled", "flash-outdated", "flash-insecure", "flash-unavailable", "flash-degraded", "flash-deactivated", "flash-overdue" ];
+ /**
+ * A RegExp to match the `name` property of `error` events related to Flash.
+ * @private
+ */
+ var _flashStateErrorNameMatchingRegex = new RegExp("^flash-(" + _flashStateErrorNames.map(function(errorName) {
+ return errorName.replace(/^flash-/, "");
+ }).join("|") + ")$");
+ /**
+ * A RegExp to match the `name` property of `error` events related to Flash,
+ * which is enabled.
+ * @private
+ */
+ var _flashStateEnabledErrorNameMatchingRegex = new RegExp("^flash-(" + _flashStateErrorNames.filter(function(errorName) {
+ return errorName !== "flash-disabled";
+ }).map(function(errorName) {
+ return errorName.replace(/^flash-/, "");
+ }).join("|") + ")$");
+ /**
+ * ZeroClipboard configuration defaults for the Core module.
+ * @private
+ */
+ var _globalConfig = {
+ swfPath: _getDefaultSwfPath(),
+ trustedDomains: _window.location.host ? [ _window.location.host ] : [],
+ cacheBust: true,
+ forceEnhancedClipboard: false,
+ flashLoadTimeout: 3e4,
+ autoActivate: true,
+ bubbleEvents: true,
+ fixLineEndings: true,
+ containerId: "global-zeroclipboard-html-bridge",
+ containerClass: "global-zeroclipboard-container",
+ swfObjectId: "global-zeroclipboard-flash-bridge",
+ hoverClass: "zeroclipboard-is-hover",
+ activeClass: "zeroclipboard-is-active",
+ forceHandCursor: false,
+ title: null,
+ zIndex: 999999999
+ };
+ /**
+ * The underlying implementation of `ZeroClipboard.config`.
+ * @private
+ */
+ var _config = function(options) {
+ if (typeof options === "object" && options && !("length" in options)) {
+ _keys(options).forEach(function(prop) {
+ if (/^(?:forceHandCursor|title|zIndex|bubbleEvents|fixLineEndings)$/.test(prop)) {
+ _globalConfig[prop] = options[prop];
+ } else if (_flashState.bridge == null) {
+ if (prop === "containerId" || prop === "swfObjectId") {
+ if (_isValidHtml4Id(options[prop])) {
+ _globalConfig[prop] = options[prop];
+ } else {
+ throw new Error("The specified `" + prop + "` value is not valid as an HTML4 Element ID");
+ }
+ } else {
+ _globalConfig[prop] = options[prop];
+ }
+ }
+ });
+ }
+ if (typeof options === "string" && options) {
+ if (_hasOwn.call(_globalConfig, options)) {
+ return _globalConfig[options];
+ }
+ return;
+ }
+ return _deepCopy(_globalConfig);
+ };
+ /**
+ * The underlying implementation of `ZeroClipboard.state`.
+ * @private
+ */
+ var _state = function() {
+ _detectSandbox();
+ return {
+ browser: _extend(_pick(_navigator, [ "userAgent", "platform", "appName", "appVersion" ]), {
+ isSupported: _isBrowserSupported()
+ }),
+ flash: _omit(_flashState, [ "bridge" ]),
+ zeroclipboard: {
+ version: ZeroClipboard.version,
+ config: ZeroClipboard.config()
+ }
+ };
+ };
+ /**
+ * Does this browser support all of the necessary DOM and JS features necessary?
+ * @private
+ */
+ var _isBrowserSupported = function() {
+ return !!(_document.addEventListener && _window.Object.keys && _window.Array.prototype.map);
+ };
+ /**
+ * The underlying implementation of `ZeroClipboard.isFlashUnusable`.
+ * @private
+ */
+ var _isFlashUnusable = function() {
+ return !!(_flashState.sandboxed || _flashState.disabled || _flashState.outdated || _flashState.unavailable || _flashState.degraded || _flashState.deactivated);
+ };
+ /**
+ * The underlying implementation of `ZeroClipboard.on`.
+ * @private
+ */
+ var _on = function(eventType, listener) {
+ var i, len, events, added = {};
+ if (typeof eventType === "string" && eventType) {
+ events = eventType.toLowerCase().split(/\s+/);
+ } else if (typeof eventType === "object" && eventType && !("length" in eventType) && typeof listener === "undefined") {
+ _keys(eventType).forEach(function(key) {
+ var listener = eventType[key];
+ if (typeof listener === "function") {
+ ZeroClipboard.on(key, listener);
+ }
+ });
+ }
+ if (events && events.length && listener) {
+ for (i = 0, len = events.length; i < len; i++) {
+ eventType = events[i].replace(/^on/, "");
+ added[eventType] = true;
+ if (!_handlers[eventType]) {
+ _handlers[eventType] = [];
+ }
+ _handlers[eventType].push(listener);
+ }
+ if (added.ready && _flashState.ready) {
+ ZeroClipboard.emit({
+ type: "ready"
+ });
+ }
+ if (added.error) {
+ if (!_isBrowserSupported()) {
+ ZeroClipboard.emit({
+ type: "error",
+ name: "browser-unsupported"
+ });
+ }
+ for (i = 0, len = _flashStateErrorNames.length; i < len; i++) {
+ if (_flashState[_flashStateErrorNames[i].replace(/^flash-/, "")] === true) {
+ ZeroClipboard.emit({
+ type: "error",
+ name: _flashStateErrorNames[i]
+ });
+ break;
+ }
+ }
+ if (_zcSwfVersion !== undefined && ZeroClipboard.version !== _zcSwfVersion) {
+ ZeroClipboard.emit({
+ type: "error",
+ name: "version-mismatch",
+ jsVersion: ZeroClipboard.version,
+ swfVersion: _zcSwfVersion
+ });
+ }
+ }
+ }
+ return ZeroClipboard;
+ };
+ /**
+ * The underlying implementation of `ZeroClipboard.off`.
+ * @private
+ */
+ var _off = function(eventType, listener) {
+ var i, len, foundIndex, events, perEventHandlers;
+ if (arguments.length === 0) {
+ events = _keys(_handlers);
+ } else if (typeof eventType === "string" && eventType) {
+ events = eventType.toLowerCase().split(/\s+/);
+ } else if (typeof eventType === "object" && eventType && !("length" in eventType) && typeof listener === "undefined") {
+ _keys(eventType).forEach(function(key) {
+ var listener = eventType[key];
+ if (typeof listener === "function") {
+ ZeroClipboard.off(key, listener);
+ }
+ });
+ }
+ if (events && events.length) {
+ for (i = 0, len = events.length; i < len; i++) {
+ eventType = events[i].replace(/^on/, "");
+ perEventHandlers = _handlers[eventType];
+ if (perEventHandlers && perEventHandlers.length) {
+ if (listener) {
+ foundIndex = perEventHandlers.indexOf(listener);
+ while (foundIndex !== -1) {
+ perEventHandlers.splice(foundIndex, 1);
+ foundIndex = perEventHandlers.indexOf(listener, foundIndex);
+ }
+ } else {
+ perEventHandlers.length = 0;
+ }
+ }
+ }
+ }
+ return ZeroClipboard;
+ };
+ /**
+ * The underlying implementation of `ZeroClipboard.handlers`.
+ * @private
+ */
+ var _listeners = function(eventType) {
+ var copy;
+ if (typeof eventType === "string" && eventType) {
+ copy = _deepCopy(_handlers[eventType]) || null;
+ } else {
+ copy = _deepCopy(_handlers);
+ }
+ return copy;
+ };
+ /**
+ * The underlying implementation of `ZeroClipboard.emit`.
+ * @private
+ */
+ var _emit = function(event) {
+ var eventCopy, returnVal, tmp;
+ event = _createEvent(event);
+ if (!event) {
+ return;
+ }
+ if (_preprocessEvent(event)) {
+ return;
+ }
+ if (event.type === "ready" && _flashState.overdue === true) {
+ return ZeroClipboard.emit({
+ type: "error",
+ name: "flash-overdue"
+ });
+ }
+ eventCopy = _extend({}, event);
+ _dispatchCallbacks.call(this, eventCopy);
+ if (event.type === "copy") {
+ tmp = _mapClipDataToFlash(_clipData);
+ returnVal = tmp.data;
+ _clipDataFormatMap = tmp.formatMap;
+ }
+ return returnVal;
+ };
+ /**
+ * Get the protocol of the configured SWF path.
+ * @private
+ */
+ var _getSwfPathProtocol = function() {
+ var swfPath = _globalConfig.swfPath || "", swfPathFirstTwoChars = swfPath.slice(0, 2), swfProtocol = swfPath.slice(0, swfPath.indexOf("://") + 1);
+ return swfPathFirstTwoChars === "\\\\" ? "file:" : swfPathFirstTwoChars === "//" || swfProtocol === "" ? _window.location.protocol : swfProtocol;
+ };
+ /**
+ * The underlying implementation of `ZeroClipboard.create`.
+ * @private
+ */
+ var _create = function() {
+ var maxWait, swfProtocol, previousState = _flashState.sandboxed;
+ if (!_isBrowserSupported()) {
+ _flashState.ready = false;
+ ZeroClipboard.emit({
+ type: "error",
+ name: "browser-unsupported"
+ });
+ return;
+ }
+ _detectSandbox();
+ if (typeof _flashState.ready !== "boolean") {
+ _flashState.ready = false;
+ }
+ if (_flashState.sandboxed !== previousState && _flashState.sandboxed === true) {
+ _flashState.ready = false;
+ ZeroClipboard.emit({
+ type: "error",
+ name: "flash-sandboxed"
+ });
+ } else if (!ZeroClipboard.isFlashUnusable() && _flashState.bridge === null) {
+ swfProtocol = _getSwfPathProtocol();
+ if (swfProtocol && swfProtocol !== _window.location.protocol) {
+ ZeroClipboard.emit({
+ type: "error",
+ name: "flash-insecure"
+ });
+ } else {
+ maxWait = _globalConfig.flashLoadTimeout;
+ if (typeof maxWait === "number" && maxWait >= 0) {
+ _flashCheckTimeout = _setTimeout(function() {
+ if (typeof _flashState.deactivated !== "boolean") {
+ _flashState.deactivated = true;
+ }
+ if (_flashState.deactivated === true) {
+ ZeroClipboard.emit({
+ type: "error",
+ name: "flash-deactivated"
+ });
+ }
+ }, maxWait);
+ }
+ _flashState.overdue = false;
+ _embedSwf();
+ }
+ }
+ };
+ /**
+ * The underlying implementation of `ZeroClipboard.destroy`.
+ * @private
+ */
+ var _destroy = function() {
+ ZeroClipboard.clearData();
+ ZeroClipboard.blur();
+ ZeroClipboard.emit("destroy");
+ _unembedSwf();
+ ZeroClipboard.off();
+ };
+ /**
+ * The underlying implementation of `ZeroClipboard.setData`.
+ * @private
+ */
+ var _setData = function(format, data) {
+ var dataObj;
+ if (typeof format === "object" && format && typeof data === "undefined") {
+ dataObj = format;
+ ZeroClipboard.clearData();
+ } else if (typeof format === "string" && format) {
+ dataObj = {};
+ dataObj[format] = data;
+ } else {
+ return;
+ }
+ for (var dataFormat in dataObj) {
+ if (typeof dataFormat === "string" && dataFormat && _hasOwn.call(dataObj, dataFormat) && typeof dataObj[dataFormat] === "string" && dataObj[dataFormat]) {
+ _clipData[dataFormat] = _fixLineEndings(dataObj[dataFormat]);
+ }
+ }
+ };
+ /**
+ * The underlying implementation of `ZeroClipboard.clearData`.
+ * @private
+ */
+ var _clearData = function(format) {
+ if (typeof format === "undefined") {
+ _deleteOwnProperties(_clipData);
+ _clipDataFormatMap = null;
+ } else if (typeof format === "string" && _hasOwn.call(_clipData, format)) {
+ delete _clipData[format];
+ }
+ };
+ /**
+ * The underlying implementation of `ZeroClipboard.getData`.
+ * @private
+ */
+ var _getData = function(format) {
+ if (typeof format === "undefined") {
+ return _deepCopy(_clipData);
+ } else if (typeof format === "string" && _hasOwn.call(_clipData, format)) {
+ return _clipData[format];
+ }
+ };
+ /**
+ * The underlying implementation of `ZeroClipboard.focus`/`ZeroClipboard.activate`.
+ * @private
+ */
+ var _focus = function(element) {
+ if (!(element && element.nodeType === 1)) {
+ return;
+ }
+ if (_currentElement) {
+ _removeClass(_currentElement, _globalConfig.activeClass);
+ if (_currentElement !== element) {
+ _removeClass(_currentElement, _globalConfig.hoverClass);
+ }
+ }
+ _currentElement = element;
+ _addClass(element, _globalConfig.hoverClass);
+ var newTitle = element.getAttribute("title") || _globalConfig.title;
+ if (typeof newTitle === "string" && newTitle) {
+ var htmlBridge = _getHtmlBridge(_flashState.bridge);
+ if (htmlBridge) {
+ htmlBridge.setAttribute("title", newTitle);
+ }
+ }
+ var useHandCursor = _globalConfig.forceHandCursor === true || _getStyle(element, "cursor") === "pointer";
+ _setHandCursor(useHandCursor);
+ _reposition();
+ };
+ /**
+ * The underlying implementation of `ZeroClipboard.blur`/`ZeroClipboard.deactivate`.
+ * @private
+ */
+ var _blur = function() {
+ var htmlBridge = _getHtmlBridge(_flashState.bridge);
+ if (htmlBridge) {
+ htmlBridge.removeAttribute("title");
+ htmlBridge.style.left = "0px";
+ htmlBridge.style.top = "-9999px";
+ htmlBridge.style.width = "1px";
+ htmlBridge.style.height = "1px";
+ }
+ if (_currentElement) {
+ _removeClass(_currentElement, _globalConfig.hoverClass);
+ _removeClass(_currentElement, _globalConfig.activeClass);
+ _currentElement = null;
+ }
+ };
+ /**
+ * The underlying implementation of `ZeroClipboard.activeElement`.
+ * @private
+ */
+ var _activeElement = function() {
+ return _currentElement || null;
+ };
+ /**
+ * Check if a value is a valid HTML4 `ID` or `Name` token.
+ * @private
+ */
+ var _isValidHtml4Id = function(id) {
+ return typeof id === "string" && id && /^[A-Za-z][A-Za-z0-9_:\-\.]*$/.test(id);
+ };
+ /**
+ * Create or update an `event` object, based on the `eventType`.
+ * @private
+ */
+ var _createEvent = function(event) {
+ var eventType;
+ if (typeof event === "string" && event) {
+ eventType = event;
+ event = {};
+ } else if (typeof event === "object" && event && typeof event.type === "string" && event.type) {
+ eventType = event.type;
+ }
+ if (!eventType) {
+ return;
+ }
+ eventType = eventType.toLowerCase();
+ if (!event.target && (/^(copy|aftercopy|_click)$/.test(eventType) || eventType === "error" && event.name === "clipboard-error")) {
+ event.target = _copyTarget;
+ }
+ _extend(event, {
+ type: eventType,
+ target: event.target || _currentElement || null,
+ relatedTarget: event.relatedTarget || null,
+ currentTarget: _flashState && _flashState.bridge || null,
+ timeStamp: event.timeStamp || _now() || null
+ });
+ var msg = _eventMessages[event.type];
+ if (event.type === "error" && event.name && msg) {
+ msg = msg[event.name];
+ }
+ if (msg) {
+ event.message = msg;
+ }
+ if (event.type === "ready") {
+ _extend(event, {
+ target: null,
+ version: _flashState.version
+ });
+ }
+ if (event.type === "error") {
+ if (_flashStateErrorNameMatchingRegex.test(event.name)) {
+ _extend(event, {
+ target: null,
+ minimumVersion: _minimumFlashVersion
+ });
+ }
+ if (_flashStateEnabledErrorNameMatchingRegex.test(event.name)) {
+ _extend(event, {
+ version: _flashState.version
+ });
+ }
+ if (event.name === "flash-insecure") {
+ _extend(event, {
+ pageProtocol: _window.location.protocol,
+ swfProtocol: _getSwfPathProtocol()
+ });
+ }
+ }
+ if (event.type === "copy") {
+ event.clipboardData = {
+ setData: ZeroClipboard.setData,
+ clearData: ZeroClipboard.clearData
+ };
+ }
+ if (event.type === "aftercopy") {
+ event = _mapClipResultsFromFlash(event, _clipDataFormatMap);
+ }
+ if (event.target && !event.relatedTarget) {
+ event.relatedTarget = _getRelatedTarget(event.target);
+ }
+ return _addMouseData(event);
+ };
+ /**
+ * Get a relatedTarget from the target's `data-clipboard-target` attribute
+ * @private
+ */
+ var _getRelatedTarget = function(targetEl) {
+ var relatedTargetId = targetEl && targetEl.getAttribute && targetEl.getAttribute("data-clipboard-target");
+ return relatedTargetId ? _document.getElementById(relatedTargetId) : null;
+ };
+ /**
+ * Add element and position data to `MouseEvent` instances
+ * @private
+ */
+ var _addMouseData = function(event) {
+ if (event && /^_(?:click|mouse(?:over|out|down|up|move))$/.test(event.type)) {
+ var srcElement = event.target;
+ var fromElement = event.type === "_mouseover" && event.relatedTarget ? event.relatedTarget : undefined;
+ var toElement = event.type === "_mouseout" && event.relatedTarget ? event.relatedTarget : undefined;
+ var pos = _getElementPosition(srcElement);
+ var screenLeft = _window.screenLeft || _window.screenX || 0;
+ var screenTop = _window.screenTop || _window.screenY || 0;
+ var scrollLeft = _document.body.scrollLeft + _document.documentElement.scrollLeft;
+ var scrollTop = _document.body.scrollTop + _document.documentElement.scrollTop;
+ var pageX = pos.left + (typeof event._stageX === "number" ? event._stageX : 0);
+ var pageY = pos.top + (typeof event._stageY === "number" ? event._stageY : 0);
+ var clientX = pageX - scrollLeft;
+ var clientY = pageY - scrollTop;
+ var screenX = screenLeft + clientX;
+ var screenY = screenTop + clientY;
+ var moveX = typeof event.movementX === "number" ? event.movementX : 0;
+ var moveY = typeof event.movementY === "number" ? event.movementY : 0;
+ delete event._stageX;
+ delete event._stageY;
+ _extend(event, {
+ srcElement: srcElement,
+ fromElement: fromElement,
+ toElement: toElement,
+ screenX: screenX,
+ screenY: screenY,
+ pageX: pageX,
+ pageY: pageY,
+ clientX: clientX,
+ clientY: clientY,
+ x: clientX,
+ y: clientY,
+ movementX: moveX,
+ movementY: moveY,
+ offsetX: 0,
+ offsetY: 0,
+ layerX: 0,
+ layerY: 0
+ });
+ }
+ return event;
+ };
+ /**
+ * Determine if an event's registered handlers should be execute synchronously or asynchronously.
+ *
+ * @returns {boolean}
+ * @private
+ */
+ var _shouldPerformAsync = function(event) {
+ var eventType = event && typeof event.type === "string" && event.type || "";
+ return !/^(?:(?:before)?copy|destroy)$/.test(eventType);
+ };
+ /**
+ * Control if a callback should be executed asynchronously or not.
+ *
+ * @returns `undefined`
+ * @private
+ */
+ var _dispatchCallback = function(func, context, args, async) {
+ if (async) {
+ _setTimeout(function() {
+ func.apply(context, args);
+ }, 0);
+ } else {
+ func.apply(context, args);
+ }
+ };
+ /**
+ * Handle the actual dispatching of events to client instances.
+ *
+ * @returns `undefined`
+ * @private
+ */
+ var _dispatchCallbacks = function(event) {
+ if (!(typeof event === "object" && event && event.type)) {
+ return;
+ }
+ var async = _shouldPerformAsync(event);
+ var wildcardTypeHandlers = _handlers["*"] || [];
+ var specificTypeHandlers = _handlers[event.type] || [];
+ var handlers = wildcardTypeHandlers.concat(specificTypeHandlers);
+ if (handlers && handlers.length) {
+ var i, len, func, context, eventCopy, originalContext = this;
+ for (i = 0, len = handlers.length; i < len; i++) {
+ func = handlers[i];
+ context = originalContext;
+ if (typeof func === "string" && typeof _window[func] === "function") {
+ func = _window[func];
+ }
+ if (typeof func === "object" && func && typeof func.handleEvent === "function") {
+ context = func;
+ func = func.handleEvent;
+ }
+ if (typeof func === "function") {
+ eventCopy = _extend({}, event);
+ _dispatchCallback(func, context, [ eventCopy ], async);
+ }
+ }
+ }
+ return this;
+ };
+ /**
+ * Check an `error` event's `name` property to see if Flash has
+ * already loaded, which rules out possible `iframe` sandboxing.
+ * @private
+ */
+ var _getSandboxStatusFromErrorEvent = function(event) {
+ var isSandboxed = null;
+ if (_pageIsFramed === false || event && event.type === "error" && event.name && _errorsThatOnlyOccurAfterFlashLoads.indexOf(event.name) !== -1) {
+ isSandboxed = false;
+ }
+ return isSandboxed;
+ };
+ /**
+ * Preprocess any special behaviors, reactions, or state changes after receiving this event.
+ * Executes only once per event emitted, NOT once per client.
+ * @private
+ */
+ var _preprocessEvent = function(event) {
+ var element = event.target || _currentElement || null;
+ var sourceIsSwf = event._source === "swf";
+ delete event._source;
+ switch (event.type) {
+ case "error":
+ var isSandboxed = event.name === "flash-sandboxed" || _getSandboxStatusFromErrorEvent(event);
+ if (typeof isSandboxed === "boolean") {
+ _flashState.sandboxed = isSandboxed;
+ }
+ if (event.name === "browser-unsupported") {
+ _extend(_flashState, {
+ disabled: false,
+ outdated: false,
+ unavailable: false,
+ degraded: false,
+ deactivated: false,
+ overdue: false,
+ ready: false
+ });
+ } else if (_flashStateErrorNames.indexOf(event.name) !== -1) {
+ _extend(_flashState, {
+ disabled: event.name === "flash-disabled",
+ outdated: event.name === "flash-outdated",
+ insecure: event.name === "flash-insecure",
+ unavailable: event.name === "flash-unavailable",
+ degraded: event.name === "flash-degraded",
+ deactivated: event.name === "flash-deactivated",
+ overdue: event.name === "flash-overdue",
+ ready: false
+ });
+ } else if (event.name === "version-mismatch") {
+ _zcSwfVersion = event.swfVersion;
+ _extend(_flashState, {
+ disabled: false,
+ outdated: false,
+ insecure: false,
+ unavailable: false,
+ degraded: false,
+ deactivated: false,
+ overdue: false,
+ ready: false
+ });
+ }
+ _clearTimeoutsAndPolling();
+ break;
+
+ case "ready":
+ _zcSwfVersion = event.swfVersion;
+ var wasDeactivated = _flashState.deactivated === true;
+ _extend(_flashState, {
+ sandboxed: false,
+ disabled: false,
+ outdated: false,
+ insecure: false,
+ unavailable: false,
+ degraded: false,
+ deactivated: false,
+ overdue: wasDeactivated,
+ ready: !wasDeactivated
+ });
+ _clearTimeoutsAndPolling();
+ break;
+
+ case "beforecopy":
+ _copyTarget = element;
+ break;
+
+ case "copy":
+ var textContent, htmlContent, targetEl = event.relatedTarget;
+ if (!(_clipData["text/html"] || _clipData["text/plain"]) && targetEl && (htmlContent = targetEl.value || targetEl.outerHTML || targetEl.innerHTML) && (textContent = targetEl.value || targetEl.textContent || targetEl.innerText)) {
+ event.clipboardData.clearData();
+ event.clipboardData.setData("text/plain", textContent);
+ if (htmlContent !== textContent) {
+ event.clipboardData.setData("text/html", htmlContent);
+ }
+ } else if (!_clipData["text/plain"] && event.target && (textContent = event.target.getAttribute("data-clipboard-text"))) {
+ event.clipboardData.clearData();
+ event.clipboardData.setData("text/plain", textContent);
+ }
+ break;
+
+ case "aftercopy":
+ _queueEmitClipboardErrors(event);
+ ZeroClipboard.clearData();
+ if (element && element !== _safeActiveElement() && element.focus) {
+ element.focus();
+ }
+ break;
+
+ case "_mouseover":
+ ZeroClipboard.focus(element);
+ if (_globalConfig.bubbleEvents === true && sourceIsSwf) {
+ if (element && element !== event.relatedTarget && !_containedBy(event.relatedTarget, element)) {
+ _fireMouseEvent(_extend({}, event, {
+ type: "mouseenter",
+ bubbles: false,
+ cancelable: false
+ }));
+ }
+ _fireMouseEvent(_extend({}, event, {
+ type: "mouseover"
+ }));
+ }
+ break;
+
+ case "_mouseout":
+ ZeroClipboard.blur();
+ if (_globalConfig.bubbleEvents === true && sourceIsSwf) {
+ if (element && element !== event.relatedTarget && !_containedBy(event.relatedTarget, element)) {
+ _fireMouseEvent(_extend({}, event, {
+ type: "mouseleave",
+ bubbles: false,
+ cancelable: false
+ }));
+ }
+ _fireMouseEvent(_extend({}, event, {
+ type: "mouseout"
+ }));
+ }
+ break;
+
+ case "_mousedown":
+ _addClass(element, _globalConfig.activeClass);
+ if (_globalConfig.bubbleEvents === true && sourceIsSwf) {
+ _fireMouseEvent(_extend({}, event, {
+ type: event.type.slice(1)
+ }));
+ }
+ break;
+
+ case "_mouseup":
+ _removeClass(element, _globalConfig.activeClass);
+ if (_globalConfig.bubbleEvents === true && sourceIsSwf) {
+ _fireMouseEvent(_extend({}, event, {
+ type: event.type.slice(1)
+ }));
+ }
+ break;
+
+ case "_click":
+ _copyTarget = null;
+ if (_globalConfig.bubbleEvents === true && sourceIsSwf) {
+ _fireMouseEvent(_extend({}, event, {
+ type: event.type.slice(1)
+ }));
+ }
+ break;
+
+ case "_mousemove":
+ if (_globalConfig.bubbleEvents === true && sourceIsSwf) {
+ _fireMouseEvent(_extend({}, event, {
+ type: event.type.slice(1)
+ }));
+ }
+ break;
+ }
+ if (/^_(?:click|mouse(?:over|out|down|up|move))$/.test(event.type)) {
+ return true;
+ }
+ };
+ /**
+ * Check an "aftercopy" event for clipboard errors and emit a corresponding "error" event.
+ * @private
+ */
+ var _queueEmitClipboardErrors = function(aftercopyEvent) {
+ if (aftercopyEvent.errors && aftercopyEvent.errors.length > 0) {
+ var errorEvent = _deepCopy(aftercopyEvent);
+ _extend(errorEvent, {
+ type: "error",
+ name: "clipboard-error"
+ });
+ delete errorEvent.success;
+ _setTimeout(function() {
+ ZeroClipboard.emit(errorEvent);
+ }, 0);
+ }
+ };
+ /**
+ * Dispatch a synthetic MouseEvent.
+ *
+ * @returns `undefined`
+ * @private
+ */
+ var _fireMouseEvent = function(event) {
+ if (!(event && typeof event.type === "string" && event)) {
+ return;
+ }
+ var e, target = event.target || null, doc = target && target.ownerDocument || _document, defaults = {
+ view: doc.defaultView || _window,
+ canBubble: true,
+ cancelable: true,
+ detail: event.type === "click" ? 1 : 0,
+ button: typeof event.which === "number" ? event.which - 1 : typeof event.button === "number" ? event.button : doc.createEvent ? 0 : 1
+ }, args = _extend(defaults, event);
+ if (!target) {
+ return;
+ }
+ if (doc.createEvent && target.dispatchEvent) {
+ args = [ args.type, args.canBubble, args.cancelable, args.view, args.detail, args.screenX, args.screenY, args.clientX, args.clientY, args.ctrlKey, args.altKey, args.shiftKey, args.metaKey, args.button, args.relatedTarget ];
+ e = doc.createEvent("MouseEvents");
+ if (e.initMouseEvent) {
+ e.initMouseEvent.apply(e, args);
+ e._source = "js";
+ target.dispatchEvent(e);
+ }
+ }
+ };
+ /**
+ * Continuously poll the DOM until either:
+ * (a) the fallback content becomes visible, or
+ * (b) we receive an event from SWF (handled elsewhere)
+ *
+ * IMPORTANT:
+ * This is NOT a necessary check but it can result in significantly faster
+ * detection of bad `swfPath` configuration and/or network/server issues [in
+ * supported browsers] than waiting for the entire `flashLoadTimeout` duration
+ * to elapse before detecting that the SWF cannot be loaded. The detection
+ * duration can be anywhere from 10-30 times faster [in supported browsers] by
+ * using this approach.
+ *
+ * @returns `undefined`
+ * @private
+ */
+ var _watchForSwfFallbackContent = function() {
+ var maxWait = _globalConfig.flashLoadTimeout;
+ if (typeof maxWait === "number" && maxWait >= 0) {
+ var pollWait = Math.min(1e3, maxWait / 10);
+ var fallbackContentId = _globalConfig.swfObjectId + "_fallbackContent";
+ _swfFallbackCheckInterval = _setInterval(function() {
+ var el = _document.getElementById(fallbackContentId);
+ if (_isElementVisible(el)) {
+ _clearTimeoutsAndPolling();
+ _flashState.deactivated = null;
+ ZeroClipboard.emit({
+ type: "error",
+ name: "swf-not-found"
+ });
+ }
+ }, pollWait);
+ }
+ };
+ /**
+ * Create the HTML bridge element to embed the Flash object into.
+ * @private
+ */
+ var _createHtmlBridge = function() {
+ var container = _document.createElement("div");
+ container.id = _globalConfig.containerId;
+ container.className = _globalConfig.containerClass;
+ container.style.position = "absolute";
+ container.style.left = "0px";
+ container.style.top = "-9999px";
+ container.style.width = "1px";
+ container.style.height = "1px";
+ container.style.zIndex = "" + _getSafeZIndex(_globalConfig.zIndex);
+ return container;
+ };
+ /**
+ * Get the HTML element container that wraps the Flash bridge object/element.
+ * @private
+ */
+ var _getHtmlBridge = function(flashBridge) {
+ var htmlBridge = flashBridge && flashBridge.parentNode;
+ while (htmlBridge && htmlBridge.nodeName === "OBJECT" && htmlBridge.parentNode) {
+ htmlBridge = htmlBridge.parentNode;
+ }
+ return htmlBridge || null;
+ };
+ /**
+ *
+ * @private
+ */
+ var _escapeXmlValue = function(val) {
+ if (typeof val !== "string" || !val) {
+ return val;
+ }
+ return val.replace(/["&'<>]/g, function(chr) {
+ switch (chr) {
+ case '"':
+ return """;
+
+ case "&":
+ return "&";
+
+ case "'":
+ return "'";
+
+ case "<":
+ return "<";
+
+ case ">":
+ return ">";
+
+ default:
+ return chr;
+ }
+ });
+ };
+ /**
+ * Create the SWF object.
+ *
+ * @returns The SWF object reference.
+ * @private
+ */
+ var _embedSwf = function() {
+ var len, flashBridge = _flashState.bridge, container = _getHtmlBridge(flashBridge);
+ if (!flashBridge) {
+ var allowScriptAccess = _determineScriptAccess(_window.location.host, _globalConfig);
+ var allowNetworking = allowScriptAccess === "never" ? "none" : "all";
+ var flashvars = _vars(_extend({
+ jsVersion: ZeroClipboard.version
+ }, _globalConfig));
+ var swfUrl = _globalConfig.swfPath + _cacheBust(_globalConfig.swfPath, _globalConfig);
+ if (_pageIsXhtml) {
+ swfUrl = _escapeXmlValue(swfUrl);
+ }
+ container = _createHtmlBridge();
+ var divToBeReplaced = _document.createElement("div");
+ container.appendChild(divToBeReplaced);
+ _document.body.appendChild(container);
+ var tmpDiv = _document.createElement("div");
+ var usingActiveX = _flashState.pluginType === "activex";
+ tmpDiv.innerHTML = '" + (usingActiveX ? ' ' : "") + ' ' + ' ' + ' ' + ' ' + ' ' + '
' + " ";
+ flashBridge = tmpDiv.firstChild;
+ tmpDiv = null;
+ _unwrap(flashBridge).ZeroClipboard = ZeroClipboard;
+ container.replaceChild(flashBridge, divToBeReplaced);
+ _watchForSwfFallbackContent();
+ }
+ if (!flashBridge) {
+ flashBridge = _document[_globalConfig.swfObjectId];
+ if (flashBridge && (len = flashBridge.length)) {
+ flashBridge = flashBridge[len - 1];
+ }
+ if (!flashBridge && container) {
+ flashBridge = container.firstChild;
+ }
+ }
+ _flashState.bridge = flashBridge || null;
+ return flashBridge;
+ };
+ /**
+ * Destroy the SWF object.
+ * @private
+ */
+ var _unembedSwf = function() {
+ var flashBridge = _flashState.bridge;
+ if (flashBridge) {
+ var htmlBridge = _getHtmlBridge(flashBridge);
+ if (htmlBridge) {
+ if (_flashState.pluginType === "activex" && "readyState" in flashBridge) {
+ flashBridge.style.display = "none";
+ (function removeSwfFromIE() {
+ if (flashBridge.readyState === 4) {
+ for (var prop in flashBridge) {
+ if (typeof flashBridge[prop] === "function") {
+ flashBridge[prop] = null;
+ }
+ }
+ if (flashBridge.parentNode) {
+ flashBridge.parentNode.removeChild(flashBridge);
+ }
+ if (htmlBridge.parentNode) {
+ htmlBridge.parentNode.removeChild(htmlBridge);
+ }
+ } else {
+ _setTimeout(removeSwfFromIE, 10);
+ }
+ })();
+ } else {
+ if (flashBridge.parentNode) {
+ flashBridge.parentNode.removeChild(flashBridge);
+ }
+ if (htmlBridge.parentNode) {
+ htmlBridge.parentNode.removeChild(htmlBridge);
+ }
+ }
+ }
+ _clearTimeoutsAndPolling();
+ _flashState.ready = null;
+ _flashState.bridge = null;
+ _flashState.deactivated = null;
+ _flashState.insecure = null;
+ _zcSwfVersion = undefined;
+ }
+ };
+ /**
+ * Map the data format names of the "clipData" to Flash-friendly names.
+ *
+ * @returns A new transformed object.
+ * @private
+ */
+ var _mapClipDataToFlash = function(clipData) {
+ var newClipData = {}, formatMap = {};
+ if (!(typeof clipData === "object" && clipData)) {
+ return;
+ }
+ for (var dataFormat in clipData) {
+ if (dataFormat && _hasOwn.call(clipData, dataFormat) && typeof clipData[dataFormat] === "string" && clipData[dataFormat]) {
+ switch (dataFormat.toLowerCase()) {
+ case "text/plain":
+ case "text":
+ case "air:text":
+ case "flash:text":
+ newClipData.text = clipData[dataFormat];
+ formatMap.text = dataFormat;
+ break;
+
+ case "text/html":
+ case "html":
+ case "air:html":
+ case "flash:html":
+ newClipData.html = clipData[dataFormat];
+ formatMap.html = dataFormat;
+ break;
+
+ case "application/rtf":
+ case "text/rtf":
+ case "rtf":
+ case "richtext":
+ case "air:rtf":
+ case "flash:rtf":
+ newClipData.rtf = clipData[dataFormat];
+ formatMap.rtf = dataFormat;
+ break;
+
+ default:
+ break;
+ }
+ }
+ }
+ return {
+ data: newClipData,
+ formatMap: formatMap
+ };
+ };
+ /**
+ * Map the data format names from Flash-friendly names back to their original "clipData" names (via a format mapping).
+ *
+ * @returns A new transformed object.
+ * @private
+ */
+ var _mapClipResultsFromFlash = function(clipResults, formatMap) {
+ if (!(typeof clipResults === "object" && clipResults && typeof formatMap === "object" && formatMap)) {
+ return clipResults;
+ }
+ var newResults = {};
+ for (var prop in clipResults) {
+ if (_hasOwn.call(clipResults, prop)) {
+ if (prop === "errors") {
+ newResults[prop] = clipResults[prop] ? clipResults[prop].slice() : [];
+ for (var i = 0, len = newResults[prop].length; i < len; i++) {
+ newResults[prop][i].format = formatMap[newResults[prop][i].format];
+ }
+ } else if (prop !== "success" && prop !== "data") {
+ newResults[prop] = clipResults[prop];
+ } else {
+ newResults[prop] = {};
+ var tmpHash = clipResults[prop];
+ for (var dataFormat in tmpHash) {
+ if (dataFormat && _hasOwn.call(tmpHash, dataFormat) && _hasOwn.call(formatMap, dataFormat)) {
+ newResults[prop][formatMap[dataFormat]] = tmpHash[dataFormat];
+ }
+ }
+ }
+ }
+ }
+ return newResults;
+ };
+ /**
+ * Will look at a path, and will create a "?noCache={time}" or "&noCache={time}"
+ * query param string to return. Does NOT append that string to the original path.
+ * This is useful because ExternalInterface often breaks when a Flash SWF is cached.
+ *
+ * @returns The `noCache` query param with necessary "?"/"&" prefix.
+ * @private
+ */
+ var _cacheBust = function(path, options) {
+ var cacheBust = options == null || options && options.cacheBust === true;
+ if (cacheBust) {
+ return (path.indexOf("?") === -1 ? "?" : "&") + "noCache=" + _now();
+ } else {
+ return "";
+ }
+ };
+ /**
+ * Creates a query string for the FlashVars param.
+ * Does NOT include the cache-busting query param.
+ *
+ * @returns FlashVars query string
+ * @private
+ */
+ var _vars = function(options) {
+ var i, len, domain, domains, str = "", trustedOriginsExpanded = [];
+ if (options.trustedDomains) {
+ if (typeof options.trustedDomains === "string") {
+ domains = [ options.trustedDomains ];
+ } else if (typeof options.trustedDomains === "object" && "length" in options.trustedDomains) {
+ domains = options.trustedDomains;
+ }
+ }
+ if (domains && domains.length) {
+ for (i = 0, len = domains.length; i < len; i++) {
+ if (_hasOwn.call(domains, i) && domains[i] && typeof domains[i] === "string") {
+ domain = _extractDomain(domains[i]);
+ if (!domain) {
+ continue;
+ }
+ if (domain === "*") {
+ trustedOriginsExpanded.length = 0;
+ trustedOriginsExpanded.push(domain);
+ break;
+ }
+ trustedOriginsExpanded.push.apply(trustedOriginsExpanded, [ domain, "//" + domain, _window.location.protocol + "//" + domain ]);
+ }
+ }
+ }
+ if (trustedOriginsExpanded.length) {
+ str += "trustedOrigins=" + _encodeURIComponent(trustedOriginsExpanded.join(","));
+ }
+ if (options.forceEnhancedClipboard === true) {
+ str += (str ? "&" : "") + "forceEnhancedClipboard=true";
+ }
+ if (typeof options.swfObjectId === "string" && options.swfObjectId) {
+ str += (str ? "&" : "") + "swfObjectId=" + _encodeURIComponent(options.swfObjectId);
+ }
+ if (typeof options.jsVersion === "string" && options.jsVersion) {
+ str += (str ? "&" : "") + "jsVersion=" + _encodeURIComponent(options.jsVersion);
+ }
+ return str;
+ };
+ /**
+ * Extract the domain (e.g. "github.com") from an origin (e.g. "https://github.com") or
+ * URL (e.g. "https://github.com/zeroclipboard/zeroclipboard/").
+ *
+ * @returns the domain
+ * @private
+ */
+ var _extractDomain = function(originOrUrl) {
+ if (originOrUrl == null || originOrUrl === "") {
+ return null;
+ }
+ originOrUrl = originOrUrl.replace(/^\s+|\s+$/g, "");
+ if (originOrUrl === "") {
+ return null;
+ }
+ var protocolIndex = originOrUrl.indexOf("//");
+ originOrUrl = protocolIndex === -1 ? originOrUrl : originOrUrl.slice(protocolIndex + 2);
+ var pathIndex = originOrUrl.indexOf("/");
+ originOrUrl = pathIndex === -1 ? originOrUrl : protocolIndex === -1 || pathIndex === 0 ? null : originOrUrl.slice(0, pathIndex);
+ if (originOrUrl && originOrUrl.slice(-4).toLowerCase() === ".swf") {
+ return null;
+ }
+ return originOrUrl || null;
+ };
+ /**
+ * Set `allowScriptAccess` based on `trustedDomains` and `window.location.host` vs. `swfPath`.
+ *
+ * @returns The appropriate script access level.
+ * @private
+ */
+ var _determineScriptAccess = function() {
+ var _extractAllDomains = function(origins) {
+ var i, len, tmp, resultsArray = [];
+ if (typeof origins === "string") {
+ origins = [ origins ];
+ }
+ if (!(typeof origins === "object" && origins && typeof origins.length === "number")) {
+ return resultsArray;
+ }
+ for (i = 0, len = origins.length; i < len; i++) {
+ if (_hasOwn.call(origins, i) && (tmp = _extractDomain(origins[i]))) {
+ if (tmp === "*") {
+ resultsArray.length = 0;
+ resultsArray.push("*");
+ break;
+ }
+ if (resultsArray.indexOf(tmp) === -1) {
+ resultsArray.push(tmp);
+ }
+ }
+ }
+ return resultsArray;
+ };
+ return function(currentDomain, configOptions) {
+ var swfDomain = _extractDomain(configOptions.swfPath);
+ if (swfDomain === null) {
+ swfDomain = currentDomain;
+ }
+ var trustedDomains = _extractAllDomains(configOptions.trustedDomains);
+ var len = trustedDomains.length;
+ if (len > 0) {
+ if (len === 1 && trustedDomains[0] === "*") {
+ return "always";
+ }
+ if (trustedDomains.indexOf(currentDomain) !== -1) {
+ if (len === 1 && currentDomain === swfDomain) {
+ return "sameDomain";
+ }
+ return "always";
+ }
+ }
+ return "never";
+ };
+ }();
+ /**
+ * Get the currently active/focused DOM element.
+ *
+ * @returns the currently active/focused element, or `null`
+ * @private
+ */
+ var _safeActiveElement = function() {
+ try {
+ return _document.activeElement;
+ } catch (err) {
+ return null;
+ }
+ };
+ /**
+ * Add a class to an element, if it doesn't already have it.
+ *
+ * @returns The element, with its new class added.
+ * @private
+ */
+ var _addClass = function(element, value) {
+ var c, cl, className, classNames = [];
+ if (typeof value === "string" && value) {
+ classNames = value.split(/\s+/);
+ }
+ if (element && element.nodeType === 1 && classNames.length > 0) {
+ className = (" " + (element.className || "") + " ").replace(/[\t\r\n\f]/g, " ");
+ for (c = 0, cl = classNames.length; c < cl; c++) {
+ if (className.indexOf(" " + classNames[c] + " ") === -1) {
+ className += classNames[c] + " ";
+ }
+ }
+ className = className.replace(/^\s+|\s+$/g, "");
+ if (className !== element.className) {
+ element.className = className;
+ }
+ }
+ return element;
+ };
+ /**
+ * Remove a class from an element, if it has it.
+ *
+ * @returns The element, with its class removed.
+ * @private
+ */
+ var _removeClass = function(element, value) {
+ var c, cl, className, classNames = [];
+ if (typeof value === "string" && value) {
+ classNames = value.split(/\s+/);
+ }
+ if (element && element.nodeType === 1 && classNames.length > 0) {
+ if (element.className) {
+ className = (" " + element.className + " ").replace(/[\t\r\n\f]/g, " ");
+ for (c = 0, cl = classNames.length; c < cl; c++) {
+ className = className.replace(" " + classNames[c] + " ", " ");
+ }
+ className = className.replace(/^\s+|\s+$/g, "");
+ if (className !== element.className) {
+ element.className = className;
+ }
+ }
+ }
+ return element;
+ };
+ /**
+ * Attempt to interpret the element's CSS styling. If `prop` is `"cursor"`,
+ * then we assume that it should be a hand ("pointer") cursor if the element
+ * is an anchor element ("a" tag).
+ *
+ * @returns The computed style property.
+ * @private
+ */
+ var _getStyle = function(el, prop) {
+ var value = _getComputedStyle(el, null).getPropertyValue(prop);
+ if (prop === "cursor") {
+ if (!value || value === "auto") {
+ if (el.nodeName === "A") {
+ return "pointer";
+ }
+ }
+ }
+ return value;
+ };
+ /**
+ * Get the absolutely positioned coordinates of a DOM element.
+ *
+ * @returns Object containing the element's position, width, and height.
+ * @private
+ */
+ var _getElementPosition = function(el) {
+ var pos = {
+ left: 0,
+ top: 0,
+ width: 0,
+ height: 0
+ };
+ if (el.getBoundingClientRect) {
+ var elRect = el.getBoundingClientRect();
+ var pageXOffset = _window.pageXOffset;
+ var pageYOffset = _window.pageYOffset;
+ var leftBorderWidth = _document.documentElement.clientLeft || 0;
+ var topBorderWidth = _document.documentElement.clientTop || 0;
+ var leftBodyOffset = 0;
+ var topBodyOffset = 0;
+ if (_getStyle(_document.body, "position") === "relative") {
+ var bodyRect = _document.body.getBoundingClientRect();
+ var htmlRect = _document.documentElement.getBoundingClientRect();
+ leftBodyOffset = bodyRect.left - htmlRect.left || 0;
+ topBodyOffset = bodyRect.top - htmlRect.top || 0;
+ }
+ pos.left = elRect.left + pageXOffset - leftBorderWidth - leftBodyOffset;
+ pos.top = elRect.top + pageYOffset - topBorderWidth - topBodyOffset;
+ pos.width = "width" in elRect ? elRect.width : elRect.right - elRect.left;
+ pos.height = "height" in elRect ? elRect.height : elRect.bottom - elRect.top;
+ }
+ return pos;
+ };
+ /**
+ * Determine is an element is visible somewhere within the document (page).
+ *
+ * @returns Boolean
+ * @private
+ */
+ var _isElementVisible = function(el) {
+ if (!el) {
+ return false;
+ }
+ var styles = _getComputedStyle(el, null);
+ if (!styles) {
+ return false;
+ }
+ var hasCssHeight = _parseFloat(styles.height) > 0;
+ var hasCssWidth = _parseFloat(styles.width) > 0;
+ var hasCssTop = _parseFloat(styles.top) >= 0;
+ var hasCssLeft = _parseFloat(styles.left) >= 0;
+ var cssKnows = hasCssHeight && hasCssWidth && hasCssTop && hasCssLeft;
+ var rect = cssKnows ? null : _getElementPosition(el);
+ var isVisible = styles.display !== "none" && styles.visibility !== "collapse" && (cssKnows || !!rect && (hasCssHeight || rect.height > 0) && (hasCssWidth || rect.width > 0) && (hasCssTop || rect.top >= 0) && (hasCssLeft || rect.left >= 0));
+ return isVisible;
+ };
+ /**
+ * Clear all existing timeouts and interval polling delegates.
+ *
+ * @returns `undefined`
+ * @private
+ */
+ var _clearTimeoutsAndPolling = function() {
+ _clearTimeout(_flashCheckTimeout);
+ _flashCheckTimeout = 0;
+ _clearInterval(_swfFallbackCheckInterval);
+ _swfFallbackCheckInterval = 0;
+ };
+ /**
+ * Reposition the Flash object to cover the currently activated element.
+ *
+ * @returns `undefined`
+ * @private
+ */
+ var _reposition = function() {
+ var htmlBridge;
+ if (_currentElement && (htmlBridge = _getHtmlBridge(_flashState.bridge))) {
+ var pos = _getElementPosition(_currentElement);
+ _extend(htmlBridge.style, {
+ width: pos.width + "px",
+ height: pos.height + "px",
+ top: pos.top + "px",
+ left: pos.left + "px",
+ zIndex: "" + _getSafeZIndex(_globalConfig.zIndex)
+ });
+ }
+ };
+ /**
+ * Sends a signal to the Flash object to display the hand cursor if `true`.
+ *
+ * @returns `undefined`
+ * @private
+ */
+ var _setHandCursor = function(enabled) {
+ if (_flashState.ready === true) {
+ if (_flashState.bridge && typeof _flashState.bridge.setHandCursor === "function") {
+ _flashState.bridge.setHandCursor(enabled);
+ } else {
+ _flashState.ready = false;
+ }
+ }
+ };
+ /**
+ * Get a safe value for `zIndex`
+ *
+ * @returns an integer, or "auto"
+ * @private
+ */
+ var _getSafeZIndex = function(val) {
+ if (/^(?:auto|inherit)$/.test(val)) {
+ return val;
+ }
+ var zIndex;
+ if (typeof val === "number" && !_isNaN(val)) {
+ zIndex = val;
+ } else if (typeof val === "string") {
+ zIndex = _getSafeZIndex(_parseInt(val, 10));
+ }
+ return typeof zIndex === "number" ? zIndex : "auto";
+ };
+ /**
+ * Ensure OS-compliant line endings, i.e. "\r\n" on Windows, "\n" elsewhere
+ *
+ * @returns string
+ * @private
+ */
+ var _fixLineEndings = function(content) {
+ var replaceRegex = /(\r\n|\r|\n)/g;
+ if (typeof content === "string" && _globalConfig.fixLineEndings === true) {
+ if (_isWindows()) {
+ if (/((^|[^\r])\n|\r([^\n]|$))/.test(content)) {
+ content = content.replace(replaceRegex, "\r\n");
+ }
+ } else if (/\r/.test(content)) {
+ content = content.replace(replaceRegex, "\n");
+ }
+ }
+ return content;
+ };
+ /**
+ * Attempt to detect if ZeroClipboard is executing inside of a sandboxed iframe.
+ * If it is, Flash Player cannot be used, so ZeroClipboard is dead in the water.
+ *
+ * @see {@link http://lists.w3.org/Archives/Public/public-whatwg-archive/2014Dec/0002.html}
+ * @see {@link https://github.com/zeroclipboard/zeroclipboard/issues/511}
+ * @see {@link http://zeroclipboard.github.io/test-iframes.html}
+ *
+ * @returns `true` (is sandboxed), `false` (is not sandboxed), or `null` (uncertain)
+ * @private
+ */
+ var _detectSandbox = function(doNotReassessFlashSupport) {
+ var effectiveScriptOrigin, frame, frameError, previousState = _flashState.sandboxed, isSandboxed = null;
+ doNotReassessFlashSupport = doNotReassessFlashSupport === true;
+ if (_pageIsFramed === false) {
+ isSandboxed = false;
+ } else {
+ try {
+ frame = window.frameElement || null;
+ } catch (e) {
+ frameError = {
+ name: e.name,
+ message: e.message
+ };
+ }
+ if (frame && frame.nodeType === 1 && frame.nodeName === "IFRAME") {
+ try {
+ isSandboxed = frame.hasAttribute("sandbox");
+ } catch (e) {
+ isSandboxed = null;
+ }
+ } else {
+ try {
+ effectiveScriptOrigin = document.domain || null;
+ } catch (e) {
+ effectiveScriptOrigin = null;
+ }
+ if (effectiveScriptOrigin === null || frameError && frameError.name === "SecurityError" && /(^|[\s\(\[@])sandbox(es|ed|ing|[\s\.,!\)\]@]|$)/.test(frameError.message.toLowerCase())) {
+ isSandboxed = true;
+ }
+ }
+ }
+ _flashState.sandboxed = isSandboxed;
+ if (previousState !== isSandboxed && !doNotReassessFlashSupport) {
+ _detectFlashSupport(_ActiveXObject);
+ }
+ return isSandboxed;
+ };
+ /**
+ * Detect the Flash Player status, version, and plugin type.
+ *
+ * @see {@link https://code.google.com/p/doctype-mirror/wiki/ArticleDetectFlash#The_code}
+ * @see {@link http://stackoverflow.com/questions/12866060/detecting-pepper-ppapi-flash-with-javascript}
+ *
+ * @returns `undefined`
+ * @private
+ */
+ var _detectFlashSupport = function(ActiveXObject) {
+ var plugin, ax, mimeType, hasFlash = false, isActiveX = false, isPPAPI = false, flashVersion = "";
+ /**
+ * Derived from Apple's suggested sniffer.
+ * @param {String} desc e.g. "Shockwave Flash 7.0 r61"
+ * @returns {String} "7.0.61"
+ * @private
+ */
+ function parseFlashVersion(desc) {
+ var matches = desc.match(/[\d]+/g);
+ matches.length = 3;
+ return matches.join(".");
+ }
+ function isPepperFlash(flashPlayerFileName) {
+ return !!flashPlayerFileName && (flashPlayerFileName = flashPlayerFileName.toLowerCase()) && (/^(pepflashplayer\.dll|libpepflashplayer\.so|pepperflashplayer\.plugin)$/.test(flashPlayerFileName) || flashPlayerFileName.slice(-13) === "chrome.plugin");
+ }
+ function inspectPlugin(plugin) {
+ if (plugin) {
+ hasFlash = true;
+ if (plugin.version) {
+ flashVersion = parseFlashVersion(plugin.version);
+ }
+ if (!flashVersion && plugin.description) {
+ flashVersion = parseFlashVersion(plugin.description);
+ }
+ if (plugin.filename) {
+ isPPAPI = isPepperFlash(plugin.filename);
+ }
+ }
+ }
+ if (_navigator.plugins && _navigator.plugins.length) {
+ plugin = _navigator.plugins["Shockwave Flash"];
+ inspectPlugin(plugin);
+ if (_navigator.plugins["Shockwave Flash 2.0"]) {
+ hasFlash = true;
+ flashVersion = "2.0.0.11";
+ }
+ } else if (_navigator.mimeTypes && _navigator.mimeTypes.length) {
+ mimeType = _navigator.mimeTypes["application/x-shockwave-flash"];
+ plugin = mimeType && mimeType.enabledPlugin;
+ inspectPlugin(plugin);
+ } else if (typeof ActiveXObject !== "undefined") {
+ isActiveX = true;
+ try {
+ ax = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
+ hasFlash = true;
+ flashVersion = parseFlashVersion(ax.GetVariable("$version"));
+ } catch (e1) {
+ try {
+ ax = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
+ hasFlash = true;
+ flashVersion = "6.0.21";
+ } catch (e2) {
+ try {
+ ax = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
+ hasFlash = true;
+ flashVersion = parseFlashVersion(ax.GetVariable("$version"));
+ } catch (e3) {
+ isActiveX = false;
+ }
+ }
+ }
+ }
+ _flashState.disabled = hasFlash !== true;
+ _flashState.outdated = flashVersion && _parseFloat(flashVersion) < _parseFloat(_minimumFlashVersion);
+ _flashState.version = flashVersion || "0.0.0";
+ _flashState.pluginType = isPPAPI ? "pepper" : isActiveX ? "activex" : hasFlash ? "netscape" : "unknown";
+ };
+ /**
+ * Invoke the Flash detection algorithms immediately upon inclusion so we're not waiting later.
+ */
+ _detectFlashSupport(_ActiveXObject);
+ /**
+ * Always assess the `sandboxed` state of the page at important Flash-related moments.
+ */
+ _detectSandbox(true);
+ /**
+ * A shell constructor for `ZeroClipboard` client instances.
+ *
+ * @constructor
+ */
+ var ZeroClipboard = function() {
+ if (!(this instanceof ZeroClipboard)) {
+ return new ZeroClipboard();
+ }
+ if (typeof ZeroClipboard._createClient === "function") {
+ ZeroClipboard._createClient.apply(this, _args(arguments));
+ }
+ };
+ /**
+ * The ZeroClipboard library's version number.
+ *
+ * @static
+ * @readonly
+ * @property {string}
+ */
+ ZeroClipboard.version = "2.4.0-beta.1";
+ /**
+ * Update or get a copy of the ZeroClipboard global configuration.
+ * Returns a copy of the current/updated configuration.
+ *
+ * @returns Object
+ * @static
+ */
+ ZeroClipboard.config = function() {
+ return _config.apply(this, _args(arguments));
+ };
+ /**
+ * Diagnostic method that describes the state of the browser, Flash Player, and ZeroClipboard.
+ *
+ * @returns Object
+ * @static
+ */
+ ZeroClipboard.state = function() {
+ return _state.apply(this, _args(arguments));
+ };
+ /**
+ * Check if Flash is unusable for any reason: disabled, outdated, deactivated, etc.
+ *
+ * @returns Boolean
+ * @static
+ */
+ ZeroClipboard.isFlashUnusable = function() {
+ return _isFlashUnusable.apply(this, _args(arguments));
+ };
+ /**
+ * Register an event listener.
+ *
+ * @returns `ZeroClipboard`
+ * @static
+ */
+ ZeroClipboard.on = function() {
+ return _on.apply(this, _args(arguments));
+ };
+ /**
+ * Unregister an event listener.
+ * If no `listener` function/object is provided, it will unregister all listeners for the provided `eventType`.
+ * If no `eventType` is provided, it will unregister all listeners for every event type.
+ *
+ * @returns `ZeroClipboard`
+ * @static
+ */
+ ZeroClipboard.off = function() {
+ return _off.apply(this, _args(arguments));
+ };
+ /**
+ * Retrieve event listeners for an `eventType`.
+ * If no `eventType` is provided, it will retrieve all listeners for every event type.
+ *
+ * @returns array of listeners for the `eventType`; if no `eventType`, then a map/hash object of listeners for all event types; or `null`
+ */
+ ZeroClipboard.handlers = function() {
+ return _listeners.apply(this, _args(arguments));
+ };
+ /**
+ * Event emission receiver from the Flash object, forwarding to any registered JavaScript event listeners.
+ *
+ * @returns For the "copy" event, returns the Flash-friendly "clipData" object; otherwise `undefined`.
+ * @static
+ */
+ ZeroClipboard.emit = function() {
+ return _emit.apply(this, _args(arguments));
+ };
+ /**
+ * Create and embed the Flash object.
+ *
+ * @returns The Flash object
+ * @static
+ */
+ ZeroClipboard.create = function() {
+ return _create.apply(this, _args(arguments));
+ };
+ /**
+ * Self-destruct and clean up everything, including the embedded Flash object.
+ *
+ * @returns `undefined`
+ * @static
+ */
+ ZeroClipboard.destroy = function() {
+ return _destroy.apply(this, _args(arguments));
+ };
+ /**
+ * Set the pending data for clipboard injection.
+ *
+ * @returns `undefined`
+ * @static
+ */
+ ZeroClipboard.setData = function() {
+ return _setData.apply(this, _args(arguments));
+ };
+ /**
+ * Clear the pending data for clipboard injection.
+ * If no `format` is provided, all pending data formats will be cleared.
+ *
+ * @returns `undefined`
+ * @static
+ */
+ ZeroClipboard.clearData = function() {
+ return _clearData.apply(this, _args(arguments));
+ };
+ /**
+ * Get a copy of the pending data for clipboard injection.
+ * If no `format` is provided, a copy of ALL pending data formats will be returned.
+ *
+ * @returns `String` or `Object`
+ * @static
+ */
+ ZeroClipboard.getData = function() {
+ return _getData.apply(this, _args(arguments));
+ };
+ /**
+ * Sets the current HTML object that the Flash object should overlay. This will put the global
+ * Flash object on top of the current element; depending on the setup, this may also set the
+ * pending clipboard text data as well as the Flash object's wrapping element's title attribute
+ * based on the underlying HTML element and ZeroClipboard configuration.
+ *
+ * @returns `undefined`
+ * @static
+ */
+ ZeroClipboard.focus = ZeroClipboard.activate = function() {
+ return _focus.apply(this, _args(arguments));
+ };
+ /**
+ * Un-overlays the Flash object. This will put the global Flash object off-screen; depending on
+ * the setup, this may also unset the Flash object's wrapping element's title attribute based on
+ * the underlying HTML element and ZeroClipboard configuration.
+ *
+ * @returns `undefined`
+ * @static
+ */
+ ZeroClipboard.blur = ZeroClipboard.deactivate = function() {
+ return _blur.apply(this, _args(arguments));
+ };
+ /**
+ * Returns the currently focused/"activated" HTML element that the Flash object is wrapping.
+ *
+ * @returns `HTMLElement` or `null`
+ * @static
+ */
+ ZeroClipboard.activeElement = function() {
+ return _activeElement.apply(this, _args(arguments));
+ };
+ if (typeof define === "function" && define.amd) {
+ define(function() {
+ return ZeroClipboard;
+ });
+ } else if (typeof module === "object" && module && typeof module.exports === "object" && module.exports) {
+ module.exports = ZeroClipboard;
+ } else {
+ window.ZeroClipboard = ZeroClipboard;
+ }
+})(function() {
+ return this || window;
+}());
\ No newline at end of file
diff --git a/js/ZeroClipboard.Core.min.js b/js/ZeroClipboard.Core.min.js
new file mode 100644
index 0000000..8d3193c
--- /dev/null
+++ b/js/ZeroClipboard.Core.min.js
@@ -0,0 +1,10 @@
+/*!
+ * ZeroClipboard
+ * The ZeroClipboard library provides an easy way to copy text to the clipboard using an invisible Adobe Flash movie and a JavaScript interface
+ * Copyright (c) 2009-2017 Jon Rohan, James M. Greene
+ * Licensed MIT
+ * http://zeroclipboard.github.io/
+ * v2.4.0-beta.1
+ */
+!function(a,b){"use strict";var c,d,e,f=a,g=f.document,h=f.navigator,i=f.setTimeout,j=f.clearTimeout,k=f.setInterval,l=f.clearInterval,m=f.getComputedStyle,n=f.encodeURIComponent,o=f.ActiveXObject,p=f.Error,q=f.Number.parseInt||f.parseInt,r=f.Number.parseFloat||f.parseFloat,s=f.Number.isNaN||f.isNaN,t=f.Date.now,u=f.Object.keys,v=f.Object.prototype.hasOwnProperty,w=f.Array.prototype.slice,x=function(){var a=function(a){return a};if("function"==typeof f.wrap&&"function"==typeof f.unwrap)try{var b=g.createElement("div"),c=f.unwrap(b);1===b.nodeType&&c&&1===c.nodeType&&(a=f.unwrap)}catch(d){}return a}(),y=function(a){return w.call(a,0)},z=function(){var a,c,d,e,f,g,h=y(arguments),i=h[0]||{};for(a=1,c=h.length;c>a;a++)if(null!=(d=h[a]))for(e in d)v.call(d,e)&&(f=i[e],g=d[e],i!==g&&g!==b&&(i[e]=g));return i},A=function(a){var b,c,d,e;if("object"!=typeof a||null==a||"number"==typeof a.nodeType)b=a;else if("number"==typeof a.length)for(b=[],c=0,d=a.length;d>c;c++)v.call(a,c)&&(b[c]=A(a[c]));else{b={};for(e in a)v.call(a,e)&&(b[e]=A(a[e]))}return b},B=function(a,b){for(var c={},d=0,e=b.length;e>d;d++)b[d]in a&&(c[b[d]]=a[b[d]]);return c},C=function(a,b){var c={};for(var d in a)-1===b.indexOf(d)&&(c[d]=a[d]);return c},D=function(a){if(a)for(var b in a)v.call(a,b)&&delete a[b];return a},E=function(a,b){if(a&&1===a.nodeType&&a.ownerDocument&&b&&(1===b.nodeType&&b.ownerDocument&&b.ownerDocument===a.ownerDocument||9===b.nodeType&&!b.ownerDocument&&b===a.ownerDocument))do{if(a===b)return!0;a=a.parentNode}while(a);return!1},F=function(a){var b;return"string"==typeof a&&a&&(b=a.split("#")[0].split("?")[0],b=a.slice(0,a.lastIndexOf("/")+1)),b},G=function(a){var b,c;return"string"==typeof a&&a&&(c=a.match(/^(?:|[^:@]*@|.+\)@(?=http[s]?|file)|.+?\s+(?: at |@)(?:[^:\(]+ )*[\(]?)((?:http[s]?|file):\/\/[\/]?.+?\/[^:\)]*?)(?::\d+)(?::\d+)?/),c&&c[1]?b=c[1]:(c=a.match(/\)@((?:http[s]?|file):\/\/[\/]?.+?\/[^:\)]*?)(?::\d+)(?::\d+)?/),c&&c[1]&&(b=c[1]))),b},H=function(){var a,b;try{throw new p}catch(c){b=c}return b&&(a=b.sourceURL||b.fileName||G(b.stack)),a},I=function(){var a,c,d;if(g.currentScript&&(a=g.currentScript.src))return a;if(c=g.getElementsByTagName("script"),1===c.length)return c[0].src||b;if("readyState"in(c[0]||document.createElement("script")))for(d=c.length;d--;)if("interactive"===c[d].readyState&&(a=c[d].src))return a;return"loading"===g.readyState&&(a=c[c.length-1].src)?a:(a=H())?a:b},J=function(){var a,c,d,e=g.getElementsByTagName("script");for(a=e.length;a--;){if(!(d=e[a].src)){c=null;break}if(d=F(d),null==c)c=d;else if(c!==d){c=null;break}}return c||b},K=function(){var a=F(I())||J()||"";return a+"ZeroClipboard.swf"},L=function(){var a=/win(dows|[\s]?(nt|me|ce|xp|vista|[\d]+))/i;return!!h&&(a.test(h.appVersion||"")||a.test(h.platform||"")||-1!==(h.userAgent||"").indexOf("Windows"))},M=function(){return null==f.opener&&(!!f.top&&f!=f.top||!!f.parent&&f!=f.parent)}(),N="html"===g.documentElement.nodeName,O={bridge:null,version:"0.0.0",pluginType:"unknown",sandboxed:null,disabled:null,outdated:null,insecure:null,unavailable:null,degraded:null,deactivated:null,overdue:null,ready:null},P="11.0.0",Q={},R={},S=null,T=0,U=0,V={ready:"Flash communication is established",error:{"flash-sandboxed":"Attempting to run Flash in a sandboxed iframe, which is impossible","flash-disabled":"Flash is disabled or not installed. May also be attempting to run Flash in a sandboxed iframe, which is impossible.","flash-outdated":"Flash is too outdated to support ZeroClipboard","flash-insecure":"Flash will be unable to communicate due to a protocol mismatch between your `swfPath` configuration and the page","flash-unavailable":"Flash is unable to communicate bidirectionally with JavaScript","flash-degraded":"Flash is unable to preserve data fidelity when communicating with JavaScript","flash-deactivated":"Flash is too outdated for your browser and/or is configured as click-to-activate.\nThis may also mean that the ZeroClipboard SWF object could not be loaded, so please check your `swfPath` configuration and/or network connectivity.\nMay also be attempting to run Flash in a sandboxed iframe, which is impossible.","flash-overdue":"Flash communication was established but NOT within the acceptable time limit","version-mismatch":"ZeroClipboard JS version number does not match ZeroClipboard SWF version number","clipboard-error":"At least one error was thrown while ZeroClipboard was attempting to inject your data into the clipboard","config-mismatch":"ZeroClipboard configuration does not match Flash's reality","swf-not-found":"The ZeroClipboard SWF object could not be loaded, so please check your `swfPath` configuration and/or network connectivity","browser-unsupported":"The browser does not support the required HTML DOM and JavaScript features"}},W=["flash-unavailable","flash-degraded","flash-overdue","version-mismatch","config-mismatch","clipboard-error"],X=["flash-sandboxed","flash-disabled","flash-outdated","flash-insecure","flash-unavailable","flash-degraded","flash-deactivated","flash-overdue"],Y=new RegExp("^flash-("+X.map(function(a){return a.replace(/^flash-/,"")}).join("|")+")$"),Z=new RegExp("^flash-("+X.filter(function(a){return"flash-disabled"!==a}).map(function(a){return a.replace(/^flash-/,"")}).join("|")+")$"),$={swfPath:K(),trustedDomains:f.location.host?[f.location.host]:[],cacheBust:!0,forceEnhancedClipboard:!1,flashLoadTimeout:3e4,autoActivate:!0,bubbleEvents:!0,fixLineEndings:!0,containerId:"global-zeroclipboard-html-bridge",containerClass:"global-zeroclipboard-container",swfObjectId:"global-zeroclipboard-flash-bridge",hoverClass:"zeroclipboard-is-hover",activeClass:"zeroclipboard-is-active",forceHandCursor:!1,title:null,zIndex:999999999},_=function(a){"object"!=typeof a||!a||"length"in a||u(a).forEach(function(b){if(/^(?:forceHandCursor|title|zIndex|bubbleEvents|fixLineEndings)$/.test(b))$[b]=a[b];else if(null==O.bridge)if("containerId"===b||"swfObjectId"===b){if(!qa(a[b]))throw new Error("The specified `"+b+"` value is not valid as an HTML4 Element ID");$[b]=a[b]}else $[b]=a[b]});{if("string"!=typeof a||!a)return A($);if(v.call($,a))return $[a]}},aa=function(){return Ya(),{browser:z(B(h,["userAgent","platform","appName","appVersion"]),{isSupported:ba()}),flash:C(O,["bridge"]),zeroclipboard:{version:$a.version,config:$a.config()}}},ba=function(){return!!(g.addEventListener&&f.Object.keys&&f.Array.prototype.map)},ca=function(){return!!(O.sandboxed||O.disabled||O.outdated||O.unavailable||O.degraded||O.deactivated)},da=function(a,d){var e,f,g,h={};if("string"==typeof a&&a?g=a.toLowerCase().split(/\s+/):"object"!=typeof a||!a||"length"in a||"undefined"!=typeof d||u(a).forEach(function(b){var c=a[b];"function"==typeof c&&$a.on(b,c)}),g&&g.length&&d){for(e=0,f=g.length;f>e;e++)a=g[e].replace(/^on/,""),h[a]=!0,Q[a]||(Q[a]=[]),Q[a].push(d);if(h.ready&&O.ready&&$a.emit({type:"ready"}),h.error){for(ba()||$a.emit({type:"error",name:"browser-unsupported"}),e=0,f=X.length;f>e;e++)if(O[X[e].replace(/^flash-/,"")]===!0){$a.emit({type:"error",name:X[e]});break}c!==b&&$a.version!==c&&$a.emit({type:"error",name:"version-mismatch",jsVersion:$a.version,swfVersion:c})}}return $a},ea=function(a,b){var c,d,e,f,g;if(0===arguments.length?f=u(Q):"string"==typeof a&&a?f=a.toLowerCase().split(/\s+/):"object"!=typeof a||!a||"length"in a||"undefined"!=typeof b||u(a).forEach(function(b){var c=a[b];"function"==typeof c&&$a.off(b,c)}),f&&f.length)for(c=0,d=f.length;d>c;c++)if(a=f[c].replace(/^on/,""),g=Q[a],g&&g.length)if(b)for(e=g.indexOf(b);-1!==e;)g.splice(e,1),e=g.indexOf(b,e);else g.length=0;return $a},fa=function(a){var b;return b="string"==typeof a&&a?A(Q[a])||null:A(Q)},ga=function(a){var b,c,d;return a=ra(a),a&&!ya(a)?"ready"===a.type&&O.overdue===!0?$a.emit({type:"error",name:"flash-overdue"}):(b=z({},a),wa.call(this,b),"copy"===a.type&&(d=Ha(R),c=d.data,S=d.formatMap),c):void 0},ha=function(){var a=$.swfPath||"",b=a.slice(0,2),c=a.slice(0,a.indexOf("://")+1);return"\\\\"===b?"file:":"//"===b||""===c?f.location.protocol:c},ia=function(){var a,b,c=O.sandboxed;return ba()?(Ya(),"boolean"!=typeof O.ready&&(O.ready=!1),void(O.sandboxed!==c&&O.sandboxed===!0?(O.ready=!1,$a.emit({type:"error",name:"flash-sandboxed"})):$a.isFlashUnusable()||null!==O.bridge||(b=ha(),b&&b!==f.location.protocol?$a.emit({type:"error",name:"flash-insecure"}):(a=$.flashLoadTimeout,"number"==typeof a&&a>=0&&(T=i(function(){"boolean"!=typeof O.deactivated&&(O.deactivated=!0),O.deactivated===!0&&$a.emit({type:"error",name:"flash-deactivated"})},a)),O.overdue=!1,Fa())))):(O.ready=!1,void $a.emit({type:"error",name:"browser-unsupported"}))},ja=function(){$a.clearData(),$a.blur(),$a.emit("destroy"),Ga(),$a.off()},ka=function(a,b){var c;if("object"==typeof a&&a&&"undefined"==typeof b)c=a,$a.clearData();else{if("string"!=typeof a||!a)return;c={},c[a]=b}for(var d in c)"string"==typeof d&&d&&v.call(c,d)&&"string"==typeof c[d]&&c[d]&&(R[d]=Xa(c[d]))},la=function(a){"undefined"==typeof a?(D(R),S=null):"string"==typeof a&&v.call(R,a)&&delete R[a]},ma=function(a){return"undefined"==typeof a?A(R):"string"==typeof a&&v.call(R,a)?R[a]:void 0},na=function(a){if(a&&1===a.nodeType){d&&(Pa(d,$.activeClass),d!==a&&Pa(d,$.hoverClass)),d=a,Oa(a,$.hoverClass);var b=a.getAttribute("title")||$.title;if("string"==typeof b&&b){var c=Da(O.bridge);c&&c.setAttribute("title",b)}var e=$.forceHandCursor===!0||"pointer"===Qa(a,"cursor");Va(e),Ua()}},oa=function(){var a=Da(O.bridge);a&&(a.removeAttribute("title"),a.style.left="0px",a.style.top="-9999px",a.style.width="1px",a.style.height="1px"),d&&(Pa(d,$.hoverClass),Pa(d,$.activeClass),d=null)},pa=function(){return d||null},qa=function(a){return"string"==typeof a&&a&&/^[A-Za-z][A-Za-z0-9_:\-\.]*$/.test(a)},ra=function(a){var b;if("string"==typeof a&&a?(b=a,a={}):"object"==typeof a&&a&&"string"==typeof a.type&&a.type&&(b=a.type),b){b=b.toLowerCase(),!a.target&&(/^(copy|aftercopy|_click)$/.test(b)||"error"===b&&"clipboard-error"===a.name)&&(a.target=e),z(a,{type:b,target:a.target||d||null,relatedTarget:a.relatedTarget||null,currentTarget:O&&O.bridge||null,timeStamp:a.timeStamp||t()||null});var c=V[a.type];return"error"===a.type&&a.name&&c&&(c=c[a.name]),c&&(a.message=c),"ready"===a.type&&z(a,{target:null,version:O.version}),"error"===a.type&&(Y.test(a.name)&&z(a,{target:null,minimumVersion:P}),Z.test(a.name)&&z(a,{version:O.version}),"flash-insecure"===a.name&&z(a,{pageProtocol:f.location.protocol,swfProtocol:ha()})),"copy"===a.type&&(a.clipboardData={setData:$a.setData,clearData:$a.clearData}),"aftercopy"===a.type&&(a=Ia(a,S)),a.target&&!a.relatedTarget&&(a.relatedTarget=sa(a.target)),ta(a)}},sa=function(a){var b=a&&a.getAttribute&&a.getAttribute("data-clipboard-target");return b?g.getElementById(b):null},ta=function(a){if(a&&/^_(?:click|mouse(?:over|out|down|up|move))$/.test(a.type)){var c=a.target,d="_mouseover"===a.type&&a.relatedTarget?a.relatedTarget:b,e="_mouseout"===a.type&&a.relatedTarget?a.relatedTarget:b,h=Ra(c),i=f.screenLeft||f.screenX||0,j=f.screenTop||f.screenY||0,k=g.body.scrollLeft+g.documentElement.scrollLeft,l=g.body.scrollTop+g.documentElement.scrollTop,m=h.left+("number"==typeof a._stageX?a._stageX:0),n=h.top+("number"==typeof a._stageY?a._stageY:0),o=m-k,p=n-l,q=i+o,r=j+p,s="number"==typeof a.movementX?a.movementX:0,t="number"==typeof a.movementY?a.movementY:0;delete a._stageX,delete a._stageY,z(a,{srcElement:c,fromElement:d,toElement:e,screenX:q,screenY:r,pageX:m,pageY:n,clientX:o,clientY:p,x:o,y:p,movementX:s,movementY:t,offsetX:0,offsetY:0,layerX:0,layerY:0})}return a},ua=function(a){var b=a&&"string"==typeof a.type&&a.type||"";return!/^(?:(?:before)?copy|destroy)$/.test(b)},va=function(a,b,c,d){d?i(function(){a.apply(b,c)},0):a.apply(b,c)},wa=function(a){if("object"==typeof a&&a&&a.type){var b=ua(a),c=Q["*"]||[],d=Q[a.type]||[],e=c.concat(d);if(e&&e.length){var g,h,i,j,k,l=this;for(g=0,h=e.length;h>g;g++)i=e[g],j=l,"string"==typeof i&&"function"==typeof f[i]&&(i=f[i]),"object"==typeof i&&i&&"function"==typeof i.handleEvent&&(j=i,i=i.handleEvent),"function"==typeof i&&(k=z({},a),va(i,j,[k],b))}return this}},xa=function(a){var b=null;return(M===!1||a&&"error"===a.type&&a.name&&-1!==W.indexOf(a.name))&&(b=!1),b},ya=function(a){var b=a.target||d||null,f="swf"===a._source;switch(delete a._source,a.type){case"error":var g="flash-sandboxed"===a.name||xa(a);"boolean"==typeof g&&(O.sandboxed=g),"browser-unsupported"===a.name?z(O,{disabled:!1,outdated:!1,unavailable:!1,degraded:!1,deactivated:!1,overdue:!1,ready:!1}):-1!==X.indexOf(a.name)?z(O,{disabled:"flash-disabled"===a.name,outdated:"flash-outdated"===a.name,insecure:"flash-insecure"===a.name,unavailable:"flash-unavailable"===a.name,degraded:"flash-degraded"===a.name,deactivated:"flash-deactivated"===a.name,overdue:"flash-overdue"===a.name,ready:!1}):"version-mismatch"===a.name&&(c=a.swfVersion,z(O,{disabled:!1,outdated:!1,insecure:!1,unavailable:!1,degraded:!1,deactivated:!1,overdue:!1,ready:!1})),Ta();break;case"ready":c=a.swfVersion;var h=O.deactivated===!0;z(O,{sandboxed:!1,disabled:!1,outdated:!1,insecure:!1,unavailable:!1,degraded:!1,deactivated:!1,overdue:h,ready:!h}),Ta();break;case"beforecopy":e=b;break;case"copy":var i,j,k=a.relatedTarget;!R["text/html"]&&!R["text/plain"]&&k&&(j=k.value||k.outerHTML||k.innerHTML)&&(i=k.value||k.textContent||k.innerText)?(a.clipboardData.clearData(),a.clipboardData.setData("text/plain",i),j!==i&&a.clipboardData.setData("text/html",j)):!R["text/plain"]&&a.target&&(i=a.target.getAttribute("data-clipboard-text"))&&(a.clipboardData.clearData(),a.clipboardData.setData("text/plain",i));break;case"aftercopy":za(a),$a.clearData(),b&&b!==Na()&&b.focus&&b.focus();break;case"_mouseover":$a.focus(b),$.bubbleEvents===!0&&f&&(b&&b!==a.relatedTarget&&!E(a.relatedTarget,b)&&Aa(z({},a,{type:"mouseenter",bubbles:!1,cancelable:!1})),Aa(z({},a,{type:"mouseover"})));break;case"_mouseout":$a.blur(),$.bubbleEvents===!0&&f&&(b&&b!==a.relatedTarget&&!E(a.relatedTarget,b)&&Aa(z({},a,{type:"mouseleave",bubbles:!1,cancelable:!1})),Aa(z({},a,{type:"mouseout"})));break;case"_mousedown":Oa(b,$.activeClass),$.bubbleEvents===!0&&f&&Aa(z({},a,{type:a.type.slice(1)}));break;case"_mouseup":Pa(b,$.activeClass),$.bubbleEvents===!0&&f&&Aa(z({},a,{type:a.type.slice(1)}));break;case"_click":e=null,$.bubbleEvents===!0&&f&&Aa(z({},a,{type:a.type.slice(1)}));break;case"_mousemove":$.bubbleEvents===!0&&f&&Aa(z({},a,{type:a.type.slice(1)}))}return/^_(?:click|mouse(?:over|out|down|up|move))$/.test(a.type)?!0:void 0},za=function(a){if(a.errors&&a.errors.length>0){var b=A(a);z(b,{type:"error",name:"clipboard-error"}),delete b.success,i(function(){$a.emit(b)},0)}},Aa=function(a){if(a&&"string"==typeof a.type&&a){var b,c=a.target||null,d=c&&c.ownerDocument||g,e={view:d.defaultView||f,canBubble:!0,cancelable:!0,detail:"click"===a.type?1:0,button:"number"==typeof a.which?a.which-1:"number"==typeof a.button?a.button:d.createEvent?0:1},h=z(e,a);c&&d.createEvent&&c.dispatchEvent&&(h=[h.type,h.canBubble,h.cancelable,h.view,h.detail,h.screenX,h.screenY,h.clientX,h.clientY,h.ctrlKey,h.altKey,h.shiftKey,h.metaKey,h.button,h.relatedTarget],b=d.createEvent("MouseEvents"),b.initMouseEvent&&(b.initMouseEvent.apply(b,h),b._source="js",c.dispatchEvent(b)))}},Ba=function(){var a=$.flashLoadTimeout;if("number"==typeof a&&a>=0){var b=Math.min(1e3,a/10),c=$.swfObjectId+"_fallbackContent";U=k(function(){var a=g.getElementById(c);Sa(a)&&(Ta(),O.deactivated=null,$a.emit({type:"error",name:"swf-not-found"}))},b)}},Ca=function(){var a=g.createElement("div");return a.id=$.containerId,a.className=$.containerClass,a.style.position="absolute",a.style.left="0px",a.style.top="-9999px",a.style.width="1px",a.style.height="1px",a.style.zIndex=""+Wa($.zIndex),a},Da=function(a){for(var b=a&&a.parentNode;b&&"OBJECT"===b.nodeName&&b.parentNode;)b=b.parentNode;return b||null},Ea=function(a){return"string"==typeof a&&a?a.replace(/["&'<>]/g,function(a){switch(a){case'"':return""";case"&":return"&";case"'":return"'";case"<":return"<";case">":return">";default:return a}}):a},Fa=function(){var a,b=O.bridge,c=Da(b);if(!b){var d=Ma(f.location.host,$),e="never"===d?"none":"all",h=Ka(z({jsVersion:$a.version},$)),i=$.swfPath+Ja($.swfPath,$);N&&(i=Ea(i)),c=Ca();var j=g.createElement("div");c.appendChild(j),g.body.appendChild(c);var k=g.createElement("div"),l="activex"===O.pluginType;k.innerHTML='"+(l?' ':"")+'
',b=k.firstChild,k=null,x(b).ZeroClipboard=$a,c.replaceChild(b,j),Ba()}return b||(b=g[$.swfObjectId],b&&(a=b.length)&&(b=b[a-1]),!b&&c&&(b=c.firstChild)),O.bridge=b||null,b},Ga=function(){var a=O.bridge;if(a){var d=Da(a);d&&("activex"===O.pluginType&&"readyState"in a?(a.style.display="none",function e(){if(4===a.readyState){for(var b in a)"function"==typeof a[b]&&(a[b]=null);a.parentNode&&a.parentNode.removeChild(a),d.parentNode&&d.parentNode.removeChild(d)}else i(e,10)}()):(a.parentNode&&a.parentNode.removeChild(a),d.parentNode&&d.parentNode.removeChild(d))),Ta(),O.ready=null,O.bridge=null,O.deactivated=null,O.insecure=null,c=b}},Ha=function(a){var b={},c={};if("object"==typeof a&&a){for(var d in a)if(d&&v.call(a,d)&&"string"==typeof a[d]&&a[d])switch(d.toLowerCase()){case"text/plain":case"text":case"air:text":case"flash:text":b.text=a[d],c.text=d;break;case"text/html":case"html":case"air:html":case"flash:html":b.html=a[d],c.html=d;break;case"application/rtf":case"text/rtf":case"rtf":case"richtext":case"air:rtf":case"flash:rtf":b.rtf=a[d],c.rtf=d}return{data:b,formatMap:c}}},Ia=function(a,b){if("object"!=typeof a||!a||"object"!=typeof b||!b)return a;var c={};for(var d in a)if(v.call(a,d))if("errors"===d){c[d]=a[d]?a[d].slice():[];for(var e=0,f=c[d].length;f>e;e++)c[d][e].format=b[c[d][e].format]}else if("success"!==d&&"data"!==d)c[d]=a[d];else{c[d]={};var g=a[d];for(var h in g)h&&v.call(g,h)&&v.call(b,h)&&(c[d][b[h]]=g[h])}return c},Ja=function(a,b){var c=null==b||b&&b.cacheBust===!0;return c?(-1===a.indexOf("?")?"?":"&")+"noCache="+t():""},Ka=function(a){var b,c,d,e,g="",h=[];if(a.trustedDomains&&("string"==typeof a.trustedDomains?e=[a.trustedDomains]:"object"==typeof a.trustedDomains&&"length"in a.trustedDomains&&(e=a.trustedDomains)),e&&e.length)for(b=0,c=e.length;c>b;b++)if(v.call(e,b)&&e[b]&&"string"==typeof e[b]){if(d=La(e[b]),!d)continue;if("*"===d){h.length=0,h.push(d);break}h.push.apply(h,[d,"//"+d,f.location.protocol+"//"+d])}return h.length&&(g+="trustedOrigins="+n(h.join(","))),a.forceEnhancedClipboard===!0&&(g+=(g?"&":"")+"forceEnhancedClipboard=true"),"string"==typeof a.swfObjectId&&a.swfObjectId&&(g+=(g?"&":"")+"swfObjectId="+n(a.swfObjectId)),"string"==typeof a.jsVersion&&a.jsVersion&&(g+=(g?"&":"")+"jsVersion="+n(a.jsVersion)),g},La=function(a){if(null==a||""===a)return null;if(a=a.replace(/^\s+|\s+$/g,""),""===a)return null;var b=a.indexOf("//");a=-1===b?a:a.slice(b+2);var c=a.indexOf("/");return a=-1===c?a:-1===b||0===c?null:a.slice(0,c),a&&".swf"===a.slice(-4).toLowerCase()?null:a||null},Ma=function(){var a=function(a){var b,c,d,e=[];if("string"==typeof a&&(a=[a]),"object"!=typeof a||!a||"number"!=typeof a.length)return e;for(b=0,c=a.length;c>b;b++)if(v.call(a,b)&&(d=La(a[b]))){if("*"===d){e.length=0,e.push("*");break}-1===e.indexOf(d)&&e.push(d)}return e};return function(b,c){var d=La(c.swfPath);null===d&&(d=b);var e=a(c.trustedDomains),f=e.length;if(f>0){if(1===f&&"*"===e[0])return"always";if(-1!==e.indexOf(b))return 1===f&&b===d?"sameDomain":"always"}return"never"}}(),Na=function(){try{return g.activeElement}catch(a){return null}},Oa=function(a,b){var c,d,e,f=[];if("string"==typeof b&&b&&(f=b.split(/\s+/)),a&&1===a.nodeType&&f.length>0){for(e=(" "+(a.className||"")+" ").replace(/[\t\r\n\f]/g," "),c=0,d=f.length;d>c;c++)-1===e.indexOf(" "+f[c]+" ")&&(e+=f[c]+" ");e=e.replace(/^\s+|\s+$/g,""),e!==a.className&&(a.className=e)}return a},Pa=function(a,b){var c,d,e,f=[];if("string"==typeof b&&b&&(f=b.split(/\s+/)),a&&1===a.nodeType&&f.length>0&&a.className){for(e=(" "+a.className+" ").replace(/[\t\r\n\f]/g," "),c=0,d=f.length;d>c;c++)e=e.replace(" "+f[c]+" "," ");e=e.replace(/^\s+|\s+$/g,""),e!==a.className&&(a.className=e)}return a},Qa=function(a,b){var c=m(a,null).getPropertyValue(b);return"cursor"!==b||c&&"auto"!==c||"A"!==a.nodeName?c:"pointer"},Ra=function(a){var b={left:0,top:0,width:0,height:0};if(a.getBoundingClientRect){var c=a.getBoundingClientRect(),d=f.pageXOffset,e=f.pageYOffset,h=g.documentElement.clientLeft||0,i=g.documentElement.clientTop||0,j=0,k=0;if("relative"===Qa(g.body,"position")){var l=g.body.getBoundingClientRect(),m=g.documentElement.getBoundingClientRect();j=l.left-m.left||0,k=l.top-m.top||0}b.left=c.left+d-h-j,b.top=c.top+e-i-k,b.width="width"in c?c.width:c.right-c.left,b.height="height"in c?c.height:c.bottom-c.top}return b},Sa=function(a){if(!a)return!1;var b=m(a,null);if(!b)return!1;var c=r(b.height)>0,d=r(b.width)>0,e=r(b.top)>=0,f=r(b.left)>=0,g=c&&d&&e&&f,h=g?null:Ra(a),i="none"!==b.display&&"collapse"!==b.visibility&&(g||!!h&&(c||h.height>0)&&(d||h.width>0)&&(e||h.top>=0)&&(f||h.left>=0));return i},Ta=function(){j(T),T=0,l(U),U=0},Ua=function(){var a;if(d&&(a=Da(O.bridge))){var b=Ra(d);z(a.style,{width:b.width+"px",height:b.height+"px",top:b.top+"px",left:b.left+"px",zIndex:""+Wa($.zIndex)})}},Va=function(a){O.ready===!0&&(O.bridge&&"function"==typeof O.bridge.setHandCursor?O.bridge.setHandCursor(a):O.ready=!1)},Wa=function(a){if(/^(?:auto|inherit)$/.test(a))return a;var b;return"number"!=typeof a||s(a)?"string"==typeof a&&(b=Wa(q(a,10))):b=a,"number"==typeof b?b:"auto"},Xa=function(a){var b=/(\r\n|\r|\n)/g;return"string"==typeof a&&$.fixLineEndings===!0&&(L()?/((^|[^\r])\n|\r([^\n]|$))/.test(a)&&(a=a.replace(b,"\r\n")):/\r/.test(a)&&(a=a.replace(b,"\n"))),a},Ya=function(b){var c,d,e,f=O.sandboxed,g=null;if(b=b===!0,M===!1)g=!1;else{try{d=a.frameElement||null}catch(h){e={name:h.name,message:h.message}}if(d&&1===d.nodeType&&"IFRAME"===d.nodeName)try{g=d.hasAttribute("sandbox")}catch(h){g=null}else{try{c=document.domain||null}catch(h){c=null}(null===c||e&&"SecurityError"===e.name&&/(^|[\s\(\[@])sandbox(es|ed|ing|[\s\.,!\)\]@]|$)/.test(e.message.toLowerCase()))&&(g=!0)}}return O.sandboxed=g,f===g||b||Za(o),g},Za=function(a){function b(a){var b=a.match(/[\d]+/g);return b.length=3,b.join(".")}function c(a){return!!a&&(a=a.toLowerCase())&&(/^(pepflashplayer\.dll|libpepflashplayer\.so|pepperflashplayer\.plugin)$/.test(a)||"chrome.plugin"===a.slice(-13))}function d(a){a&&(i=!0,a.version&&(l=b(a.version)),!l&&a.description&&(l=b(a.description)),a.filename&&(k=c(a.filename)))}var e,f,g,i=!1,j=!1,k=!1,l="";if(h.plugins&&h.plugins.length)e=h.plugins["Shockwave Flash"],d(e),h.plugins["Shockwave Flash 2.0"]&&(i=!0,l="2.0.0.11");else if(h.mimeTypes&&h.mimeTypes.length)g=h.mimeTypes["application/x-shockwave-flash"],e=g&&g.enabledPlugin,d(e);else if("undefined"!=typeof a){j=!0;try{f=new a("ShockwaveFlash.ShockwaveFlash.7"),i=!0,l=b(f.GetVariable("$version"))}catch(m){try{f=new a("ShockwaveFlash.ShockwaveFlash.6"),i=!0,l="6.0.21"}catch(n){try{f=new a("ShockwaveFlash.ShockwaveFlash"),i=!0,l=b(f.GetVariable("$version"))}catch(o){j=!1}}}}O.disabled=i!==!0,O.outdated=l&&r(l)= 0) {\n _flashCheckTimeout = _setTimeout(function() {\n if (typeof _flashState.deactivated !== \"boolean\") {\n _flashState.deactivated = true;\n }\n if (_flashState.deactivated === true) {\n ZeroClipboard.emit({\n type: \"error\",\n name: \"flash-deactivated\"\n });\n }\n }, maxWait);\n }\n _flashState.overdue = false;\n _embedSwf();\n }\n }\n };\n /**\n * The underlying implementation of `ZeroClipboard.destroy`.\n * @private\n */\n var _destroy = function() {\n ZeroClipboard.clearData();\n ZeroClipboard.blur();\n ZeroClipboard.emit(\"destroy\");\n _unembedSwf();\n ZeroClipboard.off();\n };\n /**\n * The underlying implementation of `ZeroClipboard.setData`.\n * @private\n */\n var _setData = function(format, data) {\n var dataObj;\n if (typeof format === \"object\" && format && typeof data === \"undefined\") {\n dataObj = format;\n ZeroClipboard.clearData();\n } else if (typeof format === \"string\" && format) {\n dataObj = {};\n dataObj[format] = data;\n } else {\n return;\n }\n for (var dataFormat in dataObj) {\n if (typeof dataFormat === \"string\" && dataFormat && _hasOwn.call(dataObj, dataFormat) && typeof dataObj[dataFormat] === \"string\" && dataObj[dataFormat]) {\n _clipData[dataFormat] = _fixLineEndings(dataObj[dataFormat]);\n }\n }\n };\n /**\n * The underlying implementation of `ZeroClipboard.clearData`.\n * @private\n */\n var _clearData = function(format) {\n if (typeof format === \"undefined\") {\n _deleteOwnProperties(_clipData);\n _clipDataFormatMap = null;\n } else if (typeof format === \"string\" && _hasOwn.call(_clipData, format)) {\n delete _clipData[format];\n }\n };\n /**\n * The underlying implementation of `ZeroClipboard.getData`.\n * @private\n */\n var _getData = function(format) {\n if (typeof format === \"undefined\") {\n return _deepCopy(_clipData);\n } else if (typeof format === \"string\" && _hasOwn.call(_clipData, format)) {\n return _clipData[format];\n }\n };\n /**\n * The underlying implementation of `ZeroClipboard.focus`/`ZeroClipboard.activate`.\n * @private\n */\n var _focus = function(element) {\n if (!(element && element.nodeType === 1)) {\n return;\n }\n if (_currentElement) {\n _removeClass(_currentElement, _globalConfig.activeClass);\n if (_currentElement !== element) {\n _removeClass(_currentElement, _globalConfig.hoverClass);\n }\n }\n _currentElement = element;\n _addClass(element, _globalConfig.hoverClass);\n var newTitle = element.getAttribute(\"title\") || _globalConfig.title;\n if (typeof newTitle === \"string\" && newTitle) {\n var htmlBridge = _getHtmlBridge(_flashState.bridge);\n if (htmlBridge) {\n htmlBridge.setAttribute(\"title\", newTitle);\n }\n }\n var useHandCursor = _globalConfig.forceHandCursor === true || _getStyle(element, \"cursor\") === \"pointer\";\n _setHandCursor(useHandCursor);\n _reposition();\n };\n /**\n * The underlying implementation of `ZeroClipboard.blur`/`ZeroClipboard.deactivate`.\n * @private\n */\n var _blur = function() {\n var htmlBridge = _getHtmlBridge(_flashState.bridge);\n if (htmlBridge) {\n htmlBridge.removeAttribute(\"title\");\n htmlBridge.style.left = \"0px\";\n htmlBridge.style.top = \"-9999px\";\n htmlBridge.style.width = \"1px\";\n htmlBridge.style.height = \"1px\";\n }\n if (_currentElement) {\n _removeClass(_currentElement, _globalConfig.hoverClass);\n _removeClass(_currentElement, _globalConfig.activeClass);\n _currentElement = null;\n }\n };\n /**\n * The underlying implementation of `ZeroClipboard.activeElement`.\n * @private\n */\n var _activeElement = function() {\n return _currentElement || null;\n };\n /**\n * Check if a value is a valid HTML4 `ID` or `Name` token.\n * @private\n */\n var _isValidHtml4Id = function(id) {\n return typeof id === \"string\" && id && /^[A-Za-z][A-Za-z0-9_:\\-\\.]*$/.test(id);\n };\n /**\n * Create or update an `event` object, based on the `eventType`.\n * @private\n */\n var _createEvent = function(event) {\n var eventType;\n if (typeof event === \"string\" && event) {\n eventType = event;\n event = {};\n } else if (typeof event === \"object\" && event && typeof event.type === \"string\" && event.type) {\n eventType = event.type;\n }\n if (!eventType) {\n return;\n }\n eventType = eventType.toLowerCase();\n if (!event.target && (/^(copy|aftercopy|_click)$/.test(eventType) || eventType === \"error\" && event.name === \"clipboard-error\")) {\n event.target = _copyTarget;\n }\n _extend(event, {\n type: eventType,\n target: event.target || _currentElement || null,\n relatedTarget: event.relatedTarget || null,\n currentTarget: _flashState && _flashState.bridge || null,\n timeStamp: event.timeStamp || _now() || null\n });\n var msg = _eventMessages[event.type];\n if (event.type === \"error\" && event.name && msg) {\n msg = msg[event.name];\n }\n if (msg) {\n event.message = msg;\n }\n if (event.type === \"ready\") {\n _extend(event, {\n target: null,\n version: _flashState.version\n });\n }\n if (event.type === \"error\") {\n if (_flashStateErrorNameMatchingRegex.test(event.name)) {\n _extend(event, {\n target: null,\n minimumVersion: _minimumFlashVersion\n });\n }\n if (_flashStateEnabledErrorNameMatchingRegex.test(event.name)) {\n _extend(event, {\n version: _flashState.version\n });\n }\n if (event.name === \"flash-insecure\") {\n _extend(event, {\n pageProtocol: _window.location.protocol,\n swfProtocol: _getSwfPathProtocol()\n });\n }\n }\n if (event.type === \"copy\") {\n event.clipboardData = {\n setData: ZeroClipboard.setData,\n clearData: ZeroClipboard.clearData\n };\n }\n if (event.type === \"aftercopy\") {\n event = _mapClipResultsFromFlash(event, _clipDataFormatMap);\n }\n if (event.target && !event.relatedTarget) {\n event.relatedTarget = _getRelatedTarget(event.target);\n }\n return _addMouseData(event);\n };\n /**\n * Get a relatedTarget from the target's `data-clipboard-target` attribute\n * @private\n */\n var _getRelatedTarget = function(targetEl) {\n var relatedTargetId = targetEl && targetEl.getAttribute && targetEl.getAttribute(\"data-clipboard-target\");\n return relatedTargetId ? _document.getElementById(relatedTargetId) : null;\n };\n /**\n * Add element and position data to `MouseEvent` instances\n * @private\n */\n var _addMouseData = function(event) {\n if (event && /^_(?:click|mouse(?:over|out|down|up|move))$/.test(event.type)) {\n var srcElement = event.target;\n var fromElement = event.type === \"_mouseover\" && event.relatedTarget ? event.relatedTarget : undefined;\n var toElement = event.type === \"_mouseout\" && event.relatedTarget ? event.relatedTarget : undefined;\n var pos = _getElementPosition(srcElement);\n var screenLeft = _window.screenLeft || _window.screenX || 0;\n var screenTop = _window.screenTop || _window.screenY || 0;\n var scrollLeft = _document.body.scrollLeft + _document.documentElement.scrollLeft;\n var scrollTop = _document.body.scrollTop + _document.documentElement.scrollTop;\n var pageX = pos.left + (typeof event._stageX === \"number\" ? event._stageX : 0);\n var pageY = pos.top + (typeof event._stageY === \"number\" ? event._stageY : 0);\n var clientX = pageX - scrollLeft;\n var clientY = pageY - scrollTop;\n var screenX = screenLeft + clientX;\n var screenY = screenTop + clientY;\n var moveX = typeof event.movementX === \"number\" ? event.movementX : 0;\n var moveY = typeof event.movementY === \"number\" ? event.movementY : 0;\n delete event._stageX;\n delete event._stageY;\n _extend(event, {\n srcElement: srcElement,\n fromElement: fromElement,\n toElement: toElement,\n screenX: screenX,\n screenY: screenY,\n pageX: pageX,\n pageY: pageY,\n clientX: clientX,\n clientY: clientY,\n x: clientX,\n y: clientY,\n movementX: moveX,\n movementY: moveY,\n offsetX: 0,\n offsetY: 0,\n layerX: 0,\n layerY: 0\n });\n }\n return event;\n };\n /**\n * Determine if an event's registered handlers should be execute synchronously or asynchronously.\n *\n * @returns {boolean}\n * @private\n */\n var _shouldPerformAsync = function(event) {\n var eventType = event && typeof event.type === \"string\" && event.type || \"\";\n return !/^(?:(?:before)?copy|destroy)$/.test(eventType);\n };\n /**\n * Control if a callback should be executed asynchronously or not.\n *\n * @returns `undefined`\n * @private\n */\n var _dispatchCallback = function(func, context, args, async) {\n if (async) {\n _setTimeout(function() {\n func.apply(context, args);\n }, 0);\n } else {\n func.apply(context, args);\n }\n };\n /**\n * Handle the actual dispatching of events to client instances.\n *\n * @returns `undefined`\n * @private\n */\n var _dispatchCallbacks = function(event) {\n if (!(typeof event === \"object\" && event && event.type)) {\n return;\n }\n var async = _shouldPerformAsync(event);\n var wildcardTypeHandlers = _handlers[\"*\"] || [];\n var specificTypeHandlers = _handlers[event.type] || [];\n var handlers = wildcardTypeHandlers.concat(specificTypeHandlers);\n if (handlers && handlers.length) {\n var i, len, func, context, eventCopy, originalContext = this;\n for (i = 0, len = handlers.length; i < len; i++) {\n func = handlers[i];\n context = originalContext;\n if (typeof func === \"string\" && typeof _window[func] === \"function\") {\n func = _window[func];\n }\n if (typeof func === \"object\" && func && typeof func.handleEvent === \"function\") {\n context = func;\n func = func.handleEvent;\n }\n if (typeof func === \"function\") {\n eventCopy = _extend({}, event);\n _dispatchCallback(func, context, [ eventCopy ], async);\n }\n }\n }\n return this;\n };\n /**\n * Check an `error` event's `name` property to see if Flash has\n * already loaded, which rules out possible `iframe` sandboxing.\n * @private\n */\n var _getSandboxStatusFromErrorEvent = function(event) {\n var isSandboxed = null;\n if (_pageIsFramed === false || event && event.type === \"error\" && event.name && _errorsThatOnlyOccurAfterFlashLoads.indexOf(event.name) !== -1) {\n isSandboxed = false;\n }\n return isSandboxed;\n };\n /**\n * Preprocess any special behaviors, reactions, or state changes after receiving this event.\n * Executes only once per event emitted, NOT once per client.\n * @private\n */\n var _preprocessEvent = function(event) {\n var element = event.target || _currentElement || null;\n var sourceIsSwf = event._source === \"swf\";\n delete event._source;\n switch (event.type) {\n case \"error\":\n var isSandboxed = event.name === \"flash-sandboxed\" || _getSandboxStatusFromErrorEvent(event);\n if (typeof isSandboxed === \"boolean\") {\n _flashState.sandboxed = isSandboxed;\n }\n if (event.name === \"browser-unsupported\") {\n _extend(_flashState, {\n disabled: false,\n outdated: false,\n unavailable: false,\n degraded: false,\n deactivated: false,\n overdue: false,\n ready: false\n });\n } else if (_flashStateErrorNames.indexOf(event.name) !== -1) {\n _extend(_flashState, {\n disabled: event.name === \"flash-disabled\",\n outdated: event.name === \"flash-outdated\",\n insecure: event.name === \"flash-insecure\",\n unavailable: event.name === \"flash-unavailable\",\n degraded: event.name === \"flash-degraded\",\n deactivated: event.name === \"flash-deactivated\",\n overdue: event.name === \"flash-overdue\",\n ready: false\n });\n } else if (event.name === \"version-mismatch\") {\n _zcSwfVersion = event.swfVersion;\n _extend(_flashState, {\n disabled: false,\n outdated: false,\n insecure: false,\n unavailable: false,\n degraded: false,\n deactivated: false,\n overdue: false,\n ready: false\n });\n }\n _clearTimeoutsAndPolling();\n break;\n\n case \"ready\":\n _zcSwfVersion = event.swfVersion;\n var wasDeactivated = _flashState.deactivated === true;\n _extend(_flashState, {\n sandboxed: false,\n disabled: false,\n outdated: false,\n insecure: false,\n unavailable: false,\n degraded: false,\n deactivated: false,\n overdue: wasDeactivated,\n ready: !wasDeactivated\n });\n _clearTimeoutsAndPolling();\n break;\n\n case \"beforecopy\":\n _copyTarget = element;\n break;\n\n case \"copy\":\n var textContent, htmlContent, targetEl = event.relatedTarget;\n if (!(_clipData[\"text/html\"] || _clipData[\"text/plain\"]) && targetEl && (htmlContent = targetEl.value || targetEl.outerHTML || targetEl.innerHTML) && (textContent = targetEl.value || targetEl.textContent || targetEl.innerText)) {\n event.clipboardData.clearData();\n event.clipboardData.setData(\"text/plain\", textContent);\n if (htmlContent !== textContent) {\n event.clipboardData.setData(\"text/html\", htmlContent);\n }\n } else if (!_clipData[\"text/plain\"] && event.target && (textContent = event.target.getAttribute(\"data-clipboard-text\"))) {\n event.clipboardData.clearData();\n event.clipboardData.setData(\"text/plain\", textContent);\n }\n break;\n\n case \"aftercopy\":\n _queueEmitClipboardErrors(event);\n ZeroClipboard.clearData();\n if (element && element !== _safeActiveElement() && element.focus) {\n element.focus();\n }\n break;\n\n case \"_mouseover\":\n ZeroClipboard.focus(element);\n if (_globalConfig.bubbleEvents === true && sourceIsSwf) {\n if (element && element !== event.relatedTarget && !_containedBy(event.relatedTarget, element)) {\n _fireMouseEvent(_extend({}, event, {\n type: \"mouseenter\",\n bubbles: false,\n cancelable: false\n }));\n }\n _fireMouseEvent(_extend({}, event, {\n type: \"mouseover\"\n }));\n }\n break;\n\n case \"_mouseout\":\n ZeroClipboard.blur();\n if (_globalConfig.bubbleEvents === true && sourceIsSwf) {\n if (element && element !== event.relatedTarget && !_containedBy(event.relatedTarget, element)) {\n _fireMouseEvent(_extend({}, event, {\n type: \"mouseleave\",\n bubbles: false,\n cancelable: false\n }));\n }\n _fireMouseEvent(_extend({}, event, {\n type: \"mouseout\"\n }));\n }\n break;\n\n case \"_mousedown\":\n _addClass(element, _globalConfig.activeClass);\n if (_globalConfig.bubbleEvents === true && sourceIsSwf) {\n _fireMouseEvent(_extend({}, event, {\n type: event.type.slice(1)\n }));\n }\n break;\n\n case \"_mouseup\":\n _removeClass(element, _globalConfig.activeClass);\n if (_globalConfig.bubbleEvents === true && sourceIsSwf) {\n _fireMouseEvent(_extend({}, event, {\n type: event.type.slice(1)\n }));\n }\n break;\n\n case \"_click\":\n _copyTarget = null;\n if (_globalConfig.bubbleEvents === true && sourceIsSwf) {\n _fireMouseEvent(_extend({}, event, {\n type: event.type.slice(1)\n }));\n }\n break;\n\n case \"_mousemove\":\n if (_globalConfig.bubbleEvents === true && sourceIsSwf) {\n _fireMouseEvent(_extend({}, event, {\n type: event.type.slice(1)\n }));\n }\n break;\n }\n if (/^_(?:click|mouse(?:over|out|down|up|move))$/.test(event.type)) {\n return true;\n }\n };\n /**\n * Check an \"aftercopy\" event for clipboard errors and emit a corresponding \"error\" event.\n * @private\n */\n var _queueEmitClipboardErrors = function(aftercopyEvent) {\n if (aftercopyEvent.errors && aftercopyEvent.errors.length > 0) {\n var errorEvent = _deepCopy(aftercopyEvent);\n _extend(errorEvent, {\n type: \"error\",\n name: \"clipboard-error\"\n });\n delete errorEvent.success;\n _setTimeout(function() {\n ZeroClipboard.emit(errorEvent);\n }, 0);\n }\n };\n /**\n * Dispatch a synthetic MouseEvent.\n *\n * @returns `undefined`\n * @private\n */\n var _fireMouseEvent = function(event) {\n if (!(event && typeof event.type === \"string\" && event)) {\n return;\n }\n var e, target = event.target || null, doc = target && target.ownerDocument || _document, defaults = {\n view: doc.defaultView || _window,\n canBubble: true,\n cancelable: true,\n detail: event.type === \"click\" ? 1 : 0,\n button: typeof event.which === \"number\" ? event.which - 1 : typeof event.button === \"number\" ? event.button : doc.createEvent ? 0 : 1\n }, args = _extend(defaults, event);\n if (!target) {\n return;\n }\n if (doc.createEvent && target.dispatchEvent) {\n args = [ args.type, args.canBubble, args.cancelable, args.view, args.detail, args.screenX, args.screenY, args.clientX, args.clientY, args.ctrlKey, args.altKey, args.shiftKey, args.metaKey, args.button, args.relatedTarget ];\n e = doc.createEvent(\"MouseEvents\");\n if (e.initMouseEvent) {\n e.initMouseEvent.apply(e, args);\n e._source = \"js\";\n target.dispatchEvent(e);\n }\n }\n };\n /**\n * Continuously poll the DOM until either:\n * (a) the fallback content becomes visible, or\n * (b) we receive an event from SWF (handled elsewhere)\n *\n * IMPORTANT:\n * This is NOT a necessary check but it can result in significantly faster\n * detection of bad `swfPath` configuration and/or network/server issues [in\n * supported browsers] than waiting for the entire `flashLoadTimeout` duration\n * to elapse before detecting that the SWF cannot be loaded. The detection\n * duration can be anywhere from 10-30 times faster [in supported browsers] by\n * using this approach.\n *\n * @returns `undefined`\n * @private\n */\n var _watchForSwfFallbackContent = function() {\n var maxWait = _globalConfig.flashLoadTimeout;\n if (typeof maxWait === \"number\" && maxWait >= 0) {\n var pollWait = Math.min(1e3, maxWait / 10);\n var fallbackContentId = _globalConfig.swfObjectId + \"_fallbackContent\";\n _swfFallbackCheckInterval = _setInterval(function() {\n var el = _document.getElementById(fallbackContentId);\n if (_isElementVisible(el)) {\n _clearTimeoutsAndPolling();\n _flashState.deactivated = null;\n ZeroClipboard.emit({\n type: \"error\",\n name: \"swf-not-found\"\n });\n }\n }, pollWait);\n }\n };\n /**\n * Create the HTML bridge element to embed the Flash object into.\n * @private\n */\n var _createHtmlBridge = function() {\n var container = _document.createElement(\"div\");\n container.id = _globalConfig.containerId;\n container.className = _globalConfig.containerClass;\n container.style.position = \"absolute\";\n container.style.left = \"0px\";\n container.style.top = \"-9999px\";\n container.style.width = \"1px\";\n container.style.height = \"1px\";\n container.style.zIndex = \"\" + _getSafeZIndex(_globalConfig.zIndex);\n return container;\n };\n /**\n * Get the HTML element container that wraps the Flash bridge object/element.\n * @private\n */\n var _getHtmlBridge = function(flashBridge) {\n var htmlBridge = flashBridge && flashBridge.parentNode;\n while (htmlBridge && htmlBridge.nodeName === \"OBJECT\" && htmlBridge.parentNode) {\n htmlBridge = htmlBridge.parentNode;\n }\n return htmlBridge || null;\n };\n /**\n *\n * @private\n */\n var _escapeXmlValue = function(val) {\n if (typeof val !== \"string\" || !val) {\n return val;\n }\n return val.replace(/[\"&'<>]/g, function(chr) {\n switch (chr) {\n case '\"':\n return \""\";\n\n case \"&\":\n return \"&\";\n\n case \"'\":\n return \"'\";\n\n case \"<\":\n return \"<\";\n\n case \">\":\n return \">\";\n\n default:\n return chr;\n }\n });\n };\n /**\n * Create the SWF object.\n *\n * @returns The SWF object reference.\n * @private\n */\n var _embedSwf = function() {\n var len, flashBridge = _flashState.bridge, container = _getHtmlBridge(flashBridge);\n if (!flashBridge) {\n var allowScriptAccess = _determineScriptAccess(_window.location.host, _globalConfig);\n var allowNetworking = allowScriptAccess === \"never\" ? \"none\" : \"all\";\n var flashvars = _vars(_extend({\n jsVersion: ZeroClipboard.version\n }, _globalConfig));\n var swfUrl = _globalConfig.swfPath + _cacheBust(_globalConfig.swfPath, _globalConfig);\n if (_pageIsXhtml) {\n swfUrl = _escapeXmlValue(swfUrl);\n }\n container = _createHtmlBridge();\n var divToBeReplaced = _document.createElement(\"div\");\n container.appendChild(divToBeReplaced);\n _document.body.appendChild(container);\n var tmpDiv = _document.createElement(\"div\");\n var usingActiveX = _flashState.pluginType === \"activex\";\n tmpDiv.innerHTML = '\" + (usingActiveX ? ' ' : \"\") + ' ' + ' ' + ' ' + ' ' + ' ' + '
' + \" \";\n flashBridge = tmpDiv.firstChild;\n tmpDiv = null;\n _unwrap(flashBridge).ZeroClipboard = ZeroClipboard;\n container.replaceChild(flashBridge, divToBeReplaced);\n _watchForSwfFallbackContent();\n }\n if (!flashBridge) {\n flashBridge = _document[_globalConfig.swfObjectId];\n if (flashBridge && (len = flashBridge.length)) {\n flashBridge = flashBridge[len - 1];\n }\n if (!flashBridge && container) {\n flashBridge = container.firstChild;\n }\n }\n _flashState.bridge = flashBridge || null;\n return flashBridge;\n };\n /**\n * Destroy the SWF object.\n * @private\n */\n var _unembedSwf = function() {\n var flashBridge = _flashState.bridge;\n if (flashBridge) {\n var htmlBridge = _getHtmlBridge(flashBridge);\n if (htmlBridge) {\n if (_flashState.pluginType === \"activex\" && \"readyState\" in flashBridge) {\n flashBridge.style.display = \"none\";\n (function removeSwfFromIE() {\n if (flashBridge.readyState === 4) {\n for (var prop in flashBridge) {\n if (typeof flashBridge[prop] === \"function\") {\n flashBridge[prop] = null;\n }\n }\n if (flashBridge.parentNode) {\n flashBridge.parentNode.removeChild(flashBridge);\n }\n if (htmlBridge.parentNode) {\n htmlBridge.parentNode.removeChild(htmlBridge);\n }\n } else {\n _setTimeout(removeSwfFromIE, 10);\n }\n })();\n } else {\n if (flashBridge.parentNode) {\n flashBridge.parentNode.removeChild(flashBridge);\n }\n if (htmlBridge.parentNode) {\n htmlBridge.parentNode.removeChild(htmlBridge);\n }\n }\n }\n _clearTimeoutsAndPolling();\n _flashState.ready = null;\n _flashState.bridge = null;\n _flashState.deactivated = null;\n _flashState.insecure = null;\n _zcSwfVersion = undefined;\n }\n };\n /**\n * Map the data format names of the \"clipData\" to Flash-friendly names.\n *\n * @returns A new transformed object.\n * @private\n */\n var _mapClipDataToFlash = function(clipData) {\n var newClipData = {}, formatMap = {};\n if (!(typeof clipData === \"object\" && clipData)) {\n return;\n }\n for (var dataFormat in clipData) {\n if (dataFormat && _hasOwn.call(clipData, dataFormat) && typeof clipData[dataFormat] === \"string\" && clipData[dataFormat]) {\n switch (dataFormat.toLowerCase()) {\n case \"text/plain\":\n case \"text\":\n case \"air:text\":\n case \"flash:text\":\n newClipData.text = clipData[dataFormat];\n formatMap.text = dataFormat;\n break;\n\n case \"text/html\":\n case \"html\":\n case \"air:html\":\n case \"flash:html\":\n newClipData.html = clipData[dataFormat];\n formatMap.html = dataFormat;\n break;\n\n case \"application/rtf\":\n case \"text/rtf\":\n case \"rtf\":\n case \"richtext\":\n case \"air:rtf\":\n case \"flash:rtf\":\n newClipData.rtf = clipData[dataFormat];\n formatMap.rtf = dataFormat;\n break;\n\n default:\n break;\n }\n }\n }\n return {\n data: newClipData,\n formatMap: formatMap\n };\n };\n /**\n * Map the data format names from Flash-friendly names back to their original \"clipData\" names (via a format mapping).\n *\n * @returns A new transformed object.\n * @private\n */\n var _mapClipResultsFromFlash = function(clipResults, formatMap) {\n if (!(typeof clipResults === \"object\" && clipResults && typeof formatMap === \"object\" && formatMap)) {\n return clipResults;\n }\n var newResults = {};\n for (var prop in clipResults) {\n if (_hasOwn.call(clipResults, prop)) {\n if (prop === \"errors\") {\n newResults[prop] = clipResults[prop] ? clipResults[prop].slice() : [];\n for (var i = 0, len = newResults[prop].length; i < len; i++) {\n newResults[prop][i].format = formatMap[newResults[prop][i].format];\n }\n } else if (prop !== \"success\" && prop !== \"data\") {\n newResults[prop] = clipResults[prop];\n } else {\n newResults[prop] = {};\n var tmpHash = clipResults[prop];\n for (var dataFormat in tmpHash) {\n if (dataFormat && _hasOwn.call(tmpHash, dataFormat) && _hasOwn.call(formatMap, dataFormat)) {\n newResults[prop][formatMap[dataFormat]] = tmpHash[dataFormat];\n }\n }\n }\n }\n }\n return newResults;\n };\n /**\n * Will look at a path, and will create a \"?noCache={time}\" or \"&noCache={time}\"\n * query param string to return. Does NOT append that string to the original path.\n * This is useful because ExternalInterface often breaks when a Flash SWF is cached.\n *\n * @returns The `noCache` query param with necessary \"?\"/\"&\" prefix.\n * @private\n */\n var _cacheBust = function(path, options) {\n var cacheBust = options == null || options && options.cacheBust === true;\n if (cacheBust) {\n return (path.indexOf(\"?\") === -1 ? \"?\" : \"&\") + \"noCache=\" + _now();\n } else {\n return \"\";\n }\n };\n /**\n * Creates a query string for the FlashVars param.\n * Does NOT include the cache-busting query param.\n *\n * @returns FlashVars query string\n * @private\n */\n var _vars = function(options) {\n var i, len, domain, domains, str = \"\", trustedOriginsExpanded = [];\n if (options.trustedDomains) {\n if (typeof options.trustedDomains === \"string\") {\n domains = [ options.trustedDomains ];\n } else if (typeof options.trustedDomains === \"object\" && \"length\" in options.trustedDomains) {\n domains = options.trustedDomains;\n }\n }\n if (domains && domains.length) {\n for (i = 0, len = domains.length; i < len; i++) {\n if (_hasOwn.call(domains, i) && domains[i] && typeof domains[i] === \"string\") {\n domain = _extractDomain(domains[i]);\n if (!domain) {\n continue;\n }\n if (domain === \"*\") {\n trustedOriginsExpanded.length = 0;\n trustedOriginsExpanded.push(domain);\n break;\n }\n trustedOriginsExpanded.push.apply(trustedOriginsExpanded, [ domain, \"//\" + domain, _window.location.protocol + \"//\" + domain ]);\n }\n }\n }\n if (trustedOriginsExpanded.length) {\n str += \"trustedOrigins=\" + _encodeURIComponent(trustedOriginsExpanded.join(\",\"));\n }\n if (options.forceEnhancedClipboard === true) {\n str += (str ? \"&\" : \"\") + \"forceEnhancedClipboard=true\";\n }\n if (typeof options.swfObjectId === \"string\" && options.swfObjectId) {\n str += (str ? \"&\" : \"\") + \"swfObjectId=\" + _encodeURIComponent(options.swfObjectId);\n }\n if (typeof options.jsVersion === \"string\" && options.jsVersion) {\n str += (str ? \"&\" : \"\") + \"jsVersion=\" + _encodeURIComponent(options.jsVersion);\n }\n return str;\n };\n /**\n * Extract the domain (e.g. \"github.com\") from an origin (e.g. \"https://github.com\") or\n * URL (e.g. \"https://github.com/zeroclipboard/zeroclipboard/\").\n *\n * @returns the domain\n * @private\n */\n var _extractDomain = function(originOrUrl) {\n if (originOrUrl == null || originOrUrl === \"\") {\n return null;\n }\n originOrUrl = originOrUrl.replace(/^\\s+|\\s+$/g, \"\");\n if (originOrUrl === \"\") {\n return null;\n }\n var protocolIndex = originOrUrl.indexOf(\"//\");\n originOrUrl = protocolIndex === -1 ? originOrUrl : originOrUrl.slice(protocolIndex + 2);\n var pathIndex = originOrUrl.indexOf(\"/\");\n originOrUrl = pathIndex === -1 ? originOrUrl : protocolIndex === -1 || pathIndex === 0 ? null : originOrUrl.slice(0, pathIndex);\n if (originOrUrl && originOrUrl.slice(-4).toLowerCase() === \".swf\") {\n return null;\n }\n return originOrUrl || null;\n };\n /**\n * Set `allowScriptAccess` based on `trustedDomains` and `window.location.host` vs. `swfPath`.\n *\n * @returns The appropriate script access level.\n * @private\n */\n var _determineScriptAccess = function() {\n var _extractAllDomains = function(origins) {\n var i, len, tmp, resultsArray = [];\n if (typeof origins === \"string\") {\n origins = [ origins ];\n }\n if (!(typeof origins === \"object\" && origins && typeof origins.length === \"number\")) {\n return resultsArray;\n }\n for (i = 0, len = origins.length; i < len; i++) {\n if (_hasOwn.call(origins, i) && (tmp = _extractDomain(origins[i]))) {\n if (tmp === \"*\") {\n resultsArray.length = 0;\n resultsArray.push(\"*\");\n break;\n }\n if (resultsArray.indexOf(tmp) === -1) {\n resultsArray.push(tmp);\n }\n }\n }\n return resultsArray;\n };\n return function(currentDomain, configOptions) {\n var swfDomain = _extractDomain(configOptions.swfPath);\n if (swfDomain === null) {\n swfDomain = currentDomain;\n }\n var trustedDomains = _extractAllDomains(configOptions.trustedDomains);\n var len = trustedDomains.length;\n if (len > 0) {\n if (len === 1 && trustedDomains[0] === \"*\") {\n return \"always\";\n }\n if (trustedDomains.indexOf(currentDomain) !== -1) {\n if (len === 1 && currentDomain === swfDomain) {\n return \"sameDomain\";\n }\n return \"always\";\n }\n }\n return \"never\";\n };\n }();\n /**\n * Get the currently active/focused DOM element.\n *\n * @returns the currently active/focused element, or `null`\n * @private\n */\n var _safeActiveElement = function() {\n try {\n return _document.activeElement;\n } catch (err) {\n return null;\n }\n };\n /**\n * Add a class to an element, if it doesn't already have it.\n *\n * @returns The element, with its new class added.\n * @private\n */\n var _addClass = function(element, value) {\n var c, cl, className, classNames = [];\n if (typeof value === \"string\" && value) {\n classNames = value.split(/\\s+/);\n }\n if (element && element.nodeType === 1 && classNames.length > 0) {\n className = (\" \" + (element.className || \"\") + \" \").replace(/[\\t\\r\\n\\f]/g, \" \");\n for (c = 0, cl = classNames.length; c < cl; c++) {\n if (className.indexOf(\" \" + classNames[c] + \" \") === -1) {\n className += classNames[c] + \" \";\n }\n }\n className = className.replace(/^\\s+|\\s+$/g, \"\");\n if (className !== element.className) {\n element.className = className;\n }\n }\n return element;\n };\n /**\n * Remove a class from an element, if it has it.\n *\n * @returns The element, with its class removed.\n * @private\n */\n var _removeClass = function(element, value) {\n var c, cl, className, classNames = [];\n if (typeof value === \"string\" && value) {\n classNames = value.split(/\\s+/);\n }\n if (element && element.nodeType === 1 && classNames.length > 0) {\n if (element.className) {\n className = (\" \" + element.className + \" \").replace(/[\\t\\r\\n\\f]/g, \" \");\n for (c = 0, cl = classNames.length; c < cl; c++) {\n className = className.replace(\" \" + classNames[c] + \" \", \" \");\n }\n className = className.replace(/^\\s+|\\s+$/g, \"\");\n if (className !== element.className) {\n element.className = className;\n }\n }\n }\n return element;\n };\n /**\n * Attempt to interpret the element's CSS styling. If `prop` is `\"cursor\"`,\n * then we assume that it should be a hand (\"pointer\") cursor if the element\n * is an anchor element (\"a\" tag).\n *\n * @returns The computed style property.\n * @private\n */\n var _getStyle = function(el, prop) {\n var value = _getComputedStyle(el, null).getPropertyValue(prop);\n if (prop === \"cursor\") {\n if (!value || value === \"auto\") {\n if (el.nodeName === \"A\") {\n return \"pointer\";\n }\n }\n }\n return value;\n };\n /**\n * Get the absolutely positioned coordinates of a DOM element.\n *\n * @returns Object containing the element's position, width, and height.\n * @private\n */\n var _getElementPosition = function(el) {\n var pos = {\n left: 0,\n top: 0,\n width: 0,\n height: 0\n };\n if (el.getBoundingClientRect) {\n var elRect = el.getBoundingClientRect();\n var pageXOffset = _window.pageXOffset;\n var pageYOffset = _window.pageYOffset;\n var leftBorderWidth = _document.documentElement.clientLeft || 0;\n var topBorderWidth = _document.documentElement.clientTop || 0;\n var leftBodyOffset = 0;\n var topBodyOffset = 0;\n if (_getStyle(_document.body, \"position\") === \"relative\") {\n var bodyRect = _document.body.getBoundingClientRect();\n var htmlRect = _document.documentElement.getBoundingClientRect();\n leftBodyOffset = bodyRect.left - htmlRect.left || 0;\n topBodyOffset = bodyRect.top - htmlRect.top || 0;\n }\n pos.left = elRect.left + pageXOffset - leftBorderWidth - leftBodyOffset;\n pos.top = elRect.top + pageYOffset - topBorderWidth - topBodyOffset;\n pos.width = \"width\" in elRect ? elRect.width : elRect.right - elRect.left;\n pos.height = \"height\" in elRect ? elRect.height : elRect.bottom - elRect.top;\n }\n return pos;\n };\n /**\n * Determine is an element is visible somewhere within the document (page).\n *\n * @returns Boolean\n * @private\n */\n var _isElementVisible = function(el) {\n if (!el) {\n return false;\n }\n var styles = _getComputedStyle(el, null);\n if (!styles) {\n return false;\n }\n var hasCssHeight = _parseFloat(styles.height) > 0;\n var hasCssWidth = _parseFloat(styles.width) > 0;\n var hasCssTop = _parseFloat(styles.top) >= 0;\n var hasCssLeft = _parseFloat(styles.left) >= 0;\n var cssKnows = hasCssHeight && hasCssWidth && hasCssTop && hasCssLeft;\n var rect = cssKnows ? null : _getElementPosition(el);\n var isVisible = styles.display !== \"none\" && styles.visibility !== \"collapse\" && (cssKnows || !!rect && (hasCssHeight || rect.height > 0) && (hasCssWidth || rect.width > 0) && (hasCssTop || rect.top >= 0) && (hasCssLeft || rect.left >= 0));\n return isVisible;\n };\n /**\n * Clear all existing timeouts and interval polling delegates.\n *\n * @returns `undefined`\n * @private\n */\n var _clearTimeoutsAndPolling = function() {\n _clearTimeout(_flashCheckTimeout);\n _flashCheckTimeout = 0;\n _clearInterval(_swfFallbackCheckInterval);\n _swfFallbackCheckInterval = 0;\n };\n /**\n * Reposition the Flash object to cover the currently activated element.\n *\n * @returns `undefined`\n * @private\n */\n var _reposition = function() {\n var htmlBridge;\n if (_currentElement && (htmlBridge = _getHtmlBridge(_flashState.bridge))) {\n var pos = _getElementPosition(_currentElement);\n _extend(htmlBridge.style, {\n width: pos.width + \"px\",\n height: pos.height + \"px\",\n top: pos.top + \"px\",\n left: pos.left + \"px\",\n zIndex: \"\" + _getSafeZIndex(_globalConfig.zIndex)\n });\n }\n };\n /**\n * Sends a signal to the Flash object to display the hand cursor if `true`.\n *\n * @returns `undefined`\n * @private\n */\n var _setHandCursor = function(enabled) {\n if (_flashState.ready === true) {\n if (_flashState.bridge && typeof _flashState.bridge.setHandCursor === \"function\") {\n _flashState.bridge.setHandCursor(enabled);\n } else {\n _flashState.ready = false;\n }\n }\n };\n /**\n * Get a safe value for `zIndex`\n *\n * @returns an integer, or \"auto\"\n * @private\n */\n var _getSafeZIndex = function(val) {\n if (/^(?:auto|inherit)$/.test(val)) {\n return val;\n }\n var zIndex;\n if (typeof val === \"number\" && !_isNaN(val)) {\n zIndex = val;\n } else if (typeof val === \"string\") {\n zIndex = _getSafeZIndex(_parseInt(val, 10));\n }\n return typeof zIndex === \"number\" ? zIndex : \"auto\";\n };\n /**\n * Ensure OS-compliant line endings, i.e. \"\\r\\n\" on Windows, \"\\n\" elsewhere\n *\n * @returns string\n * @private\n */\n var _fixLineEndings = function(content) {\n var replaceRegex = /(\\r\\n|\\r|\\n)/g;\n if (typeof content === \"string\" && _globalConfig.fixLineEndings === true) {\n if (_isWindows()) {\n if (/((^|[^\\r])\\n|\\r([^\\n]|$))/.test(content)) {\n content = content.replace(replaceRegex, \"\\r\\n\");\n }\n } else if (/\\r/.test(content)) {\n content = content.replace(replaceRegex, \"\\n\");\n }\n }\n return content;\n };\n /**\n * Attempt to detect if ZeroClipboard is executing inside of a sandboxed iframe.\n * If it is, Flash Player cannot be used, so ZeroClipboard is dead in the water.\n *\n * @see {@link http://lists.w3.org/Archives/Public/public-whatwg-archive/2014Dec/0002.html}\n * @see {@link https://github.com/zeroclipboard/zeroclipboard/issues/511}\n * @see {@link http://zeroclipboard.github.io/test-iframes.html}\n *\n * @returns `true` (is sandboxed), `false` (is not sandboxed), or `null` (uncertain)\n * @private\n */\n var _detectSandbox = function(doNotReassessFlashSupport) {\n var effectiveScriptOrigin, frame, frameError, previousState = _flashState.sandboxed, isSandboxed = null;\n doNotReassessFlashSupport = doNotReassessFlashSupport === true;\n if (_pageIsFramed === false) {\n isSandboxed = false;\n } else {\n try {\n frame = window.frameElement || null;\n } catch (e) {\n frameError = {\n name: e.name,\n message: e.message\n };\n }\n if (frame && frame.nodeType === 1 && frame.nodeName === \"IFRAME\") {\n try {\n isSandboxed = frame.hasAttribute(\"sandbox\");\n } catch (e) {\n isSandboxed = null;\n }\n } else {\n try {\n effectiveScriptOrigin = document.domain || null;\n } catch (e) {\n effectiveScriptOrigin = null;\n }\n if (effectiveScriptOrigin === null || frameError && frameError.name === \"SecurityError\" && /(^|[\\s\\(\\[@])sandbox(es|ed|ing|[\\s\\.,!\\)\\]@]|$)/.test(frameError.message.toLowerCase())) {\n isSandboxed = true;\n }\n }\n }\n _flashState.sandboxed = isSandboxed;\n if (previousState !== isSandboxed && !doNotReassessFlashSupport) {\n _detectFlashSupport(_ActiveXObject);\n }\n return isSandboxed;\n };\n /**\n * Detect the Flash Player status, version, and plugin type.\n *\n * @see {@link https://code.google.com/p/doctype-mirror/wiki/ArticleDetectFlash#The_code}\n * @see {@link http://stackoverflow.com/questions/12866060/detecting-pepper-ppapi-flash-with-javascript}\n *\n * @returns `undefined`\n * @private\n */\n var _detectFlashSupport = function(ActiveXObject) {\n var plugin, ax, mimeType, hasFlash = false, isActiveX = false, isPPAPI = false, flashVersion = \"\";\n /**\n * Derived from Apple's suggested sniffer.\n * @param {String} desc e.g. \"Shockwave Flash 7.0 r61\"\n * @returns {String} \"7.0.61\"\n * @private\n */\n function parseFlashVersion(desc) {\n var matches = desc.match(/[\\d]+/g);\n matches.length = 3;\n return matches.join(\".\");\n }\n function isPepperFlash(flashPlayerFileName) {\n return !!flashPlayerFileName && (flashPlayerFileName = flashPlayerFileName.toLowerCase()) && (/^(pepflashplayer\\.dll|libpepflashplayer\\.so|pepperflashplayer\\.plugin)$/.test(flashPlayerFileName) || flashPlayerFileName.slice(-13) === \"chrome.plugin\");\n }\n function inspectPlugin(plugin) {\n if (plugin) {\n hasFlash = true;\n if (plugin.version) {\n flashVersion = parseFlashVersion(plugin.version);\n }\n if (!flashVersion && plugin.description) {\n flashVersion = parseFlashVersion(plugin.description);\n }\n if (plugin.filename) {\n isPPAPI = isPepperFlash(plugin.filename);\n }\n }\n }\n if (_navigator.plugins && _navigator.plugins.length) {\n plugin = _navigator.plugins[\"Shockwave Flash\"];\n inspectPlugin(plugin);\n if (_navigator.plugins[\"Shockwave Flash 2.0\"]) {\n hasFlash = true;\n flashVersion = \"2.0.0.11\";\n }\n } else if (_navigator.mimeTypes && _navigator.mimeTypes.length) {\n mimeType = _navigator.mimeTypes[\"application/x-shockwave-flash\"];\n plugin = mimeType && mimeType.enabledPlugin;\n inspectPlugin(plugin);\n } else if (typeof ActiveXObject !== \"undefined\") {\n isActiveX = true;\n try {\n ax = new ActiveXObject(\"ShockwaveFlash.ShockwaveFlash.7\");\n hasFlash = true;\n flashVersion = parseFlashVersion(ax.GetVariable(\"$version\"));\n } catch (e1) {\n try {\n ax = new ActiveXObject(\"ShockwaveFlash.ShockwaveFlash.6\");\n hasFlash = true;\n flashVersion = \"6.0.21\";\n } catch (e2) {\n try {\n ax = new ActiveXObject(\"ShockwaveFlash.ShockwaveFlash\");\n hasFlash = true;\n flashVersion = parseFlashVersion(ax.GetVariable(\"$version\"));\n } catch (e3) {\n isActiveX = false;\n }\n }\n }\n }\n _flashState.disabled = hasFlash !== true;\n _flashState.outdated = flashVersion && _parseFloat(flashVersion) < _parseFloat(_minimumFlashVersion);\n _flashState.version = flashVersion || \"0.0.0\";\n _flashState.pluginType = isPPAPI ? \"pepper\" : isActiveX ? \"activex\" : hasFlash ? \"netscape\" : \"unknown\";\n };\n /**\n * Invoke the Flash detection algorithms immediately upon inclusion so we're not waiting later.\n */\n _detectFlashSupport(_ActiveXObject);\n /**\n * Always assess the `sandboxed` state of the page at important Flash-related moments.\n */\n _detectSandbox(true);\n /**\n * A shell constructor for `ZeroClipboard` client instances.\n *\n * @constructor\n */\n var ZeroClipboard = function() {\n if (!(this instanceof ZeroClipboard)) {\n return new ZeroClipboard();\n }\n if (typeof ZeroClipboard._createClient === \"function\") {\n ZeroClipboard._createClient.apply(this, _args(arguments));\n }\n };\n /**\n * The ZeroClipboard library's version number.\n *\n * @static\n * @readonly\n * @property {string}\n */\n ZeroClipboard.version = \"2.4.0-beta.1\";\n /**\n * Update or get a copy of the ZeroClipboard global configuration.\n * Returns a copy of the current/updated configuration.\n *\n * @returns Object\n * @static\n */\n ZeroClipboard.config = function() {\n return _config.apply(this, _args(arguments));\n };\n /**\n * Diagnostic method that describes the state of the browser, Flash Player, and ZeroClipboard.\n *\n * @returns Object\n * @static\n */\n ZeroClipboard.state = function() {\n return _state.apply(this, _args(arguments));\n };\n /**\n * Check if Flash is unusable for any reason: disabled, outdated, deactivated, etc.\n *\n * @returns Boolean\n * @static\n */\n ZeroClipboard.isFlashUnusable = function() {\n return _isFlashUnusable.apply(this, _args(arguments));\n };\n /**\n * Register an event listener.\n *\n * @returns `ZeroClipboard`\n * @static\n */\n ZeroClipboard.on = function() {\n return _on.apply(this, _args(arguments));\n };\n /**\n * Unregister an event listener.\n * If no `listener` function/object is provided, it will unregister all listeners for the provided `eventType`.\n * If no `eventType` is provided, it will unregister all listeners for every event type.\n *\n * @returns `ZeroClipboard`\n * @static\n */\n ZeroClipboard.off = function() {\n return _off.apply(this, _args(arguments));\n };\n /**\n * Retrieve event listeners for an `eventType`.\n * If no `eventType` is provided, it will retrieve all listeners for every event type.\n *\n * @returns array of listeners for the `eventType`; if no `eventType`, then a map/hash object of listeners for all event types; or `null`\n */\n ZeroClipboard.handlers = function() {\n return _listeners.apply(this, _args(arguments));\n };\n /**\n * Event emission receiver from the Flash object, forwarding to any registered JavaScript event listeners.\n *\n * @returns For the \"copy\" event, returns the Flash-friendly \"clipData\" object; otherwise `undefined`.\n * @static\n */\n ZeroClipboard.emit = function() {\n return _emit.apply(this, _args(arguments));\n };\n /**\n * Create and embed the Flash object.\n *\n * @returns The Flash object\n * @static\n */\n ZeroClipboard.create = function() {\n return _create.apply(this, _args(arguments));\n };\n /**\n * Self-destruct and clean up everything, including the embedded Flash object.\n *\n * @returns `undefined`\n * @static\n */\n ZeroClipboard.destroy = function() {\n return _destroy.apply(this, _args(arguments));\n };\n /**\n * Set the pending data for clipboard injection.\n *\n * @returns `undefined`\n * @static\n */\n ZeroClipboard.setData = function() {\n return _setData.apply(this, _args(arguments));\n };\n /**\n * Clear the pending data for clipboard injection.\n * If no `format` is provided, all pending data formats will be cleared.\n *\n * @returns `undefined`\n * @static\n */\n ZeroClipboard.clearData = function() {\n return _clearData.apply(this, _args(arguments));\n };\n /**\n * Get a copy of the pending data for clipboard injection.\n * If no `format` is provided, a copy of ALL pending data formats will be returned.\n *\n * @returns `String` or `Object`\n * @static\n */\n ZeroClipboard.getData = function() {\n return _getData.apply(this, _args(arguments));\n };\n /**\n * Sets the current HTML object that the Flash object should overlay. This will put the global\n * Flash object on top of the current element; depending on the setup, this may also set the\n * pending clipboard text data as well as the Flash object's wrapping element's title attribute\n * based on the underlying HTML element and ZeroClipboard configuration.\n *\n * @returns `undefined`\n * @static\n */\n ZeroClipboard.focus = ZeroClipboard.activate = function() {\n return _focus.apply(this, _args(arguments));\n };\n /**\n * Un-overlays the Flash object. This will put the global Flash object off-screen; depending on\n * the setup, this may also unset the Flash object's wrapping element's title attribute based on\n * the underlying HTML element and ZeroClipboard configuration.\n *\n * @returns `undefined`\n * @static\n */\n ZeroClipboard.blur = ZeroClipboard.deactivate = function() {\n return _blur.apply(this, _args(arguments));\n };\n /**\n * Returns the currently focused/\"activated\" HTML element that the Flash object is wrapping.\n *\n * @returns `HTMLElement` or `null`\n * @static\n */\n ZeroClipboard.activeElement = function() {\n return _activeElement.apply(this, _args(arguments));\n };\n if (typeof define === \"function\" && define.amd) {\n define(function() {\n return ZeroClipboard;\n });\n } else if (typeof module === \"object\" && module && typeof module.exports === \"object\" && module.exports) {\n module.exports = ZeroClipboard;\n } else {\n window.ZeroClipboard = ZeroClipboard;\n }\n})(function() {\n return this || window;\n}());"]}
\ No newline at end of file
diff --git a/js/ZeroClipboard.js b/js/ZeroClipboard.js
new file mode 100644
index 0000000..f81fae3
--- /dev/null
+++ b/js/ZeroClipboard.js
@@ -0,0 +1,2716 @@
+/*!
+ * ZeroClipboard
+ * The ZeroClipboard library provides an easy way to copy text to the clipboard using an invisible Adobe Flash movie and a JavaScript interface
+ * Copyright (c) 2009-2017 Jon Rohan, James M. Greene
+ * Licensed MIT
+ * http://zeroclipboard.github.io/
+ * v2.4.0-beta.1
+ */
+(function(window, undefined) {
+ "use strict";
+ /**
+ * Store references to critically important global functions that may be
+ * overridden on certain web pages.
+ */
+ var _window = window, _document = _window.document, _navigator = _window.navigator, _setTimeout = _window.setTimeout, _clearTimeout = _window.clearTimeout, _setInterval = _window.setInterval, _clearInterval = _window.clearInterval, _getComputedStyle = _window.getComputedStyle, _encodeURIComponent = _window.encodeURIComponent, _ActiveXObject = _window.ActiveXObject, _Error = _window.Error, _parseInt = _window.Number.parseInt || _window.parseInt, _parseFloat = _window.Number.parseFloat || _window.parseFloat, _isNaN = _window.Number.isNaN || _window.isNaN, _now = _window.Date.now, _keys = _window.Object.keys, _hasOwn = _window.Object.prototype.hasOwnProperty, _slice = _window.Array.prototype.slice, _unwrap = function() {
+ var unwrapper = function(el) {
+ return el;
+ };
+ if (typeof _window.wrap === "function" && typeof _window.unwrap === "function") {
+ try {
+ var div = _document.createElement("div");
+ var unwrappedDiv = _window.unwrap(div);
+ if (div.nodeType === 1 && unwrappedDiv && unwrappedDiv.nodeType === 1) {
+ unwrapper = _window.unwrap;
+ }
+ } catch (e) {}
+ }
+ return unwrapper;
+ }();
+ /**
+ * Convert an `arguments` object into an Array.
+ *
+ * @returns The arguments as an Array
+ * @private
+ */
+ var _args = function(argumentsObj) {
+ return _slice.call(argumentsObj, 0);
+ };
+ /**
+ * Shallow-copy the owned, enumerable properties of one object over to another, similar to jQuery's `$.extend`.
+ *
+ * @returns The target object, augmented
+ * @private
+ */
+ var _extend = function() {
+ var i, len, arg, prop, src, copy, args = _args(arguments), target = args[0] || {};
+ for (i = 1, len = args.length; i < len; i++) {
+ if ((arg = args[i]) != null) {
+ for (prop in arg) {
+ if (_hasOwn.call(arg, prop)) {
+ src = target[prop];
+ copy = arg[prop];
+ if (target !== copy && copy !== undefined) {
+ target[prop] = copy;
+ }
+ }
+ }
+ }
+ }
+ return target;
+ };
+ /**
+ * Return a deep copy of the source object or array.
+ *
+ * @returns Object or Array
+ * @private
+ */
+ var _deepCopy = function(source) {
+ var copy, i, len, prop;
+ if (typeof source !== "object" || source == null || typeof source.nodeType === "number") {
+ copy = source;
+ } else if (typeof source.length === "number") {
+ copy = [];
+ for (i = 0, len = source.length; i < len; i++) {
+ if (_hasOwn.call(source, i)) {
+ copy[i] = _deepCopy(source[i]);
+ }
+ }
+ } else {
+ copy = {};
+ for (prop in source) {
+ if (_hasOwn.call(source, prop)) {
+ copy[prop] = _deepCopy(source[prop]);
+ }
+ }
+ }
+ return copy;
+ };
+ /**
+ * Makes a shallow copy of `obj` (like `_extend`) but filters its properties based on a list of `keys` to keep.
+ * The inverse of `_omit`, mostly. The big difference is that these properties do NOT need to be enumerable to
+ * be kept.
+ *
+ * @returns A new filtered object.
+ * @private
+ */
+ var _pick = function(obj, keys) {
+ var newObj = {};
+ for (var i = 0, len = keys.length; i < len; i++) {
+ if (keys[i] in obj) {
+ newObj[keys[i]] = obj[keys[i]];
+ }
+ }
+ return newObj;
+ };
+ /**
+ * Makes a shallow copy of `obj` (like `_extend`) but filters its properties based on a list of `keys` to omit.
+ * The inverse of `_pick`.
+ *
+ * @returns A new filtered object.
+ * @private
+ */
+ var _omit = function(obj, keys) {
+ var newObj = {};
+ for (var prop in obj) {
+ if (keys.indexOf(prop) === -1) {
+ newObj[prop] = obj[prop];
+ }
+ }
+ return newObj;
+ };
+ /**
+ * Remove all owned, enumerable properties from an object.
+ *
+ * @returns The original object without its owned, enumerable properties.
+ * @private
+ */
+ var _deleteOwnProperties = function(obj) {
+ if (obj) {
+ for (var prop in obj) {
+ if (_hasOwn.call(obj, prop)) {
+ delete obj[prop];
+ }
+ }
+ }
+ return obj;
+ };
+ /**
+ * Determine if an element is contained within another element.
+ *
+ * @returns Boolean
+ * @private
+ */
+ var _containedBy = function(el, ancestorEl) {
+ if (el && el.nodeType === 1 && el.ownerDocument && ancestorEl && (ancestorEl.nodeType === 1 && ancestorEl.ownerDocument && ancestorEl.ownerDocument === el.ownerDocument || ancestorEl.nodeType === 9 && !ancestorEl.ownerDocument && ancestorEl === el.ownerDocument)) {
+ do {
+ if (el === ancestorEl) {
+ return true;
+ }
+ el = el.parentNode;
+ } while (el);
+ }
+ return false;
+ };
+ /**
+ * Get the URL path's parent directory.
+ *
+ * @returns String or `undefined`
+ * @private
+ */
+ var _getDirPathOfUrl = function(url) {
+ var dir;
+ if (typeof url === "string" && url) {
+ dir = url.split("#")[0].split("?")[0];
+ dir = url.slice(0, url.lastIndexOf("/") + 1);
+ }
+ return dir;
+ };
+ /**
+ * Get the current script's URL by throwing an `Error` and analyzing it.
+ *
+ * @returns String or `undefined`
+ * @private
+ */
+ var _getCurrentScriptUrlFromErrorStack = function(stack) {
+ var url, matches;
+ if (typeof stack === "string" && stack) {
+ matches = stack.match(/^(?:|[^:@]*@|.+\)@(?=http[s]?|file)|.+?\s+(?: at |@)(?:[^:\(]+ )*[\(]?)((?:http[s]?|file):\/\/[\/]?.+?\/[^:\)]*?)(?::\d+)(?::\d+)?/);
+ if (matches && matches[1]) {
+ url = matches[1];
+ } else {
+ matches = stack.match(/\)@((?:http[s]?|file):\/\/[\/]?.+?\/[^:\)]*?)(?::\d+)(?::\d+)?/);
+ if (matches && matches[1]) {
+ url = matches[1];
+ }
+ }
+ }
+ return url;
+ };
+ /**
+ * Get the current script's URL by throwing an `Error` and analyzing it.
+ *
+ * @returns String or `undefined`
+ * @private
+ */
+ var _getCurrentScriptUrlFromError = function() {
+ var url, err;
+ try {
+ throw new _Error();
+ } catch (e) {
+ err = e;
+ }
+ if (err) {
+ url = err.sourceURL || err.fileName || _getCurrentScriptUrlFromErrorStack(err.stack);
+ }
+ return url;
+ };
+ /**
+ * Get the current script's URL.
+ *
+ * @returns String or `undefined`
+ * @private
+ */
+ var _getCurrentScriptUrl = function() {
+ var jsPath, scripts, i;
+ if (_document.currentScript && (jsPath = _document.currentScript.src)) {
+ return jsPath;
+ }
+ scripts = _document.getElementsByTagName("script");
+ if (scripts.length === 1) {
+ return scripts[0].src || undefined;
+ }
+ if ("readyState" in (scripts[0] || document.createElement("script"))) {
+ for (i = scripts.length; i--; ) {
+ if (scripts[i].readyState === "interactive" && (jsPath = scripts[i].src)) {
+ return jsPath;
+ }
+ }
+ }
+ if (_document.readyState === "loading" && (jsPath = scripts[scripts.length - 1].src)) {
+ return jsPath;
+ }
+ if (jsPath = _getCurrentScriptUrlFromError()) {
+ return jsPath;
+ }
+ return undefined;
+ };
+ /**
+ * Get the unanimous parent directory of ALL script tags.
+ * If any script tags are either (a) inline or (b) from differing parent
+ * directories, this method must return `undefined`.
+ *
+ * @returns String or `undefined`
+ * @private
+ */
+ var _getUnanimousScriptParentDir = function() {
+ var i, jsDir, jsPath, scripts = _document.getElementsByTagName("script");
+ for (i = scripts.length; i--; ) {
+ if (!(jsPath = scripts[i].src)) {
+ jsDir = null;
+ break;
+ }
+ jsPath = _getDirPathOfUrl(jsPath);
+ if (jsDir == null) {
+ jsDir = jsPath;
+ } else if (jsDir !== jsPath) {
+ jsDir = null;
+ break;
+ }
+ }
+ return jsDir || undefined;
+ };
+ /**
+ * Get the presumed location of the "ZeroClipboard.swf" file, based on the location
+ * of the executing JavaScript file (e.g. "ZeroClipboard.js", etc.).
+ *
+ * @returns String
+ * @private
+ */
+ var _getDefaultSwfPath = function() {
+ var jsDir = _getDirPathOfUrl(_getCurrentScriptUrl()) || _getUnanimousScriptParentDir() || "";
+ return jsDir + "ZeroClipboard.swf";
+ };
+ /**
+ * Is the client's operating system some version of Windows?
+ *
+ * @returns Boolean
+ * @private
+ */
+ var _isWindows = function() {
+ var isWindowsRegex = /win(dows|[\s]?(nt|me|ce|xp|vista|[\d]+))/i;
+ return !!_navigator && (isWindowsRegex.test(_navigator.appVersion || "") || isWindowsRegex.test(_navigator.platform || "") || (_navigator.userAgent || "").indexOf("Windows") !== -1);
+ };
+ /**
+ * Keep track of if the page is framed (in an `iframe`). This can never change.
+ * @private
+ */
+ var _pageIsFramed = function() {
+ return _window.opener == null && (!!_window.top && _window != _window.top || !!_window.parent && _window != _window.parent);
+ }();
+ /**
+ * Keep track of if the page is XHTML (vs. HTML), which requires that everything
+ * be rendering in XML mode.
+ * @private
+ */
+ var _pageIsXhtml = _document.documentElement.nodeName === "html";
+ /**
+ * Keep track of the state of the Flash object.
+ * @private
+ */
+ var _flashState = {
+ bridge: null,
+ version: "0.0.0",
+ pluginType: "unknown",
+ sandboxed: null,
+ disabled: null,
+ outdated: null,
+ insecure: null,
+ unavailable: null,
+ degraded: null,
+ deactivated: null,
+ overdue: null,
+ ready: null
+ };
+ /**
+ * The minimum Flash Player version required to use ZeroClipboard completely.
+ * @readonly
+ * @private
+ */
+ var _minimumFlashVersion = "11.0.0";
+ /**
+ * The ZeroClipboard library version number, as reported by Flash, at the time the SWF was compiled.
+ */
+ var _zcSwfVersion;
+ /**
+ * Keep track of all event listener registrations.
+ * @private
+ */
+ var _handlers = {};
+ /**
+ * Keep track of the currently activated element.
+ * @private
+ */
+ var _currentElement;
+ /**
+ * Keep track of the element that was activated when a `copy` process started.
+ * @private
+ */
+ var _copyTarget;
+ /**
+ * Keep track of data for the pending clipboard transaction.
+ * @private
+ */
+ var _clipData = {};
+ /**
+ * Keep track of data formats for the pending clipboard transaction.
+ * @private
+ */
+ var _clipDataFormatMap = null;
+ /**
+ * Keep track of the Flash availability check timeout.
+ * @private
+ */
+ var _flashCheckTimeout = 0;
+ /**
+ * Keep track of SWF network errors interval polling.
+ * @private
+ */
+ var _swfFallbackCheckInterval = 0;
+ /**
+ * The `message` store for events
+ * @private
+ */
+ var _eventMessages = {
+ ready: "Flash communication is established",
+ error: {
+ "flash-sandboxed": "Attempting to run Flash in a sandboxed iframe, which is impossible",
+ "flash-disabled": "Flash is disabled or not installed. May also be attempting to run Flash in a sandboxed iframe, which is impossible.",
+ "flash-outdated": "Flash is too outdated to support ZeroClipboard",
+ "flash-insecure": "Flash will be unable to communicate due to a protocol mismatch between your `swfPath` configuration and the page",
+ "flash-unavailable": "Flash is unable to communicate bidirectionally with JavaScript",
+ "flash-degraded": "Flash is unable to preserve data fidelity when communicating with JavaScript",
+ "flash-deactivated": "Flash is too outdated for your browser and/or is configured as click-to-activate.\nThis may also mean that the ZeroClipboard SWF object could not be loaded, so please check your `swfPath` configuration and/or network connectivity.\nMay also be attempting to run Flash in a sandboxed iframe, which is impossible.",
+ "flash-overdue": "Flash communication was established but NOT within the acceptable time limit",
+ "version-mismatch": "ZeroClipboard JS version number does not match ZeroClipboard SWF version number",
+ "clipboard-error": "At least one error was thrown while ZeroClipboard was attempting to inject your data into the clipboard",
+ "config-mismatch": "ZeroClipboard configuration does not match Flash's reality",
+ "swf-not-found": "The ZeroClipboard SWF object could not be loaded, so please check your `swfPath` configuration and/or network connectivity",
+ "browser-unsupported": "The browser does not support the required HTML DOM and JavaScript features"
+ }
+ };
+ /**
+ * The `name`s of `error` events that can only occur is Flash has at least
+ * been able to load the SWF successfully.
+ * @private
+ */
+ var _errorsThatOnlyOccurAfterFlashLoads = [ "flash-unavailable", "flash-degraded", "flash-overdue", "version-mismatch", "config-mismatch", "clipboard-error" ];
+ /**
+ * The `name`s of `error` events that should likely result in the `_flashState`
+ * variable's property values being updated.
+ * @private
+ */
+ var _flashStateErrorNames = [ "flash-sandboxed", "flash-disabled", "flash-outdated", "flash-insecure", "flash-unavailable", "flash-degraded", "flash-deactivated", "flash-overdue" ];
+ /**
+ * A RegExp to match the `name` property of `error` events related to Flash.
+ * @private
+ */
+ var _flashStateErrorNameMatchingRegex = new RegExp("^flash-(" + _flashStateErrorNames.map(function(errorName) {
+ return errorName.replace(/^flash-/, "");
+ }).join("|") + ")$");
+ /**
+ * A RegExp to match the `name` property of `error` events related to Flash,
+ * which is enabled.
+ * @private
+ */
+ var _flashStateEnabledErrorNameMatchingRegex = new RegExp("^flash-(" + _flashStateErrorNames.filter(function(errorName) {
+ return errorName !== "flash-disabled";
+ }).map(function(errorName) {
+ return errorName.replace(/^flash-/, "");
+ }).join("|") + ")$");
+ /**
+ * ZeroClipboard configuration defaults for the Core module.
+ * @private
+ */
+ var _globalConfig = {
+ swfPath: _getDefaultSwfPath(),
+ trustedDomains: _window.location.host ? [ _window.location.host ] : [],
+ cacheBust: true,
+ forceEnhancedClipboard: false,
+ flashLoadTimeout: 3e4,
+ autoActivate: true,
+ bubbleEvents: true,
+ fixLineEndings: true,
+ containerId: "global-zeroclipboard-html-bridge",
+ containerClass: "global-zeroclipboard-container",
+ swfObjectId: "global-zeroclipboard-flash-bridge",
+ hoverClass: "zeroclipboard-is-hover",
+ activeClass: "zeroclipboard-is-active",
+ forceHandCursor: false,
+ title: null,
+ zIndex: 999999999
+ };
+ /**
+ * The underlying implementation of `ZeroClipboard.config`.
+ * @private
+ */
+ var _config = function(options) {
+ if (typeof options === "object" && options && !("length" in options)) {
+ _keys(options).forEach(function(prop) {
+ if (/^(?:forceHandCursor|title|zIndex|bubbleEvents|fixLineEndings)$/.test(prop)) {
+ _globalConfig[prop] = options[prop];
+ } else if (_flashState.bridge == null) {
+ if (prop === "containerId" || prop === "swfObjectId") {
+ if (_isValidHtml4Id(options[prop])) {
+ _globalConfig[prop] = options[prop];
+ } else {
+ throw new Error("The specified `" + prop + "` value is not valid as an HTML4 Element ID");
+ }
+ } else {
+ _globalConfig[prop] = options[prop];
+ }
+ }
+ });
+ }
+ if (typeof options === "string" && options) {
+ if (_hasOwn.call(_globalConfig, options)) {
+ return _globalConfig[options];
+ }
+ return;
+ }
+ return _deepCopy(_globalConfig);
+ };
+ /**
+ * The underlying implementation of `ZeroClipboard.state`.
+ * @private
+ */
+ var _state = function() {
+ _detectSandbox();
+ return {
+ browser: _extend(_pick(_navigator, [ "userAgent", "platform", "appName", "appVersion" ]), {
+ isSupported: _isBrowserSupported()
+ }),
+ flash: _omit(_flashState, [ "bridge" ]),
+ zeroclipboard: {
+ version: ZeroClipboard.version,
+ config: ZeroClipboard.config()
+ }
+ };
+ };
+ /**
+ * Does this browser support all of the necessary DOM and JS features necessary?
+ * @private
+ */
+ var _isBrowserSupported = function() {
+ return !!(_document.addEventListener && _window.Object.keys && _window.Array.prototype.map);
+ };
+ /**
+ * The underlying implementation of `ZeroClipboard.isFlashUnusable`.
+ * @private
+ */
+ var _isFlashUnusable = function() {
+ return !!(_flashState.sandboxed || _flashState.disabled || _flashState.outdated || _flashState.unavailable || _flashState.degraded || _flashState.deactivated);
+ };
+ /**
+ * The underlying implementation of `ZeroClipboard.on`.
+ * @private
+ */
+ var _on = function(eventType, listener) {
+ var i, len, events, added = {};
+ if (typeof eventType === "string" && eventType) {
+ events = eventType.toLowerCase().split(/\s+/);
+ } else if (typeof eventType === "object" && eventType && !("length" in eventType) && typeof listener === "undefined") {
+ _keys(eventType).forEach(function(key) {
+ var listener = eventType[key];
+ if (typeof listener === "function") {
+ ZeroClipboard.on(key, listener);
+ }
+ });
+ }
+ if (events && events.length && listener) {
+ for (i = 0, len = events.length; i < len; i++) {
+ eventType = events[i].replace(/^on/, "");
+ added[eventType] = true;
+ if (!_handlers[eventType]) {
+ _handlers[eventType] = [];
+ }
+ _handlers[eventType].push(listener);
+ }
+ if (added.ready && _flashState.ready) {
+ ZeroClipboard.emit({
+ type: "ready"
+ });
+ }
+ if (added.error) {
+ if (!_isBrowserSupported()) {
+ ZeroClipboard.emit({
+ type: "error",
+ name: "browser-unsupported"
+ });
+ }
+ for (i = 0, len = _flashStateErrorNames.length; i < len; i++) {
+ if (_flashState[_flashStateErrorNames[i].replace(/^flash-/, "")] === true) {
+ ZeroClipboard.emit({
+ type: "error",
+ name: _flashStateErrorNames[i]
+ });
+ break;
+ }
+ }
+ if (_zcSwfVersion !== undefined && ZeroClipboard.version !== _zcSwfVersion) {
+ ZeroClipboard.emit({
+ type: "error",
+ name: "version-mismatch",
+ jsVersion: ZeroClipboard.version,
+ swfVersion: _zcSwfVersion
+ });
+ }
+ }
+ }
+ return ZeroClipboard;
+ };
+ /**
+ * The underlying implementation of `ZeroClipboard.off`.
+ * @private
+ */
+ var _off = function(eventType, listener) {
+ var i, len, foundIndex, events, perEventHandlers;
+ if (arguments.length === 0) {
+ events = _keys(_handlers);
+ } else if (typeof eventType === "string" && eventType) {
+ events = eventType.toLowerCase().split(/\s+/);
+ } else if (typeof eventType === "object" && eventType && !("length" in eventType) && typeof listener === "undefined") {
+ _keys(eventType).forEach(function(key) {
+ var listener = eventType[key];
+ if (typeof listener === "function") {
+ ZeroClipboard.off(key, listener);
+ }
+ });
+ }
+ if (events && events.length) {
+ for (i = 0, len = events.length; i < len; i++) {
+ eventType = events[i].replace(/^on/, "");
+ perEventHandlers = _handlers[eventType];
+ if (perEventHandlers && perEventHandlers.length) {
+ if (listener) {
+ foundIndex = perEventHandlers.indexOf(listener);
+ while (foundIndex !== -1) {
+ perEventHandlers.splice(foundIndex, 1);
+ foundIndex = perEventHandlers.indexOf(listener, foundIndex);
+ }
+ } else {
+ perEventHandlers.length = 0;
+ }
+ }
+ }
+ }
+ return ZeroClipboard;
+ };
+ /**
+ * The underlying implementation of `ZeroClipboard.handlers`.
+ * @private
+ */
+ var _listeners = function(eventType) {
+ var copy;
+ if (typeof eventType === "string" && eventType) {
+ copy = _deepCopy(_handlers[eventType]) || null;
+ } else {
+ copy = _deepCopy(_handlers);
+ }
+ return copy;
+ };
+ /**
+ * The underlying implementation of `ZeroClipboard.emit`.
+ * @private
+ */
+ var _emit = function(event) {
+ var eventCopy, returnVal, tmp;
+ event = _createEvent(event);
+ if (!event) {
+ return;
+ }
+ if (_preprocessEvent(event)) {
+ return;
+ }
+ if (event.type === "ready" && _flashState.overdue === true) {
+ return ZeroClipboard.emit({
+ type: "error",
+ name: "flash-overdue"
+ });
+ }
+ eventCopy = _extend({}, event);
+ _dispatchCallbacks.call(this, eventCopy);
+ if (event.type === "copy") {
+ tmp = _mapClipDataToFlash(_clipData);
+ returnVal = tmp.data;
+ _clipDataFormatMap = tmp.formatMap;
+ }
+ return returnVal;
+ };
+ /**
+ * Get the protocol of the configured SWF path.
+ * @private
+ */
+ var _getSwfPathProtocol = function() {
+ var swfPath = _globalConfig.swfPath || "", swfPathFirstTwoChars = swfPath.slice(0, 2), swfProtocol = swfPath.slice(0, swfPath.indexOf("://") + 1);
+ return swfPathFirstTwoChars === "\\\\" ? "file:" : swfPathFirstTwoChars === "//" || swfProtocol === "" ? _window.location.protocol : swfProtocol;
+ };
+ /**
+ * The underlying implementation of `ZeroClipboard.create`.
+ * @private
+ */
+ var _create = function() {
+ var maxWait, swfProtocol, previousState = _flashState.sandboxed;
+ if (!_isBrowserSupported()) {
+ _flashState.ready = false;
+ ZeroClipboard.emit({
+ type: "error",
+ name: "browser-unsupported"
+ });
+ return;
+ }
+ _detectSandbox();
+ if (typeof _flashState.ready !== "boolean") {
+ _flashState.ready = false;
+ }
+ if (_flashState.sandboxed !== previousState && _flashState.sandboxed === true) {
+ _flashState.ready = false;
+ ZeroClipboard.emit({
+ type: "error",
+ name: "flash-sandboxed"
+ });
+ } else if (!ZeroClipboard.isFlashUnusable() && _flashState.bridge === null) {
+ swfProtocol = _getSwfPathProtocol();
+ if (swfProtocol && swfProtocol !== _window.location.protocol) {
+ ZeroClipboard.emit({
+ type: "error",
+ name: "flash-insecure"
+ });
+ } else {
+ maxWait = _globalConfig.flashLoadTimeout;
+ if (typeof maxWait === "number" && maxWait >= 0) {
+ _flashCheckTimeout = _setTimeout(function() {
+ if (typeof _flashState.deactivated !== "boolean") {
+ _flashState.deactivated = true;
+ }
+ if (_flashState.deactivated === true) {
+ ZeroClipboard.emit({
+ type: "error",
+ name: "flash-deactivated"
+ });
+ }
+ }, maxWait);
+ }
+ _flashState.overdue = false;
+ _embedSwf();
+ }
+ }
+ };
+ /**
+ * The underlying implementation of `ZeroClipboard.destroy`.
+ * @private
+ */
+ var _destroy = function() {
+ ZeroClipboard.clearData();
+ ZeroClipboard.blur();
+ ZeroClipboard.emit("destroy");
+ _unembedSwf();
+ ZeroClipboard.off();
+ };
+ /**
+ * The underlying implementation of `ZeroClipboard.setData`.
+ * @private
+ */
+ var _setData = function(format, data) {
+ var dataObj;
+ if (typeof format === "object" && format && typeof data === "undefined") {
+ dataObj = format;
+ ZeroClipboard.clearData();
+ } else if (typeof format === "string" && format) {
+ dataObj = {};
+ dataObj[format] = data;
+ } else {
+ return;
+ }
+ for (var dataFormat in dataObj) {
+ if (typeof dataFormat === "string" && dataFormat && _hasOwn.call(dataObj, dataFormat) && typeof dataObj[dataFormat] === "string" && dataObj[dataFormat]) {
+ _clipData[dataFormat] = _fixLineEndings(dataObj[dataFormat]);
+ }
+ }
+ };
+ /**
+ * The underlying implementation of `ZeroClipboard.clearData`.
+ * @private
+ */
+ var _clearData = function(format) {
+ if (typeof format === "undefined") {
+ _deleteOwnProperties(_clipData);
+ _clipDataFormatMap = null;
+ } else if (typeof format === "string" && _hasOwn.call(_clipData, format)) {
+ delete _clipData[format];
+ }
+ };
+ /**
+ * The underlying implementation of `ZeroClipboard.getData`.
+ * @private
+ */
+ var _getData = function(format) {
+ if (typeof format === "undefined") {
+ return _deepCopy(_clipData);
+ } else if (typeof format === "string" && _hasOwn.call(_clipData, format)) {
+ return _clipData[format];
+ }
+ };
+ /**
+ * The underlying implementation of `ZeroClipboard.focus`/`ZeroClipboard.activate`.
+ * @private
+ */
+ var _focus = function(element) {
+ if (!(element && element.nodeType === 1)) {
+ return;
+ }
+ if (_currentElement) {
+ _removeClass(_currentElement, _globalConfig.activeClass);
+ if (_currentElement !== element) {
+ _removeClass(_currentElement, _globalConfig.hoverClass);
+ }
+ }
+ _currentElement = element;
+ _addClass(element, _globalConfig.hoverClass);
+ var newTitle = element.getAttribute("title") || _globalConfig.title;
+ if (typeof newTitle === "string" && newTitle) {
+ var htmlBridge = _getHtmlBridge(_flashState.bridge);
+ if (htmlBridge) {
+ htmlBridge.setAttribute("title", newTitle);
+ }
+ }
+ var useHandCursor = _globalConfig.forceHandCursor === true || _getStyle(element, "cursor") === "pointer";
+ _setHandCursor(useHandCursor);
+ _reposition();
+ };
+ /**
+ * The underlying implementation of `ZeroClipboard.blur`/`ZeroClipboard.deactivate`.
+ * @private
+ */
+ var _blur = function() {
+ var htmlBridge = _getHtmlBridge(_flashState.bridge);
+ if (htmlBridge) {
+ htmlBridge.removeAttribute("title");
+ htmlBridge.style.left = "0px";
+ htmlBridge.style.top = "-9999px";
+ htmlBridge.style.width = "1px";
+ htmlBridge.style.height = "1px";
+ }
+ if (_currentElement) {
+ _removeClass(_currentElement, _globalConfig.hoverClass);
+ _removeClass(_currentElement, _globalConfig.activeClass);
+ _currentElement = null;
+ }
+ };
+ /**
+ * The underlying implementation of `ZeroClipboard.activeElement`.
+ * @private
+ */
+ var _activeElement = function() {
+ return _currentElement || null;
+ };
+ /**
+ * Check if a value is a valid HTML4 `ID` or `Name` token.
+ * @private
+ */
+ var _isValidHtml4Id = function(id) {
+ return typeof id === "string" && id && /^[A-Za-z][A-Za-z0-9_:\-\.]*$/.test(id);
+ };
+ /**
+ * Create or update an `event` object, based on the `eventType`.
+ * @private
+ */
+ var _createEvent = function(event) {
+ var eventType;
+ if (typeof event === "string" && event) {
+ eventType = event;
+ event = {};
+ } else if (typeof event === "object" && event && typeof event.type === "string" && event.type) {
+ eventType = event.type;
+ }
+ if (!eventType) {
+ return;
+ }
+ eventType = eventType.toLowerCase();
+ if (!event.target && (/^(copy|aftercopy|_click)$/.test(eventType) || eventType === "error" && event.name === "clipboard-error")) {
+ event.target = _copyTarget;
+ }
+ _extend(event, {
+ type: eventType,
+ target: event.target || _currentElement || null,
+ relatedTarget: event.relatedTarget || null,
+ currentTarget: _flashState && _flashState.bridge || null,
+ timeStamp: event.timeStamp || _now() || null
+ });
+ var msg = _eventMessages[event.type];
+ if (event.type === "error" && event.name && msg) {
+ msg = msg[event.name];
+ }
+ if (msg) {
+ event.message = msg;
+ }
+ if (event.type === "ready") {
+ _extend(event, {
+ target: null,
+ version: _flashState.version
+ });
+ }
+ if (event.type === "error") {
+ if (_flashStateErrorNameMatchingRegex.test(event.name)) {
+ _extend(event, {
+ target: null,
+ minimumVersion: _minimumFlashVersion
+ });
+ }
+ if (_flashStateEnabledErrorNameMatchingRegex.test(event.name)) {
+ _extend(event, {
+ version: _flashState.version
+ });
+ }
+ if (event.name === "flash-insecure") {
+ _extend(event, {
+ pageProtocol: _window.location.protocol,
+ swfProtocol: _getSwfPathProtocol()
+ });
+ }
+ }
+ if (event.type === "copy") {
+ event.clipboardData = {
+ setData: ZeroClipboard.setData,
+ clearData: ZeroClipboard.clearData
+ };
+ }
+ if (event.type === "aftercopy") {
+ event = _mapClipResultsFromFlash(event, _clipDataFormatMap);
+ }
+ if (event.target && !event.relatedTarget) {
+ event.relatedTarget = _getRelatedTarget(event.target);
+ }
+ return _addMouseData(event);
+ };
+ /**
+ * Get a relatedTarget from the target's `data-clipboard-target` attribute
+ * @private
+ */
+ var _getRelatedTarget = function(targetEl) {
+ var relatedTargetId = targetEl && targetEl.getAttribute && targetEl.getAttribute("data-clipboard-target");
+ return relatedTargetId ? _document.getElementById(relatedTargetId) : null;
+ };
+ /**
+ * Add element and position data to `MouseEvent` instances
+ * @private
+ */
+ var _addMouseData = function(event) {
+ if (event && /^_(?:click|mouse(?:over|out|down|up|move))$/.test(event.type)) {
+ var srcElement = event.target;
+ var fromElement = event.type === "_mouseover" && event.relatedTarget ? event.relatedTarget : undefined;
+ var toElement = event.type === "_mouseout" && event.relatedTarget ? event.relatedTarget : undefined;
+ var pos = _getElementPosition(srcElement);
+ var screenLeft = _window.screenLeft || _window.screenX || 0;
+ var screenTop = _window.screenTop || _window.screenY || 0;
+ var scrollLeft = _document.body.scrollLeft + _document.documentElement.scrollLeft;
+ var scrollTop = _document.body.scrollTop + _document.documentElement.scrollTop;
+ var pageX = pos.left + (typeof event._stageX === "number" ? event._stageX : 0);
+ var pageY = pos.top + (typeof event._stageY === "number" ? event._stageY : 0);
+ var clientX = pageX - scrollLeft;
+ var clientY = pageY - scrollTop;
+ var screenX = screenLeft + clientX;
+ var screenY = screenTop + clientY;
+ var moveX = typeof event.movementX === "number" ? event.movementX : 0;
+ var moveY = typeof event.movementY === "number" ? event.movementY : 0;
+ delete event._stageX;
+ delete event._stageY;
+ _extend(event, {
+ srcElement: srcElement,
+ fromElement: fromElement,
+ toElement: toElement,
+ screenX: screenX,
+ screenY: screenY,
+ pageX: pageX,
+ pageY: pageY,
+ clientX: clientX,
+ clientY: clientY,
+ x: clientX,
+ y: clientY,
+ movementX: moveX,
+ movementY: moveY,
+ offsetX: 0,
+ offsetY: 0,
+ layerX: 0,
+ layerY: 0
+ });
+ }
+ return event;
+ };
+ /**
+ * Determine if an event's registered handlers should be execute synchronously or asynchronously.
+ *
+ * @returns {boolean}
+ * @private
+ */
+ var _shouldPerformAsync = function(event) {
+ var eventType = event && typeof event.type === "string" && event.type || "";
+ return !/^(?:(?:before)?copy|destroy)$/.test(eventType);
+ };
+ /**
+ * Control if a callback should be executed asynchronously or not.
+ *
+ * @returns `undefined`
+ * @private
+ */
+ var _dispatchCallback = function(func, context, args, async) {
+ if (async) {
+ _setTimeout(function() {
+ func.apply(context, args);
+ }, 0);
+ } else {
+ func.apply(context, args);
+ }
+ };
+ /**
+ * Handle the actual dispatching of events to client instances.
+ *
+ * @returns `undefined`
+ * @private
+ */
+ var _dispatchCallbacks = function(event) {
+ if (!(typeof event === "object" && event && event.type)) {
+ return;
+ }
+ var async = _shouldPerformAsync(event);
+ var wildcardTypeHandlers = _handlers["*"] || [];
+ var specificTypeHandlers = _handlers[event.type] || [];
+ var handlers = wildcardTypeHandlers.concat(specificTypeHandlers);
+ if (handlers && handlers.length) {
+ var i, len, func, context, eventCopy, originalContext = this;
+ for (i = 0, len = handlers.length; i < len; i++) {
+ func = handlers[i];
+ context = originalContext;
+ if (typeof func === "string" && typeof _window[func] === "function") {
+ func = _window[func];
+ }
+ if (typeof func === "object" && func && typeof func.handleEvent === "function") {
+ context = func;
+ func = func.handleEvent;
+ }
+ if (typeof func === "function") {
+ eventCopy = _extend({}, event);
+ _dispatchCallback(func, context, [ eventCopy ], async);
+ }
+ }
+ }
+ return this;
+ };
+ /**
+ * Check an `error` event's `name` property to see if Flash has
+ * already loaded, which rules out possible `iframe` sandboxing.
+ * @private
+ */
+ var _getSandboxStatusFromErrorEvent = function(event) {
+ var isSandboxed = null;
+ if (_pageIsFramed === false || event && event.type === "error" && event.name && _errorsThatOnlyOccurAfterFlashLoads.indexOf(event.name) !== -1) {
+ isSandboxed = false;
+ }
+ return isSandboxed;
+ };
+ /**
+ * Preprocess any special behaviors, reactions, or state changes after receiving this event.
+ * Executes only once per event emitted, NOT once per client.
+ * @private
+ */
+ var _preprocessEvent = function(event) {
+ var element = event.target || _currentElement || null;
+ var sourceIsSwf = event._source === "swf";
+ delete event._source;
+ switch (event.type) {
+ case "error":
+ var isSandboxed = event.name === "flash-sandboxed" || _getSandboxStatusFromErrorEvent(event);
+ if (typeof isSandboxed === "boolean") {
+ _flashState.sandboxed = isSandboxed;
+ }
+ if (event.name === "browser-unsupported") {
+ _extend(_flashState, {
+ disabled: false,
+ outdated: false,
+ unavailable: false,
+ degraded: false,
+ deactivated: false,
+ overdue: false,
+ ready: false
+ });
+ } else if (_flashStateErrorNames.indexOf(event.name) !== -1) {
+ _extend(_flashState, {
+ disabled: event.name === "flash-disabled",
+ outdated: event.name === "flash-outdated",
+ insecure: event.name === "flash-insecure",
+ unavailable: event.name === "flash-unavailable",
+ degraded: event.name === "flash-degraded",
+ deactivated: event.name === "flash-deactivated",
+ overdue: event.name === "flash-overdue",
+ ready: false
+ });
+ } else if (event.name === "version-mismatch") {
+ _zcSwfVersion = event.swfVersion;
+ _extend(_flashState, {
+ disabled: false,
+ outdated: false,
+ insecure: false,
+ unavailable: false,
+ degraded: false,
+ deactivated: false,
+ overdue: false,
+ ready: false
+ });
+ }
+ _clearTimeoutsAndPolling();
+ break;
+
+ case "ready":
+ _zcSwfVersion = event.swfVersion;
+ var wasDeactivated = _flashState.deactivated === true;
+ _extend(_flashState, {
+ sandboxed: false,
+ disabled: false,
+ outdated: false,
+ insecure: false,
+ unavailable: false,
+ degraded: false,
+ deactivated: false,
+ overdue: wasDeactivated,
+ ready: !wasDeactivated
+ });
+ _clearTimeoutsAndPolling();
+ break;
+
+ case "beforecopy":
+ _copyTarget = element;
+ break;
+
+ case "copy":
+ var textContent, htmlContent, targetEl = event.relatedTarget;
+ if (!(_clipData["text/html"] || _clipData["text/plain"]) && targetEl && (htmlContent = targetEl.value || targetEl.outerHTML || targetEl.innerHTML) && (textContent = targetEl.value || targetEl.textContent || targetEl.innerText)) {
+ event.clipboardData.clearData();
+ event.clipboardData.setData("text/plain", textContent);
+ if (htmlContent !== textContent) {
+ event.clipboardData.setData("text/html", htmlContent);
+ }
+ } else if (!_clipData["text/plain"] && event.target && (textContent = event.target.getAttribute("data-clipboard-text"))) {
+ event.clipboardData.clearData();
+ event.clipboardData.setData("text/plain", textContent);
+ }
+ break;
+
+ case "aftercopy":
+ _queueEmitClipboardErrors(event);
+ ZeroClipboard.clearData();
+ if (element && element !== _safeActiveElement() && element.focus) {
+ element.focus();
+ }
+ break;
+
+ case "_mouseover":
+ ZeroClipboard.focus(element);
+ if (_globalConfig.bubbleEvents === true && sourceIsSwf) {
+ if (element && element !== event.relatedTarget && !_containedBy(event.relatedTarget, element)) {
+ _fireMouseEvent(_extend({}, event, {
+ type: "mouseenter",
+ bubbles: false,
+ cancelable: false
+ }));
+ }
+ _fireMouseEvent(_extend({}, event, {
+ type: "mouseover"
+ }));
+ }
+ break;
+
+ case "_mouseout":
+ ZeroClipboard.blur();
+ if (_globalConfig.bubbleEvents === true && sourceIsSwf) {
+ if (element && element !== event.relatedTarget && !_containedBy(event.relatedTarget, element)) {
+ _fireMouseEvent(_extend({}, event, {
+ type: "mouseleave",
+ bubbles: false,
+ cancelable: false
+ }));
+ }
+ _fireMouseEvent(_extend({}, event, {
+ type: "mouseout"
+ }));
+ }
+ break;
+
+ case "_mousedown":
+ _addClass(element, _globalConfig.activeClass);
+ if (_globalConfig.bubbleEvents === true && sourceIsSwf) {
+ _fireMouseEvent(_extend({}, event, {
+ type: event.type.slice(1)
+ }));
+ }
+ break;
+
+ case "_mouseup":
+ _removeClass(element, _globalConfig.activeClass);
+ if (_globalConfig.bubbleEvents === true && sourceIsSwf) {
+ _fireMouseEvent(_extend({}, event, {
+ type: event.type.slice(1)
+ }));
+ }
+ break;
+
+ case "_click":
+ _copyTarget = null;
+ if (_globalConfig.bubbleEvents === true && sourceIsSwf) {
+ _fireMouseEvent(_extend({}, event, {
+ type: event.type.slice(1)
+ }));
+ }
+ break;
+
+ case "_mousemove":
+ if (_globalConfig.bubbleEvents === true && sourceIsSwf) {
+ _fireMouseEvent(_extend({}, event, {
+ type: event.type.slice(1)
+ }));
+ }
+ break;
+ }
+ if (/^_(?:click|mouse(?:over|out|down|up|move))$/.test(event.type)) {
+ return true;
+ }
+ };
+ /**
+ * Check an "aftercopy" event for clipboard errors and emit a corresponding "error" event.
+ * @private
+ */
+ var _queueEmitClipboardErrors = function(aftercopyEvent) {
+ if (aftercopyEvent.errors && aftercopyEvent.errors.length > 0) {
+ var errorEvent = _deepCopy(aftercopyEvent);
+ _extend(errorEvent, {
+ type: "error",
+ name: "clipboard-error"
+ });
+ delete errorEvent.success;
+ _setTimeout(function() {
+ ZeroClipboard.emit(errorEvent);
+ }, 0);
+ }
+ };
+ /**
+ * Dispatch a synthetic MouseEvent.
+ *
+ * @returns `undefined`
+ * @private
+ */
+ var _fireMouseEvent = function(event) {
+ if (!(event && typeof event.type === "string" && event)) {
+ return;
+ }
+ var e, target = event.target || null, doc = target && target.ownerDocument || _document, defaults = {
+ view: doc.defaultView || _window,
+ canBubble: true,
+ cancelable: true,
+ detail: event.type === "click" ? 1 : 0,
+ button: typeof event.which === "number" ? event.which - 1 : typeof event.button === "number" ? event.button : doc.createEvent ? 0 : 1
+ }, args = _extend(defaults, event);
+ if (!target) {
+ return;
+ }
+ if (doc.createEvent && target.dispatchEvent) {
+ args = [ args.type, args.canBubble, args.cancelable, args.view, args.detail, args.screenX, args.screenY, args.clientX, args.clientY, args.ctrlKey, args.altKey, args.shiftKey, args.metaKey, args.button, args.relatedTarget ];
+ e = doc.createEvent("MouseEvents");
+ if (e.initMouseEvent) {
+ e.initMouseEvent.apply(e, args);
+ e._source = "js";
+ target.dispatchEvent(e);
+ }
+ }
+ };
+ /**
+ * Continuously poll the DOM until either:
+ * (a) the fallback content becomes visible, or
+ * (b) we receive an event from SWF (handled elsewhere)
+ *
+ * IMPORTANT:
+ * This is NOT a necessary check but it can result in significantly faster
+ * detection of bad `swfPath` configuration and/or network/server issues [in
+ * supported browsers] than waiting for the entire `flashLoadTimeout` duration
+ * to elapse before detecting that the SWF cannot be loaded. The detection
+ * duration can be anywhere from 10-30 times faster [in supported browsers] by
+ * using this approach.
+ *
+ * @returns `undefined`
+ * @private
+ */
+ var _watchForSwfFallbackContent = function() {
+ var maxWait = _globalConfig.flashLoadTimeout;
+ if (typeof maxWait === "number" && maxWait >= 0) {
+ var pollWait = Math.min(1e3, maxWait / 10);
+ var fallbackContentId = _globalConfig.swfObjectId + "_fallbackContent";
+ _swfFallbackCheckInterval = _setInterval(function() {
+ var el = _document.getElementById(fallbackContentId);
+ if (_isElementVisible(el)) {
+ _clearTimeoutsAndPolling();
+ _flashState.deactivated = null;
+ ZeroClipboard.emit({
+ type: "error",
+ name: "swf-not-found"
+ });
+ }
+ }, pollWait);
+ }
+ };
+ /**
+ * Create the HTML bridge element to embed the Flash object into.
+ * @private
+ */
+ var _createHtmlBridge = function() {
+ var container = _document.createElement("div");
+ container.id = _globalConfig.containerId;
+ container.className = _globalConfig.containerClass;
+ container.style.position = "absolute";
+ container.style.left = "0px";
+ container.style.top = "-9999px";
+ container.style.width = "1px";
+ container.style.height = "1px";
+ container.style.zIndex = "" + _getSafeZIndex(_globalConfig.zIndex);
+ return container;
+ };
+ /**
+ * Get the HTML element container that wraps the Flash bridge object/element.
+ * @private
+ */
+ var _getHtmlBridge = function(flashBridge) {
+ var htmlBridge = flashBridge && flashBridge.parentNode;
+ while (htmlBridge && htmlBridge.nodeName === "OBJECT" && htmlBridge.parentNode) {
+ htmlBridge = htmlBridge.parentNode;
+ }
+ return htmlBridge || null;
+ };
+ /**
+ *
+ * @private
+ */
+ var _escapeXmlValue = function(val) {
+ if (typeof val !== "string" || !val) {
+ return val;
+ }
+ return val.replace(/["&'<>]/g, function(chr) {
+ switch (chr) {
+ case '"':
+ return """;
+
+ case "&":
+ return "&";
+
+ case "'":
+ return "'";
+
+ case "<":
+ return "<";
+
+ case ">":
+ return ">";
+
+ default:
+ return chr;
+ }
+ });
+ };
+ /**
+ * Create the SWF object.
+ *
+ * @returns The SWF object reference.
+ * @private
+ */
+ var _embedSwf = function() {
+ var len, flashBridge = _flashState.bridge, container = _getHtmlBridge(flashBridge);
+ if (!flashBridge) {
+ var allowScriptAccess = _determineScriptAccess(_window.location.host, _globalConfig);
+ var allowNetworking = allowScriptAccess === "never" ? "none" : "all";
+ var flashvars = _vars(_extend({
+ jsVersion: ZeroClipboard.version
+ }, _globalConfig));
+ var swfUrl = _globalConfig.swfPath + _cacheBust(_globalConfig.swfPath, _globalConfig);
+ if (_pageIsXhtml) {
+ swfUrl = _escapeXmlValue(swfUrl);
+ }
+ container = _createHtmlBridge();
+ var divToBeReplaced = _document.createElement("div");
+ container.appendChild(divToBeReplaced);
+ _document.body.appendChild(container);
+ var tmpDiv = _document.createElement("div");
+ var usingActiveX = _flashState.pluginType === "activex";
+ tmpDiv.innerHTML = '" + (usingActiveX ? ' ' : "") + ' ' + ' ' + ' ' + ' ' + ' ' + '
' + " ";
+ flashBridge = tmpDiv.firstChild;
+ tmpDiv = null;
+ _unwrap(flashBridge).ZeroClipboard = ZeroClipboard;
+ container.replaceChild(flashBridge, divToBeReplaced);
+ _watchForSwfFallbackContent();
+ }
+ if (!flashBridge) {
+ flashBridge = _document[_globalConfig.swfObjectId];
+ if (flashBridge && (len = flashBridge.length)) {
+ flashBridge = flashBridge[len - 1];
+ }
+ if (!flashBridge && container) {
+ flashBridge = container.firstChild;
+ }
+ }
+ _flashState.bridge = flashBridge || null;
+ return flashBridge;
+ };
+ /**
+ * Destroy the SWF object.
+ * @private
+ */
+ var _unembedSwf = function() {
+ var flashBridge = _flashState.bridge;
+ if (flashBridge) {
+ var htmlBridge = _getHtmlBridge(flashBridge);
+ if (htmlBridge) {
+ if (_flashState.pluginType === "activex" && "readyState" in flashBridge) {
+ flashBridge.style.display = "none";
+ (function removeSwfFromIE() {
+ if (flashBridge.readyState === 4) {
+ for (var prop in flashBridge) {
+ if (typeof flashBridge[prop] === "function") {
+ flashBridge[prop] = null;
+ }
+ }
+ if (flashBridge.parentNode) {
+ flashBridge.parentNode.removeChild(flashBridge);
+ }
+ if (htmlBridge.parentNode) {
+ htmlBridge.parentNode.removeChild(htmlBridge);
+ }
+ } else {
+ _setTimeout(removeSwfFromIE, 10);
+ }
+ })();
+ } else {
+ if (flashBridge.parentNode) {
+ flashBridge.parentNode.removeChild(flashBridge);
+ }
+ if (htmlBridge.parentNode) {
+ htmlBridge.parentNode.removeChild(htmlBridge);
+ }
+ }
+ }
+ _clearTimeoutsAndPolling();
+ _flashState.ready = null;
+ _flashState.bridge = null;
+ _flashState.deactivated = null;
+ _flashState.insecure = null;
+ _zcSwfVersion = undefined;
+ }
+ };
+ /**
+ * Map the data format names of the "clipData" to Flash-friendly names.
+ *
+ * @returns A new transformed object.
+ * @private
+ */
+ var _mapClipDataToFlash = function(clipData) {
+ var newClipData = {}, formatMap = {};
+ if (!(typeof clipData === "object" && clipData)) {
+ return;
+ }
+ for (var dataFormat in clipData) {
+ if (dataFormat && _hasOwn.call(clipData, dataFormat) && typeof clipData[dataFormat] === "string" && clipData[dataFormat]) {
+ switch (dataFormat.toLowerCase()) {
+ case "text/plain":
+ case "text":
+ case "air:text":
+ case "flash:text":
+ newClipData.text = clipData[dataFormat];
+ formatMap.text = dataFormat;
+ break;
+
+ case "text/html":
+ case "html":
+ case "air:html":
+ case "flash:html":
+ newClipData.html = clipData[dataFormat];
+ formatMap.html = dataFormat;
+ break;
+
+ case "application/rtf":
+ case "text/rtf":
+ case "rtf":
+ case "richtext":
+ case "air:rtf":
+ case "flash:rtf":
+ newClipData.rtf = clipData[dataFormat];
+ formatMap.rtf = dataFormat;
+ break;
+
+ default:
+ break;
+ }
+ }
+ }
+ return {
+ data: newClipData,
+ formatMap: formatMap
+ };
+ };
+ /**
+ * Map the data format names from Flash-friendly names back to their original "clipData" names (via a format mapping).
+ *
+ * @returns A new transformed object.
+ * @private
+ */
+ var _mapClipResultsFromFlash = function(clipResults, formatMap) {
+ if (!(typeof clipResults === "object" && clipResults && typeof formatMap === "object" && formatMap)) {
+ return clipResults;
+ }
+ var newResults = {};
+ for (var prop in clipResults) {
+ if (_hasOwn.call(clipResults, prop)) {
+ if (prop === "errors") {
+ newResults[prop] = clipResults[prop] ? clipResults[prop].slice() : [];
+ for (var i = 0, len = newResults[prop].length; i < len; i++) {
+ newResults[prop][i].format = formatMap[newResults[prop][i].format];
+ }
+ } else if (prop !== "success" && prop !== "data") {
+ newResults[prop] = clipResults[prop];
+ } else {
+ newResults[prop] = {};
+ var tmpHash = clipResults[prop];
+ for (var dataFormat in tmpHash) {
+ if (dataFormat && _hasOwn.call(tmpHash, dataFormat) && _hasOwn.call(formatMap, dataFormat)) {
+ newResults[prop][formatMap[dataFormat]] = tmpHash[dataFormat];
+ }
+ }
+ }
+ }
+ }
+ return newResults;
+ };
+ /**
+ * Will look at a path, and will create a "?noCache={time}" or "&noCache={time}"
+ * query param string to return. Does NOT append that string to the original path.
+ * This is useful because ExternalInterface often breaks when a Flash SWF is cached.
+ *
+ * @returns The `noCache` query param with necessary "?"/"&" prefix.
+ * @private
+ */
+ var _cacheBust = function(path, options) {
+ var cacheBust = options == null || options && options.cacheBust === true;
+ if (cacheBust) {
+ return (path.indexOf("?") === -1 ? "?" : "&") + "noCache=" + _now();
+ } else {
+ return "";
+ }
+ };
+ /**
+ * Creates a query string for the FlashVars param.
+ * Does NOT include the cache-busting query param.
+ *
+ * @returns FlashVars query string
+ * @private
+ */
+ var _vars = function(options) {
+ var i, len, domain, domains, str = "", trustedOriginsExpanded = [];
+ if (options.trustedDomains) {
+ if (typeof options.trustedDomains === "string") {
+ domains = [ options.trustedDomains ];
+ } else if (typeof options.trustedDomains === "object" && "length" in options.trustedDomains) {
+ domains = options.trustedDomains;
+ }
+ }
+ if (domains && domains.length) {
+ for (i = 0, len = domains.length; i < len; i++) {
+ if (_hasOwn.call(domains, i) && domains[i] && typeof domains[i] === "string") {
+ domain = _extractDomain(domains[i]);
+ if (!domain) {
+ continue;
+ }
+ if (domain === "*") {
+ trustedOriginsExpanded.length = 0;
+ trustedOriginsExpanded.push(domain);
+ break;
+ }
+ trustedOriginsExpanded.push.apply(trustedOriginsExpanded, [ domain, "//" + domain, _window.location.protocol + "//" + domain ]);
+ }
+ }
+ }
+ if (trustedOriginsExpanded.length) {
+ str += "trustedOrigins=" + _encodeURIComponent(trustedOriginsExpanded.join(","));
+ }
+ if (options.forceEnhancedClipboard === true) {
+ str += (str ? "&" : "") + "forceEnhancedClipboard=true";
+ }
+ if (typeof options.swfObjectId === "string" && options.swfObjectId) {
+ str += (str ? "&" : "") + "swfObjectId=" + _encodeURIComponent(options.swfObjectId);
+ }
+ if (typeof options.jsVersion === "string" && options.jsVersion) {
+ str += (str ? "&" : "") + "jsVersion=" + _encodeURIComponent(options.jsVersion);
+ }
+ return str;
+ };
+ /**
+ * Extract the domain (e.g. "github.com") from an origin (e.g. "https://github.com") or
+ * URL (e.g. "https://github.com/zeroclipboard/zeroclipboard/").
+ *
+ * @returns the domain
+ * @private
+ */
+ var _extractDomain = function(originOrUrl) {
+ if (originOrUrl == null || originOrUrl === "") {
+ return null;
+ }
+ originOrUrl = originOrUrl.replace(/^\s+|\s+$/g, "");
+ if (originOrUrl === "") {
+ return null;
+ }
+ var protocolIndex = originOrUrl.indexOf("//");
+ originOrUrl = protocolIndex === -1 ? originOrUrl : originOrUrl.slice(protocolIndex + 2);
+ var pathIndex = originOrUrl.indexOf("/");
+ originOrUrl = pathIndex === -1 ? originOrUrl : protocolIndex === -1 || pathIndex === 0 ? null : originOrUrl.slice(0, pathIndex);
+ if (originOrUrl && originOrUrl.slice(-4).toLowerCase() === ".swf") {
+ return null;
+ }
+ return originOrUrl || null;
+ };
+ /**
+ * Set `allowScriptAccess` based on `trustedDomains` and `window.location.host` vs. `swfPath`.
+ *
+ * @returns The appropriate script access level.
+ * @private
+ */
+ var _determineScriptAccess = function() {
+ var _extractAllDomains = function(origins) {
+ var i, len, tmp, resultsArray = [];
+ if (typeof origins === "string") {
+ origins = [ origins ];
+ }
+ if (!(typeof origins === "object" && origins && typeof origins.length === "number")) {
+ return resultsArray;
+ }
+ for (i = 0, len = origins.length; i < len; i++) {
+ if (_hasOwn.call(origins, i) && (tmp = _extractDomain(origins[i]))) {
+ if (tmp === "*") {
+ resultsArray.length = 0;
+ resultsArray.push("*");
+ break;
+ }
+ if (resultsArray.indexOf(tmp) === -1) {
+ resultsArray.push(tmp);
+ }
+ }
+ }
+ return resultsArray;
+ };
+ return function(currentDomain, configOptions) {
+ var swfDomain = _extractDomain(configOptions.swfPath);
+ if (swfDomain === null) {
+ swfDomain = currentDomain;
+ }
+ var trustedDomains = _extractAllDomains(configOptions.trustedDomains);
+ var len = trustedDomains.length;
+ if (len > 0) {
+ if (len === 1 && trustedDomains[0] === "*") {
+ return "always";
+ }
+ if (trustedDomains.indexOf(currentDomain) !== -1) {
+ if (len === 1 && currentDomain === swfDomain) {
+ return "sameDomain";
+ }
+ return "always";
+ }
+ }
+ return "never";
+ };
+ }();
+ /**
+ * Get the currently active/focused DOM element.
+ *
+ * @returns the currently active/focused element, or `null`
+ * @private
+ */
+ var _safeActiveElement = function() {
+ try {
+ return _document.activeElement;
+ } catch (err) {
+ return null;
+ }
+ };
+ /**
+ * Add a class to an element, if it doesn't already have it.
+ *
+ * @returns The element, with its new class added.
+ * @private
+ */
+ var _addClass = function(element, value) {
+ var c, cl, className, classNames = [];
+ if (typeof value === "string" && value) {
+ classNames = value.split(/\s+/);
+ }
+ if (element && element.nodeType === 1 && classNames.length > 0) {
+ className = (" " + (element.className || "") + " ").replace(/[\t\r\n\f]/g, " ");
+ for (c = 0, cl = classNames.length; c < cl; c++) {
+ if (className.indexOf(" " + classNames[c] + " ") === -1) {
+ className += classNames[c] + " ";
+ }
+ }
+ className = className.replace(/^\s+|\s+$/g, "");
+ if (className !== element.className) {
+ element.className = className;
+ }
+ }
+ return element;
+ };
+ /**
+ * Remove a class from an element, if it has it.
+ *
+ * @returns The element, with its class removed.
+ * @private
+ */
+ var _removeClass = function(element, value) {
+ var c, cl, className, classNames = [];
+ if (typeof value === "string" && value) {
+ classNames = value.split(/\s+/);
+ }
+ if (element && element.nodeType === 1 && classNames.length > 0) {
+ if (element.className) {
+ className = (" " + element.className + " ").replace(/[\t\r\n\f]/g, " ");
+ for (c = 0, cl = classNames.length; c < cl; c++) {
+ className = className.replace(" " + classNames[c] + " ", " ");
+ }
+ className = className.replace(/^\s+|\s+$/g, "");
+ if (className !== element.className) {
+ element.className = className;
+ }
+ }
+ }
+ return element;
+ };
+ /**
+ * Attempt to interpret the element's CSS styling. If `prop` is `"cursor"`,
+ * then we assume that it should be a hand ("pointer") cursor if the element
+ * is an anchor element ("a" tag).
+ *
+ * @returns The computed style property.
+ * @private
+ */
+ var _getStyle = function(el, prop) {
+ var value = _getComputedStyle(el, null).getPropertyValue(prop);
+ if (prop === "cursor") {
+ if (!value || value === "auto") {
+ if (el.nodeName === "A") {
+ return "pointer";
+ }
+ }
+ }
+ return value;
+ };
+ /**
+ * Get the absolutely positioned coordinates of a DOM element.
+ *
+ * @returns Object containing the element's position, width, and height.
+ * @private
+ */
+ var _getElementPosition = function(el) {
+ var pos = {
+ left: 0,
+ top: 0,
+ width: 0,
+ height: 0
+ };
+ if (el.getBoundingClientRect) {
+ var elRect = el.getBoundingClientRect();
+ var pageXOffset = _window.pageXOffset;
+ var pageYOffset = _window.pageYOffset;
+ var leftBorderWidth = _document.documentElement.clientLeft || 0;
+ var topBorderWidth = _document.documentElement.clientTop || 0;
+ var leftBodyOffset = 0;
+ var topBodyOffset = 0;
+ if (_getStyle(_document.body, "position") === "relative") {
+ var bodyRect = _document.body.getBoundingClientRect();
+ var htmlRect = _document.documentElement.getBoundingClientRect();
+ leftBodyOffset = bodyRect.left - htmlRect.left || 0;
+ topBodyOffset = bodyRect.top - htmlRect.top || 0;
+ }
+ pos.left = elRect.left + pageXOffset - leftBorderWidth - leftBodyOffset;
+ pos.top = elRect.top + pageYOffset - topBorderWidth - topBodyOffset;
+ pos.width = "width" in elRect ? elRect.width : elRect.right - elRect.left;
+ pos.height = "height" in elRect ? elRect.height : elRect.bottom - elRect.top;
+ }
+ return pos;
+ };
+ /**
+ * Determine is an element is visible somewhere within the document (page).
+ *
+ * @returns Boolean
+ * @private
+ */
+ var _isElementVisible = function(el) {
+ if (!el) {
+ return false;
+ }
+ var styles = _getComputedStyle(el, null);
+ if (!styles) {
+ return false;
+ }
+ var hasCssHeight = _parseFloat(styles.height) > 0;
+ var hasCssWidth = _parseFloat(styles.width) > 0;
+ var hasCssTop = _parseFloat(styles.top) >= 0;
+ var hasCssLeft = _parseFloat(styles.left) >= 0;
+ var cssKnows = hasCssHeight && hasCssWidth && hasCssTop && hasCssLeft;
+ var rect = cssKnows ? null : _getElementPosition(el);
+ var isVisible = styles.display !== "none" && styles.visibility !== "collapse" && (cssKnows || !!rect && (hasCssHeight || rect.height > 0) && (hasCssWidth || rect.width > 0) && (hasCssTop || rect.top >= 0) && (hasCssLeft || rect.left >= 0));
+ return isVisible;
+ };
+ /**
+ * Clear all existing timeouts and interval polling delegates.
+ *
+ * @returns `undefined`
+ * @private
+ */
+ var _clearTimeoutsAndPolling = function() {
+ _clearTimeout(_flashCheckTimeout);
+ _flashCheckTimeout = 0;
+ _clearInterval(_swfFallbackCheckInterval);
+ _swfFallbackCheckInterval = 0;
+ };
+ /**
+ * Reposition the Flash object to cover the currently activated element.
+ *
+ * @returns `undefined`
+ * @private
+ */
+ var _reposition = function() {
+ var htmlBridge;
+ if (_currentElement && (htmlBridge = _getHtmlBridge(_flashState.bridge))) {
+ var pos = _getElementPosition(_currentElement);
+ _extend(htmlBridge.style, {
+ width: pos.width + "px",
+ height: pos.height + "px",
+ top: pos.top + "px",
+ left: pos.left + "px",
+ zIndex: "" + _getSafeZIndex(_globalConfig.zIndex)
+ });
+ }
+ };
+ /**
+ * Sends a signal to the Flash object to display the hand cursor if `true`.
+ *
+ * @returns `undefined`
+ * @private
+ */
+ var _setHandCursor = function(enabled) {
+ if (_flashState.ready === true) {
+ if (_flashState.bridge && typeof _flashState.bridge.setHandCursor === "function") {
+ _flashState.bridge.setHandCursor(enabled);
+ } else {
+ _flashState.ready = false;
+ }
+ }
+ };
+ /**
+ * Get a safe value for `zIndex`
+ *
+ * @returns an integer, or "auto"
+ * @private
+ */
+ var _getSafeZIndex = function(val) {
+ if (/^(?:auto|inherit)$/.test(val)) {
+ return val;
+ }
+ var zIndex;
+ if (typeof val === "number" && !_isNaN(val)) {
+ zIndex = val;
+ } else if (typeof val === "string") {
+ zIndex = _getSafeZIndex(_parseInt(val, 10));
+ }
+ return typeof zIndex === "number" ? zIndex : "auto";
+ };
+ /**
+ * Ensure OS-compliant line endings, i.e. "\r\n" on Windows, "\n" elsewhere
+ *
+ * @returns string
+ * @private
+ */
+ var _fixLineEndings = function(content) {
+ var replaceRegex = /(\r\n|\r|\n)/g;
+ if (typeof content === "string" && _globalConfig.fixLineEndings === true) {
+ if (_isWindows()) {
+ if (/((^|[^\r])\n|\r([^\n]|$))/.test(content)) {
+ content = content.replace(replaceRegex, "\r\n");
+ }
+ } else if (/\r/.test(content)) {
+ content = content.replace(replaceRegex, "\n");
+ }
+ }
+ return content;
+ };
+ /**
+ * Attempt to detect if ZeroClipboard is executing inside of a sandboxed iframe.
+ * If it is, Flash Player cannot be used, so ZeroClipboard is dead in the water.
+ *
+ * @see {@link http://lists.w3.org/Archives/Public/public-whatwg-archive/2014Dec/0002.html}
+ * @see {@link https://github.com/zeroclipboard/zeroclipboard/issues/511}
+ * @see {@link http://zeroclipboard.github.io/test-iframes.html}
+ *
+ * @returns `true` (is sandboxed), `false` (is not sandboxed), or `null` (uncertain)
+ * @private
+ */
+ var _detectSandbox = function(doNotReassessFlashSupport) {
+ var effectiveScriptOrigin, frame, frameError, previousState = _flashState.sandboxed, isSandboxed = null;
+ doNotReassessFlashSupport = doNotReassessFlashSupport === true;
+ if (_pageIsFramed === false) {
+ isSandboxed = false;
+ } else {
+ try {
+ frame = window.frameElement || null;
+ } catch (e) {
+ frameError = {
+ name: e.name,
+ message: e.message
+ };
+ }
+ if (frame && frame.nodeType === 1 && frame.nodeName === "IFRAME") {
+ try {
+ isSandboxed = frame.hasAttribute("sandbox");
+ } catch (e) {
+ isSandboxed = null;
+ }
+ } else {
+ try {
+ effectiveScriptOrigin = document.domain || null;
+ } catch (e) {
+ effectiveScriptOrigin = null;
+ }
+ if (effectiveScriptOrigin === null || frameError && frameError.name === "SecurityError" && /(^|[\s\(\[@])sandbox(es|ed|ing|[\s\.,!\)\]@]|$)/.test(frameError.message.toLowerCase())) {
+ isSandboxed = true;
+ }
+ }
+ }
+ _flashState.sandboxed = isSandboxed;
+ if (previousState !== isSandboxed && !doNotReassessFlashSupport) {
+ _detectFlashSupport(_ActiveXObject);
+ }
+ return isSandboxed;
+ };
+ /**
+ * Detect the Flash Player status, version, and plugin type.
+ *
+ * @see {@link https://code.google.com/p/doctype-mirror/wiki/ArticleDetectFlash#The_code}
+ * @see {@link http://stackoverflow.com/questions/12866060/detecting-pepper-ppapi-flash-with-javascript}
+ *
+ * @returns `undefined`
+ * @private
+ */
+ var _detectFlashSupport = function(ActiveXObject) {
+ var plugin, ax, mimeType, hasFlash = false, isActiveX = false, isPPAPI = false, flashVersion = "";
+ /**
+ * Derived from Apple's suggested sniffer.
+ * @param {String} desc e.g. "Shockwave Flash 7.0 r61"
+ * @returns {String} "7.0.61"
+ * @private
+ */
+ function parseFlashVersion(desc) {
+ var matches = desc.match(/[\d]+/g);
+ matches.length = 3;
+ return matches.join(".");
+ }
+ function isPepperFlash(flashPlayerFileName) {
+ return !!flashPlayerFileName && (flashPlayerFileName = flashPlayerFileName.toLowerCase()) && (/^(pepflashplayer\.dll|libpepflashplayer\.so|pepperflashplayer\.plugin)$/.test(flashPlayerFileName) || flashPlayerFileName.slice(-13) === "chrome.plugin");
+ }
+ function inspectPlugin(plugin) {
+ if (plugin) {
+ hasFlash = true;
+ if (plugin.version) {
+ flashVersion = parseFlashVersion(plugin.version);
+ }
+ if (!flashVersion && plugin.description) {
+ flashVersion = parseFlashVersion(plugin.description);
+ }
+ if (plugin.filename) {
+ isPPAPI = isPepperFlash(plugin.filename);
+ }
+ }
+ }
+ if (_navigator.plugins && _navigator.plugins.length) {
+ plugin = _navigator.plugins["Shockwave Flash"];
+ inspectPlugin(plugin);
+ if (_navigator.plugins["Shockwave Flash 2.0"]) {
+ hasFlash = true;
+ flashVersion = "2.0.0.11";
+ }
+ } else if (_navigator.mimeTypes && _navigator.mimeTypes.length) {
+ mimeType = _navigator.mimeTypes["application/x-shockwave-flash"];
+ plugin = mimeType && mimeType.enabledPlugin;
+ inspectPlugin(plugin);
+ } else if (typeof ActiveXObject !== "undefined") {
+ isActiveX = true;
+ try {
+ ax = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
+ hasFlash = true;
+ flashVersion = parseFlashVersion(ax.GetVariable("$version"));
+ } catch (e1) {
+ try {
+ ax = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
+ hasFlash = true;
+ flashVersion = "6.0.21";
+ } catch (e2) {
+ try {
+ ax = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
+ hasFlash = true;
+ flashVersion = parseFlashVersion(ax.GetVariable("$version"));
+ } catch (e3) {
+ isActiveX = false;
+ }
+ }
+ }
+ }
+ _flashState.disabled = hasFlash !== true;
+ _flashState.outdated = flashVersion && _parseFloat(flashVersion) < _parseFloat(_minimumFlashVersion);
+ _flashState.version = flashVersion || "0.0.0";
+ _flashState.pluginType = isPPAPI ? "pepper" : isActiveX ? "activex" : hasFlash ? "netscape" : "unknown";
+ };
+ /**
+ * Invoke the Flash detection algorithms immediately upon inclusion so we're not waiting later.
+ */
+ _detectFlashSupport(_ActiveXObject);
+ /**
+ * Always assess the `sandboxed` state of the page at important Flash-related moments.
+ */
+ _detectSandbox(true);
+ /**
+ * A shell constructor for `ZeroClipboard` client instances.
+ *
+ * @constructor
+ */
+ var ZeroClipboard = function() {
+ if (!(this instanceof ZeroClipboard)) {
+ return new ZeroClipboard();
+ }
+ if (typeof ZeroClipboard._createClient === "function") {
+ ZeroClipboard._createClient.apply(this, _args(arguments));
+ }
+ };
+ /**
+ * The ZeroClipboard library's version number.
+ *
+ * @static
+ * @readonly
+ * @property {string}
+ */
+ ZeroClipboard.version = "2.4.0-beta.1";
+ /**
+ * Update or get a copy of the ZeroClipboard global configuration.
+ * Returns a copy of the current/updated configuration.
+ *
+ * @returns Object
+ * @static
+ */
+ ZeroClipboard.config = function() {
+ return _config.apply(this, _args(arguments));
+ };
+ /**
+ * Diagnostic method that describes the state of the browser, Flash Player, and ZeroClipboard.
+ *
+ * @returns Object
+ * @static
+ */
+ ZeroClipboard.state = function() {
+ return _state.apply(this, _args(arguments));
+ };
+ /**
+ * Check if Flash is unusable for any reason: disabled, outdated, deactivated, etc.
+ *
+ * @returns Boolean
+ * @static
+ */
+ ZeroClipboard.isFlashUnusable = function() {
+ return _isFlashUnusable.apply(this, _args(arguments));
+ };
+ /**
+ * Register an event listener.
+ *
+ * @returns `ZeroClipboard`
+ * @static
+ */
+ ZeroClipboard.on = function() {
+ return _on.apply(this, _args(arguments));
+ };
+ /**
+ * Unregister an event listener.
+ * If no `listener` function/object is provided, it will unregister all listeners for the provided `eventType`.
+ * If no `eventType` is provided, it will unregister all listeners for every event type.
+ *
+ * @returns `ZeroClipboard`
+ * @static
+ */
+ ZeroClipboard.off = function() {
+ return _off.apply(this, _args(arguments));
+ };
+ /**
+ * Retrieve event listeners for an `eventType`.
+ * If no `eventType` is provided, it will retrieve all listeners for every event type.
+ *
+ * @returns array of listeners for the `eventType`; if no `eventType`, then a map/hash object of listeners for all event types; or `null`
+ */
+ ZeroClipboard.handlers = function() {
+ return _listeners.apply(this, _args(arguments));
+ };
+ /**
+ * Event emission receiver from the Flash object, forwarding to any registered JavaScript event listeners.
+ *
+ * @returns For the "copy" event, returns the Flash-friendly "clipData" object; otherwise `undefined`.
+ * @static
+ */
+ ZeroClipboard.emit = function() {
+ return _emit.apply(this, _args(arguments));
+ };
+ /**
+ * Create and embed the Flash object.
+ *
+ * @returns The Flash object
+ * @static
+ */
+ ZeroClipboard.create = function() {
+ return _create.apply(this, _args(arguments));
+ };
+ /**
+ * Self-destruct and clean up everything, including the embedded Flash object.
+ *
+ * @returns `undefined`
+ * @static
+ */
+ ZeroClipboard.destroy = function() {
+ return _destroy.apply(this, _args(arguments));
+ };
+ /**
+ * Set the pending data for clipboard injection.
+ *
+ * @returns `undefined`
+ * @static
+ */
+ ZeroClipboard.setData = function() {
+ return _setData.apply(this, _args(arguments));
+ };
+ /**
+ * Clear the pending data for clipboard injection.
+ * If no `format` is provided, all pending data formats will be cleared.
+ *
+ * @returns `undefined`
+ * @static
+ */
+ ZeroClipboard.clearData = function() {
+ return _clearData.apply(this, _args(arguments));
+ };
+ /**
+ * Get a copy of the pending data for clipboard injection.
+ * If no `format` is provided, a copy of ALL pending data formats will be returned.
+ *
+ * @returns `String` or `Object`
+ * @static
+ */
+ ZeroClipboard.getData = function() {
+ return _getData.apply(this, _args(arguments));
+ };
+ /**
+ * Sets the current HTML object that the Flash object should overlay. This will put the global
+ * Flash object on top of the current element; depending on the setup, this may also set the
+ * pending clipboard text data as well as the Flash object's wrapping element's title attribute
+ * based on the underlying HTML element and ZeroClipboard configuration.
+ *
+ * @returns `undefined`
+ * @static
+ */
+ ZeroClipboard.focus = ZeroClipboard.activate = function() {
+ return _focus.apply(this, _args(arguments));
+ };
+ /**
+ * Un-overlays the Flash object. This will put the global Flash object off-screen; depending on
+ * the setup, this may also unset the Flash object's wrapping element's title attribute based on
+ * the underlying HTML element and ZeroClipboard configuration.
+ *
+ * @returns `undefined`
+ * @static
+ */
+ ZeroClipboard.blur = ZeroClipboard.deactivate = function() {
+ return _blur.apply(this, _args(arguments));
+ };
+ /**
+ * Returns the currently focused/"activated" HTML element that the Flash object is wrapping.
+ *
+ * @returns `HTMLElement` or `null`
+ * @static
+ */
+ ZeroClipboard.activeElement = function() {
+ return _activeElement.apply(this, _args(arguments));
+ };
+ /**
+ * Keep track of the ZeroClipboard client instance counter.
+ */
+ var _clientIdCounter = 0;
+ /**
+ * Keep track of the state of the client instances.
+ *
+ * Entry structure:
+ * _clientMeta[client.id] = {
+ * instance: client,
+ * elements: [],
+ * handlers: {},
+ * coreWildcardHandler: function(event) { return client.emit(event); }
+ * };
+ */
+ var _clientMeta = {};
+ /**
+ * Keep track of the ZeroClipboard clipped elements counter.
+ */
+ var _elementIdCounter = 0;
+ /**
+ * Keep track of the state of the clipped element relationships to clients.
+ *
+ * Entry structure:
+ * _elementMeta[element.zcClippingId] = [client1.id, client2.id];
+ */
+ var _elementMeta = {};
+ /**
+ * Keep track of the state of the mouse event handlers for clipped elements.
+ *
+ * Entry structure:
+ * _mouseHandlers[element.zcClippingId] = {
+ * mouseover: function(event) {},
+ * mouseout: function(event) {},
+ * mouseenter: function(event) {},
+ * mouseleave: function(event) {},
+ * mousemove: function(event) {}
+ * };
+ */
+ var _mouseHandlers = {};
+ /**
+ * Extending the ZeroClipboard configuration defaults for the Client module.
+ */
+ _extend(_globalConfig, {
+ autoActivate: true
+ });
+ /**
+ * The real constructor for `ZeroClipboard` client instances.
+ * @private
+ */
+ var _clientConstructor = function(elements) {
+ var meta, client = this;
+ client.id = "" + _clientIdCounter++;
+ meta = {
+ instance: client,
+ elements: [],
+ handlers: {},
+ coreWildcardHandler: function(event) {
+ return client.emit(event);
+ }
+ };
+ _clientMeta[client.id] = meta;
+ if (elements) {
+ client.clip(elements);
+ }
+ ZeroClipboard.on("*", meta.coreWildcardHandler);
+ ZeroClipboard.on("destroy", function() {
+ client.destroy();
+ });
+ ZeroClipboard.create();
+ };
+ /**
+ * The underlying implementation of `ZeroClipboard.Client.prototype.on`.
+ * @private
+ */
+ var _clientOn = function(eventType, listener) {
+ var i, len, events, added = {}, client = this, meta = _clientMeta[client.id], handlers = meta && meta.handlers;
+ if (!meta) {
+ throw new Error("Attempted to add new listener(s) to a destroyed ZeroClipboard client instance");
+ }
+ if (typeof eventType === "string" && eventType) {
+ events = eventType.toLowerCase().split(/\s+/);
+ } else if (typeof eventType === "object" && eventType && !("length" in eventType) && typeof listener === "undefined") {
+ _keys(eventType).forEach(function(key) {
+ var listener = eventType[key];
+ if (typeof listener === "function") {
+ client.on(key, listener);
+ }
+ });
+ }
+ if (events && events.length && listener) {
+ for (i = 0, len = events.length; i < len; i++) {
+ eventType = events[i].replace(/^on/, "");
+ added[eventType] = true;
+ if (!handlers[eventType]) {
+ handlers[eventType] = [];
+ }
+ handlers[eventType].push(listener);
+ }
+ if (added.ready && _flashState.ready) {
+ this.emit({
+ type: "ready",
+ client: this
+ });
+ }
+ if (added.error) {
+ for (i = 0, len = _flashStateErrorNames.length; i < len; i++) {
+ if (_flashState[_flashStateErrorNames[i].replace(/^flash-/, "")]) {
+ this.emit({
+ type: "error",
+ name: _flashStateErrorNames[i],
+ client: this
+ });
+ break;
+ }
+ }
+ if (_zcSwfVersion !== undefined && ZeroClipboard.version !== _zcSwfVersion) {
+ this.emit({
+ type: "error",
+ name: "version-mismatch",
+ jsVersion: ZeroClipboard.version,
+ swfVersion: _zcSwfVersion
+ });
+ }
+ }
+ }
+ return client;
+ };
+ /**
+ * The underlying implementation of `ZeroClipboard.Client.prototype.off`.
+ * @private
+ */
+ var _clientOff = function(eventType, listener) {
+ var i, len, foundIndex, events, perEventHandlers, client = this, meta = _clientMeta[client.id], handlers = meta && meta.handlers;
+ if (!handlers) {
+ return client;
+ }
+ if (arguments.length === 0) {
+ events = _keys(handlers);
+ } else if (typeof eventType === "string" && eventType) {
+ events = eventType.split(/\s+/);
+ } else if (typeof eventType === "object" && eventType && !("length" in eventType) && typeof listener === "undefined") {
+ _keys(eventType).forEach(function(key) {
+ var listener = eventType[key];
+ if (typeof listener === "function") {
+ client.off(key, listener);
+ }
+ });
+ }
+ if (events && events.length) {
+ for (i = 0, len = events.length; i < len; i++) {
+ eventType = events[i].toLowerCase().replace(/^on/, "");
+ perEventHandlers = handlers[eventType];
+ if (perEventHandlers && perEventHandlers.length) {
+ if (listener) {
+ foundIndex = perEventHandlers.indexOf(listener);
+ while (foundIndex !== -1) {
+ perEventHandlers.splice(foundIndex, 1);
+ foundIndex = perEventHandlers.indexOf(listener, foundIndex);
+ }
+ } else {
+ perEventHandlers.length = 0;
+ }
+ }
+ }
+ }
+ return client;
+ };
+ /**
+ * The underlying implementation of `ZeroClipboard.Client.prototype.handlers`.
+ * @private
+ */
+ var _clientListeners = function(eventType) {
+ var copy = null, handlers = _clientMeta[this.id] && _clientMeta[this.id].handlers;
+ if (handlers) {
+ if (typeof eventType === "string" && eventType) {
+ copy = handlers[eventType] ? handlers[eventType].slice(0) : [];
+ } else {
+ copy = _deepCopy(handlers);
+ }
+ }
+ return copy;
+ };
+ /**
+ * The underlying implementation of `ZeroClipboard.Client.prototype.emit`.
+ * @private
+ */
+ var _clientEmit = function(event) {
+ var eventCopy, client = this;
+ if (_clientShouldEmit.call(client, event)) {
+ if (typeof event === "object" && event && typeof event.type === "string" && event.type) {
+ event = _extend({}, event);
+ }
+ eventCopy = _extend({}, _createEvent(event), {
+ client: client
+ });
+ _clientDispatchCallbacks.call(client, eventCopy);
+ }
+ return client;
+ };
+ /**
+ * The underlying implementation of `ZeroClipboard.Client.prototype.clip`.
+ * @private
+ */
+ var _clientClip = function(elements) {
+ if (!_clientMeta[this.id]) {
+ throw new Error("Attempted to clip element(s) to a destroyed ZeroClipboard client instance");
+ }
+ elements = _prepClip(elements);
+ for (var i = 0; i < elements.length; i++) {
+ if (_hasOwn.call(elements, i) && elements[i] && elements[i].nodeType === 1) {
+ if (!elements[i].zcClippingId) {
+ elements[i].zcClippingId = "zcClippingId_" + _elementIdCounter++;
+ _elementMeta[elements[i].zcClippingId] = [ this.id ];
+ if (_globalConfig.autoActivate === true) {
+ _addMouseHandlers(elements[i]);
+ }
+ } else if (_elementMeta[elements[i].zcClippingId].indexOf(this.id) === -1) {
+ _elementMeta[elements[i].zcClippingId].push(this.id);
+ }
+ var clippedElements = _clientMeta[this.id] && _clientMeta[this.id].elements;
+ if (clippedElements.indexOf(elements[i]) === -1) {
+ clippedElements.push(elements[i]);
+ }
+ }
+ }
+ return this;
+ };
+ /**
+ * The underlying implementation of `ZeroClipboard.Client.prototype.unclip`.
+ * @private
+ */
+ var _clientUnclip = function(elements) {
+ var meta = _clientMeta[this.id];
+ if (!meta) {
+ return this;
+ }
+ var clippedElements = meta.elements;
+ var arrayIndex;
+ if (typeof elements === "undefined") {
+ elements = clippedElements.slice(0);
+ } else {
+ elements = _prepClip(elements);
+ }
+ for (var i = elements.length; i--; ) {
+ if (_hasOwn.call(elements, i) && elements[i] && elements[i].nodeType === 1) {
+ arrayIndex = 0;
+ while ((arrayIndex = clippedElements.indexOf(elements[i], arrayIndex)) !== -1) {
+ clippedElements.splice(arrayIndex, 1);
+ }
+ var clientIds = _elementMeta[elements[i].zcClippingId];
+ if (clientIds) {
+ arrayIndex = 0;
+ while ((arrayIndex = clientIds.indexOf(this.id, arrayIndex)) !== -1) {
+ clientIds.splice(arrayIndex, 1);
+ }
+ if (clientIds.length === 0) {
+ if (_globalConfig.autoActivate === true) {
+ _removeMouseHandlers(elements[i]);
+ }
+ delete elements[i].zcClippingId;
+ }
+ }
+ }
+ }
+ return this;
+ };
+ /**
+ * The underlying implementation of `ZeroClipboard.Client.prototype.elements`.
+ * @private
+ */
+ var _clientElements = function() {
+ var meta = _clientMeta[this.id];
+ return meta && meta.elements ? meta.elements.slice(0) : [];
+ };
+ /**
+ * The underlying implementation of `ZeroClipboard.Client.prototype.destroy`.
+ * @private
+ */
+ var _clientDestroy = function() {
+ var meta = _clientMeta[this.id];
+ if (!meta) {
+ return;
+ }
+ this.unclip();
+ this.off();
+ ZeroClipboard.off("*", meta.coreWildcardHandler);
+ delete _clientMeta[this.id];
+ };
+ /**
+ * Inspect an Event to see if the Client (`this`) should honor it for emission.
+ * @private
+ */
+ var _clientShouldEmit = function(event) {
+ if (!(event && event.type)) {
+ return false;
+ }
+ if (event.client && event.client !== this) {
+ return false;
+ }
+ var meta = _clientMeta[this.id];
+ var clippedEls = meta && meta.elements;
+ var hasClippedEls = !!clippedEls && clippedEls.length > 0;
+ var goodTarget = !event.target || hasClippedEls && clippedEls.indexOf(event.target) !== -1;
+ var goodRelTarget = event.relatedTarget && hasClippedEls && clippedEls.indexOf(event.relatedTarget) !== -1;
+ var goodClient = event.client && event.client === this;
+ if (!meta || !(goodTarget || goodRelTarget || goodClient)) {
+ return false;
+ }
+ return true;
+ };
+ /**
+ * Handle the actual dispatching of events to a client instance.
+ *
+ * @returns `undefined`
+ * @private
+ */
+ var _clientDispatchCallbacks = function(event) {
+ var meta = _clientMeta[this.id];
+ if (!(typeof event === "object" && event && event.type && meta)) {
+ return;
+ }
+ var async = _shouldPerformAsync(event);
+ var wildcardTypeHandlers = meta && meta.handlers["*"] || [];
+ var specificTypeHandlers = meta && meta.handlers[event.type] || [];
+ var handlers = wildcardTypeHandlers.concat(specificTypeHandlers);
+ if (handlers && handlers.length) {
+ var i, len, func, context, eventCopy, originalContext = this;
+ for (i = 0, len = handlers.length; i < len; i++) {
+ func = handlers[i];
+ context = originalContext;
+ if (typeof func === "string" && typeof _window[func] === "function") {
+ func = _window[func];
+ }
+ if (typeof func === "object" && func && typeof func.handleEvent === "function") {
+ context = func;
+ func = func.handleEvent;
+ }
+ if (typeof func === "function") {
+ eventCopy = _extend({}, event);
+ _dispatchCallback(func, context, [ eventCopy ], async);
+ }
+ }
+ }
+ };
+ /**
+ * Prepares the elements for clipping/unclipping.
+ *
+ * @returns An Array of elements.
+ * @private
+ */
+ var _prepClip = function(elements) {
+ if (typeof elements === "string") {
+ elements = [];
+ }
+ return typeof elements.length !== "number" ? [ elements ] : elements;
+ };
+ /**
+ * Add a `mouseover` handler function for a clipped element.
+ *
+ * @returns `undefined`
+ * @private
+ */
+ var _addMouseHandlers = function(element) {
+ if (!(element && element.nodeType === 1)) {
+ return;
+ }
+ var _suppressMouseEvents = function(event) {
+ if (!(event || (event = _window.event))) {
+ return;
+ }
+ if (event._source !== "js") {
+ event.stopImmediatePropagation();
+ event.preventDefault();
+ }
+ delete event._source;
+ };
+ var _elementMouseOver = function(event) {
+ if (!(event || (event = _window.event))) {
+ return;
+ }
+ _suppressMouseEvents(event);
+ ZeroClipboard.focus(element);
+ };
+ element.addEventListener("mouseover", _elementMouseOver, false);
+ element.addEventListener("mouseout", _suppressMouseEvents, false);
+ element.addEventListener("mouseenter", _suppressMouseEvents, false);
+ element.addEventListener("mouseleave", _suppressMouseEvents, false);
+ element.addEventListener("mousemove", _suppressMouseEvents, false);
+ _mouseHandlers[element.zcClippingId] = {
+ mouseover: _elementMouseOver,
+ mouseout: _suppressMouseEvents,
+ mouseenter: _suppressMouseEvents,
+ mouseleave: _suppressMouseEvents,
+ mousemove: _suppressMouseEvents
+ };
+ };
+ /**
+ * Remove a `mouseover` handler function for a clipped element.
+ *
+ * @returns `undefined`
+ * @private
+ */
+ var _removeMouseHandlers = function(element) {
+ if (!(element && element.nodeType === 1)) {
+ return;
+ }
+ var mouseHandlers = _mouseHandlers[element.zcClippingId];
+ if (!(typeof mouseHandlers === "object" && mouseHandlers)) {
+ return;
+ }
+ var key, val, mouseEvents = [ "move", "leave", "enter", "out", "over" ];
+ for (var i = 0, len = mouseEvents.length; i < len; i++) {
+ key = "mouse" + mouseEvents[i];
+ val = mouseHandlers[key];
+ if (typeof val === "function") {
+ element.removeEventListener(key, val, false);
+ }
+ }
+ delete _mouseHandlers[element.zcClippingId];
+ };
+ /**
+ * Creates a new ZeroClipboard client instance.
+ * Optionally, auto-`clip` an element or collection of elements.
+ *
+ * @constructor
+ */
+ ZeroClipboard._createClient = function() {
+ _clientConstructor.apply(this, _args(arguments));
+ };
+ /**
+ * Register an event listener to the client.
+ *
+ * @returns `this`
+ */
+ ZeroClipboard.prototype.on = function() {
+ return _clientOn.apply(this, _args(arguments));
+ };
+ /**
+ * Unregister an event handler from the client.
+ * If no `listener` function/object is provided, it will unregister all handlers for the provided `eventType`.
+ * If no `eventType` is provided, it will unregister all handlers for every event type.
+ *
+ * @returns `this`
+ */
+ ZeroClipboard.prototype.off = function() {
+ return _clientOff.apply(this, _args(arguments));
+ };
+ /**
+ * Retrieve event listeners for an `eventType` from the client.
+ * If no `eventType` is provided, it will retrieve all listeners for every event type.
+ *
+ * @returns array of listeners for the `eventType`; if no `eventType`, then a map/hash object of listeners for all event types; or `null`
+ */
+ ZeroClipboard.prototype.handlers = function() {
+ return _clientListeners.apply(this, _args(arguments));
+ };
+ /**
+ * Event emission receiver from the Flash object for this client's registered JavaScript event listeners.
+ *
+ * @returns For the "copy" event, returns the Flash-friendly "clipData" object; otherwise `undefined`.
+ */
+ ZeroClipboard.prototype.emit = function() {
+ return _clientEmit.apply(this, _args(arguments));
+ };
+ /**
+ * Register clipboard actions for new element(s) to the client.
+ *
+ * @returns `this`
+ */
+ ZeroClipboard.prototype.clip = function() {
+ return _clientClip.apply(this, _args(arguments));
+ };
+ /**
+ * Unregister the clipboard actions of previously registered element(s) on the page.
+ * If no elements are provided, ALL registered elements will be unregistered.
+ *
+ * @returns `this`
+ */
+ ZeroClipboard.prototype.unclip = function() {
+ return _clientUnclip.apply(this, _args(arguments));
+ };
+ /**
+ * Get all of the elements to which this client is clipped.
+ *
+ * @returns array of clipped elements
+ */
+ ZeroClipboard.prototype.elements = function() {
+ return _clientElements.apply(this, _args(arguments));
+ };
+ /**
+ * Self-destruct and clean up everything for a single client.
+ * This will NOT destroy the embedded Flash object.
+ *
+ * @returns `undefined`
+ */
+ ZeroClipboard.prototype.destroy = function() {
+ return _clientDestroy.apply(this, _args(arguments));
+ };
+ /**
+ * Stores the pending plain text to inject into the clipboard.
+ *
+ * @returns `this`
+ */
+ ZeroClipboard.prototype.setText = function(text) {
+ if (!_clientMeta[this.id]) {
+ throw new Error("Attempted to set pending clipboard data from a destroyed ZeroClipboard client instance");
+ }
+ ZeroClipboard.setData("text/plain", text);
+ return this;
+ };
+ /**
+ * Stores the pending HTML text to inject into the clipboard.
+ *
+ * @returns `this`
+ */
+ ZeroClipboard.prototype.setHtml = function(html) {
+ if (!_clientMeta[this.id]) {
+ throw new Error("Attempted to set pending clipboard data from a destroyed ZeroClipboard client instance");
+ }
+ ZeroClipboard.setData("text/html", html);
+ return this;
+ };
+ /**
+ * Stores the pending rich text (RTF) to inject into the clipboard.
+ *
+ * @returns `this`
+ */
+ ZeroClipboard.prototype.setRichText = function(richText) {
+ if (!_clientMeta[this.id]) {
+ throw new Error("Attempted to set pending clipboard data from a destroyed ZeroClipboard client instance");
+ }
+ ZeroClipboard.setData("application/rtf", richText);
+ return this;
+ };
+ /**
+ * Stores the pending data to inject into the clipboard.
+ *
+ * @returns `this`
+ */
+ ZeroClipboard.prototype.setData = function() {
+ if (!_clientMeta[this.id]) {
+ throw new Error("Attempted to set pending clipboard data from a destroyed ZeroClipboard client instance");
+ }
+ ZeroClipboard.setData.apply(this, _args(arguments));
+ return this;
+ };
+ /**
+ * Clears the pending data to inject into the clipboard.
+ * If no `format` is provided, all pending data formats will be cleared.
+ *
+ * @returns `this`
+ */
+ ZeroClipboard.prototype.clearData = function() {
+ if (!_clientMeta[this.id]) {
+ throw new Error("Attempted to clear pending clipboard data from a destroyed ZeroClipboard client instance");
+ }
+ ZeroClipboard.clearData.apply(this, _args(arguments));
+ return this;
+ };
+ /**
+ * Gets a copy of the pending data to inject into the clipboard.
+ * If no `format` is provided, a copy of ALL pending data formats will be returned.
+ *
+ * @returns `String` or `Object`
+ */
+ ZeroClipboard.prototype.getData = function() {
+ if (!_clientMeta[this.id]) {
+ throw new Error("Attempted to get pending clipboard data from a destroyed ZeroClipboard client instance");
+ }
+ return ZeroClipboard.getData.apply(this, _args(arguments));
+ };
+ if (typeof define === "function" && define.amd) {
+ define(function() {
+ return ZeroClipboard;
+ });
+ } else if (typeof module === "object" && module && typeof module.exports === "object" && module.exports) {
+ module.exports = ZeroClipboard;
+ } else {
+ window.ZeroClipboard = ZeroClipboard;
+ }
+})(function() {
+ return this || window;
+}());
\ No newline at end of file
diff --git a/js/ZeroClipboard.min.js b/js/ZeroClipboard.min.js
new file mode 100644
index 0000000..8f7012d
--- /dev/null
+++ b/js/ZeroClipboard.min.js
@@ -0,0 +1,10 @@
+/*!
+ * ZeroClipboard
+ * The ZeroClipboard library provides an easy way to copy text to the clipboard using an invisible Adobe Flash movie and a JavaScript interface
+ * Copyright (c) 2009-2017 Jon Rohan, James M. Greene
+ * Licensed MIT
+ * http://zeroclipboard.github.io/
+ * v2.4.0-beta.1
+ */
+!function(a,b){"use strict";var c,d,e,f=a,g=f.document,h=f.navigator,i=f.setTimeout,j=f.clearTimeout,k=f.setInterval,l=f.clearInterval,m=f.getComputedStyle,n=f.encodeURIComponent,o=f.ActiveXObject,p=f.Error,q=f.Number.parseInt||f.parseInt,r=f.Number.parseFloat||f.parseFloat,s=f.Number.isNaN||f.isNaN,t=f.Date.now,u=f.Object.keys,v=f.Object.prototype.hasOwnProperty,w=f.Array.prototype.slice,x=function(){var a=function(a){return a};if("function"==typeof f.wrap&&"function"==typeof f.unwrap)try{var b=g.createElement("div"),c=f.unwrap(b);1===b.nodeType&&c&&1===c.nodeType&&(a=f.unwrap)}catch(d){}return a}(),y=function(a){return w.call(a,0)},z=function(){var a,c,d,e,f,g,h=y(arguments),i=h[0]||{};for(a=1,c=h.length;c>a;a++)if(null!=(d=h[a]))for(e in d)v.call(d,e)&&(f=i[e],g=d[e],i!==g&&g!==b&&(i[e]=g));return i},A=function(a){var b,c,d,e;if("object"!=typeof a||null==a||"number"==typeof a.nodeType)b=a;else if("number"==typeof a.length)for(b=[],c=0,d=a.length;d>c;c++)v.call(a,c)&&(b[c]=A(a[c]));else{b={};for(e in a)v.call(a,e)&&(b[e]=A(a[e]))}return b},B=function(a,b){for(var c={},d=0,e=b.length;e>d;d++)b[d]in a&&(c[b[d]]=a[b[d]]);return c},C=function(a,b){var c={};for(var d in a)-1===b.indexOf(d)&&(c[d]=a[d]);return c},D=function(a){if(a)for(var b in a)v.call(a,b)&&delete a[b];return a},E=function(a,b){if(a&&1===a.nodeType&&a.ownerDocument&&b&&(1===b.nodeType&&b.ownerDocument&&b.ownerDocument===a.ownerDocument||9===b.nodeType&&!b.ownerDocument&&b===a.ownerDocument))do{if(a===b)return!0;a=a.parentNode}while(a);return!1},F=function(a){var b;return"string"==typeof a&&a&&(b=a.split("#")[0].split("?")[0],b=a.slice(0,a.lastIndexOf("/")+1)),b},G=function(a){var b,c;return"string"==typeof a&&a&&(c=a.match(/^(?:|[^:@]*@|.+\)@(?=http[s]?|file)|.+?\s+(?: at |@)(?:[^:\(]+ )*[\(]?)((?:http[s]?|file):\/\/[\/]?.+?\/[^:\)]*?)(?::\d+)(?::\d+)?/),c&&c[1]?b=c[1]:(c=a.match(/\)@((?:http[s]?|file):\/\/[\/]?.+?\/[^:\)]*?)(?::\d+)(?::\d+)?/),c&&c[1]&&(b=c[1]))),b},H=function(){var a,b;try{throw new p}catch(c){b=c}return b&&(a=b.sourceURL||b.fileName||G(b.stack)),a},I=function(){var a,c,d;if(g.currentScript&&(a=g.currentScript.src))return a;if(c=g.getElementsByTagName("script"),1===c.length)return c[0].src||b;if("readyState"in(c[0]||document.createElement("script")))for(d=c.length;d--;)if("interactive"===c[d].readyState&&(a=c[d].src))return a;return"loading"===g.readyState&&(a=c[c.length-1].src)?a:(a=H())?a:b},J=function(){var a,c,d,e=g.getElementsByTagName("script");for(a=e.length;a--;){if(!(d=e[a].src)){c=null;break}if(d=F(d),null==c)c=d;else if(c!==d){c=null;break}}return c||b},K=function(){var a=F(I())||J()||"";return a+"ZeroClipboard.swf"},L=function(){var a=/win(dows|[\s]?(nt|me|ce|xp|vista|[\d]+))/i;return!!h&&(a.test(h.appVersion||"")||a.test(h.platform||"")||-1!==(h.userAgent||"").indexOf("Windows"))},M=function(){return null==f.opener&&(!!f.top&&f!=f.top||!!f.parent&&f!=f.parent)}(),N="html"===g.documentElement.nodeName,O={bridge:null,version:"0.0.0",pluginType:"unknown",sandboxed:null,disabled:null,outdated:null,insecure:null,unavailable:null,degraded:null,deactivated:null,overdue:null,ready:null},P="11.0.0",Q={},R={},S=null,T=0,U=0,V={ready:"Flash communication is established",error:{"flash-sandboxed":"Attempting to run Flash in a sandboxed iframe, which is impossible","flash-disabled":"Flash is disabled or not installed. May also be attempting to run Flash in a sandboxed iframe, which is impossible.","flash-outdated":"Flash is too outdated to support ZeroClipboard","flash-insecure":"Flash will be unable to communicate due to a protocol mismatch between your `swfPath` configuration and the page","flash-unavailable":"Flash is unable to communicate bidirectionally with JavaScript","flash-degraded":"Flash is unable to preserve data fidelity when communicating with JavaScript","flash-deactivated":"Flash is too outdated for your browser and/or is configured as click-to-activate.\nThis may also mean that the ZeroClipboard SWF object could not be loaded, so please check your `swfPath` configuration and/or network connectivity.\nMay also be attempting to run Flash in a sandboxed iframe, which is impossible.","flash-overdue":"Flash communication was established but NOT within the acceptable time limit","version-mismatch":"ZeroClipboard JS version number does not match ZeroClipboard SWF version number","clipboard-error":"At least one error was thrown while ZeroClipboard was attempting to inject your data into the clipboard","config-mismatch":"ZeroClipboard configuration does not match Flash's reality","swf-not-found":"The ZeroClipboard SWF object could not be loaded, so please check your `swfPath` configuration and/or network connectivity","browser-unsupported":"The browser does not support the required HTML DOM and JavaScript features"}},W=["flash-unavailable","flash-degraded","flash-overdue","version-mismatch","config-mismatch","clipboard-error"],X=["flash-sandboxed","flash-disabled","flash-outdated","flash-insecure","flash-unavailable","flash-degraded","flash-deactivated","flash-overdue"],Y=new RegExp("^flash-("+X.map(function(a){return a.replace(/^flash-/,"")}).join("|")+")$"),Z=new RegExp("^flash-("+X.filter(function(a){return"flash-disabled"!==a}).map(function(a){return a.replace(/^flash-/,"")}).join("|")+")$"),$={swfPath:K(),trustedDomains:f.location.host?[f.location.host]:[],cacheBust:!0,forceEnhancedClipboard:!1,flashLoadTimeout:3e4,autoActivate:!0,bubbleEvents:!0,fixLineEndings:!0,containerId:"global-zeroclipboard-html-bridge",containerClass:"global-zeroclipboard-container",swfObjectId:"global-zeroclipboard-flash-bridge",hoverClass:"zeroclipboard-is-hover",activeClass:"zeroclipboard-is-active",forceHandCursor:!1,title:null,zIndex:999999999},_=function(a){"object"!=typeof a||!a||"length"in a||u(a).forEach(function(b){if(/^(?:forceHandCursor|title|zIndex|bubbleEvents|fixLineEndings)$/.test(b))$[b]=a[b];else if(null==O.bridge)if("containerId"===b||"swfObjectId"===b){if(!qa(a[b]))throw new Error("The specified `"+b+"` value is not valid as an HTML4 Element ID");$[b]=a[b]}else $[b]=a[b]});{if("string"!=typeof a||!a)return A($);if(v.call($,a))return $[a]}},aa=function(){return Ya(),{browser:z(B(h,["userAgent","platform","appName","appVersion"]),{isSupported:ba()}),flash:C(O,["bridge"]),zeroclipboard:{version:$a.version,config:$a.config()}}},ba=function(){return!!(g.addEventListener&&f.Object.keys&&f.Array.prototype.map)},ca=function(){return!!(O.sandboxed||O.disabled||O.outdated||O.unavailable||O.degraded||O.deactivated)},da=function(a,d){var e,f,g,h={};if("string"==typeof a&&a?g=a.toLowerCase().split(/\s+/):"object"!=typeof a||!a||"length"in a||"undefined"!=typeof d||u(a).forEach(function(b){var c=a[b];"function"==typeof c&&$a.on(b,c)}),g&&g.length&&d){for(e=0,f=g.length;f>e;e++)a=g[e].replace(/^on/,""),h[a]=!0,Q[a]||(Q[a]=[]),Q[a].push(d);if(h.ready&&O.ready&&$a.emit({type:"ready"}),h.error){for(ba()||$a.emit({type:"error",name:"browser-unsupported"}),e=0,f=X.length;f>e;e++)if(O[X[e].replace(/^flash-/,"")]===!0){$a.emit({type:"error",name:X[e]});break}c!==b&&$a.version!==c&&$a.emit({type:"error",name:"version-mismatch",jsVersion:$a.version,swfVersion:c})}}return $a},ea=function(a,b){var c,d,e,f,g;if(0===arguments.length?f=u(Q):"string"==typeof a&&a?f=a.toLowerCase().split(/\s+/):"object"!=typeof a||!a||"length"in a||"undefined"!=typeof b||u(a).forEach(function(b){var c=a[b];"function"==typeof c&&$a.off(b,c)}),f&&f.length)for(c=0,d=f.length;d>c;c++)if(a=f[c].replace(/^on/,""),g=Q[a],g&&g.length)if(b)for(e=g.indexOf(b);-1!==e;)g.splice(e,1),e=g.indexOf(b,e);else g.length=0;return $a},fa=function(a){var b;return b="string"==typeof a&&a?A(Q[a])||null:A(Q)},ga=function(a){var b,c,d;return a=ra(a),a&&!ya(a)?"ready"===a.type&&O.overdue===!0?$a.emit({type:"error",name:"flash-overdue"}):(b=z({},a),wa.call(this,b),"copy"===a.type&&(d=Ha(R),c=d.data,S=d.formatMap),c):void 0},ha=function(){var a=$.swfPath||"",b=a.slice(0,2),c=a.slice(0,a.indexOf("://")+1);return"\\\\"===b?"file:":"//"===b||""===c?f.location.protocol:c},ia=function(){var a,b,c=O.sandboxed;return ba()?(Ya(),"boolean"!=typeof O.ready&&(O.ready=!1),void(O.sandboxed!==c&&O.sandboxed===!0?(O.ready=!1,$a.emit({type:"error",name:"flash-sandboxed"})):$a.isFlashUnusable()||null!==O.bridge||(b=ha(),b&&b!==f.location.protocol?$a.emit({type:"error",name:"flash-insecure"}):(a=$.flashLoadTimeout,"number"==typeof a&&a>=0&&(T=i(function(){"boolean"!=typeof O.deactivated&&(O.deactivated=!0),O.deactivated===!0&&$a.emit({type:"error",name:"flash-deactivated"})},a)),O.overdue=!1,Fa())))):(O.ready=!1,void $a.emit({type:"error",name:"browser-unsupported"}))},ja=function(){$a.clearData(),$a.blur(),$a.emit("destroy"),Ga(),$a.off()},ka=function(a,b){var c;if("object"==typeof a&&a&&"undefined"==typeof b)c=a,$a.clearData();else{if("string"!=typeof a||!a)return;c={},c[a]=b}for(var d in c)"string"==typeof d&&d&&v.call(c,d)&&"string"==typeof c[d]&&c[d]&&(R[d]=Xa(c[d]))},la=function(a){"undefined"==typeof a?(D(R),S=null):"string"==typeof a&&v.call(R,a)&&delete R[a]},ma=function(a){return"undefined"==typeof a?A(R):"string"==typeof a&&v.call(R,a)?R[a]:void 0},na=function(a){if(a&&1===a.nodeType){d&&(Pa(d,$.activeClass),d!==a&&Pa(d,$.hoverClass)),d=a,Oa(a,$.hoverClass);var b=a.getAttribute("title")||$.title;if("string"==typeof b&&b){var c=Da(O.bridge);c&&c.setAttribute("title",b)}var e=$.forceHandCursor===!0||"pointer"===Qa(a,"cursor");Va(e),Ua()}},oa=function(){var a=Da(O.bridge);a&&(a.removeAttribute("title"),a.style.left="0px",a.style.top="-9999px",a.style.width="1px",a.style.height="1px"),d&&(Pa(d,$.hoverClass),Pa(d,$.activeClass),d=null)},pa=function(){return d||null},qa=function(a){return"string"==typeof a&&a&&/^[A-Za-z][A-Za-z0-9_:\-\.]*$/.test(a)},ra=function(a){var b;if("string"==typeof a&&a?(b=a,a={}):"object"==typeof a&&a&&"string"==typeof a.type&&a.type&&(b=a.type),b){b=b.toLowerCase(),!a.target&&(/^(copy|aftercopy|_click)$/.test(b)||"error"===b&&"clipboard-error"===a.name)&&(a.target=e),z(a,{type:b,target:a.target||d||null,relatedTarget:a.relatedTarget||null,currentTarget:O&&O.bridge||null,timeStamp:a.timeStamp||t()||null});var c=V[a.type];return"error"===a.type&&a.name&&c&&(c=c[a.name]),c&&(a.message=c),"ready"===a.type&&z(a,{target:null,version:O.version}),"error"===a.type&&(Y.test(a.name)&&z(a,{target:null,minimumVersion:P}),Z.test(a.name)&&z(a,{version:O.version}),"flash-insecure"===a.name&&z(a,{pageProtocol:f.location.protocol,swfProtocol:ha()})),"copy"===a.type&&(a.clipboardData={setData:$a.setData,clearData:$a.clearData}),"aftercopy"===a.type&&(a=Ia(a,S)),a.target&&!a.relatedTarget&&(a.relatedTarget=sa(a.target)),ta(a)}},sa=function(a){var b=a&&a.getAttribute&&a.getAttribute("data-clipboard-target");return b?g.getElementById(b):null},ta=function(a){if(a&&/^_(?:click|mouse(?:over|out|down|up|move))$/.test(a.type)){var c=a.target,d="_mouseover"===a.type&&a.relatedTarget?a.relatedTarget:b,e="_mouseout"===a.type&&a.relatedTarget?a.relatedTarget:b,h=Ra(c),i=f.screenLeft||f.screenX||0,j=f.screenTop||f.screenY||0,k=g.body.scrollLeft+g.documentElement.scrollLeft,l=g.body.scrollTop+g.documentElement.scrollTop,m=h.left+("number"==typeof a._stageX?a._stageX:0),n=h.top+("number"==typeof a._stageY?a._stageY:0),o=m-k,p=n-l,q=i+o,r=j+p,s="number"==typeof a.movementX?a.movementX:0,t="number"==typeof a.movementY?a.movementY:0;delete a._stageX,delete a._stageY,z(a,{srcElement:c,fromElement:d,toElement:e,screenX:q,screenY:r,pageX:m,pageY:n,clientX:o,clientY:p,x:o,y:p,movementX:s,movementY:t,offsetX:0,offsetY:0,layerX:0,layerY:0})}return a},ua=function(a){var b=a&&"string"==typeof a.type&&a.type||"";return!/^(?:(?:before)?copy|destroy)$/.test(b)},va=function(a,b,c,d){d?i(function(){a.apply(b,c)},0):a.apply(b,c)},wa=function(a){if("object"==typeof a&&a&&a.type){var b=ua(a),c=Q["*"]||[],d=Q[a.type]||[],e=c.concat(d);if(e&&e.length){var g,h,i,j,k,l=this;for(g=0,h=e.length;h>g;g++)i=e[g],j=l,"string"==typeof i&&"function"==typeof f[i]&&(i=f[i]),"object"==typeof i&&i&&"function"==typeof i.handleEvent&&(j=i,i=i.handleEvent),"function"==typeof i&&(k=z({},a),va(i,j,[k],b))}return this}},xa=function(a){var b=null;return(M===!1||a&&"error"===a.type&&a.name&&-1!==W.indexOf(a.name))&&(b=!1),b},ya=function(a){var b=a.target||d||null,f="swf"===a._source;switch(delete a._source,a.type){case"error":var g="flash-sandboxed"===a.name||xa(a);"boolean"==typeof g&&(O.sandboxed=g),"browser-unsupported"===a.name?z(O,{disabled:!1,outdated:!1,unavailable:!1,degraded:!1,deactivated:!1,overdue:!1,ready:!1}):-1!==X.indexOf(a.name)?z(O,{disabled:"flash-disabled"===a.name,outdated:"flash-outdated"===a.name,insecure:"flash-insecure"===a.name,unavailable:"flash-unavailable"===a.name,degraded:"flash-degraded"===a.name,deactivated:"flash-deactivated"===a.name,overdue:"flash-overdue"===a.name,ready:!1}):"version-mismatch"===a.name&&(c=a.swfVersion,z(O,{disabled:!1,outdated:!1,insecure:!1,unavailable:!1,degraded:!1,deactivated:!1,overdue:!1,ready:!1})),Ta();break;case"ready":c=a.swfVersion;var h=O.deactivated===!0;z(O,{sandboxed:!1,disabled:!1,outdated:!1,insecure:!1,unavailable:!1,degraded:!1,deactivated:!1,overdue:h,ready:!h}),Ta();break;case"beforecopy":e=b;break;case"copy":var i,j,k=a.relatedTarget;!R["text/html"]&&!R["text/plain"]&&k&&(j=k.value||k.outerHTML||k.innerHTML)&&(i=k.value||k.textContent||k.innerText)?(a.clipboardData.clearData(),a.clipboardData.setData("text/plain",i),j!==i&&a.clipboardData.setData("text/html",j)):!R["text/plain"]&&a.target&&(i=a.target.getAttribute("data-clipboard-text"))&&(a.clipboardData.clearData(),a.clipboardData.setData("text/plain",i));break;case"aftercopy":za(a),$a.clearData(),b&&b!==Na()&&b.focus&&b.focus();break;case"_mouseover":$a.focus(b),$.bubbleEvents===!0&&f&&(b&&b!==a.relatedTarget&&!E(a.relatedTarget,b)&&Aa(z({},a,{type:"mouseenter",bubbles:!1,cancelable:!1})),Aa(z({},a,{type:"mouseover"})));break;case"_mouseout":$a.blur(),$.bubbleEvents===!0&&f&&(b&&b!==a.relatedTarget&&!E(a.relatedTarget,b)&&Aa(z({},a,{type:"mouseleave",bubbles:!1,cancelable:!1})),Aa(z({},a,{type:"mouseout"})));break;case"_mousedown":Oa(b,$.activeClass),$.bubbleEvents===!0&&f&&Aa(z({},a,{type:a.type.slice(1)}));break;case"_mouseup":Pa(b,$.activeClass),$.bubbleEvents===!0&&f&&Aa(z({},a,{type:a.type.slice(1)}));break;case"_click":e=null,$.bubbleEvents===!0&&f&&Aa(z({},a,{type:a.type.slice(1)}));break;case"_mousemove":$.bubbleEvents===!0&&f&&Aa(z({},a,{type:a.type.slice(1)}))}return/^_(?:click|mouse(?:over|out|down|up|move))$/.test(a.type)?!0:void 0},za=function(a){if(a.errors&&a.errors.length>0){var b=A(a);z(b,{type:"error",name:"clipboard-error"}),delete b.success,i(function(){$a.emit(b)},0)}},Aa=function(a){if(a&&"string"==typeof a.type&&a){var b,c=a.target||null,d=c&&c.ownerDocument||g,e={view:d.defaultView||f,canBubble:!0,cancelable:!0,detail:"click"===a.type?1:0,button:"number"==typeof a.which?a.which-1:"number"==typeof a.button?a.button:d.createEvent?0:1},h=z(e,a);c&&d.createEvent&&c.dispatchEvent&&(h=[h.type,h.canBubble,h.cancelable,h.view,h.detail,h.screenX,h.screenY,h.clientX,h.clientY,h.ctrlKey,h.altKey,h.shiftKey,h.metaKey,h.button,h.relatedTarget],b=d.createEvent("MouseEvents"),b.initMouseEvent&&(b.initMouseEvent.apply(b,h),b._source="js",c.dispatchEvent(b)))}},Ba=function(){var a=$.flashLoadTimeout;if("number"==typeof a&&a>=0){var b=Math.min(1e3,a/10),c=$.swfObjectId+"_fallbackContent";U=k(function(){var a=g.getElementById(c);Sa(a)&&(Ta(),O.deactivated=null,$a.emit({type:"error",name:"swf-not-found"}))},b)}},Ca=function(){var a=g.createElement("div");return a.id=$.containerId,a.className=$.containerClass,a.style.position="absolute",a.style.left="0px",a.style.top="-9999px",a.style.width="1px",a.style.height="1px",a.style.zIndex=""+Wa($.zIndex),a},Da=function(a){for(var b=a&&a.parentNode;b&&"OBJECT"===b.nodeName&&b.parentNode;)b=b.parentNode;return b||null},Ea=function(a){return"string"==typeof a&&a?a.replace(/["&'<>]/g,function(a){switch(a){case'"':return""";case"&":return"&";case"'":return"'";case"<":return"<";case">":return">";default:return a}}):a},Fa=function(){var a,b=O.bridge,c=Da(b);if(!b){var d=Ma(f.location.host,$),e="never"===d?"none":"all",h=Ka(z({jsVersion:$a.version},$)),i=$.swfPath+Ja($.swfPath,$);N&&(i=Ea(i)),c=Ca();var j=g.createElement("div");c.appendChild(j),g.body.appendChild(c);var k=g.createElement("div"),l="activex"===O.pluginType;k.innerHTML='"+(l?' ':"")+'
',b=k.firstChild,k=null,x(b).ZeroClipboard=$a,c.replaceChild(b,j),Ba()}return b||(b=g[$.swfObjectId],b&&(a=b.length)&&(b=b[a-1]),!b&&c&&(b=c.firstChild)),O.bridge=b||null,b},Ga=function(){var a=O.bridge;if(a){var d=Da(a);d&&("activex"===O.pluginType&&"readyState"in a?(a.style.display="none",function e(){if(4===a.readyState){for(var b in a)"function"==typeof a[b]&&(a[b]=null);a.parentNode&&a.parentNode.removeChild(a),d.parentNode&&d.parentNode.removeChild(d)}else i(e,10)}()):(a.parentNode&&a.parentNode.removeChild(a),d.parentNode&&d.parentNode.removeChild(d))),Ta(),O.ready=null,O.bridge=null,O.deactivated=null,O.insecure=null,c=b}},Ha=function(a){var b={},c={};if("object"==typeof a&&a){for(var d in a)if(d&&v.call(a,d)&&"string"==typeof a[d]&&a[d])switch(d.toLowerCase()){case"text/plain":case"text":case"air:text":case"flash:text":b.text=a[d],c.text=d;break;case"text/html":case"html":case"air:html":case"flash:html":b.html=a[d],c.html=d;break;case"application/rtf":case"text/rtf":case"rtf":case"richtext":case"air:rtf":case"flash:rtf":b.rtf=a[d],c.rtf=d}return{data:b,formatMap:c}}},Ia=function(a,b){if("object"!=typeof a||!a||"object"!=typeof b||!b)return a;var c={};for(var d in a)if(v.call(a,d))if("errors"===d){c[d]=a[d]?a[d].slice():[];for(var e=0,f=c[d].length;f>e;e++)c[d][e].format=b[c[d][e].format]}else if("success"!==d&&"data"!==d)c[d]=a[d];else{c[d]={};var g=a[d];for(var h in g)h&&v.call(g,h)&&v.call(b,h)&&(c[d][b[h]]=g[h])}return c},Ja=function(a,b){var c=null==b||b&&b.cacheBust===!0;return c?(-1===a.indexOf("?")?"?":"&")+"noCache="+t():""},Ka=function(a){var b,c,d,e,g="",h=[];if(a.trustedDomains&&("string"==typeof a.trustedDomains?e=[a.trustedDomains]:"object"==typeof a.trustedDomains&&"length"in a.trustedDomains&&(e=a.trustedDomains)),e&&e.length)for(b=0,c=e.length;c>b;b++)if(v.call(e,b)&&e[b]&&"string"==typeof e[b]){if(d=La(e[b]),!d)continue;if("*"===d){h.length=0,h.push(d);break}h.push.apply(h,[d,"//"+d,f.location.protocol+"//"+d])}return h.length&&(g+="trustedOrigins="+n(h.join(","))),a.forceEnhancedClipboard===!0&&(g+=(g?"&":"")+"forceEnhancedClipboard=true"),"string"==typeof a.swfObjectId&&a.swfObjectId&&(g+=(g?"&":"")+"swfObjectId="+n(a.swfObjectId)),"string"==typeof a.jsVersion&&a.jsVersion&&(g+=(g?"&":"")+"jsVersion="+n(a.jsVersion)),g},La=function(a){if(null==a||""===a)return null;if(a=a.replace(/^\s+|\s+$/g,""),""===a)return null;var b=a.indexOf("//");a=-1===b?a:a.slice(b+2);var c=a.indexOf("/");return a=-1===c?a:-1===b||0===c?null:a.slice(0,c),a&&".swf"===a.slice(-4).toLowerCase()?null:a||null},Ma=function(){var a=function(a){var b,c,d,e=[];if("string"==typeof a&&(a=[a]),"object"!=typeof a||!a||"number"!=typeof a.length)return e;for(b=0,c=a.length;c>b;b++)if(v.call(a,b)&&(d=La(a[b]))){if("*"===d){e.length=0,e.push("*");break}-1===e.indexOf(d)&&e.push(d)}return e};return function(b,c){var d=La(c.swfPath);null===d&&(d=b);var e=a(c.trustedDomains),f=e.length;if(f>0){if(1===f&&"*"===e[0])return"always";if(-1!==e.indexOf(b))return 1===f&&b===d?"sameDomain":"always"}return"never"}}(),Na=function(){try{return g.activeElement}catch(a){return null}},Oa=function(a,b){var c,d,e,f=[];if("string"==typeof b&&b&&(f=b.split(/\s+/)),a&&1===a.nodeType&&f.length>0){for(e=(" "+(a.className||"")+" ").replace(/[\t\r\n\f]/g," "),c=0,d=f.length;d>c;c++)-1===e.indexOf(" "+f[c]+" ")&&(e+=f[c]+" ");e=e.replace(/^\s+|\s+$/g,""),e!==a.className&&(a.className=e)}return a},Pa=function(a,b){var c,d,e,f=[];if("string"==typeof b&&b&&(f=b.split(/\s+/)),a&&1===a.nodeType&&f.length>0&&a.className){for(e=(" "+a.className+" ").replace(/[\t\r\n\f]/g," "),c=0,d=f.length;d>c;c++)e=e.replace(" "+f[c]+" "," ");e=e.replace(/^\s+|\s+$/g,""),e!==a.className&&(a.className=e)}return a},Qa=function(a,b){var c=m(a,null).getPropertyValue(b);return"cursor"!==b||c&&"auto"!==c||"A"!==a.nodeName?c:"pointer"},Ra=function(a){var b={left:0,top:0,width:0,height:0};if(a.getBoundingClientRect){var c=a.getBoundingClientRect(),d=f.pageXOffset,e=f.pageYOffset,h=g.documentElement.clientLeft||0,i=g.documentElement.clientTop||0,j=0,k=0;if("relative"===Qa(g.body,"position")){var l=g.body.getBoundingClientRect(),m=g.documentElement.getBoundingClientRect();j=l.left-m.left||0,k=l.top-m.top||0}b.left=c.left+d-h-j,b.top=c.top+e-i-k,b.width="width"in c?c.width:c.right-c.left,b.height="height"in c?c.height:c.bottom-c.top}return b},Sa=function(a){if(!a)return!1;var b=m(a,null);if(!b)return!1;var c=r(b.height)>0,d=r(b.width)>0,e=r(b.top)>=0,f=r(b.left)>=0,g=c&&d&&e&&f,h=g?null:Ra(a),i="none"!==b.display&&"collapse"!==b.visibility&&(g||!!h&&(c||h.height>0)&&(d||h.width>0)&&(e||h.top>=0)&&(f||h.left>=0));return i},Ta=function(){j(T),T=0,l(U),U=0},Ua=function(){var a;if(d&&(a=Da(O.bridge))){var b=Ra(d);z(a.style,{width:b.width+"px",height:b.height+"px",top:b.top+"px",left:b.left+"px",zIndex:""+Wa($.zIndex)})}},Va=function(a){O.ready===!0&&(O.bridge&&"function"==typeof O.bridge.setHandCursor?O.bridge.setHandCursor(a):O.ready=!1)},Wa=function(a){if(/^(?:auto|inherit)$/.test(a))return a;var b;return"number"!=typeof a||s(a)?"string"==typeof a&&(b=Wa(q(a,10))):b=a,"number"==typeof b?b:"auto"},Xa=function(a){var b=/(\r\n|\r|\n)/g;return"string"==typeof a&&$.fixLineEndings===!0&&(L()?/((^|[^\r])\n|\r([^\n]|$))/.test(a)&&(a=a.replace(b,"\r\n")):/\r/.test(a)&&(a=a.replace(b,"\n"))),a},Ya=function(b){var c,d,e,f=O.sandboxed,g=null;if(b=b===!0,M===!1)g=!1;else{try{d=a.frameElement||null}catch(h){e={name:h.name,message:h.message}}if(d&&1===d.nodeType&&"IFRAME"===d.nodeName)try{g=d.hasAttribute("sandbox")}catch(h){g=null}else{try{c=document.domain||null}catch(h){c=null}(null===c||e&&"SecurityError"===e.name&&/(^|[\s\(\[@])sandbox(es|ed|ing|[\s\.,!\)\]@]|$)/.test(e.message.toLowerCase()))&&(g=!0)}}return O.sandboxed=g,f===g||b||Za(o),g},Za=function(a){function b(a){var b=a.match(/[\d]+/g);return b.length=3,b.join(".")}function c(a){return!!a&&(a=a.toLowerCase())&&(/^(pepflashplayer\.dll|libpepflashplayer\.so|pepperflashplayer\.plugin)$/.test(a)||"chrome.plugin"===a.slice(-13))}function d(a){a&&(i=!0,a.version&&(l=b(a.version)),!l&&a.description&&(l=b(a.description)),a.filename&&(k=c(a.filename)))}var e,f,g,i=!1,j=!1,k=!1,l="";if(h.plugins&&h.plugins.length)e=h.plugins["Shockwave Flash"],d(e),h.plugins["Shockwave Flash 2.0"]&&(i=!0,l="2.0.0.11");else if(h.mimeTypes&&h.mimeTypes.length)g=h.mimeTypes["application/x-shockwave-flash"],e=g&&g.enabledPlugin,d(e);else if("undefined"!=typeof a){j=!0;try{f=new a("ShockwaveFlash.ShockwaveFlash.7"),i=!0,l=b(f.GetVariable("$version"))}catch(m){try{f=new a("ShockwaveFlash.ShockwaveFlash.6"),i=!0,l="6.0.21"}catch(n){try{f=new a("ShockwaveFlash.ShockwaveFlash"),i=!0,l=b(f.GetVariable("$version"))}catch(o){j=!1}}}}O.disabled=i!==!0,O.outdated=l&&r(l)e;e++)a=g[e].replace(/^on/,""),h[a]=!0,k[a]||(k[a]=[]),k[a].push(d);if(h.ready&&O.ready&&this.emit({type:"ready",client:this}),h.error){for(e=0,f=X.length;f>e;e++)if(O[X[e].replace(/^flash-/,"")]){this.emit({type:"error",name:X[e],client:this});break}c!==b&&$a.version!==c&&this.emit({type:"error",name:"version-mismatch",jsVersion:$a.version,swfVersion:c})}}return i},gb=function(a,b){var c,d,e,f,g,h=this,i=ab[h.id],j=i&&i.handlers;if(!j)return h;if(0===arguments.length?f=u(j):"string"==typeof a&&a?f=a.split(/\s+/):"object"!=typeof a||!a||"length"in a||"undefined"!=typeof b||u(a).forEach(function(b){var c=a[b];"function"==typeof c&&h.off(b,c)}),f&&f.length)for(c=0,d=f.length;d>c;c++)if(a=f[c].toLowerCase().replace(/^on/,""),g=j[a],g&&g.length)if(b)for(e=g.indexOf(b);-1!==e;)g.splice(e,1),e=g.indexOf(b,e);else g.length=0;return h},hb=function(a){var b=null,c=ab[this.id]&&ab[this.id].handlers;return c&&(b="string"==typeof a&&a?c[a]?c[a].slice(0):[]:A(c)),b},ib=function(a){var b,c=this;return nb.call(c,a)&&("object"==typeof a&&a&&"string"==typeof a.type&&a.type&&(a=z({},a)),b=z({},ra(a),{client:c}),ob.call(c,b)),c},jb=function(a){if(!ab[this.id])throw new Error("Attempted to clip element(s) to a destroyed ZeroClipboard client instance");a=pb(a);for(var b=0;b0,e=!a.target||d&&-1!==c.indexOf(a.target),f=a.relatedTarget&&d&&-1!==c.indexOf(a.relatedTarget),g=a.client&&a.client===this;return b&&(e||f||g)?!0:!1},ob=function(a){var b=ab[this.id];if("object"==typeof a&&a&&a.type&&b){var c=ua(a),d=b&&b.handlers["*"]||[],e=b&&b.handlers[a.type]||[],g=d.concat(e);if(g&&g.length){var h,i,j,k,l,m=this;for(h=0,i=g.length;i>h;h++)j=g[h],k=m,"string"==typeof j&&"function"==typeof f[j]&&(j=f[j]),"object"==typeof j&&j&&"function"==typeof j.handleEvent&&(k=j,j=j.handleEvent),"function"==typeof j&&(l=z({},a),va(j,k,[l],c))}}},pb=function(a){return"string"==typeof a&&(a=[]),"number"!=typeof a.length?[a]:a},qb=function(a){if(a&&1===a.nodeType){var b=function(a){(a||(a=f.event))&&("js"!==a._source&&(a.stopImmediatePropagation(),a.preventDefault()),delete a._source)},c=function(c){(c||(c=f.event))&&(b(c),$a.focus(a))};a.addEventListener("mouseover",c,!1),a.addEventListener("mouseout",b,!1),a.addEventListener("mouseenter",b,!1),a.addEventListener("mouseleave",b,!1),a.addEventListener("mousemove",b,!1),db[a.zcClippingId]={mouseover:c,mouseout:b,mouseenter:b,mouseleave:b,mousemove:b}}},rb=function(a){if(a&&1===a.nodeType){var b=db[a.zcClippingId];if("object"==typeof b&&b){for(var c,d,e=["move","leave","enter","out","over"],f=0,g=e.length;g>f;f++)c="mouse"+e[f],d=b[c],"function"==typeof d&&a.removeEventListener(c,d,!1);delete db[a.zcClippingId]}}};$a._createClient=function(){eb.apply(this,y(arguments))},$a.prototype.on=function(){return fb.apply(this,y(arguments))},$a.prototype.off=function(){return gb.apply(this,y(arguments))},$a.prototype.handlers=function(){return hb.apply(this,y(arguments))},$a.prototype.emit=function(){return ib.apply(this,y(arguments))},$a.prototype.clip=function(){return jb.apply(this,y(arguments))},$a.prototype.unclip=function(){return kb.apply(this,y(arguments))},$a.prototype.elements=function(){return lb.apply(this,y(arguments))},$a.prototype.destroy=function(){return mb.apply(this,y(arguments))},$a.prototype.setText=function(a){if(!ab[this.id])throw new Error("Attempted to set pending clipboard data from a destroyed ZeroClipboard client instance");return $a.setData("text/plain",a),this},$a.prototype.setHtml=function(a){if(!ab[this.id])throw new Error("Attempted to set pending clipboard data from a destroyed ZeroClipboard client instance");return $a.setData("text/html",a),this},$a.prototype.setRichText=function(a){if(!ab[this.id])throw new Error("Attempted to set pending clipboard data from a destroyed ZeroClipboard client instance");return $a.setData("application/rtf",a),this},$a.prototype.setData=function(){if(!ab[this.id])throw new Error("Attempted to set pending clipboard data from a destroyed ZeroClipboard client instance");return $a.setData.apply(this,y(arguments)),this},$a.prototype.clearData=function(){if(!ab[this.id])throw new Error("Attempted to clear pending clipboard data from a destroyed ZeroClipboard client instance");return $a.clearData.apply(this,y(arguments)),this},$a.prototype.getData=function(){if(!ab[this.id])throw new Error("Attempted to get pending clipboard data from a destroyed ZeroClipboard client instance");return $a.getData.apply(this,y(arguments))},"function"==typeof define&&define.amd?define(function(){return $a}):"object"==typeof module&&module&&"object"==typeof module.exports&&module.exports?module.exports=$a:a.ZeroClipboard=$a}(function(){return this||window}());
+//# sourceMappingURL=ZeroClipboard.min.map
\ No newline at end of file
diff --git a/js/ZeroClipboard.min.map b/js/ZeroClipboard.min.map
new file mode 100644
index 0000000..0b791fe
--- /dev/null
+++ b/js/ZeroClipboard.min.map
@@ -0,0 +1 @@
+{"version":3,"file":"ZeroClipboard.min.js","sources":["ZeroClipboard.js"],"names":["window","undefined","_zcSwfVersion","_currentElement","_copyTarget","_window","_document","document","_navigator","navigator","_setTimeout","setTimeout","_clearTimeout","clearTimeout","_setInterval","setInterval","_clearInterval","clearInterval","_getComputedStyle","getComputedStyle","_encodeURIComponent","encodeURIComponent","_ActiveXObject","ActiveXObject","_Error","Error","_parseInt","Number","parseInt","_parseFloat","parseFloat","_isNaN","isNaN","_now","Date","now","_keys","Object","keys","_hasOwn","prototype","hasOwnProperty","_slice","Array","slice","_unwrap","unwrapper","el","wrap","unwrap","div","createElement","unwrappedDiv","nodeType","e","_args","argumentsObj","call","_extend","i","len","arg","prop","src","copy","args","arguments","target","length","_deepCopy","source","_pick","obj","newObj","_omit","indexOf","_deleteOwnProperties","_containedBy","ancestorEl","ownerDocument","parentNode","_getDirPathOfUrl","url","dir","split","lastIndexOf","_getCurrentScriptUrlFromErrorStack","stack","matches","match","_getCurrentScriptUrlFromError","err","sourceURL","fileName","_getCurrentScriptUrl","jsPath","scripts","currentScript","getElementsByTagName","readyState","_getUnanimousScriptParentDir","jsDir","_getDefaultSwfPath","_isWindows","isWindowsRegex","test","appVersion","platform","userAgent","_pageIsFramed","opener","top","parent","_pageIsXhtml","documentElement","nodeName","_flashState","bridge","version","pluginType","sandboxed","disabled","outdated","insecure","unavailable","degraded","deactivated","overdue","ready","_minimumFlashVersion","_handlers","_clipData","_clipDataFormatMap","_flashCheckTimeout","_swfFallbackCheckInterval","_eventMessages","error","flash-sandboxed","flash-disabled","flash-outdated","flash-insecure","flash-unavailable","flash-degraded","flash-deactivated","flash-overdue","version-mismatch","clipboard-error","config-mismatch","swf-not-found","browser-unsupported","_errorsThatOnlyOccurAfterFlashLoads","_flashStateErrorNames","_flashStateErrorNameMatchingRegex","RegExp","map","errorName","replace","join","_flashStateEnabledErrorNameMatchingRegex","filter","_globalConfig","swfPath","trustedDomains","location","host","cacheBust","forceEnhancedClipboard","flashLoadTimeout","autoActivate","bubbleEvents","fixLineEndings","containerId","containerClass","swfObjectId","hoverClass","activeClass","forceHandCursor","title","zIndex","_config","options","forEach","_isValidHtml4Id","_state","_detectSandbox","browser","isSupported","_isBrowserSupported","flash","zeroclipboard","ZeroClipboard","config","addEventListener","_isFlashUnusable","_on","eventType","listener","events","added","toLowerCase","key","on","push","emit","type","name","jsVersion","swfVersion","_off","foundIndex","perEventHandlers","off","splice","_listeners","_emit","event","eventCopy","returnVal","tmp","_createEvent","_preprocessEvent","_dispatchCallbacks","this","_mapClipDataToFlash","data","formatMap","_getSwfPathProtocol","swfPathFirstTwoChars","swfProtocol","protocol","_create","maxWait","previousState","isFlashUnusable","_embedSwf","_destroy","clearData","blur","_unembedSwf","_setData","format","dataObj","dataFormat","_fixLineEndings","_clearData","_getData","_focus","element","_removeClass","_addClass","newTitle","getAttribute","htmlBridge","_getHtmlBridge","setAttribute","useHandCursor","_getStyle","_setHandCursor","_reposition","_blur","removeAttribute","style","left","width","height","_activeElement","id","relatedTarget","currentTarget","timeStamp","msg","message","minimumVersion","pageProtocol","clipboardData","setData","_mapClipResultsFromFlash","_getRelatedTarget","_addMouseData","targetEl","relatedTargetId","getElementById","srcElement","fromElement","toElement","pos","_getElementPosition","screenLeft","screenX","screenTop","screenY","scrollLeft","body","scrollTop","pageX","_stageX","pageY","_stageY","clientX","clientY","moveX","movementX","moveY","movementY","x","y","offsetX","offsetY","layerX","layerY","_shouldPerformAsync","_dispatchCallback","func","context","async","apply","wildcardTypeHandlers","specificTypeHandlers","handlers","concat","originalContext","handleEvent","_getSandboxStatusFromErrorEvent","isSandboxed","sourceIsSwf","_source","_clearTimeoutsAndPolling","wasDeactivated","textContent","htmlContent","value","outerHTML","innerHTML","innerText","_queueEmitClipboardErrors","_safeActiveElement","focus","_fireMouseEvent","bubbles","cancelable","aftercopyEvent","errors","errorEvent","success","doc","defaults","view","defaultView","canBubble","detail","button","which","createEvent","dispatchEvent","ctrlKey","altKey","shiftKey","metaKey","initMouseEvent","_watchForSwfFallbackContent","pollWait","Math","min","fallbackContentId","_isElementVisible","_createHtmlBridge","container","className","position","_getSafeZIndex","flashBridge","_escapeXmlValue","val","chr","allowScriptAccess","_determineScriptAccess","allowNetworking","flashvars","_vars","swfUrl","_cacheBust","divToBeReplaced","appendChild","tmpDiv","usingActiveX","firstChild","replaceChild","display","removeSwfFromIE","removeChild","clipData","newClipData","text","html","rtf","clipResults","newResults","tmpHash","path","domain","domains","str","trustedOriginsExpanded","_extractDomain","originOrUrl","protocolIndex","pathIndex","_extractAllDomains","origins","resultsArray","currentDomain","configOptions","swfDomain","activeElement","c","cl","classNames","getPropertyValue","getBoundingClientRect","elRect","pageXOffset","pageYOffset","leftBorderWidth","clientLeft","topBorderWidth","clientTop","leftBodyOffset","topBodyOffset","bodyRect","htmlRect","right","bottom","styles","hasCssHeight","hasCssWidth","hasCssTop","hasCssLeft","cssKnows","rect","isVisible","visibility","enabled","setHandCursor","content","replaceRegex","doNotReassessFlashSupport","effectiveScriptOrigin","frame","frameError","frameElement","hasAttribute","_detectFlashSupport","parseFlashVersion","desc","isPepperFlash","flashPlayerFileName","inspectPlugin","plugin","hasFlash","flashVersion","description","filename","isPPAPI","ax","mimeType","isActiveX","plugins","mimeTypes","enabledPlugin","GetVariable","e1","e2","e3","_createClient","state","create","destroy","getData","activate","deactivate","_clientIdCounter","_clientMeta","_elementIdCounter","_elementMeta","_mouseHandlers","_clientConstructor","elements","meta","client","instance","coreWildcardHandler","clip","_clientOn","_clientOff","_clientListeners","_clientEmit","_clientShouldEmit","_clientDispatchCallbacks","_clientClip","_prepClip","zcClippingId","_addMouseHandlers","clippedElements","_clientUnclip","arrayIndex","clientIds","_removeMouseHandlers","_clientElements","_clientDestroy","unclip","clippedEls","hasClippedEls","goodTarget","goodRelTarget","goodClient","_suppressMouseEvents","stopImmediatePropagation","preventDefault","_elementMouseOver","mouseover","mouseout","mouseenter","mouseleave","mousemove","mouseHandlers","mouseEvents","removeEventListener","setText","setHtml","setRichText","richText","define","amd","module","exports"],"mappings":";;;;;;;;CAQA,SAAUA,EAAQC,GAChB,YAKA,IAqTIC,GAUAC,EAKAC,EApUAC,EAAUL,EAAQM,EAAYD,EAAQE,SAAUC,EAAaH,EAAQI,UAAWC,EAAcL,EAAQM,WAAYC,EAAgBP,EAAQQ,aAAcC,EAAeT,EAAQU,YAAaC,EAAiBX,EAAQY,cAAeC,EAAoBb,EAAQc,iBAAkBC,EAAsBf,EAAQgB,mBAAoBC,EAAiBjB,EAAQkB,cAAeC,EAASnB,EAAQoB,MAAOC,EAAYrB,EAAQsB,OAAOC,UAAYvB,EAAQuB,SAAUC,EAAcxB,EAAQsB,OAAOG,YAAczB,EAAQyB,WAAYC,EAAS1B,EAAQsB,OAAOK,OAAS3B,EAAQ2B,MAAOC,EAAO5B,EAAQ6B,KAAKC,IAAKC,EAAQ/B,EAAQgC,OAAOC,KAAMC,EAAUlC,EAAQgC,OAAOG,UAAUC,eAAgBC,EAASrC,EAAQsC,MAAMH,UAAUI,MAAOC,EAAU,WACzsB,GAAIC,GAAY,SAASC,GACvB,MAAOA,GAET,IAA4B,kBAAjB1C,GAAQ2C,MAAiD,kBAAnB3C,GAAQ4C,OACvD,IACE,GAAIC,GAAM5C,EAAU6C,cAAc,OAC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AYnQ,KAAK4C,IACpB,KAAM,IAAIjP,OAAM,yFAElB,OAAOqK,IAAc+R,QAAQlK,MAAM7F,KAAMvK,EAAMW,aAE3B,kBAAXid,SAAyBA,OAAOC,IACzCD,OAAO,WACL,MAAOrV,MAEkB,gBAAXuV,SAAuBA,QAAoC,gBAAnBA,QAAOC,SAAwBD,OAAOC,QAC9FD,OAAOC,QAAUxV,GAEjB9L,EAAO8L,cAAgBA,IAExB,WACD,MAAOgC,OAAQ9N","sourcesContent":["/*!\n * ZeroClipboard\n * The ZeroClipboard library provides an easy way to copy text to the clipboard using an invisible Adobe Flash movie and a JavaScript interface\n * Copyright (c) 2009-2017 Jon Rohan, James M. Greene\n * Licensed MIT\n * http://zeroclipboard.github.io/\n * v2.4.0-beta.1\n */\n(function(window, undefined) {\n \"use strict\";\n /**\n * Store references to critically important global functions that may be\n * overridden on certain web pages.\n */\n var _window = window, _document = _window.document, _navigator = _window.navigator, _setTimeout = _window.setTimeout, _clearTimeout = _window.clearTimeout, _setInterval = _window.setInterval, _clearInterval = _window.clearInterval, _getComputedStyle = _window.getComputedStyle, _encodeURIComponent = _window.encodeURIComponent, _ActiveXObject = _window.ActiveXObject, _Error = _window.Error, _parseInt = _window.Number.parseInt || _window.parseInt, _parseFloat = _window.Number.parseFloat || _window.parseFloat, _isNaN = _window.Number.isNaN || _window.isNaN, _now = _window.Date.now, _keys = _window.Object.keys, _hasOwn = _window.Object.prototype.hasOwnProperty, _slice = _window.Array.prototype.slice, _unwrap = function() {\n var unwrapper = function(el) {\n return el;\n };\n if (typeof _window.wrap === \"function\" && typeof _window.unwrap === \"function\") {\n try {\n var div = _document.createElement(\"div\");\n var unwrappedDiv = _window.unwrap(div);\n if (div.nodeType === 1 && unwrappedDiv && unwrappedDiv.nodeType === 1) {\n unwrapper = _window.unwrap;\n }\n } catch (e) {}\n }\n return unwrapper;\n }();\n /**\n * Convert an `arguments` object into an Array.\n *\n * @returns The arguments as an Array\n * @private\n */\n var _args = function(argumentsObj) {\n return _slice.call(argumentsObj, 0);\n };\n /**\n * Shallow-copy the owned, enumerable properties of one object over to another, similar to jQuery's `$.extend`.\n *\n * @returns The target object, augmented\n * @private\n */\n var _extend = function() {\n var i, len, arg, prop, src, copy, args = _args(arguments), target = args[0] || {};\n for (i = 1, len = args.length; i < len; i++) {\n if ((arg = args[i]) != null) {\n for (prop in arg) {\n if (_hasOwn.call(arg, prop)) {\n src = target[prop];\n copy = arg[prop];\n if (target !== copy && copy !== undefined) {\n target[prop] = copy;\n }\n }\n }\n }\n }\n return target;\n };\n /**\n * Return a deep copy of the source object or array.\n *\n * @returns Object or Array\n * @private\n */\n var _deepCopy = function(source) {\n var copy, i, len, prop;\n if (typeof source !== \"object\" || source == null || typeof source.nodeType === \"number\") {\n copy = source;\n } else if (typeof source.length === \"number\") {\n copy = [];\n for (i = 0, len = source.length; i < len; i++) {\n if (_hasOwn.call(source, i)) {\n copy[i] = _deepCopy(source[i]);\n }\n }\n } else {\n copy = {};\n for (prop in source) {\n if (_hasOwn.call(source, prop)) {\n copy[prop] = _deepCopy(source[prop]);\n }\n }\n }\n return copy;\n };\n /**\n * Makes a shallow copy of `obj` (like `_extend`) but filters its properties based on a list of `keys` to keep.\n * The inverse of `_omit`, mostly. The big difference is that these properties do NOT need to be enumerable to\n * be kept.\n *\n * @returns A new filtered object.\n * @private\n */\n var _pick = function(obj, keys) {\n var newObj = {};\n for (var i = 0, len = keys.length; i < len; i++) {\n if (keys[i] in obj) {\n newObj[keys[i]] = obj[keys[i]];\n }\n }\n return newObj;\n };\n /**\n * Makes a shallow copy of `obj` (like `_extend`) but filters its properties based on a list of `keys` to omit.\n * The inverse of `_pick`.\n *\n * @returns A new filtered object.\n * @private\n */\n var _omit = function(obj, keys) {\n var newObj = {};\n for (var prop in obj) {\n if (keys.indexOf(prop) === -1) {\n newObj[prop] = obj[prop];\n }\n }\n return newObj;\n };\n /**\n * Remove all owned, enumerable properties from an object.\n *\n * @returns The original object without its owned, enumerable properties.\n * @private\n */\n var _deleteOwnProperties = function(obj) {\n if (obj) {\n for (var prop in obj) {\n if (_hasOwn.call(obj, prop)) {\n delete obj[prop];\n }\n }\n }\n return obj;\n };\n /**\n * Determine if an element is contained within another element.\n *\n * @returns Boolean\n * @private\n */\n var _containedBy = function(el, ancestorEl) {\n if (el && el.nodeType === 1 && el.ownerDocument && ancestorEl && (ancestorEl.nodeType === 1 && ancestorEl.ownerDocument && ancestorEl.ownerDocument === el.ownerDocument || ancestorEl.nodeType === 9 && !ancestorEl.ownerDocument && ancestorEl === el.ownerDocument)) {\n do {\n if (el === ancestorEl) {\n return true;\n }\n el = el.parentNode;\n } while (el);\n }\n return false;\n };\n /**\n * Get the URL path's parent directory.\n *\n * @returns String or `undefined`\n * @private\n */\n var _getDirPathOfUrl = function(url) {\n var dir;\n if (typeof url === \"string\" && url) {\n dir = url.split(\"#\")[0].split(\"?\")[0];\n dir = url.slice(0, url.lastIndexOf(\"/\") + 1);\n }\n return dir;\n };\n /**\n * Get the current script's URL by throwing an `Error` and analyzing it.\n *\n * @returns String or `undefined`\n * @private\n */\n var _getCurrentScriptUrlFromErrorStack = function(stack) {\n var url, matches;\n if (typeof stack === \"string\" && stack) {\n matches = stack.match(/^(?:|[^:@]*@|.+\\)@(?=http[s]?|file)|.+?\\s+(?: at |@)(?:[^:\\(]+ )*[\\(]?)((?:http[s]?|file):\\/\\/[\\/]?.+?\\/[^:\\)]*?)(?::\\d+)(?::\\d+)?/);\n if (matches && matches[1]) {\n url = matches[1];\n } else {\n matches = stack.match(/\\)@((?:http[s]?|file):\\/\\/[\\/]?.+?\\/[^:\\)]*?)(?::\\d+)(?::\\d+)?/);\n if (matches && matches[1]) {\n url = matches[1];\n }\n }\n }\n return url;\n };\n /**\n * Get the current script's URL by throwing an `Error` and analyzing it.\n *\n * @returns String or `undefined`\n * @private\n */\n var _getCurrentScriptUrlFromError = function() {\n var url, err;\n try {\n throw new _Error();\n } catch (e) {\n err = e;\n }\n if (err) {\n url = err.sourceURL || err.fileName || _getCurrentScriptUrlFromErrorStack(err.stack);\n }\n return url;\n };\n /**\n * Get the current script's URL.\n *\n * @returns String or `undefined`\n * @private\n */\n var _getCurrentScriptUrl = function() {\n var jsPath, scripts, i;\n if (_document.currentScript && (jsPath = _document.currentScript.src)) {\n return jsPath;\n }\n scripts = _document.getElementsByTagName(\"script\");\n if (scripts.length === 1) {\n return scripts[0].src || undefined;\n }\n if (\"readyState\" in (scripts[0] || document.createElement(\"script\"))) {\n for (i = scripts.length; i--; ) {\n if (scripts[i].readyState === \"interactive\" && (jsPath = scripts[i].src)) {\n return jsPath;\n }\n }\n }\n if (_document.readyState === \"loading\" && (jsPath = scripts[scripts.length - 1].src)) {\n return jsPath;\n }\n if (jsPath = _getCurrentScriptUrlFromError()) {\n return jsPath;\n }\n return undefined;\n };\n /**\n * Get the unanimous parent directory of ALL script tags.\n * If any script tags are either (a) inline or (b) from differing parent\n * directories, this method must return `undefined`.\n *\n * @returns String or `undefined`\n * @private\n */\n var _getUnanimousScriptParentDir = function() {\n var i, jsDir, jsPath, scripts = _document.getElementsByTagName(\"script\");\n for (i = scripts.length; i--; ) {\n if (!(jsPath = scripts[i].src)) {\n jsDir = null;\n break;\n }\n jsPath = _getDirPathOfUrl(jsPath);\n if (jsDir == null) {\n jsDir = jsPath;\n } else if (jsDir !== jsPath) {\n jsDir = null;\n break;\n }\n }\n return jsDir || undefined;\n };\n /**\n * Get the presumed location of the \"ZeroClipboard.swf\" file, based on the location\n * of the executing JavaScript file (e.g. \"ZeroClipboard.js\", etc.).\n *\n * @returns String\n * @private\n */\n var _getDefaultSwfPath = function() {\n var jsDir = _getDirPathOfUrl(_getCurrentScriptUrl()) || _getUnanimousScriptParentDir() || \"\";\n return jsDir + \"ZeroClipboard.swf\";\n };\n /**\n * Is the client's operating system some version of Windows?\n *\n * @returns Boolean\n * @private\n */\n var _isWindows = function() {\n var isWindowsRegex = /win(dows|[\\s]?(nt|me|ce|xp|vista|[\\d]+))/i;\n return !!_navigator && (isWindowsRegex.test(_navigator.appVersion || \"\") || isWindowsRegex.test(_navigator.platform || \"\") || (_navigator.userAgent || \"\").indexOf(\"Windows\") !== -1);\n };\n /**\n * Keep track of if the page is framed (in an `iframe`). This can never change.\n * @private\n */\n var _pageIsFramed = function() {\n return _window.opener == null && (!!_window.top && _window != _window.top || !!_window.parent && _window != _window.parent);\n }();\n /**\n * Keep track of if the page is XHTML (vs. HTML), which requires that everything\n * be rendering in XML mode.\n * @private\n */\n var _pageIsXhtml = _document.documentElement.nodeName === \"html\";\n /**\n * Keep track of the state of the Flash object.\n * @private\n */\n var _flashState = {\n bridge: null,\n version: \"0.0.0\",\n pluginType: \"unknown\",\n sandboxed: null,\n disabled: null,\n outdated: null,\n insecure: null,\n unavailable: null,\n degraded: null,\n deactivated: null,\n overdue: null,\n ready: null\n };\n /**\n * The minimum Flash Player version required to use ZeroClipboard completely.\n * @readonly\n * @private\n */\n var _minimumFlashVersion = \"11.0.0\";\n /**\n * The ZeroClipboard library version number, as reported by Flash, at the time the SWF was compiled.\n */\n var _zcSwfVersion;\n /**\n * Keep track of all event listener registrations.\n * @private\n */\n var _handlers = {};\n /**\n * Keep track of the currently activated element.\n * @private\n */\n var _currentElement;\n /**\n * Keep track of the element that was activated when a `copy` process started.\n * @private\n */\n var _copyTarget;\n /**\n * Keep track of data for the pending clipboard transaction.\n * @private\n */\n var _clipData = {};\n /**\n * Keep track of data formats for the pending clipboard transaction.\n * @private\n */\n var _clipDataFormatMap = null;\n /**\n * Keep track of the Flash availability check timeout.\n * @private\n */\n var _flashCheckTimeout = 0;\n /**\n * Keep track of SWF network errors interval polling.\n * @private\n */\n var _swfFallbackCheckInterval = 0;\n /**\n * The `message` store for events\n * @private\n */\n var _eventMessages = {\n ready: \"Flash communication is established\",\n error: {\n \"flash-sandboxed\": \"Attempting to run Flash in a sandboxed iframe, which is impossible\",\n \"flash-disabled\": \"Flash is disabled or not installed. May also be attempting to run Flash in a sandboxed iframe, which is impossible.\",\n \"flash-outdated\": \"Flash is too outdated to support ZeroClipboard\",\n \"flash-insecure\": \"Flash will be unable to communicate due to a protocol mismatch between your `swfPath` configuration and the page\",\n \"flash-unavailable\": \"Flash is unable to communicate bidirectionally with JavaScript\",\n \"flash-degraded\": \"Flash is unable to preserve data fidelity when communicating with JavaScript\",\n \"flash-deactivated\": \"Flash is too outdated for your browser and/or is configured as click-to-activate.\\nThis may also mean that the ZeroClipboard SWF object could not be loaded, so please check your `swfPath` configuration and/or network connectivity.\\nMay also be attempting to run Flash in a sandboxed iframe, which is impossible.\",\n \"flash-overdue\": \"Flash communication was established but NOT within the acceptable time limit\",\n \"version-mismatch\": \"ZeroClipboard JS version number does not match ZeroClipboard SWF version number\",\n \"clipboard-error\": \"At least one error was thrown while ZeroClipboard was attempting to inject your data into the clipboard\",\n \"config-mismatch\": \"ZeroClipboard configuration does not match Flash's reality\",\n \"swf-not-found\": \"The ZeroClipboard SWF object could not be loaded, so please check your `swfPath` configuration and/or network connectivity\",\n \"browser-unsupported\": \"The browser does not support the required HTML DOM and JavaScript features\"\n }\n };\n /**\n * The `name`s of `error` events that can only occur is Flash has at least\n * been able to load the SWF successfully.\n * @private\n */\n var _errorsThatOnlyOccurAfterFlashLoads = [ \"flash-unavailable\", \"flash-degraded\", \"flash-overdue\", \"version-mismatch\", \"config-mismatch\", \"clipboard-error\" ];\n /**\n * The `name`s of `error` events that should likely result in the `_flashState`\n * variable's property values being updated.\n * @private\n */\n var _flashStateErrorNames = [ \"flash-sandboxed\", \"flash-disabled\", \"flash-outdated\", \"flash-insecure\", \"flash-unavailable\", \"flash-degraded\", \"flash-deactivated\", \"flash-overdue\" ];\n /**\n * A RegExp to match the `name` property of `error` events related to Flash.\n * @private\n */\n var _flashStateErrorNameMatchingRegex = new RegExp(\"^flash-(\" + _flashStateErrorNames.map(function(errorName) {\n return errorName.replace(/^flash-/, \"\");\n }).join(\"|\") + \")$\");\n /**\n * A RegExp to match the `name` property of `error` events related to Flash,\n * which is enabled.\n * @private\n */\n var _flashStateEnabledErrorNameMatchingRegex = new RegExp(\"^flash-(\" + _flashStateErrorNames.filter(function(errorName) {\n return errorName !== \"flash-disabled\";\n }).map(function(errorName) {\n return errorName.replace(/^flash-/, \"\");\n }).join(\"|\") + \")$\");\n /**\n * ZeroClipboard configuration defaults for the Core module.\n * @private\n */\n var _globalConfig = {\n swfPath: _getDefaultSwfPath(),\n trustedDomains: _window.location.host ? [ _window.location.host ] : [],\n cacheBust: true,\n forceEnhancedClipboard: false,\n flashLoadTimeout: 3e4,\n autoActivate: true,\n bubbleEvents: true,\n fixLineEndings: true,\n containerId: \"global-zeroclipboard-html-bridge\",\n containerClass: \"global-zeroclipboard-container\",\n swfObjectId: \"global-zeroclipboard-flash-bridge\",\n hoverClass: \"zeroclipboard-is-hover\",\n activeClass: \"zeroclipboard-is-active\",\n forceHandCursor: false,\n title: null,\n zIndex: 999999999\n };\n /**\n * The underlying implementation of `ZeroClipboard.config`.\n * @private\n */\n var _config = function(options) {\n if (typeof options === \"object\" && options && !(\"length\" in options)) {\n _keys(options).forEach(function(prop) {\n if (/^(?:forceHandCursor|title|zIndex|bubbleEvents|fixLineEndings)$/.test(prop)) {\n _globalConfig[prop] = options[prop];\n } else if (_flashState.bridge == null) {\n if (prop === \"containerId\" || prop === \"swfObjectId\") {\n if (_isValidHtml4Id(options[prop])) {\n _globalConfig[prop] = options[prop];\n } else {\n throw new Error(\"The specified `\" + prop + \"` value is not valid as an HTML4 Element ID\");\n }\n } else {\n _globalConfig[prop] = options[prop];\n }\n }\n });\n }\n if (typeof options === \"string\" && options) {\n if (_hasOwn.call(_globalConfig, options)) {\n return _globalConfig[options];\n }\n return;\n }\n return _deepCopy(_globalConfig);\n };\n /**\n * The underlying implementation of `ZeroClipboard.state`.\n * @private\n */\n var _state = function() {\n _detectSandbox();\n return {\n browser: _extend(_pick(_navigator, [ \"userAgent\", \"platform\", \"appName\", \"appVersion\" ]), {\n isSupported: _isBrowserSupported()\n }),\n flash: _omit(_flashState, [ \"bridge\" ]),\n zeroclipboard: {\n version: ZeroClipboard.version,\n config: ZeroClipboard.config()\n }\n };\n };\n /**\n * Does this browser support all of the necessary DOM and JS features necessary?\n * @private\n */\n var _isBrowserSupported = function() {\n return !!(_document.addEventListener && _window.Object.keys && _window.Array.prototype.map);\n };\n /**\n * The underlying implementation of `ZeroClipboard.isFlashUnusable`.\n * @private\n */\n var _isFlashUnusable = function() {\n return !!(_flashState.sandboxed || _flashState.disabled || _flashState.outdated || _flashState.unavailable || _flashState.degraded || _flashState.deactivated);\n };\n /**\n * The underlying implementation of `ZeroClipboard.on`.\n * @private\n */\n var _on = function(eventType, listener) {\n var i, len, events, added = {};\n if (typeof eventType === \"string\" && eventType) {\n events = eventType.toLowerCase().split(/\\s+/);\n } else if (typeof eventType === \"object\" && eventType && !(\"length\" in eventType) && typeof listener === \"undefined\") {\n _keys(eventType).forEach(function(key) {\n var listener = eventType[key];\n if (typeof listener === \"function\") {\n ZeroClipboard.on(key, listener);\n }\n });\n }\n if (events && events.length && listener) {\n for (i = 0, len = events.length; i < len; i++) {\n eventType = events[i].replace(/^on/, \"\");\n added[eventType] = true;\n if (!_handlers[eventType]) {\n _handlers[eventType] = [];\n }\n _handlers[eventType].push(listener);\n }\n if (added.ready && _flashState.ready) {\n ZeroClipboard.emit({\n type: \"ready\"\n });\n }\n if (added.error) {\n if (!_isBrowserSupported()) {\n ZeroClipboard.emit({\n type: \"error\",\n name: \"browser-unsupported\"\n });\n }\n for (i = 0, len = _flashStateErrorNames.length; i < len; i++) {\n if (_flashState[_flashStateErrorNames[i].replace(/^flash-/, \"\")] === true) {\n ZeroClipboard.emit({\n type: \"error\",\n name: _flashStateErrorNames[i]\n });\n break;\n }\n }\n if (_zcSwfVersion !== undefined && ZeroClipboard.version !== _zcSwfVersion) {\n ZeroClipboard.emit({\n type: \"error\",\n name: \"version-mismatch\",\n jsVersion: ZeroClipboard.version,\n swfVersion: _zcSwfVersion\n });\n }\n }\n }\n return ZeroClipboard;\n };\n /**\n * The underlying implementation of `ZeroClipboard.off`.\n * @private\n */\n var _off = function(eventType, listener) {\n var i, len, foundIndex, events, perEventHandlers;\n if (arguments.length === 0) {\n events = _keys(_handlers);\n } else if (typeof eventType === \"string\" && eventType) {\n events = eventType.toLowerCase().split(/\\s+/);\n } else if (typeof eventType === \"object\" && eventType && !(\"length\" in eventType) && typeof listener === \"undefined\") {\n _keys(eventType).forEach(function(key) {\n var listener = eventType[key];\n if (typeof listener === \"function\") {\n ZeroClipboard.off(key, listener);\n }\n });\n }\n if (events && events.length) {\n for (i = 0, len = events.length; i < len; i++) {\n eventType = events[i].replace(/^on/, \"\");\n perEventHandlers = _handlers[eventType];\n if (perEventHandlers && perEventHandlers.length) {\n if (listener) {\n foundIndex = perEventHandlers.indexOf(listener);\n while (foundIndex !== -1) {\n perEventHandlers.splice(foundIndex, 1);\n foundIndex = perEventHandlers.indexOf(listener, foundIndex);\n }\n } else {\n perEventHandlers.length = 0;\n }\n }\n }\n }\n return ZeroClipboard;\n };\n /**\n * The underlying implementation of `ZeroClipboard.handlers`.\n * @private\n */\n var _listeners = function(eventType) {\n var copy;\n if (typeof eventType === \"string\" && eventType) {\n copy = _deepCopy(_handlers[eventType]) || null;\n } else {\n copy = _deepCopy(_handlers);\n }\n return copy;\n };\n /**\n * The underlying implementation of `ZeroClipboard.emit`.\n * @private\n */\n var _emit = function(event) {\n var eventCopy, returnVal, tmp;\n event = _createEvent(event);\n if (!event) {\n return;\n }\n if (_preprocessEvent(event)) {\n return;\n }\n if (event.type === \"ready\" && _flashState.overdue === true) {\n return ZeroClipboard.emit({\n type: \"error\",\n name: \"flash-overdue\"\n });\n }\n eventCopy = _extend({}, event);\n _dispatchCallbacks.call(this, eventCopy);\n if (event.type === \"copy\") {\n tmp = _mapClipDataToFlash(_clipData);\n returnVal = tmp.data;\n _clipDataFormatMap = tmp.formatMap;\n }\n return returnVal;\n };\n /**\n * Get the protocol of the configured SWF path.\n * @private\n */\n var _getSwfPathProtocol = function() {\n var swfPath = _globalConfig.swfPath || \"\", swfPathFirstTwoChars = swfPath.slice(0, 2), swfProtocol = swfPath.slice(0, swfPath.indexOf(\"://\") + 1);\n return swfPathFirstTwoChars === \"\\\\\\\\\" ? \"file:\" : swfPathFirstTwoChars === \"//\" || swfProtocol === \"\" ? _window.location.protocol : swfProtocol;\n };\n /**\n * The underlying implementation of `ZeroClipboard.create`.\n * @private\n */\n var _create = function() {\n var maxWait, swfProtocol, previousState = _flashState.sandboxed;\n if (!_isBrowserSupported()) {\n _flashState.ready = false;\n ZeroClipboard.emit({\n type: \"error\",\n name: \"browser-unsupported\"\n });\n return;\n }\n _detectSandbox();\n if (typeof _flashState.ready !== \"boolean\") {\n _flashState.ready = false;\n }\n if (_flashState.sandboxed !== previousState && _flashState.sandboxed === true) {\n _flashState.ready = false;\n ZeroClipboard.emit({\n type: \"error\",\n name: \"flash-sandboxed\"\n });\n } else if (!ZeroClipboard.isFlashUnusable() && _flashState.bridge === null) {\n swfProtocol = _getSwfPathProtocol();\n if (swfProtocol && swfProtocol !== _window.location.protocol) {\n ZeroClipboard.emit({\n type: \"error\",\n name: \"flash-insecure\"\n });\n } else {\n maxWait = _globalConfig.flashLoadTimeout;\n if (typeof maxWait === \"number\" && maxWait >= 0) {\n _flashCheckTimeout = _setTimeout(function() {\n if (typeof _flashState.deactivated !== \"boolean\") {\n _flashState.deactivated = true;\n }\n if (_flashState.deactivated === true) {\n ZeroClipboard.emit({\n type: \"error\",\n name: \"flash-deactivated\"\n });\n }\n }, maxWait);\n }\n _flashState.overdue = false;\n _embedSwf();\n }\n }\n };\n /**\n * The underlying implementation of `ZeroClipboard.destroy`.\n * @private\n */\n var _destroy = function() {\n ZeroClipboard.clearData();\n ZeroClipboard.blur();\n ZeroClipboard.emit(\"destroy\");\n _unembedSwf();\n ZeroClipboard.off();\n };\n /**\n * The underlying implementation of `ZeroClipboard.setData`.\n * @private\n */\n var _setData = function(format, data) {\n var dataObj;\n if (typeof format === \"object\" && format && typeof data === \"undefined\") {\n dataObj = format;\n ZeroClipboard.clearData();\n } else if (typeof format === \"string\" && format) {\n dataObj = {};\n dataObj[format] = data;\n } else {\n return;\n }\n for (var dataFormat in dataObj) {\n if (typeof dataFormat === \"string\" && dataFormat && _hasOwn.call(dataObj, dataFormat) && typeof dataObj[dataFormat] === \"string\" && dataObj[dataFormat]) {\n _clipData[dataFormat] = _fixLineEndings(dataObj[dataFormat]);\n }\n }\n };\n /**\n * The underlying implementation of `ZeroClipboard.clearData`.\n * @private\n */\n var _clearData = function(format) {\n if (typeof format === \"undefined\") {\n _deleteOwnProperties(_clipData);\n _clipDataFormatMap = null;\n } else if (typeof format === \"string\" && _hasOwn.call(_clipData, format)) {\n delete _clipData[format];\n }\n };\n /**\n * The underlying implementation of `ZeroClipboard.getData`.\n * @private\n */\n var _getData = function(format) {\n if (typeof format === \"undefined\") {\n return _deepCopy(_clipData);\n } else if (typeof format === \"string\" && _hasOwn.call(_clipData, format)) {\n return _clipData[format];\n }\n };\n /**\n * The underlying implementation of `ZeroClipboard.focus`/`ZeroClipboard.activate`.\n * @private\n */\n var _focus = function(element) {\n if (!(element && element.nodeType === 1)) {\n return;\n }\n if (_currentElement) {\n _removeClass(_currentElement, _globalConfig.activeClass);\n if (_currentElement !== element) {\n _removeClass(_currentElement, _globalConfig.hoverClass);\n }\n }\n _currentElement = element;\n _addClass(element, _globalConfig.hoverClass);\n var newTitle = element.getAttribute(\"title\") || _globalConfig.title;\n if (typeof newTitle === \"string\" && newTitle) {\n var htmlBridge = _getHtmlBridge(_flashState.bridge);\n if (htmlBridge) {\n htmlBridge.setAttribute(\"title\", newTitle);\n }\n }\n var useHandCursor = _globalConfig.forceHandCursor === true || _getStyle(element, \"cursor\") === \"pointer\";\n _setHandCursor(useHandCursor);\n _reposition();\n };\n /**\n * The underlying implementation of `ZeroClipboard.blur`/`ZeroClipboard.deactivate`.\n * @private\n */\n var _blur = function() {\n var htmlBridge = _getHtmlBridge(_flashState.bridge);\n if (htmlBridge) {\n htmlBridge.removeAttribute(\"title\");\n htmlBridge.style.left = \"0px\";\n htmlBridge.style.top = \"-9999px\";\n htmlBridge.style.width = \"1px\";\n htmlBridge.style.height = \"1px\";\n }\n if (_currentElement) {\n _removeClass(_currentElement, _globalConfig.hoverClass);\n _removeClass(_currentElement, _globalConfig.activeClass);\n _currentElement = null;\n }\n };\n /**\n * The underlying implementation of `ZeroClipboard.activeElement`.\n * @private\n */\n var _activeElement = function() {\n return _currentElement || null;\n };\n /**\n * Check if a value is a valid HTML4 `ID` or `Name` token.\n * @private\n */\n var _isValidHtml4Id = function(id) {\n return typeof id === \"string\" && id && /^[A-Za-z][A-Za-z0-9_:\\-\\.]*$/.test(id);\n };\n /**\n * Create or update an `event` object, based on the `eventType`.\n * @private\n */\n var _createEvent = function(event) {\n var eventType;\n if (typeof event === \"string\" && event) {\n eventType = event;\n event = {};\n } else if (typeof event === \"object\" && event && typeof event.type === \"string\" && event.type) {\n eventType = event.type;\n }\n if (!eventType) {\n return;\n }\n eventType = eventType.toLowerCase();\n if (!event.target && (/^(copy|aftercopy|_click)$/.test(eventType) || eventType === \"error\" && event.name === \"clipboard-error\")) {\n event.target = _copyTarget;\n }\n _extend(event, {\n type: eventType,\n target: event.target || _currentElement || null,\n relatedTarget: event.relatedTarget || null,\n currentTarget: _flashState && _flashState.bridge || null,\n timeStamp: event.timeStamp || _now() || null\n });\n var msg = _eventMessages[event.type];\n if (event.type === \"error\" && event.name && msg) {\n msg = msg[event.name];\n }\n if (msg) {\n event.message = msg;\n }\n if (event.type === \"ready\") {\n _extend(event, {\n target: null,\n version: _flashState.version\n });\n }\n if (event.type === \"error\") {\n if (_flashStateErrorNameMatchingRegex.test(event.name)) {\n _extend(event, {\n target: null,\n minimumVersion: _minimumFlashVersion\n });\n }\n if (_flashStateEnabledErrorNameMatchingRegex.test(event.name)) {\n _extend(event, {\n version: _flashState.version\n });\n }\n if (event.name === \"flash-insecure\") {\n _extend(event, {\n pageProtocol: _window.location.protocol,\n swfProtocol: _getSwfPathProtocol()\n });\n }\n }\n if (event.type === \"copy\") {\n event.clipboardData = {\n setData: ZeroClipboard.setData,\n clearData: ZeroClipboard.clearData\n };\n }\n if (event.type === \"aftercopy\") {\n event = _mapClipResultsFromFlash(event, _clipDataFormatMap);\n }\n if (event.target && !event.relatedTarget) {\n event.relatedTarget = _getRelatedTarget(event.target);\n }\n return _addMouseData(event);\n };\n /**\n * Get a relatedTarget from the target's `data-clipboard-target` attribute\n * @private\n */\n var _getRelatedTarget = function(targetEl) {\n var relatedTargetId = targetEl && targetEl.getAttribute && targetEl.getAttribute(\"data-clipboard-target\");\n return relatedTargetId ? _document.getElementById(relatedTargetId) : null;\n };\n /**\n * Add element and position data to `MouseEvent` instances\n * @private\n */\n var _addMouseData = function(event) {\n if (event && /^_(?:click|mouse(?:over|out|down|up|move))$/.test(event.type)) {\n var srcElement = event.target;\n var fromElement = event.type === \"_mouseover\" && event.relatedTarget ? event.relatedTarget : undefined;\n var toElement = event.type === \"_mouseout\" && event.relatedTarget ? event.relatedTarget : undefined;\n var pos = _getElementPosition(srcElement);\n var screenLeft = _window.screenLeft || _window.screenX || 0;\n var screenTop = _window.screenTop || _window.screenY || 0;\n var scrollLeft = _document.body.scrollLeft + _document.documentElement.scrollLeft;\n var scrollTop = _document.body.scrollTop + _document.documentElement.scrollTop;\n var pageX = pos.left + (typeof event._stageX === \"number\" ? event._stageX : 0);\n var pageY = pos.top + (typeof event._stageY === \"number\" ? event._stageY : 0);\n var clientX = pageX - scrollLeft;\n var clientY = pageY - scrollTop;\n var screenX = screenLeft + clientX;\n var screenY = screenTop + clientY;\n var moveX = typeof event.movementX === \"number\" ? event.movementX : 0;\n var moveY = typeof event.movementY === \"number\" ? event.movementY : 0;\n delete event._stageX;\n delete event._stageY;\n _extend(event, {\n srcElement: srcElement,\n fromElement: fromElement,\n toElement: toElement,\n screenX: screenX,\n screenY: screenY,\n pageX: pageX,\n pageY: pageY,\n clientX: clientX,\n clientY: clientY,\n x: clientX,\n y: clientY,\n movementX: moveX,\n movementY: moveY,\n offsetX: 0,\n offsetY: 0,\n layerX: 0,\n layerY: 0\n });\n }\n return event;\n };\n /**\n * Determine if an event's registered handlers should be execute synchronously or asynchronously.\n *\n * @returns {boolean}\n * @private\n */\n var _shouldPerformAsync = function(event) {\n var eventType = event && typeof event.type === \"string\" && event.type || \"\";\n return !/^(?:(?:before)?copy|destroy)$/.test(eventType);\n };\n /**\n * Control if a callback should be executed asynchronously or not.\n *\n * @returns `undefined`\n * @private\n */\n var _dispatchCallback = function(func, context, args, async) {\n if (async) {\n _setTimeout(function() {\n func.apply(context, args);\n }, 0);\n } else {\n func.apply(context, args);\n }\n };\n /**\n * Handle the actual dispatching of events to client instances.\n *\n * @returns `undefined`\n * @private\n */\n var _dispatchCallbacks = function(event) {\n if (!(typeof event === \"object\" && event && event.type)) {\n return;\n }\n var async = _shouldPerformAsync(event);\n var wildcardTypeHandlers = _handlers[\"*\"] || [];\n var specificTypeHandlers = _handlers[event.type] || [];\n var handlers = wildcardTypeHandlers.concat(specificTypeHandlers);\n if (handlers && handlers.length) {\n var i, len, func, context, eventCopy, originalContext = this;\n for (i = 0, len = handlers.length; i < len; i++) {\n func = handlers[i];\n context = originalContext;\n if (typeof func === \"string\" && typeof _window[func] === \"function\") {\n func = _window[func];\n }\n if (typeof func === \"object\" && func && typeof func.handleEvent === \"function\") {\n context = func;\n func = func.handleEvent;\n }\n if (typeof func === \"function\") {\n eventCopy = _extend({}, event);\n _dispatchCallback(func, context, [ eventCopy ], async);\n }\n }\n }\n return this;\n };\n /**\n * Check an `error` event's `name` property to see if Flash has\n * already loaded, which rules out possible `iframe` sandboxing.\n * @private\n */\n var _getSandboxStatusFromErrorEvent = function(event) {\n var isSandboxed = null;\n if (_pageIsFramed === false || event && event.type === \"error\" && event.name && _errorsThatOnlyOccurAfterFlashLoads.indexOf(event.name) !== -1) {\n isSandboxed = false;\n }\n return isSandboxed;\n };\n /**\n * Preprocess any special behaviors, reactions, or state changes after receiving this event.\n * Executes only once per event emitted, NOT once per client.\n * @private\n */\n var _preprocessEvent = function(event) {\n var element = event.target || _currentElement || null;\n var sourceIsSwf = event._source === \"swf\";\n delete event._source;\n switch (event.type) {\n case \"error\":\n var isSandboxed = event.name === \"flash-sandboxed\" || _getSandboxStatusFromErrorEvent(event);\n if (typeof isSandboxed === \"boolean\") {\n _flashState.sandboxed = isSandboxed;\n }\n if (event.name === \"browser-unsupported\") {\n _extend(_flashState, {\n disabled: false,\n outdated: false,\n unavailable: false,\n degraded: false,\n deactivated: false,\n overdue: false,\n ready: false\n });\n } else if (_flashStateErrorNames.indexOf(event.name) !== -1) {\n _extend(_flashState, {\n disabled: event.name === \"flash-disabled\",\n outdated: event.name === \"flash-outdated\",\n insecure: event.name === \"flash-insecure\",\n unavailable: event.name === \"flash-unavailable\",\n degraded: event.name === \"flash-degraded\",\n deactivated: event.name === \"flash-deactivated\",\n overdue: event.name === \"flash-overdue\",\n ready: false\n });\n } else if (event.name === \"version-mismatch\") {\n _zcSwfVersion = event.swfVersion;\n _extend(_flashState, {\n disabled: false,\n outdated: false,\n insecure: false,\n unavailable: false,\n degraded: false,\n deactivated: false,\n overdue: false,\n ready: false\n });\n }\n _clearTimeoutsAndPolling();\n break;\n\n case \"ready\":\n _zcSwfVersion = event.swfVersion;\n var wasDeactivated = _flashState.deactivated === true;\n _extend(_flashState, {\n sandboxed: false,\n disabled: false,\n outdated: false,\n insecure: false,\n unavailable: false,\n degraded: false,\n deactivated: false,\n overdue: wasDeactivated,\n ready: !wasDeactivated\n });\n _clearTimeoutsAndPolling();\n break;\n\n case \"beforecopy\":\n _copyTarget = element;\n break;\n\n case \"copy\":\n var textContent, htmlContent, targetEl = event.relatedTarget;\n if (!(_clipData[\"text/html\"] || _clipData[\"text/plain\"]) && targetEl && (htmlContent = targetEl.value || targetEl.outerHTML || targetEl.innerHTML) && (textContent = targetEl.value || targetEl.textContent || targetEl.innerText)) {\n event.clipboardData.clearData();\n event.clipboardData.setData(\"text/plain\", textContent);\n if (htmlContent !== textContent) {\n event.clipboardData.setData(\"text/html\", htmlContent);\n }\n } else if (!_clipData[\"text/plain\"] && event.target && (textContent = event.target.getAttribute(\"data-clipboard-text\"))) {\n event.clipboardData.clearData();\n event.clipboardData.setData(\"text/plain\", textContent);\n }\n break;\n\n case \"aftercopy\":\n _queueEmitClipboardErrors(event);\n ZeroClipboard.clearData();\n if (element && element !== _safeActiveElement() && element.focus) {\n element.focus();\n }\n break;\n\n case \"_mouseover\":\n ZeroClipboard.focus(element);\n if (_globalConfig.bubbleEvents === true && sourceIsSwf) {\n if (element && element !== event.relatedTarget && !_containedBy(event.relatedTarget, element)) {\n _fireMouseEvent(_extend({}, event, {\n type: \"mouseenter\",\n bubbles: false,\n cancelable: false\n }));\n }\n _fireMouseEvent(_extend({}, event, {\n type: \"mouseover\"\n }));\n }\n break;\n\n case \"_mouseout\":\n ZeroClipboard.blur();\n if (_globalConfig.bubbleEvents === true && sourceIsSwf) {\n if (element && element !== event.relatedTarget && !_containedBy(event.relatedTarget, element)) {\n _fireMouseEvent(_extend({}, event, {\n type: \"mouseleave\",\n bubbles: false,\n cancelable: false\n }));\n }\n _fireMouseEvent(_extend({}, event, {\n type: \"mouseout\"\n }));\n }\n break;\n\n case \"_mousedown\":\n _addClass(element, _globalConfig.activeClass);\n if (_globalConfig.bubbleEvents === true && sourceIsSwf) {\n _fireMouseEvent(_extend({}, event, {\n type: event.type.slice(1)\n }));\n }\n break;\n\n case \"_mouseup\":\n _removeClass(element, _globalConfig.activeClass);\n if (_globalConfig.bubbleEvents === true && sourceIsSwf) {\n _fireMouseEvent(_extend({}, event, {\n type: event.type.slice(1)\n }));\n }\n break;\n\n case \"_click\":\n _copyTarget = null;\n if (_globalConfig.bubbleEvents === true && sourceIsSwf) {\n _fireMouseEvent(_extend({}, event, {\n type: event.type.slice(1)\n }));\n }\n break;\n\n case \"_mousemove\":\n if (_globalConfig.bubbleEvents === true && sourceIsSwf) {\n _fireMouseEvent(_extend({}, event, {\n type: event.type.slice(1)\n }));\n }\n break;\n }\n if (/^_(?:click|mouse(?:over|out|down|up|move))$/.test(event.type)) {\n return true;\n }\n };\n /**\n * Check an \"aftercopy\" event for clipboard errors and emit a corresponding \"error\" event.\n * @private\n */\n var _queueEmitClipboardErrors = function(aftercopyEvent) {\n if (aftercopyEvent.errors && aftercopyEvent.errors.length > 0) {\n var errorEvent = _deepCopy(aftercopyEvent);\n _extend(errorEvent, {\n type: \"error\",\n name: \"clipboard-error\"\n });\n delete errorEvent.success;\n _setTimeout(function() {\n ZeroClipboard.emit(errorEvent);\n }, 0);\n }\n };\n /**\n * Dispatch a synthetic MouseEvent.\n *\n * @returns `undefined`\n * @private\n */\n var _fireMouseEvent = function(event) {\n if (!(event && typeof event.type === \"string\" && event)) {\n return;\n }\n var e, target = event.target || null, doc = target && target.ownerDocument || _document, defaults = {\n view: doc.defaultView || _window,\n canBubble: true,\n cancelable: true,\n detail: event.type === \"click\" ? 1 : 0,\n button: typeof event.which === \"number\" ? event.which - 1 : typeof event.button === \"number\" ? event.button : doc.createEvent ? 0 : 1\n }, args = _extend(defaults, event);\n if (!target) {\n return;\n }\n if (doc.createEvent && target.dispatchEvent) {\n args = [ args.type, args.canBubble, args.cancelable, args.view, args.detail, args.screenX, args.screenY, args.clientX, args.clientY, args.ctrlKey, args.altKey, args.shiftKey, args.metaKey, args.button, args.relatedTarget ];\n e = doc.createEvent(\"MouseEvents\");\n if (e.initMouseEvent) {\n e.initMouseEvent.apply(e, args);\n e._source = \"js\";\n target.dispatchEvent(e);\n }\n }\n };\n /**\n * Continuously poll the DOM until either:\n * (a) the fallback content becomes visible, or\n * (b) we receive an event from SWF (handled elsewhere)\n *\n * IMPORTANT:\n * This is NOT a necessary check but it can result in significantly faster\n * detection of bad `swfPath` configuration and/or network/server issues [in\n * supported browsers] than waiting for the entire `flashLoadTimeout` duration\n * to elapse before detecting that the SWF cannot be loaded. The detection\n * duration can be anywhere from 10-30 times faster [in supported browsers] by\n * using this approach.\n *\n * @returns `undefined`\n * @private\n */\n var _watchForSwfFallbackContent = function() {\n var maxWait = _globalConfig.flashLoadTimeout;\n if (typeof maxWait === \"number\" && maxWait >= 0) {\n var pollWait = Math.min(1e3, maxWait / 10);\n var fallbackContentId = _globalConfig.swfObjectId + \"_fallbackContent\";\n _swfFallbackCheckInterval = _setInterval(function() {\n var el = _document.getElementById(fallbackContentId);\n if (_isElementVisible(el)) {\n _clearTimeoutsAndPolling();\n _flashState.deactivated = null;\n ZeroClipboard.emit({\n type: \"error\",\n name: \"swf-not-found\"\n });\n }\n }, pollWait);\n }\n };\n /**\n * Create the HTML bridge element to embed the Flash object into.\n * @private\n */\n var _createHtmlBridge = function() {\n var container = _document.createElement(\"div\");\n container.id = _globalConfig.containerId;\n container.className = _globalConfig.containerClass;\n container.style.position = \"absolute\";\n container.style.left = \"0px\";\n container.style.top = \"-9999px\";\n container.style.width = \"1px\";\n container.style.height = \"1px\";\n container.style.zIndex = \"\" + _getSafeZIndex(_globalConfig.zIndex);\n return container;\n };\n /**\n * Get the HTML element container that wraps the Flash bridge object/element.\n * @private\n */\n var _getHtmlBridge = function(flashBridge) {\n var htmlBridge = flashBridge && flashBridge.parentNode;\n while (htmlBridge && htmlBridge.nodeName === \"OBJECT\" && htmlBridge.parentNode) {\n htmlBridge = htmlBridge.parentNode;\n }\n return htmlBridge || null;\n };\n /**\n *\n * @private\n */\n var _escapeXmlValue = function(val) {\n if (typeof val !== \"string\" || !val) {\n return val;\n }\n return val.replace(/[\"&'<>]/g, function(chr) {\n switch (chr) {\n case '\"':\n return \""\";\n\n case \"&\":\n return \"&\";\n\n case \"'\":\n return \"'\";\n\n case \"<\":\n return \"<\";\n\n case \">\":\n return \">\";\n\n default:\n return chr;\n }\n });\n };\n /**\n * Create the SWF object.\n *\n * @returns The SWF object reference.\n * @private\n */\n var _embedSwf = function() {\n var len, flashBridge = _flashState.bridge, container = _getHtmlBridge(flashBridge);\n if (!flashBridge) {\n var allowScriptAccess = _determineScriptAccess(_window.location.host, _globalConfig);\n var allowNetworking = allowScriptAccess === \"never\" ? \"none\" : \"all\";\n var flashvars = _vars(_extend({\n jsVersion: ZeroClipboard.version\n }, _globalConfig));\n var swfUrl = _globalConfig.swfPath + _cacheBust(_globalConfig.swfPath, _globalConfig);\n if (_pageIsXhtml) {\n swfUrl = _escapeXmlValue(swfUrl);\n }\n container = _createHtmlBridge();\n var divToBeReplaced = _document.createElement(\"div\");\n container.appendChild(divToBeReplaced);\n _document.body.appendChild(container);\n var tmpDiv = _document.createElement(\"div\");\n var usingActiveX = _flashState.pluginType === \"activex\";\n tmpDiv.innerHTML = '\" + (usingActiveX ? ' ' : \"\") + ' ' + ' ' + ' ' + ' ' + ' ' + '
' + \" \";\n flashBridge = tmpDiv.firstChild;\n tmpDiv = null;\n _unwrap(flashBridge).ZeroClipboard = ZeroClipboard;\n container.replaceChild(flashBridge, divToBeReplaced);\n _watchForSwfFallbackContent();\n }\n if (!flashBridge) {\n flashBridge = _document[_globalConfig.swfObjectId];\n if (flashBridge && (len = flashBridge.length)) {\n flashBridge = flashBridge[len - 1];\n }\n if (!flashBridge && container) {\n flashBridge = container.firstChild;\n }\n }\n _flashState.bridge = flashBridge || null;\n return flashBridge;\n };\n /**\n * Destroy the SWF object.\n * @private\n */\n var _unembedSwf = function() {\n var flashBridge = _flashState.bridge;\n if (flashBridge) {\n var htmlBridge = _getHtmlBridge(flashBridge);\n if (htmlBridge) {\n if (_flashState.pluginType === \"activex\" && \"readyState\" in flashBridge) {\n flashBridge.style.display = \"none\";\n (function removeSwfFromIE() {\n if (flashBridge.readyState === 4) {\n for (var prop in flashBridge) {\n if (typeof flashBridge[prop] === \"function\") {\n flashBridge[prop] = null;\n }\n }\n if (flashBridge.parentNode) {\n flashBridge.parentNode.removeChild(flashBridge);\n }\n if (htmlBridge.parentNode) {\n htmlBridge.parentNode.removeChild(htmlBridge);\n }\n } else {\n _setTimeout(removeSwfFromIE, 10);\n }\n })();\n } else {\n if (flashBridge.parentNode) {\n flashBridge.parentNode.removeChild(flashBridge);\n }\n if (htmlBridge.parentNode) {\n htmlBridge.parentNode.removeChild(htmlBridge);\n }\n }\n }\n _clearTimeoutsAndPolling();\n _flashState.ready = null;\n _flashState.bridge = null;\n _flashState.deactivated = null;\n _flashState.insecure = null;\n _zcSwfVersion = undefined;\n }\n };\n /**\n * Map the data format names of the \"clipData\" to Flash-friendly names.\n *\n * @returns A new transformed object.\n * @private\n */\n var _mapClipDataToFlash = function(clipData) {\n var newClipData = {}, formatMap = {};\n if (!(typeof clipData === \"object\" && clipData)) {\n return;\n }\n for (var dataFormat in clipData) {\n if (dataFormat && _hasOwn.call(clipData, dataFormat) && typeof clipData[dataFormat] === \"string\" && clipData[dataFormat]) {\n switch (dataFormat.toLowerCase()) {\n case \"text/plain\":\n case \"text\":\n case \"air:text\":\n case \"flash:text\":\n newClipData.text = clipData[dataFormat];\n formatMap.text = dataFormat;\n break;\n\n case \"text/html\":\n case \"html\":\n case \"air:html\":\n case \"flash:html\":\n newClipData.html = clipData[dataFormat];\n formatMap.html = dataFormat;\n break;\n\n case \"application/rtf\":\n case \"text/rtf\":\n case \"rtf\":\n case \"richtext\":\n case \"air:rtf\":\n case \"flash:rtf\":\n newClipData.rtf = clipData[dataFormat];\n formatMap.rtf = dataFormat;\n break;\n\n default:\n break;\n }\n }\n }\n return {\n data: newClipData,\n formatMap: formatMap\n };\n };\n /**\n * Map the data format names from Flash-friendly names back to their original \"clipData\" names (via a format mapping).\n *\n * @returns A new transformed object.\n * @private\n */\n var _mapClipResultsFromFlash = function(clipResults, formatMap) {\n if (!(typeof clipResults === \"object\" && clipResults && typeof formatMap === \"object\" && formatMap)) {\n return clipResults;\n }\n var newResults = {};\n for (var prop in clipResults) {\n if (_hasOwn.call(clipResults, prop)) {\n if (prop === \"errors\") {\n newResults[prop] = clipResults[prop] ? clipResults[prop].slice() : [];\n for (var i = 0, len = newResults[prop].length; i < len; i++) {\n newResults[prop][i].format = formatMap[newResults[prop][i].format];\n }\n } else if (prop !== \"success\" && prop !== \"data\") {\n newResults[prop] = clipResults[prop];\n } else {\n newResults[prop] = {};\n var tmpHash = clipResults[prop];\n for (var dataFormat in tmpHash) {\n if (dataFormat && _hasOwn.call(tmpHash, dataFormat) && _hasOwn.call(formatMap, dataFormat)) {\n newResults[prop][formatMap[dataFormat]] = tmpHash[dataFormat];\n }\n }\n }\n }\n }\n return newResults;\n };\n /**\n * Will look at a path, and will create a \"?noCache={time}\" or \"&noCache={time}\"\n * query param string to return. Does NOT append that string to the original path.\n * This is useful because ExternalInterface often breaks when a Flash SWF is cached.\n *\n * @returns The `noCache` query param with necessary \"?\"/\"&\" prefix.\n * @private\n */\n var _cacheBust = function(path, options) {\n var cacheBust = options == null || options && options.cacheBust === true;\n if (cacheBust) {\n return (path.indexOf(\"?\") === -1 ? \"?\" : \"&\") + \"noCache=\" + _now();\n } else {\n return \"\";\n }\n };\n /**\n * Creates a query string for the FlashVars param.\n * Does NOT include the cache-busting query param.\n *\n * @returns FlashVars query string\n * @private\n */\n var _vars = function(options) {\n var i, len, domain, domains, str = \"\", trustedOriginsExpanded = [];\n if (options.trustedDomains) {\n if (typeof options.trustedDomains === \"string\") {\n domains = [ options.trustedDomains ];\n } else if (typeof options.trustedDomains === \"object\" && \"length\" in options.trustedDomains) {\n domains = options.trustedDomains;\n }\n }\n if (domains && domains.length) {\n for (i = 0, len = domains.length; i < len; i++) {\n if (_hasOwn.call(domains, i) && domains[i] && typeof domains[i] === \"string\") {\n domain = _extractDomain(domains[i]);\n if (!domain) {\n continue;\n }\n if (domain === \"*\") {\n trustedOriginsExpanded.length = 0;\n trustedOriginsExpanded.push(domain);\n break;\n }\n trustedOriginsExpanded.push.apply(trustedOriginsExpanded, [ domain, \"//\" + domain, _window.location.protocol + \"//\" + domain ]);\n }\n }\n }\n if (trustedOriginsExpanded.length) {\n str += \"trustedOrigins=\" + _encodeURIComponent(trustedOriginsExpanded.join(\",\"));\n }\n if (options.forceEnhancedClipboard === true) {\n str += (str ? \"&\" : \"\") + \"forceEnhancedClipboard=true\";\n }\n if (typeof options.swfObjectId === \"string\" && options.swfObjectId) {\n str += (str ? \"&\" : \"\") + \"swfObjectId=\" + _encodeURIComponent(options.swfObjectId);\n }\n if (typeof options.jsVersion === \"string\" && options.jsVersion) {\n str += (str ? \"&\" : \"\") + \"jsVersion=\" + _encodeURIComponent(options.jsVersion);\n }\n return str;\n };\n /**\n * Extract the domain (e.g. \"github.com\") from an origin (e.g. \"https://github.com\") or\n * URL (e.g. \"https://github.com/zeroclipboard/zeroclipboard/\").\n *\n * @returns the domain\n * @private\n */\n var _extractDomain = function(originOrUrl) {\n if (originOrUrl == null || originOrUrl === \"\") {\n return null;\n }\n originOrUrl = originOrUrl.replace(/^\\s+|\\s+$/g, \"\");\n if (originOrUrl === \"\") {\n return null;\n }\n var protocolIndex = originOrUrl.indexOf(\"//\");\n originOrUrl = protocolIndex === -1 ? originOrUrl : originOrUrl.slice(protocolIndex + 2);\n var pathIndex = originOrUrl.indexOf(\"/\");\n originOrUrl = pathIndex === -1 ? originOrUrl : protocolIndex === -1 || pathIndex === 0 ? null : originOrUrl.slice(0, pathIndex);\n if (originOrUrl && originOrUrl.slice(-4).toLowerCase() === \".swf\") {\n return null;\n }\n return originOrUrl || null;\n };\n /**\n * Set `allowScriptAccess` based on `trustedDomains` and `window.location.host` vs. `swfPath`.\n *\n * @returns The appropriate script access level.\n * @private\n */\n var _determineScriptAccess = function() {\n var _extractAllDomains = function(origins) {\n var i, len, tmp, resultsArray = [];\n if (typeof origins === \"string\") {\n origins = [ origins ];\n }\n if (!(typeof origins === \"object\" && origins && typeof origins.length === \"number\")) {\n return resultsArray;\n }\n for (i = 0, len = origins.length; i < len; i++) {\n if (_hasOwn.call(origins, i) && (tmp = _extractDomain(origins[i]))) {\n if (tmp === \"*\") {\n resultsArray.length = 0;\n resultsArray.push(\"*\");\n break;\n }\n if (resultsArray.indexOf(tmp) === -1) {\n resultsArray.push(tmp);\n }\n }\n }\n return resultsArray;\n };\n return function(currentDomain, configOptions) {\n var swfDomain = _extractDomain(configOptions.swfPath);\n if (swfDomain === null) {\n swfDomain = currentDomain;\n }\n var trustedDomains = _extractAllDomains(configOptions.trustedDomains);\n var len = trustedDomains.length;\n if (len > 0) {\n if (len === 1 && trustedDomains[0] === \"*\") {\n return \"always\";\n }\n if (trustedDomains.indexOf(currentDomain) !== -1) {\n if (len === 1 && currentDomain === swfDomain) {\n return \"sameDomain\";\n }\n return \"always\";\n }\n }\n return \"never\";\n };\n }();\n /**\n * Get the currently active/focused DOM element.\n *\n * @returns the currently active/focused element, or `null`\n * @private\n */\n var _safeActiveElement = function() {\n try {\n return _document.activeElement;\n } catch (err) {\n return null;\n }\n };\n /**\n * Add a class to an element, if it doesn't already have it.\n *\n * @returns The element, with its new class added.\n * @private\n */\n var _addClass = function(element, value) {\n var c, cl, className, classNames = [];\n if (typeof value === \"string\" && value) {\n classNames = value.split(/\\s+/);\n }\n if (element && element.nodeType === 1 && classNames.length > 0) {\n className = (\" \" + (element.className || \"\") + \" \").replace(/[\\t\\r\\n\\f]/g, \" \");\n for (c = 0, cl = classNames.length; c < cl; c++) {\n if (className.indexOf(\" \" + classNames[c] + \" \") === -1) {\n className += classNames[c] + \" \";\n }\n }\n className = className.replace(/^\\s+|\\s+$/g, \"\");\n if (className !== element.className) {\n element.className = className;\n }\n }\n return element;\n };\n /**\n * Remove a class from an element, if it has it.\n *\n * @returns The element, with its class removed.\n * @private\n */\n var _removeClass = function(element, value) {\n var c, cl, className, classNames = [];\n if (typeof value === \"string\" && value) {\n classNames = value.split(/\\s+/);\n }\n if (element && element.nodeType === 1 && classNames.length > 0) {\n if (element.className) {\n className = (\" \" + element.className + \" \").replace(/[\\t\\r\\n\\f]/g, \" \");\n for (c = 0, cl = classNames.length; c < cl; c++) {\n className = className.replace(\" \" + classNames[c] + \" \", \" \");\n }\n className = className.replace(/^\\s+|\\s+$/g, \"\");\n if (className !== element.className) {\n element.className = className;\n }\n }\n }\n return element;\n };\n /**\n * Attempt to interpret the element's CSS styling. If `prop` is `\"cursor\"`,\n * then we assume that it should be a hand (\"pointer\") cursor if the element\n * is an anchor element (\"a\" tag).\n *\n * @returns The computed style property.\n * @private\n */\n var _getStyle = function(el, prop) {\n var value = _getComputedStyle(el, null).getPropertyValue(prop);\n if (prop === \"cursor\") {\n if (!value || value === \"auto\") {\n if (el.nodeName === \"A\") {\n return \"pointer\";\n }\n }\n }\n return value;\n };\n /**\n * Get the absolutely positioned coordinates of a DOM element.\n *\n * @returns Object containing the element's position, width, and height.\n * @private\n */\n var _getElementPosition = function(el) {\n var pos = {\n left: 0,\n top: 0,\n width: 0,\n height: 0\n };\n if (el.getBoundingClientRect) {\n var elRect = el.getBoundingClientRect();\n var pageXOffset = _window.pageXOffset;\n var pageYOffset = _window.pageYOffset;\n var leftBorderWidth = _document.documentElement.clientLeft || 0;\n var topBorderWidth = _document.documentElement.clientTop || 0;\n var leftBodyOffset = 0;\n var topBodyOffset = 0;\n if (_getStyle(_document.body, \"position\") === \"relative\") {\n var bodyRect = _document.body.getBoundingClientRect();\n var htmlRect = _document.documentElement.getBoundingClientRect();\n leftBodyOffset = bodyRect.left - htmlRect.left || 0;\n topBodyOffset = bodyRect.top - htmlRect.top || 0;\n }\n pos.left = elRect.left + pageXOffset - leftBorderWidth - leftBodyOffset;\n pos.top = elRect.top + pageYOffset - topBorderWidth - topBodyOffset;\n pos.width = \"width\" in elRect ? elRect.width : elRect.right - elRect.left;\n pos.height = \"height\" in elRect ? elRect.height : elRect.bottom - elRect.top;\n }\n return pos;\n };\n /**\n * Determine is an element is visible somewhere within the document (page).\n *\n * @returns Boolean\n * @private\n */\n var _isElementVisible = function(el) {\n if (!el) {\n return false;\n }\n var styles = _getComputedStyle(el, null);\n if (!styles) {\n return false;\n }\n var hasCssHeight = _parseFloat(styles.height) > 0;\n var hasCssWidth = _parseFloat(styles.width) > 0;\n var hasCssTop = _parseFloat(styles.top) >= 0;\n var hasCssLeft = _parseFloat(styles.left) >= 0;\n var cssKnows = hasCssHeight && hasCssWidth && hasCssTop && hasCssLeft;\n var rect = cssKnows ? null : _getElementPosition(el);\n var isVisible = styles.display !== \"none\" && styles.visibility !== \"collapse\" && (cssKnows || !!rect && (hasCssHeight || rect.height > 0) && (hasCssWidth || rect.width > 0) && (hasCssTop || rect.top >= 0) && (hasCssLeft || rect.left >= 0));\n return isVisible;\n };\n /**\n * Clear all existing timeouts and interval polling delegates.\n *\n * @returns `undefined`\n * @private\n */\n var _clearTimeoutsAndPolling = function() {\n _clearTimeout(_flashCheckTimeout);\n _flashCheckTimeout = 0;\n _clearInterval(_swfFallbackCheckInterval);\n _swfFallbackCheckInterval = 0;\n };\n /**\n * Reposition the Flash object to cover the currently activated element.\n *\n * @returns `undefined`\n * @private\n */\n var _reposition = function() {\n var htmlBridge;\n if (_currentElement && (htmlBridge = _getHtmlBridge(_flashState.bridge))) {\n var pos = _getElementPosition(_currentElement);\n _extend(htmlBridge.style, {\n width: pos.width + \"px\",\n height: pos.height + \"px\",\n top: pos.top + \"px\",\n left: pos.left + \"px\",\n zIndex: \"\" + _getSafeZIndex(_globalConfig.zIndex)\n });\n }\n };\n /**\n * Sends a signal to the Flash object to display the hand cursor if `true`.\n *\n * @returns `undefined`\n * @private\n */\n var _setHandCursor = function(enabled) {\n if (_flashState.ready === true) {\n if (_flashState.bridge && typeof _flashState.bridge.setHandCursor === \"function\") {\n _flashState.bridge.setHandCursor(enabled);\n } else {\n _flashState.ready = false;\n }\n }\n };\n /**\n * Get a safe value for `zIndex`\n *\n * @returns an integer, or \"auto\"\n * @private\n */\n var _getSafeZIndex = function(val) {\n if (/^(?:auto|inherit)$/.test(val)) {\n return val;\n }\n var zIndex;\n if (typeof val === \"number\" && !_isNaN(val)) {\n zIndex = val;\n } else if (typeof val === \"string\") {\n zIndex = _getSafeZIndex(_parseInt(val, 10));\n }\n return typeof zIndex === \"number\" ? zIndex : \"auto\";\n };\n /**\n * Ensure OS-compliant line endings, i.e. \"\\r\\n\" on Windows, \"\\n\" elsewhere\n *\n * @returns string\n * @private\n */\n var _fixLineEndings = function(content) {\n var replaceRegex = /(\\r\\n|\\r|\\n)/g;\n if (typeof content === \"string\" && _globalConfig.fixLineEndings === true) {\n if (_isWindows()) {\n if (/((^|[^\\r])\\n|\\r([^\\n]|$))/.test(content)) {\n content = content.replace(replaceRegex, \"\\r\\n\");\n }\n } else if (/\\r/.test(content)) {\n content = content.replace(replaceRegex, \"\\n\");\n }\n }\n return content;\n };\n /**\n * Attempt to detect if ZeroClipboard is executing inside of a sandboxed iframe.\n * If it is, Flash Player cannot be used, so ZeroClipboard is dead in the water.\n *\n * @see {@link http://lists.w3.org/Archives/Public/public-whatwg-archive/2014Dec/0002.html}\n * @see {@link https://github.com/zeroclipboard/zeroclipboard/issues/511}\n * @see {@link http://zeroclipboard.github.io/test-iframes.html}\n *\n * @returns `true` (is sandboxed), `false` (is not sandboxed), or `null` (uncertain)\n * @private\n */\n var _detectSandbox = function(doNotReassessFlashSupport) {\n var effectiveScriptOrigin, frame, frameError, previousState = _flashState.sandboxed, isSandboxed = null;\n doNotReassessFlashSupport = doNotReassessFlashSupport === true;\n if (_pageIsFramed === false) {\n isSandboxed = false;\n } else {\n try {\n frame = window.frameElement || null;\n } catch (e) {\n frameError = {\n name: e.name,\n message: e.message\n };\n }\n if (frame && frame.nodeType === 1 && frame.nodeName === \"IFRAME\") {\n try {\n isSandboxed = frame.hasAttribute(\"sandbox\");\n } catch (e) {\n isSandboxed = null;\n }\n } else {\n try {\n effectiveScriptOrigin = document.domain || null;\n } catch (e) {\n effectiveScriptOrigin = null;\n }\n if (effectiveScriptOrigin === null || frameError && frameError.name === \"SecurityError\" && /(^|[\\s\\(\\[@])sandbox(es|ed|ing|[\\s\\.,!\\)\\]@]|$)/.test(frameError.message.toLowerCase())) {\n isSandboxed = true;\n }\n }\n }\n _flashState.sandboxed = isSandboxed;\n if (previousState !== isSandboxed && !doNotReassessFlashSupport) {\n _detectFlashSupport(_ActiveXObject);\n }\n return isSandboxed;\n };\n /**\n * Detect the Flash Player status, version, and plugin type.\n *\n * @see {@link https://code.google.com/p/doctype-mirror/wiki/ArticleDetectFlash#The_code}\n * @see {@link http://stackoverflow.com/questions/12866060/detecting-pepper-ppapi-flash-with-javascript}\n *\n * @returns `undefined`\n * @private\n */\n var _detectFlashSupport = function(ActiveXObject) {\n var plugin, ax, mimeType, hasFlash = false, isActiveX = false, isPPAPI = false, flashVersion = \"\";\n /**\n * Derived from Apple's suggested sniffer.\n * @param {String} desc e.g. \"Shockwave Flash 7.0 r61\"\n * @returns {String} \"7.0.61\"\n * @private\n */\n function parseFlashVersion(desc) {\n var matches = desc.match(/[\\d]+/g);\n matches.length = 3;\n return matches.join(\".\");\n }\n function isPepperFlash(flashPlayerFileName) {\n return !!flashPlayerFileName && (flashPlayerFileName = flashPlayerFileName.toLowerCase()) && (/^(pepflashplayer\\.dll|libpepflashplayer\\.so|pepperflashplayer\\.plugin)$/.test(flashPlayerFileName) || flashPlayerFileName.slice(-13) === \"chrome.plugin\");\n }\n function inspectPlugin(plugin) {\n if (plugin) {\n hasFlash = true;\n if (plugin.version) {\n flashVersion = parseFlashVersion(plugin.version);\n }\n if (!flashVersion && plugin.description) {\n flashVersion = parseFlashVersion(plugin.description);\n }\n if (plugin.filename) {\n isPPAPI = isPepperFlash(plugin.filename);\n }\n }\n }\n if (_navigator.plugins && _navigator.plugins.length) {\n plugin = _navigator.plugins[\"Shockwave Flash\"];\n inspectPlugin(plugin);\n if (_navigator.plugins[\"Shockwave Flash 2.0\"]) {\n hasFlash = true;\n flashVersion = \"2.0.0.11\";\n }\n } else if (_navigator.mimeTypes && _navigator.mimeTypes.length) {\n mimeType = _navigator.mimeTypes[\"application/x-shockwave-flash\"];\n plugin = mimeType && mimeType.enabledPlugin;\n inspectPlugin(plugin);\n } else if (typeof ActiveXObject !== \"undefined\") {\n isActiveX = true;\n try {\n ax = new ActiveXObject(\"ShockwaveFlash.ShockwaveFlash.7\");\n hasFlash = true;\n flashVersion = parseFlashVersion(ax.GetVariable(\"$version\"));\n } catch (e1) {\n try {\n ax = new ActiveXObject(\"ShockwaveFlash.ShockwaveFlash.6\");\n hasFlash = true;\n flashVersion = \"6.0.21\";\n } catch (e2) {\n try {\n ax = new ActiveXObject(\"ShockwaveFlash.ShockwaveFlash\");\n hasFlash = true;\n flashVersion = parseFlashVersion(ax.GetVariable(\"$version\"));\n } catch (e3) {\n isActiveX = false;\n }\n }\n }\n }\n _flashState.disabled = hasFlash !== true;\n _flashState.outdated = flashVersion && _parseFloat(flashVersion) < _parseFloat(_minimumFlashVersion);\n _flashState.version = flashVersion || \"0.0.0\";\n _flashState.pluginType = isPPAPI ? \"pepper\" : isActiveX ? \"activex\" : hasFlash ? \"netscape\" : \"unknown\";\n };\n /**\n * Invoke the Flash detection algorithms immediately upon inclusion so we're not waiting later.\n */\n _detectFlashSupport(_ActiveXObject);\n /**\n * Always assess the `sandboxed` state of the page at important Flash-related moments.\n */\n _detectSandbox(true);\n /**\n * A shell constructor for `ZeroClipboard` client instances.\n *\n * @constructor\n */\n var ZeroClipboard = function() {\n if (!(this instanceof ZeroClipboard)) {\n return new ZeroClipboard();\n }\n if (typeof ZeroClipboard._createClient === \"function\") {\n ZeroClipboard._createClient.apply(this, _args(arguments));\n }\n };\n /**\n * The ZeroClipboard library's version number.\n *\n * @static\n * @readonly\n * @property {string}\n */\n ZeroClipboard.version = \"2.4.0-beta.1\";\n /**\n * Update or get a copy of the ZeroClipboard global configuration.\n * Returns a copy of the current/updated configuration.\n *\n * @returns Object\n * @static\n */\n ZeroClipboard.config = function() {\n return _config.apply(this, _args(arguments));\n };\n /**\n * Diagnostic method that describes the state of the browser, Flash Player, and ZeroClipboard.\n *\n * @returns Object\n * @static\n */\n ZeroClipboard.state = function() {\n return _state.apply(this, _args(arguments));\n };\n /**\n * Check if Flash is unusable for any reason: disabled, outdated, deactivated, etc.\n *\n * @returns Boolean\n * @static\n */\n ZeroClipboard.isFlashUnusable = function() {\n return _isFlashUnusable.apply(this, _args(arguments));\n };\n /**\n * Register an event listener.\n *\n * @returns `ZeroClipboard`\n * @static\n */\n ZeroClipboard.on = function() {\n return _on.apply(this, _args(arguments));\n };\n /**\n * Unregister an event listener.\n * If no `listener` function/object is provided, it will unregister all listeners for the provided `eventType`.\n * If no `eventType` is provided, it will unregister all listeners for every event type.\n *\n * @returns `ZeroClipboard`\n * @static\n */\n ZeroClipboard.off = function() {\n return _off.apply(this, _args(arguments));\n };\n /**\n * Retrieve event listeners for an `eventType`.\n * If no `eventType` is provided, it will retrieve all listeners for every event type.\n *\n * @returns array of listeners for the `eventType`; if no `eventType`, then a map/hash object of listeners for all event types; or `null`\n */\n ZeroClipboard.handlers = function() {\n return _listeners.apply(this, _args(arguments));\n };\n /**\n * Event emission receiver from the Flash object, forwarding to any registered JavaScript event listeners.\n *\n * @returns For the \"copy\" event, returns the Flash-friendly \"clipData\" object; otherwise `undefined`.\n * @static\n */\n ZeroClipboard.emit = function() {\n return _emit.apply(this, _args(arguments));\n };\n /**\n * Create and embed the Flash object.\n *\n * @returns The Flash object\n * @static\n */\n ZeroClipboard.create = function() {\n return _create.apply(this, _args(arguments));\n };\n /**\n * Self-destruct and clean up everything, including the embedded Flash object.\n *\n * @returns `undefined`\n * @static\n */\n ZeroClipboard.destroy = function() {\n return _destroy.apply(this, _args(arguments));\n };\n /**\n * Set the pending data for clipboard injection.\n *\n * @returns `undefined`\n * @static\n */\n ZeroClipboard.setData = function() {\n return _setData.apply(this, _args(arguments));\n };\n /**\n * Clear the pending data for clipboard injection.\n * If no `format` is provided, all pending data formats will be cleared.\n *\n * @returns `undefined`\n * @static\n */\n ZeroClipboard.clearData = function() {\n return _clearData.apply(this, _args(arguments));\n };\n /**\n * Get a copy of the pending data for clipboard injection.\n * If no `format` is provided, a copy of ALL pending data formats will be returned.\n *\n * @returns `String` or `Object`\n * @static\n */\n ZeroClipboard.getData = function() {\n return _getData.apply(this, _args(arguments));\n };\n /**\n * Sets the current HTML object that the Flash object should overlay. This will put the global\n * Flash object on top of the current element; depending on the setup, this may also set the\n * pending clipboard text data as well as the Flash object's wrapping element's title attribute\n * based on the underlying HTML element and ZeroClipboard configuration.\n *\n * @returns `undefined`\n * @static\n */\n ZeroClipboard.focus = ZeroClipboard.activate = function() {\n return _focus.apply(this, _args(arguments));\n };\n /**\n * Un-overlays the Flash object. This will put the global Flash object off-screen; depending on\n * the setup, this may also unset the Flash object's wrapping element's title attribute based on\n * the underlying HTML element and ZeroClipboard configuration.\n *\n * @returns `undefined`\n * @static\n */\n ZeroClipboard.blur = ZeroClipboard.deactivate = function() {\n return _blur.apply(this, _args(arguments));\n };\n /**\n * Returns the currently focused/\"activated\" HTML element that the Flash object is wrapping.\n *\n * @returns `HTMLElement` or `null`\n * @static\n */\n ZeroClipboard.activeElement = function() {\n return _activeElement.apply(this, _args(arguments));\n };\n /**\n * Keep track of the ZeroClipboard client instance counter.\n */\n var _clientIdCounter = 0;\n /**\n * Keep track of the state of the client instances.\n *\n * Entry structure:\n * _clientMeta[client.id] = {\n * instance: client,\n * elements: [],\n * handlers: {},\n * coreWildcardHandler: function(event) { return client.emit(event); }\n * };\n */\n var _clientMeta = {};\n /**\n * Keep track of the ZeroClipboard clipped elements counter.\n */\n var _elementIdCounter = 0;\n /**\n * Keep track of the state of the clipped element relationships to clients.\n *\n * Entry structure:\n * _elementMeta[element.zcClippingId] = [client1.id, client2.id];\n */\n var _elementMeta = {};\n /**\n * Keep track of the state of the mouse event handlers for clipped elements.\n *\n * Entry structure:\n * _mouseHandlers[element.zcClippingId] = {\n * mouseover: function(event) {},\n * mouseout: function(event) {},\n * mouseenter: function(event) {},\n * mouseleave: function(event) {},\n * mousemove: function(event) {}\n * };\n */\n var _mouseHandlers = {};\n /**\n * Extending the ZeroClipboard configuration defaults for the Client module.\n */\n _extend(_globalConfig, {\n autoActivate: true\n });\n /**\n * The real constructor for `ZeroClipboard` client instances.\n * @private\n */\n var _clientConstructor = function(elements) {\n var meta, client = this;\n client.id = \"\" + _clientIdCounter++;\n meta = {\n instance: client,\n elements: [],\n handlers: {},\n coreWildcardHandler: function(event) {\n return client.emit(event);\n }\n };\n _clientMeta[client.id] = meta;\n if (elements) {\n client.clip(elements);\n }\n ZeroClipboard.on(\"*\", meta.coreWildcardHandler);\n ZeroClipboard.on(\"destroy\", function() {\n client.destroy();\n });\n ZeroClipboard.create();\n };\n /**\n * The underlying implementation of `ZeroClipboard.Client.prototype.on`.\n * @private\n */\n var _clientOn = function(eventType, listener) {\n var i, len, events, added = {}, client = this, meta = _clientMeta[client.id], handlers = meta && meta.handlers;\n if (!meta) {\n throw new Error(\"Attempted to add new listener(s) to a destroyed ZeroClipboard client instance\");\n }\n if (typeof eventType === \"string\" && eventType) {\n events = eventType.toLowerCase().split(/\\s+/);\n } else if (typeof eventType === \"object\" && eventType && !(\"length\" in eventType) && typeof listener === \"undefined\") {\n _keys(eventType).forEach(function(key) {\n var listener = eventType[key];\n if (typeof listener === \"function\") {\n client.on(key, listener);\n }\n });\n }\n if (events && events.length && listener) {\n for (i = 0, len = events.length; i < len; i++) {\n eventType = events[i].replace(/^on/, \"\");\n added[eventType] = true;\n if (!handlers[eventType]) {\n handlers[eventType] = [];\n }\n handlers[eventType].push(listener);\n }\n if (added.ready && _flashState.ready) {\n this.emit({\n type: \"ready\",\n client: this\n });\n }\n if (added.error) {\n for (i = 0, len = _flashStateErrorNames.length; i < len; i++) {\n if (_flashState[_flashStateErrorNames[i].replace(/^flash-/, \"\")]) {\n this.emit({\n type: \"error\",\n name: _flashStateErrorNames[i],\n client: this\n });\n break;\n }\n }\n if (_zcSwfVersion !== undefined && ZeroClipboard.version !== _zcSwfVersion) {\n this.emit({\n type: \"error\",\n name: \"version-mismatch\",\n jsVersion: ZeroClipboard.version,\n swfVersion: _zcSwfVersion\n });\n }\n }\n }\n return client;\n };\n /**\n * The underlying implementation of `ZeroClipboard.Client.prototype.off`.\n * @private\n */\n var _clientOff = function(eventType, listener) {\n var i, len, foundIndex, events, perEventHandlers, client = this, meta = _clientMeta[client.id], handlers = meta && meta.handlers;\n if (!handlers) {\n return client;\n }\n if (arguments.length === 0) {\n events = _keys(handlers);\n } else if (typeof eventType === \"string\" && eventType) {\n events = eventType.split(/\\s+/);\n } else if (typeof eventType === \"object\" && eventType && !(\"length\" in eventType) && typeof listener === \"undefined\") {\n _keys(eventType).forEach(function(key) {\n var listener = eventType[key];\n if (typeof listener === \"function\") {\n client.off(key, listener);\n }\n });\n }\n if (events && events.length) {\n for (i = 0, len = events.length; i < len; i++) {\n eventType = events[i].toLowerCase().replace(/^on/, \"\");\n perEventHandlers = handlers[eventType];\n if (perEventHandlers && perEventHandlers.length) {\n if (listener) {\n foundIndex = perEventHandlers.indexOf(listener);\n while (foundIndex !== -1) {\n perEventHandlers.splice(foundIndex, 1);\n foundIndex = perEventHandlers.indexOf(listener, foundIndex);\n }\n } else {\n perEventHandlers.length = 0;\n }\n }\n }\n }\n return client;\n };\n /**\n * The underlying implementation of `ZeroClipboard.Client.prototype.handlers`.\n * @private\n */\n var _clientListeners = function(eventType) {\n var copy = null, handlers = _clientMeta[this.id] && _clientMeta[this.id].handlers;\n if (handlers) {\n if (typeof eventType === \"string\" && eventType) {\n copy = handlers[eventType] ? handlers[eventType].slice(0) : [];\n } else {\n copy = _deepCopy(handlers);\n }\n }\n return copy;\n };\n /**\n * The underlying implementation of `ZeroClipboard.Client.prototype.emit`.\n * @private\n */\n var _clientEmit = function(event) {\n var eventCopy, client = this;\n if (_clientShouldEmit.call(client, event)) {\n if (typeof event === \"object\" && event && typeof event.type === \"string\" && event.type) {\n event = _extend({}, event);\n }\n eventCopy = _extend({}, _createEvent(event), {\n client: client\n });\n _clientDispatchCallbacks.call(client, eventCopy);\n }\n return client;\n };\n /**\n * The underlying implementation of `ZeroClipboard.Client.prototype.clip`.\n * @private\n */\n var _clientClip = function(elements) {\n if (!_clientMeta[this.id]) {\n throw new Error(\"Attempted to clip element(s) to a destroyed ZeroClipboard client instance\");\n }\n elements = _prepClip(elements);\n for (var i = 0; i < elements.length; i++) {\n if (_hasOwn.call(elements, i) && elements[i] && elements[i].nodeType === 1) {\n if (!elements[i].zcClippingId) {\n elements[i].zcClippingId = \"zcClippingId_\" + _elementIdCounter++;\n _elementMeta[elements[i].zcClippingId] = [ this.id ];\n if (_globalConfig.autoActivate === true) {\n _addMouseHandlers(elements[i]);\n }\n } else if (_elementMeta[elements[i].zcClippingId].indexOf(this.id) === -1) {\n _elementMeta[elements[i].zcClippingId].push(this.id);\n }\n var clippedElements = _clientMeta[this.id] && _clientMeta[this.id].elements;\n if (clippedElements.indexOf(elements[i]) === -1) {\n clippedElements.push(elements[i]);\n }\n }\n }\n return this;\n };\n /**\n * The underlying implementation of `ZeroClipboard.Client.prototype.unclip`.\n * @private\n */\n var _clientUnclip = function(elements) {\n var meta = _clientMeta[this.id];\n if (!meta) {\n return this;\n }\n var clippedElements = meta.elements;\n var arrayIndex;\n if (typeof elements === \"undefined\") {\n elements = clippedElements.slice(0);\n } else {\n elements = _prepClip(elements);\n }\n for (var i = elements.length; i--; ) {\n if (_hasOwn.call(elements, i) && elements[i] && elements[i].nodeType === 1) {\n arrayIndex = 0;\n while ((arrayIndex = clippedElements.indexOf(elements[i], arrayIndex)) !== -1) {\n clippedElements.splice(arrayIndex, 1);\n }\n var clientIds = _elementMeta[elements[i].zcClippingId];\n if (clientIds) {\n arrayIndex = 0;\n while ((arrayIndex = clientIds.indexOf(this.id, arrayIndex)) !== -1) {\n clientIds.splice(arrayIndex, 1);\n }\n if (clientIds.length === 0) {\n if (_globalConfig.autoActivate === true) {\n _removeMouseHandlers(elements[i]);\n }\n delete elements[i].zcClippingId;\n }\n }\n }\n }\n return this;\n };\n /**\n * The underlying implementation of `ZeroClipboard.Client.prototype.elements`.\n * @private\n */\n var _clientElements = function() {\n var meta = _clientMeta[this.id];\n return meta && meta.elements ? meta.elements.slice(0) : [];\n };\n /**\n * The underlying implementation of `ZeroClipboard.Client.prototype.destroy`.\n * @private\n */\n var _clientDestroy = function() {\n var meta = _clientMeta[this.id];\n if (!meta) {\n return;\n }\n this.unclip();\n this.off();\n ZeroClipboard.off(\"*\", meta.coreWildcardHandler);\n delete _clientMeta[this.id];\n };\n /**\n * Inspect an Event to see if the Client (`this`) should honor it for emission.\n * @private\n */\n var _clientShouldEmit = function(event) {\n if (!(event && event.type)) {\n return false;\n }\n if (event.client && event.client !== this) {\n return false;\n }\n var meta = _clientMeta[this.id];\n var clippedEls = meta && meta.elements;\n var hasClippedEls = !!clippedEls && clippedEls.length > 0;\n var goodTarget = !event.target || hasClippedEls && clippedEls.indexOf(event.target) !== -1;\n var goodRelTarget = event.relatedTarget && hasClippedEls && clippedEls.indexOf(event.relatedTarget) !== -1;\n var goodClient = event.client && event.client === this;\n if (!meta || !(goodTarget || goodRelTarget || goodClient)) {\n return false;\n }\n return true;\n };\n /**\n * Handle the actual dispatching of events to a client instance.\n *\n * @returns `undefined`\n * @private\n */\n var _clientDispatchCallbacks = function(event) {\n var meta = _clientMeta[this.id];\n if (!(typeof event === \"object\" && event && event.type && meta)) {\n return;\n }\n var async = _shouldPerformAsync(event);\n var wildcardTypeHandlers = meta && meta.handlers[\"*\"] || [];\n var specificTypeHandlers = meta && meta.handlers[event.type] || [];\n var handlers = wildcardTypeHandlers.concat(specificTypeHandlers);\n if (handlers && handlers.length) {\n var i, len, func, context, eventCopy, originalContext = this;\n for (i = 0, len = handlers.length; i < len; i++) {\n func = handlers[i];\n context = originalContext;\n if (typeof func === \"string\" && typeof _window[func] === \"function\") {\n func = _window[func];\n }\n if (typeof func === \"object\" && func && typeof func.handleEvent === \"function\") {\n context = func;\n func = func.handleEvent;\n }\n if (typeof func === \"function\") {\n eventCopy = _extend({}, event);\n _dispatchCallback(func, context, [ eventCopy ], async);\n }\n }\n }\n };\n /**\n * Prepares the elements for clipping/unclipping.\n *\n * @returns An Array of elements.\n * @private\n */\n var _prepClip = function(elements) {\n if (typeof elements === \"string\") {\n elements = [];\n }\n return typeof elements.length !== \"number\" ? [ elements ] : elements;\n };\n /**\n * Add a `mouseover` handler function for a clipped element.\n *\n * @returns `undefined`\n * @private\n */\n var _addMouseHandlers = function(element) {\n if (!(element && element.nodeType === 1)) {\n return;\n }\n var _suppressMouseEvents = function(event) {\n if (!(event || (event = _window.event))) {\n return;\n }\n if (event._source !== \"js\") {\n event.stopImmediatePropagation();\n event.preventDefault();\n }\n delete event._source;\n };\n var _elementMouseOver = function(event) {\n if (!(event || (event = _window.event))) {\n return;\n }\n _suppressMouseEvents(event);\n ZeroClipboard.focus(element);\n };\n element.addEventListener(\"mouseover\", _elementMouseOver, false);\n element.addEventListener(\"mouseout\", _suppressMouseEvents, false);\n element.addEventListener(\"mouseenter\", _suppressMouseEvents, false);\n element.addEventListener(\"mouseleave\", _suppressMouseEvents, false);\n element.addEventListener(\"mousemove\", _suppressMouseEvents, false);\n _mouseHandlers[element.zcClippingId] = {\n mouseover: _elementMouseOver,\n mouseout: _suppressMouseEvents,\n mouseenter: _suppressMouseEvents,\n mouseleave: _suppressMouseEvents,\n mousemove: _suppressMouseEvents\n };\n };\n /**\n * Remove a `mouseover` handler function for a clipped element.\n *\n * @returns `undefined`\n * @private\n */\n var _removeMouseHandlers = function(element) {\n if (!(element && element.nodeType === 1)) {\n return;\n }\n var mouseHandlers = _mouseHandlers[element.zcClippingId];\n if (!(typeof mouseHandlers === \"object\" && mouseHandlers)) {\n return;\n }\n var key, val, mouseEvents = [ \"move\", \"leave\", \"enter\", \"out\", \"over\" ];\n for (var i = 0, len = mouseEvents.length; i < len; i++) {\n key = \"mouse\" + mouseEvents[i];\n val = mouseHandlers[key];\n if (typeof val === \"function\") {\n element.removeEventListener(key, val, false);\n }\n }\n delete _mouseHandlers[element.zcClippingId];\n };\n /**\n * Creates a new ZeroClipboard client instance.\n * Optionally, auto-`clip` an element or collection of elements.\n *\n * @constructor\n */\n ZeroClipboard._createClient = function() {\n _clientConstructor.apply(this, _args(arguments));\n };\n /**\n * Register an event listener to the client.\n *\n * @returns `this`\n */\n ZeroClipboard.prototype.on = function() {\n return _clientOn.apply(this, _args(arguments));\n };\n /**\n * Unregister an event handler from the client.\n * If no `listener` function/object is provided, it will unregister all handlers for the provided `eventType`.\n * If no `eventType` is provided, it will unregister all handlers for every event type.\n *\n * @returns `this`\n */\n ZeroClipboard.prototype.off = function() {\n return _clientOff.apply(this, _args(arguments));\n };\n /**\n * Retrieve event listeners for an `eventType` from the client.\n * If no `eventType` is provided, it will retrieve all listeners for every event type.\n *\n * @returns array of listeners for the `eventType`; if no `eventType`, then a map/hash object of listeners for all event types; or `null`\n */\n ZeroClipboard.prototype.handlers = function() {\n return _clientListeners.apply(this, _args(arguments));\n };\n /**\n * Event emission receiver from the Flash object for this client's registered JavaScript event listeners.\n *\n * @returns For the \"copy\" event, returns the Flash-friendly \"clipData\" object; otherwise `undefined`.\n */\n ZeroClipboard.prototype.emit = function() {\n return _clientEmit.apply(this, _args(arguments));\n };\n /**\n * Register clipboard actions for new element(s) to the client.\n *\n * @returns `this`\n */\n ZeroClipboard.prototype.clip = function() {\n return _clientClip.apply(this, _args(arguments));\n };\n /**\n * Unregister the clipboard actions of previously registered element(s) on the page.\n * If no elements are provided, ALL registered elements will be unregistered.\n *\n * @returns `this`\n */\n ZeroClipboard.prototype.unclip = function() {\n return _clientUnclip.apply(this, _args(arguments));\n };\n /**\n * Get all of the elements to which this client is clipped.\n *\n * @returns array of clipped elements\n */\n ZeroClipboard.prototype.elements = function() {\n return _clientElements.apply(this, _args(arguments));\n };\n /**\n * Self-destruct and clean up everything for a single client.\n * This will NOT destroy the embedded Flash object.\n *\n * @returns `undefined`\n */\n ZeroClipboard.prototype.destroy = function() {\n return _clientDestroy.apply(this, _args(arguments));\n };\n /**\n * Stores the pending plain text to inject into the clipboard.\n *\n * @returns `this`\n */\n ZeroClipboard.prototype.setText = function(text) {\n if (!_clientMeta[this.id]) {\n throw new Error(\"Attempted to set pending clipboard data from a destroyed ZeroClipboard client instance\");\n }\n ZeroClipboard.setData(\"text/plain\", text);\n return this;\n };\n /**\n * Stores the pending HTML text to inject into the clipboard.\n *\n * @returns `this`\n */\n ZeroClipboard.prototype.setHtml = function(html) {\n if (!_clientMeta[this.id]) {\n throw new Error(\"Attempted to set pending clipboard data from a destroyed ZeroClipboard client instance\");\n }\n ZeroClipboard.setData(\"text/html\", html);\n return this;\n };\n /**\n * Stores the pending rich text (RTF) to inject into the clipboard.\n *\n * @returns `this`\n */\n ZeroClipboard.prototype.setRichText = function(richText) {\n if (!_clientMeta[this.id]) {\n throw new Error(\"Attempted to set pending clipboard data from a destroyed ZeroClipboard client instance\");\n }\n ZeroClipboard.setData(\"application/rtf\", richText);\n return this;\n };\n /**\n * Stores the pending data to inject into the clipboard.\n *\n * @returns `this`\n */\n ZeroClipboard.prototype.setData = function() {\n if (!_clientMeta[this.id]) {\n throw new Error(\"Attempted to set pending clipboard data from a destroyed ZeroClipboard client instance\");\n }\n ZeroClipboard.setData.apply(this, _args(arguments));\n return this;\n };\n /**\n * Clears the pending data to inject into the clipboard.\n * If no `format` is provided, all pending data formats will be cleared.\n *\n * @returns `this`\n */\n ZeroClipboard.prototype.clearData = function() {\n if (!_clientMeta[this.id]) {\n throw new Error(\"Attempted to clear pending clipboard data from a destroyed ZeroClipboard client instance\");\n }\n ZeroClipboard.clearData.apply(this, _args(arguments));\n return this;\n };\n /**\n * Gets a copy of the pending data to inject into the clipboard.\n * If no `format` is provided, a copy of ALL pending data formats will be returned.\n *\n * @returns `String` or `Object`\n */\n ZeroClipboard.prototype.getData = function() {\n if (!_clientMeta[this.id]) {\n throw new Error(\"Attempted to get pending clipboard data from a destroyed ZeroClipboard client instance\");\n }\n return ZeroClipboard.getData.apply(this, _args(arguments));\n };\n if (typeof define === \"function\" && define.amd) {\n define(function() {\n return ZeroClipboard;\n });\n } else if (typeof module === \"object\" && module && typeof module.exports === \"object\" && module.exports) {\n module.exports = ZeroClipboard;\n } else {\n window.ZeroClipboard = ZeroClipboard;\n }\n})(function() {\n return this || window;\n}());"]}
\ No newline at end of file
diff --git a/js/ZeroClipboard.swf b/js/ZeroClipboard.swf
new file mode 100644
index 0000000..455f633
Binary files /dev/null and b/js/ZeroClipboard.swf differ
diff --git a/page/home.html b/page/home.html
index a628496..3664bee 100644
--- a/page/home.html
+++ b/page/home.html
@@ -18,7 +18,7 @@
-