!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;"undefined"!=typeof window?t=window:"undefined"!=typeof global?t=global:"undefined"!=typeof self&&(t=self),t.woofmark=e()}}(function(){return function e(t,n,r){function o(i,s){if(!n[i]){if(!t[i]){var c="function"==typeof require&&require;if(!s&&c)return c(i,!0);if(a)return a(i,!0);var l=new Error("Cannot find module '"+i+"'");throw l.code="MODULE_NOT_FOUND",l}var u=n[i]={exports:{}};t[i][0].call(u.exports,function(e){var n=t[i][1][e];return o(n?n:e)},u,u.exports,e,t,n,r)}return n[i].exports}for(var a="function"==typeof require&&require,i=0;i<r.length;i++)o(r[i]);return o}({1:[function(e,t){t.exports=function(e,t){return Array.prototype.slice.call(e,t)}},{}],2:[function(e,t){"use strict";function n(e,t,n){function i(){h.sleeping=!0}function s(){return c()}function c(e){var n=t.getBoundingClientRect(),r=document.body.scrollTop||document.documentElement.scrollTop;return v?(e=v.read(),{x:(e.absolute?0:n.left)+e.x,y:(e.absolute?0:n.top)+r+e.y+20}):{x:n.left,y:n.top+r}}function l(e){u(e)}function u(n){if(g)throw new Error("Bullseye can't refresh after being destroyed. Create another instance instead.");if(v&&!n)return h.sleeping=!1,void v.refresh();var r=c(n);v||t===e||(r.y+=t.offsetHeight),e.style.left=r.x+"px",e.style.top=r.y+"px"}function f(){v&&v.destroy(),r.remove(window,"resize",m),g=!0}var d=n,p=t&&t.tagName;p||2!==arguments.length||(d=t),p||(t=e),d||(d={});var g=!1,m=o(u,30),h={update:d.autoupdateToCaret!==!1&&l},v=d.caret&&a(t,h);return u(),d.tracking!==!1&&r.add(window,"resize",m),{read:s,refresh:u,destroy:f,sleep:i}}var r=e("crossvent"),o=e("./throttle"),a=e("./tailormade");t.exports=n},{"./tailormade":3,"./throttle":4,crossvent:10}],3:[function(e,t){(function(n){"use strict";function r(e,t){function n(){}function r(){return(k?p:g)()}function i(){return T.sleeping?void 0:(T.update||n)(r())}function p(){var t=o(e),n=v(),r=m(n,t.start);return f.body.removeChild(n.mirror),r}function g(){var e=c();if(e.rangeCount){var t=e.getRangeAt(0),n="P"===t.startContainer.nodeName&&0===t.startOffset;if(n)return{x:t.startContainer.offsetLeft,y:t.startContainer.offsetTop,absolute:!0};if(t.getClientRects){var r=t.getClientRects();if(r.length>0)return{x:r[0].left,y:r[0].top,absolute:!0}}}return{x:0,y:0}}function m(t,n){var r=f.createElement("span"),o=t.mirror,a=t.computed;return w(o,h(e).substring(0,n)),"INPUT"===e.tagName&&(o.textContent=o.textContent.replace(/\s/g," ")),w(r,h(e).substring(n)||"."),o.appendChild(r),{x:r.offsetLeft+parseInt(a.borderLeftWidth),y:r.offsetTop+parseInt(a.borderTopWidth)}}function h(e){return k?e.value:e.innerHTML}function v(){function t(e){o[e]=n[e]}var n=u.getComputedStyle?getComputedStyle(e):e.currentStyle,r=f.createElement("div"),o=r.style;return f.body.appendChild(r),"INPUT"!==e.tagName&&(o.wordWrap="break-word"),o.whiteSpace="pre-wrap",o.position="absolute",o.visibility="hidden",l.forEach(t),d?(o.width=parseInt(n.width)-2+"px",e.scrollHeight>parseInt(n.height)&&(o.overflowY="scroll")):o.overflow="hidden",{mirror:r,computed:n}}function w(e,t){k?e.textContent=t:e.innerHTML=t}function y(t){var n=t?"remove":"add";a[n](e,"keydown",x),a[n](e,"keyup",x),a[n](e,"input",x),a[n](e,"paste",x),a[n](e,"change",x)}function b(){y(!0)}var k="INPUT"===e.tagName||"TEXTAREA"===e.tagName,x=s(i,30),T=t||{};return y(),{read:r,refresh:x,destroy:b}}var o=e("sell"),a=e("crossvent"),i=e("seleccion"),s=e("./throttle"),c=i.get,l=["direction","boxSizing","width","height","overflowX","overflowY","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","paddingTop","paddingRight","paddingBottom","paddingLeft","fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontSizeAdjust","lineHeight","fontFamily","textAlign","textTransform","textIndent","textDecoration","letterSpacing","wordSpacing"],u=n,f=document,d=null!==u.mozInnerScreenX&&void 0!==u.mozInnerScreenX;t.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./throttle":4,crossvent:10,seleccion:29,sell:31}],4:[function(e,t){"use strict";function n(e,t){var n,r=-1/0;return function(){function o(){clearTimeout(n),n=null;var a=r+t,i=Date.now();i>a?(r=i,e()):n=setTimeout(o,a-i)}n||o()}}t.exports=n},{}],5:[function(e,t){"use strict";function n(e,t){function n(t){o(t),e.files.length&&a.submit(e.files),e.value="",e.value=null}var a=r(t);return c.add(e,"change",n,!1),a}function r(e){function t(e){function t(e){u.append(r.fieldKey,e,e.name)}function a(e,t,n){t.body=n=i(n);var r=n&&n.results&&Array.isArray(n.results)?n.results:[],a=e||t.statusCode<200||t.statusCode>299||n instanceof Error;a?o.emit("error",e):o.emit("success",r,n),o.emit("ended",e,r,n)}o.emit("started",e);var c=Array.prototype.slice.call(e),l=n(c);if(!l)return void o.emit("invalid",c);o.emit("valid",l);var u=new FormData;Object.keys(r.formData).forEach(function(e){u.append(e,r.formData[e])});var f={"Content-Type":"multipart/form-data",headers:{Accept:"application/json"},method:r.method||"PUT",url:r.endpoint||"/api/files",body:u};l.forEach(t),s(f,a)}function n(e){function t(e){var t=u[r.validate]||r.validate;return t(e)}return r.validate?e.filter(t):e}var r=e||{};r.formData=r.formData||{},r.fieldKey=r.fieldKey||"uploads";var o=l({submit:t});return o}function o(e){e.stopPropagation(),e.preventDefault()}function a(e){return f.test(e.type)}function i(e){try{return JSON.parse(e)}catch(t){return t}}var s=e("xhr"),c=e("crossvent"),l=e("contra/emitter"),u={image:a},f=/^image\/(gif|png|p?jpe?g)$/i;t.exports={create:r,setup:n}},{"contra/emitter":9,crossvent:6,xhr:34}],6:[function(e,t){(function(n){"use strict";function r(e,t,n,r){return e.addEventListener(t,n,r)}function o(e,t,n){return e.attachEvent("on"+t,l(e,t,n))}function a(e,t,n,r){return e.removeEventListener(t,n,r)}function i(e,t,n){var r=u(e,t,n);return r?e.detachEvent("on"+t,r):void 0}function s(e,t,n){function r(){var e;return g.createEvent?(e=g.createEvent("Event"),e.initEvent(t,!0,!0)):g.createEventObject&&(e=g.createEventObject()),e}function o(){return new d(t,{detail:n})}var a=-1===p.indexOf(t)?o():r();e.dispatchEvent?e.dispatchEvent(a):e.fireEvent("on"+t,a)}function c(e,t,r){return function(t){var o=t||n.event;o.target=o.target||o.srcElement,o.preventDefault=o.preventDefault||function(){o.returnValue=!1},o.stopPropagation=o.stopPropagation||function(){o.cancelBubble=!0},o.which=o.which||o.keyCode,r.call(e,o)}}function l(e,t,n){var r=u(e,t,n)||c(e,t,n);return v.push({wrapper:r,element:e,type:t,fn:n}),r}function u(e,t,n){var r=f(e,t,n);if(r){var o=v[r].wrapper;return v.splice(r,1),o}}function f(e,t,n){var r,o;for(r=0;r<v.length;r++)if(o=v[r],o.element===e&&o.type===t&&o.fn===n)return r}var d=e("custom-event"),p=e("./eventmap"),g=n.document,m=r,h=a,v=[];n.addEventListener||(m=o,h=i),t.exports={add:m,remove:h,fabricate:s}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./eventmap":7,"custom-event":12}],7:[function(e,t){(function(e){"use strict";var n=[],r="",o=/^on/;for(r in e)o.test(r)&&n.push(r.slice(2));t.exports=n}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],8:[function(e,t){"use strict";var n=e("ticky");t.exports=function(e,t,r){e&&n(function(){e.apply(r||null,t||[])})}},{ticky:32}],9:[function(e,t){"use strict";var n=e("atoa"),r=e("./debounce");t.exports=function(e,t){var o=t||{},a={};return void 0===e&&(e={}),e.on=function(t,n){return a[t]?a[t].push(n):a[t]=[n],e},e.once=function(t,n){return n._once=!0,e.on(t,n),e},e.off=function(t,n){var r=arguments.length;if(1===r)delete a[t];else if(0===r)a={};else{var o=a[t];if(!o)return e;o.splice(o.indexOf(n),1)}return e},e.emit=function(){var t=n(arguments);return e.emitterSnapshot(t.shift()).apply(this,t)},e.emitterSnapshot=function(t){var i=(a[t]||[]).slice(0);return function(){var a=n(arguments),s=this||e;if("error"===t&&o["throws"]!==!1&&!i.length)throw 1===a.length?a[0]:a;return i.forEach(function(n){o.async?r(n,a,s):n.apply(s,a),n._once&&e.off(t,n)}),e}},e}},{"./debounce":8,atoa:1}],10:[function(e,t){(function(n){"use strict";function r(e,t,n,r){return e.addEventListener(t,n,r)}function o(e,t,n){return e.attachEvent("on"+t,l(e,t,n))}function a(e,t,n,r){return e.removeEventListener(t,n,r)}function i(e,t,n){return e.detachEvent("on"+t,u(e,t,n))}function s(e,t,n){function r(){var e;return g.createEvent?(e=g.createEvent("Event"),e.initEvent(t,!0,!0)):g.createEventObject&&(e=g.createEventObject()),e}function o(){return new d(t,{detail:n})}var a=-1===p.indexOf(t)?o():r();e.dispatchEvent?e.dispatchEvent(a):e.fireEvent("on"+t,a)}function c(e,t,r){return function(t){var o=t||n.event;o.target=o.target||o.srcElement,o.preventDefault=o.preventDefault||function(){o.returnValue=!1},o.stopPropagation=o.stopPropagation||function(){o.cancelBubble=!0},o.which=o.which||o.keyCode,r.call(e,o)}}function l(e,t,n){var r=u(e,t,n)||c(e,t,n);return v.push({wrapper:r,element:e,type:t,fn:n}),r}function u(e,t,n){var r=f(e,t,n);if(r){var o=v[r].wrapper;return v.splice(r,1),o}}function f(e,t,n){var r,o;for(r=0;r<v.length;r++)if(o=v[r],o.element===e&&o.type===t&&o.fn===n)return r}var d=e("custom-event"),p=e("./eventmap"),g=document,m=r,h=a,v=[];n.addEventListener||(m=o,h=i),t.exports={add:m,remove:h,fabricate:s}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./eventmap":11,"custom-event":12}],11:[function(e,t){(function(e){"use strict";var n=[],r="",o=/^on/;for(r in e)o.test(r)&&n.push(r.slice(2));t.exports=n}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],12:[function(e,t){(function(e){function n(){try{var e=new r("cat",{detail:{foo:"bar"}});return"cat"===e.type&&"bar"===e.detail.foo}catch(t){}return!1}var r=e.CustomEvent;t.exports=n()?r:"function"==typeof document.createEvent?function(e,t){var n=document.createEvent("CustomEvent");return t?n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail):n.initCustomEvent(e,!1,!1,void 0),n}:function(e,t){var n=document.createEventObject();return n.type=e,t?(n.bubbles=Boolean(t.bubbles),n.cancelable=Boolean(t.cancelable),n.detail=t.detail):(n.bubbles=!1,n.cancelable=!1,n.detail=void 0),n}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],13:[function(e,t){"use strict";var n=e("is-callable"),r=Object.prototype.toString,o=Object.prototype.hasOwnProperty,a=function(e,t,n){for(var r=0,a=e.length;a>r;r++)o.call(e,r)&&(null==n?t(e[r],r,e):t.call(n,e[r],r,e))},i=function(e,t,n){for(var r=0,o=e.length;o>r;r++)null==n?t(e.charAt(r),r,e):t.call(n,e.charAt(r),r,e)},s=function(e,t,n){for(var r in e)o.call(e,r)&&(null==n?t(e[r],r,e):t.call(n,e[r],r,e))},c=function(e,t,o){if(!n(t))throw new TypeError("iterator must be a function");var c;arguments.length>=3&&(c=o),"[object Array]"===r.call(e)?a(e,t,c):"string"==typeof e?i(e,t,c):s(e,t,c)};t.exports=c},{"is-callable":15}],14:[function(e,t){(function(e){var n;n="undefined"!=typeof window?window:"undefined"!=typeof e?e:"undefined"!=typeof self?self:{},t.exports=n}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],15:[function(e,t){"use strict";var n=Function.prototype.toString,r=/^\s*class\b/,o=function(e){try{var t=n.call(e);return r.test(t)}catch(o){return!1}},a=function(e){try{return o(e)?!1:(n.call(e),!0)}catch(t){return!1}},i=Object.prototype.toString,s="[object Function]",c="[object GeneratorFunction]",l="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;t.exports=function(e){if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if("function"==typeof e&&!e.prototype)return!0;if(l)return a(e);if(o(e))return!1;var t=i.call(e);return t===s||t===c}},{}],16:[function(e,t){function n(e){var t=r.call(e);return"[object Function]"===t||"function"==typeof e&&"[object RegExp]"!==t||"undefined"!=typeof window&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)}t.exports=n;var r=Object.prototype.toString},{}],17:[function(e,t){"use strict";function n(e){e?e in g&&(g[e]={}):g={}}function r(e,t,n,r){function o(t){var o=t.trim();0!==o.length&&e(g[a],o,n,r)}void 0===r&&(r=n,n={});var a=n.context||"defaults";r&&(void 0===g[a]&&(g[a]={}),t.toLowerCase().split(d).forEach(o))}function o(e,t,n){function o(e,t,n,r){var o={handle:r,filter:n.filter};e[t]?e[t].push(o):e[t]=[o]}r(o,e,t,n)}function a(e,t,n){function o(e,t,n,r){function o(e){return e.handle===r&&e.filter===n.filter}e[t]&&(e[t]=e[t].filter(o))}r(o,e,t,n)}function i(e){return e.which||e.keyCode||e.charCode}function s(e){var t=i(e),n=p[t]||String.fromCharCode(t);n&&l(n,e)}function c(e,t){var n=[e];return t.shiftKey&&n.unshift("shift"),t.altKey&&n.unshift("alt"),t.ctrlKey^t.metaKey&&n.unshift("cmd"),n.join("+").toLowerCase()}function l(e,t){function n(e){var n=e.filter;if(n){var r=t.target,o="string"==typeof n;if(o)return u.matchesSelector(r,n)===!1;for(;r.parentElement&&r!==n;)r=r.parentElement;return r!==n}}function r(e){n(e)||e.handle(t)}var o,a=c(e,t);for(o in g)g[o][a]&&g[o][a].forEach(r)}var u=e("sektor"),f=e("crossvent"),d=/\s+/g,p={13:"enter",27:"esc",32:"space"},g={};f.add(window,"keydown",s),t.exports={on:o,off:a,clear:n,handlers:g}},{crossvent:10,sektor:22}],18:[function(e,t){(function(n){"use strict";function r(e,t){return 1===arguments.length?o(e):a(e,t)}function o(e){return JSON.parse(u.getItem(e))}function a(e,t){try{return u.setItem(e,JSON.stringify(t)),!0}catch(n){return!1}}function i(e){return u.removeItem(e)}function s(){return u.clear()}var c=e("./stub"),l=e("./tracking"),u="localStorage"in n&&n.localStorage?n.localStorage:c;r.set=a,r.get=o,r.remove=i,r.clear=s,r.on=l.on,r.off=l.off,t.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./stub":19,"./tracking":20}],19:[function(e,t){"use strict";function n(e){return e in i?i[e]:null}function r(e,t){return i[e]=t,!0}function o(e){var t=e in i;return t?delete i[e]:!1}function a(){return i={},!0}var i={};t.exports={getItem:n,setItem:r,removeItem:o,clear:a}},{}],20:[function(e,t){(function(e){"use strict";function n(){e.addEventListener?e.addEventListener("storage",r,!1):e.attachEvent?e.attachEvent("onstorage",r):e.onstorage=r}function r(t){function n(e){e(JSON.parse(t.newValue),JSON.parse(t.oldValue),t.url||t.uri)}t||(t=e.event);var r=i[t.key];r&&r.forEach(n)}function o(e,t){i[e]?i[e].push(t):i[e]=[t],s===!1&&n()}function a(e,t){var n=i[e];n.length>1?n.splice(n.indexOf(t),1):i[e]=[]}var i={},s=!1;t.exports={on:o,off:a}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],21:[function(e,t){var n=e("trim"),r=e("for-each"),o=function(e){return"[object Array]"===Object.prototype.toString.call(e)};t.exports=function(e){if(!e)return{};var t={};return r(n(e).split("\n"),function(e){var r=e.indexOf(":"),a=n(e.slice(0,r)).toLowerCase(),i=n(e.slice(r+1));"undefined"==typeof t[a]?t[a]=i:o(t[a])?t[a].push(i):t[a]=[t[a],i]}),t}},{"for-each":13,trim:33}],22:[function(e,t){(function(e){"use strict";function n(e,t){var n,r,o,a,i,u=t!==l;u&&(n=t.getAttribute("id"),r=n||s,o="#"+r+" ",a=o+e.replace(/,/g,","+o),i=c.test(e)&&t.parentNode,n||t.setAttribute("id",r));try{return(i||t).querySelectorAll(a||e)}catch(f){return[]}finally{null===n&&t.removeAttribute("id")}}function r(e,t,r,o){var i,s=t||l,c=r||[],u=0;if("string"!=typeof e)return c;if(1!==s.nodeType&&9!==s.nodeType)return[];if(o)for(;i=o[u++];)a(i,e)&&c.push(i);else c.push.apply(c,n(e,s));return c}function o(e,t){return r(e,null,null,t)}function a(e,t){return f.call(e,t)}function i(){return!1}var s="sektor-"+Date.now(),c=/[+~]/,l=e.document,u=l&&l.documentElement||{},f=u.matches||u.webkitMatchesSelector||u.mozMatchesSelector||u.oMatchesSelector||u.msMatchesSelector||i;t.exports=r,r.matches=o,r.matchesSelector=a}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],23:[function(e,t){(function(n){"use strict";var r,o=n.document,a=e("./getSelectionRaw"),i=e("./getSelectionNullOp"),s=e("./getSelectionSynthetic"),c=e("./isHost");r=c.method(n,"getSelection")?a:"object"==typeof o.selection&&o.selection?s:i,t.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./getSelectionNullOp":24,"./getSelectionRaw":25,"./getSelectionSynthetic":26,"./isHost":27}],24:[function(e,t){"use strict";function n(){}function r(){return{removeAllRanges:n,addRange:n}}t.exports=r},{}],25:[function(e,t){(function(e){"use strict";function n(){return e.getSelection()}t.exports=n}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],26:[function(e,t){(function(n){"use strict";function r(e){var t=this,n=e.createRange();this._selection=e,this._ranges=[],"Control"===e.type?d(t):u(n)?f(t,n):s(t)}function o(e,t){for(var n,r=y.createControlRange(),o=0,a=t.length;a>o;++o){n=l(t[o]);try{r.add(n)}catch(i){throw new Error("setRanges(): Element could not be added to control selection")}}r.select(),d(e)}function a(e,t){var n=e.getAllRanges();e.removeAllRanges();for(var r=0,o=n.length;o>r;++r)g(t,n[r])||e.addRange(n[r]);e.rangeCount||s(e)}function i(e,t){var n="start",r="end";e.anchorNode=t[n+"Container"],e.anchorOffset=t[n+"Offset"],e.focusNode=t[r+"Container"],e.focusOffset=t[r+"Offset"]}function s(e){e.anchorNode=e.focusNode=null,e.anchorOffset=e.focusOffset=0,e.rangeCount=0,e.isCollapsed=!0,e._ranges.length=0}function c(e){if(!e.length||1!==e[0].nodeType)return!1;for(var t=1,n=e.length;n>t;++t)if(!m(e[0],e[t]))return!1;return!0}function l(e){var t=e.getNodes();if(!c(t))throw new Error("getSingleElementFromRange(): range did not consist of a single element");return t[0]}function u(e){return e&&void 0!==e.text}function f(e,t){e._ranges=[t],i(e,t,!1),e.rangeCount=1,e.isCollapsed=t.collapsed}function d(e){if(e._ranges.length=0,"None"===e._selection.type)s(e);else{var t=e._selection.createRange();if(u(t))f(e,t);else{e.rangeCount=t.length;for(var n,r=0;r<e.rangeCount;++r)n=w.createRange(),n.selectNode(t.item(r)),e._ranges.push(n);e.isCollapsed=1===e.rangeCount&&e._ranges[0].collapsed,i(e,e._ranges[e.rangeCount-1],!1)}}}function p(e,t){for(var n=e._selection.createRange(),r=l(t),o=y.createControlRange(),a=0,i=n.length;i>a;++a)o.add(n.item(a));try{o.add(r)}catch(s){throw new Error("addRange(): Element could not be added to control selection")}o.select(),d(e)}function g(e,t){return e.startContainer===t.startContainer&&e.startOffset===t.startOffset&&e.endContainer===t.endContainer&&e.endOffset===t.endOffset}function m(e,t){for(var n=t;n.parentNode;){if(n.parentNode===e)return!0;n=n.parentNode}return!1}function h(){return new r(n.document.selection)}var v=e("./rangeToTextRange"),w=n.document,y=w.body,b=r.prototype;b.removeAllRanges=function(){var e;try{this._selection.empty(),"None"!==this._selection.type&&(e=y.createTextRange(),e.select(),this._selection.empty())}catch(t){}s(this)},b.addRange=function(e){"Control"===this._selection.type?p(this,e):(v(e).select(),this._ranges[0]=e,this.rangeCount=1,this.isCollapsed=this._ranges[0].collapsed,i(this,e,!1))},b.setRanges=function(e){this.removeAllRanges();var t=e.length;t>1?o(this,e):t&&this.addRange(e[0])},b.getRangeAt=function(e){if(0>e||e>=this.rangeCount)throw new Error("getRangeAt(): index out of bounds");return this._ranges[e].cloneRange()},b.removeRange=function(e){if("Control"!==this._selection.type)return void a(this,e);for(var t,n=this._selection.createRange(),r=l(e),o=y.createControlRange(),i=!1,s=0,c=n.length;c>s;++s)t=n.item(s),t!==r||i?o.add(n.item(s)):i=!0;o.select(),d(this)},b.eachRange=function(e,t){var n=0,r=this._ranges.length;for(n=0;r>n;++n)if(e(this.getRangeAt(n)))return t},b.getAllRanges=function(){var e=[];return this.eachRange(function(t){e.push(t)}),e},b.setSingleRange=function(e){this.removeAllRanges(),this.addRange(e)},t.exports=h}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./rangeToTextRange":28}],27:[function(e,t){"use strict";function n(e,t){var n=typeof e[t];return"function"===n||!("object"!==n||!e[t])||"unknown"===n}function r(e,t){return"undefined"!=typeof e[t]}function o(e){return function(t,n){for(var r=n.length;r--;)if(!e(t,n[r]))return!1;return!0}}t.exports={method:n,methods:o(n),property:r,properties:o(r)}},{}],28:[function(e,t){(function(e){"use strict";function n(e){if(e.collapsed)return o({node:e.startContainer,offset:e.startOffset},!0);var t=o({node:e.startContainer,offset:e.startOffset},!0),n=o({node:e.endContainer,offset:e.endOffset},!1),r=i.createTextRange();return r.setEndPoint("StartToStart",t),r.setEndPoint("EndToEnd",n),r}function r(e){var t=e.nodeType;return 3===t||4===t||8===t}function o(e,t){var n,o,s,c,l=e.offset,u=i.createTextRange(),f=r(e.node);return f?(n=e.node,o=n.parentNode):(c=e.node.childNodes,n=l<c.length?c[l]:null,o=e.node),s=a.createElement("span"),s.innerHTML="&#feff;",n?o.insertBefore(s,n):o.appendChild(s),u.moveToElementText(s),u.collapse(!t),o.removeChild(s),f&&u[t?"moveStart":"moveEnd"]("character",l),u}var a=e.document,i=a.body;t.exports=n}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],29:[function(e,t){"use strict";var n=e("./getSelection"),r=e("./setSelection");t.exports={get:n,set:r}},{"./getSelection":23,"./setSelection":30}],30:[function(e,t){(function(n){"use strict";function r(e){function t(){var t=o(),n=i.createRange();e.startContainer&&(e.endContainer?n.setEnd(e.endContainer,e.endOffset):n.setEnd(e.startContainer,e.startOffset),n.setStart(e.startContainer,e.startOffset),t.removeAllRanges(),t.addRange(n))}function n(){a(e).select()}i.createRange?t():n()}var o=e("./getSelection"),a=e("./rangeToTextRange"),i=n.document;t.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./getSelection":23,"./rangeToTextRange":28}],31:[function(e,t){"use strict";function n(e){return{start:e.selectionStart,end:e.selectionEnd}}function r(e){function t(t,r){return n!==e&&(n?n.focus():e.blur()),{start:t,end:r}}var n=document.activeElement;n!==e&&e.focus();var r=document.selection.createRange(),i=r.getBookmark(),s=e.value,c=o(s),l=r.parentElement();if(null===l||!a(l))return t(0,0);r.text=c+r.text+c;var u=e.value;return e.value=s,r.moveToBookmark(i),r.select(),t(u.indexOf(c),u.lastIndexOf(c)-c.length)}function o(e){var t;do t="@@marker."+Math.random()*new Date;while(-1!==e.indexOf(t));return t}function a(e){return"INPUT"===e.tagName&&"text"===e.type||"TEXTAREA"===e.tagName}function i(e,t){e.selectionStart=c(e,t.start),e.selectionEnd=c(e,t.end)}function s(e,t){var n=e.createTextRange();"end"===t.start&&"end"===t.end?(n.collapse(!1),n.select()):(n.collapse(!0),n.moveEnd("character",c(e,t.end)),n.moveStart("character",c(e,t.start)),n.select())}function c(e,t){return"end"===t?e.value.length:t||0}function l(e,t){return 2===arguments.length&&f(e,t),u(e)}var u=n,f=i;document.selection&&document.selection.createRange&&(u=r,f=s),t.exports=l},{}],32:[function(e,t){var n,r="function"==typeof setImmediate;n=r?function(e){setImmediate(e)}:function(e){setTimeout(e,0)},t.exports=n},{}],33:[function(e,t,n){function r(e){return e.replace(/^\s*|\s*$/g,"")}n=t.exports=r,n.left=function(e){return e.replace(/^\s*/,"")},n.right=function(e){return e.replace(/\s*$/,"")}},{}],34:[function(e,t){"use strict";function n(e,t){for(var n=0;n<e.length;n++)t(e[n])}function r(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}function o(e,t,n){var r=e;return u(t)?(n=t,"string"==typeof e&&(r={uri:e})):r=d(t,{uri:e}),r.callback=n,r}function a(e,t,n){return t=o(e,t,n),i(t)}function i(e){function t(){4===d.readyState&&i()}function n(){var e=void 0;if(e=d.response?d.response:d.responseText||s(d),k)try{e=JSON.parse(e)}catch(t){}return e}function o(e){clearTimeout(m),e instanceof Error||(e=new Error(""+(e||"Unknown XMLHttpRequest Error"))),e.statusCode=0,l(e,u),l=c}function i(){if(!g){var t;clearTimeout(m),t=e.useXDR&&void 0===d.status?200:1223===d.status?204:d.status;var r=u,o=null;0!==t?(r={body:n(),statusCode:t,method:v,headers:{},url:h,rawRequest:d},d.getAllResponseHeaders&&(r.headers=f(d.getAllResponseHeaders()))):o=new Error("Internal XMLHttpRequest Error"),l(o,r,r.body),l=c}}var l=e.callback;if("undefined"==typeof l)throw new Error("callback argument missing");var u={body:void 0,headers:{},statusCode:0,method:v,url:h,rawRequest:d},d=e.xhr||null;d||(d=e.cors||e.useXDR?new a.XDomainRequest:new a.XMLHttpRequest);var p,g,m,h=d.url=e.uri||e.url,v=d.method=e.method||"GET",w=e.body||e.data||null,y=d.headers=e.headers||{},b=!!e.sync,k=!1;if("json"in e&&(k=!0,y.accept||y.Accept||(y.Accept="application/json"),"GET"!==v&&"HEAD"!==v&&(y["content-type"]||y["Content-Type"]||(y["Content-Type"]="application/json"),w=JSON.stringify(e.json))),d.onreadystatechange=t,d.onload=i,d.onerror=o,d.onprogress=function(){},d.ontimeout=o,d.open(v,h,!b,e.username,e.password),b||(d.withCredentials=!!e.withCredentials),!b&&e.timeout>0&&(m=setTimeout(function(){g=!0,d.abort("timeout");var e=new Error("XMLHttpRequest timeout");e.code="ETIMEDOUT",o(e)},e.timeout)),d.setRequestHeader)for(p in y)y.hasOwnProperty(p)&&d.setRequestHeader(p,y[p]);else if(e.headers&&!r(e.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in e&&(d.responseType=e.responseType),"beforeSend"in e&&"function"==typeof e.beforeSend&&e.beforeSend(d),d.send(w),d}function s(e){if("document"===e.responseType)return e.responseXML;var t=204===e.status&&e.responseXML&&"parsererror"===e.responseXML.documentElement.nodeName;return""!==e.responseType||t?null:e.responseXML}function c(){}var l=e("global/window"),u=e("is-function"),f=e("parse-headers"),d=e("xtend");t.exports=a,a.XMLHttpRequest=l.XMLHttpRequest||c,a.XDomainRequest="withCredentials"in new a.XMLHttpRequest?a.XMLHttpRequest:l.XDomainRequest,n(["get","put","post","patch","head","delete"],function(e){a["delete"===e?"del":e]=function(t,n,r){return n=o(t,n,r),n.method=e.toUpperCase(),i(n)}})},{"global/window":14,"is-function":16,"parse-headers":21,xtend:35}],35:[function(e,t){function n(){for(var e={},t=0;t<arguments.length;t++){var n=arguments[t];for(var o in n)r.call(n,o)&&(e[o]=n[o])}return e}t.exports=n;var r=Object.prototype.hasOwnProperty},{}],36:[function(e,t){"use strict";function n(e,t){function n(e){var t=l(a);s.add(e,"keypress",i),s.add(e,"keydown",l(r)),s.add(e,"keydown",l(o)),s.add(e,"mousedown",c),e.onpaste=t,e.ondrop=t}function c(){u.setMode("moving")}function l(e){return function(t){return e.call(null,u,t)}}var u=this;u.inputMode=t,u.surface=e,u.reset(),n(e.textarea),n(e.editable)}function r(e,t){var n=!1,r=t.charCode||t.keyCode,o=String.fromCharCode(r);if(t.ctrlKey||t.metaKey)switch(o.toLowerCase()){case"y":e.redo(),n=!0;break;case"z":t.shiftKey?e.redo():e.undo(),n=!0}n&&t.preventDefault&&t.preventDefault()}function o(e,t){if(!t.ctrlKey&&!t.metaKey){var n=t.keyCode;n>=33&&40>=n||n>=63232&&63235>=n?e.setMode("moving"):8===n||46===n||127===n?e.setMode("deleting"):13===n?e.setMode("newlines"):27===n?e.setMode("escape"):(16>n||n>20)&&91!==n&&e.setMode("typing")}}function a(e){e.inputState&&e.inputState.text!==e.surface.read(e.inputMode)&&null===e.refreshing&&(e.historyMode="paste",e.saveState(),e.refreshState())}function i(e){var t=e.charCode||e.keyCode,n=89===t||90===t,r=e.ctrlKey||e.metaKey;r&&n&&e.preventDefault()}var s=e("crossvent"),c=e("./InputState");n.prototype.setInputMode=function(e){var t=this;t.inputMode=e,t.reset()},n.prototype.reset=function(){var e=this;return e.inputState=null,e.lastState=null,e.history=[],e.historyPointer=0,e.historyMode="none",e.refreshing=null,e.refreshState(!0),e.saveState(),e},n.prototype.setCommandMode=function(){var e=this;e.historyMode="command",e.saveState(),e.refreshing=setTimeout(function(){e.refreshState()},0)},n.prototype.canUndo=function(){return this.historyPointer>1},n.prototype.canRedo=function(){return this.history[this.historyPointer+1]},n.prototype.undo=function(){var e=this;e.canUndo()&&(e.lastState?(e.lastState.restore(),e.lastState=null):(e.history[e.historyPointer]=new c(e.surface,e.inputMode),e.history[--e.historyPointer].restore())),e.historyMode="none",e.surface.focus(e.inputMode),e.refreshState()},n.prototype.redo=function(){var e=this;e.canRedo()&&e.history[++e.historyPointer].restore(),e.historyMode="none",e.surface.focus(e.inputMode),e.refreshState()},n.prototype.setMode=function(e){var t=this;t.historyMode!==e&&(t.historyMode=e,t.saveState()),t.refreshing=setTimeout(function(){t.refreshState()},1)},n.prototype.refreshState=function(e){var t=this;t.inputState=new c(t.surface,t.inputMode,e),t.refreshing=null},n.prototype.saveState=function(){var e=this,t=e.inputState||new c(e.surface,e.inputMode);return"moving"===e.historyMode?void(e.lastState||(e.lastState=t)):(e.lastState&&(e.history[e.historyPointer-1].text!==e.lastState.text&&(e.history[e.historyPointer++]=e.lastState),e.lastState=null),e.history[e.historyPointer++]=t,void(e.history[e.historyPointer+1]=null))},t.exports=n},{"./InputState":37,crossvent:10}],37:[function(e,t){(function(n){"use strict";function r(e,t,n){this.mode=t,this.surface=e,this.initialState=n||!1,this.init()}var o=n.document,a=e("./isVisibleElement"),i=e("./fixEOL"),s=e("./markdown/MarkdownChunks"),c=e("./html/HtmlChunks"),l={markdown:s,html:c,wysiwyg:c};r.prototype.init=function(){var e=this,t=e.surface.current(e.mode);a(t)&&(this.initialState||!o.activeElement||o.activeElement===t)&&(e.surface.readSelection(e),e.scrollTop=t.scrollTop,e.text||(e.text=e.surface.read(e.mode)))},r.prototype.select=function(){var e=this,t=e.surface.current(e.mode);a(t)&&e.surface.writeSelection(e)},r.prototype.restore=function(){var e=this,t=e.surface.current(e.mode);"string"==typeof e.text&&e.text!==e.surface.read(e.mode)&&e.surface.write(e.mode,e.text),e.select(),t.scrollTop=e.scrollTop},r.prototype.getChunks=function(){var e=this,t=new l[e.mode];return t.before=i(e.text.substring(0,e.start)),t.startTag="",t.selection=i(e.text.substring(e.start,e.end)),t.endTag="",t.after=i(e.text.substring(e.end)),t.scrollTop=e.scrollTop,e.cachedChunks=t,t},r.prototype.setChunks=function(e){var t=this;e.before=e.before+e.startTag,e.after=e.endTag+e.after,t.start=e.before.length,t.end=e.before.length+e.selection.length,t.text=e.before+e.selection+e.after,t.scrollTop=e.scrollTop},t.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./fixEOL":44,"./html/HtmlChunks":48,"./isVisibleElement":57,"./markdown/MarkdownChunks":59}],38:[function(e,t){"use strict";function n(e,t,n){function a(e){return function(){r.fabricate(e,"click")}}function i(e,t){o[e].boldOrItalic(t,"bold")}function s(e,t){o[e].boldOrItalic(t,"italic")}function c(e,n){o[e].codeblock(n,{fencing:t.fencing})}function l(e,t){o[e].list(t,!1)}function u(e,t){o[e].list(t,!0)}function f(r,a){return function(i,s){o[i].linkOrImageOrAttachment.call(this,s,{editor:n,mode:i,type:r,surface:e,prompts:t.prompts,upload:t[r+"s"],classes:t.classes,mergeHtmlAndAttachment:t.mergeHtmlAndAttachment||p,autoUpload:a})}}function d(e,t,r){return n.addCommandButton(e,t,h(r))}function p(e,t){var n=e.selection||t.title;return{before:e.before,selection:'<a href="'+t.href+'">'+n+"</a>",after:e.after}}function g(e){return function(t,n){o[t][e].call(this,n)}}function m(e){e.preventDefault(),e.stopPropagation()}function h(e){return function(t,n,r){m(t),e.call(this,n,r)}}d("bold","cmd+b",i),d("italic","cmd+i",s),d("quote","cmd+j",g("blockquote")),d("code","cmd+e",c),d("ol","cmd+o",u),d("ul","cmd+u",l),d("heading","cmd+d",g("heading")),n.showLinkDialog=a(d("link","cmd+k",f("link"))),n.showImageDialog=a(d("image","cmd+g",f("image"))),n.linkOrImageOrAttachment=f,t.attachments&&(n.showAttachmentDialog=a(d("attachment","cmd+shift+k",f("attachment")))),t.hr&&d("hr","cmd+n",g("hr"))
}var r=e("crossvent"),o={markdown:{boldOrItalic:e("./markdown/boldOrItalic"),linkOrImageOrAttachment:e("./markdown/linkOrImageOrAttachment"),blockquote:e("./markdown/blockquote"),codeblock:e("./markdown/codeblock"),heading:e("./markdown/heading"),list:e("./markdown/list"),hr:e("./markdown/hr")},html:{boldOrItalic:e("./html/boldOrItalic"),linkOrImageOrAttachment:e("./html/linkOrImageOrAttachment"),blockquote:e("./html/blockquote"),codeblock:e("./html/codeblock"),heading:e("./html/heading"),list:e("./html/list"),hr:e("./html/hr")}};o.wysiwyg=o.html,t.exports=n},{"./html/blockquote":49,"./html/boldOrItalic":50,"./html/codeblock":51,"./html/heading":52,"./html/hr":53,"./html/linkOrImageOrAttachment":54,"./html/list":55,"./markdown/blockquote":60,"./markdown/boldOrItalic":61,"./markdown/codeblock":62,"./markdown/heading":63,"./markdown/hr":64,"./markdown/linkOrImageOrAttachment":65,"./markdown/list":66,crossvent:10}],39:[function(e,t){"use strict";function n(e){var t,n=[],r=e.length;for(t=0;r>t;t++)n.push(e[t]);return n}t.exports=n},{}],40:[function(e,t){"use strict";function n(e){function t(e,t,n){var s=t.replace(/\?.*$/,r);return s=decodeURIComponent(s),s=encodeURI(s).replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29"),s=s.replace(/\?.*$/,o),{href:i(s),title:a(n)}}return t.apply(null,e.match(s))}function r(e){return e.replace(/\+/g," ")}function o(e){return e.replace(/\+/g,"%2b")}function a(e){return e?e.replace(/^\s+|\s+$/g,"").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;"):null}function i(e){var t=e.replace(/^\s+|\s+$/g,"");return t.length&&"/"!==t[0]&&!c.test(t)?"http://"+t:t}var s=/^\s*(.*?)(?:\s+"(.+)")?\s*$/,c=/^(?:https?|ftp):\/\//;t.exports=n},{}],41:[function(e,t){"use strict";function n(e){function t(e){return r.before+=e,""}function n(e){return r.after=e+r.after,""}var r=this;e&&(t=n=""),r.selection=r.selection.replace(/^(\s*)/,t).replace(/(\s*)$/,n)}t.exports=n},{}],42:[function(e,t){"use strict";function n(e,t){var n=e.className;-1===n.indexOf(t)&&(e.className=(n+" "+t).replace(o,""))}function r(e,t){e.className=e.className.replace(t,"").replace(o,"").replace(a," ")}var o=/^\s+|\s+$/g,a=/\s+/g;t.exports={add:n,rm:r}},{}],43:[function(e,t){"use strict";function n(e,t,n){function r(e,t){return o=t,""}var o,a=e.toString();return a=a.replace(/\/([gim]*)$/,r),a=a.replace(/(^\/|\/$)/g,""),a=t+a+n,new RegExp(a,o)}t.exports=n},{}],44:[function(e,t){"use strict";function n(e){return e.replace(/\r\n/g,"\n").replace(/\r/g,"\n")}t.exports=n},{}],45:[function(e,t){"use strict";function n(e,t,n){return function(o){function a(){return l.immediate=!1,i}function i(){e.focus(t.inputMode),s.setChunks(c),s.restore()}e.focus(t.inputMode),t.setCommandMode();var s=new r(e,t.inputMode),c=s.getChunks(),l={async:a,immediate:!0};n.call(l,o,t.inputMode,c),l.immediate&&i()}}var r=e("./InputState");t.exports=n},{"./InputState":37}],46:[function(e,t){(function(n){"use strict";function r(e,t,n){function r(e){a(e).focus()}function a(n){return"wysiwyg"===n?t:e}function p(n){return"wysiwyg"===n?t.innerHTML:e.value}function g(n,r){"wysiwyg"===n?t.innerHTML=r:e.value=r}function m(e){"wysiwyg"===e.mode?b(e):v(e)}function h(e){"wysiwyg"===e.mode?k(e):w(e)}function v(t){var n;if(void 0!==e.selectionStart)e.focus(),e.selectionStart=t.start,e.selectionEnd=t.end,e.scrollTop=t.scrollTop;else if(o.selection){if(o.activeElement&&o.activeElement!==e)return;e.focus(),n=e.createTextRange(),n.moveStart("character",-e.value.length),n.moveEnd("character",-e.value.length),n.moveEnd("character",t.end),n.moveStart("character",t.start),n.select()}}function w(t){void 0!==e.selectionStart?(t.start=e.selectionStart,t.end=e.selectionEnd):o.selection&&y(t)}function y(t){if(!o.activeElement||o.activeElement===e){t.text=i(e.value);var n=o.selection.createRange(),r=i(n.text),a="",c=a+r+a;n.text=c;var l=i(e.value);n.moveStart("character",-c.length),n.text=r,t.start=l.indexOf(a),t.end=l.lastIndexOf(a)-a.length;var u=t.text.length-i(e.value).length;u&&(n.moveStart("character",-r.length),r+=s("\n",u),t.end+=u,n.text=r),t.select()}}function b(e){function n(e,t){function n(e){return Math.max(0,Math.min(s,e))}var r=e.text.length,s=T(t).length,c=r+s;!i.startContainer&&c>=o&&(i.startContainer=t,i.startOffset=n(o-r)),!i.endContainer&&c>=a&&(i.endContainer=t,i.endOffset=n(a-r))}var r=e.cachedChunks||e.getChunks(),o=r.before.length,a=o+r.selection.length,i={};x(t.firstChild,n),t.focus(),u(i)}function k(e){function n(e,t){t===r.anchorNode&&(e.start=e.text.length+r.anchorOffset),t===r.focusNode&&(e.end=e.text.length+r.focusOffset)}var r=l(),o=x(t.firstChild,n),a=o.start||0,i=o.end||0;e.text=o.text,i>a?(e.start=a,e.end=i):(e.start=i,e.end=a)}function x(e,t,n,r){function o(e){x(e,t,a,!1)}var a=n||{text:""};if(!e)return a;var i=1===e.nodeType,s=3===e.nodeType;return t(a,e),s&&(a.text+=T(e)),i&&(e.outerHTML.match(f)&&(a.text+=RegExp.$1),c(e.childNodes).forEach(o),e.outerHTML.match(d)&&(a.text+=RegExp.$1)),r!==!1&&e.nextSibling?x(e.nextSibling,t,a):a}function T(e){return 3===e.nodeType?i(e.textContent||e.innerText||""):""}return{textarea:e,editable:t,droparea:n,focus:r,read:p,write:g,current:a,writeSelection:m,readSelection:h}}var o=n.document,a=e("seleccion"),i=e("./fixEOL"),s=e("./many"),c=e("./cast"),l=a.get,u=a.set,f=/^(<[^>]+(?: [^>]*)?>)/,d=/(<\/[^>]+>)$/;t.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./cast":39,"./fixEOL":44,"./many":58,seleccion:29}],47:[function(e,t){"use strict";function n(e){return e.innerText||e.textContent}t.exports=n},{}],48:[function(e,t){"use strict";function n(){}var r=e("../chunks/trim");n.prototype.trim=r,n.prototype.findTags=function(){},n.prototype.skip=function(){},t.exports=n},{"../chunks/trim":41}],49:[function(e,t){"use strict";function n(e){o("blockquote",r.placeholders.quote,e)}var r=e("../strings"),o=e("./wrapping");t.exports=n},{"../strings":76,"./wrapping":56}],50:[function(e,t){"use strict";function n(e,t){o("bold"===t?"strong":"em",r.placeholders[t],e)}var r=e("../strings"),o=e("./wrapping");t.exports=n},{"../strings":76,"./wrapping":56}],51:[function(e,t){"use strict";function n(e){o("pre><code",r.placeholders.code,e)}var r=e("../strings"),o=e("./wrapping");t.exports=n},{"../strings":76,"./wrapping":56}],52:[function(e,t){"use strict";function n(e){function t(){var t=parseInt(s[1],10),n=1>=t?4:t-1;e.before=e.before.replace(o,"<h"+n+">"),e.after=e.after.replace(a,"</h"+n+">")}function n(){e.selection||(e.selection=r.placeholders.heading),e.before+="<h1>",e.after="</h1>"+e.after}e.trim();var i=a.exec(e.after),s=o.exec(e.before);s&&i&&s[1]===i[1]?t():n()}var r=e("../strings"),o=/<h([1-6])( [^>]*)?>$/,a=/^<\/h([1-6])>/;t.exports=n},{"../strings":76}],53:[function(e,t){"use strict";function n(e){e.before+="\n<hr>\n",e.selection=""}t.exports=n},{}],54:[function(e,t){"use strict";function n(e,t){function n(){if(p){if(l.test(e.selection))return e.selection="",!0}else if(c.exec(e.after)&&s.exec(e.before))return e.before=e.before.replace(s,""),e.after=e.after.replace(c,""),!0}function u(n){function o(e){return e.href.length>0}function s(e){return e.title?' title="'+e.title+'"':""}function c(t,n){function r(e){return'<img src="'+e.href+'" alt="'}function o(e){return'"'+s(e)+" />"}function a(e){return" "+r(e)+o(e)}var i=e.after;e.before+=r(t),e.after=o(t),n.length&&(e.after+=n.map(a).join("")),e.after+=i}function l(n,r){function o(e){return'<a href="'+e.href+'"'+s(e)+u+">"}function a(){return"</a>"}function i(e){return" "+o(e)+a()}var c=e.after,l=t.classes.input.links,u=l?' class="'+l+'"':"";e.before+=o(n),e.after=a(),r.length&&(e.after+=r.map(i).join("")),e.after+=c}var u,g=n.definitions.map(i).filter(o);if(0===g.length)return void f();var m=g[0];return"attachment"===d?(u=t.mergeHtmlAndAttachment(e,m),e.before=u.before,e.selection=u.selection,e.after=u.after,f(),void r.fabricate(t.surface.textarea,"woofmark-mode-change")):(p?c(m,g.slice(1)):l(m,g.slice(1)),e.selection||(e.selection=a.placeholders[d]),void f())}var f,d=t.type,p="image"===d;"attachment"!==d&&e.trim(),n()||(f=this.async(),t.prompts.close(),(t.prompts[d]||t.prompts.link)(t,o(u)))}var r=e("crossvent"),o=e("../once"),a=e("../strings"),i=e("../chunks/parseLinkInput"),s=/<a( [^>]*)?>$/,c=/^<\/a>/,l=/<img( [^>]*)?\/>$/;t.exports=n},{"../chunks/parseLinkInput":40,"../once":69,"../strings":76,crossvent:10}],55:[function(e,t){"use strict";function n(e,t){function n(t){var n=t?"":u,o=t?"":f;e.before+=n+"<li>",e.after="</li>"+o+e.after,e.selection||(e.selection=r.placeholders.listitem)}var l=t?"ol":"ul",u="<"+l+">",f="</"+l+">";if(e.trim(),o.test(e.before)&&a.test(e.after)&&l===RegExp.$1)return e.before=e.before.replace(o,""),void(e.after=e.after.replace(a,""));var d=e.before.lastIndexOf("<ul"),p=e.before.lastIndexOf("<ol"),g=e.after.indexOf("</ul>");if(-1===g&&(g=e.after.indexOf("</ol>")),-1===g)return void n();var m=d>p?d:p;if(-1===m)return void n();var h=e.before.indexOf(">",m);if(-1===h)return void n();var v=e.before.substr(m,h-m+1);c.test(v)&&(l!==RegExp.$1?(e.before=e.before.substr(0,m)+"<"+l+e.before.substr(m+3),e.after=e.after.substr(0,g)+"</"+l+e.after.substr(g+4)):i.test(e.before)&&s.test(e.after)?(e.before=e.before.replace(i,""),e.after=e.after.replace(s,"")):n(!0))}var r=e("../strings"),o=/<(ul|ol)( [^>]*)?>\s*<li( [^>]*)?>$/,a=/^<\/li>\s*<\/(ul|ol)>/,i=/<li( [^>]*)?>$/,s=/^<\/li( [^>]*)?>/,c=/^<(ul|ol)( [^>]*)?>$/;t.exports=n},{"../strings":76}],56:[function(e,t){"use strict";function n(e,t,n){function a(){n.selection.replace(/<(\/)?([^> ]+)( [^>]*)?>/gi,i)}function i(e,t,r,o,a){var i=o||"",s=!t,c=new RegExp("</"+r.replace(/</g,"</")+">","i"),l=new RegExp("<"+r+"( [^>]*)?>","i");s&&!c.test(n.selection.substr(a))&&(n.selection+="</"+r+">",n.after=n.after.replace(/^(<\/[^>]+>)/,"$1<"+r+i+">")),t&&!l.test(n.selection.substr(0,a))&&(n.selection="<"+r+i+">"+n.selection,n.before=n.before.replace(/(<[^>]+(?: [^>]*)?>)$/,"</"+r+">$1"))}var s="<"+e,c="</"+e.replace(/</g,"</"),l=new RegExp(s+"( [^>]*)?>$","i"),u=new RegExp("^"+c+">","i"),f=new RegExp(s+"( [^>]*)?>","ig"),d=new RegExp(c+"( [^>]*)?>","ig");n.trim();var p=u.exec(n.after),g=l.exec(n.before);if(g&&p)n.before=n.before.replace(l,""),n.after=n.after.replace(u,"");else{n.selection||(n.selection=t);var m=f.test(n.selection);m&&(n.selection=n.selection.replace(f,""),o(n,e)||(n.before+=s+">"));var h=d.test(n.selection);if(h&&(n.selection=n.selection.replace(d,""),o(n,e)||(n.after=c+">"+n.after)),m||h)return void a();o(n,e)?(l.test(n.before)?n.before=n.before.replace(l,""):n.before+=c+">",n.after=u.test(n.after)?n.after.replace(u,""):s+">"+n.after):r(n,e)||(n.after=c+">"+n.after,n.before+=s+">"),a()}}function r(e,t){var n=new RegExp("</"+t.replace(/</g,"</")+">$","i"),r=new RegExp("^<"+t+"(?: [^>]*)?>","i"),o=n.test(e.before)&&r.test(e.after);return o&&(e.before=e.before.replace(n,""),e.after=e.after.replace(r,"")),o}function o(e,t){function n(e,t){var n=e.match(t);return n?n.length:0}var r=new RegExp("<"+t+"(?: [^>]*)?>","ig"),o=new RegExp("</"+t.replace(/</g,"</")+">","ig"),a=n(e.before,r),i=n(e.after,r),s=n(e.before,o),c=n(e.after,o),l=a-s>0,u=c-i>0;return l&&u}t.exports=n},{}],57:[function(e,t){(function(e){"use strict";function n(t){return e.getComputedStyle?"none"!==e.getComputedStyle(t,null).getPropertyValue("display"):t.currentStyle?"none"!==t.currentStyle.display:void 0}t.exports=n}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],58:[function(e,t){"use strict";function n(e,t){return new Array(t+1).join(e)}t.exports=n},{}],59:[function(e,t){"use strict";function n(){}var r=e("../many"),o=e("../extendRegExp"),a=e("../chunks/trim");n.prototype.trim=a,n.prototype.findTags=function(e,t){function n(e){return i.startTag=i.startTag+e,""}function r(e){return i.endTag=e+i.endTag,""}var a,i=this;e&&(a=o(e,"","$"),this.before=this.before.replace(a,n),a=o(e,"^",""),this.selection=this.selection.replace(a,n)),t&&(a=o(t,"","$"),this.selection=this.selection.replace(a,r),a=o(t,"^",""),this.after=this.after.replace(a,r))},n.prototype.skip=function(e){function t(e,t,o){var a=n.any?"\\n*":r("\\n?",t),i=r("\n",t);return e.replace(new RegExp(a+o),i)}var n=e||{},o="before"in n?n.before:1,a="after"in n?n.after:1;this.selection=this.selection.replace(/(^\n*)/,""),this.startTag=this.startTag+RegExp.$1,this.selection=this.selection.replace(/(\n*$)/,""),this.endTag=this.endTag+RegExp.$1,this.startTag=this.startTag.replace(/(^\n*)/,""),this.before=this.before+RegExp.$1,this.endTag=this.endTag.replace(/(\n*$)/,""),this.after=this.after+RegExp.$1,this.before&&(this.before=t(this.before,++o,"$")),this.after&&(this.after=t(this.after,++a,""))},t.exports=n},{"../chunks/trim":41,"../extendRegExp":43,"../many":58}],60:[function(e,t){"use strict";function n(e){function t(t,n,r,o){return e.before+=n,e.after=o+e.after,r}function n(t,n){return e.selection=n+e.selection,""}function d(t,n){return e.startTag+=n,""}function p(){for(var t,n=e.before.replace(/\n$/,"").split("\n"),r=!1,o=0;o<n.length;o++)t=!1,h=n[o],r=r&&h.length>0,/^>/.test(h)?(t=!0,!r&&h.length>1&&(r=!0)):t=/^[ \t]*$/.test(h)?!0:r,t?v+=h+"\n":(w+=v+h,v="\n");/(^|\n)>/.test(v)||(w+=v,v="")}function g(t){return e.endTag=t,""}function m(t){function n(e,t){return"\n"+t.replace(/^[ ]{0,3}>?[ \t]*$/gm,r)+"\n"}var r=t?"> ":"";e.startTag&&(e.startTag=e.startTag.replace(f,n)),e.endTag&&(e.endTag=e.endTag.replace(u,n))}var h,v="",w="";e.selection=e.selection.replace(c,t),e.before=e.before.replace(i,n),e.selection=e.selection.replace(/^(\s|>)+$/,""),e.selection=e.selection||r.placeholders.quote,e.before&&p(),e.startTag=v,e.before=w,e.after&&(e.after=e.after.replace(/^\n?/,"\n")),e.after=e.after.replace(l,g),/^(?![ ]{0,3}>)/m.test(e.selection)?(o.wrap(e,a.lineLength-2),e.selection=e.selection.replace(/^/gm,"> "),m(!0),e.skip()):(e.selection=e.selection.replace(/^[ ]{0,3}> ?/gm,""),o.unwrap(e),m(!1),!/^(\n|^)[ ]{0,3}>/.test(e.selection)&&e.startTag&&(e.startTag=e.startTag.replace(/\n{0,2}$/,"\n\n")),!/(\n|^)[ ]{0,3}>.*$/.test(e.selection)&&e.endTag&&(e.endTag=e.endTag.replace(/^\n{0,2}/,"\n\n"))),/\n/.test(e.selection)||(e.selection=e.selection.replace(s,d))}var r=e("../strings"),o=e("./wrapping"),a=e("./settings"),i=/(>[ \t]*)$/,s=/^(>[ \t]*)/,c=/^(\n*)([^\r]+?)(\n*)$/,l=/^(((\n|^)(\n[ \t]*)*>(.+\n)*.*)+(\n[ \t]*)*)/,u=/^\n((>|\s)*)\n/,f=/\n((>|\s)*)\n$/;t.exports=n},{"../strings":76,"./settings":67,"./wrapping":68}],61:[function(e,t){"use strict";function n(e,t){var n=/\n{2,}/g,s="bold"===t?2:1;e.trim(),e.selection=e.selection.replace(n,"\n");var c,l=o.exec(e.before)[0],u=r.exec(e.after)[0],f="\\*{"+s+"}",d=Math.min(l.length,u.length);d>=s&&(2!==d||1!==s)?(e.before=e.before.replace(new RegExp(f+"$",""),""),e.after=e.after.replace(new RegExp("^"+f,""),"")):!e.selection&&u?(e.after=e.after.replace(r,""),e.before=e.before.replace(a,"")+u+RegExp.$1):(e.selection||u||(e.selection=i.placeholders[t]),c=1===s?"*":"**",e.before=e.before+c,e.after=c+e.after)}var r=/^(\**)/,o=/(\**$)/,a=/(\s?)$/,i=e("../strings");t.exports=n},{"../strings":76}],62:[function(e,t){"use strict";function n(e,t){function n(){e.trim(),e.findTags(s,s),e.startTag||e.endTag?e.endTag&&!e.startTag?(e.before+=e.endTag,e.endTag=""):e.startTag=e.endTag="":(e.startTag=e.endTag="`",e.selection||(e.selection=r.placeholders.code))}function d(n){function o(t){return e.selection=t+e.selection,""}return n?(e.before=e.before.replace(c,""),void(e.after=e.after.replace(u,""))):(e.before=e.before.replace(/[ ]{4}|```[a-z]*\n$/,o),e.skip({before:/(\n|^)(\t|[ ]{4,}|```[a-z]*\n).*\n$/.test(e.before)?0:1,after:/^\n(\t|[ ]{4,}|\n```)/.test(e.after)?0:1}),void(e.selection?l.test(e.selection)&&f.test(e.selection)?e.selection=e.selection.replace(/(^```[a-z]*\n)|(```$)/g,""):/^[ ]{0,3}\S/m.test(e.selection)?t.fencing?(e.before+="```\n",e.after="\n```"+e.after):p?e.selection=e.selection.replace(/^/gm,"    "):e.before+="    ":e.selection=e.selection.replace(/^(?:[ ]{4}|[ ]{0,3}\t|```[a-z]*)/gm,""):(t.fencing?(e.startTag="```\n",e.endTag="\n```"):e.startTag="    ",e.selection=r.placeholders.code)))}var p=i.test(e.selection),g=a.test(e.after),m=o.test(e.before),h=c.test(e.before)&&u.test(e.after);h||p||!m&&!g?d(h):n()}var r=e("../strings"),o=/\S[ ]*$/,a=/^[ ]*\S/,i=/\n/,s=/`/,c=/```[a-z]*\n?$/,l=/^```[a-z]*\n/,u=/^\n?```/,f=/\n```$/;t.exports=n},{"../strings":76}],63:[function(e,t){"use strict";function n(e){var t=0;if(e.selection=e.selection.replace(/\s+/g," ").replace(/(^\s+|\s+$)/g,""),!e.selection)return e.startTag="# ",e.selection=o.placeholders.heading,e.endTag="",void e.skip({before:1,after:1});e.findTags(/#+[ ]*/,/[ ]*#+/),/#+/.test(e.startTag)&&(t=RegExp.lastMatch.length),e.startTag=e.endTag="",e.findTags(null,/\s?(-+|=+)/),/=+/.test(e.endTag)&&(t=1),/-+/.test(e.endTag)&&(t=2),e.startTag=e.endTag="",e.skip({before:1,after:1});var n=2>t?4:t-1;n>0&&(e.startTag=r("#",n)+" ")}var r=e("../many"),o=e("../strings");t.exports=n},{"../many":58,"../strings":76}],64:[function(e,t){"use strict";function n(e){e.startTag="----------\n",e.selection="",e.skip({left:2,right:1,any:!0})}t.exports=n},{}],65:[function(e,t){"use strict";function n(e,t){function n(e,n,r,o,a){return t[n]=e.replace(/\s*$/,""),o?(t[n]=e.replace(/["(](.+?)[")]$/,""),o+a):""}return c.lastIndex=0,e.replace(c,n)}function r(e){function t(e){l.test(e)&&r(f[e])}function r(e){u++,e=e.replace(/^[ ]{0,3}\[(attachment-)?(\d+)\]:/,"  [$1"+u+"]:"),d.push(e)}function o(e,t,n,a,i,s){return n=n.replace(c,o),f[i]?(r(f[i]),t+n+a+u+s):e}var a=e.chunks,i=e.definition,s=e.attachment,c=/(\[)((?:\[[^\]]*\]|[^\[\]])*)(\][ ]?(?:\n[ ]*)?\[)((?:attachment-)?\d+)(\])/g,u=0,f={},d=[];a.before=n(a.before,f),a.selection=n(a.selection,f),a.after=n(a.after,f),a.before=a.before.replace(c,o),i?s||r(i):a.selection=a.selection.replace(c,o);var p=u;return a.after=a.after.replace(c,o),a.after&&(a.after=a.after.replace(/\n*$/,"")),a.after||(a.selection=a.selection.replace(/\n*$/,"")),u=0,Object.keys(f).forEach(t),s&&r(i),a.after+="\n\n"+d.join("\n"),p}function o(e,t){function n(t){function n(n,o){function a(){e.startTag=l?"![":"[",e.endTag="]["+d+"]",e.selection||(e.selection=i.placeholders[c]),o<u.length-1&&(e.before+=e.startTag+e.selection+e.endTag+"\n")}e.selection=(" "+e.selection).replace(/([^\\](?:\\\\)*)(?=[[\]])/g,"$1\\").substr(1);var s=t.attachment?"  [attachment-9999]: ":" [9999]: ",f=s+n.href+(n.title?' "'+n.title+'"':""),d=r({chunks:e,definition:f,attachment:t.attachment});t.attachment||a()}function a(e){return e.href.length>0}var u=t.definitions.map(s).filter(a);u.forEach(n),o()}var o,c=t.type,l="image"===c;return e.trim(),e.findTags(/\s*!?\[/,/\][ ]?(?:\n[ ]*)?(\[.*?\])?/),e.endTag.length>1&&e.startTag.length>0?(e.startTag=e.startTag.replace(/!?\[/,""),e.endTag="",void r({chunks:e})):(e.selection=e.startTag+e.selection+e.endTag,e.startTag=e.endTag="",/\n\n/.test(e.selection)?void r({chunks:e}):(o=this.async(),t.prompts.close(),void(t.prompts[c]||t.prompts.link)(t,a(n))))}var a=e("../once"),i=e("../strings"),s=e("../chunks/parseLinkInput"),c=/^[ ]{0,3}\[((?:attachment-)?\d+)\]:[ \t]*\n?[ \t]*<?(\S+?)>?[ \t]*\n?[ \t]*(?:(\n*)["(](.+?)[")][ \t]*)?(?:\n+|$)/gm,l=/^attachment-(\d+)$/i;t.exports=o},{"../chunks/parseLinkInput":40,"../once":69,"../strings":76}],66:[function(e,t){"use strict";function n(e){return" "+e+" "}function r(e,t){function r(e){return u.test(e)&&(h=RegExp.$1),w=f.test(e)?1:0,g(e)}function d(e){return y=f.test(e)?1:0,g(e)}function p(){return n(t?v++ +".":h)}function g(e){var t=/^[ ]{0,3}([*+-]|\d+[.])\s/gm;return e.replace(t,p)}var m,h="-",v=1,w=1,y=1;if(e.findTags(/(\n|^)*[ ]{0,3}([*+-]|\d+[.])\s+/,null),!e.before||/\n$/.test(e.before)||/^\n/.test(e.startTag)||(e.before+=e.startTag,e.startTag=""),!e.startTag||(m=/\d+[.]/.test(e.startTag),e.startTag="",e.selection=e.selection.replace(/\n[ ]{4}/g,"\n"),i.unwrap(e),e.skip(),m&&(e.after=e.after.replace(l,g)),t!==m)){e.before=e.before.replace(c,r),e.selection||(e.selection=a.placeholders.listitem);var b=p(),k=o(" ",b.length);e.after=e.after.replace(l,d),e.trim(!0),e.skip({before:w,after:y,any:!0}),e.startTag=b,i.wrap(e,s.lineLength-b.length),e.selection=e.selection.replace(/\n/g,"\n"+k)}}var o=e("../many"),a=e("../strings"),i=e("./wrapping"),s=e("./settings"),c=/(\n|^)(([ ]{0,3}([*+-]|\d+[.])[ \t]+.*)(\n.+|\n{2,}([*+-].*|\d+[.])[ \t]+.*|\n{2,}[ \t]+\S.*)*)\n*$/,l=/^\n*(([ ]{0,3}([*+-]|\d+[.])[ \t]+.*)(\n.+|\n{2,}([*+-].*|\d+[.])[ \t]+.*|\n{2,}[ \t]+\S.*)*)\n*/,u=/^\s*([*+-])/,f=/[^\n]\n\n[^\n]/;t.exports=r},{"../many":58,"../strings":76,"./settings":67,"./wrapping":68}],67:[function(e,t){"use strict";t.exports={lineLength:72}},{}],68:[function(e,t){"use strict";function n(e,t){function n(e,t){return a.test(e)?e:t+"\n"}var o=new RegExp("(.{1,"+t+"})( +|$\\n?)","gm");r(e),e.selection=e.selection.replace(o,n).replace(s,"")}function r(e){i.lastIndex=0,e.selection=e.selection.replace(i,"$1 $2")}var o="(?:\\s{4,}|\\s*>|\\s*-\\s+|\\s*\\d+\\.|=|\\+|-|_|\\*|#|\\s*\\[[^\n]]+\\]:)",a=new RegExp("^"+o,""),i=new RegExp("([^\\n])\\n(?!(\\n|"+o+"))","g"),s=/\s+$/;t.exports={wrap:n,unwrap:r}},{}],69:[function(e,t){"use strict";function n(e){var t;return function(){return t?void 0:(t=!0,e.apply(this,arguments))}}t.exports=n},{}],70:[function(e,t){"use strict";function n(e){var t,n=[],o=i.getElementsByTagName("*");for(t in o)-1!==r(o[t].className).indexOf(r(e))&&n.push(o[t]);return n}function r(e){return" "+e+" "}function o(){a(i.body.querySelectorAll?i.body.querySelectorAll(".wk-prompt"):n("wk-prompt"))}function a(e){var t,n=e.length;for(t=0;n>t;t++)e[t].parentElement.removeChild(e[t])}var i=document;t.exports=o},{}],71:[function(e,t){"use strict";function n(e,t){function n(n){t[n]&&(e[n].className+=" "+t[n])}Object.keys(e).forEach(n)}function r(e,t){function r(){O.input.focus()}function m(e){var t=e.which||e.keyCode;t===u&&(v(),e.preventDefault())}function h(e){var t=e.which||e.keyCode;t===f&&(w(),e.preventDefault())}function v(){w(),t({definitions:[O.input.value]})}function w(){M&&y(!0),O.dialog.parentElement&&O.dialog.parentElement.removeChild(O.dialog),e.surface.focus(e.mode)}function y(e){var t=e?"remove":"add";o[t](g,"dragenter",b),o[t](g,"dragend",k),o[t](g,"mouseout",k)}function b(){s.add(S.area,d),s.add(S.area,p)}function k(){s.rm(S.area,d),s.rm(S.area,p),l.stop(e.surface.droparea)}function x(){function r(n){function r(e){return e.href+' "'+e.title+'"'}var o=n[0];O.input.value=o.href+' "'+o.title+'"',w(),t({definitions:n.map(r),attachment:"attachment"===e.type})}S=i.uploads(O,c.prompts.types+(M.restriction||e.type+"s")),y(),o.add(S.area,"dragover",T,!1),o.add(S.area,"drop",E,!1),n(S,e.classes.prompts);var l=a.setup(S.fileinput,{method:M.method,formData:M.formData,fieldKey:M.fieldKey,xhrOptions:M.xhrOptions,endpoint:M.url,validate:M.validate||"image"});return l.on("started",function(){s.rm(S.failed,"wk-prompt-error-show"),s.rm(S.warning,"wk-prompt-error-show")}),l.on("valid",function(){s.add(S.area,"wk-prompt-uploading")}),l.on("invalid",function(){s.add(S.warning,"wk-prompt-error-show")}),l.on("error",function(){s.add(S.failed,"wk-prompt-error-show")}),l.on("success",r),l.on("ended",function(){s.rm(S.area,"wk-prompt-uploading")}),l}function T(e){C(e),e.dataTransfer.dropEffect="copy"}function E(e){k(),C(e),$.submit(e.dataTransfer.files)}function C(e){e.stopPropagation(),e.preventDefault()}var S,R=c.prompts[e.type],O=i({id:"wk-prompt-"+e.type,title:R.title,description:R.description,placeholder:R.placeholder});o.add(O.cancel,"click",w),o.add(O.close,"click",w),o.add(O.ok,"click",v),o.add(O.input,"keypress",m),o.add(O.dialog,"keydown",h),n(O,e.classes.prompts);var M=e.upload;"string"==typeof M&&(M={url:M});var $=null;M&&($=x(),e.autoUpload&&$.submit(e.autoUpload)),setTimeout(r,0)}var o=e("crossvent"),a=e("bureaucracy"),i=e("./render"),s=e("../classes"),c=e("../strings"),l=e("../uploads"),u=13,f=27,d="wk-dragging",p="wk-prompt-upload-dragging",g=document.documentElement;t.exports=r},{"../classes":42,"../strings":76,"../uploads":77,"./render":72,bureaucracy:5,crossvent:10}],72:[function(e,t){(function(n){"use strict";function r(e,t,n){var r=d.createElement(e);return r.className=t,n&&c(r,n),r}function o(e){var t={dialog:r("article","wk-prompt "+e.id),close:r("a","wk-prompt-close"),header:r("header","wk-prompt-header"),h1:r("h1","wk-prompt-title",e.title),section:r("section","wk-prompt-body"),desc:r("p","wk-prompt-description",e.description),inputContainer:r("div","wk-prompt-input-container"),input:r("input","wk-prompt-input"),cancel:r("button","wk-prompt-cancel","Cancel"),ok:r("button","wk-prompt-ok","Ok"),footer:r("footer","wk-prompt-buttons")};return t.ok.type="button",t.header[f](t.h1),t.section[f](t.desc),t.section[f](t.inputContainer),t.inputContainer[f](t.input),t.input.placeholder=e.placeholder,t.cancel.type="button",t.footer[f](t.cancel),t.footer[f](t.ok),t.dialog[f](t.close),t.dialog[f](t.header),t.dialog[f](t.section),t.dialog[f](t.footer),d.body[f](t.dialog),t}function a(e,t){function n(){l.add(d.upload,"wk-focused")}function o(){l.rm(d.upload,"wk-focused")}var a="wk-prompt-fileupload",d={area:r("section","wk-prompt-upload-area"),warning:r("p","wk-prompt-error wk-warning",t),failed:r("p","wk-prompt-error wk-failed",u.prompts.uploadfailed),upload:r("label","wk-prompt-upload"),uploading:r("span","wk-prompt-progress",u.prompts.uploading),drop:r("span","wk-prompt-drop",u.prompts.drop),dropicon:r("p","wk-drop-icon wk-prompt-drop-icon"),browse:r("span","wk-prompt-browse",u.prompts.browse),dragdrop:r("p","wk-prompt-dragdrop",u.prompts.drophint),fileinput:r("input",a)};return d.area[f](d.drop),d.area[f](d.uploading),d.area[f](d.dropicon),d.upload[f](d.browse),d.upload[f](d.fileinput),d.fileinput.id=a,d.fileinput.type="file",d.fileinput.multiple="multiple",e.dialog.className+=" wk-prompt-uploads",e.inputContainer.className+=" wk-prompt-input-container-uploads",e.input.className+=" wk-prompt-input-uploads",e.section.insertBefore(d.warning,e.inputContainer),e.section.insertBefore(d.failed,e.inputContainer),e.section[f](d.upload),e.section[f](d.dragdrop),e.section[f](d.area),c(e.desc,s(e.desc)+u.prompts.upload),i.add(d.fileinput,"focus",n),i.add(d.fileinput,"blur",o),d}var i=e("crossvent"),s=e("../getText"),c=e("../setText"),l=e("../classes"),u=e("../strings"),f="appendChild",d=n.document;o.uploads=a,t.exports=o}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../classes":42,"../getText":47,"../setText":75,"../strings":76,crossvent:10}],73:[function(e,t){"use strict";function n(e){function t(){var t=e.reset().inputState,n=t.getChunks(),r=n.before.length,o=r+n.selection.length;return[[r,a],[o,i]]}function n(){var t=e.inputState,n=t.getChunks(),o=n.before+n.selection+n.after,c=o.lastIndexOf(a),l=o.lastIndexOf(i)+i.length,u=-1===c?0:c,f=-1===l?0:l;n.before=o.substr(0,u).replace(s,""),n.selection=o.substr(u,f-u).replace(s,""),n.after=o.substr(l).replace(s,"");var d=e.surface.current(e.inputMode),p=r(d,{caret:!0,autoupdateToCaret:!1,tracking:!1});t.setChunks(n),t.restore(!1),t.scrollTop=d.scrollTop=p.read().y-d.getBoundingClientRect().top-50,p.destroy()}var o=Math.random().toString(18).substr(2).replace(/\d+/g,""),a="WoofmarkSelectionOpenMarker"+o,i="WoofmarkSelectionCloseMarker"+o,s=new RegExp(a+"|"+i,"g");return{markers:t(),unmark:n}}var r=e("bullseye");t.exports=n},{bullseye:2}],74:[function(e,t){"use strict";function n(e,t){o(e,a.buttons[t]||t)}function r(e,t){o(e,a.modes[t]||t)}var o=e("./setText"),a=e("./strings");t.exports={modes:r,commands:n}},{"./setText":75,"./strings":76}],75:[function(e,t){"use strict";function n(e,t){e.innerText=e.textContent=t}t.exports=n},{}],76:[function(e,t){"use strict";t.exports={placeholders:{bold:"strong text",italic:"emphasized text",quote:"quoted text",code:"code goes here",listitem:"list item",heading:"Heading Text",link:"link text",image:"image description",attachment:"attachment description"},titles:{bold:"Strong <strong> Ctrl+B",italic:"Emphasis <em> Ctrl+I",quote:"Blockquote <blockquote> Ctrl+J",code:"Code Sample <pre><code> Ctrl+E",ol:"Numbered List <ol> Ctrl+O",ul:"Bulleted List <ul> Ctrl+U",heading:"Heading <h1>, <h2>, ... Ctrl+D",link:"Hyperlink <a> Ctrl+K",image:"Image <img> Ctrl+G",attachment:"Attachment Ctrl+Shift+K",markdown:"Markdown Mode Ctrl+M",html:"HTML Mode Ctrl+H",wysiwyg:"Preview Mode Ctrl+P"},buttons:{bold:"B",italic:"I",quote:"“",code:"</>",ol:"1.",ul:"⦿",heading:"Tt",link:"Link",image:"Image",attachment:"Attachment",hr:"↵"},prompts:{link:{title:"Insert Link",description:"Type or paste the url to your link",placeholder:'http://example.com/ "title"'},image:{title:"Insert Image",description:"Enter the url to your image",placeholder:'http://example.com/public/image.png "title"'},attachment:{title:"Attach File",description:"Enter the url to your attachment",placeholder:'http://example.com/public/report.pdf "title"'},types:"You can only upload ",browse:"Browse...",drophint:"You can also drag files from your computer and drop them here!",drop:"Drop your file here to begin upload...",upload:", or upload a file",uploading:"Uploading your file...",uploadfailed:"The upload failed! That's all we know."},modes:{wysiwyg:"wysiwyg",markdown:"m↓"}}},{}],77:[function(e,t){"use strict";function n(e,t,n,d,p){function g(){c.add(t,l),c.add(t,u)}function m(){i(t)}function h(e){a(e),g(),e.dataTransfer.dropEffect="copy"}function v(e){m(),a(e),n.runCommand(function(t,r){var o=Array.prototype.slice.call(e.dataTransfer.files),a=w(o);n.linkOrImageOrAttachment(a,o).call(this,r,t)})}function w(e){return d.images&&!d.attachments?"image":!d.images&&d.attachments?"attachment":e.every(r(d.images.validate||o))?"image":"attachment"}var y=p?"remove":"add";s[y](f,"dragenter",g),s[y](f,"dragend",m),s[y](f,"mouseout",m),s[y](e,"dragover",h,!1),s[y](t,"drop",v,!1)}function r(e){return function(t){return e(t)}}function o(){return!1}function a(e){e.stopPropagation(),e.preventDefault()}function i(e){c.rm(e,l),c.rm(e,u)}var s=e("crossvent"),c=e("./classes"),l="wk-dragging",u="wk-container-dragging",f=document.documentElement;n.stop=i,t.exports=n},{"./classes":42,crossvent:10}],78:[function(e,t){(function(n){"use strict";function r(e){for(var t=0;t<E.length;t++)if(E[t]&&E[t].ta===e)return E[t].editor;return null}function o(e,t){function n(e){var t=tt[e].button,n=X.render.modes;if(X[e]){z.appendChild(t),("function"==typeof n?n:b.modes)(t,e),l.add(t,"click",tt[e].set),t.type="button",t.tabIndex=-1;var r=d.titles[e];r&&t.setAttribute("title",C?s(r):r)}}function o(e){var t=e?"rm":"add",n=e?"removeChild":"appendChild";e?u.clear(Z):(X.markdown&&u.on("cmd+m",et,O),X.html&&u.on("cmd+h",et,M),X.wysiwyg&&u.on("cmd+p",et,$)),y[t](_,"wk-container"),_[n](F),U&&_[n](U),_[n](W),_[n](z),(X.images||X.attachments)&&(_[n](K),f(_,K,G,X,e))}function p(){"markdown"!==G.mode&&(e.value=N()),y.rm(e,"wk-hide"),o(!0),delete E[Q-1]}function O(e){I("markdown",e)}function M(e){I("html",e)}function $(e){I("wysiwyg",e)}function I(t,n){function r(e,t){return X[e](t,{markers:o&&o.markers||[]})}var o,a=G.mode,s=tt[a].button,l=tt[t].button,u=!!n||S.activeElement===e||S.activeElement===F;i(n),a!==t&&(o=u&&g(V,X),e.blur(),"markdown"===t?e.value="html"===a?r("parseHTML",e.value).trim():r("parseHTML",F).trim():"html"===t?e.value="markdown"===a?r("parseMarkdown",e.value).trim():F.innerHTML.trim():"wysiwyg"===t&&(F.innerHTML="markdown"===a?r("parseMarkdown",e.value).replace(R,"").trim():e.value.replace(R,"").trim()),"wysiwyg"===t?(y.add(e,"wk-hide"),y.rm(F,"wk-hide"),U&&y.rm(U,"wk-hide"),u&&setTimeout(L,0)):(y.rm(e,"wk-hide"),y.add(F,"wk-hide"),U&&y.add(U,"wk-hide"),u&&e.focus()),y.add(l,"wk-mode-active"),y.rm(s,"wk-mode-active"),y.add(s,"wk-mode-inactive"),y.rm(l,"wk-mode-inactive"),l.setAttribute("disabled","disabled"),s.removeAttribute("disabled"),G.mode=t,X.storage&&c.set(X.storage,t),V.setInputMode(t),o&&o.unmark(),A("woofmark-mode-change"))}function A(t){setTimeout(function(){l.fabricate(e,t)},0)}function L(){F.focus()}function N(){return"wysiwyg"===G.mode?X.parseHTML(F):"html"===G.mode?X.parseHTML(e.value):e.value
}function H(t){function n(){return X.parseMarkdown(r)}var r=String(t),o=1===arguments.length;return o&&("wysiwyg"===G.mode?F.innerHTML=n():e.value="html"===G.mode?n():r,V.reset()),N()}function q(e,t,n){2===arguments.length&&(n=t,t=null);var r=a({t:"button",c:"wk-command",p:W}),o=X.render.commands,i="function"==typeof o?o:b.commands,c=d.titles[e];return c&&r.setAttribute("title",C?s(c):c),r.type="button",r.tabIndex=-1,i(r,e),l.add(r,"click",v(J,V,n)),t&&j(t,n),r}function j(e,t){u.on(e,et,v(J,V,t))}function D(e){function t(t,n,r){return e.call(this,r,n)}v(J,V,t)(null)}var P=r(e);if(P)return P;var _=e.parentElement;if(_.children.length>1)throw new Error("woofmark demands <textarea> elements to have no siblings");var X=t||{};if(void 0===X.markdown&&(X.markdown=!0),void 0===X.html&&(X.html=!0),void 0===X.wysiwyg&&(X.wysiwyg=!0),!X.markdown&&!X.html&&!X.wysiwyg)throw new Error("woofmark expects at least one input mode to be available");void 0===X.hr&&(X.hr=!1),void 0===X.storage&&(X.storage=!0),X.storage===!0&&(X.storage="woofmark_input_mode"),void 0===X.fencing&&(X.fencing=!0),void 0===X.render&&(X.render={}),void 0===X.render.modes&&(X.render.modes={}),void 0===X.render.commands&&(X.render.commands={}),void 0===X.prompts&&(X.prompts={}),void 0===X.prompts.link&&(X.prompts.link=k),void 0===X.prompts.image&&(X.prompts.image=k),void 0===X.prompts.attachment&&(X.prompts.attachment=k),void 0===X.prompts.close&&(X.prompts.close=x),void 0===X.classes&&(X.classes={}),void 0===X.classes.wysiwyg&&(X.classes.wysiwyg=[]),void 0===X.classes.prompts&&(X.classes.prompts={}),void 0===X.classes.input&&(X.classes.input={});var B=X.storage&&c.get(X.storage);B&&(X.defaultMode=B);var U,K=a({c:"wk-container-drop"}),z=a({c:"wk-switchboard"}),W=a({c:"wk-commands"}),F=a({c:["wk-wysiwyg","wk-hide"].concat(X.classes.wysiwyg).join(" ")}),J=w(e,F,K),V=new h(J,"markdown"),G={addCommand:j,addCommandButton:q,runCommand:D,parseMarkdown:X.parseMarkdown,parseHTML:X.parseHTML,destroy:p,value:H,textarea:e,editable:X.wysiwyg?F:null,setMode:I,history:{undo:V.undo,redo:V.redo,canUndo:V.canUndo,canRedo:V.canRedo},mode:"markdown"},Y={ta:e,editor:G},Q=E.push(Y),Z="woofmark_"+Q,et={filter:_,context:Z},tt={markdown:{button:a({t:"button",c:"wk-mode wk-mode-active"}),set:O},html:{button:a({t:"button",c:"wk-mode wk-mode-inactive"}),set:M},wysiwyg:{button:a({t:"button",c:"wk-mode wk-mode-inactive"}),set:$}};return a({t:"span",c:"wk-drop-text",x:d.prompts.drop,p:K}),a({t:"p",c:["wk-drop-icon"].concat(X.classes.dropicon).join(" "),p:K}),F.contentEditable=!0,tt.markdown.button.setAttribute("disabled","disabled"),T.forEach(n),X.wysiwyg&&(U=a({c:"wk-wysiwyg-placeholder wk-hide",x:e.placeholder}),l.add(U,"click",L)),X.defaultMode&&X[X.defaultMode]?tt[X.defaultMode].set():X.markdown?tt.markdown.set():X.html?tt.html.set():tt.wysiwyg.set(),m(J,X,G),o(),G}function a(e){var t=e||{},n=S.createElement(t.t||"div");return n.className=t.c||"",p(n,t.x||""),t.p&&t.p.appendChild(n),n}function i(e){e&&(e.preventDefault(),e.stopPropagation())}function s(e){return e.replace(/\bctrl\b/i,"⌘").replace(/\balt\b/i,"⌥").replace(/\bshift\b/i,"⇧")}var c=e("local-storage"),l=e("crossvent"),u=e("kanye"),f=e("./uploads"),d=e("./strings"),p=e("./setText"),g=e("./rememberSelection"),m=e("./bindCommands"),h=e("./InputHistory"),v=e("./getCommandHandler"),w=e("./getSurface"),y=e("./classes"),b=e("./renderers"),k=e("./prompts/prompt"),x=e("./prompts/close"),T=["markdown","html","wysiwyg"],E=[],C=/\bMac OS\b/.test(n.navigator.userAgent),S=document,R=/^<p><\/p>\n?$/i;o.find=r,o.strings=d,t.exports=o}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./InputHistory":36,"./bindCommands":38,"./classes":42,"./getCommandHandler":45,"./getSurface":46,"./prompts/close":70,"./prompts/prompt":71,"./rememberSelection":73,"./renderers":74,"./setText":75,"./strings":76,"./uploads":77,crossvent:10,kanye:17,"local-storage":18}]},{},[78])(78)});