1import{r as T,j as ee}from"./vendor-react-DdEP1kCQ.js";import{x as te,d as re}from"./core-Bpuic6mr.js";import"./vendor-shared-ShLQKC4n.js";import"./sciam-CvuG93yt.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},x=new a.Error().stack;x&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[x]="73ed8eed-bee5-4657-9def-85f8ef72d05d",a._sentryDebugIdIdentifier="sentry-dbid-73ed8eed-bee5-4657-9def-85f8ef72d05d")}catch{}})();function ne(){const a=window.Osano?.cm?.getConsent().ANALYTICS==="ACCEPT";var x="pm-embed-div",y=".pm-embed-div",S="pm-iframe",z={PM_BasePath:"https://cdn-us.amuselabs.com/pmm/",getUID:function(){var e="loggedout_uid";function t(){var r=new Date().getTime(),v="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(b){var c=(r+Math.random()*16)%16|0;return r=Math.floor(r/16),(b=="x"?c:c&3|8).toString(16)});return v}function l(r){for(var v=r+"=",b=document.cookie.split(";"),c=0;c<b.length;c++){var p=A(b[c]);if(p.indexOf(v)==0)return p.substring(v.length,p.length)}return null}function n(r,v,b){var c=new Date;c.setTime(c.getTime()+b*24*60*60*1e3);var p="expires="+c.toUTCString();document.cookie=r+"="+v+";"+p+";path=/"}function d(r){return typeof CryptoJS>"u"?r:CryptoJS.SHA256?CryptoJS.SHA256(r).toString():r}var f="";if(!f&&(a&&(f=l(e)),!f)){var o=t();return o!=null&&o!=""&&a&&n(e,o,365),o}return d(f)}};function m(e){}function G(e){}function H(e){}function J(e){}function M(e){F(e)}function j(e){}function D(){function e(i){var L=U(!0);if(L==null||L==="")return null;var h=L+"/"+i.pageName+"?&set="+g(i.puzzleSet);new URLSearchParams(i.puzzleEmbedParams).forEach(function($,P){h+="&"+P+"="+g($)}),i.pickerStyle!=null&&i.pickerStyle!==""&&i.pickerStyle!=="0"&&(h+="&style="+g(i.pickerStyle)),i.puzzleId!=null&&i.puzzleId!==""&&(h+="&id="+g(i.puzzleId)),i.src!=null&&i.src!==""&&(h+="&src="+g(i.src)),i.uid!==null&&i.uid!==""&&(h+="&uid="+g(i.uid)),i.puzzlePlayId!==null&&i.puzzlePlayId!==""&&(h+="&playId="+g(i.puzzlePlayId)),i.parentPagePath!==null&&i.parentPagePath!==""&&(h+="&src="+g(i.parentPagePath));for(var O in i.parentPageParams)n.hasOwnProperty(O)&&(h+="&"+O+"="+g(i.parentPageParams[O]));return h}var t=window.location.href,l;t.indexOf("?")!==-1?l=A(t.substring(0,t.indexOf("?"))):l=A(t);for(var n=q(t),d=document.getElementsByClassName(x),f=0;f<d.length;f++){var o=d[f],r=JSON.parse(JSON.stringify(n));if(r.set&&o.hasAttribute("data-set")){var v=o.getAttribute("data-set"),b=r.set;v!=b&&(r={})}var c=u("id",o,r),p=u("set",o,r);if(p==null){console&&console.log("PuzzleMe: Unable to construct iframe url because set was not specified. Please check the configuration parameters.");continue}var _=u("iframetitle",o,r),C=u("iframename",o,r),V=u("style",o,r),Y=u("playId",o,r),Z=u("src",o,r),K=u("embedParams",o,r,"embed=js"),E=u("uid",o,r);E==null&&z.getUID!=null&&typeof z.getUID=="function"&&(E=z.getUID());var s=document.createElement("iframe");o.appendChild(s),s.setAttribute("name",p),s.setAttribute("class",S);{var Q=u("height",o,r,"700px"),X=u("width",o,r,"100%"),W="border:none; width: 100% !important; position: static; display: block !important! margin: 0! important;";s.setAttribute("allow","web-share; fullscreen"),s.setAttribute("style",W),s.height=Q,s.width=X}s.setAttribute("aria-label","Puzzle Me Game");var k="date-picker";{var R=u("puzzleType",o,r),B=u("page",o,r);B!=null?k=B:R!=null&&(k=R)}var w=e({pageName:k,puzzleId:c,puzzleSet:p,pickerStyle:V,puzzleEmbedParams:K,parentPageParams:r,src:Z,uid:E,puzzlePlayId:Y,parentPagePath:l});w==null&&console&&console.log("Unable to construct the iframe URL for loading puzzle/picker. Please contact [email protected] for help."),s&&w&&(_!=null&&_!==""&&s.setAttribute("title",_),C!=null&&C!==""&&s.setAttribute("name",C),navigator.userAgent.indexOf("MSIE")==-1?s.setAttribute("src",w):s.setAttribute("location",w))}}function q(e){var t=new URL(e),l=new URLSearchParams(t.search),n={};return l.forEach(function(d,f){n[f]=d}),n}var A=function(e){if(typeof e!="string")return e;for(var t;!(e.length===0||(t=e.charAt(0),t!==` 2`&&t!==" "&&t!==" "));)e=e.substring(1);for(;!(e.length===0||(t=e.charAt(e.length-1),t!==` 3`&&t!==" "&&t!==" "));)e=e.substring(0,e.length-1);return e};function g(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(t){return"%"+t.charCodeAt(0).toString(16)})}function F(e){e.gridOffset&&e.gridOffset;var t=document.querySelector(y);if(t){var l=t.getBoundingClientRect();l.top+window.scrollY,l.left+window.scrollX}}function u(e,t,l,n){if(t.hasAttribute("data-"+e)){var d=t.getAttribute("data-"+e);return delete l[e],d}else if(l[e]){var d=l[e];return delete l[e],d}else return n||null}function U(e){var t="";t=z.PM_BasePath;var l=new URL(t);return e?l.protocol+"//"+l.host+"/"+l.pathname.split("/")[1]:l.protocol+"//"+l.host}function N(e){var t=U(!1);if(t!=null)try{if(t===e.origin){var l=e.origin,n=void 0;e.data&&(n=JSON.parse(e.data)),n&&(n.src==="picker"?"frameHeight"in n?G&&void 0:m&&void 0:n.src==="crossword"&&("frameHeight"in n&&J&&void 0,"progress"in n&&(n.progress==="puzzleLoaded"?H&&void 0:n.progress==="puzzleCompleted"&&j&&void 0),"type"in n&&n.type==="event"&&M&&M(n)))}}catch{}}window.addEventListener("message",N,!1),D()}const ie="game__iframe-F9BpI",le={game__iframe:ie};let I=!1;function de({className:a,...x}){const y=T.useRef(null),{userId:S}=te();return T.useEffect(()=>(I&&document.querySelectorAll(".pm-iframe").forEach(z=>z.remove()),ne(),I=!0,()=>{y.current&&(y.current.innerHTML="")}),[]),ee.jsx("div",{ref:y,className:re("pm-embed-div",a,le.game__iframe),"data-uid":S||void 0,...x})}export{de as AmuseLabGame,de as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.