-
Notifications
You must be signed in to change notification settings - Fork 0
/
emails-editor.js
2 lines (2 loc) · 64.1 KB
/
emails-editor.js
1
2
var EmailsEditor=function(t){var n={};function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:r})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,n){if(1&n&&(t=e(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(e.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var o in t)e.d(r,o,function(n){return t[n]}.bind(null,o));return r},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,n){return Object.prototype.hasOwnProperty.call(t,n)},e.p="",e(e.s=0)}([function(t,n,e){var r=e(5).default;t.exports=r},function(t,n,e){var r=e(2),o=e(3);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var a={insert:"head",singleton:!1},i=(r(o,a),o.locals?o.locals:{});t.exports=i},function(t,n,e){"use strict";var r,o=function(){return void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r},a=function(){var t={};return function(n){if(void 0===t[n]){var e=document.querySelector(n);if(window.HTMLIFrameElement&&e instanceof window.HTMLIFrameElement)try{e=e.contentDocument.head}catch(t){e=null}t[n]=e}return t[n]}}(),i=[];function c(t){for(var n=-1,e=0;e<i.length;e++)if(i[e].identifier===t){n=e;break}return n}function l(t,n){for(var e={},r=[],o=0;o<t.length;o++){var a=t[o],l=n.base?a[0]+n.base:a[0],s=e[l]||0,u="".concat(l," ").concat(s);e[l]=s+1;var f=c(u),d={css:a[1],media:a[2],sourceMap:a[3]};-1!==f?(i[f].references++,i[f].updater(d)):i.push({identifier:u,updater:b(d,n),references:1}),r.push(u)}return r}function s(t){var n=document.createElement("style"),r=t.attributes||{};if(void 0===r.nonce){var o=e.nc;o&&(r.nonce=o)}if(Object.keys(r).forEach((function(t){n.setAttribute(t,r[t])})),"function"==typeof t.insert)t.insert(n);else{var i=a(t.insert||"head");if(!i)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");i.appendChild(n)}return n}var u,f=(u=[],function(t,n){return u[t]=n,u.filter(Boolean).join("\n")});function d(t,n,e,r){var o=e?"":r.media?"@media ".concat(r.media," {").concat(r.css,"}"):r.css;if(t.styleSheet)t.styleSheet.cssText=f(n,o);else{var a=document.createTextNode(o),i=t.childNodes;i[n]&&t.removeChild(i[n]),i.length?t.insertBefore(a,i[n]):t.appendChild(a)}}function p(t,n,e){var r=e.css,o=e.media,a=e.sourceMap;if(o?t.setAttribute("media",o):t.removeAttribute("media"),a&&btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(a))))," */")),t.styleSheet)t.styleSheet.cssText=r;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(r))}}var m=null,v=0;function b(t,n){var e,r,o;if(n.singleton){var a=v++;e=m||(m=s(n)),r=d.bind(null,e,a,!1),o=d.bind(null,e,a,!0)}else e=s(n),r=p.bind(null,e,n),o=function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(e)};return r(t),function(n){if(n){if(n.css===t.css&&n.media===t.media&&n.sourceMap===t.sourceMap)return;r(t=n)}else o()}}t.exports=function(t,n){(n=n||{}).singleton||"boolean"==typeof n.singleton||(n.singleton=o());var e=l(t=t||[],n);return function(t){if(t=t||[],"[object Array]"===Object.prototype.toString.call(t)){for(var r=0;r<e.length;r++){var o=c(e[r]);i[o].references--}for(var a=l(t,n),s=0;s<e.length;s++){var u=c(e[s]);0===i[u].references&&(i[u].updater(),i.splice(u,1))}e=a}}}},function(t,n,e){(n=e(4)(!1)).push([t.i,'.form-container{width:600px;height:400px;margin:20px}.form{display:flex;flex-direction:column;box-shadow:0 10px 20px 0 rgba(0,0,0,0.3);border-radius:16px 16px 16px 16px;font:400 14px/24px Open Sans,sans-serif}.form__top{flex:0 1 250px;padding:50px 50px 0px 50px;border-radius:16px 16px 0px 0px;background-color:#f8f8f7}.form__bottom{flex:0 1 75px;padding:12.5px 50px 12.5px 50px;border-radius:0px 0px 16px 16px;background-color:white;display:flex;justify-content:flex-start;align-items:center}.form__header{height:50px;display:flex;justify-content:flex-start;align-items:center;font-size:20px}.form__header .bold-text{font-weight:bold}.form__editor{height:170px;min-width:500px;margin-bottom:30px;display:flex;flex-wrap:wrap;justify-content:flex-start;align-content:flex-start;background-color:white;border-radius:4px;border:1px solid #c3c1d0;float:left;overflow:auto}.form__editor__input{display:inline-block;flex:1 1 auto;margin:3px;border:none;outline:none;line-height:24px}.form__editor__email{background-color:#e0eaff;display:flex;padding:0px 10px;margin:5px 3px;border:none;border-radius:12px;outline:none;line-height:24px}.form__editor__remover::after{content:"×";font-size:large;padding:0px 5px;cursor:pointer}.form__editor__email--error{text-decoration:underline red}.form__footer{height:100%;display:flex;justify-content:flex-start;align-items:center}.button_primary{color:white;background-color:#4262FF;border-color:#4262FF;border-radius:4px;border:1px solid;padding:10px 20px 10px 20px;margin:0px 10px;text-align:center;font:400 14px/24px Open Sans,sans-serif;cursor:pointer}\n',""]),t.exports=n},function(t,n,e){"use strict";t.exports=function(t){var n=[];return n.toString=function(){return this.map((function(n){var e=function(t,n){var e=t[1]||"",r=t[3];if(!r)return e;if(n&&"function"==typeof btoa){var o=(i=r,c=btoa(unescape(encodeURIComponent(JSON.stringify(i)))),l="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(c),"/*# ".concat(l," */")),a=r.sources.map((function(t){return"/*# sourceURL=".concat(r.sourceRoot||"").concat(t," */")}));return[e].concat(a).concat([o]).join("\n")}var i,c,l;return[e].join("\n")}(n,t);return n[2]?"@media ".concat(n[2]," {").concat(e,"}"):e})).join("")},n.i=function(t,e,r){"string"==typeof t&&(t=[[null,t,""]]);var o={};if(r)for(var a=0;a<this.length;a++){var i=this[a][0];null!=i&&(o[i]=!0)}for(var c=0;c<t.length;c++){var l=[].concat(t[c]);r&&o[l[0]]||(e&&(l[2]?l[2]="".concat(e," and ").concat(l[2]):l[2]=e),n.push(l))}},n}},function(t,n,e){"use strict";e.r(n);e(1);var r=function(t){return"\n <div class=".concat("form__header",'>\n Share <span class="bold-text"> ').concat(t," </span> with others\n </div>\n ")},o=new Map,a=/^[a-zA-Z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/,i=function(t){return o.has(t)||o.set(t,a.test(t)),o.get(t)},c=function t(n){return"\n <div class=".concat(t.EDITOR_CLASS,' data-ns="editor">\n ').concat(t.innerTemplate(n),"\n </div>\n ")};c.EDITOR_CLASS="form__editor",c.INPUT_CLASS="form__editor__input",c.EMAIL_CLASS="form__editor__email",c.REMOVER_CLASS="form__editor__remover",c.ERROR_CLASS="form__editor__email--error",c.innerTemplate=function(t){var n=0;return t.reduce((function(t,e){return t+"\n <div class=".concat(c.EMAIL_CLASS," data-key=").concat(n++,"> \n <span class=").concat(i(e)?"":c.ERROR_CLASS," > ").concat(e," </span>\n <span class=").concat(c.REMOVER_CLASS," data-ns=").concat("REMOVE","></span>\n </div>\n ")}),"")+"<input class=".concat(c.INPUT_CLASS," data-ns=").concat("RECORD",' type="text" contenteditable="true" placeholder="add more people..."></input>')};var l=c,s=function(t,n){return'\n <button type="button" class='.concat("button_primary"," data-ns=").concat(n,">\n ").concat(t,"\n </button>\n ")},u=function(){return"\n <div class=".concat("form__footer",">\n ").concat(s("Add email","ADD"),"\n ").concat(s("Get emails count","GET_COUNT"),"\n </div>\n ")},f=function(t){var n={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};return t.replace(/[&<>"'/]/gi,(function(t){return n[t]}))};function d(t){return function(t){if(Array.isArray(t)){for(var n=0,e=new Array(t.length);n<t.length;n++)e[n]=t[n];return e}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function p(){return(p=Object.assign||function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t}).apply(this,arguments)}var m=function(t){var n=p({},t);console.log("Build -- [Form] -- start");var e=n.boardName,o=e.replace(/\s/g,""),a=n.emails,i=function(){},c=document.createElement("div");c.setAttribute("id",o),c.setAttribute("class","form-container");var s="\n\t\t<div class=".concat("form",">\t\n\t\t\t<div class=").concat("form__top",">\n\t\t\t\t").concat(r(e),"\n\t\t\t\t").concat(l(a),"\n\t\t\t</div>\n\t\t\t<div class=").concat("form__bottom",">\n\t\t\t\t").concat(u(),"\n\t\t\t</div>\n\t\t</div>\n ");c.innerHTML=s;return console.log("Build -- [Form] -- end"),{form:c,getEmails:function(){return a},setEmails:function(t){t=t.map((function(t){return f(t.trim())})).filter((function(t){return""!==t})),function(t){document.querySelector("#"+o+" ."+l.EDITOR_CLASS).innerHTML=l.innerTemplate(t)}(a=d(t)),i(a)},subscribe:function(t){i=t}}},v=function(){for(var t,n,e="abcdefghijklmnopqrstuvwxyz",r=(t=4,n=10,t=Math.ceil(t),n=Math.floor(n),Math.floor(Math.random()*(n-t))+t),o="",a=0;a<r;a++)o+=e[Math.floor(Math.random()*e.length)];return o+"@gmail.com"};function b(t){return function(t){if(Array.isArray(t)){for(var n=0,e=new Array(t.length);n<t.length;n++)e[n]=t[n];return e}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var g={"click.REMOVE":function(t,n){var e=t.parentNode.dataset.key,r=n.getEmails();r.splice(e,1),n.setEmails(r)},"click.ADD":function(t,n){var e=n.getEmails(),r=v();e.push(r),n.setEmails(e)},"click.GET_COUNT":function(t,n,e){var r=0;n.getEmails().forEach((function(t){i(t)&&r++})),alert("Valid emails count : "+r)},"keydown.RECORD":function(t,n,e){var r;return function(){var o=this,a=arguments,i=function(){r=null,e||t.apply(o,a)},c=e&&!r;clearTimeout(r),r=setTimeout(i,n),c&&t.apply(o,a)}}((function(t,n,e){var r=e.which||e.keyCode;if(13===r||188===r){var o=t.value;if(t.value="",null==o||""===o)return;","===o.charAt(o.length-1)&&(o=o.substring(0,o.length-1));var a=n.getEmails();a.push(o),n.setEmails(a)}}),300,!1),"paste.RECORD":function(t,n,e){var r=(e.clipboardData||window.clipboardData).getData("text");if(null!=r&&""!==r){r=r.split(",");var o=n.getEmails();n.setEmails([].concat(b(o),b(r)))}},"focusout.RECORD":function(t,n,e){var r=t.value;if(t.value="",null!=r&&""!==r){var o=n.getEmails();o.push(r),n.setEmails(o)}}},h=function(t,n,e,r){var o=g[n+"."+t];"function"==typeof o&&o(e,r,event)},x={listenOn:function(t,n,e){n.forEach((function(n){t.addEventListener(n,(function(t){t.stopPropagation();var n=t.target,r=t.type,o=n.dataset.ns;h(o,r,n,e)}))}))}};function y(t,n){if(null==t)return{};var e,r,o=function(t,n){if(null==t)return{};var e,r,o={},a=Object.keys(t);for(r=0;r<a.length;r++)e=a[r],n.indexOf(e)>=0||(o[e]=t[e]);return o}(t,n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(r=0;r<a.length;r++)e=a[r],n.indexOf(e)>=0||Object.prototype.propertyIsEnumerable.call(t,e)&&(o[e]=t[e])}return o}n.default=function(t){var n=t.container,e=y(t,["container"]);console.log("Render -- [EmailsEditor] -- Render in ".concat(n.id," with options ").concat(JSON.stringify(e)));var r=performance.now(),o=m(e),a=o.form,i=o.getEmails,c=o.setEmails,l=o.subscribe;n.append(a),x.listenOn(a,["click","keydown","focusout","paste"],{setEmails:c,getEmails:i});var s=performance.now();return console.log("Render -- [EmailsEditor] -- Finishing rendering #".concat(e.boardName,"# within ").concat(Math.ceil(s-r)," ms")),{getEmails:i,setEmails:c,subscribe:l}}}]);
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9FbWFpbHNFZGl0b3Ivd2VicGFjay9ib290c3RyYXAiLCJ3ZWJwYWNrOi8vRW1haWxzRWRpdG9yLy4vc3JjL2VudHJ5LmpzIiwid2VicGFjazovL0VtYWlsc0VkaXRvci8uL3NyYy9zdHlsZXMvbWFpbi5zY3NzPzY5YzciLCJ3ZWJwYWNrOi8vRW1haWxzRWRpdG9yLy4vbm9kZV9tb2R1bGVzL3N0eWxlLWxvYWRlci9kaXN0L3J1bnRpbWUvaW5qZWN0U3R5bGVzSW50b1N0eWxlVGFnLmpzIiwid2VicGFjazovL0VtYWlsc0VkaXRvci8uL3NyYy9zdHlsZXMvbWFpbi5zY3NzIiwid2VicGFjazovL0VtYWlsc0VkaXRvci8uL25vZGVfbW9kdWxlcy9jc3MtbG9hZGVyL2Rpc3QvcnVudGltZS9hcGkuanMiLCJ3ZWJwYWNrOi8vRW1haWxzRWRpdG9yLy4vc3JjL2NvbXBvbmVudHMvSGVhZGVyLmpzIiwid2VicGFjazovL0VtYWlsc0VkaXRvci8uL3NyYy91dGlscy92YWxpZGF0ZUVtYWlsLmpzIiwid2VicGFjazovL0VtYWlsc0VkaXRvci8uL3NyYy9jb21wb25lbnRzL0VkaXRvci5qcyIsIndlYnBhY2s6Ly9FbWFpbHNFZGl0b3IvLi9zcmMvZXZlbnRzL05hbWVTcGFjZS5qcyIsIndlYnBhY2s6Ly9FbWFpbHNFZGl0b3IvLi9zcmMvY29tcG9uZW50cy9CdXR0b24uanMiLCJ3ZWJwYWNrOi8vRW1haWxzRWRpdG9yLy4vc3JjL2NvbXBvbmVudHMvRm9vdGVy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