UNPKG

crunchit

Version:

Autotrack the events from your users

1 lines 182 kB
(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){(()=>{var e={10:(e,t,n)=>{const r=n(401),o=n(654),i=n(221),a=n(27),s=n(582),l=n(926),c=n(211),{throttle:u,handleScroll:d}=n(78),{v4:f}=n(429),p=n(251),{isAlreadySelected:v}=n(973);var h,g,y,m,b,w;let x={};function _(){return function(e){let t=window.localStorage.getItem("CRUNCH_LOCATING");t&&e.preventDefault();let{intent:n,allVariables:o}=r(e),i=new String(1*new Date),a=e.target.className.toString(),s=e.target.id.toString(),c=l(e.target),u=Object.assign({},e.target.dataset);x[c]||(x[c]=[]),x[c].push(i);let d=x[c].filter(e=>i-e<=1e3);if(d.length>4){let e={eventType:"RAGE_CLICK",userIntent:n,timestamp:i,className:a,cssId:s,currentHref:window.location.href,browserDetails:g,ipDetails:y,dataAttributes:u,userIntentVariables:o};h.addAutoCaptureActivity(c,e)}x[c]=d;const f={eventType:"CLICK",userIntent:n,timestamp:i,className:a,cssId:s,currentHref:window.location.href,browserDetails:g,ipDetails:y,dataAttributes:u,userIntentVariables:o};if(t){console.log("Reached here 1");let t={userIntent:n,xpath:c,className:a,cssId:s,currentHref:window.location.href,dataAttributes:u,userIntentVariables:o},r=v(c);r&&(t.isSelectedElement=r),p({type:"LOCATED_ELEMENT",message:JSON.stringify(t)}),console.log("Reached here 2"),window.document.getElementById("CRUNCH_IFRAME_CONTAINER_TIP").style.display="none",window.crunchSelectedElement=e.target,window.localStorage.removeItem("CRUNCH_LOCATING"),document.removeEventListener("mouseover"),window.document.onmouseover=null,document.addEventListener("click",_(),!0)}else h.addAutoCaptureActivity(c,f)}}function E(e,t){const n={eventType:"CLICK",eventName:e,timestamp:1*new Date,currentHref:window.location.href,browserDetails:g,ipDetails:y,...t};h.addManualCaptureActivity(n)}function C(e,t={sessionTimeout:18e5}){if(window.localStorage.setItem("CRUNCH_APP_ID",e),"undefined"!=typeof window){window.localStorage.removeItem("CRUNCH_LOCATING"),window.crunchit={autocapture:_,identify:o,track:E},(b=window.sessionStorage.getItem("CRUNCH_SESSION_ID"))||(b=f(),window.sessionStorage.setItem("CRUNCH_SESSION_ID",b)),(m=window.localStorage.getItem("DISTINCT_ID"))||(m=f(),window.localStorage.setItem("DISTINCT_ID",m)),h=new i(10,5e3,m,e,b,t.sessionTimeout),window.addEventListener("beforeunload",()=>{h.handleBrowserClose(),d(h,g,y)}),g={userAgent:window.navigator?.userAgent,vendor:window.navigator?.vendor,languages:window.navigator?.languages,networkSpeed:window.navigator?.connection?.downlink,preferences:a(),fingerprint:s(m)};const n=new URLSearchParams(window.location.search);w=n.has("selectorMode");let r=n.get("selectorId"),l=n.get("redirectUrl");window.localStorage.setItem("CRUNCH_REDIRECT_URL",l);let p=n.get("xpath");w&&(r&&c(r),c(!1,p||!1)),(y=window.localStorage.getItem("IPAPI_RESPONSE"))?y=JSON.parse(y):fetch("https://ipapi.co/json/").then(e=>e.json()).then(e=>{window.localStorage.setItem("IPAPI_RESPONSE",JSON.stringify(e)),y=e}).catch(e=>{}),console.log("Ready to crunch"),document.addEventListener("click",_(),!0),window.addEventListener("scroll",()=>u(d,4e3,h,g,y),!0),window.history.pushState=new Proxy(window.history.pushState,{apply:(e,t,n)=>{let r=n[n.length-1];return h.addAutoCaptureActivity(r,{eventType:"PAGE_VIEW",currentHref:r,timestamp:new String(1*new Date),userIntent:`User visited ${r}`,browserDetails:g,ipDetails:y}),e.apply(t,n)}}),window.localStorage.removeItem("CRUNCH_LOCATING_TIP")}else n.g.crunchit={autocapture:_,identify:o,track:E}}"undefined"!=typeof window&&(window.letscrunch=C),e.exports={letscrunch:C,identify:o,track:E}},221:(e,t,n)=>{const{v4:r}=n(429);e.exports=class{constructor(e=10,t=5e3,n,o,i,a){this.batchSize=e,this.batch=[],this.interval=t,this.distinctId=n,this.sessionId=i,this.app_id=o,this.API_URL="https://events-backend-5dzspnb6za-uc.a.run.app/",this.timeout=a,this.timeoutRef=setTimeout(()=>{let e=r();window.sessionStorage.setItem("CRUNCH_SESSION_ID",e)},this.timeout);const s=window?.localStorage.getItem("batch");s&&(this.batch=JSON.parse(s)),this.intervalId=setInterval(()=>{this.sendBatch()},this.interval)}addAutoCaptureActivity(e,t){let n={type:"AUTO",activity:t,xpath:e,distinctId:this.distinctId,id:this.sessionId};this.addToBatch(n)}addManualCaptureActivity(e){let t={type:"MANUAL",activity:e,distinctId:this.distinctId,id:this.sessionId};this.addToBatch(t)}resetTimeout(){clearTimeout(this.timeoutRef),this.timeoutRef=setTimeout(()=>{let e=r();window.sessionStorage.setItem("CRUNCH_SESSION_ID",e)},this.timeout)}addToBatch(e){let t=1*new Date;this.batch.length>0?t-this.batch[this.batch.length-1].activity.timestamp>=200&&this.batch.push(e):this.batch.push(e),this.batch.length>=this.batchSize&&this.sendBatch(),this.resetTimeout()}sendBatch(){0!==this.batch.length&&(window.localStorage.removeItem("batch"),this.sendToServer(this.batch))}saveBatch(){window.localStorage.setItem("batch",JSON.stringify(this.batch))}sendToServer(e){let t={activity:e};fetch(`${this.API_URL}add-activity`,{method:"POST",headers:{"Content-Type":"application/json",project_id:this.app_id},body:JSON.stringify(t)}).then(e=>(this.batch=[],e.json())).then(e=>{window.crunchDebug&&console.log("add-activity response:",e)}).catch(e=>{window.crunchDebug&&console.error("add-activity error:",e)})}handleBrowserClose(){this.saveBatch()}sendCustomLabel(e,t){fetch(`${this.API_URL}add-activity-name`,{method:"POST",headers:{"Content-Type":"application/json",project_id:this.app_id},body:JSON.stringify(e)}).then(e=>(t(),e.json())).then(e=>{window.crunchDebug&&console.log("add-activity-name response:",e)}).catch(e=>{window.crunchDebug&&console.error("add-activity-name error:",e)})}}},973:e=>{const t={hoveredElement:null,selectedElement:null,hoveredLines:[],selectedLines:[],successfulSelections:[]},n={hoveredColorDark:"mediumpurple",selectedColorDark:"darkorange",selectedColorLight:"rgba(255, 165, 0, 0.1)",lineThickness:3,zIndex:"999999999",boxShadow:"1px 1px 3px rgba(0, 0, 0, 0.2)",ignoreElementIds:["CRUNCH_IFRAME_CONTAINER","CRUNCH_NAVBAR_CONTAINER"]};function r(){t.selectedElement&&(t.selectedElement.style.background=""),t.selectedLines.forEach(e=>{e.parentNode&&e.parentNode.removeChild(e)}),t.selectedLines.length=0}function o(){r(),t.selectedElement=null}function i(e){let t=e;for(;t;){if(n.ignoreElementIds.includes(t.id))return!0;t=t.parentElement}return!1}function a(e,t,r){const o=e.getBoundingClientRect();if(o.height<4||o.width<4)return;r.forEach(e=>{e.parentNode&&e.parentNode.removeChild(e)}),r.length=0;let i=o.height<12||o.width<12?"orangered":t;["top","bottom","left","right"].forEach(e=>{const t=function(e){const t=document.createElement("div");return t.style.position="absolute",t.style.backgroundColor=e,t.style.zIndex=n.zIndex,t.style.boxShadow=n.boxShadow,t}(i);"top"===e||"bottom"===e?(t.style.height=`${n.lineThickness}px`,t.style.left=`${o.left}px`,t.style.width="bottom"===e?`${o.width+3}px`:`${o.width}px`,t.style.top="top"===e?`${o.top}px`:`${o.bottom}px`):(t.style.width=`${n.lineThickness}px`,t.style.top=`${o.top}px`,t.style.height=`${o.height}px`,t.style.left="left"===e?`${o.left}px`:`${o.right}px`),document.body.appendChild(t),r.push(t)})}function s(e){i(e.target)||t.selectedElement||(t.hoveredElement=e.target,a(t.hoveredElement,n.hoveredColorDark,t.hoveredLines))}function l(e){if(i(e.target))return;e.preventDefault(),e.stopImmediatePropagation(),r();let o=e.target;o.style.background=n.selectedColorLight,t.selectedElement=o,a(t.selectedElement,n.selectedColorDark,t.selectedLines)}e.exports={activateHighlighter:function(){o(),document.addEventListener("mouseover",s),document.addEventListener("click",l,!0)},unhighlightSelectedElement:o,deactivateHighlighter:function(){document.removeEventListener("mouseover",s),document.removeEventListener("click",l,!0),r(),t.hoveredLines.forEach(e=>{e.parentNode&&e.parentNode.removeChild(e)}),t.hoveredLines.length=0,t.selectedLines.length=0,t.hoveredElement=null,t.selectedElement=null},successfulSelection:function(e){if(t.selectedElement&&t.selectedLines.length>0){const n=t.selectedElement.getBoundingClientRect(),r=t.selectedLines.map((e,t)=>{const r=e.cloneNode();switch(r.style.backgroundColor="lawngreen",r.style.position="absolute",t){case 0:case 2:r.style.top="0px",r.style.left="0px";break;case 1:r.style.top=`${n.height}px`,r.style.left="0px";break;case 3:r.style.top="0px",r.style.left=`${n.width}px`}return r});t.successfulSelections.push({element:t.selectedElement,lines:r}),t.selectedElement.style.position="relative",r.forEach(e=>{t.selectedElement.appendChild(e)});let o,i={...e,successfulLines:r};if(t.successfulSelections.find((t,n)=>t.xpath==e.xpath&&(o=n,!0))){let e=[...t.successfulSelections];e[o]=i,t.successfulSelections=e}else t.successfulSelections.push(i)}},isAlreadySelected:e=>t.successfulSelections.find(t=>t.xpath==e)}},582:(e,t,n)=>{const r=n(165);e.exports=function(e){const{navigator:t}=window;var n="";return n+=t.userAgent,n+=t.platform,n+=t.language,n+=t.vendor,0===(n+=e).length?"NO_FINGERPRINT_GENERATED":r(n)}},837:e=>{e.exports=function(e){for(;e.includes("{");)e=e.replace(/\{\w.*?\}/g,"");return(new XPathEvaluator).evaluate(e,document.documentElement,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue}},211:(e,t,n)=>{const{handleMessageFromIframe:r}=n(498),o=n(251),i=n(150),{unhighlightSelectedElement:a}=n(973);e.exports=function(e,t=!1){if(window.document.getElementById("CRUNCH_IFRAME_CONTAINER")||!i)return;window.interact=i,window.requestBack=()=>{a(),r("END_LOCATING",""),o({type:"REQUESTED_BACK",message:""})};const n="http://localhost:3000",s=window.localStorage.getItem("CRUNCH_APP_ID"),l=`${n}?${e?"selectorId="+e:""}&${t?"xpath="+t:""}&host=${window.location.origin}&appId=${s}`;document.querySelector("body").insertAdjacentHTML("beforeend",'<div\nid="CRUNCH_IFRAME_CONTAINER"\nstyle="\nposition: fixed;\nbottom: 16px;\nright: 16px;\nfont-family: \'Inter\', sans-serif;\nborder: 1px solid rgba(229, 231, 235, 1);\nborder-radius: 8px;\nbox-shadow: 0px 10px 10px -5px rgba(0, 0, 0, 0.04), 0px 20px 25px -5px rgba(0, 0, 0, 0.10);\nmin-width: 400px;\nz-index: 99999;\n"\n>\n<link rel="preconnect" href="https://fonts.googleapis.com" />\n<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />\n<link\nhref="https://fonts.googleapis.com/css2?family=Inter:wght@500&display=swap"\nrel="stylesheet"\n/>\n<script type="module">\n// import interact from "https://cdn.interactjs.io/v1.9.20/interactjs/index.js";\n<\/script>\n<div\nstyle="\ndisplay: grid;\npadding: 8px 16px;\ngrid-template-columns: 1fr 1fr 1fr;\nbackground: #eee;\nborder-radius:6px 6px 0 0;\n"\nid="CRUNCH_IFRAME_CONTAINER_NAV"\n>\n<span\nid="CRUNCH_IFRAME_CONTAINER_NAV_TEXT"\nstyle="\nfont-size: 12px;\ncolor: rgba(107, 114, 128, 1);\nfont-weight: 500;\ndisplay: flex;\nalign-items: center;\n"\n><svg width="16" height="16" style="margin-right:4px;" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M12.8128 11.0226C12.1187 12.1424 11.078 13.0049 9.84885 13.4792C8.61975 13.9535 7.26934 14.0135 6.00298 13.6503C4.73658 13.2869 3.62342 12.5201 2.83266 11.4664C2.0419 10.4126 1.61676 9.12949 1.62187 7.81201C1.62698 6.49453 2.06205 5.21478 2.86096 4.16717C3.65987 3.11957 4.77893 2.36142 6.04808 2.00794C7.31729 1.65445 8.66715 1.72497 9.89257 2.20877C11.118 2.69256 12.152 3.56318 12.8374 4.68832L7.67115 7.83546L12.8128 11.0226Z" fill="#8B5CF6"/>\n<path d="M12.6266 7.45245L10.9336 6.62988L10.111 8.32284L11.804 9.14541L12.6266 7.45245Z" fill="#8B5CF6"/>\n<path d="M14.4882 6.62075L14.4204 5.56445L13.3641 5.63224L13.4319 6.68853L14.4882 6.62075Z" fill="#8B5CF6"/>\n<path d="M14.2274 9.84L14.6111 8.85352L13.6246 8.46985L13.2409 9.45634L14.2274 9.84Z" fill="#8B5CF6"/>\n</svg>\nMagic tag</span\n>\n<span\nid="CRUNCH_IFRAME_CONTAINER_NAV_BACK"\nonclick="requestBack()"\nstyle="\nfont-size: 12px;\ncolor: rgba(107, 114, 128, 1);\nfont-weight: 500;\ndisplay: none;\nalign-items: center;\ncursor: pointer;\n"\n><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" style="width:20px; margin-right:8px;">\n<path fill-rule="evenodd" d="M18 10a.75.75 0 01-.75.75H4.66l2.1 1.95a.75.75 0 11-1.02 1.1l-3.5-3.25a.75.75 0 010-1.1l3.5-3.25a.75.75 0 111.02 1.1l-2.1 1.95h12.59A.75.75 0 0118 10z" clip-rule="evenodd" />\n</svg>\nBack</span\n>\n<svg\nid="CRUNCH_IFRAME_CONTAINER_NAV_DRAG_HANDLE"\nstyle="justify-self: center; align-self: center; cursor: grab"\nwidth="29"\nheight="16"\nviewBox="0 0 29 16"\nfill="none"\nxmlns="http://www.w3.org/2000/svg"\n>\n<path\nd="M13.3307 10.1668C13.3307 10.4891 13.2168 10.7641 12.9891 10.9918C12.7613 11.2196 12.4863 11.3335 12.1641 11.3335C11.8418 11.3335 11.5668 11.2196 11.3391 10.9918C11.1113 10.7641 10.9974 10.4891 10.9974 10.1668C10.9974 9.84461 11.1113 9.56961 11.3391 9.34183C11.5668 9.11405 11.8418 9.00016 12.1641 9.00016C12.4863 9.00016 12.7613 9.11405 12.9891 9.34183C13.2168 9.56961 13.3307 9.84461 13.3307 10.1668ZM13.3307 5.8335C13.3307 6.15572 13.2168 6.43072 12.9891 6.6585C12.7613 6.88627 12.4863 7.00016 12.1641 7.00016C11.8418 7.00016 11.5668 6.88627 11.3391 6.6585C11.1113 6.43072 10.9974 6.15572 10.9974 5.8335C10.9974 5.51127 11.1113 5.23627 11.3391 5.0085C11.5668 4.78072 11.8418 4.66683 12.1641 4.66683C12.4863 4.66683 12.7613 4.78072 12.9891 5.0085C13.2168 5.23627 13.3307 5.51127 13.3307 5.8335ZM9.16406 10.1668C9.16406 10.4891 9.05017 10.7641 8.8224 10.9918C8.59462 11.2196 8.31962 11.3335 7.9974 11.3335C7.67517 11.3335 7.40017 11.2196 7.1724 10.9918C6.94462 10.7641 6.83073 10.4891 6.83073 10.1668C6.83073 9.84461 6.94462 9.56961 7.1724 9.34183C7.40017 9.11405 7.67517 9.00016 7.9974 9.00016C8.31962 9.00016 8.59462 9.11405 8.8224 9.34183C9.05017 9.56961 9.16406 9.84461 9.16406 10.1668ZM9.16406 5.8335C9.16406 6.15572 9.05017 6.43072 8.8224 6.6585C8.59462 6.88627 8.31962 7.00016 7.9974 7.00016C7.67517 7.00016 7.40017 6.88627 7.1724 6.6585C6.94462 6.43072 6.83073 6.15572 6.83073 5.8335C6.83073 5.51127 6.94462 5.23627 7.1724 5.0085C7.40017 4.78072 7.67517 4.66683 7.9974 4.66683C8.31962 4.66683 8.59462 4.78072 8.8224 5.0085C9.05017 5.23627 9.16406 5.51127 9.16406 5.8335ZM4.9974 10.1668C4.9974 10.4891 4.88351 10.7641 4.65573 10.9918C4.42795 11.2196 4.15295 11.3335 3.83073 11.3335C3.50851 11.3335 3.23351 11.2196 3.00573 10.9918C2.77795 10.7641 2.66406 10.4891 2.66406 10.1668C2.66406 9.84461 2.77795 9.56961 3.00573 9.34183C3.23351 9.11405 3.50851 9.00016 3.83073 9.00016C4.15295 9.00016 4.42795 9.11405 4.65573 9.34183C4.88351 9.56961 4.9974 9.84461 4.9974 10.1668ZM4.9974 5.8335C4.9974 6.15572 4.88351 6.43072 4.65573 6.6585C4.42795 6.88627 4.15295 7.00016 3.83073 7.00016C3.50851 7.00016 3.23351 6.88627 3.00573 6.6585C2.77795 6.43072 2.66406 6.15572 2.66406 5.8335C2.66406 5.51127 2.77795 5.23627 3.00573 5.0085C3.23351 4.78072 3.50851 4.66683 3.83073 4.66683C4.15295 4.66683 4.42795 4.78072 4.65573 5.0085C4.88351 5.23627 4.9974 5.51127 4.9974 5.8335Z"\nfill="#9CA3AF"\n/>\n<path\nd="M26.3307 10.1668C26.3307 10.4891 26.2168 10.7641 25.9891 10.9918C25.7613 11.2196 25.4863 11.3335 25.1641 11.3335C24.8418 11.3335 24.5668 11.2196 24.3391 10.9918C24.1113 10.7641 23.9974 10.4891 23.9974 10.1668C23.9974 9.84461 24.1113 9.56961 24.3391 9.34183C24.5668 9.11405 24.8418 9.00016 25.1641 9.00016C25.4863 9.00016 25.7613 9.11405 25.9891 9.34183C26.2168 9.56961 26.3307 9.84461 26.3307 10.1668ZM26.3307 5.8335C26.3307 6.15572 26.2168 6.43072 25.9891 6.6585C25.7613 6.88627 25.4863 7.00016 25.1641 7.00016C24.8418 7.00016 24.5668 6.88627 24.3391 6.6585C24.1113 6.43072 23.9974 6.15572 23.9974 5.8335C23.9974 5.51127 24.1113 5.23627 24.3391 5.0085C24.5668 4.78072 24.8418 4.66683 25.1641 4.66683C25.4863 4.66683 25.7613 4.78072 25.9891 5.0085C26.2168 5.23627 26.3307 5.51127 26.3307 5.8335ZM22.1641 10.1668C22.1641 10.4891 22.0502 10.7641 21.8224 10.9918C21.5946 11.2196 21.3196 11.3335 20.9974 11.3335C20.6752 11.3335 20.4002 11.2196 20.1724 10.9918C19.9446 10.7641 19.8307 10.4891 19.8307 10.1668C19.8307 9.84461 19.9446 9.56961 20.1724 9.34183C20.4002 9.11405 20.6752 9.00016 20.9974 9.00016C21.3196 9.00016 21.5946 9.11405 21.8224 9.34183C22.0502 9.56961 22.1641 9.84461 22.1641 10.1668ZM22.1641 5.8335C22.1641 6.15572 22.0502 6.43072 21.8224 6.6585C21.5946 6.88627 21.3196 7.00016 20.9974 7.00016C20.6752 7.00016 20.4002 6.88627 20.1724 6.6585C19.9446 6.43072 19.8307 6.15572 19.8307 5.8335C19.8307 5.51127 19.9446 5.23627 20.1724 5.0085C20.4002 4.78072 20.6752 4.66683 20.9974 4.66683C21.3196 4.66683 21.5946 4.78072 21.8224 5.0085C22.0502 5.23627 22.1641 5.51127 22.1641 5.8335ZM17.9974 10.1668C17.9974 10.4891 17.8835 10.7641 17.6557 10.9918C17.428 11.2196 17.153 11.3335 16.8307 11.3335C16.5085 11.3335 16.2335 11.2196 16.0057 10.9918C15.778 10.7641 15.6641 10.4891 15.6641 10.1668C15.6641 9.84461 15.778 9.56961 16.0057 9.34183C16.2335 9.11405 16.5085 9.00016 16.8307 9.00016C17.153 9.00016 17.428 9.11405 17.6557 9.34183C17.8835 9.56961 17.9974 9.84461 17.9974 10.1668ZM17.9974 5.8335C17.9974 6.15572 17.8835 6.43072 17.6557 6.6585C17.428 6.88627 17.153 7.00016 16.8307 7.00016C16.5085 7.00016 16.2335 6.88627 16.0057 6.6585C15.778 6.43072 15.6641 6.15572 15.6641 5.8335C15.6641 5.51127 15.778 5.23627 16.0057 5.0085C16.2335 4.78072 16.5085 4.66683 16.8307 4.66683C17.153 4.66683 17.428 4.78072 17.6557 5.0085C17.8835 5.23627 17.9974 5.51127 17.9974 5.8335Z"\nfill="#9CA3AF"\n/>\n</svg>\n\n<svg\nid="CRUNCH_IFRAME_CONTAINER_NAV_MINIMIZER"\nstyle="justify-self: end; width: 20px; cursor: pointer"\nxmlns="http://www.w3.org/2000/svg"\nviewBox="0 0 20 20"\nfill="#9CA3AF"\nonclick="var iframe=window.document.getElementById(\'CRUNCH_IFRAME\');if(iframe.style.display==\'none\'){ iframe.style.display=\'block\'; window.document.getElementById(\'CRUNCH_IFRAME_CONTAINER_NAV_MINIMIZER\').style.transform = \'rotate(0deg)\';}else {iframe.style.display=\'none\'; window.document.getElementById(\'CRUNCH_IFRAME_CONTAINER_NAV_MINIMIZER\').style.transform = \'rotate(180deg)\';}"\n>\n<path\nfill-rule="evenodd"\nd="M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z"\nclip-rule="evenodd"\n/>\n</svg>\n</div>\n<iframe\nsrc="%iframe_host%"\nwidth="400"\nheight="600"\nframeborder="0"\ntitle="daolens"\nid="CRUNCH_IFRAME"\nonload="\nconst position = { x: 0, y: 0 };\nwindow.interact(\'#CRUNCH_IFRAME_CONTAINER\').draggable({\nlisteners: {\nmove(event) {\nposition.x += event.dx;\nposition.y += event.dy;\nevent.target.style.transform =\n\'translate(\' + position.x + \'px, \' + position.y + \'px)\';\n},\n},\n});"\n></iframe>\n<div\nid="CRUNCH_IFRAME_CONTAINER_TIP"\nstyle="\nposition: absolute;\nbottom: 190%;\nwidth: 70%;\nleft: 50%;\ntransform: translateX(-50%);\nbackground-color: #fff;\nborder-radius: 8px;\nbox-shadow: 0px 10px 10px -5px rgba(0, 0, 0, 0.04),\n0px 20px 25px -5px rgba(0, 0, 0, 0.1);\ndisplay: none;\nflex-direction: column;\nalign-items: flex-start;\npadding: 12px;\ncolor:#333;\n"\n>\n<span\nstyle="\ndisplay: block;\nwidth: 40px;\nheight: 20px;\nclip-path: polygon(0% 0%, 100% 0%, 50% 100%, 0 0);\nposition: absolute;\nbottom: -20px;\nleft: 50%;\ntransform: translateX(-50%);\nbackground-color: #fff;\nbox-shadow: 0px 10px 10px -5px rgba(0, 0, 0, 0.04),\n0px 20px 25px -5px rgba(0, 0, 0, 0.1);\n"\n></span>\n<div style="display: flex; align-items: center">\n<svg\nxmlns="http://www.w3.org/2000/svg"\nviewBox="0 0 24 24"\nfill="rgba(251, 191, 36, 1)"\n\nstyle="margin-right: 4px;width:24px;height:24px;"\n>\n<path\nd="M12 .75a8.25 8.25 0 00-4.135 15.39c.686.398 1.115 1.008 1.134 1.623a.75.75 0 00.577.706c.352.083.71.148 1.074.195.323.041.6-.218.6-.544v-4.661a6.714 6.714 0 01-.937-.171.75.75 0 11.374-1.453 5.261 5.261 0 002.626 0 .75.75 0 11.374 1.452 6.712 6.712 0 01-.937.172v4.66c0 .327.277.586.6.545.364-.047.722-.112 1.074-.195a.75.75 0 00.577-.706c.02-.615.448-1.225 1.134-1.623A8.25 8.25 0 0012 .75z"\n/>\n<path\nfill-rule="evenodd"\nd="M9.013 19.9a.75.75 0 01.877-.597 11.319 11.319 0 004.22 0 .75.75 0 11.28 1.473 12.819 12.819 0 01-4.78 0 .75.75 0 01-.597-.876zM9.754 22.344a.75.75 0 01.824-.668 13.682 13.682 0 002.844 0 .75.75 0 11.156 1.492 15.156 15.156 0 01-3.156 0 .75.75 0 01-.668-.824z"\nclip-rule="evenodd"\n/></svg\n><span>Tip</span>\n</div>\n<div\nstyle="\ndisplay: flex;\nflex-direction: column;\nalign-items: center;\njustify-content: space-between;\nborder-radius: 8px;\nwidth: 100%;\nmargin: 12px 0;\nbackground-color: rgba(243, 244, 246, 1);\n"\n>\n<div\nstyle="display: grid; grid-template-columns: 1fr 1fr; width: 100%"\n>\n<span\nstyle="\nbackground-color: #10b981;\ndisplay: block;\nheight: 4px;\nwidth: 100%;\n"\n></span\n><span\nstyle="\nbackground-color: #ef4444;\ndisplay: block;\nheight: 4px;\nwidth: 100%;\n"\n></span>\n</div>\n<div\nstyle="\ndisplay: flex;\nalign-items: center;\njustify-content: space-evenly;\nwidth: 100%;\nfont-size: 12px;\n"\n>\n<div\nstyle="\ndisplay: flex;\nalign-items: center;\nflex-direction: column;\npadding: 12px 0;\n"\n>\n<div style="display: flex; align-items: center">\n<svg\nxmlns="http://www.w3.org/2000/svg"\nviewBox="0 0 24 24"\nfill="rgba(16, 185, 129, 1)"\n\nstyle="margin-right: 4px;width:24px;height:24px;"\n>\n<path\nfill-rule="evenodd"\nd="M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12zm13.36-1.814a.75.75 0 10-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 00-1.06 1.06l2.25 2.25a.75.75 0 001.14-.094l3.75-5.25z"\nclip-rule="evenodd"\n/>\n</svg>\n<span>Do</span>\n</div>\n<div style="border: 3px solid #8b5cf6; margin-top: 12px">\n<div\nstyle="\nbackground-color: white;\npadding: 8px 16px;\nborder-radius: 100px;\n"\n>\n<span>Crunch it</span>\n</div>\n</div>\n</div>\n<div\nstyle="\ndisplay: flex;\nalign-items: center;\nflex-direction: column;\npadding: 12px 0;\n"\n>\n<div style="display: flex; align-items: center">\n<svg\nxmlns="http://www.w3.org/2000/svg"\nviewBox="0 0 24 24"\nfill="rgba(239, 68, 68, 1)"\n\nstyle="margin-right: 4px;width:24px;height:24px;"\n>\n<path\nfill-rule="evenodd"\nd="M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25zm-1.72 6.97a.75.75 0 10-1.06 1.06L10.94 12l-1.72 1.72a.75.75 0 101.06 1.06L12 13.06l1.72 1.72a.75.75 0 101.06-1.06L13.06 12l1.72-1.72a.75.75 0 10-1.06-1.06L12 10.94l-1.72-1.72z"\nclip-rule="evenodd"\n/>\n</svg>\n\n<span>Don’t</span>\n</div>\n<div style="margin-top: 12px">\n<div\nstyle="\nbackground-color: white;\npadding: 8px 16px;\nborder-radius: 100px;\n"\n>\n<span style="border: 3px solid rgba(239, 68, 68, 1)"\n>Crunch it</span\n>\n</div>\n</div>\n</div>\n</div>\n</div>\n<span\nstyle="font-size: 12px; font-weight: 400; color: rgba(17, 24, 39, 1)"\n>While locating the event make sure to select the largest possible\nboundry of the target area</span\n>\n</div>\n</div>'.replace("%iframe_host%",l)),window.addEventListener("message",function(e){if(e.origin!==n)return;const{type:t,message:o}=e.data;r(t,o)},!1)}},654:e=>{e.exports=function(e){return new Promise((t,n)=>{let r=window.localStorage.getItem("DISTINCT_ID"),o=window.sessionStorage.getItem("CRUNCH_SESSION_ID"),i=window.localStorage.getItem("CRUNCH_APP_ID");fetch("https://events-backend-5dzspnb6za-uc.a.run.app/add-relation",{method:"POST",headers:{"Content-Type":"application/json",project_id:i},body:JSON.stringify({...e,distinctId:r,id:o})}).then(t=>(window.localStorage.setItem("CRUNCH_IDENTIFY",JSON.stringify({...e,id:r})),t.json())).then(e=>{window.crunchDebug&&console.log("add-relation response:",e),t(e)}).catch(e=>{window.crunchDebug&&console.error("add-relation error:",e),n(e)})})}},401:e=>{function t(e){const t={};for(const r in e)n=e[r],(Array.isArray(n)?0===n.length:"object"==typeof n&&null!==n?0===Object.keys(n).length:""===n||null==n)||(t[r]=e[r]);var n;return t}function n(e,t=0){if(t>5)return"";for(let r of e.childNodes){if(r.nodeType===Node.TEXT_NODE&&""!==r.textContent.trim())return r.textContent.trim();if(r.nodeType===Node.ELEMENT_NODE){let e=n(r,t+1);if(""!==e)return e}}return""}e.exports=function(e,r="clicked",o=null){let i={};i.eventType="clicked"==r?"CLICK":"SCROLL";var a=o||e.target;let s=`User ${r} an element: [${a.tagName.toLowerCase()}]`;switch(i.element=a.tagName.toLowerCase(),a.getAttribute("aria-label")&&(s+=` with aria-label "${a.getAttribute("aria-label")}"`,i.aria=a.getAttribute("aria-label"),i.text=a.getAttribute("aria-label")),a.getAttribute("title")&&(s+=` with title "${a.getAttribute("title")}"`,i.title=a.getAttribute("title"),i.text=a.getAttribute("title")),a.tagName.toLowerCase()){case"button":i.buttonText=a.innerText,i.text=a.innerText,s+="submit"===a.type?`, with inner-text: ${a.innerText}, which submits a form`:`, with inner-text: ${a.innerText}, which is a button`;break;case"a":i.linkHref=a.href,i.text=a.href,s+=`, which links to "${a.href}"`;break;case"option":const e=a.parentElement;i.optionValue=a.value,i.text=a.value,i.optionTitle=e.name,s+=`, which is an option with value "${a.value}" of a select element with name "${e.name}"`;break;case"input":switch(i.inputType=a.type,i.inputChecked=`${a.checked}`,i.inputPlaceholder=a.placeholder,i.text=a.placeholder||a.type,a.type){case"checkbox":case"radio":s+=`, which is a ${a.type} and is ${a.checked?"checked":"not checked"}`;break;case"submit":s+=", which is a submit button for a form";break;default:s+=`, which is an input of type "${a.type}" and placeholder, "${a.placeholder}"`}break;case"textarea":i.inputType="textarea",s+=", which is a textarea";break;case"img":case"svg":case"path":case"g":let t=a,r=null;const o=e=>{if(e.nodeType===Node.TEXT_NODE&&""!==e.textContent.trim())return e.textContent.trim();for(let t of e.childNodes){let e=o(t);if(e)return e}return null},l=(e,t)=>{let n=window.getComputedStyle(e,t).getPropertyValue("content");return n&&"none"!==n?n.slice(1,-1):null};for(;t&&!r;){if(r=o(t),r||(r=l(t,"::before")||l(t,"::after")),!r){let e=t.nextElementSibling;for(;e&&(r=o(e),!r);)e=e.nextElementSibling}if(!r){let e=t.previousElementSibling;for(;e&&(r=o(e),!r);)e=e.previousElementSibling}r||(t=t.parentElement)}r&&(i.associatedText=r,i.text=r,s+=`, which is an element associated with the text "${r}". `),t.alt&&(i.alt=t.alt,s+=`, which has an alt ${t.alt} `);break;case"div":case"span":if("button"===a.getAttribute("role"))s+=`, which is a ${a.tagName.toLowerCase()} with a role of button`;else{let e=` which is a ${a.tagName.toLowerCase()}`;const t=a.querySelector("img"),r=n(a);i.associatedText=r,i.text=r,t&&(e+=`, containing an image with src "${t.src}"`),r&&(e+=`, containing the text "${r}"`),s+=e}break;case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":case"p":s+=`, which is a ${a.tagName.toLowerCase()} with text "${a.textContent}"`,i.associatedText=a.textContent,i.text=a.textContent;break;case"form":s+=", which is a form";break;case"fieldset":s+=", which is a fieldset";break;case"label":s+=`, which is a label with text "${a.textContent}"`}return{intent:s,allVariables:t(i)}}},78:(e,t,n)=>{const r=n(401),o=n(926);let i=null;e.exports={throttle:function(e,t,n,r,o){i||(i=setTimeout(()=>{e(n,r,o),i=null},t))},handleScroll:function(e,t,n){const i=window.scrollY,a=function(){const e=document.documentElement,t=document.body,n="scrollTop",r="scrollHeight",o=e[n]||t[n]||0,i=(e[r]||t[r]||0)-(e.clientHeight||0);return 0===i||isNaN(i)?0:o/i*100}().toFixed(2),s=function(e=document.body){const t=["SCRIPT","NOSCRIPT","STYLE","LINK"];let n=[e];for(;n.length>0;){let e=n.shift();const r=e.getBoundingClientRect();if(r.top>=0&&r.bottom<=window.innerHeight&&!t.includes(e.tagName))return e;let o=Array.from(e.children);n=n.concat(o)}return null}();let l=o(s),c=new String(1*new Date),u=Object.assign({},s.dataset);e.addAutoCaptureActivity(l,{eventType:"SCROLL",timestamp:c,browserDetails:t,dataAttributes:u,ipDetails:n,userIntent:s?r(null,"scrolled",s)?.intent:"scrolled to "+a,scrollDetails:{currentScrollPosition:i,scrollPercentage:a}})}}},27:e=>{e.exports=function(){const e=[{name:"prefers-color-scheme",media:"(prefers-color-scheme: dark)"},{name:"prefers-reduced-motion",media:"(prefers-reduced-motion: reduce)"},{name:"prefers-reduced-transparency",media:"(prefers-reduced-transparency: reduce)"},{name:"prefers-contrast",media:"(prefers-contrast: more)"},{name:"prefers-reduced-data",media:"(prefers-reduced-data: reduce)"},{name:"prefers-reduced-font-sizes",media:"(prefers-reduced-font-sizes: reduce)"},{name:"prefers-geolocation",media:"(prefers-geolocation: none)"},{name:"prefers-inverted-colors",media:"(prefers-inverted-colors: inverted)"},{name:"prefers-light-level",media:"(prefers-light-level: dim)"},{name:"prefers-reduced-motion",media:"(prefers-reduced-motion: reduce)"}],t={};for(const n of e){const{name:e,media:r}=n,o=window.matchMedia(r);t[e]=o.matches}return t}},498:(e,t,n)=>{const{activateHighlighter:r,unhighlightSelectedElement:o,deactivateHighlighter:i,successfulSelection:a}=n(973),s=n(837),l=n(251);e.exports={handleMessageFromIframe:function e(t,n){let o=window.document.getElementById("CRUNCH_IFRAME"),c=window.document.getElementById("CRUNCH_IFRAME_CONTAINER_NAV_TEXT"),u=window.document.getElementById("CRUNCH_IFRAME_CONTAINER_NAV_BACK"),d=window.document.getElementById("CRUNCH_IFRAME_CONTAINER_NAV_MINIMIZER"),f=n.includes("crunch-xpath")?s(n.split("||")[1]):null;switch(t){case"INITIALIZE":window.localStorage.setItem("CRUNCH_SELECTOR_CONNECTED",n);let t=window.localStorage.getItem("CRUNCH_APP_ID");l({type:"INITIALIZE",message:{CRUNCH_HOST:window.location.origin,CRUNCH_APP_ID:t}});break;case"START_LOCATING":window.localStorage.setItem("CRUNCH_LOCATING",!0),function(){if(!window.localStorage.getItem("CRUNCH_LOCATING_TIP")){window.localStorage.setItem("CRUNCH_LOCATING_TIP",!0);let e=window.document.getElementById("CRUNCH_IFRAME_CONTAINER_TIP");e.style.display="flex",setTimeout(()=>{e.style.display="none"},5e3)}}(),r();break;case"END_LOCATING":case"TEST_MESSAGE":default:break;case"LABELING_SUCCESS":let s=JSON.parse(n);a(s);break;case"LOCATOR_MODE_GENERIC":let v=document.querySelector("body");window.localStorage.setItem("LOCATOR_MODE","LOCATOR_MODE_GENERIC"),document.getElementById("CRUNCH_IFRAME_CONTAINER_TIP").style.display="none",window.handleContainerMinimize=()=>{const e=document.getElementById("CRUNCH_NAVBAR_CONTAINER_MINIMIZE_HANDLER"),t=document.getElementById("CRUNCH_NAVBAR_CONTAINER_MINIMIZE_HANDLER_SVG"),n=document.getElementById("CRUNCH_NAVBAR_CONTAINER"),r=document.getElementById("CRUNCH_NAVBAR_CONTAINER_BACK"),o=document.getElementById("CRUNCH_NAVBAR_CONTAINER_TOGGLE");"48px"==n.style.height?(n.style.height="0px",t.style.transform="rotate(180deg)",r.style.display="none",o.style.display="none",v.style.paddingTop="0px",e.style.transform="translate(-50%, 0px)"):(n.style.height="48px",t.style.transform="rotate(0deg)",r.style.display="flex",o.style.display="block",v.style.paddingTop="48px",e.style.transform="translate(-50%, -5px)")},window.crunchHandleBack=()=>{let e=window.localStorage.getItem("CRUNCH_REDIRECT_URL");window.open(e)},window.crunchBrowseSite=()=>{const t=document.getElementById("CRUNCH_NAVBAR_BROWSE_BTN"),n=document.getElementById("CRUNCH_NAVBAR_DEFINE_BTN"),r=document.getElementById("CRUNCH_IFRAME_CONTAINER");e("END_LOCATING",""),i(),document.addEventListener("click",window.crunchit.autocapture(),!0),window.localStorage.removeItem("CRUNCH_LOCATING"),r.style.display="none",t.style.backgroundColor="rgba(55, 65, 81, 1)",t.style.borderRadius="4px",t.style.color="rgba(243, 244, 246, 1)",n.style.backgroundColor="transparent",n.style.color="rgba(156, 163, 175, 1)"},window.crunchDefineEvent=()=>{const t=document.getElementById("CRUNCH_NAVBAR_BROWSE_BTN"),n=document.getElementById("CRUNCH_NAVBAR_DEFINE_BTN"),r=document.getElementById("CRUNCH_IFRAME_CONTAINER");window.localStorage.getItem("CRUNCH_LOCATING")||(e("START_LOCATING",""),r.style.display="block",n.style.backgroundColor="rgba(55, 65, 81, 1)",n.style.borderRadius="4px",n.style.color="rgba(243, 244, 246, 1)",t.style.backgroundColor="transparent",t.style.color="rgba(156, 163, 175, 1)")},v.style.paddingTop="48px",document.getElementById("CRUNCH_NAVBAR_CONTAINER")||v.insertAdjacentHTML("afterBegin",'<div\n id="CRUNCH_NAVBAR_CONTAINER"\n style="\n display: grid;\n grid-template-columns: 1fr 1fr 1fr;\n align-items: center;\n justify-content: space-between;\n position: fixed;\n width: 100vw;\n left: 0px;\n top: 0px;\n height: 48px;\n background-color: rgba(17, 24, 39, 1);\n z-index: 9999999;\n "\n >\n <div style=" margin-left: 12px " id="CRUNCH_NAVBAR_CONTAINER_BACK">\n <span\n style="\n font-size: 12px;\n color: rgba(209, 213, 219, 1);\n font-weight: 500;\n display: flex;\n align-items: center;\n cursor: pointer;\n "\n onclick="crunchHandleBack()"\n\n >\n <svg\n xmlns="http://www.w3.org/2000/svg"\n view-box="0 0 20 20"\n fill="currentColor"\n style="height: 20px; width: 20px; margin-right: 8px"\n >\n <path\n fill-rule="evenodd"\n d="M18 10a.75.75 0 01-.75.75H4.66l2.1 1.95a.75.75 0 11-1.02 1.1l-3.5-3.25a.75.75 0 010-1.1l3.5-3.25a.75.75 0 111.02 1.1l-2.1 1.95h12.59A.75.75 0 0118 10z"\n clip-rule="evenodd"\n />\n </svg>\n Back to Crunch\n </span>\n </div>\n <div\n id="CRUNCH_NAVBAR_CONTAINER_TOGGLE"\n style="\n background-color: rgba(31, 41, 55, 0.5);\n padding: 4px;\n border-radius: 8px;\n font-size: 12px;\n justify-self: center;\n "\n >\n <span\n style="\n color: rgba(156, 163, 175, 1);\n padding: 4px 8px;\n cursor: pointer;\n "\n onclick="crunchBrowseSite()"\n id="CRUNCH_NAVBAR_BROWSE_BTN"\n >Browse site</span>\n <span\n style="\n background-color: rgba(55, 65, 81, 1);\n border-radius: 4px;\n color: rgba(243, 244, 246, 1);\n padding: 4px 8px;\n cursor: pointer;\n "\n onclick="crunchDefineEvent()"\n id="CRUNCH_NAVBAR_DEFINE_BTN"\n >Define events</span>\n </div>\n <div></div>\n <div\n id="CRUNCH_NAVBAR_CONTAINER_MINIMIZE_HANDLER"\n onclick="handleContainerMinimize()"\n style="background-color: rgba(17, 24, 39, 1);\n position: absolute;\n top: 100%;\n left: 50%;\n transform: translate(-50%,-5px);\n padding: 4px;\n border-radius: 0 0 200px 200px;\n width: 28px;\n height: 18px;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer"\n >\n <svg\n id="CRUNCH_NAVBAR_CONTAINER_MINIMIZE_HANDLER_SVG"\n xmlns="http://www.w3.org/2000/svg"\n fill="none"\n viewBox="0 0 24 24"\n stroke-width="2"\n stroke="#fff"\n style=" height: 12px; width: 12px "\n >\n <path\n stroke-linecap="round"\n stroke-linejoin="round"\n d="M4.5 15.75l7.5-7.5 7.5 7.5"\n />\n </svg>\n </div>\n </div>'),e("START_LOCATING","");break;case"LOCATOR_MODE_TEMPLATE":window.localStorage.setItem("LOCATOR_MODE","LOCATOR_MODE_TEMPLATE");break;case"LOCATOR_MODE_SINGLE":window.localStorage.setItem("LOCATOR_MODE","LOCATOR_MODE_SINGLE");break;case"LOCATOR_MAIN_PAGE":c.style.display="flex",u.style.display="none";break;case"LOCATOR_EVENT_PAGE":c.style.display="none",u.style.display="flex";break;case"MINIMIZE_LOCATOR":o.style.display="none",d.style.transform="rotate(180deg)",c.style.display="flex",u.style.display="none";break;case"MAXIMIZE_LOCATOR":o.style.display="block",d.style.transform="rotate(0deg)";break;case"CRUNCH_HIGHLIGHT_TAG":(p=f).crunchPreviousBorder=p.style.border,p.style.border="2.5px solid purple";break;case"CRUNCH_UNHIGHLIGHT_TAG":!function(e){e.style.border=e.crunchPreviousBorder||"",e.crunchPreviousBorder=""}(f);break;case"CLOSE_WINDOW":window.close()}var p}}},251:e=>{e.exports=function(e){var t=document.getElementById("CRUNCH_IFRAME")?.contentWindow;console.log("iframe",t),t?.postMessage(e,"http://localhost:3000")}},926:e=>{e.exports=function(e){let t=[];for(;e&&1==e.nodeType;e=e.parentNode){let n=0;for(let t=e.previousSibling;t;t=t.previousSibling)t.nodeType!=Node.DOCUMENT_TYPE_NODE&&t.nodeName==e.nodeName&&++n;let r=e.nodeName.toLowerCase(),o=n?"["+(n+1)+"]":"",i="";if(e.nodeType===Node.TEXT_NODE)i=e.textContent.trim();else for(let t of e.childNodes)t.nodeType===Node.TEXT_NODE&&(i+=t.textContent.trim());i.length>20&&(i=i.substring(0,20)+"...");let a=i&&"html"!==r?"{"+i+"}":"";t.splice(0,0,r+o+a)}return t.length?"/"+t.join("/"):null}},897:function(e){!function(t){"use strict";var n={bytesToHex:function(e){return function(e){return e.map(function(e){return 2,(t=e.toString(16)).length>2?t:Array(2-t.length+1).join("0")+t;var t}).join("")}(e)},hexToBytes:function(e){if(e.length%2==1)throw new Error("hexToBytes can't have a string with an odd number of characters.");return 0===e.indexOf("0x")&&(e=e.slice(2)),e.match(/../g).map(function(e){return parseInt(e,16)})}};e.exports?e.exports=n:t.convertHex=n}(this)},496:function(e){!function(t){"use strict";var n={bytesToString:function(e){return e.map(function(e){return String.fromCharCode(e)}).join("")},stringToBytes:function(e){return e.split("").map(function(e){return e.charCodeAt(0)})}};n.UTF8={bytesToString:function(e){return decodeURIComponent(escape(n.bytesToString(e)))},stringToBytes:function(e){return n.stringToBytes(unescape(encodeURIComponent(e)))}},e.exports?e.exports=n:t.convertString=n}(this)},150:e=>{e.exports=function(){var e={};Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,e.default=function(e){return!(!e||!e.Window)&&e instanceof e.Window};var t={};Object.defineProperty(t,"__esModule",{value:!0}),t.getWindow=function(t){return(0,e.default)(t)?t:(t.ownerDocument||t).defaultView||r.window},t.init=o,t.window=t.realWindow=void 0;var n=void 0;t.realWindow=n;var r=void 0;function o(e){t.realWindow=n=e;var o=e.document.createTextNode("");o.ownerDocument!==e.document&&"function"==typeof e.wrap&&e.wrap(o)===o&&(e=e.wrap(e)),t.window=r=e}t.window=r,"undefined"!=typeof window&&window&&o(window);var i={};function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0;var s=function(e){return!!e&&"object"===a(e)},l=function(e){return"function"==typeof e},c={window:function(n){return n===t.window||(0,e.default)(n)},docFrag:function(e){return s(e)&&11===e.nodeType},object:s,func:l,number:function(e){return"number"==typeof e},bool:function(e){return"boolean"==typeof e},string:function(e){return"string"==typeof e},element:function(e){if(!e||"object"!==a(e))return!1;var n=t.getWindow(e)||t.window;return/object|function/.test("undefined"==typeof Element?"undefined":a(Element))?e instanceof Element||e instanceof n.Element:1===e.nodeType&&"string"==typeof e.nodeName},plainObject:function(e){return s(e)&&!!e.constructor&&/function Object\b/.test(e.constructor.toString())},array:function(e){return s(e)&&void 0!==e.length&&l(e.splice)}};i.default=c;var u={};function d(e){var t=e.interaction;if("drag"===t.prepared.name){var n=t.prepared.axis;"x"===n?(t.coords.cur.page.y=t.coords.start.page.y,t.coords.cur.client.y=t.coords.start.client.y,t.coords.velocity.client.y=0,t.coords.velocity.page.y=0):"y"===n&&(t.coords.cur.page.x=t.coords.start.page.x,t.coords.cur.client.x=t.coords.start.client.x,t.coords.velocity.client.x=0,t.coords.velocity.page.x=0)}}function f(e){var t=e.iEvent,n=e.interaction;if("drag"===n.prepared.name){var r=n.prepared.axis;if("x"===r||"y"===r){var o="x"===r?"y":"x";t.page[o]=n.coords.start.page[o],t.client[o]=n.coords.start.client[o],t.delta[o]=0}}}Object.defineProperty(u,"__esModule",{value:!0}),u.default=void 0;var p={id:"actions/drag",install:function(e){var t=e.actions,n=e.Interactable,r=e.defaults;n.prototype.draggable=p.draggable,t.map.drag=p,t.methodDict.drag="draggable",r.actions.drag=p.defaults},listeners:{"interactions:before-action-move":d,"interactions:action-resume":d,"interactions:action-move":f,"auto-start:check":function(e){var t=e.interaction,n=e.interactable,r=e.buttons,o=n.options.drag;if(o&&o.enabled&&(!t.pointerIsDown||!/mouse|pointer/.test(t.pointerType)||0!=(r&n.options.drag.mouseButtons)))return e.action={name:"drag",axis:"start"===o.lockAxis?o.startAxis:o.lockAxis},!1}},draggable:function(e){return i.default.object(e)?(this.options.drag.enabled=!1!==e.enabled,this.setPerAction("drag",e),this.setOnEvents("drag",e),/^(xy|x|y|start)$/.test(e.lockAxis)&&(this.options.drag.lockAxis=e.lockAxis),/^(xy|x|y)$/.test(e.startAxis)&&(this.options.drag.startAxis=e.startAxis),this):i.default.bool(e)?(this.options.drag.enabled=e,this):this.options.drag},beforeMove:d,move:f,defaults:{startAxis:"xy",lockAxis:"xy"},getCursor:function(){return"move"}},v=p;u.default=v;var h={};Object.defineProperty(h,"__esModule",{value:!0}),h.default=void 0;var g={init:function(e){var t=e;g.document=t.document,g.DocumentFragment=t.DocumentFragment||y,g.SVGElement=t.SVGElement||y,g.SVGSVGElement=t.SVGSVGElement||y,g.SVGElementInstance=t.SVGElementInstance||y,g.Element=t.Element||y,g.HTMLElement=t.HTMLElement||g.Element,g.Event=t.Event,g.Touch=t.Touch||y,g.PointerEvent=t.PointerEvent||t.MSPointerEvent},document:null,DocumentFragment:null,SVGElement:null,SVGSVGElement:null,SVGElementInstance:null,Element:null,HTMLElement:null,Event:null,Touch:null,PointerEvent:null};function y(){}var m=g;h.default=m;var b={};Object.defineProperty(b,"__esModule",{value:!0}),b.default=void 0;var w={init:function(e){var t=h.default.Element,n=e.navigator||{};w.supportsTouch="ontouchstart"in e||i.default.func(e.DocumentTouch)&&h.default.document instanceof e.DocumentTouch,w.supportsPointerEvent=!1!==n.pointerEnabled&&!!h.default.PointerEvent,w.isIOS=/iP(hone|od|ad)/.test(n.platform),w.isIOS7=/iP(hone|od|ad)/.test(n.platform)&&/OS 7[^\d]/.test(n.appVersion),w.isIe9=/MSIE 9/.test(n.userAgent),w.isOperaMobile="Opera"===n.appName&&w.supportsTouch&&/Presto/.test(n.userAgent),w.prefixedMatchesSelector="matches"in t.prototype?"matches":"webkitMatchesSelector"in t.prototype?"webkitMatchesSelector":"mozMatchesSelector"in t.prototype?"mozMatchesSelector":"oMatchesSelector"in t.prototype?"oMatchesSelector":"msMatchesSelector",w.pEventTypes=w.supportsPointerEvent?h.default.PointerEvent===e.MSPointerEvent?{up:"MSPointerUp",down:"MSPointerDown",over:"mouseover",out:"mouseout",move:"MSPointerMove",cancel:"MSPointerCancel"}:{up:"pointerup",down:"pointerdown",over:"pointerover",out:"pointerout",move:"pointermove",cancel:"pointercancel"}:null,w.wheelEvent=h.default.document&&"onmousewheel"in h.default.document?"mousewheel":"wheel"},supportsTouch:null,supportsPointerEvent:null,isIOS7:null,isIOS:null,isIe9:null,isOperaMobile:null,prefixedMatchesSelector:null,pEventTypes:null,wheelEvent:null},x=w;b.default=x;var _={};function E(e){var t=e.parentNode;if(i.default.docFrag(t)){for(;(t=t.host)&&i.default.docFrag(t););return t}return t}function C(e,n){return t.window!==t.realWindow&&(n=n.replace(/\/deep\//g," ")),e[b.default.prefixedMatchesSelector](n)}Object.defineProperty(_,"__esModule",{value:!0}),_.closest=function(e,t){for(;i.default.element(e);){if(C(e,t))return e;e=E(e)}return null},_.getActualElement=function(e){return e.correspondingUseElement||e},_.getElementClientRect=T,_.getElementRect=function(e){var n=T(e);if(!b.default.isIOS7&&n){var r=S(t.getWindow(e));n.left+=r.x,n.right+=r.x,n.top+=r.y,n.bottom+=r.y}return n},_.getPath=function(e){for(var t=[];e;)t.push(e),e=E(e);return t},_.getScrollXY=S,_.indexOfDeepestElement=function(e){for(var n,r=[],o=0;o<e.length;o++){var i=e[o],a=e[n];if(i&&o!==n)if(a){var s=O(i),l=O(a);if(s!==i.ownerDocument)if(l!==i.ownerDocument)if(s!==l){r=r.length?r:I(a);var c=void 0;if(a instanceof h.default.HTMLElement&&i instanceof h.default.SVGElement&&!(i instanceof h.default.SVGSVGElement)){if(i===l)continue;c=i.ownerSVGElement}else c=i;for(var u=I(c,a.ownerDocument),d=0;u[d]&&u[d]===r[d];)d++;var f=[u[d-1],u[d],r[d]];if(f[0])for(var p=f[0].lastChild;p;){if(p===f[1]){n=o,r=u;break}if(p===f[2])break;p=p.previousSibling}}else v=i,g=a,(parseInt(t.getWindow(v).getComputedStyle(v).zIndex,10)||0)>=(parseInt(t.getWindow(g).getComputedStyle(g).zIndex,10)||0)&&(n=o);else n=o}else n=o}var v,g;return n},_.matchesSelector=C,_.matchesUpTo=function(e,t,n){for(;i.default.element(e);){if(C(e,t))return!0;if((e=E(e))===n)return C(e,t)}return!1},_.nodeContains=function(e,t){if(e.contains)return e.contains(t);for(;t;){if(t===e)return!0;t=t.parentNode}return!1},_.parentNode=E,_.trySelector=function(e){return!!i.default.string(e)&&(h.default.document.querySelector(e),!0)};var O=function(e){return e.parentNode||e.host};function I(e,t){for(var n,r=[],o=e;(n=O(o))&&o!==t&&n!==o.ownerDocument;)r.unshift(o),o=n;return r}function S(e){return{x:(e=e||t.window).scrollX||e.document.documentElement.scrollLeft,y:e.scrollY||e.document.documentElement.scrollTop}}function T(e){var t=e instanceof h.default.SVGElement?e.getBoundingClientRect():e.getClientRects()[0];return t&&{left:t.left,right:t.right,top:t.top,bottom:t.bottom,width:t.width||t.right-t.left,height:t.height||t.bottom-t.top}}var P={};Object.defineProperty(P,"__esModule",{value:!0}),P.default=function(e,t){for(var n in t)e[n]=t[n];return e};var A={};function M(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function R(e,t,n){return"parent"===e?(0,_.parentNode)(n):"self"===e?t.getRect(n):(0,_.closest)(n,e)}Object.defineProperty(A,"__esModule",{value:!0}),A.addEdges=function(e,t,n){e.left&&(t.left+=n.x),e.right&&(t.right+=n.x),e.top&&(t.top+=n.y),e.bottom&&(t.bottom+=n.y),t.width=t.right-t.left,t.height=t.bottom-t.top},A.getStringOptionResult=R,A.rectToXY=function(e){return e&&{x:"x"in e?e.x:e.left,y:"y"in e?e.y:e.top}},A.resolveRectLike=function(e,t,n,r){var o,a=e;return i.default.string(a)?a=R(a,t,n):i.default.func(a)&&(a=a.apply(void 0,function(e){if(Array.isArray(e))return M(e)}(o=r)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(o)||function(e,t){if(e){if("string"==typeof e)return M(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?M(e,t):void 0}}(o)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())),i.default.element(a)&&(a=(0,_.getElementRect)(a)),a},A.tlbrToXywh=function(e){return!e||"x"in e&&"y"in e||((e=(0,P.default)({},e)).x=e.left||0,e.y=e.top||0,e.width=e.width||(e.right||0)-e.x,e.height=e.height||(e.bottom||0)-e.y),e},A.xywhToTlbr=function(e){return!e||"left"in e&&"top"in e||((e=(0,P.default)({},e)).left=e.x||0,e.top=e.y||0,e.right=e.right||e.left+e.width,e.bottom=e.bottom||e.top+e.height),e};var k={};Object.defineProperty(k,"__esModule",{value:!0}),k.default=function(e,t,n){var r=e.options[n],o=r&&r.origin||e.options.origin,i=(0,A.resolveRectLike)(o,e,t,[e&&t]);return(0,A.rectToXY)(i)||{x:0,y:0}};var N={};function j(e){return e.trim().split(/ +/)}Object.defineProperty(N,"__esModule",{value:!0}),N.default=function e(t,n,r){if(r=r||{},i.default.string(t)&&-1!==t.search(" ")&&(t=j(t)),i.default.array(t))return t.reduce(function(t,o){return(0,P.default)(t,e(o,n,r))},r);if(i.default.object(t)&&(n=t,t=""),i.default.func(n))r[t]=r[t]||[],r[t].push(n);else if(i.default.array(n))for(var o=0;o<n.length;o++){var a;a=n[o],e(t,a,r)}else if(i.default.object(n))for(var s in n){var l=j(s).map(function(e){return"".concat(t).concat(e)});e(l,n[s],r)}return r};var D={};Object.defineProperty(D,"__esModule",{value:!0}),D.default=void 0,D.default=function(e,t){return Math.sqrt(e*e+t*t)};var z={};Object.defineProperty(z,"__esModule",{value:!0}),z.default=function(e,t){e.__set||(e.__set={});var n=function(n){"function"!=typeof e[n]&&"__set"!==n&&Object.defineProperty(e,n,{get:function(){return n in e.__set?e.__set[n]:e.__set[n]=t[n]},set:function(t){e.__set[n]=t},configurable:!0})};for(var r in t)n(r);return e};var L={};function B(e){return e instanceof h.de