pushfeedback 0.0.8 → 0.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1,520 @@
1
- const _0x538b3b=_0x2296;(function(_0x2de245,_0x24ebe5){const _0x1ef254=_0x2296,_0xdf88ed=_0x2de245();while(!![]){try{const _0x382f08=-parseInt(_0x1ef254(0x19e))/0x1+-parseInt(_0x1ef254(0xe3))/0x2+-parseInt(_0x1ef254(0x184))/0x3+-parseInt(_0x1ef254(0x110))/0x4*(-parseInt(_0x1ef254(0x182))/0x5)+-parseInt(_0x1ef254(0x111))/0x6*(parseInt(_0x1ef254(0x116))/0x7)+-parseInt(_0x1ef254(0xe6))/0x8+parseInt(_0x1ef254(0x160))/0x9;if(_0x382f08===_0x24ebe5)break;else _0xdf88ed['push'](_0xdf88ed['shift']());}catch(_0x36f8fb){_0xdf88ed['push'](_0xdf88ed['shift']());}}}(_0x41bc,0xa1c98));import{h}from'@stencil/core';import _0x594d05 from'dom-to-image';function _0x2296(_0x3ca9da,_0xd48776){const _0x41bcca=_0x41bc();return _0x2296=function(_0x22963c,_0x4e055a){_0x22963c=_0x22963c-0xd2;let _0x1d04be=_0x41bcca[_0x22963c];return _0x1d04be;},_0x2296(_0x3ca9da,_0xd48776);}function _0x41bc(){const _0x48f6c3=['string','Email\x20address\x20(optional)','zAcgI','modalTitleError403','LpeGZ','line','GOzZy','yUYIu','sending','backgroundColor','url(#footer-logo)','message-placeholder','How\x20could\x20this\x20page\x20be\x20more\x20helpful?','Send','handleMessageInput','iRopn','modal-position','Take\x20a\x20Screenshot','left','feedback-modal-element-selected','modalPosition','kmFjH','Glvju','formError','Oops!\x20We\x20didn\x27t\x20receive\x20your\x20feedback.\x20Please\x20try\x20again\x20later.','19222290mBQcuY','BDGab','display','modalTitle','resetOverflow','PnfDz','vYFJs','\x27How\x20could\x20this\x20page\x20be\x20more\x20helpful?\x27','screenshotButtonTooltipText','bottomSide','screenshot-topbar-text','styleUrls','21.152%','\x27Share\x20your\x20feedback\x27','feedback-modal-body','target','button','POST','Thanks\x20for\x20your\x20feedback!','cyLip','leftSide','render','HukZh','fkRnu','modal-title-success','fJqQI','100%','NQHeW','close','formEmail','single','KrDRD','kThcQ','GMHqv','1515SGdScd','has-selected-element','1647249Amgruh','iWuOw','MSvBp','status','HwgMZ','ZdoBN','HYeXM','#4FD1C5','nxuJF','none','IVpPk','then','classList','ItmDU','IXdsM','radialGradient','log','originalStyleUrls','modal-title-error-4-0-3','componentWillLoad','style','feedback-modal-screenshot-overlay','NpNEa','gpQKg','getElementsByTagName','modal-title-error-4-0-4','380500XiODCU','closeScreenShot','states','nUqBS','\x27center\x27','feather\x20feather-x','getBoundingClientRect','removeChild','cQqoi','stringify','25.871%','blLCc','application/json','right-side','email','EPHGH','showScreenshotMode','nonzero','jBlnO','https://pushfeedback.com','split','etsRV','bottom','cloneNode','oTGZL','ZsmoM','feedback-modal-header','MyhLz','html','feedback-modal-buttons\x20','onGHa','0\x200\x2032\x2032','Oops!\x20The\x20request\x20URL\x20does\x20not\x20match\x20the\x20one\x20defined\x20in\x20PushFeedback\x20for\x20this\x20project.','SjcyP','overflow','TViPN','kCHzs','clientX','JkyBe','KnaoZ','RmzkT','xIIWv','ifCef','100vh','86.063%','DzczR','YAQAl','zPFIt','preventDefault','handleMouseOverScreenShot','jarGc','zyMfB','feedback-modal-text','IvlQf','feedback-modal-email','LaFsr','xppcK','rgba(0,\x200,\x200,\x200.3)','span','transparent','SGKdR','bottom-side','NyqOH','overlay','https://app.pushfeedback.com/api/feedback/','catch','modalTitleError','div','height','modalContent','EJnHi','feedback-modal.css','DwNkj','DCHjg','error','Yvvwh','SaOBZ','qgVeC','inherit','formErrorStatus','showModal','\x27SELECT\x20AN\x20ELEMENT\x20ON\x20THE\x20PAGE\x27','hrafT','\x22Oops!\x20We\x20didn\x27t\x20receive\x20your\x20feedback.\x20Please\x20try\x20again\x20later.\x22','1066292Zomcym','\x27Thanks\x20for\x20your\x20feedback!\x27','feedback-modal-footer','3828720JEnPzt','w-8\x20h-8','absolute','encodedScreenshot','href','handleSubmit','modalTitleSuccess','width','screenshotTopbarText','ZKLSU','YuSlt','\x27Send\x27','hNKCi','pnvGm','circle','location','project','PushFeedback','round','position','BIqQk','top-side','svg','RMMJE','iJpMM','emailPlaceholder','Rsrhm','uLlLu','feedback-modal-content\x20feedback-modal-content--','sXLVe','xPsdv','currentColor','formMessage','topSide','hoUfr','shadow','MydcN','false','openScreenShot','zHXKI','hidden','form','8956ewMjhQ','210228unumiw','rect','show-screenshot-mode','NkMpB','PhLNa','42DcpWvl','DlrZm','text-center','PZRAx','liIPm','TKywT','formSuccess','screenshot-button-tooltip-text','screenshotModal','rightSide','HqAMG','WWXVo','elementSelected','hasSelectedElement','hide-screenshot-button','GDpMa','path','sendButtonText','KogtA','\x22Oops!\x20The\x20request\x20URL\x20does\x20not\x20match\x20the\x20one\x20defined\x20in\x20PushFeedback\x20for\x20this\x20project.\x22','5|4|1|3|2|0','0px','add','top','properties','KnkQa','messagePlaceholder','center','Oops,\x20something\x20went\x20wrong!','feedback-modal','RFzgF','0\x200\x2024\x2024','value','hideScreenshotButton','feather\x20feather-camera','boolean','AKsfo','modalTitleError404','GViEa','fXiUj','EtRZB','PjBWN','body','pageYOffset','yjuUW','SqOnI','handleEmailInput','hVQhx','feedback-modal-element-hover'];_0x41bc=function(){return _0x48f6c3;};return _0x41bc();}export class FeedbackModal{constructor(){const _0x40cbe5=_0x2296,_0x16e311={'PjBWN':_0x40cbe5(0x1de),'xIIWv':_0x40cbe5(0x171),'nxuJF':_0x40cbe5(0x1aa),'fkRnu':_0x40cbe5(0x12a),'sQqke':_0x40cbe5(0x18d),'NQHeW':_0x40cbe5(0xe8),'KnkQa':_0x40cbe5(0x146),'IVpPk':_0x40cbe5(0x12b),'QxTXm':function(_0x3f598c,_0x187f23){return _0x3f598c+_0x187f23;},'HukZh':_0x40cbe5(0x1d7),'kCHzs':_0x40cbe5(0x1c9),'vYFJs':_0x40cbe5(0x17a),'BdcRs':_0x40cbe5(0x1d9),'NyqOH':_0x40cbe5(0x132),'fXiUj':_0x40cbe5(0x15a),'ifCef':function(_0x455446,_0x480654){return _0x455446+_0x480654;},'tZorz':'block','MSvBp':'Share\x20your\x20feedback','nUqBS':_0x40cbe5(0x172),'YAQAl':_0x40cbe5(0x15f),'PhLNa':'Oops!\x20We\x20could\x20not\x20find\x20the\x20provided\x20project\x20id\x20in\x20PushFeedback.','GOzZy':_0x40cbe5(0x131),'msedN':_0x40cbe5(0x154),'pbLVo':_0x40cbe5(0x158),'xPsdv':'SELECT\x20AN\x20ELEMENT\x20ON\x20THE\x20PAGE','OvWtJ':_0x40cbe5(0x148)};this['handleSubmit']=async _0x5ca6b5=>{const _0x5b0e09=_0x40cbe5;_0x5ca6b5[_0x5b0e09(0x1ce)](),this[_0x5b0e09(0x164)](),this[_0x5b0e09(0x1ae)]=![],this[_0x5b0e09(0xdf)]=![],this[_0x5b0e09(0x14f)]=!![];let _0x28ed1d='';this[_0x5b0e09(0xe9)]&&await this[_0x5b0e09(0xe9)][_0x5b0e09(0x18f)](_0xe08b49=>{_0x28ed1d=_0xe08b49;})['catch'](_0x28250d=>{console['log'](_0x28250d);});try{const _0x1aa8f2=await fetch(_0x16e311[_0x5b0e09(0x13f)],{'method':_0x16e311[_0x5b0e09(0x1c7)],'body':JSON[_0x5b0e09(0x1a7)]({'url':window[_0x5b0e09(0xf5)][_0x5b0e09(0xea)],'message':this['formMessage'],'email':this[_0x5b0e09(0x17d)],'project':this[_0x5b0e09(0xf6)],'screenshot':_0x28ed1d}),'headers':{'Content-Type':_0x16e311[_0x5b0e09(0x18c)]}});_0x1aa8f2[_0x5b0e09(0x187)]===0xc9?(this['formSuccess']=!![],this['formError']=![]):(this[_0x5b0e09(0x11c)]=![],this['formError']=!![],this[_0x5b0e09(0xde)]=_0x1aa8f2[_0x5b0e09(0x187)]);}catch(_0x4a4cc1){console[_0x5b0e09(0x194)](_0x4a4cc1),this['formSuccess']=![],this[_0x5b0e09(0x15e)]=!![],this[_0x5b0e09(0xde)]=0x1f4;}finally{this[_0x5b0e09(0x14f)]=![],this['showModal']=!![];}},this[_0x40cbe5(0x17c)]=()=>{const _0x4a3ad5=_0x40cbe5;this[_0x4a3ad5(0x14f)]=![],this[_0x4a3ad5(0xdf)]=![],this[_0x4a3ad5(0x1ae)]=![],this['hasSelectedElement']=![],this[_0x4a3ad5(0xe9)]=null,this[_0x4a3ad5(0x11c)]=![],this[_0x4a3ad5(0x15e)]=![],this['formErrorStatus']=0x1f4,this['formMessage']='',this[_0x4a3ad5(0x17d)]='',this[_0x4a3ad5(0x164)]();},this[_0x40cbe5(0x10c)]=()=>{const _0x2d61f4=_0x40cbe5;this[_0x2d61f4(0x123)]=![],this[_0x2d61f4(0xdf)]=![],this[_0x2d61f4(0x1ae)]=!![],this[_0x2d61f4(0xe9)]=null,this['resetOverflow']();},this[_0x40cbe5(0x19f)]=()=>{const _0x119a28=_0x40cbe5,_0x9d764f=_0x16e311[_0x119a28(0x177)][_0x119a28(0x1b2)]('|');let _0x408d91=0x0;while(!![]){switch(_0x9d764f[_0x408d91++]){case'0':this['resetOverflow']();continue;case'1':this[_0x119a28(0x123)]=![];continue;case'2':this[_0x119a28(0x1dd)]['style'][_0x119a28(0x162)]=_0x119a28(0x18d);continue;case'3':this[_0x119a28(0xe9)]=null;continue;case'4':this['showScreenshotMode']=![];continue;case'5':this['showModal']=![];continue;}break;}},this[_0x40cbe5(0x1cf)]=_0x4a6369=>{const _0x3381ac=_0x40cbe5;_0x4a6369[_0x3381ac(0x1ce)]();if(this['hasSelectedElement'])return;this[_0x3381ac(0x1dd)][_0x3381ac(0x198)]['display']=_0x3381ac(0x18d),this[_0x3381ac(0x11e)][_0x3381ac(0x198)][_0x3381ac(0x162)]=_0x16e311['sQqke'];const _0x2a1cc4=document['elementFromPoint'](_0x4a6369[_0x3381ac(0x1c3)],_0x4a6369['clientY']),_0x445d5b=_0x2a1cc4[_0x3381ac(0x1a4)]();this[_0x3381ac(0x11e)][_0x3381ac(0x198)][_0x3381ac(0x162)]='',this[_0x3381ac(0x122)]['style']['position']=_0x16e311[_0x3381ac(0x17b)],this[_0x3381ac(0x122)]['style']['left']=_0x445d5b[_0x3381ac(0x159)]+'px',this[_0x3381ac(0x122)]['style']['top']=_0x445d5b[_0x3381ac(0x12d)]+'px',this[_0x3381ac(0x122)][_0x3381ac(0x198)][_0x3381ac(0xed)]=_0x445d5b[_0x3381ac(0xed)]+'px',this[_0x3381ac(0x122)]['style']['height']=_0x445d5b[_0x3381ac(0xd3)]+'px',this[_0x3381ac(0x122)][_0x3381ac(0x190)][_0x3381ac(0x12c)](_0x16e311[_0x3381ac(0x12f)]),this['topSide'][_0x3381ac(0x198)][_0x3381ac(0xf9)]=_0x16e311[_0x3381ac(0x17b)],this[_0x3381ac(0x107)][_0x3381ac(0x198)]['left']=_0x445d5b['left']+'px',this[_0x3381ac(0x107)][_0x3381ac(0x198)][_0x3381ac(0x12d)]=_0x16e311[_0x3381ac(0x18e)],this['topSide'][_0x3381ac(0x198)][_0x3381ac(0xed)]=_0x16e311['QxTXm'](_0x445d5b[_0x3381ac(0xed)],0x8)+'px',this[_0x3381ac(0x107)][_0x3381ac(0x198)][_0x3381ac(0xd3)]=_0x445d5b[_0x3381ac(0x12d)]+'px',this['topSide'][_0x3381ac(0x198)][_0x3381ac(0x150)]=_0x16e311[_0x3381ac(0x176)],this[_0x3381ac(0x174)][_0x3381ac(0x198)]['position']=_0x3381ac(0xe8),this[_0x3381ac(0x174)][_0x3381ac(0x198)]['left']=_0x16e311[_0x3381ac(0x18e)],this[_0x3381ac(0x174)]['style'][_0x3381ac(0x12d)]=_0x16e311[_0x3381ac(0x18e)],this[_0x3381ac(0x174)][_0x3381ac(0x198)][_0x3381ac(0xed)]=_0x445d5b[_0x3381ac(0x159)]+'px',this['leftSide']['style']['height']=_0x3381ac(0x1c9),this[_0x3381ac(0x174)][_0x3381ac(0x198)]['backgroundColor']=_0x16e311[_0x3381ac(0x176)],this[_0x3381ac(0x169)][_0x3381ac(0x198)][_0x3381ac(0xf9)]=_0x16e311[_0x3381ac(0x17b)],this[_0x3381ac(0x169)][_0x3381ac(0x198)][_0x3381ac(0x159)]=_0x445d5b['left']+'px',this[_0x3381ac(0x169)][_0x3381ac(0x198)][_0x3381ac(0x12d)]=_0x16e311['QxTXm'](_0x445d5b[_0x3381ac(0x1b4)],0x8)+'px',this['bottomSide'][_0x3381ac(0x198)][_0x3381ac(0xed)]=_0x445d5b['width']+0x8+'px',this[_0x3381ac(0x169)][_0x3381ac(0x198)][_0x3381ac(0xd3)]=_0x16e311[_0x3381ac(0x1c2)],this['bottomSide'][_0x3381ac(0x198)][_0x3381ac(0x150)]=_0x16e311['HukZh'],this['rightSide'][_0x3381ac(0x198)]['position']=_0x16e311[_0x3381ac(0x17b)],this[_0x3381ac(0x11f)][_0x3381ac(0x198)][_0x3381ac(0x159)]=_0x445d5b['right']+0x8+'px';;this[_0x3381ac(0x11f)]['style']['top']=_0x16e311[_0x3381ac(0x18e)],this['rightSide']['style'][_0x3381ac(0xed)]=_0x16e311[_0x3381ac(0x166)],this['rightSide'][_0x3381ac(0x198)]['height']=_0x16e311[_0x3381ac(0x1c2)],this[_0x3381ac(0x11f)][_0x3381ac(0x198)][_0x3381ac(0x150)]=_0x16e311[_0x3381ac(0x176)],this['screenshotModal']['style'][_0x3381ac(0x150)]=_0x16e311['BdcRs'];},this['handleMouseClickedSelectedElement']=_0x1037e8=>{const _0xb6cc46=_0x40cbe5;_0x1037e8[_0xb6cc46(0x1ce)]();if(this[_0xb6cc46(0x122)])this[_0xb6cc46(0x122)][_0xb6cc46(0x190)][_0xb6cc46(0x12c)](_0x16e311[_0xb6cc46(0x13d)]);let _0x1d6e91=this['elementSelected'][_0xb6cc46(0x1a4)]()[_0xb6cc46(0x12d)];this['elementSelected'][_0xb6cc46(0x198)][_0xb6cc46(0x12d)]=_0x16e311[_0xb6cc46(0x1c8)](_0x1d6e91,window[_0xb6cc46(0x141)])+'px';const _0x55aacc=this['elementSelected'][_0xb6cc46(0x1b5)](!![]);document[_0xb6cc46(0x140)]['appendChild'](_0x55aacc),this[_0xb6cc46(0x122)][_0xb6cc46(0x198)]['top']=_0x1d6e91+'px',this[_0xb6cc46(0xe9)]=_0x594d05['toPng'](document['body'],{'cacheBust':!![]})[_0xb6cc46(0x18f)](function(_0x42ba36){const _0x37d545=_0xb6cc46;return document[_0x37d545(0x140)][_0x37d545(0x1a5)](_0x55aacc),_0x42ba36;})[_0xb6cc46(0x1df)](function(_0x5337eb){const _0x305c87=_0xb6cc46;return console[_0x305c87(0xd9)](_0x16e311[_0x305c87(0x1dc)],_0x5337eb),'';});const _0x238a7a=document[_0xb6cc46(0x19c)]('html')[0x0];_0x238a7a[_0xb6cc46(0x198)][_0xb6cc46(0x1c0)]=_0xb6cc46(0x10e),this[_0xb6cc46(0x123)]=!![],this[_0xb6cc46(0x1dd)]['style'][_0xb6cc46(0x162)]=_0x16e311['tZorz'],this[_0xb6cc46(0xdf)]=!![];},this[_0x40cbe5(0x14f)]=![],this[_0x40cbe5(0x106)]='',this['formEmail']='',this['formSuccess']=![],this[_0x40cbe5(0x15e)]=![],this[_0x40cbe5(0xde)]=0x1f4,this[_0x40cbe5(0xe9)]=undefined,this[_0x40cbe5(0x163)]=_0x16e311[_0x40cbe5(0x186)],this['modalTitleSuccess']=_0x16e311[_0x40cbe5(0x1a1)],this[_0x40cbe5(0x1e0)]=_0x16e311[_0x40cbe5(0x1cc)],this['modalTitleError403']=_0x40cbe5(0x1be),this[_0x40cbe5(0x13b)]=_0x16e311[_0x40cbe5(0x115)],this['modalPosition']=_0x16e311[_0x40cbe5(0x14d)],this[_0x40cbe5(0x127)]=_0x16e311['msedN'],this[_0x40cbe5(0xf6)]='',this['screenshotButtonTooltipText']=_0x16e311['pbLVo'],this[_0x40cbe5(0xee)]=_0x16e311[_0x40cbe5(0x104)],this[_0x40cbe5(0x1ac)]='',this[_0x40cbe5(0xff)]=_0x16e311['OvWtJ'],this[_0x40cbe5(0x130)]=_0x40cbe5(0x153),this[_0x40cbe5(0xdf)]=![],this['showScreenshotMode']=![],this[_0x40cbe5(0x123)]=![],this[_0x40cbe5(0x137)]=![];}[_0x538b3b(0x197)](){const _0xdf3142=_0x538b3b;this[_0xdf3142(0x17d)]=this['email'];}[_0x538b3b(0x164)](){const _0x16384a=_0x538b3b,_0x18ee7e={'hNKCi':_0x16384a(0x1ba),'lycwk':_0x16384a(0xdd)},_0x2fea1=document[_0x16384a(0x19c)](_0x18ee7e[_0x16384a(0xf2)])[0x0];_0x2fea1[_0x16384a(0x198)][_0x16384a(0x1c0)]=_0x18ee7e['lycwk'];}[_0x538b3b(0x155)](_0x32e4fb){const _0x1de91f=_0x538b3b;this[_0x1de91f(0x106)]=_0x32e4fb[_0x1de91f(0x16f)][_0x1de91f(0x136)];}[_0x538b3b(0x144)](_0x35c965){const _0x361132=_0x538b3b;this[_0x361132(0x17d)]=_0x35c965['target'][_0x361132(0x136)];}[_0x538b3b(0x175)](){const _0x463dac=_0x538b3b,_0x26d35e={'SaOBZ':function(_0x1960ae,_0x29c63c,_0xd82297,_0x4cef36,_0x46314f){return _0x1960ae(_0x29c63c,_0xd82297,_0x4cef36,_0x46314f);},'EtRZB':'feedback-modal-wrapper','DwNkj':'div','DlrZm':'feedback-modal-screenshot','LaFsr':function(_0x446855,_0xfa315c,_0x1c1fb9){return _0x446855(_0xfa315c,_0x1c1fb9);},'RMMJE':'feedback-modal-screenshot-element-selected','iRopn':_0x463dac(0xfb),'EPHGH':'left-side','RmzkT':function(_0x433a0e,_0x223933,_0x216eb6){return _0x433a0e(_0x223933,_0x216eb6);},'EJnHi':_0x463dac(0x1db),'NpNEa':_0x463dac(0x1ab),'qgVeC':function(_0x195ea6,_0xf85b17,_0x559b44,_0x1dd497,_0x286563){return _0x195ea6(_0xf85b17,_0x559b44,_0x1dd497,_0x286563);},'bMSzb':'feedback-modal-screenshot-header','Glvju':function(_0x284254,_0x465c0e,_0x2fb832,_0xc75cae){return _0x284254(_0x465c0e,_0x2fb832,_0xc75cae);},'NkMpB':'span','IXdsM':function(_0x3f64ad,_0x287a33,_0x56256b,_0x5c05df){return _0x3f64ad(_0x287a33,_0x56256b,_0x5c05df);},'ItmDU':'http://www.w3.org/2000/svg','zPFIt':_0x463dac(0x135),'cQqoi':_0x463dac(0x18d),'gpQKg':'#fff','PZRAx':_0x463dac(0xf8),'yxSxs':_0x463dac(0x1a3),'etsRV':_0x463dac(0x14c),'DzczR':function(_0x5677c7,_0x426d8e,_0xc34506){return _0x5677c7(_0x426d8e,_0xc34506);},'uLlLu':_0x463dac(0x199),'YuSlt':function(_0x2449ce,_0x570534,_0x5892ca,_0x5acb6d,_0x13b420,_0x2d318f){return _0x2449ce(_0x570534,_0x5892ca,_0x5acb6d,_0x13b420,_0x2d318f);},'FgPAC':function(_0x390ad5,_0x76226d,_0x47b15e,_0x505ba6,_0x1e33f4){return _0x390ad5(_0x76226d,_0x47b15e,_0x505ba6,_0x1e33f4);},'zyMfB':_0x463dac(0x1b8),'iZOdX':function(_0x63e19a,_0x55e5e2,_0x5d534b,_0x36f17e){return _0x63e19a(_0x55e5e2,_0x5d534b,_0x36f17e);},'zHXKI':_0x463dac(0x118),'PueWO':function(_0x4923ed,_0x56e184){return _0x4923ed==_0x56e184;},'HJyIM':function(_0x49cb32,_0x559741){return _0x49cb32==_0x559741;},'rrcHV':function(_0x4809a7,_0x33f798,_0x564bdd,_0x3409e2){return _0x4809a7(_0x33f798,_0x564bdd,_0x3409e2);},'HwgMZ':'button','Yvvwh':'feedback-modal-close','TKywT':_0x463dac(0xfc),'fJqQI':'#ccc','GDpMa':function(_0x7fac5e,_0x20d450,_0x3f17d2,_0x5d3d5b){return _0x7fac5e(_0x20d450,_0x3f17d2,_0x5d3d5b);},'yjuUW':_0x463dac(0x1d4),'PnfDz':function(_0x1239cf,_0x4f4c88,_0x51d4b2){return _0x1239cf(_0x4f4c88,_0x51d4b2);},'pnvGm':'input','VBavC':'email','SqOnI':function(_0x208786,_0x5c8ac5,_0x51e828,_0x1423ad){return _0x208786(_0x5c8ac5,_0x51e828,_0x1423ad);},'yUYIu':'\x20active','jBlnO':function(_0xff8b2e,_0x33e981,_0x27a0fb,_0x2a62a8,_0x2329fe){return _0xff8b2e(_0x33e981,_0x27a0fb,_0x2a62a8,_0x2329fe);},'ZKLSU':_0x463dac(0x105),'MyhLz':_0x463dac(0x138),'DCHjg':function(_0x4aaf91,_0x541723,_0x4c616d){return _0x4aaf91(_0x541723,_0x4c616d);},'BDGab':_0x463dac(0x126),'NTlPx':'M23\x2019a2\x202\x200\x200\x201-2\x202H3a2\x202\x200\x200\x201-2-2V8a2\x202\x200\x200\x201\x202-2h4l2-3h6l2\x203h4a2\x202\x200\x200\x201\x202\x202z','iJpMM':function(_0xf963e1,_0x3f3bd6,_0x4e3177){return _0xf963e1(_0x3f3bd6,_0x4e3177);},'pJlRU':_0x463dac(0xf4),'KnaoZ':'submit','WWXVo':function(_0x4db22b,_0x4cf0b4,_0x5e664d,_0x1b066e,_0x3e2229){return _0x4db22b(_0x4cf0b4,_0x5e664d,_0x1b066e,_0x3e2229);},'GMHqv':_0x463dac(0xe7),'dciYx':function(_0x1913da,_0x104a85,_0x4b48d4,_0x2c362a){return _0x1913da(_0x104a85,_0x4b48d4,_0x2c362a);},'Rsrhm':'defs','hVQhx':_0x463dac(0x193),'kmFjH':_0x463dac(0x16c),'RPenZ':_0x463dac(0x1ca),'CUYCq':'79.941%','IvlQf':'footer-logo','JkyBe':'stop','ZsmoM':_0x463dac(0x18b),'nnfVj':'#81E6D9','SGKdR':_0x463dac(0x1a8),'tNYts':'#338CF5','GViEa':_0x463dac(0x17a),'TViPN':_0x463dac(0x112),'HivVr':_0x463dac(0x151),'HYeXM':function(_0xbdd2f4,_0x4a48ca,_0x5975f0,_0x259c9d){return _0xbdd2f4(_0x4a48ca,_0x5975f0,_0x259c9d);},'FwGPr':_0x463dac(0x1b1)};return _0x26d35e[_0x463dac(0xdb)](h,_0x463dac(0xd2),{'class':_0x26d35e[_0x463dac(0x13e)]},this[_0x463dac(0x1ae)]&&h(_0x26d35e[_0x463dac(0xd7)],{'class':_0x26d35e[_0x463dac(0x117)],'ref':_0x5bbef2=>this['screenshotModal']=_0x5bbef2,'onMouseMove':this[_0x463dac(0x1cf)]},_0x26d35e[_0x463dac(0x1d5)](h,_0x26d35e[_0x463dac(0xd7)],{'class':_0x26d35e[_0x463dac(0xfd)],'ref':_0x4ad6c0=>this[_0x463dac(0x122)]=_0x4ad6c0,'onClick':this['handleMouseClickedSelectedElement']}),h(_0x26d35e[_0x463dac(0xd7)],{'class':_0x26d35e[_0x463dac(0x156)],'ref':_0x470d71=>this[_0x463dac(0x107)]=_0x470d71}),_0x26d35e['LaFsr'](h,_0x463dac(0xd2),{'class':_0x26d35e[_0x463dac(0x1ad)],'ref':_0x37b91c=>this[_0x463dac(0x174)]=_0x37b91c}),_0x26d35e[_0x463dac(0x1c6)](h,_0x26d35e[_0x463dac(0xd7)],{'class':_0x26d35e[_0x463dac(0xd5)],'ref':_0x36c93c=>this[_0x463dac(0x169)]=_0x36c93c}),_0x26d35e['LaFsr'](h,_0x26d35e[_0x463dac(0xd7)],{'class':_0x26d35e[_0x463dac(0x19a)],'ref':_0x5deebf=>this[_0x463dac(0x11f)]=_0x5deebf}),_0x26d35e[_0x463dac(0xdc)](h,_0x26d35e['DwNkj'],{'class':_0x26d35e['bMSzb'],'onClick':this[_0x463dac(0x19f)]},_0x26d35e['Glvju'](h,_0x26d35e['NkMpB'],null,this[_0x463dac(0xee)]),_0x26d35e[_0x463dac(0x192)](h,_0x26d35e[_0x463dac(0x114)],{'class':'feedback-modal-screenshot-close'},_0x26d35e[_0x463dac(0xdc)](h,'svg',{'xmlns':_0x26d35e['ItmDU'],'width':'24','height':'24','viewBox':_0x26d35e[_0x463dac(0x1cd)],'fill':_0x26d35e[_0x463dac(0x1a6)],'stroke':_0x26d35e[_0x463dac(0x19b)],'stroke-width':'2','stroke-linecap':_0x26d35e[_0x463dac(0x119)],'stroke-linejoin':_0x26d35e[_0x463dac(0x119)],'class':_0x26d35e['yxSxs']},h(_0x26d35e['etsRV'],{'x1':'18','y1':'6','x2':'6','y2':'18'}),_0x26d35e['DzczR'](h,_0x26d35e['etsRV'],{'x1':'6','y1':'6','x2':'18','y2':'18'})))),_0x26d35e[_0x463dac(0x1d5)](h,_0x26d35e['DwNkj'],{'class':_0x26d35e[_0x463dac(0x101)],'ref':_0x4af047=>this[_0x463dac(0x1dd)]=_0x4af047})),this[_0x463dac(0xdf)]&&_0x26d35e['YuSlt'](h,_0x26d35e[_0x463dac(0xd7)],{'class':_0x463dac(0x102)+this[_0x463dac(0x15b)],'ref':_0x5c6c4b=>this[_0x463dac(0xd4)]=_0x5c6c4b},_0x26d35e['FgPAC'](h,_0x463dac(0xd2),{'class':_0x26d35e[_0x463dac(0x1d1)]},!this['formSuccess']&&!this[_0x463dac(0x15e)]?h(_0x463dac(0x1d8),null,this[_0x463dac(0x163)]):this[_0x463dac(0x11c)]?_0x26d35e['iZOdX'](h,_0x26d35e[_0x463dac(0x114)],{'class':_0x26d35e[_0x463dac(0x10d)]},this[_0x463dac(0xec)]):this['formError']&&_0x26d35e['PueWO'](this[_0x463dac(0xde)],0x1f4)?h(_0x26d35e[_0x463dac(0x114)],{'class':_0x26d35e[_0x463dac(0x10d)]},this[_0x463dac(0x1e0)]):this[_0x463dac(0x15e)]&&_0x26d35e['PueWO'](this['formErrorStatus'],0x193)?_0x26d35e['Glvju'](h,_0x463dac(0x1d8),{'class':_0x26d35e[_0x463dac(0x10d)]},this[_0x463dac(0x14a)]):this['formError']&&_0x26d35e['HJyIM'](this[_0x463dac(0xde)],0x194)?_0x26d35e[_0x463dac(0x15d)](h,_0x26d35e[_0x463dac(0x114)],{'class':_0x463dac(0x118)},this['modalTitleError404']):h(_0x26d35e[_0x463dac(0x114)],null),_0x26d35e['rrcHV'](h,_0x26d35e[_0x463dac(0x188)],{'class':_0x26d35e[_0x463dac(0xda)],'onClick':this[_0x463dac(0x17c)]},h(_0x26d35e[_0x463dac(0x11b)],{'xmlns':_0x26d35e[_0x463dac(0x191)],'width':'24','height':'24','viewBox':_0x26d35e[_0x463dac(0x1cd)],'fill':_0x26d35e[_0x463dac(0x1a6)],'stroke':_0x26d35e[_0x463dac(0x179)],'stroke-width':'2','stroke-linecap':_0x463dac(0xf8),'stroke-linejoin':_0x26d35e[_0x463dac(0x119)],'class':'feather\x20feather-x'},h(_0x26d35e[_0x463dac(0x1b3)],{'x1':'18','y1':'6','x2':'6','y2':'18'}),h(_0x26d35e[_0x463dac(0x1b3)],{'x1':'6','y1':'6','x2':'18','y2':'18'})))),_0x26d35e['IXdsM'](h,_0x26d35e[_0x463dac(0xd7)],{'class':_0x463dac(0x16e)},!this[_0x463dac(0x11c)]&&!this[_0x463dac(0x15e)]?h(_0x463dac(0x10f),{'onSubmit':this[_0x463dac(0xeb)]},_0x26d35e[_0x463dac(0x125)](h,_0x26d35e[_0x463dac(0xd7)],{'class':_0x463dac(0x1d2)},h('textarea',{'placeholder':this[_0x463dac(0x130)],'value':this[_0x463dac(0x106)],'onInput':_0x127fe1=>this[_0x463dac(0x155)](_0x127fe1),'required':!![]})),!this[_0x463dac(0x1ac)]&&_0x26d35e[_0x463dac(0x125)](h,_0x26d35e[_0x463dac(0xd7)],{'class':_0x26d35e[_0x463dac(0x142)]},_0x26d35e[_0x463dac(0x165)](h,_0x26d35e[_0x463dac(0xf3)],{'type':_0x26d35e['VBavC'],'placeholder':this['emailPlaceholder'],'onInput':_0x2a079c=>this[_0x463dac(0x144)](_0x2a079c),'value':this['formEmail']})),h(_0x26d35e[_0x463dac(0xd7)],{'class':_0x463dac(0x1bb)+(this['hideScreenshotButton']?_0x463dac(0x17e):'')},!this[_0x463dac(0x137)]&&_0x26d35e[_0x463dac(0x143)](h,_0x26d35e[_0x463dac(0x188)],{'type':_0x26d35e[_0x463dac(0x188)],'class':_0x463dac(0x170)+(this[_0x463dac(0xe9)]?_0x26d35e[_0x463dac(0x14e)]:''),'title':this[_0x463dac(0x168)],'onClick':this[_0x463dac(0x10c)],'disabled':this[_0x463dac(0x14f)]},_0x26d35e[_0x463dac(0x1b0)](h,_0x26d35e['TKywT'],{'xmlns':_0x26d35e['ItmDU'],'width':'24','height':'24','viewBox':_0x26d35e['zPFIt'],'fill':_0x26d35e['cQqoi'],'stroke':_0x26d35e[_0x463dac(0xef)],'stroke-width':'2','stroke-linecap':_0x26d35e[_0x463dac(0x119)],'stroke-linejoin':_0x26d35e[_0x463dac(0x119)],'class':_0x26d35e[_0x463dac(0x1b9)]},_0x26d35e['DCHjg'](h,_0x26d35e[_0x463dac(0x161)],{'d':_0x26d35e['NTlPx']}),_0x26d35e[_0x463dac(0xfe)](h,_0x26d35e['pJlRU'],{'cx':'12','cy':'13','r':'4'}))),_0x26d35e[_0x463dac(0x143)](h,_0x463dac(0x170),{'class':'button','type':_0x26d35e[_0x463dac(0x1c5)],'disabled':this['sending']},this[_0x463dac(0x127)]))):_0x26d35e[_0x463dac(0x1cb)](h,_0x463dac(0x1d8),null)),_0x26d35e['SqOnI'](h,_0x26d35e[_0x463dac(0xd7)],{'class':_0x463dac(0xe5)},h(_0x26d35e['DwNkj'],{'class':'feedback-logo'},_0x26d35e[_0x463dac(0x121)](h,_0x26d35e['TKywT'],{'class':_0x26d35e[_0x463dac(0x181)],'viewBox':_0x463dac(0x1bd),'xmlns':_0x26d35e[_0x463dac(0x191)]},_0x26d35e['dciYx'](h,_0x26d35e[_0x463dac(0x100)],null,_0x26d35e[_0x463dac(0xf0)](h,_0x26d35e[_0x463dac(0x145)],{'cx':_0x26d35e[_0x463dac(0x15c)],'cy':_0x26d35e['RPenZ'],'fx':_0x26d35e[_0x463dac(0x15c)],'fy':_0x463dac(0x1ca),'r':_0x26d35e['CUYCq'],'id':_0x26d35e[_0x463dac(0x1d3)]},_0x26d35e['RmzkT'](h,_0x26d35e[_0x463dac(0x1c4)],{'stop-color':_0x26d35e[_0x463dac(0x1b7)],'offset':'0%'}),_0x26d35e[_0x463dac(0xd8)](h,_0x26d35e[_0x463dac(0x1c4)],{'stop-color':_0x26d35e['nnfVj'],'offset':_0x26d35e[_0x463dac(0x1da)]}),h(_0x26d35e['JkyBe'],{'stop-color':_0x26d35e['tNYts'],'offset':_0x26d35e[_0x463dac(0x13c)]}))),_0x26d35e['iJpMM'](h,_0x26d35e[_0x463dac(0x1c1)],{'width':'32','height':'32','rx':'16','fill':_0x26d35e['HivVr'],'fill-rule':_0x463dac(0x1af)})),'\x20',_0x26d35e[_0x463dac(0x18a)](h,'a',{'href':_0x26d35e['FwGPr']},_0x463dac(0xf7))))));}static get['is'](){const _0x163e0f=_0x538b3b,_0x35e925={'KNbIx':_0x163e0f(0x133)};return _0x35e925['KNbIx'];}static get['encapsulation'](){const _0x24b207=_0x538b3b,_0x412832={'KogtA':_0x24b207(0x109)};return _0x412832[_0x24b207(0x128)];}static get[_0x538b3b(0x195)](){const _0x135c79=_0x538b3b;return{'$':[_0x135c79(0xd6)]};}static get[_0x538b3b(0x16b)](){const _0x1d6fa4=_0x538b3b;return{'$':[_0x1d6fa4(0xd6)]};}static get[_0x538b3b(0x12e)](){const _0x4f5dd1=_0x538b3b,_0x10342b={'MydcN':_0x4f5dd1(0x147),'xppcK':'modal-title','AKsfo':_0x4f5dd1(0x16d),'onGHa':_0x4f5dd1(0x178),'xSyVB':_0x4f5dd1(0xe4),'hoUfr':'modal-title-error','KrDRD':_0x4f5dd1(0xe2),'hrafT':_0x4f5dd1(0x196),'kThcQ':_0x4f5dd1(0x19d),'LpeGZ':'\x22Oops!\x20We\x20could\x20not\x20find\x20the\x20provided\x20project\x20id\x20in\x20PushFeedback.\x22','BIqQk':_0x4f5dd1(0x157),'cyLip':'send-button-text','sXLVe':_0x4f5dd1(0xf1),'SjcyP':_0x4f5dd1(0x11d),'ptWkd':'\x27Take\x20a\x20Screenshot\x27','KiWwW':_0x4f5dd1(0xe0),'liIPm':_0x4f5dd1(0x1ac),'bElaF':'email-placeholder','zAcgI':'\x27Email\x20address\x20(optional)\x27','ZdoBN':_0x4f5dd1(0x152),'blLCc':_0x4f5dd1(0x167),'jarGc':_0x4f5dd1(0x139),'oTGZL':'show-modal','HqAMG':_0x4f5dd1(0x113),'RFzgF':_0x4f5dd1(0x10b),'ftPyv':_0x4f5dd1(0x183),'iWuOw':_0x4f5dd1(0x124)};return{'modalTitle':{'type':_0x10342b[_0x4f5dd1(0x10a)],'mutable':![],'complexType':{'original':'string','resolved':_0x4f5dd1(0x147),'references':{}},'required':![],'optional':![],'docs':{'tags':[],'text':''},'attribute':_0x10342b[_0x4f5dd1(0x1d6)],'reflect':![],'defaultValue':_0x10342b[_0x4f5dd1(0x13a)]},'modalTitleSuccess':{'type':_0x10342b[_0x4f5dd1(0x10a)],'mutable':![],'complexType':{'original':_0x10342b['MydcN'],'resolved':_0x10342b[_0x4f5dd1(0x10a)],'references':{}},'required':![],'optional':![],'docs':{'tags':[],'text':''},'attribute':_0x10342b[_0x4f5dd1(0x1bc)],'reflect':![],'defaultValue':_0x10342b['xSyVB']},'modalTitleError':{'type':_0x4f5dd1(0x147),'mutable':![],'complexType':{'original':_0x10342b[_0x4f5dd1(0x10a)],'resolved':_0x10342b['MydcN'],'references':{}},'required':![],'optional':![],'docs':{'tags':[],'text':''},'attribute':_0x10342b[_0x4f5dd1(0x108)],'reflect':![],'defaultValue':_0x10342b[_0x4f5dd1(0x17f)]},'modalTitleError403':{'type':_0x10342b[_0x4f5dd1(0x10a)],'mutable':![],'complexType':{'original':_0x10342b[_0x4f5dd1(0x10a)],'resolved':_0x10342b[_0x4f5dd1(0x10a)],'references':{}},'required':![],'optional':![],'docs':{'tags':[],'text':''},'attribute':_0x10342b[_0x4f5dd1(0xe1)],'reflect':![],'defaultValue':_0x4f5dd1(0x129)},'modalTitleError404':{'type':_0x10342b['MydcN'],'mutable':![],'complexType':{'original':_0x4f5dd1(0x147),'resolved':_0x4f5dd1(0x147),'references':{}},'required':![],'optional':![],'docs':{'tags':[],'text':''},'attribute':_0x10342b[_0x4f5dd1(0x180)],'reflect':![],'defaultValue':_0x10342b[_0x4f5dd1(0x14b)]},'modalPosition':{'type':_0x10342b[_0x4f5dd1(0x10a)],'mutable':![],'complexType':{'original':_0x10342b[_0x4f5dd1(0x10a)],'resolved':_0x10342b[_0x4f5dd1(0x10a)],'references':{}},'required':![],'optional':![],'docs':{'tags':[],'text':''},'attribute':_0x10342b[_0x4f5dd1(0xfa)],'reflect':![],'defaultValue':_0x4f5dd1(0x1a2)},'sendButtonText':{'type':_0x10342b[_0x4f5dd1(0x10a)],'mutable':![],'complexType':{'original':_0x10342b['MydcN'],'resolved':_0x10342b[_0x4f5dd1(0x10a)],'references':{}},'required':![],'optional':![],'docs':{'tags':[],'text':''},'attribute':_0x10342b[_0x4f5dd1(0x173)],'reflect':![],'defaultValue':_0x10342b[_0x4f5dd1(0x103)]},'project':{'type':_0x10342b['MydcN'],'mutable':![],'complexType':{'original':_0x10342b['MydcN'],'resolved':_0x4f5dd1(0x147),'references':{}},'required':![],'optional':![],'docs':{'tags':[],'text':''},'attribute':_0x4f5dd1(0xf6),'reflect':![],'defaultValue':'\x27\x27'},'screenshotButtonTooltipText':{'type':_0x4f5dd1(0x147),'mutable':![],'complexType':{'original':_0x10342b[_0x4f5dd1(0x10a)],'resolved':_0x10342b[_0x4f5dd1(0x10a)],'references':{}},'required':![],'optional':![],'docs':{'tags':[],'text':''},'attribute':_0x10342b[_0x4f5dd1(0x1bf)],'reflect':![],'defaultValue':_0x10342b['ptWkd']},'screenshotTopbarText':{'type':_0x10342b[_0x4f5dd1(0x10a)],'mutable':![],'complexType':{'original':_0x10342b['MydcN'],'resolved':_0x10342b['MydcN'],'references':{}},'required':![],'optional':![],'docs':{'tags':[],'text':''},'attribute':_0x4f5dd1(0x16a),'reflect':![],'defaultValue':_0x10342b['KiWwW']},'email':{'type':_0x10342b['MydcN'],'mutable':![],'complexType':{'original':_0x10342b[_0x4f5dd1(0x10a)],'resolved':_0x10342b[_0x4f5dd1(0x10a)],'references':{}},'required':![],'optional':![],'docs':{'tags':[],'text':''},'attribute':_0x10342b[_0x4f5dd1(0x11a)],'reflect':![],'defaultValue':'\x27\x27'},'emailPlaceholder':{'type':_0x4f5dd1(0x147),'mutable':![],'complexType':{'original':_0x4f5dd1(0x147),'resolved':_0x10342b[_0x4f5dd1(0x10a)],'references':{}},'required':![],'optional':![],'docs':{'tags':[],'text':''},'attribute':_0x10342b['bElaF'],'reflect':![],'defaultValue':_0x10342b[_0x4f5dd1(0x149)]},'messagePlaceholder':{'type':_0x10342b[_0x4f5dd1(0x10a)],'mutable':![],'complexType':{'original':_0x4f5dd1(0x147),'resolved':_0x10342b[_0x4f5dd1(0x10a)],'references':{}},'required':![],'optional':![],'docs':{'tags':[],'text':''},'attribute':_0x10342b[_0x4f5dd1(0x189)],'reflect':![],'defaultValue':_0x10342b[_0x4f5dd1(0x1a9)]},'showModal':{'type':_0x10342b['jarGc'],'mutable':!![],'complexType':{'original':_0x10342b[_0x4f5dd1(0x1d0)],'resolved':_0x10342b[_0x4f5dd1(0x1d0)],'references':{}},'required':![],'optional':![],'docs':{'tags':[],'text':''},'attribute':_0x10342b[_0x4f5dd1(0x1b6)],'reflect':!![],'defaultValue':'false'},'showScreenshotMode':{'type':_0x10342b[_0x4f5dd1(0x1d0)],'mutable':!![],'complexType':{'original':_0x4f5dd1(0x139),'resolved':_0x10342b[_0x4f5dd1(0x1d0)],'references':{}},'required':![],'optional':![],'docs':{'tags':[],'text':''},'attribute':_0x10342b[_0x4f5dd1(0x120)],'reflect':!![],'defaultValue':_0x10342b[_0x4f5dd1(0x134)]},'hasSelectedElement':{'type':_0x10342b[_0x4f5dd1(0x1d0)],'mutable':!![],'complexType':{'original':_0x10342b[_0x4f5dd1(0x1d0)],'resolved':_0x10342b[_0x4f5dd1(0x1d0)],'references':{}},'required':![],'optional':![],'docs':{'tags':[],'text':''},'attribute':_0x10342b['ftPyv'],'reflect':!![],'defaultValue':_0x10342b[_0x4f5dd1(0x134)]},'hideScreenshotButton':{'type':_0x10342b[_0x4f5dd1(0x1d0)],'mutable':![],'complexType':{'original':_0x10342b[_0x4f5dd1(0x1d0)],'resolved':_0x4f5dd1(0x139),'references':{}},'required':![],'optional':![],'docs':{'tags':[],'text':''},'attribute':_0x10342b[_0x4f5dd1(0x185)],'reflect':![],'defaultValue':_0x10342b[_0x4f5dd1(0x134)]}};}static get[_0x538b3b(0x1a0)](){return{'sending':{},'formMessage':{},'formEmail':{},'formSuccess':{},'formError':{},'formErrorStatus':{},'encodedScreenshot':{}};}}
1
+ import { h } from '@stencil/core';
2
+ import html2canvas from 'html2canvas';
3
+ export class FeedbackModal {
4
+ constructor() {
5
+ this.handleSubmit = async (event) => {
6
+ event.preventDefault();
7
+ this.resetOverflow();
8
+ this.showScreenshotMode = false;
9
+ this.showModal = false;
10
+ this.sending = true;
11
+ try {
12
+ const res = await fetch('https://app.pushfeedback.com/api/feedback/', {
13
+ method: 'POST',
14
+ body: JSON.stringify({
15
+ url: window.location.href,
16
+ message: this.formMessage,
17
+ email: this.formEmail,
18
+ project: this.project,
19
+ screenshot: this.encodedScreenshot
20
+ }),
21
+ headers: {
22
+ 'Content-Type': 'application/json'
23
+ }
24
+ });
25
+ if (res.status === 201) {
26
+ this.formSuccess = true;
27
+ this.formError = false;
28
+ }
29
+ else {
30
+ this.formSuccess = false;
31
+ this.formError = true;
32
+ this.formErrorStatus = res.status;
33
+ }
34
+ }
35
+ catch (error) {
36
+ console.log(error);
37
+ this.formSuccess = false;
38
+ this.formError = true;
39
+ this.formErrorStatus = 500;
40
+ }
41
+ finally {
42
+ this.sending = false;
43
+ this.showModal = true;
44
+ }
45
+ };
46
+ this.close = () => {
47
+ this.sending = false;
48
+ this.showModal = false;
49
+ this.showScreenshotMode = false;
50
+ this.hasSelectedElement = false;
51
+ this.encodedScreenshot = null;
52
+ this.formSuccess = false;
53
+ this.formError = false;
54
+ this.formErrorStatus = 500;
55
+ this.formMessage = '';
56
+ this.formEmail = '';
57
+ this.resetOverflow();
58
+ };
59
+ this.openScreenShot = () => {
60
+ this.hasSelectedElement = false;
61
+ this.showModal = false;
62
+ this.showScreenshotMode = true;
63
+ this.encodedScreenshot = null;
64
+ this.resetOverflow();
65
+ };
66
+ this.closeScreenShot = () => {
67
+ this.showModal = false;
68
+ this.showScreenshotMode = false;
69
+ this.hasSelectedElement = false;
70
+ this.encodedScreenshot = null;
71
+ this.overlay.style.display = 'none';
72
+ this.resetOverflow();
73
+ };
74
+ this.handleMouseOverScreenShot = (event) => {
75
+ event.preventDefault();
76
+ if (this.hasSelectedElement)
77
+ return;
78
+ this.overlay.style.display = 'none';
79
+ this.screenshotModal.style.display = 'none';
80
+ const elementUnder = document.elementFromPoint(event.clientX, event.clientY);
81
+ const rect = elementUnder.getBoundingClientRect();
82
+ this.screenshotModal.style.display = '';
83
+ // Get the bounding box of the element selected
84
+ this.elementSelected.style.position = "absolute";
85
+ this.elementSelected.style.left = `${rect.left}px`;
86
+ this.elementSelected.style.top = `${rect.top}px`;
87
+ this.elementSelected.style.width = `${rect.width}px`;
88
+ this.elementSelected.style.height = `${rect.height}px`;
89
+ this.elementSelected.classList.add('feedback-modal-element-hover');
90
+ // Set the background color of nonselected areas
91
+ // Top
92
+ this.topSide.style.position = "absolute";
93
+ this.topSide.style.left = `${rect.left}px`;
94
+ this.topSide.style.top = '0px';
95
+ this.topSide.style.width = `${rect.width + 8}px`;
96
+ this.topSide.style.height = `${rect.top}px`;
97
+ this.topSide.style.backgroundColor = "rgba(0, 0, 0, 0.3)";
98
+ // Left
99
+ this.leftSide.style.position = "absolute";
100
+ this.leftSide.style.left = '0px';
101
+ this.leftSide.style.top = '0px';
102
+ this.leftSide.style.width = `${rect.left}px`;
103
+ this.leftSide.style.height = '100vh';
104
+ this.leftSide.style.backgroundColor = "rgba(0, 0, 0, 0.3)";
105
+ // Bottom
106
+ this.bottomSide.style.position = "absolute";
107
+ this.bottomSide.style.left = `${rect.left}px`;
108
+ this.bottomSide.style.top = `${rect.bottom + 8}px`;
109
+ this.bottomSide.style.width = `${rect.width + 8}px`;
110
+ this.bottomSide.style.height = '100vh';
111
+ this.bottomSide.style.backgroundColor = "rgba(0, 0, 0, 0.3)";
112
+ // Right
113
+ this.rightSide.style.position = "absolute";
114
+ this.rightSide.style.left = `${rect.right + 8}px`;
115
+ ;
116
+ this.rightSide.style.top = '0px';
117
+ this.rightSide.style.width = '100%';
118
+ this.rightSide.style.height = '100vh';
119
+ this.rightSide.style.backgroundColor = "rgba(0, 0, 0, 0.3)";
120
+ // Restore the visibility of the screenshot-modal
121
+ this.screenshotModal.style.backgroundColor = 'transparent';
122
+ };
123
+ this.handleMouseClickedSelectedElement = (event) => {
124
+ event.preventDefault();
125
+ if (this.elementSelected) {
126
+ this.elementSelected.classList.add('feedback-modal-element-selected');
127
+ }
128
+ let top = this.elementSelected.getBoundingClientRect().top;
129
+ this.elementSelected.style.top = `${top + window.scrollY}px`;
130
+ const clonedElementSelected = this.elementSelected.cloneNode(true);
131
+ document.body.appendChild(clonedElementSelected);
132
+ this.elementSelected.style.top = `${top}px`;
133
+ html2canvas(document.body).then((canvas) => {
134
+ this.encodedScreenshot = canvas.toDataURL();
135
+ document.body.removeChild(clonedElementSelected);
136
+ const page = document.getElementsByTagName('html')[0];
137
+ page.style.overflow = 'hidden';
138
+ this.hasSelectedElement = true;
139
+ this.overlay.style.display = 'block';
140
+ this.showModal = true;
141
+ }).catch((error) => {
142
+ console.log(error);
143
+ return "";
144
+ });
145
+ };
146
+ this.sending = false;
147
+ this.formMessage = '';
148
+ this.formEmail = '';
149
+ this.formSuccess = false;
150
+ this.formError = false;
151
+ this.formErrorStatus = 500;
152
+ this.encodedScreenshot = undefined;
153
+ this.modalTitle = 'Share your feedback';
154
+ this.modalTitleSuccess = 'Thanks for your feedback!';
155
+ this.modalTitleError = "Oops! We didn't receive your feedback. Please try again later.";
156
+ this.modalTitleError403 = "Oops! The request URL does not match the one defined in PushFeedback for this project.";
157
+ this.modalTitleError404 = "Oops! We could not find the provided project id in PushFeedback.";
158
+ this.modalPosition = 'center';
159
+ this.sendButtonText = 'Send';
160
+ this.project = '';
161
+ this.screenshotButtonTooltipText = 'Take a Screenshot';
162
+ this.screenshotTopbarText = 'SELECT AN ELEMENT ON THE PAGE';
163
+ this.email = '';
164
+ this.emailPlaceholder = 'Email address (optional)';
165
+ this.messagePlaceholder = 'How could this page be more helpful?';
166
+ this.showModal = false;
167
+ this.showScreenshotMode = false;
168
+ this.hasSelectedElement = false;
169
+ this.hideScreenshotButton = false;
170
+ }
171
+ componentWillLoad() {
172
+ this.formEmail = this.email;
173
+ }
174
+ resetOverflow() {
175
+ const page = document.getElementsByTagName('html')[0];
176
+ page.style.overflow = 'inherit';
177
+ }
178
+ handleMessageInput(event) {
179
+ this.formMessage = event.target.value;
180
+ }
181
+ handleEmailInput(event) {
182
+ this.formEmail = event.target.value;
183
+ }
184
+ render() {
185
+ return (h("div", { class: "feedback-modal-wrapper" }, this.showScreenshotMode && (h("div", { class: "feedback-modal-screenshot", ref: el => (this.screenshotModal = el), onMouseMove: this.handleMouseOverScreenShot }, h("div", { class: "feedback-modal-screenshot-element-selected", ref: el => (this.elementSelected = el), onClick: this.handleMouseClickedSelectedElement }), h("div", { class: "top-side", ref: el => (this.topSide = el) }), h("div", { class: "left-side", ref: el => (this.leftSide = el) }), h("div", { class: "bottom-side", ref: el => (this.bottomSide = el) }), h("div", { class: "right-side", ref: el => (this.rightSide = el) }), h("div", { class: "feedback-modal-screenshot-header", onClick: this.closeScreenShot }, h("span", null, this.screenshotTopbarText), h("span", { class: "feedback-modal-screenshot-close" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "#fff", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", class: "feather feather-x" }, h("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), h("line", { x1: "6", y1: "6", x2: "18", y2: "18" })))), h("div", { class: "feedback-modal-screenshot-overlay", ref: el => (this.overlay = el) }))), this.showModal && (h("div", { class: `feedback-modal-content feedback-modal-content--${this.modalPosition}`, ref: el => (this.modalContent = el) }, h("div", { class: "feedback-modal-header" }, !this.formSuccess && !this.formError ? (h("span", null, this.modalTitle)) : this.formSuccess ? (h("span", { class: "text-center" }, this.modalTitleSuccess)) : this.formError && this.formErrorStatus == 500 ? (h("span", { class: "text-center" }, this.modalTitleError)) : this.formError && this.formErrorStatus == 403 ? (h("span", { class: "text-center" }, this.modalTitleError403)) : this.formError && this.formErrorStatus == 404 ? (h("span", { class: "text-center" }, this.modalTitleError404)) : h("span", null), h("button", { class: "feedback-modal-close", onClick: this.close }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "#ccc", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", class: "feather feather-x" }, h("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), h("line", { x1: "6", y1: "6", x2: "18", y2: "18" })))), h("div", { class: "feedback-modal-body" }, !this.formSuccess && !this.formError ? (h("form", { onSubmit: this.handleSubmit }, h("div", { class: "feedback-modal-text" }, h("textarea", { placeholder: this.messagePlaceholder, value: this.formMessage, onInput: (event) => this.handleMessageInput(event), required: true })), !this.email && (h("div", { class: "feedback-modal-email" }, h("input", { type: "email", placeholder: this.emailPlaceholder, onInput: (event) => this.handleEmailInput(event), value: this.formEmail }))), h("div", { class: `feedback-modal-buttons ${this.hideScreenshotButton ? 'single' : ''}` }, !this.hideScreenshotButton && (h("button", { type: "button", class: `button${this.encodedScreenshot ? " active" : ""}`, title: this.screenshotButtonTooltipText, onClick: this.openScreenShot, disabled: this.sending }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", class: "feather feather-camera" }, h("path", { d: "M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z" }), h("circle", { cx: "12", cy: "13", r: "4" })))), h("button", { class: "button", type: "submit", disabled: this.sending }, this.sendButtonText)))) : h("span", null)), h("div", { class: "feedback-modal-footer" }, h("div", { class: "feedback-logo" }, h("svg", { class: "w-8 h-8", viewBox: "0 0 32 32", xmlns: "http://www.w3.org/2000/svg" }, h("defs", null, h("radialGradient", { cx: "21.152%", cy: "86.063%", fx: "21.152%", fy: "86.063%", r: "79.941%", id: "footer-logo" }, h("stop", { "stop-color": "#4FD1C5", offset: "0%" }), h("stop", { "stop-color": "#81E6D9", offset: "25.871%" }), h("stop", { "stop-color": "#338CF5", offset: "100%" }))), h("rect", { width: "32", height: "32", rx: "16", fill: "url(#footer-logo)", "fill-rule": "nonzero" })), " ", h("a", { href: "https://pushfeedback.com" }, "PushFeedback")))))));
186
+ }
187
+ static get is() { return "feedback-modal"; }
188
+ static get encapsulation() { return "shadow"; }
189
+ static get originalStyleUrls() {
190
+ return {
191
+ "$": ["feedback-modal.css"]
192
+ };
193
+ }
194
+ static get styleUrls() {
195
+ return {
196
+ "$": ["feedback-modal.css"]
197
+ };
198
+ }
199
+ static get properties() {
200
+ return {
201
+ "modalTitle": {
202
+ "type": "string",
203
+ "mutable": false,
204
+ "complexType": {
205
+ "original": "string",
206
+ "resolved": "string",
207
+ "references": {}
208
+ },
209
+ "required": false,
210
+ "optional": false,
211
+ "docs": {
212
+ "tags": [],
213
+ "text": ""
214
+ },
215
+ "attribute": "modal-title",
216
+ "reflect": false,
217
+ "defaultValue": "'Share your feedback'"
218
+ },
219
+ "modalTitleSuccess": {
220
+ "type": "string",
221
+ "mutable": false,
222
+ "complexType": {
223
+ "original": "string",
224
+ "resolved": "string",
225
+ "references": {}
226
+ },
227
+ "required": false,
228
+ "optional": false,
229
+ "docs": {
230
+ "tags": [],
231
+ "text": ""
232
+ },
233
+ "attribute": "modal-title-success",
234
+ "reflect": false,
235
+ "defaultValue": "'Thanks for your feedback!'"
236
+ },
237
+ "modalTitleError": {
238
+ "type": "string",
239
+ "mutable": false,
240
+ "complexType": {
241
+ "original": "string",
242
+ "resolved": "string",
243
+ "references": {}
244
+ },
245
+ "required": false,
246
+ "optional": false,
247
+ "docs": {
248
+ "tags": [],
249
+ "text": ""
250
+ },
251
+ "attribute": "modal-title-error",
252
+ "reflect": false,
253
+ "defaultValue": "\"Oops! We didn't receive your feedback. Please try again later.\""
254
+ },
255
+ "modalTitleError403": {
256
+ "type": "string",
257
+ "mutable": false,
258
+ "complexType": {
259
+ "original": "string",
260
+ "resolved": "string",
261
+ "references": {}
262
+ },
263
+ "required": false,
264
+ "optional": false,
265
+ "docs": {
266
+ "tags": [],
267
+ "text": ""
268
+ },
269
+ "attribute": "modal-title-error-4-0-3",
270
+ "reflect": false,
271
+ "defaultValue": "\"Oops! The request URL does not match the one defined in PushFeedback for this project.\""
272
+ },
273
+ "modalTitleError404": {
274
+ "type": "string",
275
+ "mutable": false,
276
+ "complexType": {
277
+ "original": "string",
278
+ "resolved": "string",
279
+ "references": {}
280
+ },
281
+ "required": false,
282
+ "optional": false,
283
+ "docs": {
284
+ "tags": [],
285
+ "text": ""
286
+ },
287
+ "attribute": "modal-title-error-4-0-4",
288
+ "reflect": false,
289
+ "defaultValue": "\"Oops! We could not find the provided project id in PushFeedback.\""
290
+ },
291
+ "modalPosition": {
292
+ "type": "string",
293
+ "mutable": false,
294
+ "complexType": {
295
+ "original": "string",
296
+ "resolved": "string",
297
+ "references": {}
298
+ },
299
+ "required": false,
300
+ "optional": false,
301
+ "docs": {
302
+ "tags": [],
303
+ "text": ""
304
+ },
305
+ "attribute": "modal-position",
306
+ "reflect": false,
307
+ "defaultValue": "'center'"
308
+ },
309
+ "sendButtonText": {
310
+ "type": "string",
311
+ "mutable": false,
312
+ "complexType": {
313
+ "original": "string",
314
+ "resolved": "string",
315
+ "references": {}
316
+ },
317
+ "required": false,
318
+ "optional": false,
319
+ "docs": {
320
+ "tags": [],
321
+ "text": ""
322
+ },
323
+ "attribute": "send-button-text",
324
+ "reflect": false,
325
+ "defaultValue": "'Send'"
326
+ },
327
+ "project": {
328
+ "type": "string",
329
+ "mutable": false,
330
+ "complexType": {
331
+ "original": "string",
332
+ "resolved": "string",
333
+ "references": {}
334
+ },
335
+ "required": false,
336
+ "optional": false,
337
+ "docs": {
338
+ "tags": [],
339
+ "text": ""
340
+ },
341
+ "attribute": "project",
342
+ "reflect": false,
343
+ "defaultValue": "''"
344
+ },
345
+ "screenshotButtonTooltipText": {
346
+ "type": "string",
347
+ "mutable": false,
348
+ "complexType": {
349
+ "original": "string",
350
+ "resolved": "string",
351
+ "references": {}
352
+ },
353
+ "required": false,
354
+ "optional": false,
355
+ "docs": {
356
+ "tags": [],
357
+ "text": ""
358
+ },
359
+ "attribute": "screenshot-button-tooltip-text",
360
+ "reflect": false,
361
+ "defaultValue": "'Take a Screenshot'"
362
+ },
363
+ "screenshotTopbarText": {
364
+ "type": "string",
365
+ "mutable": false,
366
+ "complexType": {
367
+ "original": "string",
368
+ "resolved": "string",
369
+ "references": {}
370
+ },
371
+ "required": false,
372
+ "optional": false,
373
+ "docs": {
374
+ "tags": [],
375
+ "text": ""
376
+ },
377
+ "attribute": "screenshot-topbar-text",
378
+ "reflect": false,
379
+ "defaultValue": "'SELECT AN ELEMENT ON THE PAGE'"
380
+ },
381
+ "email": {
382
+ "type": "string",
383
+ "mutable": false,
384
+ "complexType": {
385
+ "original": "string",
386
+ "resolved": "string",
387
+ "references": {}
388
+ },
389
+ "required": false,
390
+ "optional": false,
391
+ "docs": {
392
+ "tags": [],
393
+ "text": ""
394
+ },
395
+ "attribute": "email",
396
+ "reflect": false,
397
+ "defaultValue": "''"
398
+ },
399
+ "emailPlaceholder": {
400
+ "type": "string",
401
+ "mutable": false,
402
+ "complexType": {
403
+ "original": "string",
404
+ "resolved": "string",
405
+ "references": {}
406
+ },
407
+ "required": false,
408
+ "optional": false,
409
+ "docs": {
410
+ "tags": [],
411
+ "text": ""
412
+ },
413
+ "attribute": "email-placeholder",
414
+ "reflect": false,
415
+ "defaultValue": "'Email address (optional)'"
416
+ },
417
+ "messagePlaceholder": {
418
+ "type": "string",
419
+ "mutable": false,
420
+ "complexType": {
421
+ "original": "string",
422
+ "resolved": "string",
423
+ "references": {}
424
+ },
425
+ "required": false,
426
+ "optional": false,
427
+ "docs": {
428
+ "tags": [],
429
+ "text": ""
430
+ },
431
+ "attribute": "message-placeholder",
432
+ "reflect": false,
433
+ "defaultValue": "'How could this page be more helpful?'"
434
+ },
435
+ "showModal": {
436
+ "type": "boolean",
437
+ "mutable": true,
438
+ "complexType": {
439
+ "original": "boolean",
440
+ "resolved": "boolean",
441
+ "references": {}
442
+ },
443
+ "required": false,
444
+ "optional": false,
445
+ "docs": {
446
+ "tags": [],
447
+ "text": ""
448
+ },
449
+ "attribute": "show-modal",
450
+ "reflect": true,
451
+ "defaultValue": "false"
452
+ },
453
+ "showScreenshotMode": {
454
+ "type": "boolean",
455
+ "mutable": true,
456
+ "complexType": {
457
+ "original": "boolean",
458
+ "resolved": "boolean",
459
+ "references": {}
460
+ },
461
+ "required": false,
462
+ "optional": false,
463
+ "docs": {
464
+ "tags": [],
465
+ "text": ""
466
+ },
467
+ "attribute": "show-screenshot-mode",
468
+ "reflect": true,
469
+ "defaultValue": "false"
470
+ },
471
+ "hasSelectedElement": {
472
+ "type": "boolean",
473
+ "mutable": true,
474
+ "complexType": {
475
+ "original": "boolean",
476
+ "resolved": "boolean",
477
+ "references": {}
478
+ },
479
+ "required": false,
480
+ "optional": false,
481
+ "docs": {
482
+ "tags": [],
483
+ "text": ""
484
+ },
485
+ "attribute": "has-selected-element",
486
+ "reflect": true,
487
+ "defaultValue": "false"
488
+ },
489
+ "hideScreenshotButton": {
490
+ "type": "boolean",
491
+ "mutable": false,
492
+ "complexType": {
493
+ "original": "boolean",
494
+ "resolved": "boolean",
495
+ "references": {}
496
+ },
497
+ "required": false,
498
+ "optional": false,
499
+ "docs": {
500
+ "tags": [],
501
+ "text": ""
502
+ },
503
+ "attribute": "hide-screenshot-button",
504
+ "reflect": false,
505
+ "defaultValue": "false"
506
+ }
507
+ };
508
+ }
509
+ static get states() {
510
+ return {
511
+ "sending": {},
512
+ "formMessage": {},
513
+ "formEmail": {},
514
+ "formSuccess": {},
515
+ "formError": {},
516
+ "formErrorStatus": {},
517
+ "encodedScreenshot": {}
518
+ };
519
+ }
520
+ }
@@ -1 +1 @@
1
- (function(_0x59fc51,_0x38a345){var _0x21ca7a=_0x1774,_0x35577b=_0x59fc51();while(!![]){try{var _0x22c49e=-parseInt(_0x21ca7a(0x185))/0x1*(parseInt(_0x21ca7a(0x18a))/0x2)+-parseInt(_0x21ca7a(0x18b))/0x3*(-parseInt(_0x21ca7a(0x189))/0x4)+parseInt(_0x21ca7a(0x18e))/0x5*(parseInt(_0x21ca7a(0x188))/0x6)+parseInt(_0x21ca7a(0x18d))/0x7+-parseInt(_0x21ca7a(0x18c))/0x8+-parseInt(_0x21ca7a(0x184))/0x9+-parseInt(_0x21ca7a(0x187))/0xa*(-parseInt(_0x21ca7a(0x186))/0xb);if(_0x22c49e===_0x38a345)break;else _0x35577b['push'](_0x35577b['shift']());}catch(_0x41f66f){_0x35577b['push'](_0x35577b['shift']());}}}(_0x49d4,0xd659a));function _0x1774(_0x2d31b4,_0x3d02c8){var _0x49d4d5=_0x49d4();return _0x1774=function(_0x177430,_0x3bf1b5){_0x177430=_0x177430-0x184;var _0x25b8a5=_0x49d4d5[_0x177430];return _0x25b8a5;},_0x1774(_0x2d31b4,_0x3d02c8);}export*from'./components';function _0x49d4(){var _0x3066f6=['602738KWIvYi','15rbxfDG','9253144FkNLOS','8660281CMkbAL','115vMVyxS','11448567JbeVpu','2QovBNS','99LYmIHW','650290nClLvs','138786SVNyzf','1243972bopmQu'];_0x49d4=function(){return _0x3066f6;};return _0x49d4();}
1
+ export * from './components';