import React from"react";import ReactDOM from"react-dom";import{validate}from"@geocortex/licensing";const workflowSkuCode="GCXWFL",notice="VertiGIS Studio Workflow must be licensed for use in production applications.";class Watermark extends React.Component{shouldComponentUpdate(){return!1}render(){return React.createElement("div",{style:{position:"fixed",top:"0",left:"0",right:"0",color:"#333",textAlign:"center",zIndex:"2147483647",pointerEvents:"none",opacity:1}},React.createElement("div",{style:{display:"inline-table",backgroundColor:"#ffd498",verticalAlign:"top",textAlign:"left",pointerEvents:"all",border:"1px solid #dab581",borderTop:"0",borderRadius:"0 0 2px 2px"}},React.createElement("svg",{style:{display:"table-cell",width:"32px",height:"34px",margin:"4px 0 4px 4px"},viewBox:"0 0 32 34"},React.createElement("path",{d:"M19.46.37.37,4.72V30.1L19.46,34l12.18-7.58V8.93ZM14,8.45a.84.84,0,0,1,.84-.84h3.35a.84.84,0,0,1,.84.84V11.8a.84.84,0,0,1-.84.84H14.82A.84.84,0,0,1,14,11.8ZM12.31,25.21a.84.84,0,0,1-.84.84H8.12a.84.84,0,0,1-.84-.84V21.86A.84.84,0,0,1,8.12,21h3.35a.84.84,0,0,1,.84.84Zm6.71,0a.84.84,0,0,1-.84.84H14.82a.84.84,0,0,1-.84-.84V21.86a.84.84,0,0,1,.84-.84h3.35a.84.84,0,0,1,.84.84Zm-1.89-7.75V20H15.87V17.46H10.42V20H9.16V16.83a.63.63,0,0,1,.63-.63h6.08V13.69h1.26V16.2H23.2a.63.63,0,0,1,.63.63V20H22.58V17.46Zm8.59,7.75a.84.84,0,0,1-.84.84H21.53a.84.84,0,0,1-.84-.84V21.86a.84.84,0,0,1,.84-.84h3.35a.84.84,0,0,1,.84.84Z"})),React.createElement("div",{style:{display:"table-cell",verticalAlign:"top",padding:"4px 8px",maxWidth:"260px"}},React.createElement("div",{style:{fontSize:"12px"},title:notice},notice)),React.createElement("div",{style:{display:"table-cell",cursor:"pointer",color:"#555",verticalAlign:"top"},onClick:hide},React.createElement("button",{style:{marginRight:"4px",background:"none",border:"none",cursor:"pointer"}},"✖"))))}}let div;function show(){void 0===div&&(div=document.createElement("div")),div.parentNode!==document.body&&(null!==div.parentNode&&div.parentNode.removeChild(div),document.body.appendChild(div)),ReactDOM.render(React.createElement(Watermark,null),div)}function hide(){null!==div.parentNode&&div.parentNode.removeChild(div)}function check(t,i){if("localhost"!==location.hostname&&"127.0.0.1"!==location.hostname){i=i?`-${workflowSkuCode}-${i}-`:`${workflowSkuCode}-`;if(void 0===div&&(div=document.createElement("div")),null===div.parentNode){let e=t&&t.licenseInfo&&t.licenseInfo.licenseeId;t=t&&t.licenseInfo&&t.licenseInfo.licenseUrl;t&&!e&&(e="a"),validate({sku:i,orgId:e,url:t}).then(e=>{if(!e||!e.isValid){if(e&&!e.isEval&&e.expires)if(((new Date).getTime()-e.expires.getTime())/864e5<60)return;show()}}).catch(()=>{show()})}}}export{check};