/*! * clipboard.js v2.0.0 * https://zenorocha.github.io/clipboard.js * * licensed mit © zeno rocha */ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.clipboardjs=e():t.clipboardjs=e()}(this,function(){return function(t){function e(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,o){e.o(t,n)||object.defineproperty(t,n,{configurable:!1,enumerable:!0,get:o})},e.n=function(t){var n=t&&t.__esmodule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return object.prototype.hasownproperty.call(t,e)},e.p="",e(e.s=3)}([function(t,e,n){var o,r,i;!function(a,c){r=[t,n(7)],o=c,void 0!==(i="function"==typeof o?o.apply(e,r):o)&&(t.exports=i)}(0,function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new typeerror("cannot call a class as a function")}var o=function(t){return t&&t.__esmodule?t:{default:t}}(e),r="function"==typeof symbol&&"symbol"==typeof symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof symbol&&t.constructor===symbol&&t!==symbol.prototype?"symbol":typeof t},i=function(){function t(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};this.action=t.action,this.container=t.container,this.emitter=t.emitter,this.target=t.target,this.text=t.text,this.trigger=t.trigger,this.selectedtext=""}},{key:"initselection",value:function(){this.text?this.selectfake():this.target&&this.selecttarget()}},{key:"selectfake",value:function(){var t=this,e="rtl"==document.documentelement.getattribute("dir");this.removefake(),this.fakehandlercallback=function(){return t.removefake()},this.fakehandler=this.container.addeventlistener("click",this.fakehandlercallback)||!0,this.fakeelem=document.createelement("textarea"),this.fakeelem.style.fontsize="12pt",this.fakeelem.style.border="0",this.fakeelem.style.padding="0",this.fakeelem.style.margin="0",this.fakeelem.style.position="absolute",this.fakeelem.style[e?"right":"left"]="-9999px";var n=window.pageyoffset||document.documentelement.scrolltop;this.fakeelem.style.top=n+"px",this.fakeelem.setattribute("readonly",""),this.fakeelem.value=this.text,this.container.appendchild(this.fakeelem),this.selectedtext=(0,o.default)(this.fakeelem),this.copytext()}},{key:"removefake",value:function(){this.fakehandler&&(this.container.removeeventlistener("click",this.fakehandlercallback),this.fakehandler=null,this.fakehandlercallback=null),this.fakeelem&&(this.container.removechild(this.fakeelem),this.fakeelem=null)}},{key:"selecttarget",value:function(){this.selectedtext=(0,o.default)(this.target),this.copytext()}},{key:"copytext",value:function(){var t=void 0;try{t=document.execcommand(this.action)}catch(e){t=!1}this.handleresult(t)}},{key:"handleresult",value:function(t){this.emitter.emit(t?"success":"error",{action:this.action,text:this.selectedtext,trigger:this.trigger,clearselection:this.clearselection.bind(this)})}},{key:"clearselection",value:function(){this.trigger&&this.trigger.focus(),window.getselection().removeallranges()}},{key:"destroy",value:function(){this.removefake()}},{key:"action",set:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"copy";if(this._action=t,"copy"!==this._action&&"cut"!==this._action)throw new error('invalid "action" value, use either "copy" or "cut"')},get:function(){return this._action}},{key:"target",set:function(t){if(void 0!==t){if(!t||"object"!==(void 0===t?"undefined":r(t))||1!==t.nodetype)throw new error('invalid "target" value, use a valid element');if("copy"===this.action&&t.hasattribute("disabled"))throw new error('invalid "target" attribute. please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(t.hasattribute("readonly")||t.hasattribute("disabled")))throw new error('invalid "target" attribute. you can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=t}},get:function(){return this._target}}]),t}();t.exports=a})},function(t,e,n){function o(t,e,n){if(!t&&!e&&!n)throw new error("missing required arguments");if(!c.string(e))throw new typeerror("second argument must be a string");if(!c.fn(n))throw new typeerror("third argument must be a function");if(c.node(t))return r(t,e,n);if(c.nodelist(t))return i(t,e,n);if(c.string(t))return a(t,e,n);throw new typeerror("first argument must be a string, htmlelement, htmlcollection, or nodelist")}function r(t,e,n){return t.addeventlistener(e,n),{destroy:function(){t.removeeventlistener(e,n)}}}function i(t,e,n){return array.prototype.foreach.call(t,function(t){t.addeventlistener(e,n)}),{destroy:function(){array.prototype.foreach.call(t,function(t){t.removeeventlistener(e,n)})}}}function a(t,e,n){return u(document.body,t,e,n)}var c=n(6),u=n(5);t.exports=o},function(t,e){function n(){}n.prototype={on:function(t,e,n){var o=this.e||(this.e={});return(o[t]||(o[t]=[])).push({fn:e,ctx:n}),this},once:function(t,e,n){function o(){r.off(t,o),e.apply(n,arguments)}var r=this;return o._=e,this.on(t,o,n)},emit:function(t){var e=[].slice.call(arguments,1),n=((this.e||(this.e={}))[t]||[]).slice(),o=0,r=n.length;for(o;o0&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof t.action?t.action:this.defaultaction,this.target="function"==typeof t.target?t.target:this.defaulttarget,this.text="function"==typeof t.text?t.text:this.defaulttext,this.container="object"===d(t.container)?t.container:document.body}},{key:"listenclick",value:function(t){var e=this;this.listener=(0,f.default)(t,"click",function(t){return e.onclick(t)})}},{key:"onclick",value:function(t){var e=t.delegatetarget||t.currenttarget;this.clipboardaction&&(this.clipboardaction=null),this.clipboardaction=new l.default({action:this.action(e),target:this.target(e),text:this.text(e),container:this.container,trigger:e,emitter:this})}},{key:"defaultaction",value:function(t){return u("action",t)}},{key:"defaulttarget",value:function(t){var e=u("target",t);if(e)return document.queryselector(e)}},{key:"defaulttext",value:function(t){return u("text",t)}},{key:"destroy",value:function(){this.listener.destroy(),this.clipboardaction&&(this.clipboardaction.destroy(),this.clipboardaction=null)}}],[{key:"issupported",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["copy","cut"],e="string"==typeof t?[t]:t,n=!!document.querycommandsupported;return e.foreach(function(t){n=n&&!!document.querycommandsupported(t)}),n}}]),e}(s.default);t.exports=p})},function(t,e){function n(t,e){for(;t&&t.nodetype!==o;){if("function"==typeof t.matches&&t.matches(e))return t;t=t.parentnode}}var o=9;if("undefined"!=typeof element&&!element.prototype.matches){var r=element.prototype;r.matches=r.matchesselector||r.mozmatchesselector||r.msmatchesselector||r.omatchesselector||r.webkitmatchesselector}t.exports=n},function(t,e,n){function o(t,e,n,o,r){var a=i.apply(this,arguments);return t.addeventlistener(n,a,r),{destroy:function(){t.removeeventlistener(n,a,r)}}}function r(t,e,n,r,i){return"function"==typeof t.addeventlistener?o.apply(null,arguments):"function"==typeof n?o.bind(null,document).apply(null,arguments):("string"==typeof t&&(t=document.queryselectorall(t)),array.prototype.map.call(t,function(t){return o(t,e,n,r,i)}))}function i(t,e,n,o){return function(n){n.delegatetarget=a(n.target,e),n.delegatetarget&&o.call(t,n)}}var a=n(4);t.exports=r},function(t,e){e.node=function(t){return void 0!==t&&t instanceof htmlelement&&1===t.nodetype},e.nodelist=function(t){var n=object.prototype.tostring.call(t);return void 0!==t&&("[object nodelist]"===n||"[object htmlcollection]"===n)&&"length"in t&&(0===t.length||e.node(t[0]))},e.string=function(t){return"string"==typeof t||t instanceof string},e.fn=function(t){return"[object function]"===object.prototype.tostring.call(t)}},function(t,e){function n(t){var e;if("select"===t.nodename)t.focus(),e=t.value;else if("input"===t.nodename||"textarea"===t.nodename){var n=t.hasattribute("readonly");n||t.setattribute("readonly",""),t.select(),t.setselectionrange(0,t.value.length),n||t.removeattribute("readonly"),e=t.value}else{t.hasattribute("contenteditable")&&t.focus();var o=window.getselection(),r=document.createrange();r.selectnodecontents(t),o.removeallranges(),o.addrange(r),e=o.tostring()}return e}t.exports=n}])});