@clickview/auth 0.55.2 → 0.56.0
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.
|
@@ -62,7 +62,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
62
62
|
Copyright (c) 2018 Jed Watson.
|
|
63
63
|
Licensed under the MIT License (MIT), see
|
|
64
64
|
http://jedwatson.github.io/classnames
|
|
65
|
-
*/var wD;function cre(){return wD||(wD=1,(function(e){(function(){var r={}.hasOwnProperty;function t(){for(var s="",u=0;u<arguments.length;u++){var p=arguments[u];p&&(s=o(s,a(p)))}return s}function a(s){if(typeof s=="string"||typeof s=="number")return s;if(typeof s!="object")return"";if(Array.isArray(s))return t.apply(null,s);if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]"))return s.toString();var u="";for(var p in s)r.call(s,p)&&s[p]&&(u=o(u,p));return u}function o(s,u){return u?s?s+" "+u:s+u:s}e.exports?(t.default=t,e.exports=t):window.classNames=t})()})(ub)),ub.exports}var fre=cre();const iF=al(fre),dre=["xxl","xl","lg","md","sm","xs"],hre="xs",oF=Nr.createContext({prefixes:{},breakpoints:dre,minBreakpoint:hre}),{Consumer:Qne,Provider:eae}=oF;function sF(e,r){const{prefixes:t}=Nr.useContext(oF);return e||t[r]||r}const vre=["as","disabled"];function pre(e,r){if(e==null)return{};var t={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(r.indexOf(a)>=0)continue;t[a]=e[a]}return t}function gre(e){return!e||e.trim()==="#"}function uF({tagName:e,disabled:r,href:t,target:a,rel:o,role:s,onClick:u,tabIndex:p=0,type:d}){e||(t!=null||a!=null||o!=null?e="a":e="button");const h={tagName:e};if(e==="button")return[{type:d||"button",disabled:r},h];const f=_=>{if((r||e==="a"&&gre(t))&&_.preventDefault(),r){_.stopPropagation();return}u==null||u(_)},c=_=>{_.key===" "&&(_.preventDefault(),f(_))};return e==="a"&&(t||(t="#"),r&&(t=void 0)),[{role:s??"button",disabled:void 0,tabIndex:r?void 0:p,href:t,target:e==="a"?a:void 0,"aria-disabled":r||void 0,rel:e==="a"?o:void 0,onClick:f,onKeyDown:c},h]}const mre=Nr.forwardRef((e,r)=>{let{as:t,disabled:a}=e,o=pre(e,vre);const[s,{tagName:u}]=uF(Object.assign({tagName:t,disabled:a},o));return A.jsx(u,Object.assign({},o,s,{ref:r}))});mre.displayName="Button";const lF=Nr.forwardRef(({as:e,bsPrefix:r,variant:t="primary",size:a,active:o=!1,disabled:s=!1,className:u,...p},d)=>{const h=sF(r,"btn"),[f,{tagName:c}]=uF({tagName:e,disabled:s,...p}),_=c;return A.jsx(_,{...f,...p,ref:d,disabled:s,className:iF(u,h,o&&"active",t&&`${h}-${t}`,a&&`${h}-${a}`,p.href&&s&&"disabled")})});lF.displayName="Button";const G_=Nr.forwardRef(({bsPrefix:e,variant:r,animation:t="border",size:a,as:o="div",className:s,...u},p)=>{e=sF(e,"spinner");const d=`${e}-${t}`;return A.jsx(o,{ref:p,...u,className:iF(s,d,a&&`${d}-${a}`,r&&`text-${r}`)})});G_.displayName="Spinner";function zf(e){const{showSpinner:r,children:t,style:a,spinnerText:o,...s}=e,u=Nr.useRef(null),[{width:p,height:d},h]=Nr.useState({}),[f,c]=Nr.useState(r);Nr.useEffect(()=>{if(!r){h({});return}const E=u.current,S=E.offsetHeight,w=E.offsetWidth;!S||!w||h({width:w,height:S})},[r]),Nr.useLayoutEffect(()=>{c(r)},[r]);const _={...a};return p&&(_.width=`${p+1}px`),d&&(_.height=`${d+1}px`),A.jsx(lF,{ref:u,disabled:r,style:_,...s,children:f?A.jsxs(A.Fragment,{children:[A.jsx(G_,{as:"span",animation:"border",role:"status",size:"sm"}),!!o&&A.jsx("span",{className:"ps-1",children:o})]}):t})}const Lc=/\$+[\w\s]?/,yre=/^\+?\d{4,255}$/,Mc=255;function cF(e){var E,S,w,R;const[r,t]=je.useState({fullname:"",jobTitle:"",phone:""});function a(b){b==null||b.preventDefault(),c(r)&&e.handleSubmitForm(r)}function o(b){b.preventDefault(),h("fullname",b.target.value),f("fullname"),f("submission")}function s(b){b.preventDefault(),h("phone",b.target.value.trim()),f("phone"),f("submission")}function u(b){h("jobTitle",b),f("jobTitle"),f("submission")}function p(){h("fullname",""),f("fullname"),f("submission")}function d(){h("phone",""),f("phone"),f("submission")}function h(b,I){t(m=>({...m,[b]:I}))}function f(b){if(!Object.keys(e.errors).length||!e.errors[b])return;const I={...e.errors};delete I[b],e.setErrors(I)}function c(b){const{fullname:I,jobTitle:m,phone:v}=b,{firstName:y,surname:g}=V_(I),x={};return(!y||!g)&&(x.fullname="Please enter your full name."),(Lc.test(y)||Lc.test(g))&&(x.fullname="Please enter your full name."),I.length>Mc&&(x.fullname=`Full name cannot exceed max length of ${Mc} characters.`),m!=null&&m.length||(x.jobTitle="Please enter your job title."),Lc.test(m)&&(x.jobTitle="Please enter a valid job title."),m.length>Mc&&(x.jobTitle=`Job title cannot exceed max length of ${Mc} characters.`),v!=null&&v.length||(x.phone="Please enter your phone number."),(Lc.test(v)||!yre.test(v))&&(x.phone="Please enter a valid phone number."),e.setErrors(x),!Object.keys(x).length}function _(){const{fullname:b,jobTitle:I,phone:m}=r;return!(!b.length||!I.length||!m.length||Object.keys(e.errors).length)}return A.jsxs("div",{className:"text-center",children:[A.jsx("h1",{className:"text-center h4",children:"A little more about you"}),A.jsx("p",{children:"Please enter your details."}),A.jsxs("form",{onSubmit:a,"aria-errormessage":"brazeFormError",children:[A.jsxs("div",{className:"form-group text-start",children:[A.jsx("label",{className:"d-block fw-bold mb-1",htmlFor:"fullname-input",children:"Full name"}),A.jsx(Bs,{value:r.fullname,onChange:o,name:"fullname-input",id:"fullname-input",type:"text",className:`form-control form-control-lg ${(E=e.errors.fullname)!=null&&E.length?"is-invalid":""}`,placeholder:"Enter your name",onClickClear:p,autoFocus:!0,"aria-errormessage":"fullname-inputError"}),e.errors.fullname&&A.jsx(Ht,{name:"fullname-input",children:e.errors.fullname})]}),A.jsxs("div",{className:"form-group text-start",children:[A.jsx("label",{className:"d-block fw-bold mb-1",htmlFor:"phone-input",children:"Contact number"}),A.jsx(Bs,{value:r.phone,onChange:s,name:"phone-input",id:"phone-input",type:"tel",className:`form-control form-control-lg ${(S=e.errors.phone)!=null&&S.length?"is-invalid":""}`,placeholder:"Enter your phone number",onClickClear:d,"aria-errormessage":"phone-inputError"}),e.errors.phone&&A.jsx(Ht,{name:"phone-input",children:e.errors.phone})]}),A.jsxs("div",{className:"form-group text-start",children:[A.jsx("label",{className:"d-block fw-bold mb-1",htmlFor:"jobTitle-select",children:"Job title"}),A.jsx(ore,{id:"jobTitle-select",countryCode:Zt.getCountryCode(e.country),onChange:u,error:(w=e.errors)==null?void 0:w.jobTitle,size:"lg",labelClassName:"d-none",isTertiary:e.isTertiary})]}),!!((R=e.errors)!=null&&R.submission)&&A.jsx(Ht,{name:"brazeForm",className:"form-group",children:e.errors.submission}),A.jsx("div",{className:"form-group mb-1",children:A.jsx(zf,{className:"btn-lg w-100",variant:"dark",onClick:()=>a(),showSpinner:e.loading,disabled:e.loading||!_(),children:"Submit"})})]})]})}var Dr=(e=>(e.Unavailable="unavailable",e.Expired="expired",e.Active="active",e.NotRequired="not-required",e.Available="available",e.Unsupported="unsupported",e.UserAutoJoinAllowed="user-auto-join-allowed",e.UserJoinApprovalRequired="user-join-approval-required",e.InvalidEmail="invalid-email",e.BdmTrialAvailable="bdm-trial-available",e))(Dr||{}),In=(e=>(e.Staff="staff",e.Learner="learner",e))(In||{}),lb={exports:{}},ED;function bre(){return ED||(ED=1,(function(e,r){(function(t){e.exports=t()})(function(t){var a=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function o(b,I){var m=b[0],v=b[1],y=b[2],g=b[3];m+=(v&y|~v&g)+I[0]-680876936|0,m=(m<<7|m>>>25)+v|0,g+=(m&v|~m&y)+I[1]-389564586|0,g=(g<<12|g>>>20)+m|0,y+=(g&m|~g&v)+I[2]+606105819|0,y=(y<<17|y>>>15)+g|0,v+=(y&g|~y&m)+I[3]-1044525330|0,v=(v<<22|v>>>10)+y|0,m+=(v&y|~v&g)+I[4]-176418897|0,m=(m<<7|m>>>25)+v|0,g+=(m&v|~m&y)+I[5]+1200080426|0,g=(g<<12|g>>>20)+m|0,y+=(g&m|~g&v)+I[6]-1473231341|0,y=(y<<17|y>>>15)+g|0,v+=(y&g|~y&m)+I[7]-45705983|0,v=(v<<22|v>>>10)+y|0,m+=(v&y|~v&g)+I[8]+1770035416|0,m=(m<<7|m>>>25)+v|0,g+=(m&v|~m&y)+I[9]-1958414417|0,g=(g<<12|g>>>20)+m|0,y+=(g&m|~g&v)+I[10]-42063|0,y=(y<<17|y>>>15)+g|0,v+=(y&g|~y&m)+I[11]-1990404162|0,v=(v<<22|v>>>10)+y|0,m+=(v&y|~v&g)+I[12]+1804603682|0,m=(m<<7|m>>>25)+v|0,g+=(m&v|~m&y)+I[13]-40341101|0,g=(g<<12|g>>>20)+m|0,y+=(g&m|~g&v)+I[14]-1502002290|0,y=(y<<17|y>>>15)+g|0,v+=(y&g|~y&m)+I[15]+1236535329|0,v=(v<<22|v>>>10)+y|0,m+=(v&g|y&~g)+I[1]-165796510|0,m=(m<<5|m>>>27)+v|0,g+=(m&y|v&~y)+I[6]-1069501632|0,g=(g<<9|g>>>23)+m|0,y+=(g&v|m&~v)+I[11]+643717713|0,y=(y<<14|y>>>18)+g|0,v+=(y&m|g&~m)+I[0]-373897302|0,v=(v<<20|v>>>12)+y|0,m+=(v&g|y&~g)+I[5]-701558691|0,m=(m<<5|m>>>27)+v|0,g+=(m&y|v&~y)+I[10]+38016083|0,g=(g<<9|g>>>23)+m|0,y+=(g&v|m&~v)+I[15]-660478335|0,y=(y<<14|y>>>18)+g|0,v+=(y&m|g&~m)+I[4]-405537848|0,v=(v<<20|v>>>12)+y|0,m+=(v&g|y&~g)+I[9]+568446438|0,m=(m<<5|m>>>27)+v|0,g+=(m&y|v&~y)+I[14]-1019803690|0,g=(g<<9|g>>>23)+m|0,y+=(g&v|m&~v)+I[3]-187363961|0,y=(y<<14|y>>>18)+g|0,v+=(y&m|g&~m)+I[8]+1163531501|0,v=(v<<20|v>>>12)+y|0,m+=(v&g|y&~g)+I[13]-1444681467|0,m=(m<<5|m>>>27)+v|0,g+=(m&y|v&~y)+I[2]-51403784|0,g=(g<<9|g>>>23)+m|0,y+=(g&v|m&~v)+I[7]+1735328473|0,y=(y<<14|y>>>18)+g|0,v+=(y&m|g&~m)+I[12]-1926607734|0,v=(v<<20|v>>>12)+y|0,m+=(v^y^g)+I[5]-378558|0,m=(m<<4|m>>>28)+v|0,g+=(m^v^y)+I[8]-2022574463|0,g=(g<<11|g>>>21)+m|0,y+=(g^m^v)+I[11]+1839030562|0,y=(y<<16|y>>>16)+g|0,v+=(y^g^m)+I[14]-35309556|0,v=(v<<23|v>>>9)+y|0,m+=(v^y^g)+I[1]-1530992060|0,m=(m<<4|m>>>28)+v|0,g+=(m^v^y)+I[4]+1272893353|0,g=(g<<11|g>>>21)+m|0,y+=(g^m^v)+I[7]-155497632|0,y=(y<<16|y>>>16)+g|0,v+=(y^g^m)+I[10]-1094730640|0,v=(v<<23|v>>>9)+y|0,m+=(v^y^g)+I[13]+681279174|0,m=(m<<4|m>>>28)+v|0,g+=(m^v^y)+I[0]-358537222|0,g=(g<<11|g>>>21)+m|0,y+=(g^m^v)+I[3]-722521979|0,y=(y<<16|y>>>16)+g|0,v+=(y^g^m)+I[6]+76029189|0,v=(v<<23|v>>>9)+y|0,m+=(v^y^g)+I[9]-640364487|0,m=(m<<4|m>>>28)+v|0,g+=(m^v^y)+I[12]-421815835|0,g=(g<<11|g>>>21)+m|0,y+=(g^m^v)+I[15]+530742520|0,y=(y<<16|y>>>16)+g|0,v+=(y^g^m)+I[2]-995338651|0,v=(v<<23|v>>>9)+y|0,m+=(y^(v|~g))+I[0]-198630844|0,m=(m<<6|m>>>26)+v|0,g+=(v^(m|~y))+I[7]+1126891415|0,g=(g<<10|g>>>22)+m|0,y+=(m^(g|~v))+I[14]-1416354905|0,y=(y<<15|y>>>17)+g|0,v+=(g^(y|~m))+I[5]-57434055|0,v=(v<<21|v>>>11)+y|0,m+=(y^(v|~g))+I[12]+1700485571|0,m=(m<<6|m>>>26)+v|0,g+=(v^(m|~y))+I[3]-1894986606|0,g=(g<<10|g>>>22)+m|0,y+=(m^(g|~v))+I[10]-1051523|0,y=(y<<15|y>>>17)+g|0,v+=(g^(y|~m))+I[1]-2054922799|0,v=(v<<21|v>>>11)+y|0,m+=(y^(v|~g))+I[8]+1873313359|0,m=(m<<6|m>>>26)+v|0,g+=(v^(m|~y))+I[15]-30611744|0,g=(g<<10|g>>>22)+m|0,y+=(m^(g|~v))+I[6]-1560198380|0,y=(y<<15|y>>>17)+g|0,v+=(g^(y|~m))+I[13]+1309151649|0,v=(v<<21|v>>>11)+y|0,m+=(y^(v|~g))+I[4]-145523070|0,m=(m<<6|m>>>26)+v|0,g+=(v^(m|~y))+I[11]-1120210379|0,g=(g<<10|g>>>22)+m|0,y+=(m^(g|~v))+I[2]+718787259|0,y=(y<<15|y>>>17)+g|0,v+=(g^(y|~m))+I[9]-343485551|0,v=(v<<21|v>>>11)+y|0,b[0]=m+b[0]|0,b[1]=v+b[1]|0,b[2]=y+b[2]|0,b[3]=g+b[3]|0}function s(b){var I=[],m;for(m=0;m<64;m+=4)I[m>>2]=b.charCodeAt(m)+(b.charCodeAt(m+1)<<8)+(b.charCodeAt(m+2)<<16)+(b.charCodeAt(m+3)<<24);return I}function u(b){var I=[],m;for(m=0;m<64;m+=4)I[m>>2]=b[m]+(b[m+1]<<8)+(b[m+2]<<16)+(b[m+3]<<24);return I}function p(b){var I=b.length,m=[1732584193,-271733879,-1732584194,271733878],v,y,g,x,T,O;for(v=64;v<=I;v+=64)o(m,s(b.substring(v-64,v)));for(b=b.substring(v-64),y=b.length,g=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],v=0;v<y;v+=1)g[v>>2]|=b.charCodeAt(v)<<(v%4<<3);if(g[v>>2]|=128<<(v%4<<3),v>55)for(o(m,g),v=0;v<16;v+=1)g[v]=0;return x=I*8,x=x.toString(16).match(/(.*?)(.{0,8})$/),T=parseInt(x[2],16),O=parseInt(x[1],16)||0,g[14]=T,g[15]=O,o(m,g),m}function d(b){var I=b.length,m=[1732584193,-271733879,-1732584194,271733878],v,y,g,x,T,O;for(v=64;v<=I;v+=64)o(m,u(b.subarray(v-64,v)));for(b=v-64<I?b.subarray(v-64):new Uint8Array(0),y=b.length,g=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],v=0;v<y;v+=1)g[v>>2]|=b[v]<<(v%4<<3);if(g[v>>2]|=128<<(v%4<<3),v>55)for(o(m,g),v=0;v<16;v+=1)g[v]=0;return x=I*8,x=x.toString(16).match(/(.*?)(.{0,8})$/),T=parseInt(x[2],16),O=parseInt(x[1],16)||0,g[14]=T,g[15]=O,o(m,g),m}function h(b){var I="",m;for(m=0;m<4;m+=1)I+=a[b>>m*8+4&15]+a[b>>m*8&15];return I}function f(b){var I;for(I=0;I<b.length;I+=1)b[I]=h(b[I]);return b.join("")}f(p("hello")),typeof ArrayBuffer<"u"&&!ArrayBuffer.prototype.slice&&(function(){function b(I,m){return I=I|0||0,I<0?Math.max(I+m,0):Math.min(I,m)}ArrayBuffer.prototype.slice=function(I,m){var v=this.byteLength,y=b(I,v),g=v,x,T,O,j;return m!==t&&(g=b(m,v)),y>g?new ArrayBuffer(0):(x=g-y,T=new ArrayBuffer(x),O=new Uint8Array(T),j=new Uint8Array(this,y,x),O.set(j),T)}})();function c(b){return/[\u0080-\uFFFF]/.test(b)&&(b=unescape(encodeURIComponent(b))),b}function _(b,I){var m=b.length,v=new ArrayBuffer(m),y=new Uint8Array(v),g;for(g=0;g<m;g+=1)y[g]=b.charCodeAt(g);return I?y:v}function E(b){return String.fromCharCode.apply(null,new Uint8Array(b))}function S(b,I,m){var v=new Uint8Array(b.byteLength+I.byteLength);return v.set(new Uint8Array(b)),v.set(new Uint8Array(I),b.byteLength),v}function w(b){var I=[],m=b.length,v;for(v=0;v<m-1;v+=2)I.push(parseInt(b.substr(v,2),16));return String.fromCharCode.apply(String,I)}function R(){this.reset()}return R.prototype.append=function(b){return this.appendBinary(c(b)),this},R.prototype.appendBinary=function(b){this._buff+=b,this._length+=b.length;var I=this._buff.length,m;for(m=64;m<=I;m+=64)o(this._hash,s(this._buff.substring(m-64,m)));return this._buff=this._buff.substring(m-64),this},R.prototype.end=function(b){var I=this._buff,m=I.length,v,y=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],g;for(v=0;v<m;v+=1)y[v>>2]|=I.charCodeAt(v)<<(v%4<<3);return this._finish(y,m),g=f(this._hash),b&&(g=w(g)),this.reset(),g},R.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},R.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},R.prototype.setState=function(b){return this._buff=b.buff,this._length=b.length,this._hash=b.hash,this},R.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},R.prototype._finish=function(b,I){var m=I,v,y,g;if(b[m>>2]|=128<<(m%4<<3),m>55)for(o(this._hash,b),m=0;m<16;m+=1)b[m]=0;v=this._length*8,v=v.toString(16).match(/(.*?)(.{0,8})$/),y=parseInt(v[2],16),g=parseInt(v[1],16)||0,b[14]=y,b[15]=g,o(this._hash,b)},R.hash=function(b,I){return R.hashBinary(c(b),I)},R.hashBinary=function(b,I){var m=p(b),v=f(m);return I?w(v):v},R.ArrayBuffer=function(){this.reset()},R.ArrayBuffer.prototype.append=function(b){var I=S(this._buff.buffer,b),m=I.length,v;for(this._length+=b.byteLength,v=64;v<=m;v+=64)o(this._hash,u(I.subarray(v-64,v)));return this._buff=v-64<m?new Uint8Array(I.buffer.slice(v-64)):new Uint8Array(0),this},R.ArrayBuffer.prototype.end=function(b){var I=this._buff,m=I.length,v=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],y,g;for(y=0;y<m;y+=1)v[y>>2]|=I[y]<<(y%4<<3);return this._finish(v,m),g=f(this._hash),b&&(g=w(g)),this.reset(),g},R.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},R.ArrayBuffer.prototype.getState=function(){var b=R.prototype.getState.call(this);return b.buff=E(b.buff),b},R.ArrayBuffer.prototype.setState=function(b){return b.buff=_(b.buff,!0),R.prototype.setState.call(this,b)},R.ArrayBuffer.prototype.destroy=R.prototype.destroy,R.ArrayBuffer.prototype._finish=R.prototype._finish,R.ArrayBuffer.hash=function(b,I){var m=d(new Uint8Array(b)),v=f(m);return I?w(v):v},R})})(lb)),lb.exports}var _re=bre();const Sre=al(_re),CD={secondary:{label:"Secondary",isTertiary:!1},"primary & secondary":{label:"Primary & Secondary",isTertiary:!1},k12:{label:"Primary & Secondary",isTertiary:!1},primary:{label:"Primary",isTertiary:!1},special:{label:"Special",isTertiary:!1},university:{label:"University",isTertiary:!0},middle:{label:"Middle",isTertiary:!1},"fe college":{label:"FE College",isTertiary:!0},"high school":{label:"Secondary",isTertiary:!1},elementary:{label:"Primary",isTertiary:!1},"middle school":{label:"Middle",isTertiary:!1},tafe:{label:"TAFE",isTertiary:!0},college:{label:"FE College",isTertiary:!0},"sixth form college":{label:"Sixth Form College",isTertiary:!0}},wre={england:"ENG",scotland:"SCT",wales:"WLS","northern ireland":"NIR"},Kt={hashedEmail(e){const r=e.trim().toLowerCase();return Sre.hash(r)},removeEmptyKeys(e){if(Array.isArray(e))return e;const r={...e};return Object.entries(r).filter(([,t])=>!(t==null||typeof t=="string"&&!t.length)).reduce((t,[a,o])=>({...t,[a]:o===Object(o)?Kt.removeEmptyKeys(o):o}),{})},EVENT_TOPIC:"Free Trial Request",BDM_EVENT_TOPIC:"Requested free trial (Streamable Customer)",SOURCE:"cv_product_trial_requested",BDM_SOURCE:"cv_product_bdm_trial_requested",TRIAL_UPGRADE_SOURCE:"cv_product_trial_upgrade_requested",getSchoolType(e){var a;if(!e)return;const r=e.toLowerCase();if(["unknown","other"].includes(r))return;const t=(a=CD[r])==null?void 0:a.label;return t||e},isTertiarySchool(e){var r;return((r=CD[e==null?void 0:e.toLowerCase()])==null?void 0:r.isTertiary)||!1},parseProvince(e){return e.length?wre[e.toLowerCase()]||e:""}};function Ere(e){var h;const[r,t]=je.useState(!1),[a,o]=je.useState({});je.useEffect(()=>{e.userType===In.Learner&&e.complete({completionStep:"trial-status",trialCreated:!1,trialStatus:Dr.Unsupported})},[]);function s(f){if(wM(f.jobTitle)){d();return}u(f)}async function u(f){if(r)return;if(e.userType===In.Learner){o({...a,submission:"Something went wrong! Please try again later."});return}e.logUserAction({},{actionType:sn.Click,workflowPhase:Ma.Next,descriptor:Yt.AddToBraze}),t(!0);const{firstName:c,surname:_}=V_(f.fullname);try{const E={email:e.email,firstName:c,lastName:_,phone:f.phone,custom:{orgSubType:Kt.getSchoolType(e==null?void 0:e.schoolType),accountName:e==null?void 0:e.schoolName,jobTitle:f.jobTitle,accountAddress:{countryCode:e==null?void 0:e.country,province:Kt.parseProvince((e==null?void 0:e.province)||"")},syncToCrm:!0,source:Kt.SOURCE},event:{accountCountry:e==null?void 0:e.country,accountPostCode:e==null?void 0:e.schoolPostCode,eventTopic:Kt.EVENT_TOPIC}},S={prospect_id:e==null?void 0:e.prospectId};e.logBrazeEvent({user:E,event:{eventType:Tl.ProductFormEvent.ProductTrailRequested,additionalData:S,callback:p}})}catch{o({...a,submission:"Something went wrong! Please try again later."})}Object.keys(a).length||d()}function p(f){o(f?{}:{...a,submission:"Something went wrong! Please try again later."}),t(!1)}function d(){e.complete({completionStep:"added-to-braze",trialCreated:!1,trialStatus:null})}return A.jsx(cF,{loading:r,errors:a,setErrors:o,country:e.country||((h=e.geoLocation)==null?void 0:h.countryCode),logUserAction:e.logUserAction,handleSubmitForm:s,isTertiary:Kt.isTertiarySchool(e.schoolType)})}const fF={getRandomInt(e=1e4){return Math.floor(Math.random()*Math.floor(e))}};var Cre=function e(r,t){if(r===t)return!0;if(r&&t&&typeof r=="object"&&typeof t=="object"){if(r.constructor!==t.constructor)return!1;var a,o,s;if(Array.isArray(r)){if(a=r.length,a!=t.length)return!1;for(o=a;o--!==0;)if(!e(r[o],t[o]))return!1;return!0}if(r.constructor===RegExp)return r.source===t.source&&r.flags===t.flags;if(r.valueOf!==Object.prototype.valueOf)return r.valueOf()===t.valueOf();if(r.toString!==Object.prototype.toString)return r.toString()===t.toString();if(s=Object.keys(r),a=s.length,a!==Object.keys(t).length)return!1;for(o=a;o--!==0;)if(!Object.prototype.hasOwnProperty.call(t,s[o]))return!1;for(o=a;o--!==0;){var u=s[o];if(!e(r[u],t[u]))return!1}return!0}return r!==r&&t!==t};const xD="__googleMapsScriptId";var Ms;(function(e){e[e.INITIALIZED=0]="INITIALIZED",e[e.LOADING=1]="LOADING",e[e.SUCCESS=2]="SUCCESS",e[e.FAILURE=3]="FAILURE"})(Ms||(Ms={}));class $o{constructor({apiKey:r,authReferrerPolicy:t,channel:a,client:o,id:s=xD,language:u,libraries:p=[],mapIds:d,nonce:h,region:f,retries:c=3,url:_="https://maps.googleapis.com/maps/api/js",version:E}){if(this.CALLBACK="__googleMapsCallback",this.callbacks=[],this.done=!1,this.loading=!1,this.errors=[],this.apiKey=r,this.authReferrerPolicy=t,this.channel=a,this.client=o,this.id=s||xD,this.language=u,this.libraries=p,this.mapIds=d,this.nonce=h,this.region=f,this.retries=c,this.url=_,this.version=E,$o.instance){if(!Cre(this.options,$o.instance.options))throw new Error(`Loader must not be called again with different options. ${JSON.stringify(this.options)} !== ${JSON.stringify($o.instance.options)}`);return $o.instance}$o.instance=this}get options(){return{version:this.version,apiKey:this.apiKey,channel:this.channel,client:this.client,id:this.id,libraries:this.libraries,language:this.language,region:this.region,mapIds:this.mapIds,nonce:this.nonce,url:this.url,authReferrerPolicy:this.authReferrerPolicy}}get status(){return this.errors.length?Ms.FAILURE:this.done?Ms.SUCCESS:this.loading?Ms.LOADING:Ms.INITIALIZED}get failed(){return this.done&&!this.loading&&this.errors.length>=this.retries+1}createUrl(){let r=this.url;return r+=`?callback=${this.CALLBACK}`,this.apiKey&&(r+=`&key=${this.apiKey}`),this.channel&&(r+=`&channel=${this.channel}`),this.client&&(r+=`&client=${this.client}`),this.libraries.length>0&&(r+=`&libraries=${this.libraries.join(",")}`),this.language&&(r+=`&language=${this.language}`),this.region&&(r+=`®ion=${this.region}`),this.version&&(r+=`&v=${this.version}`),this.mapIds&&(r+=`&map_ids=${this.mapIds.join(",")}`),this.authReferrerPolicy&&(r+=`&auth_referrer_policy=${this.authReferrerPolicy}`),r}deleteScript(){const r=document.getElementById(this.id);r&&r.remove()}load(){return this.loadPromise()}loadPromise(){return new Promise((r,t)=>{this.loadCallback(a=>{a?t(a.error):r(window.google)})})}loadCallback(r){this.callbacks.push(r),this.execute()}setScript(){if(document.getElementById(this.id)){this.callback();return}const r=this.createUrl(),t=document.createElement("script");t.id=this.id,t.type="text/javascript",t.src=r,t.onerror=this.loadErrorCallback.bind(this),t.defer=!0,t.async=!0,this.nonce&&(t.nonce=this.nonce),document.head.appendChild(t)}reset(){this.deleteScript(),this.done=!1,this.loading=!1,this.errors=[],this.onerrorEvent=null}resetIfRetryingFailed(){this.failed&&this.reset()}loadErrorCallback(r){if(this.errors.push(r),this.errors.length<=this.retries){const t=this.errors.length*Math.pow(2,this.errors.length);console.log(`Failed to load Google Maps script, retrying in ${t} ms.`),setTimeout(()=>{this.deleteScript(),this.setScript()},t)}else this.onerrorEvent=r,this.callback()}setCallback(){window.__googleMapsCallback=this.callback.bind(this)}callback(){this.done=!0,this.loading=!1,this.callbacks.forEach(r=>{r(this.onerrorEvent)}),this.callbacks=[]}execute(){if(this.resetIfRetryingFailed(),this.done)this.callback();else{if(window.google&&window.google.maps&&window.google.maps.version){console.warn("Google Maps already loaded outside @googlemaps/js-api-loader.This may result in undesirable behavior as options and script parameters may not match."),this.callback();return}this.loading||(this.loading=!0,this.setCallback(),this.setScript())}}}function ID(e){return new $o({apiKey:e.apiKey,version:"weekly",libraries:e.libraries,retries:3})}function dF(e){const r={apiKey:e.apiKey,libraries:e.libraries||["places"]},[t,a]=je.useState(!1),[o,s]=je.useState(ID(r));je.useEffect(()=>{u()},[]);function u(p,d){if(!o){s(ID(r));return}o.loadCallback(h=>{if(h){a(!1),d&&d(h);return}a(!0),p&&p()})}return{loader:o,scriptLoaded:t,onGoogleApiReady:u}}function hF(e){const{scriptLoaded:r}=dF({apiKey:e.googleApiKey}),[t,a]=je.useState();return je.useEffect(()=>{r&&a(new google.maps.places.AutocompleteService)},[r]),t}const AD="us",vF="country:placeholder:text";function xre(e){const r=Zt.getLocalizedLocalityPlaceholderText(e==null?void 0:e.countryCode);if(r)return r;const t=Tn.cacheGet(`${vF}:${e==null?void 0:e.countryCode}`);if(t)return t}function Ire(){return String.fromCharCode(96+fF.getRandomInt(26))}function Are({apiKey:e,geoLocation:r,makeRequest:t=!0,template:a="E.g. [placeholder]",templateKey:o="[placeholder]"}){const s=hF({googleApiKey:e}),[u,p]=je.useState(()=>xre(r));je.useEffect(()=>{if(u||!s||!t)return;const f=(r==null?void 0:r.countryCode)||AD,_={input:Ire(),types:["(cities)"],region:f,componentRestrictions:{country:f}};s.getPlacePredictions(_,(E,S)=>h(E,S,f))},[u,s,r,t]);function d(f,c){Tn.cacheSet(`${vF}:${c}`,f,86400),p(f)}function h(f,c,_){if(c!==google.maps.places.PlacesServiceStatus.OK||!f){d(Zt.getLocalizedLocalityPlaceholderText(AD),_);return}const E=fF.getRandomInt(f.length),S=f[E].description;d(a.replace(o,S),_)}return u}const pF={getPlaceDetails(e){let r,t,a,o;const s=e.formatted_address;for(const u of e.address_components)for(const p of u.types)p==="locality"&&(r=u.short_name),p==="administrative_area_level_1"&&(t=u.short_name),p==="postal_code"&&(o=u.short_name),p==="country"&&(a=u.short_name);return{locality:s,country:a,postalCode:o,city:r,province:t}}},Tre={1:"geocoderPermissionDenied",2:"geocoderUnavailable",3:"geocoderTimeout"};function Rre(e){const[r,t]=je.useState({}),{onGoogleApiReady:a}=dF(e);function o(){a(()=>{window.navigator.geolocation.getCurrentPosition(s,u)})}function s(p){const{latitude:d,longitude:h}=p.coords,f=new google.maps.LatLng(d,h);new google.maps.Geocoder().geocode({location:f},(_,E)=>{if(E!==google.maps.GeocoderStatus.OK)return;const S=_.find(R=>R.types.includes("locality")||R.types.includes("administrative_area_level_2")),w=pF.getPlaceDetails(S);t({...w,longitude:h,latitude:d})})}function u(p){Tre[p.code],e.onPositionError("We are unable to access your location. Please try again later.")}return{placeDetails:r,onClickGetCurrentLocation:o}}const gF=(e,r)=>{const[t,a]=je.useState(e);return je.useEffect(()=>{const o=setTimeout(()=>a(e),r);return()=>clearTimeout(o)},[e,r]),t};function Ore({search:e,makePredicition:r,geoLocation:t,apiKey:a}){const o=hF({googleApiKey:a}),s=gF(e,300),[u,p]=je.useState();je.useEffect(()=>{if(!o)return;if((s==null?void 0:s.length)===0||!r){p(void 0);return}const f=(t==null?void 0:t.countryCode)||"us";o.getPlacePredictions({input:s,componentRestrictions:t!=null&&t.isFallback?void 0:{country:f},region:f,types:["locality","sublocality","postal_code"]},d)},[s,r,o]);function d(f,c){if(c!==google.maps.places.PlacesServiceStatus.OK||!f){p(void 0);return}p(f)}function h(f,c,_){new google.maps.places.PlacesService(c.current).getDetails({placeId:f.place_id,fields:["geometry","address_components","formatted_address"],region:t.countryCode},(S,w)=>{if(w!==google.maps.places.PlacesServiceStatus.OK)return;const R=S.geometry.location.lng(),b=S.geometry.location.lat(),{locality:I,country:m,postalCode:v,city:y,province:g}=pF.getPlaceDetails(S);_({longitude:R,latitude:b,locality:I,country:m,city:y,postalCode:v,province:g})})}return{localityPredicitions:u,getPlaceInfo:h}}function TD(){return A.jsx("svg",{viewBox:"0 0 24 24",children:A.jsx("path",{d:"m12.00559,20.40189c4.60881,0 8.37242,-3.78424 8.37242,-8.40189c0,-4.61764 -3.76361,-8.40187 -8.37242,-8.40187c-4.62002,0 -8.38365,3.78422 -8.38365,8.40187c0,4.61765 3.76364,8.40189 8.38365,8.40189zm0,-1.65557c-3.75235,0 -6.67085,-2.96208 -6.67085,-6.74632c0,-3.7842 2.91851,-6.74625 6.67085,-6.74625c3.74105,0 6.67084,2.96206 6.67084,6.74625c0,3.78424 -2.92978,6.74632 -6.67084,6.74632zm-10.14151,-6.02552l6.01731,0c0.40566,0 0.72118,-0.31536 0.72118,-0.7208c0,-0.40544 -0.31552,-0.7208 -0.72118,-0.7208l-6.01731,0c-0.40566,0 -0.72117,0.31536 -0.72117,0.7208c0,0.40544 0.31551,0.7208 0.72118,0.7208l-0.00001,0zm14.25442,0l6.0174,0c0.40565,0 0.72118,-0.31536 0.72118,-0.7208c0,-0.40544 -0.31553,-0.7208 -0.72118,-0.7208l-6.0174,0c-0.40565,0 -0.72118,0.31536 -0.72118,0.7208c0,0.40544 0.31553,0.7208 0.72118,0.7208zm-4.12417,-4.1221c0.40566,0 0.72118,-0.31534 0.72118,-0.70952l0,-6.02547c0,-0.40544 -0.31552,-0.7208 -0.72118,-0.7208c-0.3944,0 -0.7099,0.31536 -0.7099,0.7208l0,6.02547c0,0.39418 0.31551,0.70952 0.7099,0.70952zm0,14.25838c0.40566,0 0.72118,-0.3154 0.72118,-0.72077l0,-6.02541c0,-0.39425 -0.31552,-0.70965 -0.72118,-0.70965c-0.3944,0 -0.7099,0.3154 -0.7099,0.70965l0,6.02541c0,0.40538 0.31551,0.72077 0.7099,0.72077z"})})}const kre="_baseText_5xxp4_1",Pre="_inputFocused_5xxp4_4",Nre="_dropdown_5xxp4_7",jre="_suggestionContainer_5xxp4_10",qre="_suggestionItem_5xxp4_20",Dre="_suggestionLoading_5xxp4_20",Lre="_noSuggestion_5xxp4_20",Mre="_large_5xxp4_24",Ure="_input_5xxp4_4",Fre="_selected_5xxp4_42",Bre="_useMyLocation_5xxp4_46",zt={baseText:kre,inputFocused:Pre,dropdown:Nre,suggestionContainer:jre,suggestionItem:qre,suggestionLoading:Dre,noSuggestion:Lre,large:Mre,input:Ure,selected:Fre,useMyLocation:Bre};function $re(e){const{predictions:r,getPlaceInfo:t,selectedIndex:a}=e;return A.jsx(A.Fragment,{children:r.map((o,s)=>A.jsx(Zo,{className:`${zt.suggestionItem} ${a-1===s?zt.selected:""}`,onKeyDown:u=>u.key==="Enter"&&t(o),onMouseDown:()=>t(o),onClick:()=>t(o),children:o.description},o.place_id))})}function mF(e){var V,G,B,M,L;const r=je.useRef(null),[t,a]=je.useState(((V=e.data)==null?void 0:V.schoolLocality)||""),[o,s]=je.useState(!1),u=Are({apiKey:e.googleMapsApiKey,geoLocation:e.geoLocation}),{localityPredicitions:p,getPlaceInfo:d}=Ore({search:t,makePredicition:o,geoLocation:e.geoLocation,apiKey:e.googleMapsApiKey}),{placeDetails:h,onClickGetCurrentLocation:f}=Rre({apiKey:e.googleMapsApiKey,onPositionError:v}),c=window.navigator.geolocation?1:0,{selectedIndex:_,onKeyDown:E,containerRef:S,hide:w,onBlur:R,onFocus:b}=g_({onSelected:x,itemCount:((p==null?void 0:p.length)??0)+c,hideOnBlur:e.hideOnBlur}),[I,m]=je.useState();je.useEffect(()=>{T(h)},[h]);function v(U){s(!0),m(U)}function y(U){var H,ae,oe;I&&m(void 0),o||s(!0),((H=e.data)!=null&&H.longitude||(ae=e.data)!=null&&ae.latitude||(oe=e.data)!=null&&oe.schoolLocality)&&e.clearData(),a(U)}function g(){y(""),r.current.focus()}function x(U){if(!p)return;if(U===p.length){j();return}const H=p[U];H&&O(H)}function T(U){e.setData({schoolLocality:U.locality,country:U.country,province:U.province,schoolPostCode:U.postalCode,longitude:U.longitude,latitude:U.latitude}),U.locality&&a(U.locality)}function O(U){o&&s(!1),d(U,r,T)}function j(U){var H;U==null||U.preventDefault(),s(!1),f(),(H=e.logUserAction)==null||H.call(e,{},{actionType:sn.Click,descriptor:Yt.UseMyLocation})}function k(){let U="form-control";return e.size==="lg"&&(U+=" form-control-lg"),!N||w?`${U} ${zt.input}`:`${U} ${zt.inputFocused}`}const N=(p==null?void 0:p.length)&&!((B=(G=e.data)==null?void 0:G.schoolLocality)!=null&&B.length),D=window.navigator.geolocation&&!((L=(M=e.data)==null?void 0:M.schoolLocality)!=null&&L.length),F=e.labelClassName||`d-block text-center mb-3 fw-normal ${zt.baseText}`;let $="form-group position-relative";return e.size==="lg"&&($+=` ${zt.large}`),A.jsxs("div",{className:$,children:[A.jsxs("label",{className:F,htmlFor:"locality-input",children:["ZIP code or city",e.required&&A.jsx("span",{className:"text-danger",children:"*"})]}),A.jsx(Bs,{type:"text",value:t,onChange:U=>y(U.currentTarget.value),id:"locality-input",className:k(),ref:r,autoComplete:"off",placeholder:u||"Loading...",disabled:e.disabled||!u,autoFocus:e==null?void 0:e.autoFocus,onClickClear:g,onKeyDown:E,onFocus:b,onBlur:R}),A.jsxs("div",{className:`position-absolute z-1 w-100 ${zt.dropdown} ${w?"d-none":""}`,children:[!!N&&A.jsxs("div",{className:zt.suggestionContainer,ref:S,children:[A.jsx($re,{predictions:p,getPlaceInfo:O,selectedIndex:_}),window.navigator.geolocation&&e.useGeoLocationApi&&A.jsx(Zo,{className:`${zt.suggestionItem} px-1 ${_-1===p.length?zt.selected:""}`,onClick:j,children:A.jsxs("div",{className:"btn btn-link info-link btn-with-icon bg-transparent py-0 pe-1",children:[A.jsx(TD,{}),"Use my current location"]})})]}),D&&!N&&e.useGeoLocationApi&&A.jsx("div",{className:`d-flex ${zt.useMyLocation}`,children:A.jsxs("button",{onClick:j,className:"btn btn-link info-link bg-white btn-with-icon",children:[A.jsx(TD,{}),"Use my current location"]})}),!!I&&A.jsx("div",{className:"text-danger p-2",children:I})]})]})}var Li=(e=>(e.GET="GET",e.POST="POST",e.PUT="PUT",e.DELETE="DELETE",e))(Li||{});class zre extends Error{constructor(r,t="Error"){super(t),this.body=r}}const Zre={prepareQuery(e,r){let t=e;return Object.keys(r).forEach((a,o)=>{r[a]&&(o===0?t+="?":t+="&",t+=`${a}=${encodeURIComponent(r[a])}`)}),t}};function cb(e){let r={method:Li.GET,headers:{"Content-type":"application/json"}};e.method&&(r={...r,method:e.method}),e.init&&(r={...r,...e.init});let t=e.url;return r.method===Li.GET&&e.data?t=Zre.prepareQuery(t,e.data):e.data&&(r={...r,body:JSON.stringify(e.data)}),{init:r,url:t}}const ei={async asyncFetch(e){const r=cb(e),t=await fetch(r.url,r.init);if(!t.ok){const a=await t.json();throw new zre(a)}if(t.status!==204)return await t.json()},async asyncFetchPlain(e){const r=cb(e),t=await fetch(r.url,r.init);if(t.ok)return await t.text()},fetch(e){const r=cb(e);return fetch(r.url,r.init).then(t=>{if(t.status!==204)return t.json()}).then(t=>(e.success&&e.success(t),t)).catch(t=>(e.error&&e.error(),t)).finally(()=>{e.always&&e.always()})}},Zf={search(e,r,t,a,o){const s={longitude:r.longitude,latitude:r.latitude};r.query&&(s.query=r.query),ei.fetch({url:e,data:s,success:t,error:a,always:o})},async create(e,r){return ei.asyncFetch({url:e.createProspect,method:Li.POST,data:r})},getLookups(e,r){return ei.asyncFetch({url:e.prospectLookups(r)})}},Hre=/\/$/,Vre={urlBuilder(e,r){const a=Object.entries(r).map(([o,s])=>o&&Array.isArray(s)?s.map(p=>`${o}=${encodeURIComponent(p)}`).join("&"):o&&s!==void 0&&s!==null?`${o}=${encodeURIComponent(s)}`:"").reduce((o,s)=>s?o?`${o}&${s}`:s:o,"");return a?`${e}?${a}`:e},buildFilter(e){const r=[];if(e.limit&&r.push(`limit:${e.limit}`),e.cursor&&r.push(`page:${e.cursor}`),e.before&&r.push(`dateCreated:...${e.before}`),!!r.length)return r.join(",")},makeHttps(e){return typeof e!="string"||e.indexOf("http://")===-1||(e=e.replace("http://","https://")),e},safeUrlConcat(e,r){if(!e)return;let t=e;return e.endsWith("/")||(t+="/"),r&&(t+=r.startsWith("/")?r.slice(1):r),t},removeTrailingSlash(e){if(typeof e=="string")return e.replace(Hre,"")}},mo={checkTrialStatus(e,r){if(e.productName!==La.Lite)return Promise.reject();const t={email:r.email};return ei.asyncFetch({url:e.userStatus,data:t})},checkUserIdps(e,r){return e.productName!==La.Lite?Promise.reject():ei.asyncFetch({url:e.idps,data:{email:r}})},checkProspectTrialStatus(e,r,t,a,o){let s=e.prospectStatus(r.prospectId);s=Vre.urlBuilder(s,{email:r.email}),ei.fetch({url:s,success:t,error:a,always:o})},createTrial(e,r){const t={prospectId:r.prospectId,email:r.email,userType:r.userType,appLink:r==null?void 0:r.appLink,attribution:r==null?void 0:r.attribution};return ei.asyncFetch({url:e.createTrial,method:Li.POST,data:t})},resendTrialEmail(e,r,t){if(e.productName!==La.Lite)return Promise.reject();const a={email:t.email,appLink:t==null?void 0:t.appLink};return ei.asyncFetch({url:e.resendTrialEmail(r),method:Li.POST,data:a})},createJoinRequest(e,r){const t=e.productName===La.Auth?e.joinRequest:e.joinRequest(r.customerId),a=e.productName===La.Auth?r:{email:r.email};return ei.asyncFetch({url:t,method:Li.POST,data:a})},createAutoJoinRequest(e,r){return e.productName!==La.Lite?Promise.reject():ei.asyncFetch({url:e.autoJoin,method:Li.POST,data:r})}},RD=["Primary","Secondary","K12","Special","TAFE","University"],Gre=["Primary","Secondary","Primary & Secondary","Special","Sixth Form College","FE College","University","Other"],xb=["Elementary","Middle School","High School","College","Other"],Wre={au:RD,nz:RD,uk:Gre,us:xb,ca:xb};function Kre(e){const r=Zt.getCountryCode(e),t=Wre[r];return t||xb}var yF=(e=>(e.Published="Published",e.Draft="Draft",e))(yF||{});function Yre(e){var R;const[r,t]=je.useState({prospectId:e.prospectId,schoolName:e.schoolName,schoolType:e.schoolType,schoolLocality:e.schoolLocality,country:e.country,province:e.province,city:e.city,longitude:e.longitude,latitude:e.latitude}),[a,o]=je.useState(),[s,u]=je.useState(!1),p=Kre(r.country||((R=e.geoLocation)==null?void 0:R.countryCode));function d(){const{schoolName:b,schoolType:I,country:m}=r;return!!(b&&I&&m)}function h(b,I){t(m=>({...m,[b]:I}))}function f(b){const{longitude:I,latitude:m,schoolLocality:v,country:y,city:g,province:x}=b;I&&h("longitude",I),m&&h("latitude",m),y&&h("country",y),g&&h("city",g),x&&h("province",x),v&&h("schoolLocality",v)}function c(){h("schoolLocality",void 0),h("longitude",void 0),h("latitude",void 0),h("city",void 0),h("province",void 0),h("country",void 0),o("")}function _(b){const I=b.target.value;h("schoolType",I)}function E(b){h("schoolName",b.target.value)}async function S(b){const I={email:e.email,custom:{accountName:r==null?void 0:r.schoolName,accountAddress:{countryCode:r==null?void 0:r.country,province:Kt.parseProvince(r.province)},orgSubType:Kt.getSchoolType(r==null?void 0:r.schoolType),syncToCrm:!0,source:Kt.SOURCE},event:{accountCountry:r==null?void 0:r.country,accountPostCode:r==null?void 0:r.schoolPostCode,accountState:Kt.parseProvince(r.province)}},m={form_type:"trial-sign-up",prospect_id:r==null?void 0:r.prospectId};e.logBrazeEvent({user:I,event:{eventType:Tl.ProductFormEvent.FormSubmission,additionalData:m,callback:b}})}async function w(b){var m;if(b.preventDefault(),!d())return;e.logUserAction(r,{actionType:sn.Click,workflowPhase:Ma.Next,descriptor:Yt.CantFindSchool}),u(!0);let I;try{if(I=await Zf.create(e.ajaxUrls,{name:r.schoolName,status:yF.Draft,countryCode:r.country,prospectType:r.schoolType,city:r.city,postCode:r.schoolPostCode,province:Kt.parseProvince(r.province)}),!I.id){u(!1),o("Error. Something went wrong.");return}}catch{u(!1),o("Error. Something went wrong.");return}if(e.userTrialStatus===Dr.BdmTrialAvailable){if(e.userType!==In.Staff){e.complete({completionStep:"added-to-braze",trialCreated:!1,trialStatus:null});return}e.nextStep({step:"request-bdm-trial",...r});return}try{const v={prospectId:I.id,email:e.email,userType:e.userType,appLink:e.pageAppLinkString,attribution:{...bi.getDecodedAttributionData(),utms:ss.getUtmParameters()}},y=await mo.createTrial(e.ajaxUrls,v);e.createOrUpdateProfile&&e.createOrUpdateProfile({masterId:y.id,email:e.email,countryCode:r==null?void 0:r.country});const g={completionStep:"trial-status",email:e.email,userId:y.id,prospectId:I.id,schoolName:r.schoolName,schoolLocality:r.schoolLocality,country:r.country,schoolType:r.schoolType,city:r.city,schoolPostCode:r.schoolPostCode,latitude:r.latitude,longitude:r.longitude,province:r.province,trialStatus:Dr.Available,trialCreated:!0,customerId:(m=y.data)==null?void 0:m.customerId};if((e==null?void 0:e.userType)===In.Staff){await S(x=>{x||console.error("Failed to submit create trial data to braze."),e.complete(g)});return}e.complete(g)}catch(v){if(!v.body){u(!1),o("Error. Something went wrong.");return}const y=v;if(y.body.status===400&&y.body.type==="trial-not-available"){e.nextStep({step:"add-to-braze",...r,prospectId:I.id,trialStatus:Dr.Unavailable});return}console.error(v)}}return A.jsxs(A.Fragment,{children:[A.jsxs("div",{className:"text-center",children:[A.jsx("h1",{className:"h4",children:"Tell us more about your school"}),A.jsx("p",{children:"Please enter your school details."})]}),A.jsxs("div",{className:"form-group",children:[A.jsx("label",{className:"d-block",htmlFor:"school-name-input",children:"Name of school"}),A.jsx("input",{type:"text",value:(r==null?void 0:r.schoolName)||"",onChange:E,id:"school-name-input",className:"form-control form-control-lg",autoComplete:"off",placeholder:"Enter name of school",autoFocus:!0})]}),A.jsxs("div",{className:"form-group",children:[A.jsx("label",{className:"d-block",htmlFor:"school-type-select",children:"Type of school"}),A.jsxs("select",{id:"school-type-select",className:`form-select form-select-lg ${r.schoolType?"":"text-secondary"}`,autoComplete:"off",value:r.schoolType||"none",onChange:_,children:[A.jsx("option",{value:"none",className:"text-secondary",disabled:!0,children:"Select type of school"}),p.map(b=>A.jsx("option",{value:b,className:"text-dark",children:b},b))]})]}),A.jsx(mF,{data:r,setData:f,clearData:c,disabled:!1,labelClassName:"d-block",geoLocation:e.geoLocation,logUserAction:e.logUserAction,googleMapsApiKey:e.googleMapsApiKey,autoFocus:!1,size:"lg",useGeoLocationApi:!0}),a&&A.jsx("div",{className:"text-danger mb-3",children:a}),d()&&A.jsx(zf,{className:"btn-lg w-100",variant:"dark",onClick:w,showSpinner:s,disabled:s,children:"Get started"})]})}function W_(e,r){return r?`${e} ${r}`:e}function Jre(e){return A.jsx("h1",{className:W_("text-center mb-2 h4",e.className),children:e.children})}function Xre(e){return A.jsx("div",{className:W_("text-center text-sm px-2 px-lg-4",e.className),children:e.children})}function Qre(e){return A.jsx("p",{className:W_("",e.className),children:e.children})}const rt={Heading:Jre,Body:Xre,Message:Qre};function Rl(e){const r={[Dr.Available]:e.imageUrls.statusImages.available,[Dr.Active]:e.imageUrls.statusImages.active,[Dr.Expired]:e.imageUrls.statusImages.expired,[Dr.NotRequired]:e.imageUrls.statusImages.notRequired,[Dr.Unavailable]:e.imageUrls.statusImages.unavailable,[Dr.Unsupported]:e.imageUrls.statusImages.unsupported,[Dr.UserAutoJoinAllowed]:e.imageUrls.statusImages.notRequired,[Dr.UserJoinApprovalRequired]:e.imageUrls.statusImages.notRequired,[Dr.InvalidEmail]:"",[Dr.BdmTrialAvailable]:""};return A.jsx("div",{className:"d-flex justify-content-center my-4 px-2 px-lg-4",children:A.jsx("img",{src:r[e.trialStatus],className:"w-100 h-auto"})})}function ete(e){return je.useEffect(()=>{e.logUserAction({},{actionType:sn.Create,descriptor:Yt.TrialRequested,workflowPhase:Ma.Complete})},[]),A.jsxs(A.Fragment,{children:[A.jsx(Rl,{trialStatus:Dr.Available,imageUrls:e.imageUrls}),A.jsxs(rt.Body,{className:"mb-3",children:[A.jsx(rt.Heading,{children:"Submitted!"}),A.jsx(rt.Message,{children:"Thank you for your interest in trialing ClickView. We will be in touch with you as soon as possible."})]})]})}function rte(e){return A.jsxs(A.Fragment,{children:[A.jsx(Rl,{trialStatus:Dr.Available,imageUrls:e.imageUrls}),A.jsxs(rt.Body,{className:"mb-3",children:[A.jsx(rt.Heading,{children:"You've requested access!"}),A.jsx(rt.Message,{children:"We've sent a request to your ClickView admin. Once your account is ready, you'll receive an email notification with instructions on how to get started with ClickView."})]})]})}const Uc={Marketing:{au:"https://www.clickvieweducation.com/en-au",us:"https://www.clickvieweducation.com",nz:"https://www.clickview.co.nz",uk:"https://www.clickview.co.uk",ca:"https://www.clickvieweducation.com/en-ca"},Support:{au:"https://www.clickviewsupport.com/hc/en-au",uk:"https://www.clickviewsupport.com/hc/en-au#gb",nz:"https://www.clickviewsupport.com/hc/en-au#nz",us:"https://www.clickviewsupport.com/hc/en-au#us",ca:"https://www.clickviewsupport.com/hc/en-au#ca"}},tte={[Ze.AU]:"/contact-us/sales",[Ze.US]:"/contact-us/sales",[Ze.NZ]:"/contact-us/",[Ze.UK]:"/contact-us/trial",[Ze.CA]:"/contact-us/sales"},nte={[Ze.AU]:"/resources/free-student-resources",[Ze.US]:"/resources/free-student-resources",[Ze.NZ]:"/free-student-resources/",[Ze.UK]:"/free-student-resources/",[Ze.CA]:"/resources/free-student-resources"},wo={getMarketingUrlForGeoLocation(e){const r=Zt.getCountryCode(e==null?void 0:e.countryCode),t=Uc.Marketing[r];return t||Uc.Marketing.us},getMarketingSalesContactForGeoLocation(e){const r=Zt.getCountryCode(e==null?void 0:e.countryCode),t=wo.getMarketingUrlForGeoLocation(e),a=tte[r];return`${t}${a}`},getFreeResourcesForGeoLocation(e){const r=Zt.getCountryCode(e==null?void 0:e.countryCode),t=this.getMarketingUrlForGeoLocation({countryCode:r}),a=nte[r];return`${t}${a}`},getTermsAndConditionsLink(){return this.getMarketingUrlForGeoLocation(Ze.US)+"/terms-and-conditions/"},getPrivacyPolicyLink(){return this.getMarketingUrlForGeoLocation(Ze.US)+"/privacy-policy/"},getSupportUrlForGeoLocation(e){const r=Zt.getCountryCode(e==null?void 0:e.countryCode),t=Uc.Support[r];return t||Uc.Support.us}};function Fc(e){const r=(e==null?void 0:e.previousStepIds)&&e.previousStepIds[e.previousStepIds.length-1]==="find-school",t=(e==null?void 0:e.schoolName)||"Your school";return A.jsxs(rt.Body,{className:"mb-3",children:[r?A.jsxs(A.Fragment,{children:[A.jsxs(rt.Heading,{children:[t,A.jsx("br",{}),"already has ClickView 🎉"]}),A.jsxs(rt.Message,{className:"mt-3",children:["If your school has SSO ",A.jsx("a",{href:e.getSignInUrl({email:e.email,customerId:e.customerId}),className:"info-link",children:"click here to sign in."})]}),A.jsx(rt.Message,{children:"Otherwise please contact your school admin for access."})]}):A.jsxs(A.Fragment,{children:[A.jsx(rt.Heading,{children:"Good News!"}),A.jsxs(rt.Message,{children:["An account already exists for:",A.jsx("br",{})," ",A.jsx("strong",{children:e.email})]}),A.jsx(rt.Message,{children:A.jsx("a",{href:e.getSignInUrl({email:e.email}),className:"btn btn-dark btn-lg w-100",children:"Sign into ClickView"})})]}),A.jsxs(rt.Message,{children:["Need Help? ",A.jsx("a",{href:wo.getSupportUrlForGeoLocation(e.geoLocation),className:"info-link",target:"_blank",children:"Contact our Help Centre."})]})]})}function ate(e){const r=wo.getMarketingSalesContactForGeoLocation(e.geoLocation),t=(e==null?void 0:e.previousStepIds)&&e.previousStepIds[e.previousStepIds.length-1]==="find-school",a=(e==null?void 0:e.schoolName)||"Your school";return A.jsxs(rt.Body,{children:[A.jsx(rt.Heading,{children:t?`${a} trial has expired`:"Your trial has expired"}),A.jsxs(rt.Message,{children:["Please contact our ",A.jsx("a",{href:r,className:"info-link",target:"_blank",children:"ClickView Sales Team"})]})]})}function ite(e){const r=wo.getMarketingSalesContactForGeoLocation(e.geoLocation);return A.jsxs(rt.Body,{children:[A.jsxs(rt.Heading,{children:["Your school no longer",A.jsx("br",{})," has access to ClickView"]}),A.jsxs(rt.Message,{children:["Please contact our ",A.jsx("a",{href:r,className:"info-link",children:"ClickView Sales Team"})," for more information."]})]})}function ote(){return A.jsxs(rt.Body,{children:[A.jsxs(rt.Heading,{className:"px-2 px-lg-4",children:["ClickView isn't currently ",A.jsx("br",{})," available for your school"]}),A.jsx(rt.Message,{children:"We're working hard to get ClickView ready for more people."})]})}const ste=1;function ute(e){const[r,t]=je.useState(0),[a,o]=je.useState(!1);async function s(p){p==null||p.preventDefault();try{await mo.resendTrialEmail(e.ajaxUrls,e.userId,{email:e.email,appLink:e.pageAppLinkString}),t(r+1)}catch{o(!0)}e.logUserAction({},{actionType:sn.Click,descriptor:Yt.ResendEmail})}function u(p){p==null||p.preventDefault(),e.logUserAction({},{actionType:sn.Click,descriptor:Yt.WrongEmail}),e.nextStep({step:"enter-email",userType:e.userType})}if(e!=null&&e.email)return A.jsxs(rt.Body,{children:[A.jsx(rt.Heading,{children:"Check your inbox!"}),A.jsxs(rt.Message,{children:["An email has been sent to ",A.jsx("strong",{children:e.email}),"."]}),!!e.userId&&A.jsxs(A.Fragment,{children:[r<ste?A.jsx("button",{onClick:s,className:"btn btn-outline-dark btn-lg mb-3",children:"Resend verification email"}):A.jsx(rt.Message,{children:"✅ Email has been resent!"}),A.jsxs(rt.Message,{children:["Wrong email? ",A.jsx("button",{onClick:u,className:"btn info-link p-0 align-top border-0",children:"Update email address"})]}),a&&A.jsxs(rt.Message,{className:"mb-0 text-danger",children:["❌ There was a problem resending the email. Please try again later or contact our ",A.jsx("a",{href:wo.getSupportUrlForGeoLocation(e.geoLocation),className:"info-link",children:"support"})]})]})]})}const lte={[Dr.Available]:ute,[Dr.Active]:Fc,[Dr.Expired]:ate,[Dr.NotRequired]:Fc,[Dr.Unavailable]:ite,[Dr.Unsupported]:ote,[Dr.UserAutoJoinAllowed]:Fc,[Dr.UserJoinApprovalRequired]:Fc,[Dr.InvalidEmail]:null,[Dr.BdmTrialAvailable]:null};function cte(e){const r=lte[e.trialStatus];return r?A.jsx(r,{...e}):A.jsx(A.Fragment,{})}function fte(e){return je.useEffect(()=>{const r={actionType:sn.Create,descriptor:Yt.DeadEnd,workflowPhase:Ma.Discard};e.trialCreated&&(r.descriptor=Yt.TrialCreated,r.workflowPhase=Ma.Complete),e.logUserAction({},r)},[]),A.jsxs(A.Fragment,{children:[A.jsx(Rl,{trialStatus:e.trialStatus,imageUrls:e.imageUrls}),A.jsx(cte,{...e})]})}const dte="young-student";function hte(e){const r=wo.getFreeResourcesForGeoLocation(e.geoLocation);return je.useEffect(()=>{Tn.set(dte,!0)},[]),A.jsxs(A.Fragment,{children:[A.jsx(Rl,{trialStatus:Dr.Active,imageUrls:e.imageUrls}),A.jsxs(rt.Body,{className:"mb-3",children:[A.jsx(rt.Heading,{children:"Discover our free content"}),A.jsx(rt.Message,{children:"Click the button below to explore our videos"}),A.jsx("a",{href:r,className:"btn btn-lg btn-dark w-100",target:"_blank",children:"Start watching now"})]})]})}const vte={"trial-status":fte,"added-to-braze":ete,"young-student":hte,"requested-access":rte};function pte(e){const r=vte[e.completionStep];return A.jsx("div",{className:"d-flex justify-content-center flex-column mx-auto px-2",children:A.jsx(r,{...e})})}const gte="_day_n6ysn_1",mte="_month_n6ysn_4",yte="_year_n6ysn_7",fb={day:gte,month:mte,year:yte},bte=120,_te=16;function Ste(e,r,t){const a=new Date(bF(e,r,t));return!isNaN(+a)}function bF(e,r,t){return`${e.padStart(4,"0")}-${r.padStart(2,"0")}-${t.padStart(2,"0")}`}function wte(e){const[r,t]=je.useState(""),[a,o]=je.useState(""),[s,u]=je.useState(""),[p,d]=je.useState(null);function h(v){t(v.target.value),d(null)}function f(v){o(v.target.value),d(null)}function c(v){u(v.target.value),d(null)}function _(){return!r||!a||!s?(d("Please enter your date of birth"),!1):Ste(s,a,r)?+s>S?(d("Please enter a date in the past"),!1):+s<S-bte?(d("Please enter a realistic date of birth"),!1):!0:(d("Please enter a valid date"),!1)}function E(v){if(v.preventDefault(),!_())return;const y=new Date(bF(s,a,r)),g=S-_te,x=new Date;if(x.setFullYear(g),y>x){e.complete({completionStep:"young-student",trialCreated:!1,trialStatus:null});return}e.nextStep({step:"enter-email",userType:e.userType})}const S=new Date().getFullYear(),w="mx-2 d-inline-block text-start",R=`form-control form-control-lg ${p?"is-invalid":""}`;let b="order-0",I="order-3";const m=Zt.isCountryCodeUS(e.geoLocation.countryCode);return m&&(b="order-3",I="order-0"),A.jsxs("form",{className:"text-center",onSubmit:E,noValidate:!0,children:[A.jsx("h1",{className:"h4",children:"Tell us a little about yourself"}),A.jsx("p",{children:"Please enter your date of birth"}),A.jsxs("div",{className:"my-4",children:[A.jsxs("fieldset",{className:"d-flex justify-content-center","aria-describedby":"dateOfBirthError",children:[A.jsxs("div",{className:`${w} ${b}`,children:[A.jsx("label",{className:"mb-0",htmlFor:"day",children:"Day"}),A.jsx("input",{id:"day",type:"number",className:`${R} ${fb.day}`,min:"1",max:"31",placeholder:"DD",value:r,onChange:h,autoFocus:!m,tabIndex:m?2:1})]}),A.jsx("span",{className:`h1 fw-normal mt-3 mb-0 order-1 ${p?"text-danger":""}`,children:"/"}),A.jsxs("div",{className:`${w} ${I}`,children:[A.jsx("label",{className:"mb-0",htmlFor:"month",children:"Month"}),A.jsx("input",{id:"month",type:"number",className:`${R} ${fb.month}`,min:"1",max:"12",placeholder:"MM",value:a,onChange:f,autoFocus:m,tabIndex:m?1:2})]}),A.jsx("span",{className:`h1 fw-normal mt-3 mb-0 order-4 ${p?"text-danger":""}`,children:"/"}),A.jsxs("div",{className:`${w} order-5`,children:[A.jsx("label",{className:"mb-0",htmlFor:"year",children:"Year"}),A.jsx("input",{id:"year",name:"year",type:"number",className:`${R} ${fb.year}`,min:S-120,max:S,placeholder:"YYYY",value:s,onChange:c,tabIndex:3})]})]}),!!p&&A.jsx(Ht,{name:"dateofBirth",children:p})]}),A.jsx("button",{type:"submit",className:"btn btn-lg btn-dark w-100",children:"Continue"})]})}function Ete(e){return A.jsxs(A.Fragment,{children:["Have a ClickView account already?",A.jsx("a",{href:e.link,className:"info-link ms-1",onClick:e.onClick,children:"Sign in"})]})}function Cte(){const e={},r=bi.getEncodedAttributionData();r&&(e.r=r);const t=ss.getUtmParameters();return t&&(e.utms=t),JSON.stringify(e)}const xte=new RegExp(/^[^\s@]+@[^\s@]+\.[^\s@]+$/),OD={[Ze.AU]:"valerie.frizzle@school.edu.au",[Ze.UK]:"valerie.frizzle@school.gov.uk",[Ze.US]:"valerie.frizzle@school.gov",[Ze.NZ]:"valerie.frizzle@school.nz",[Ze.CA]:"valerie.frizzle@school.ca"},Ite={[Ze.AU]:"/contact-us/support",[Ze.US]:"/contact-us/support",[Ze.NZ]:"/contact-us/",[Ze.UK]:"/contact-us/technical/",[Ze.CA]:"/contact-us/support"};function Ate(e){const r=wo.getMarketingUrlForGeoLocation(e),t=Zt.getCountryCode(e==null?void 0:e.countryCode),a=Ite[t];return`${r}${a}`}function Tte(e){const r=OD[Zt.getCountryCode(e.countryCode)];return r||OD.us}const Rte=[Dr.Expired,Dr.NotRequired,Dr.Unavailable,Dr.Unsupported,Dr.Active];function Ote(e){const[r,t]=je.useState(!1),[a,o]=je.useState((e==null?void 0:e.email)||""),[s,u]=je.useState(),p=Ate(e.geoLocation);async function d(){u("");let S;try{S=await mo.checkTrialStatus(e.ajaxUrls,{email:a})}catch{u("Something went wrong! Please try again later.");return}if(S.status===Dr.InvalidEmail){u("Please use your school email address.");return}if(e.logUserAction({},{actionType:sn.Click,workflowPhase:Ma.Next,descriptor:Yt.EnterEmail}),Rte.includes(S.status)){e.complete({completionStep:"trial-status",email:a,trialStatus:S.status,trialCreated:!1});return}try{const w=await mo.checkUserIdps(e.ajaxUrls,a);if(w.length){e.nextStep({step:"select-idp",email:a,userTrialStatus:S.status,idps:w});return}}catch{u("Something went wrong! Please try again later.");return}e.nextStep({step:"find-school",email:a,userTrialStatus:S.status})}function h(){e.logUserAction({},{actionType:sn.Click,descriptor:Yt.ContactUs})}function f(){return a.length?xte.test(a)?!0:(u("Please use your school email address."),!1):(u("Please enter your school email address."),!1)}function c(){e.logUserAction({},{actionType:sn.Click,descriptor:Yt.SignIn})}function _(S){S.preventDefault(),o(S.target.value),u("")}async function E(S){S==null||S.preventDefault(),f()&&(t(!0),await d(),t(!1))}return A.jsxs(A.Fragment,{children:[A.jsxs("div",{className:"text-center",children:[A.jsx("h1",{className:"h4",children:"Let's set up your account"}),A.jsx("p",{children:"Enter your school email address"})]}),A.jsxs("form",{onSubmit:E,noValidate:!0,children:[A.jsxs("div",{className:"form-group mb-3",children:[A.jsx(Bs,{value:a,onChange:_,name:"email-input",id:"email-input",type:"email",className:`form-control form-control-lg ${s?"is-invalid":""}`,placeholder:Tte(e.geoLocation),autoComplete:"false",autoCorrect:"false",autoFocus:!0,onClickClear:()=>o(""),"aria-errormessage":"email-inputError"}),s&&A.jsxs(A.Fragment,{children:[A.jsx(Ht,{name:"error-input",children:s}),A.jsxs("small",{children:["Having an issue with your email?",A.jsx("a",{href:p,className:"info-link ps-1",target:"_blank",onClick:h,children:"Contact our team"})]})]})]}),A.jsx(zf,{showSpinner:r,variant:"dark",className:"btn-lg mb-3 w-100",disabled:r,onClick:E,children:"Continue"})]}),e.userType===In.Staff&&A.jsx(h_,{idps:e.globalIdps,className:"mt-n3",attribution:Cte()}),A.jsx("div",{className:"text-center",children:A.jsx(Ete,{link:e.getSignInUrl({email:a}),onClick:c})})]})}function kte(e){var r;switch((r=e==null?void 0:e.body)==null?void 0:r.type){case"user-type-not-supported":return"Students may not request to join schools.";case"join-request-already-pending":return"Your request is awaiting administrator approval.";case"join-request-already-denied":return"Your request has been denied by an administrator.";case"join-request-not-allowed":case"user-email-domain-not-approved":case"user-email-invalid":case"create-join-request-failed":case"join-not-required":default:return"Something went wrong."}}var K_=(e=>(e.MasterId="master_id",e.CrmId="crm_id",e.SalesforceId="salesforce_id",e))(K_||{});function Pte(e){const[r,t]=je.useState(null);async function a(){var o;try{const u=(o=(await Zf.getLookups(e.ajaxUrls,e.prospectId)).find(p=>p.type===K_.MasterId))==null?void 0:o.externalId;if(!u){t("Something went wrong.");return}await mo.createJoinRequest(e.ajaxUrls,{customerId:u,email:e.email}),e.logUserAction({},{actionType:sn.Click,descriptor:Yt.RequestAccess}),e.complete({completionStep:"requested-access",trialCreated:!1,trialStatus:Dr.UserJoinApprovalRequired})}catch(s){t(kte(s))}}return A.jsxs(A.Fragment,{children:[A.jsx(Rl,{trialStatus:Dr.UserJoinApprovalRequired,imageUrls:e.imageUrls}),A.jsx(rt.Body,{className:"mb-3",children:A.jsxs(rt.Heading,{children:[e.schoolName,A.jsx("br",{}),"already has ClickView 🎉"]})}),A.jsx("button",{className:"btn btn-lg btn-dark w-100 mb-3",onClick:a,children:"Request access"}),r&&A.jsx("p",{className:"text-danger text-center mb-2",children:r}),A.jsxs(rt.Message,{className:"text-center",children:["Need Help? ",A.jsx("a",{href:wo.getSupportUrlForGeoLocation(e.geoLocation),className:"info-link",target:"_blank",children:"Contact our Help Centre."})]})]})}const Nte={checkEmail(e,r,t){return e.productName!==La.Lite?Promise.reject():ei.asyncFetch({url:e.brazeCheckEmail,method:Li.POST,data:{email:r,instanceRegion:t}})}};function jte(e){var f;const[r,t]=je.useState(!1),[a,o]=je.useState({});function s(c){if(wM(c.jobTitle)){h();return}p(c)}function u(){var _;const c=Zt.getCountryCode(e.country||((_=e.geoLocation)==null?void 0:_.countryCode));return Zt.getInstanceRegion(c)}async function p(c){var S;if(r)return;if(e.userType===In.Learner){o({...a,submission:"Something went wrong! Please try again later."});return}e.logUserAction({},{actionType:sn.Click,workflowPhase:Ma.Next,descriptor:Yt.RequestBdmTrial}),t(!0);const{firstName:_,surname:E}=V_(c.fullname);try{const w=await Nte.checkEmail(e.ajaxUrls,e.email,u()),R={email:e.email,firstName:_,lastName:E,phone:c.phone,custom:{orgSubType:Kt.getSchoolType(e==null?void 0:e.schoolType),accountName:e==null?void 0:e.schoolName,jobTitle:c.jobTitle,accountAddress:{countryCode:e==null?void 0:e.country,province:Kt.parseProvince((e==null?void 0:e.province)||"")},syncToCrm:((S=w.users)==null?void 0:S.length)===0?!0:void 0,source:Kt.BDM_SOURCE},event:{eventTopic:Kt.BDM_EVENT_TOPIC}},b={prospect_id:e==null?void 0:e.prospectId};e.logBrazeEvent({user:R,event:{eventType:Tl.ProductFormEvent.BdmTrialRequested,additionalData:b,callback:d}})}catch{o({...a,submission:"Something went wrong! Please try again later."})}Object.keys(a).length||h()}function d(c){o(c?{}:{...a,submission:"Something went wrong! Please try again later."}),t(!1)}function h(){e.complete({completionStep:"added-to-braze",trialCreated:!1,trialStatus:null})}return A.jsx(cF,{loading:r,errors:a,setErrors:o,country:e.country||((f=e.geoLocation)==null?void 0:f.countryCode),logUserAction:e.logUserAction,handleSubmitForm:s,isTertiary:Kt.isTertiarySchool(e.schoolType)})}function qte(e){const{loading:r,canSubmitForm:t,setSubmissionError:a,prospectStatus:o,userType:s,logStepEvent:u,logUserAction:p,nextStep:d,data:h,productName:f,ajaxUrls:c,complete:_,setLoadingState:E,email:S,userTrialStatus:w,pageAppLinkString:R,setProperty:b,logBrazeEvent:I,createOrUpdateProfile:m}=e;function v(){d({step:"add-to-braze",trialStatus:o,...h}),u()}function y(){if(u(),s!==In.Staff){_({completionStep:"added-to-braze",trialCreated:!1,trialStatus:null});return}d({step:"request-bdm-trial",...h})}function g(){d({step:"request-access",...h}),u()}async function x(){try{await mo.createAutoJoinRequest(c,{prospectId:h.prospectId,email:S}),p({},{actionType:sn.Click,descriptor:Yt.AutoJoin}),_({completionStep:"trial-status",trialCreated:!0,trialStatus:Dr.Available,...h})}catch{a("Something went wrong! Please try again later."),E(!1);return}}async function T(){var D;let N;h!=null&&h.prospectId&&o===Dr.NotRequired&&(N=(D=(await Zf.getLookups(c,h.prospectId)).find($=>$.type===K_.MasterId))==null?void 0:D.externalId),_({completionStep:"trial-status",trialStatus:o,trialCreated:!1,customerId:N,...h}),u()}function O(){return o===Dr.Active||o===Dr.Available?!0:o===Dr.UserAutoJoinAllowed?f===La.Auth:!1}async function j(){if(s!==In.Staff)return;const N={email:S,custom:{accountName:h==null?void 0:h.schoolName,accountAddress:{countryCode:h==null?void 0:h.country,province:Kt.parseProvince(h.province)},orgSubType:Kt.getSchoolType(h==null?void 0:h.schoolType),syncToCrm:!0,source:Kt.SOURCE},event:{accountCountry:h==null?void 0:h.country,accountPostCode:h==null?void 0:h.schoolPostCode,accountState:Kt.parseProvince(h.province)}},D={form_type:"trial-sign-up",prospect_id:h==null?void 0:h.prospectId};I({user:N,event:{eventType:Tl.ProductFormEvent.FormSubmission,additionalData:D}})}async function k(){var D;E(!0);let N;try{N=await mo.createTrial(c,{userType:s,email:S,prospectId:h==null?void 0:h.prospectId,appLink:R,attribution:{...bi.getDecodedAttributionData(),utms:ss.getUtmParameters()}})}catch{a("Something went wrong! Please try again later."),E(!1);return}o===Dr.UserAutoJoinAllowed&&p({},{actionType:sn.Click,descriptor:Yt.AutoJoin}),b("userId",N.id),_({completionStep:"trial-status",userId:N.id,trialCreated:!0,trialStatus:Dr.Available,customerId:(D=N.data)==null?void 0:D.customerId,...h}),j(),m&&m({masterId:N.id,email:S,countryCode:h==null?void 0:h.country}),u()}return async function(){if(!r){if(!t()){a("Something went wrong! Please try again later.");return}if(w===Dr.BdmTrialAvailable)return y();if(s===In.Staff){if(o===Dr.Unsupported)return v();if(o===Dr.UserJoinApprovalRequired)return g();if(o===Dr.UserAutoJoinAllowed&&f===La.Lite)return await x()}return O()?await k():await T()}}}function Dte(e){return e.toLowerCase().split(" ").map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join(" ")}function Lte(e){const r=[];return e.city&&r.push(Dte(e.city)),e.province&&r.push(e.province),e.postCode&&r.push(e.postCode),r.join(" ")}function Mte(e){const{filteredSchoolsList:r,getSchoolName:t,onSchoolSuggestionClick:a,selectedIndex:o}=e;return A.jsx(A.Fragment,{children:r.map((s,u)=>A.jsxs(Zo,{className:`${zt.suggestionItem} ${o-1===u?zt.selected:""}`,onKeyDown:p=>p.key==="Enter"&&a(s),onMouseDown:()=>a(s),onClick:()=>a(s),children:[t(s)," ",A.jsx("br",{}),A.jsx("small",{className:"text-secondary",children:Lte(s)})]},s.id))})}function Ute(e){return A.jsx("div",{className:`info-link ${zt.suggestionItem} ${zt.noSuggestion} ${e.selected?zt.selected:""}`,onKeyDown:r=>r.key==="Enter"&&e.handleNoSuggestion(),onMouseDown:e.handleNoSuggestion,onClick:e.handleNoSuggestion,children:"Can't find your school?"})}function Fte(e){var N;const r=je.useRef(null),[t,a]=je.useState(!0),[o,s]=je.useState(e.data.schoolName&&e.data.schoolPostCode?e.data.schoolName+", "+e.data.schoolPostCode:e.data.schoolName?e.data.schoolName:""),[u,p]=je.useState(),d=gF(o,250),{selectedIndex:h,onKeyDown:f,containerRef:c,hide:_,onBlur:E,onFocus:S}=g_({onSelected:w,itemCount:((u==null?void 0:u.length)??0)+1,hideOnBlur:e.hideOnBlur});function w(D){if(!u&&!D)return;if(D===u.length){e.onClickNoSuggestions(o);return}const F=u[D];F&&x(F)}const R=!!((N=e.data)!=null&&N.prospectId),b=t&&!R,I=!t&&!R&&(u==null?void 0:u.length)<5,m=(u==null?void 0:u.length)&&!R;je.useEffect(()=>{if(!R){if(!d.length){g();return}if(!R&&d.length>1&&d===o){g(d);return}}},[d,R]);function v(D){(e.data.schoolName||e.data.prospectId)&&e.clearData(),D!==o&&s(D)}function y(){v(""),r.current.focus()}function g(D){if(!e.data.latitude&&!e.data.longitude){a(!1);return}a(!0);const F={latitude:e.data.latitude,longitude:e.data.longitude};D&&D.length&&(F.query=D),Zf.search(e.searchUrl,F,$=>p($),null,()=>a(!1))}function x(D){s(T(D)),e.setData({prospectId:D.id,schoolName:D.name,schoolPostCode:D.postCode,schoolType:D.prospectType,province:D.province,city:D.city,country:D.countryCode})}function T(D){return D.name}const O=(m||b||I)&&!e.disabled&&!_;let j=`form-control ${O?zt.inputFocused:zt.input}`,k="form-group position-relative";return e.size==="lg"&&(j+=" form-control-lg",k+=` ${zt.large}`),A.jsxs("div",{className:k,children:[A.jsxs("label",{className:e.labelClassName,htmlFor:"school-input",children:["School",e.required&&A.jsx("span",{className:"text-danger",children:"*"})]}),A.jsx(Bs,{id:"school-input",value:o,onChange:D=>v(D.currentTarget.value),ref:r,className:j,type:"text",autoComplete:"off",placeholder:e.placeholder||"Select your school below",disabled:e.disabled,autoFocus:!0,onClickClear:y,onKeyDown:f,onFocus:S,onBlur:E}),A.jsx("div",{className:`position-absolute z-1 w-100 ${zt.dropdown} ${_?"d-none":""}`,children:A.jsxs("div",{className:`${zt.suggestionContainer} ${O?"":"d-none"}`,ref:c,children:[m?A.jsx(Mte,{filteredSchoolsList:u,onSchoolSuggestionClick:x,getSchoolName:T,selectedIndex:h}):b&&A.jsx("div",{className:`${zt.suggestionLoading} py-4 d-flex justify-content-center`,children:A.jsx(G_,{animation:"border"})}),!b&&I&&A.jsx(Ute,{selected:h===u.length+1,handleNoSuggestion:()=>{e.onClickNoSuggestions(o)}})]})})]})}function Bte(e){return(e==null?void 0:e.toLowerCase())==="au"?"Enter your school postcode or suburb":(e==null?void 0:e.toLowerCase())==="us"?"Enter your school ZIP code or city":"Enter your school postcode or city"}function $te(e){var j;const{email:r,userType:t}=e,[a,o]=je.useState({schoolLocality:e.schoolLocality,country:e.country,longitude:e.longitude,latitude:e.latitude,city:e.city,province:e.province,prospectId:e.prospectId,schoolName:e.schoolName,schoolType:e.schoolType,schoolPostCode:e.schoolPostCode}),[s,u]=je.useState(e.trialStatus),[p,d]=je.useState(),[h,f]=je.useState(!1),[c,_]=je.useState(!1),[E,S]=je.useState(!1),w=qte({...e,prospectStatus:s,loading:h,data:a,canSubmitForm:b,setSubmissionError:d,logStepEvent:I,setLoadingState:m,setProperty:v});function R(){return!!(a&&a.schoolLocality&&a.longitude&&a.latitude)}function b(){if(!a||!r||!t)return!1;const{prospectId:k}=a;return!!(r&&t&&k)}function I(){const k={actionType:sn.Click,descriptor:Yt.FindSchool,workflowPhase:Ma.Next};e.logUserAction(a||{},k)}function m(k){_(k),S(k),f(k)}function v(k,N){k==="prospectId"&&N&&(f(!0),mo.checkProspectTrialStatus(e.ajaxUrls,{prospectId:N.toString(),email:e.email},D=>{u(D.status)},()=>{console.log("error")},()=>{f(!1)})),o(D=>({...D,[k]:N}))}function y(){v("schoolLocality",void 0),v("longitude",void 0),v("latitude",void 0),v("city",void 0),v("province",void 0),v("country",void 0),g()}function g(){v("prospectId",void 0),v("schoolName",""),v("schoolPostCode",void 0),d(void 0)}function x(k){e.nextStep({step:"cant-find-school",prospectId:a.prospectId,schoolName:k,schoolLocality:a.schoolLocality,longitude:a.longitude,latitude:a.latitude,country:a.country,city:a.city,province:a.province}),e.logUserAction({},{actionType:sn.Click,descriptor:Yt.CantFindSchool,workflowPhase:Ma.Next})}function T(k){v("prospectId",k.prospectId),v("schoolName",k.schoolName),v("schoolPostCode",k.schoolPostCode),v("schoolType",k.schoolType),v("province",k.province),v("city",k.city),v("country",k.country)}function O(k){const{longitude:N,latitude:D,schoolLocality:F,country:$,city:V,province:G}=k;N&&v("longitude",N),D&&v("latitude",D),$&&v("country",$),V&&v("city",V),G&&v("province",G),F&&v("schoolLocality",F)}return A.jsxs(A.Fragment,{children:[A.jsxs("div",{className:"text-center",children:[A.jsx("h1",{className:"h4",children:"Let's find your school"}),A.jsx("p",{children:Bte((j=e.geoLocation)==null?void 0:j.countryCode)})]}),A.jsx(mF,{data:a,setData:O,clearData:y,disabled:c,geoLocation:e.geoLocation,labelClassName:"d-none",logUserAction:e.logUserAction,googleMapsApiKey:e.googleMapsApiKey,autoFocus:!0,size:"lg",useGeoLocationApi:!0}),R()&&A.jsx(Fte,{data:a,setData:T,clearData:g,disabled:E,searchUrl:e.ajaxUrls.searchProspect,onClickNoSuggestions:x,size:"lg",labelClassName:"d-none"}),p&&A.jsx("p",{className:"text-danger mb-2",children:p}),b()&&A.jsx(zf,{className:"btn-lg w-100",variant:"dark",onClick:w,showSpinner:c||E||h,disabled:c||E||h,children:"Get started"})]})}const kD=["38A2E8","7A76E8","40BCC3","F7847B"];function zte(e){const[r,t]=je.useState(null);function a(s){if(!s)return;const u=window.location.pathname+window.location.search;window.location.href=`/challenge?idp=${s.id}&redirectUrl=`+encodeURIComponent(u)}function o(){e.logUserAction({},{actionType:sn.Click,workflowPhase:Ma.Next,descriptor:Yt.SkipIdpSelect}),e.nextStep({step:"find-school",email:e.email,userTrialStatus:e.userTrialStatus})}return A.jsxs(A.Fragment,{children:[A.jsxs("div",{className:"text-center",children:[A.jsx("h1",{className:"h4",children:"Does your school already have ClickView?"}),A.jsx("p",{children:"Find your school from the list below"})]}),e.idps.length>4?A.jsxs(A.Fragment,{children:[A.jsx(Sl,{id:"idp",item:r,items:e.idps,onSelect:t,getName:s=>s.name,clearData:()=>t(null),placeholder:"Select a school",size:"lg"}),A.jsx("button",{className:"btn btn-lg btn-dark w-100 mb-3",disabled:!r,onClick:()=>a(r),children:"Continue"})]}):e.idps.map((s,u)=>A.jsx("button",{className:"btn btn-lg w-100 mb-3",onClick:()=>a(s),style:{backgroundColor:`#${kD[u%kD.length]}`,color:"#FFF"},children:s.name},u)),A.jsx("button",{className:"btn btn-link text-info w-100 no-sso-link",onClick:o,children:"My school does not have ClickView"})]})}const Zte="_userTypeOption_egazo_1",Hte="_selected_egazo_8",Vte="_mobileButtons_egazo_13",db={userTypeOption:Zte,selected:Hte,mobileButtons:Vte};function PD(e){return A.jsxs(A.Fragment,{children:[A.jsxs(Zo,{className:`
|
|
65
|
+
*/var wD;function cre(){return wD||(wD=1,(function(e){(function(){var r={}.hasOwnProperty;function t(){for(var s="",u=0;u<arguments.length;u++){var p=arguments[u];p&&(s=o(s,a(p)))}return s}function a(s){if(typeof s=="string"||typeof s=="number")return s;if(typeof s!="object")return"";if(Array.isArray(s))return t.apply(null,s);if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]"))return s.toString();var u="";for(var p in s)r.call(s,p)&&s[p]&&(u=o(u,p));return u}function o(s,u){return u?s?s+" "+u:s+u:s}e.exports?(t.default=t,e.exports=t):window.classNames=t})()})(ub)),ub.exports}var fre=cre();const iF=al(fre),dre=["xxl","xl","lg","md","sm","xs"],hre="xs",oF=Nr.createContext({prefixes:{},breakpoints:dre,minBreakpoint:hre}),{Consumer:Qne,Provider:eae}=oF;function sF(e,r){const{prefixes:t}=Nr.useContext(oF);return e||t[r]||r}const vre=["as","disabled"];function pre(e,r){if(e==null)return{};var t={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(r.indexOf(a)>=0)continue;t[a]=e[a]}return t}function gre(e){return!e||e.trim()==="#"}function uF({tagName:e,disabled:r,href:t,target:a,rel:o,role:s,onClick:u,tabIndex:p=0,type:d}){e||(t!=null||a!=null||o!=null?e="a":e="button");const h={tagName:e};if(e==="button")return[{type:d||"button",disabled:r},h];const f=_=>{if((r||e==="a"&&gre(t))&&_.preventDefault(),r){_.stopPropagation();return}u==null||u(_)},c=_=>{_.key===" "&&(_.preventDefault(),f(_))};return e==="a"&&(t||(t="#"),r&&(t=void 0)),[{role:s??"button",disabled:void 0,tabIndex:r?void 0:p,href:t,target:e==="a"?a:void 0,"aria-disabled":r||void 0,rel:e==="a"?o:void 0,onClick:f,onKeyDown:c},h]}const mre=Nr.forwardRef((e,r)=>{let{as:t,disabled:a}=e,o=pre(e,vre);const[s,{tagName:u}]=uF(Object.assign({tagName:t,disabled:a},o));return A.jsx(u,Object.assign({},o,s,{ref:r}))});mre.displayName="Button";const lF=Nr.forwardRef(({as:e,bsPrefix:r,variant:t="primary",size:a,active:o=!1,disabled:s=!1,className:u,...p},d)=>{const h=sF(r,"btn"),[f,{tagName:c}]=uF({tagName:e,disabled:s,...p}),_=c;return A.jsx(_,{...f,...p,ref:d,disabled:s,className:iF(u,h,o&&"active",t&&`${h}-${t}`,a&&`${h}-${a}`,p.href&&s&&"disabled")})});lF.displayName="Button";const G_=Nr.forwardRef(({bsPrefix:e,variant:r,animation:t="border",size:a,as:o="div",className:s,...u},p)=>{e=sF(e,"spinner");const d=`${e}-${t}`;return A.jsx(o,{ref:p,...u,className:iF(s,d,a&&`${d}-${a}`,r&&`text-${r}`)})});G_.displayName="Spinner";function zf(e){const{showSpinner:r,children:t,style:a,spinnerText:o,...s}=e,u=Nr.useRef(null),[{width:p,height:d},h]=Nr.useState({}),[f,c]=Nr.useState(r);Nr.useEffect(()=>{if(!r){h({});return}const E=u.current,S=E.offsetHeight,w=E.offsetWidth;!S||!w||h({width:w,height:S})},[r]),Nr.useLayoutEffect(()=>{c(r)},[r]);const _={...a};return p&&(_.width=`${p+1}px`),d&&(_.height=`${d+1}px`),A.jsx(lF,{ref:u,disabled:r,style:_,...s,children:f?A.jsxs(A.Fragment,{children:[A.jsx(G_,{as:"span",animation:"border",role:"status",size:"sm"}),!!o&&A.jsx("span",{className:"ps-1",children:o})]}):t})}const Lc=/\$+[\w\s]?/,yre=/^\+?\d{4,255}$/,Mc=255;function cF(e){var E,S,w,R;const[r,t]=je.useState({fullname:"",jobTitle:"",phone:""});function a(b){b==null||b.preventDefault(),c(r)&&e.handleSubmitForm(r)}function o(b){b.preventDefault(),h("fullname",b.target.value),f("fullname"),f("submission")}function s(b){b.preventDefault(),h("phone",b.target.value.trim()),f("phone"),f("submission")}function u(b){h("jobTitle",b),f("jobTitle"),f("submission")}function p(){h("fullname",""),f("fullname"),f("submission")}function d(){h("phone",""),f("phone"),f("submission")}function h(b,I){t(m=>({...m,[b]:I}))}function f(b){if(!Object.keys(e.errors).length||!e.errors[b])return;const I={...e.errors};delete I[b],e.setErrors(I)}function c(b){const{fullname:I,jobTitle:m,phone:v}=b,{firstName:y,surname:g}=V_(I),x={};return(!y||!g)&&(x.fullname="Please enter your full name."),(Lc.test(y)||Lc.test(g))&&(x.fullname="Please enter your full name."),I.length>Mc&&(x.fullname=`Full name cannot exceed max length of ${Mc} characters.`),m!=null&&m.length||(x.jobTitle="Please enter your job title."),Lc.test(m)&&(x.jobTitle="Please enter a valid job title."),m.length>Mc&&(x.jobTitle=`Job title cannot exceed max length of ${Mc} characters.`),v!=null&&v.length||(x.phone="Please enter your phone number."),(Lc.test(v)||!yre.test(v))&&(x.phone="Please enter a valid phone number."),e.setErrors(x),!Object.keys(x).length}function _(){const{fullname:b,jobTitle:I,phone:m}=r;return!(!b.length||!I.length||!m.length||Object.keys(e.errors).length)}return A.jsxs("div",{className:"text-center",children:[A.jsx("h1",{className:"text-center h4",children:"A little more about you"}),A.jsx("p",{children:"Please enter your details."}),A.jsxs("form",{onSubmit:a,"aria-errormessage":"brazeFormError",children:[A.jsxs("div",{className:"form-group text-start",children:[A.jsx("label",{className:"d-block fw-bold mb-1",htmlFor:"fullname-input",children:"Full name"}),A.jsx(Bs,{value:r.fullname,onChange:o,name:"fullname-input",id:"fullname-input",type:"text",className:`form-control form-control-lg ${(E=e.errors.fullname)!=null&&E.length?"is-invalid":""}`,placeholder:"Enter your name",onClickClear:p,autoFocus:!0,"aria-errormessage":"fullname-inputError"}),e.errors.fullname&&A.jsx(Ht,{name:"fullname-input",children:e.errors.fullname})]}),A.jsxs("div",{className:"form-group text-start",children:[A.jsx("label",{className:"d-block fw-bold mb-1",htmlFor:"phone-input",children:"Contact number"}),A.jsx(Bs,{value:r.phone,onChange:s,name:"phone-input",id:"phone-input",type:"tel",className:`form-control form-control-lg ${(S=e.errors.phone)!=null&&S.length?"is-invalid":""}`,placeholder:"Enter your phone number",onClickClear:d,"aria-errormessage":"phone-inputError"}),e.errors.phone&&A.jsx(Ht,{name:"phone-input",children:e.errors.phone})]}),A.jsxs("div",{className:"form-group text-start",children:[A.jsx("label",{className:"d-block fw-bold mb-1",htmlFor:"jobTitle-select",children:"Job title"}),A.jsx(ore,{id:"jobTitle-select",countryCode:Zt.getCountryCode(e.country),onChange:u,error:(w=e.errors)==null?void 0:w.jobTitle,size:"lg",labelClassName:"d-none",isTertiary:e.isTertiary})]}),!!((R=e.errors)!=null&&R.submission)&&A.jsx(Ht,{name:"brazeForm",className:"form-group",children:e.errors.submission}),A.jsx("div",{className:"form-group mb-1",children:A.jsx(zf,{className:"btn-lg w-100",variant:"dark",onClick:()=>a(),showSpinner:e.loading,disabled:e.loading||!_(),children:"Submit"})})]})]})}var Dr=(e=>(e.Unavailable="unavailable",e.Expired="expired",e.Active="active",e.NotRequired="not-required",e.Available="available",e.Unsupported="unsupported",e.UserAutoJoinAllowed="user-auto-join-allowed",e.UserJoinApprovalRequired="user-join-approval-required",e.InvalidEmail="invalid-email",e.BdmTrialAvailable="bdm-trial-available",e))(Dr||{}),In=(e=>(e.Staff="staff",e.Learner="learner",e))(In||{}),lb={exports:{}},ED;function bre(){return ED||(ED=1,(function(e,r){(function(t){e.exports=t()})(function(t){var a=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function o(b,I){var m=b[0],v=b[1],y=b[2],g=b[3];m+=(v&y|~v&g)+I[0]-680876936|0,m=(m<<7|m>>>25)+v|0,g+=(m&v|~m&y)+I[1]-389564586|0,g=(g<<12|g>>>20)+m|0,y+=(g&m|~g&v)+I[2]+606105819|0,y=(y<<17|y>>>15)+g|0,v+=(y&g|~y&m)+I[3]-1044525330|0,v=(v<<22|v>>>10)+y|0,m+=(v&y|~v&g)+I[4]-176418897|0,m=(m<<7|m>>>25)+v|0,g+=(m&v|~m&y)+I[5]+1200080426|0,g=(g<<12|g>>>20)+m|0,y+=(g&m|~g&v)+I[6]-1473231341|0,y=(y<<17|y>>>15)+g|0,v+=(y&g|~y&m)+I[7]-45705983|0,v=(v<<22|v>>>10)+y|0,m+=(v&y|~v&g)+I[8]+1770035416|0,m=(m<<7|m>>>25)+v|0,g+=(m&v|~m&y)+I[9]-1958414417|0,g=(g<<12|g>>>20)+m|0,y+=(g&m|~g&v)+I[10]-42063|0,y=(y<<17|y>>>15)+g|0,v+=(y&g|~y&m)+I[11]-1990404162|0,v=(v<<22|v>>>10)+y|0,m+=(v&y|~v&g)+I[12]+1804603682|0,m=(m<<7|m>>>25)+v|0,g+=(m&v|~m&y)+I[13]-40341101|0,g=(g<<12|g>>>20)+m|0,y+=(g&m|~g&v)+I[14]-1502002290|0,y=(y<<17|y>>>15)+g|0,v+=(y&g|~y&m)+I[15]+1236535329|0,v=(v<<22|v>>>10)+y|0,m+=(v&g|y&~g)+I[1]-165796510|0,m=(m<<5|m>>>27)+v|0,g+=(m&y|v&~y)+I[6]-1069501632|0,g=(g<<9|g>>>23)+m|0,y+=(g&v|m&~v)+I[11]+643717713|0,y=(y<<14|y>>>18)+g|0,v+=(y&m|g&~m)+I[0]-373897302|0,v=(v<<20|v>>>12)+y|0,m+=(v&g|y&~g)+I[5]-701558691|0,m=(m<<5|m>>>27)+v|0,g+=(m&y|v&~y)+I[10]+38016083|0,g=(g<<9|g>>>23)+m|0,y+=(g&v|m&~v)+I[15]-660478335|0,y=(y<<14|y>>>18)+g|0,v+=(y&m|g&~m)+I[4]-405537848|0,v=(v<<20|v>>>12)+y|0,m+=(v&g|y&~g)+I[9]+568446438|0,m=(m<<5|m>>>27)+v|0,g+=(m&y|v&~y)+I[14]-1019803690|0,g=(g<<9|g>>>23)+m|0,y+=(g&v|m&~v)+I[3]-187363961|0,y=(y<<14|y>>>18)+g|0,v+=(y&m|g&~m)+I[8]+1163531501|0,v=(v<<20|v>>>12)+y|0,m+=(v&g|y&~g)+I[13]-1444681467|0,m=(m<<5|m>>>27)+v|0,g+=(m&y|v&~y)+I[2]-51403784|0,g=(g<<9|g>>>23)+m|0,y+=(g&v|m&~v)+I[7]+1735328473|0,y=(y<<14|y>>>18)+g|0,v+=(y&m|g&~m)+I[12]-1926607734|0,v=(v<<20|v>>>12)+y|0,m+=(v^y^g)+I[5]-378558|0,m=(m<<4|m>>>28)+v|0,g+=(m^v^y)+I[8]-2022574463|0,g=(g<<11|g>>>21)+m|0,y+=(g^m^v)+I[11]+1839030562|0,y=(y<<16|y>>>16)+g|0,v+=(y^g^m)+I[14]-35309556|0,v=(v<<23|v>>>9)+y|0,m+=(v^y^g)+I[1]-1530992060|0,m=(m<<4|m>>>28)+v|0,g+=(m^v^y)+I[4]+1272893353|0,g=(g<<11|g>>>21)+m|0,y+=(g^m^v)+I[7]-155497632|0,y=(y<<16|y>>>16)+g|0,v+=(y^g^m)+I[10]-1094730640|0,v=(v<<23|v>>>9)+y|0,m+=(v^y^g)+I[13]+681279174|0,m=(m<<4|m>>>28)+v|0,g+=(m^v^y)+I[0]-358537222|0,g=(g<<11|g>>>21)+m|0,y+=(g^m^v)+I[3]-722521979|0,y=(y<<16|y>>>16)+g|0,v+=(y^g^m)+I[6]+76029189|0,v=(v<<23|v>>>9)+y|0,m+=(v^y^g)+I[9]-640364487|0,m=(m<<4|m>>>28)+v|0,g+=(m^v^y)+I[12]-421815835|0,g=(g<<11|g>>>21)+m|0,y+=(g^m^v)+I[15]+530742520|0,y=(y<<16|y>>>16)+g|0,v+=(y^g^m)+I[2]-995338651|0,v=(v<<23|v>>>9)+y|0,m+=(y^(v|~g))+I[0]-198630844|0,m=(m<<6|m>>>26)+v|0,g+=(v^(m|~y))+I[7]+1126891415|0,g=(g<<10|g>>>22)+m|0,y+=(m^(g|~v))+I[14]-1416354905|0,y=(y<<15|y>>>17)+g|0,v+=(g^(y|~m))+I[5]-57434055|0,v=(v<<21|v>>>11)+y|0,m+=(y^(v|~g))+I[12]+1700485571|0,m=(m<<6|m>>>26)+v|0,g+=(v^(m|~y))+I[3]-1894986606|0,g=(g<<10|g>>>22)+m|0,y+=(m^(g|~v))+I[10]-1051523|0,y=(y<<15|y>>>17)+g|0,v+=(g^(y|~m))+I[1]-2054922799|0,v=(v<<21|v>>>11)+y|0,m+=(y^(v|~g))+I[8]+1873313359|0,m=(m<<6|m>>>26)+v|0,g+=(v^(m|~y))+I[15]-30611744|0,g=(g<<10|g>>>22)+m|0,y+=(m^(g|~v))+I[6]-1560198380|0,y=(y<<15|y>>>17)+g|0,v+=(g^(y|~m))+I[13]+1309151649|0,v=(v<<21|v>>>11)+y|0,m+=(y^(v|~g))+I[4]-145523070|0,m=(m<<6|m>>>26)+v|0,g+=(v^(m|~y))+I[11]-1120210379|0,g=(g<<10|g>>>22)+m|0,y+=(m^(g|~v))+I[2]+718787259|0,y=(y<<15|y>>>17)+g|0,v+=(g^(y|~m))+I[9]-343485551|0,v=(v<<21|v>>>11)+y|0,b[0]=m+b[0]|0,b[1]=v+b[1]|0,b[2]=y+b[2]|0,b[3]=g+b[3]|0}function s(b){var I=[],m;for(m=0;m<64;m+=4)I[m>>2]=b.charCodeAt(m)+(b.charCodeAt(m+1)<<8)+(b.charCodeAt(m+2)<<16)+(b.charCodeAt(m+3)<<24);return I}function u(b){var I=[],m;for(m=0;m<64;m+=4)I[m>>2]=b[m]+(b[m+1]<<8)+(b[m+2]<<16)+(b[m+3]<<24);return I}function p(b){var I=b.length,m=[1732584193,-271733879,-1732584194,271733878],v,y,g,x,T,O;for(v=64;v<=I;v+=64)o(m,s(b.substring(v-64,v)));for(b=b.substring(v-64),y=b.length,g=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],v=0;v<y;v+=1)g[v>>2]|=b.charCodeAt(v)<<(v%4<<3);if(g[v>>2]|=128<<(v%4<<3),v>55)for(o(m,g),v=0;v<16;v+=1)g[v]=0;return x=I*8,x=x.toString(16).match(/(.*?)(.{0,8})$/),T=parseInt(x[2],16),O=parseInt(x[1],16)||0,g[14]=T,g[15]=O,o(m,g),m}function d(b){var I=b.length,m=[1732584193,-271733879,-1732584194,271733878],v,y,g,x,T,O;for(v=64;v<=I;v+=64)o(m,u(b.subarray(v-64,v)));for(b=v-64<I?b.subarray(v-64):new Uint8Array(0),y=b.length,g=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],v=0;v<y;v+=1)g[v>>2]|=b[v]<<(v%4<<3);if(g[v>>2]|=128<<(v%4<<3),v>55)for(o(m,g),v=0;v<16;v+=1)g[v]=0;return x=I*8,x=x.toString(16).match(/(.*?)(.{0,8})$/),T=parseInt(x[2],16),O=parseInt(x[1],16)||0,g[14]=T,g[15]=O,o(m,g),m}function h(b){var I="",m;for(m=0;m<4;m+=1)I+=a[b>>m*8+4&15]+a[b>>m*8&15];return I}function f(b){var I;for(I=0;I<b.length;I+=1)b[I]=h(b[I]);return b.join("")}f(p("hello")),typeof ArrayBuffer<"u"&&!ArrayBuffer.prototype.slice&&(function(){function b(I,m){return I=I|0||0,I<0?Math.max(I+m,0):Math.min(I,m)}ArrayBuffer.prototype.slice=function(I,m){var v=this.byteLength,y=b(I,v),g=v,x,T,O,j;return m!==t&&(g=b(m,v)),y>g?new ArrayBuffer(0):(x=g-y,T=new ArrayBuffer(x),O=new Uint8Array(T),j=new Uint8Array(this,y,x),O.set(j),T)}})();function c(b){return/[\u0080-\uFFFF]/.test(b)&&(b=unescape(encodeURIComponent(b))),b}function _(b,I){var m=b.length,v=new ArrayBuffer(m),y=new Uint8Array(v),g;for(g=0;g<m;g+=1)y[g]=b.charCodeAt(g);return I?y:v}function E(b){return String.fromCharCode.apply(null,new Uint8Array(b))}function S(b,I,m){var v=new Uint8Array(b.byteLength+I.byteLength);return v.set(new Uint8Array(b)),v.set(new Uint8Array(I),b.byteLength),v}function w(b){var I=[],m=b.length,v;for(v=0;v<m-1;v+=2)I.push(parseInt(b.substr(v,2),16));return String.fromCharCode.apply(String,I)}function R(){this.reset()}return R.prototype.append=function(b){return this.appendBinary(c(b)),this},R.prototype.appendBinary=function(b){this._buff+=b,this._length+=b.length;var I=this._buff.length,m;for(m=64;m<=I;m+=64)o(this._hash,s(this._buff.substring(m-64,m)));return this._buff=this._buff.substring(m-64),this},R.prototype.end=function(b){var I=this._buff,m=I.length,v,y=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],g;for(v=0;v<m;v+=1)y[v>>2]|=I.charCodeAt(v)<<(v%4<<3);return this._finish(y,m),g=f(this._hash),b&&(g=w(g)),this.reset(),g},R.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},R.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},R.prototype.setState=function(b){return this._buff=b.buff,this._length=b.length,this._hash=b.hash,this},R.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},R.prototype._finish=function(b,I){var m=I,v,y,g;if(b[m>>2]|=128<<(m%4<<3),m>55)for(o(this._hash,b),m=0;m<16;m+=1)b[m]=0;v=this._length*8,v=v.toString(16).match(/(.*?)(.{0,8})$/),y=parseInt(v[2],16),g=parseInt(v[1],16)||0,b[14]=y,b[15]=g,o(this._hash,b)},R.hash=function(b,I){return R.hashBinary(c(b),I)},R.hashBinary=function(b,I){var m=p(b),v=f(m);return I?w(v):v},R.ArrayBuffer=function(){this.reset()},R.ArrayBuffer.prototype.append=function(b){var I=S(this._buff.buffer,b),m=I.length,v;for(this._length+=b.byteLength,v=64;v<=m;v+=64)o(this._hash,u(I.subarray(v-64,v)));return this._buff=v-64<m?new Uint8Array(I.buffer.slice(v-64)):new Uint8Array(0),this},R.ArrayBuffer.prototype.end=function(b){var I=this._buff,m=I.length,v=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],y,g;for(y=0;y<m;y+=1)v[y>>2]|=I[y]<<(y%4<<3);return this._finish(v,m),g=f(this._hash),b&&(g=w(g)),this.reset(),g},R.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},R.ArrayBuffer.prototype.getState=function(){var b=R.prototype.getState.call(this);return b.buff=E(b.buff),b},R.ArrayBuffer.prototype.setState=function(b){return b.buff=_(b.buff,!0),R.prototype.setState.call(this,b)},R.ArrayBuffer.prototype.destroy=R.prototype.destroy,R.ArrayBuffer.prototype._finish=R.prototype._finish,R.ArrayBuffer.hash=function(b,I){var m=d(new Uint8Array(b)),v=f(m);return I?w(v):v},R})})(lb)),lb.exports}var _re=bre();const Sre=al(_re),CD={secondary:{label:"Secondary",isTertiary:!1},"primary & secondary":{label:"Primary & Secondary",isTertiary:!1},k12:{label:"Primary & Secondary",isTertiary:!1},primary:{label:"Primary",isTertiary:!1},special:{label:"Special",isTertiary:!1},university:{label:"University",isTertiary:!0},middle:{label:"Middle",isTertiary:!1},"fe college":{label:"FE College",isTertiary:!0},"high school":{label:"Secondary",isTertiary:!1},elementary:{label:"Primary",isTertiary:!1},"middle school":{label:"Middle",isTertiary:!1},tafe:{label:"TAFE",isTertiary:!0},college:{label:"FE College",isTertiary:!0},"sixth form college":{label:"Sixth Form College",isTertiary:!0}},wre={england:"ENG",scotland:"SCT",wales:"WLS","northern ireland":"NIR"},Kt={hashedEmail(e){const r=e.trim().toLowerCase();return Sre.hash(r)},removeEmptyKeys(e){if(Array.isArray(e))return e;const r={...e};return Object.entries(r).filter(([,t])=>!(t==null||typeof t=="string"&&!t.length)).reduce((t,[a,o])=>({...t,[a]:o===Object(o)?Kt.removeEmptyKeys(o):o}),{})},EVENT_TOPIC:"Free Trial Request",BDM_EVENT_TOPIC:"Requested free trial (Streamable Customer)",SOURCE:"cv_product_trial_requested",BDM_SOURCE:"cv_product_bdm_trial_requested",TRIAL_UPGRADE_SOURCE:"cv_product_trial_upgrade_requested",getSchoolType(e){var a;if(!e)return;const r=e.toLowerCase();if(["unknown","other"].includes(r))return;const t=(a=CD[r])==null?void 0:a.label;return t||e},isTertiarySchool(e){var r;return((r=CD[e==null?void 0:e.toLowerCase()])==null?void 0:r.isTertiary)||!1},parseProvince(e){return e.length?wre[e.toLowerCase()]||e:""}};function Ere(e){var h;const[r,t]=je.useState(!1),[a,o]=je.useState({});je.useEffect(()=>{e.userType===In.Learner&&e.complete({completionStep:"trial-status",trialCreated:!1,trialStatus:Dr.Unsupported})},[]);function s(f){if(wM(f.jobTitle)){d();return}u(f)}async function u(f){if(r)return;if(e.userType===In.Learner){o({...a,submission:"Something went wrong! Please try again later."});return}e.logUserAction({},{actionType:sn.Click,workflowPhase:Ma.Next,descriptor:Yt.AddToBraze}),t(!0);const{firstName:c,surname:_}=V_(f.fullname);try{const E={email:e.email,firstName:c,lastName:_,phone:f.phone,custom:{orgSubType:Kt.getSchoolType(e==null?void 0:e.schoolType),accountName:e==null?void 0:e.schoolName,jobTitle:f.jobTitle,accountAddress:{countryCode:e==null?void 0:e.country,province:Kt.parseProvince((e==null?void 0:e.province)||"")},syncToCrm:!0,source:Kt.SOURCE},event:{accountCountry:e==null?void 0:e.country,accountPostCode:e==null?void 0:e.schoolPostCode,eventTopic:Kt.EVENT_TOPIC}},S={prospect_id:e==null?void 0:e.prospectId};e.logBrazeEvent({user:E,event:{eventType:Tl.ProductFormEvent.ProductTrailRequested,additionalData:S,callback:p}})}catch{o({...a,submission:"Something went wrong! Please try again later."})}Object.keys(a).length||d()}function p(f){o(f?{}:{...a,submission:"Something went wrong! Please try again later."}),t(!1)}function d(){e.complete({completionStep:"added-to-braze",trialCreated:!1,trialStatus:null})}return A.jsx(cF,{loading:r,errors:a,setErrors:o,country:e.country||((h=e.geoLocation)==null?void 0:h.countryCode),logUserAction:e.logUserAction,handleSubmitForm:s,isTertiary:Kt.isTertiarySchool(e.schoolType)})}const fF={getRandomInt(e=1e4){return Math.floor(Math.random()*Math.floor(e))}};var Cre=function e(r,t){if(r===t)return!0;if(r&&t&&typeof r=="object"&&typeof t=="object"){if(r.constructor!==t.constructor)return!1;var a,o,s;if(Array.isArray(r)){if(a=r.length,a!=t.length)return!1;for(o=a;o--!==0;)if(!e(r[o],t[o]))return!1;return!0}if(r.constructor===RegExp)return r.source===t.source&&r.flags===t.flags;if(r.valueOf!==Object.prototype.valueOf)return r.valueOf()===t.valueOf();if(r.toString!==Object.prototype.toString)return r.toString()===t.toString();if(s=Object.keys(r),a=s.length,a!==Object.keys(t).length)return!1;for(o=a;o--!==0;)if(!Object.prototype.hasOwnProperty.call(t,s[o]))return!1;for(o=a;o--!==0;){var u=s[o];if(!e(r[u],t[u]))return!1}return!0}return r!==r&&t!==t};const xD="__googleMapsScriptId";var Ms;(function(e){e[e.INITIALIZED=0]="INITIALIZED",e[e.LOADING=1]="LOADING",e[e.SUCCESS=2]="SUCCESS",e[e.FAILURE=3]="FAILURE"})(Ms||(Ms={}));class $o{constructor({apiKey:r,authReferrerPolicy:t,channel:a,client:o,id:s=xD,language:u,libraries:p=[],mapIds:d,nonce:h,region:f,retries:c=3,url:_="https://maps.googleapis.com/maps/api/js",version:E}){if(this.CALLBACK="__googleMapsCallback",this.callbacks=[],this.done=!1,this.loading=!1,this.errors=[],this.apiKey=r,this.authReferrerPolicy=t,this.channel=a,this.client=o,this.id=s||xD,this.language=u,this.libraries=p,this.mapIds=d,this.nonce=h,this.region=f,this.retries=c,this.url=_,this.version=E,$o.instance){if(!Cre(this.options,$o.instance.options))throw new Error(`Loader must not be called again with different options. ${JSON.stringify(this.options)} !== ${JSON.stringify($o.instance.options)}`);return $o.instance}$o.instance=this}get options(){return{version:this.version,apiKey:this.apiKey,channel:this.channel,client:this.client,id:this.id,libraries:this.libraries,language:this.language,region:this.region,mapIds:this.mapIds,nonce:this.nonce,url:this.url,authReferrerPolicy:this.authReferrerPolicy}}get status(){return this.errors.length?Ms.FAILURE:this.done?Ms.SUCCESS:this.loading?Ms.LOADING:Ms.INITIALIZED}get failed(){return this.done&&!this.loading&&this.errors.length>=this.retries+1}createUrl(){let r=this.url;return r+=`?callback=${this.CALLBACK}`,this.apiKey&&(r+=`&key=${this.apiKey}`),this.channel&&(r+=`&channel=${this.channel}`),this.client&&(r+=`&client=${this.client}`),this.libraries.length>0&&(r+=`&libraries=${this.libraries.join(",")}`),this.language&&(r+=`&language=${this.language}`),this.region&&(r+=`®ion=${this.region}`),this.version&&(r+=`&v=${this.version}`),this.mapIds&&(r+=`&map_ids=${this.mapIds.join(",")}`),this.authReferrerPolicy&&(r+=`&auth_referrer_policy=${this.authReferrerPolicy}`),r}deleteScript(){const r=document.getElementById(this.id);r&&r.remove()}load(){return this.loadPromise()}loadPromise(){return new Promise((r,t)=>{this.loadCallback(a=>{a?t(a.error):r(window.google)})})}loadCallback(r){this.callbacks.push(r),this.execute()}setScript(){if(document.getElementById(this.id)){this.callback();return}const r=this.createUrl(),t=document.createElement("script");t.id=this.id,t.type="text/javascript",t.src=r,t.onerror=this.loadErrorCallback.bind(this),t.defer=!0,t.async=!0,this.nonce&&(t.nonce=this.nonce),document.head.appendChild(t)}reset(){this.deleteScript(),this.done=!1,this.loading=!1,this.errors=[],this.onerrorEvent=null}resetIfRetryingFailed(){this.failed&&this.reset()}loadErrorCallback(r){if(this.errors.push(r),this.errors.length<=this.retries){const t=this.errors.length*Math.pow(2,this.errors.length);console.log(`Failed to load Google Maps script, retrying in ${t} ms.`),setTimeout(()=>{this.deleteScript(),this.setScript()},t)}else this.onerrorEvent=r,this.callback()}setCallback(){window.__googleMapsCallback=this.callback.bind(this)}callback(){this.done=!0,this.loading=!1,this.callbacks.forEach(r=>{r(this.onerrorEvent)}),this.callbacks=[]}execute(){if(this.resetIfRetryingFailed(),this.done)this.callback();else{if(window.google&&window.google.maps&&window.google.maps.version){console.warn("Google Maps already loaded outside @googlemaps/js-api-loader.This may result in undesirable behavior as options and script parameters may not match."),this.callback();return}this.loading||(this.loading=!0,this.setCallback(),this.setScript())}}}function ID(e){return new $o({apiKey:e.apiKey,version:"weekly",libraries:e.libraries,retries:3})}function dF(e){const r={apiKey:e.apiKey,libraries:e.libraries||["places"]},[t,a]=je.useState(!1),[o,s]=je.useState(ID(r));je.useEffect(()=>{u()},[]);function u(p,d){if(!o){s(ID(r));return}o.loadCallback(h=>{if(h){a(!1),d&&d(h);return}a(!0),p&&p()})}return{loader:o,scriptLoaded:t,onGoogleApiReady:u}}function hF(e){const{scriptLoaded:r}=dF({apiKey:e.googleApiKey}),[t,a]=je.useState();return je.useEffect(()=>{r&&a(new google.maps.places.AutocompleteService)},[r]),t}const AD="us",vF="country:placeholder:text";function xre(e){const r=Zt.getLocalizedLocalityPlaceholderText(e==null?void 0:e.countryCode);if(r)return r;const t=Tn.cacheGet(`${vF}:${e==null?void 0:e.countryCode}`);if(t)return t}function Ire(){return String.fromCharCode(96+fF.getRandomInt(26))}function Are({apiKey:e,geoLocation:r,makeRequest:t=!0,template:a="E.g. [placeholder]",templateKey:o="[placeholder]"}){const s=hF({googleApiKey:e}),[u,p]=je.useState(()=>xre(r));je.useEffect(()=>{if(u||!s||!t)return;const f=(r==null?void 0:r.countryCode)||AD,_={input:Ire(),types:["(cities)"],region:f,componentRestrictions:{country:f}};s.getPlacePredictions(_,(E,S)=>h(E,S,f))},[u,s,r,t]);function d(f,c){Tn.cacheSet(`${vF}:${c}`,f,86400),p(f)}function h(f,c,_){if(c!==google.maps.places.PlacesServiceStatus.OK||!f){d(Zt.getLocalizedLocalityPlaceholderText(AD),_);return}const E=fF.getRandomInt(f.length),S=f[E].description;d(a.replace(o,S),_)}return u}const pF={getPlaceDetails(e){let r,t,a,o;const s=e.formatted_address;for(const u of e.address_components)for(const p of u.types)p==="locality"&&(r=u.short_name),p==="administrative_area_level_1"&&(t=u.short_name),p==="postal_code"&&(o=u.short_name),p==="country"&&(a=u.short_name);return{locality:s,country:a,postalCode:o,city:r,province:t}}},Tre={1:"geocoderPermissionDenied",2:"geocoderUnavailable",3:"geocoderTimeout"};function Rre(e){const[r,t]=je.useState({}),{onGoogleApiReady:a}=dF(e);function o(){a(()=>{window.navigator.geolocation.getCurrentPosition(s,u)})}function s(p){const{latitude:d,longitude:h}=p.coords,f=new google.maps.LatLng(d,h);new google.maps.Geocoder().geocode({location:f},(_,E)=>{if(E!==google.maps.GeocoderStatus.OK)return;const S=_.find(R=>R.types.includes("locality")||R.types.includes("administrative_area_level_2")),w=pF.getPlaceDetails(S);t({...w,longitude:h,latitude:d})})}function u(p){Tre[p.code],e.onPositionError("We are unable to access your location. Please try again later.")}return{placeDetails:r,onClickGetCurrentLocation:o}}const gF=(e,r)=>{const[t,a]=je.useState(e);return je.useEffect(()=>{const o=setTimeout(()=>a(e),r);return()=>clearTimeout(o)},[e,r]),t};function Ore({search:e,makePredicition:r,geoLocation:t,apiKey:a}){const o=hF({googleApiKey:a}),s=gF(e,300),[u,p]=je.useState();je.useEffect(()=>{if(!o)return;if((s==null?void 0:s.length)===0||!r){p(void 0);return}const f=(t==null?void 0:t.countryCode)||"us";o.getPlacePredictions({input:s,componentRestrictions:t!=null&&t.isFallback?void 0:{country:f},region:f,types:["locality","sublocality","postal_code"]},d)},[s,r,o]);function d(f,c){if(c!==google.maps.places.PlacesServiceStatus.OK||!f){p(void 0);return}p(f)}function h(f,c,_){new google.maps.places.PlacesService(c.current).getDetails({placeId:f.place_id,fields:["geometry","address_components","formatted_address"],region:t.countryCode},(S,w)=>{if(w!==google.maps.places.PlacesServiceStatus.OK)return;const R=S.geometry.location.lng(),b=S.geometry.location.lat(),{locality:I,country:m,postalCode:v,city:y,province:g}=pF.getPlaceDetails(S);_({longitude:R,latitude:b,locality:I,country:m,city:y,postalCode:v,province:g})})}return{localityPredicitions:u,getPlaceInfo:h}}function TD(){return A.jsx("svg",{viewBox:"0 0 24 24",children:A.jsx("path",{d:"m12.00559,20.40189c4.60881,0 8.37242,-3.78424 8.37242,-8.40189c0,-4.61764 -3.76361,-8.40187 -8.37242,-8.40187c-4.62002,0 -8.38365,3.78422 -8.38365,8.40187c0,4.61765 3.76364,8.40189 8.38365,8.40189zm0,-1.65557c-3.75235,0 -6.67085,-2.96208 -6.67085,-6.74632c0,-3.7842 2.91851,-6.74625 6.67085,-6.74625c3.74105,0 6.67084,2.96206 6.67084,6.74625c0,3.78424 -2.92978,6.74632 -6.67084,6.74632zm-10.14151,-6.02552l6.01731,0c0.40566,0 0.72118,-0.31536 0.72118,-0.7208c0,-0.40544 -0.31552,-0.7208 -0.72118,-0.7208l-6.01731,0c-0.40566,0 -0.72117,0.31536 -0.72117,0.7208c0,0.40544 0.31551,0.7208 0.72118,0.7208l-0.00001,0zm14.25442,0l6.0174,0c0.40565,0 0.72118,-0.31536 0.72118,-0.7208c0,-0.40544 -0.31553,-0.7208 -0.72118,-0.7208l-6.0174,0c-0.40565,0 -0.72118,0.31536 -0.72118,0.7208c0,0.40544 0.31553,0.7208 0.72118,0.7208zm-4.12417,-4.1221c0.40566,0 0.72118,-0.31534 0.72118,-0.70952l0,-6.02547c0,-0.40544 -0.31552,-0.7208 -0.72118,-0.7208c-0.3944,0 -0.7099,0.31536 -0.7099,0.7208l0,6.02547c0,0.39418 0.31551,0.70952 0.7099,0.70952zm0,14.25838c0.40566,0 0.72118,-0.3154 0.72118,-0.72077l0,-6.02541c0,-0.39425 -0.31552,-0.70965 -0.72118,-0.70965c-0.3944,0 -0.7099,0.3154 -0.7099,0.70965l0,6.02541c0,0.40538 0.31551,0.72077 0.7099,0.72077z"})})}const kre="_baseText_5xxp4_1",Pre="_inputFocused_5xxp4_4",Nre="_dropdown_5xxp4_7",jre="_suggestionContainer_5xxp4_10",qre="_suggestionItem_5xxp4_20",Dre="_suggestionLoading_5xxp4_20",Lre="_noSuggestion_5xxp4_20",Mre="_large_5xxp4_24",Ure="_input_5xxp4_4",Fre="_selected_5xxp4_42",Bre="_useMyLocation_5xxp4_46",zt={baseText:kre,inputFocused:Pre,dropdown:Nre,suggestionContainer:jre,suggestionItem:qre,suggestionLoading:Dre,noSuggestion:Lre,large:Mre,input:Ure,selected:Fre,useMyLocation:Bre};function $re(e){const{predictions:r,getPlaceInfo:t,selectedIndex:a}=e;return A.jsx(A.Fragment,{children:r.map((o,s)=>A.jsx(Zo,{className:`${zt.suggestionItem} ${a-1===s?zt.selected:""}`,onKeyDown:u=>u.key==="Enter"&&t(o),onMouseDown:()=>t(o),onClick:()=>t(o),children:o.description},o.place_id))})}function mF(e){var V,G,B,M,L;const r=je.useRef(null),[t,a]=je.useState(((V=e.data)==null?void 0:V.schoolLocality)||""),[o,s]=je.useState(!1),u=Are({apiKey:e.googleMapsApiKey,geoLocation:e.geoLocation}),{localityPredicitions:p,getPlaceInfo:d}=Ore({search:t,makePredicition:o,geoLocation:e.geoLocation,apiKey:e.googleMapsApiKey}),{placeDetails:h,onClickGetCurrentLocation:f}=Rre({apiKey:e.googleMapsApiKey,onPositionError:v}),c=window.navigator.geolocation?1:0,{selectedIndex:_,onKeyDown:E,containerRef:S,hide:w,onBlur:R,onFocus:b}=g_({onSelected:x,itemCount:((p==null?void 0:p.length)??0)+c,hideOnBlur:e.hideOnBlur}),[I,m]=je.useState();je.useEffect(()=>{T(h)},[h]);function v(U){s(!0),m(U)}function y(U){var H,ae,oe;I&&m(void 0),o||s(!0),((H=e.data)!=null&&H.longitude||(ae=e.data)!=null&&ae.latitude||(oe=e.data)!=null&&oe.schoolLocality)&&e.clearData(),a(U)}function g(){y(""),r.current.focus()}function x(U){if(!p)return;if(U===p.length){j();return}const H=p[U];H&&O(H)}function T(U){e.setData({schoolLocality:U.locality,country:U.country,province:U.province,schoolPostCode:U.postalCode,longitude:U.longitude,latitude:U.latitude}),U.locality&&a(U.locality)}function O(U){o&&s(!1),d(U,r,T)}function j(U){var H;U==null||U.preventDefault(),s(!1),f(),(H=e.logUserAction)==null||H.call(e,{},{actionType:sn.Click,descriptor:Yt.UseMyLocation})}function k(){let U="form-control";return e.size==="lg"&&(U+=" form-control-lg"),!N||w?`${U} ${zt.input}`:`${U} ${zt.inputFocused}`}const N=(p==null?void 0:p.length)&&!((B=(G=e.data)==null?void 0:G.schoolLocality)!=null&&B.length),D=window.navigator.geolocation&&!((L=(M=e.data)==null?void 0:M.schoolLocality)!=null&&L.length),F=e.labelClassName||`d-block text-center mb-3 fw-normal ${zt.baseText}`;let $="form-group position-relative";return e.size==="lg"&&($+=` ${zt.large}`),A.jsxs("div",{className:$,children:[A.jsxs("label",{className:F,htmlFor:"locality-input",children:["ZIP code or city",e.required&&A.jsx("span",{className:"text-danger",children:"*"})]}),A.jsx(Bs,{type:"text",value:t,onChange:U=>y(U.currentTarget.value),id:"locality-input",className:k(),ref:r,autoComplete:"off",placeholder:u||"Loading...",disabled:e.disabled||!u,autoFocus:e==null?void 0:e.autoFocus,onClickClear:g,onKeyDown:E,onFocus:b,onBlur:R}),A.jsxs("div",{className:`position-absolute z-1 w-100 ${zt.dropdown} ${w?"d-none":""}`,children:[!!N&&A.jsxs("div",{className:zt.suggestionContainer,ref:S,children:[A.jsx($re,{predictions:p,getPlaceInfo:O,selectedIndex:_}),window.navigator.geolocation&&e.useGeoLocationApi&&A.jsx(Zo,{className:`${zt.suggestionItem} px-1 ${_-1===p.length?zt.selected:""}`,onClick:j,children:A.jsxs("div",{className:"btn btn-link info-link btn-with-icon bg-transparent py-0 pe-1",children:[A.jsx(TD,{}),"Use my current location"]})})]}),D&&!N&&e.useGeoLocationApi&&A.jsx("div",{className:`d-flex ${zt.useMyLocation}`,children:A.jsxs("button",{onClick:j,className:"btn btn-link info-link bg-white btn-with-icon",children:[A.jsx(TD,{}),"Use my current location"]})}),!!I&&A.jsx("div",{className:"text-danger p-2",children:I})]})]})}var Li=(e=>(e.GET="GET",e.POST="POST",e.PUT="PUT",e.DELETE="DELETE",e))(Li||{});class zre extends Error{constructor(r,t="Error"){super(t),this.body=r}}const Zre={prepareQuery(e,r){let t=e;return Object.keys(r).forEach((a,o)=>{r[a]&&(o===0?t+="?":t+="&",t+=`${a}=${encodeURIComponent(r[a])}`)}),t}};function cb(e){let r={method:Li.GET,headers:{"Content-type":"application/json"}};e.method&&(r={...r,method:e.method}),e.init&&(r={...r,...e.init});let t=e.url;return r.method===Li.GET&&e.data?t=Zre.prepareQuery(t,e.data):e.data&&(r={...r,body:JSON.stringify(e.data)}),{init:r,url:t}}const ei={async asyncFetch(e){const r=cb(e),t=await fetch(r.url,r.init);if(!t.ok){const a=await t.json();throw new zre(a)}if(t.status!==204)return await t.json()},async asyncFetchPlain(e){const r=cb(e),t=await fetch(r.url,r.init);if(t.ok)return await t.text()},fetch(e){const r=cb(e);return fetch(r.url,r.init).then(t=>{if(t.status!==204)return t.json()}).then(t=>(e.success&&e.success(t),t)).catch(t=>(e.error&&e.error(),t)).finally(()=>{e.always&&e.always()})}},Zf={search(e,r,t,a,o){const s={longitude:r.longitude,latitude:r.latitude};r.query&&(s.query=r.query),ei.fetch({url:e,data:s,success:t,error:a,always:o})},async create(e,r){return ei.asyncFetch({url:e.createProspect,method:Li.POST,data:r})},getLookups(e,r){return ei.asyncFetch({url:e.prospectLookups(r)})}},Hre=/\/$/,Vre={urlBuilder(e,r){const a=Object.entries(r).map(([o,s])=>o&&Array.isArray(s)?s.map(p=>`${o}=${encodeURIComponent(p)}`).join("&"):o&&s!==void 0&&s!==null?`${o}=${encodeURIComponent(s)}`:"").reduce((o,s)=>s?o?`${o}&${s}`:s:o,"");return a?`${e}?${a}`:e},buildFilter(e){const r=[];if(e.limit&&r.push(`limit:${e.limit}`),e.cursor&&r.push(`page:${e.cursor}`),e.before&&r.push(`dateCreated:...${e.before}`),!!r.length)return r.join(",")},makeHttps(e){return typeof e!="string"||e.indexOf("http://")===-1||(e=e.replace("http://","https://")),e},safeUrlConcat(e,r){if(!e)return;let t=e;return e.endsWith("/")||(t+="/"),r&&(t+=r.startsWith("/")?r.slice(1):r),t},removeTrailingSlash(e){if(typeof e=="string")return e.replace(Hre,"")}},mo={checkTrialStatus(e,r){if(e.productName!==La.Lite)return Promise.reject();const t={email:r.email};return ei.asyncFetch({url:e.userStatus,data:t})},checkUserIdps(e,r){return e.productName!==La.Lite?Promise.reject():ei.asyncFetch({url:e.idps,data:{email:r}})},checkProspectTrialStatus(e,r,t,a,o){let s=e.prospectStatus(r.prospectId);s=Vre.urlBuilder(s,{email:r.email}),ei.fetch({url:s,success:t,error:a,always:o})},createTrial(e,r){const t={prospectId:r.prospectId,email:r.email,userType:r.userType,appLink:r==null?void 0:r.appLink,attribution:r==null?void 0:r.attribution};return ei.asyncFetch({url:e.createTrial,method:Li.POST,data:t})},resendTrialEmail(e,r,t){if(e.productName!==La.Lite)return Promise.reject();const a={email:t.email,appLink:t==null?void 0:t.appLink};return ei.asyncFetch({url:e.resendTrialEmail(r),method:Li.POST,data:a})},createJoinRequest(e,r){const t=e.productName===La.Auth?e.joinRequest:e.joinRequest(r.customerId),a=e.productName===La.Auth?r:{email:r.email};return ei.asyncFetch({url:t,method:Li.POST,data:a})},createAutoJoinRequest(e,r){return e.productName!==La.Lite?Promise.reject():ei.asyncFetch({url:e.autoJoin,method:Li.POST,data:r})}},RD=["Primary","Secondary","K12","Special","TAFE","University"],Gre=["Primary","Secondary","Primary & Secondary","Special","Sixth Form College","FE College","University","Other"],xb=["Elementary","Middle School","High School","College","Other"],Wre={au:RD,nz:RD,uk:Gre,us:xb,ca:xb};function Kre(e){const r=Zt.getCountryCode(e),t=Wre[r];return t||xb}var yF=(e=>(e.Published="Published",e.Draft="Draft",e))(yF||{});function Yre(e){var R;const[r,t]=je.useState({prospectId:e.prospectId,schoolName:e.schoolName,schoolType:e.schoolType,schoolLocality:e.schoolLocality,country:e.country,province:e.province,city:e.city,longitude:e.longitude,latitude:e.latitude}),[a,o]=je.useState(),[s,u]=je.useState(!1),p=Kre(r.country||((R=e.geoLocation)==null?void 0:R.countryCode));function d(){const{schoolName:b,schoolType:I,country:m}=r;return!!(b&&I&&m)}function h(b,I){t(m=>({...m,[b]:I}))}function f(b){const{longitude:I,latitude:m,schoolLocality:v,country:y,city:g,province:x}=b;I&&h("longitude",I),m&&h("latitude",m),y&&h("country",y),g&&h("city",g),x&&h("province",x),v&&h("schoolLocality",v)}function c(){h("schoolLocality",void 0),h("longitude",void 0),h("latitude",void 0),h("city",void 0),h("province",void 0),h("country",void 0),o("")}function _(b){const I=b.target.value;h("schoolType",I)}function E(b){h("schoolName",b.target.value)}async function S(b){const I={email:e.email,custom:{accountName:r==null?void 0:r.schoolName,accountAddress:{countryCode:r==null?void 0:r.country,province:Kt.parseProvince(r.province)},orgSubType:Kt.getSchoolType(r==null?void 0:r.schoolType),syncToCrm:!0,source:Kt.SOURCE},event:{accountCountry:r==null?void 0:r.country,accountPostCode:r==null?void 0:r.schoolPostCode,accountState:Kt.parseProvince(r.province)}},m={form_type:"trial-sign-up",prospect_id:r==null?void 0:r.prospectId};e.logBrazeEvent({user:I,event:{eventType:Tl.ProductFormEvent.FormSubmission,additionalData:m,callback:b}})}async function w(b){var m;if(b.preventDefault(),!d())return;e.logUserAction(r,{actionType:sn.Click,workflowPhase:Ma.Next,descriptor:Yt.CantFindSchool}),u(!0);let I;try{if(I=await Zf.create(e.ajaxUrls,{name:r.schoolName,status:yF.Draft,countryCode:r.country,prospectType:r.schoolType,city:r.city,postCode:r.schoolPostCode,province:Kt.parseProvince(r.province)}),!I.id){u(!1),o("Error. Something went wrong.");return}}catch{u(!1),o("Error. Something went wrong.");return}if(e.userTrialStatus===Dr.BdmTrialAvailable){if(e.userType!==In.Staff){e.complete({completionStep:"added-to-braze",trialCreated:!1,trialStatus:null});return}e.nextStep({step:"request-bdm-trial",...r});return}try{const v={prospectId:I.id,email:e.email,userType:e.userType,appLink:e.pageAppLinkString,attribution:{...bi.getDecodedAttributionData(),utms:ss.getUtmParameters()}},y=await mo.createTrial(e.ajaxUrls,v);e.createOrUpdateProfile&&e.createOrUpdateProfile({masterId:y.id,email:e.email,countryCode:r==null?void 0:r.country});const g={completionStep:"trial-status",email:e.email,userId:y.id,prospectId:I.id,schoolName:r.schoolName,schoolLocality:r.schoolLocality,country:r.country,schoolType:r.schoolType,city:r.city,schoolPostCode:r.schoolPostCode,latitude:r.latitude,longitude:r.longitude,province:r.province,trialStatus:Dr.Available,trialCreated:!0,customerId:(m=y.data)==null?void 0:m.customerId};if((e==null?void 0:e.userType)===In.Staff){await S(x=>{x||console.error("Failed to submit create trial data to braze."),e.complete(g)});return}e.complete(g)}catch(v){if(!v.body){u(!1),o("Error. Something went wrong.");return}const y=v;if(y.body.status===400&&y.body.type==="trial-not-available"){e.nextStep({step:"add-to-braze",...r,prospectId:I.id,trialStatus:Dr.Unavailable});return}console.error(v)}}return A.jsxs(A.Fragment,{children:[A.jsxs("div",{className:"text-center",children:[A.jsx("h1",{className:"h4",children:"Tell us more about your school"}),A.jsx("p",{children:"Please enter your school details."})]}),A.jsxs("div",{className:"form-group",children:[A.jsx("label",{className:"d-block",htmlFor:"school-name-input",children:"Name of school"}),A.jsx("input",{type:"text",value:(r==null?void 0:r.schoolName)||"",onChange:E,id:"school-name-input",className:"form-control form-control-lg",autoComplete:"off",placeholder:"Enter name of school",autoFocus:!0})]}),A.jsxs("div",{className:"form-group",children:[A.jsx("label",{className:"d-block",htmlFor:"school-type-select",children:"Type of school"}),A.jsxs("select",{id:"school-type-select",className:`form-select form-select-lg ${r.schoolType?"":"text-secondary"}`,autoComplete:"off",value:r.schoolType||"none",onChange:_,children:[A.jsx("option",{value:"none",className:"text-secondary",disabled:!0,children:"Select type of school"}),p.map(b=>A.jsx("option",{value:b,className:"text-dark",children:b},b))]})]}),A.jsx(mF,{data:r,setData:f,clearData:c,disabled:!1,labelClassName:"d-block",geoLocation:e.geoLocation,logUserAction:e.logUserAction,googleMapsApiKey:e.googleMapsApiKey,autoFocus:!1,size:"lg",useGeoLocationApi:!0}),a&&A.jsx("div",{className:"text-danger mb-3",children:a}),d()&&A.jsx(zf,{className:"btn-lg w-100",variant:"dark",onClick:w,showSpinner:s,disabled:s,children:"Get started"})]})}function W_(e,r){return r?`${e} ${r}`:e}function Jre(e){return A.jsx("h1",{className:W_("text-center mb-2 h4",e.className),children:e.children})}function Xre(e){return A.jsx("div",{className:W_("text-center text-sm px-2 px-lg-4",e.className),children:e.children})}function Qre(e){return A.jsx("p",{className:W_("",e.className),children:e.children})}const rt={Heading:Jre,Body:Xre,Message:Qre};function Rl(e){const r={[Dr.Available]:e.imageUrls.statusImages.available,[Dr.Active]:e.imageUrls.statusImages.active,[Dr.Expired]:e.imageUrls.statusImages.expired,[Dr.NotRequired]:e.imageUrls.statusImages.notRequired,[Dr.Unavailable]:e.imageUrls.statusImages.unavailable,[Dr.Unsupported]:e.imageUrls.statusImages.unsupported,[Dr.UserAutoJoinAllowed]:e.imageUrls.statusImages.notRequired,[Dr.UserJoinApprovalRequired]:e.imageUrls.statusImages.notRequired,[Dr.InvalidEmail]:"",[Dr.BdmTrialAvailable]:""};return A.jsx("div",{className:"d-flex justify-content-center my-4 px-2 px-lg-4",children:A.jsx("img",{src:r[e.trialStatus],className:"w-100 h-auto"})})}function ete(e){return je.useEffect(()=>{e.logUserAction({},{actionType:sn.Create,descriptor:Yt.TrialRequested,workflowPhase:Ma.Complete})},[]),A.jsxs(A.Fragment,{children:[A.jsx(Rl,{trialStatus:Dr.Available,imageUrls:e.imageUrls}),A.jsxs(rt.Body,{className:"mb-3",children:[A.jsx(rt.Heading,{children:"Submitted!"}),A.jsx(rt.Message,{children:"Thank you for your interest in trialing ClickView. We will be in touch with you as soon as possible."})]})]})}function rte(e){return A.jsxs(A.Fragment,{children:[A.jsx(Rl,{trialStatus:Dr.Available,imageUrls:e.imageUrls}),A.jsxs(rt.Body,{className:"mb-3",children:[A.jsx(rt.Heading,{children:"You've requested access!"}),A.jsx(rt.Message,{children:"We've sent a request to your ClickView admin. Once your account is ready, you'll receive an email notification with instructions on how to get started with ClickView."})]})]})}const Uc={Marketing:{au:"https://www.clickvieweducation.com/en-au",us:"https://www.clickvieweducation.com",nz:"https://www.clickview.co.nz",uk:"https://www.clickview.co.uk",ca:"https://www.clickvieweducation.com/en-ca"},Support:{au:"https://www.clickviewsupport.com/hc/en-au",uk:"https://www.clickviewsupport.com/hc/en-au#gb",nz:"https://www.clickviewsupport.com/hc/en-au#nz",us:"https://www.clickviewsupport.com/hc/en-au#us",ca:"https://www.clickviewsupport.com/hc/en-au#ca"}},tte={[Ze.AU]:"/contact-us/sales",[Ze.US]:"/contact-us/sales",[Ze.NZ]:"/contact-us/",[Ze.UK]:"/contact-us/trial",[Ze.CA]:"/contact-us/sales"},nte={[Ze.AU]:"/resources/free-student-resources",[Ze.US]:"/resources/free-student-resources",[Ze.NZ]:"/free-student-resources/",[Ze.UK]:"/free-student-resources/",[Ze.CA]:"/resources/free-student-resources"},wo={getMarketingUrlForGeoLocation(e){const r=Zt.getCountryCode(e==null?void 0:e.countryCode),t=Uc.Marketing[r];return t||Uc.Marketing.us},getMarketingSalesContactForGeoLocation(e){const r=Zt.getCountryCode(e==null?void 0:e.countryCode),t=wo.getMarketingUrlForGeoLocation(e),a=tte[r];return`${t}${a}`},getFreeResourcesForGeoLocation(e){const r=Zt.getCountryCode(e==null?void 0:e.countryCode),t=this.getMarketingUrlForGeoLocation({countryCode:r}),a=nte[r];return`${t}${a}`},getTermsAndConditionsLink(){return this.getMarketingUrlForGeoLocation(Ze.US)+"/terms-and-conditions/"},getPrivacyPolicyLink(){return this.getMarketingUrlForGeoLocation(Ze.US)+"/privacy-policy/"},getSupportUrlForGeoLocation(e){const r=Zt.getCountryCode(e==null?void 0:e.countryCode),t=Uc.Support[r];return t||Uc.Support.us}};function Fc(e){const r=(e==null?void 0:e.previousStepIds)&&e.previousStepIds[e.previousStepIds.length-1]==="find-school",t=(e==null?void 0:e.schoolName)||"Your school";return A.jsxs(rt.Body,{className:"mb-3",children:[r?A.jsxs(A.Fragment,{children:[A.jsxs(rt.Heading,{children:[t,A.jsx("br",{}),"already has ClickView 🎉"]}),A.jsxs(rt.Message,{className:"mt-3",children:["If your school has SSO ",A.jsx("a",{href:e.getSignInUrl({email:e.email,customerId:e.customerId}),className:"info-link",children:"click here to sign in."})]}),A.jsx(rt.Message,{children:"Otherwise please contact your school admin for access."})]}):A.jsxs(A.Fragment,{children:[A.jsx(rt.Heading,{children:"Good News!"}),A.jsxs(rt.Message,{children:["An account already exists for:",A.jsx("br",{})," ",A.jsx("strong",{children:e.email})]}),A.jsx(rt.Message,{children:A.jsx("a",{href:e.getSignInUrl({email:e.email}),className:"btn btn-dark btn-lg w-100",children:"Sign into ClickView"})})]}),A.jsxs(rt.Message,{children:["Need Help? ",A.jsx("a",{href:wo.getSupportUrlForGeoLocation(e.geoLocation),className:"info-link",target:"_blank",children:"Contact our Help Centre."})]})]})}function ate(e){const r=wo.getMarketingSalesContactForGeoLocation(e.geoLocation),t=(e==null?void 0:e.previousStepIds)&&e.previousStepIds[e.previousStepIds.length-1]==="find-school",a=(e==null?void 0:e.schoolName)||"Your school";return A.jsxs(rt.Body,{children:[A.jsx(rt.Heading,{children:t?`${a} trial has expired`:"Your trial has expired"}),A.jsxs(rt.Message,{children:["Please contact our ",A.jsx("a",{href:r,className:"info-link",target:"_blank",children:"ClickView Sales Team"})]})]})}function ite(e){const r=wo.getMarketingSalesContactForGeoLocation(e.geoLocation);return A.jsxs(rt.Body,{children:[A.jsxs(rt.Heading,{children:["Your school no longer",A.jsx("br",{})," has access to ClickView"]}),A.jsxs(rt.Message,{children:["Please contact our ",A.jsx("a",{href:r,className:"info-link",children:"ClickView Sales Team"})," for more information."]})]})}function ote(){return A.jsxs(rt.Body,{children:[A.jsxs(rt.Heading,{className:"px-2 px-lg-4",children:["ClickView isn't currently ",A.jsx("br",{})," available for your school"]}),A.jsx(rt.Message,{children:"We're working hard to get ClickView ready for more people."})]})}const ste=1;function ute(e){const[r,t]=je.useState(0),[a,o]=je.useState(!1);async function s(p){p==null||p.preventDefault();try{await mo.resendTrialEmail(e.ajaxUrls,e.userId,{email:e.email,appLink:e.pageAppLinkString}),t(r+1)}catch{o(!0)}e.logUserAction({},{actionType:sn.Click,descriptor:Yt.ResendEmail})}function u(p){p==null||p.preventDefault(),e.logUserAction({},{actionType:sn.Click,descriptor:Yt.WrongEmail}),e.nextStep({step:"enter-email",userType:e.userType})}if(e!=null&&e.email)return A.jsxs(rt.Body,{children:[A.jsx(rt.Heading,{children:"Check your inbox!"}),A.jsxs(rt.Message,{children:["An email has been sent to ",A.jsx("strong",{children:e.email}),"."]}),!!e.userId&&A.jsxs(A.Fragment,{children:[r<ste?A.jsx("button",{onClick:s,className:"btn btn-outline-dark btn-lg mb-3",children:"Resend verification email"}):A.jsx(rt.Message,{children:"✅ Email has been resent!"}),A.jsxs(rt.Message,{children:["Wrong email? ",A.jsx("button",{onClick:u,className:"btn info-link p-0 align-top border-0",children:"Update email address"})]}),a&&A.jsxs(rt.Message,{className:"mb-0 text-danger",children:["❌ There was a problem resending the email. Please try again later or contact our ",A.jsx("a",{href:wo.getSupportUrlForGeoLocation(e.geoLocation),className:"info-link",children:"support"})]})]})]})}const lte={[Dr.Available]:ute,[Dr.Active]:Fc,[Dr.Expired]:ate,[Dr.NotRequired]:Fc,[Dr.Unavailable]:ite,[Dr.Unsupported]:ote,[Dr.UserAutoJoinAllowed]:Fc,[Dr.UserJoinApprovalRequired]:Fc,[Dr.InvalidEmail]:null,[Dr.BdmTrialAvailable]:null};function cte(e){const r=lte[e.trialStatus];return r?A.jsx(r,{...e}):A.jsx(A.Fragment,{})}function fte(e){return je.useEffect(()=>{const r={actionType:sn.Create,descriptor:Yt.DeadEnd,workflowPhase:Ma.Discard};e.trialCreated&&(r.descriptor=Yt.TrialCreated,r.workflowPhase=Ma.Complete),e.logUserAction({},r)},[]),A.jsxs(A.Fragment,{children:[A.jsx(Rl,{trialStatus:e.trialStatus,imageUrls:e.imageUrls}),A.jsx(cte,{...e})]})}const dte="young-student";function hte(e){const r=wo.getFreeResourcesForGeoLocation(e.geoLocation);return je.useEffect(()=>{Tn.set(dte,!0)},[]),A.jsxs(A.Fragment,{children:[A.jsx(Rl,{trialStatus:Dr.Active,imageUrls:e.imageUrls}),A.jsxs(rt.Body,{className:"mb-3",children:[A.jsx(rt.Heading,{children:"Discover our free content"}),A.jsx(rt.Message,{children:"Click the button below to explore our videos"}),A.jsx("a",{href:r,className:"btn btn-lg btn-dark w-100",target:"_blank",children:"Start watching now"})]})]})}const vte={"trial-status":fte,"added-to-braze":ete,"young-student":hte,"requested-access":rte};function pte(e){const r=vte[e.completionStep];return A.jsx("div",{className:"d-flex justify-content-center flex-column mx-auto px-2",children:A.jsx(r,{...e})})}const gte="_day_n6ysn_1",mte="_month_n6ysn_4",yte="_year_n6ysn_7",fb={day:gte,month:mte,year:yte},bte=120,_te=16;function Ste(e,r,t){const a=new Date(bF(e,r,t));return!isNaN(+a)}function bF(e,r,t){return`${e.padStart(4,"0")}-${r.padStart(2,"0")}-${t.padStart(2,"0")}`}function wte(e){const[r,t]=je.useState(""),[a,o]=je.useState(""),[s,u]=je.useState(""),[p,d]=je.useState(null);function h(v){t(v.target.value),d(null)}function f(v){o(v.target.value),d(null)}function c(v){u(v.target.value),d(null)}function _(){return!r||!a||!s?(d("Please enter your date of birth"),!1):Ste(s,a,r)?+s>S?(d("Please enter a date in the past"),!1):+s<S-bte?(d("Please enter a realistic date of birth"),!1):!0:(d("Please enter a valid date"),!1)}function E(v){if(v.preventDefault(),!_())return;const y=new Date(bF(s,a,r)),g=S-_te,x=new Date;if(x.setFullYear(g),y>x){e.complete({completionStep:"young-student",trialCreated:!1,trialStatus:null});return}e.nextStep({step:"enter-email",userType:e.userType})}const S=new Date().getFullYear(),w="mx-2 d-inline-block text-start",R=`form-control form-control-lg ${p?"is-invalid":""}`;let b="order-0",I="order-3";const m=Zt.isCountryCodeUS(e.geoLocation.countryCode);return m&&(b="order-3",I="order-0"),A.jsxs("form",{className:"text-center",onSubmit:E,noValidate:!0,children:[A.jsx("h1",{className:"h4",children:"Tell us a little about yourself"}),A.jsx("p",{children:"Please enter your date of birth"}),A.jsxs("div",{className:"my-4",children:[A.jsxs("fieldset",{className:"d-flex justify-content-center","aria-describedby":"dateOfBirthError",children:[A.jsxs("div",{className:`${w} ${b}`,children:[A.jsx("label",{className:"mb-0",htmlFor:"day",children:"Day"}),A.jsx("input",{id:"day",type:"number",className:`${R} ${fb.day}`,min:"1",max:"31",placeholder:"DD",value:r,onChange:h,autoFocus:!m,tabIndex:m?2:1})]}),A.jsx("span",{className:`h1 fw-normal mt-3 mb-0 order-1 ${p?"text-danger":""}`,children:"/"}),A.jsxs("div",{className:`${w} ${I}`,children:[A.jsx("label",{className:"mb-0",htmlFor:"month",children:"Month"}),A.jsx("input",{id:"month",type:"number",className:`${R} ${fb.month}`,min:"1",max:"12",placeholder:"MM",value:a,onChange:f,autoFocus:m,tabIndex:m?1:2})]}),A.jsx("span",{className:`h1 fw-normal mt-3 mb-0 order-4 ${p?"text-danger":""}`,children:"/"}),A.jsxs("div",{className:`${w} order-5`,children:[A.jsx("label",{className:"mb-0",htmlFor:"year",children:"Year"}),A.jsx("input",{id:"year",name:"year",type:"number",className:`${R} ${fb.year}`,min:S-120,max:S,placeholder:"YYYY",value:s,onChange:c,tabIndex:3})]})]}),!!p&&A.jsx(Ht,{name:"dateofBirth",children:p})]}),A.jsx("button",{type:"submit",className:"btn btn-lg btn-dark w-100",children:"Continue"})]})}function Ete(e){return A.jsxs(A.Fragment,{children:["Have a ClickView account already?",A.jsx("a",{href:e.link,className:"info-link ms-1",onClick:e.onClick,children:"Sign in"})]})}function Cte(){const e={},r=bi.getEncodedAttributionData();r&&(e.r=r);const t=ss.getUtmParameters();return t&&(e.utms=t),JSON.stringify(e)}const xte=new RegExp(/^[^\s@]+@[^\s@]+\.[^\s@]+$/),OD={[Ze.AU]:"valerie.frizzle@school.edu.au",[Ze.UK]:"valerie.frizzle@school.gov.uk",[Ze.US]:"valerie.frizzle@school.gov",[Ze.NZ]:"valerie.frizzle@school.nz",[Ze.CA]:"valerie.frizzle@school.ca"},Ite={[Ze.AU]:"/contact-us/support",[Ze.US]:"/contact-us/support",[Ze.NZ]:"/contact-us/",[Ze.UK]:"/contact-us/technical/",[Ze.CA]:"/contact-us/support"};function Ate(e){const r=wo.getMarketingUrlForGeoLocation(e),t=Zt.getCountryCode(e==null?void 0:e.countryCode),a=Ite[t];return`${r}${a}`}function Tte(e){const r=OD[Zt.getCountryCode(e.countryCode)];return r||OD.us}const Rte=[Dr.Expired,Dr.NotRequired,Dr.Unavailable,Dr.Unsupported,Dr.Active];function Ote(e){const[r,t]=je.useState(!1),[a,o]=je.useState((e==null?void 0:e.email)||""),[s,u]=je.useState(),p=Ate(e.geoLocation);async function d(){u("");let S;try{S=await mo.checkTrialStatus(e.ajaxUrls,{email:a})}catch{u("Something went wrong! Please try again later.");return}if(S.status===Dr.InvalidEmail){u("Please use your school email address.");return}if(e.logUserAction({},{actionType:sn.Click,workflowPhase:Ma.Next,descriptor:Yt.EnterEmail}),Rte.includes(S.status)){e.complete({completionStep:"trial-status",email:a,trialStatus:S.status,trialCreated:!1});return}try{const w=await mo.checkUserIdps(e.ajaxUrls,a);if(w.length){e.nextStep({step:"select-idp",email:a,userTrialStatus:S.status,idps:w});return}}catch{u("Something went wrong! Please try again later.");return}e.nextStep({step:"find-school",email:a,userTrialStatus:S.status})}function h(){e.logUserAction({},{actionType:sn.Click,descriptor:Yt.ContactUs})}function f(){return a.length?xte.test(a)?!0:(u("Please use your school email address."),!1):(u("Please enter your school email address."),!1)}function c(){e.logUserAction({},{actionType:sn.Click,descriptor:Yt.SignIn})}function _(S){S.preventDefault(),o(S.target.value),u("")}async function E(S){S==null||S.preventDefault(),f()&&(t(!0),await d(),t(!1))}return A.jsxs(A.Fragment,{children:[A.jsxs("div",{className:"text-center",children:[A.jsx("h1",{className:"h4",children:"Let's set up your account"}),A.jsx("p",{children:"Enter your school email address"})]}),A.jsxs("form",{onSubmit:E,noValidate:!0,children:[A.jsxs("div",{className:"form-group mb-3",children:[A.jsx(Bs,{value:a,onChange:_,name:"email-input",id:"email-input",type:"email",className:`form-control form-control-lg ${s?"is-invalid":""}`,placeholder:Tte(e.geoLocation),autoComplete:"false",autoCorrect:"false",autoFocus:!0,onClickClear:()=>o(""),"aria-errormessage":"email-inputError"}),s&&A.jsxs(A.Fragment,{children:[A.jsx(Ht,{name:"error-input",children:s}),A.jsxs("small",{children:["Having an issue with your email?",A.jsx("a",{href:p,className:"info-link ps-1",target:"_blank",onClick:h,children:"Contact our team"})]})]})]}),A.jsx(zf,{showSpinner:r,variant:"dark",className:"btn-lg mb-3 w-100",disabled:r,onClick:E,children:"Continue"})]}),e.userType===In.Staff&&A.jsx(h_,{idps:e.globalIdps,className:"mt-n3",attribution:Cte()}),A.jsx("div",{className:"text-center",children:A.jsx(Ete,{link:e.getSignInUrl({email:a}),onClick:c})})]})}function kte(e){var r;switch((r=e==null?void 0:e.body)==null?void 0:r.type){case"user-type-not-supported":return"Students may not request to join schools.";case"join-request-already-pending":return"Your request is awaiting administrator approval.";case"join-request-already-denied":return"Your request has been denied by an administrator.";case"join-request-not-allowed":case"user-email-domain-not-approved":case"user-email-invalid":case"create-join-request-failed":case"join-not-required":default:return"Something went wrong."}}var K_=(e=>(e.MasterId="master_id",e.CrmId="crm_id",e.SalesforceId="salesforce_id",e))(K_||{});function Pte(e){const[r,t]=je.useState(null);async function a(){var o;try{const u=(o=(await Zf.getLookups(e.ajaxUrls,e.prospectId)).find(p=>p.type===K_.MasterId))==null?void 0:o.externalId;if(!u){t("Something went wrong.");return}await mo.createJoinRequest(e.ajaxUrls,{customerId:u,email:e.email}),e.logUserAction({},{actionType:sn.Click,descriptor:Yt.RequestAccess}),e.complete({completionStep:"requested-access",trialCreated:!1,trialStatus:Dr.UserJoinApprovalRequired})}catch(s){t(kte(s))}}return A.jsxs(A.Fragment,{children:[A.jsx(Rl,{trialStatus:Dr.UserJoinApprovalRequired,imageUrls:e.imageUrls}),A.jsx(rt.Body,{className:"mb-3",children:A.jsxs(rt.Heading,{children:[e.schoolName,A.jsx("br",{}),"already has ClickView 🎉"]})}),A.jsx("button",{className:"btn btn-lg btn-dark w-100 mb-3",onClick:a,children:"Request access"}),r&&A.jsx("p",{className:"text-danger text-center mb-2",children:r}),A.jsxs(rt.Message,{className:"text-center",children:["Need Help? ",A.jsx("a",{href:wo.getSupportUrlForGeoLocation(e.geoLocation),className:"info-link",target:"_blank",children:"Contact our Help Centre."})]})]})}const Nte={checkEmail(e,r,t){return e.productName!==La.Lite?Promise.reject():ei.asyncFetch({url:e.brazeCheckEmail,method:Li.POST,data:{email:r,instanceRegion:t}})}};function jte(e){var f;const[r,t]=je.useState(!1),[a,o]=je.useState({});function s(c){if(wM(c.jobTitle)){h();return}p(c)}function u(){var _;const c=Zt.getCountryCode(e.country||((_=e.geoLocation)==null?void 0:_.countryCode));return Zt.getInstanceRegion(c)}async function p(c){var S;if(r)return;if(e.userType===In.Learner){o({...a,submission:"Something went wrong! Please try again later."});return}e.logUserAction({},{actionType:sn.Click,workflowPhase:Ma.Next,descriptor:Yt.RequestBdmTrial}),t(!0);const{firstName:_,surname:E}=V_(c.fullname);try{const w=await Nte.checkEmail(e.ajaxUrls,e.email,u()),R={email:e.email,firstName:_,lastName:E,phone:c.phone,custom:{orgSubType:Kt.getSchoolType(e==null?void 0:e.schoolType),accountName:e==null?void 0:e.schoolName,jobTitle:c.jobTitle,accountAddress:{countryCode:e==null?void 0:e.country,province:Kt.parseProvince((e==null?void 0:e.province)||"")},syncToCrm:((S=w.users)==null?void 0:S.length)===0?!0:void 0,source:Kt.BDM_SOURCE},event:{eventTopic:Kt.BDM_EVENT_TOPIC}},b={prospect_id:e==null?void 0:e.prospectId};e.logBrazeEvent({user:R,event:{eventType:Tl.ProductFormEvent.BdmTrialRequested,additionalData:b,callback:d}})}catch{o({...a,submission:"Something went wrong! Please try again later."})}Object.keys(a).length||h()}function d(c){o(c?{}:{...a,submission:"Something went wrong! Please try again later."}),t(!1)}function h(){e.complete({completionStep:"added-to-braze",trialCreated:!1,trialStatus:null})}return A.jsx(cF,{loading:r,errors:a,setErrors:o,country:e.country||((f=e.geoLocation)==null?void 0:f.countryCode),logUserAction:e.logUserAction,handleSubmitForm:s,isTertiary:Kt.isTertiarySchool(e.schoolType)})}function qte(e){const{loading:r,canSubmitForm:t,setSubmissionError:a,prospectStatus:o,userType:s,logStepEvent:u,logUserAction:p,nextStep:d,data:h,productName:f,ajaxUrls:c,complete:_,setLoadingState:E,email:S,userTrialStatus:w,pageAppLinkString:R,setProperty:b,logBrazeEvent:I,createOrUpdateProfile:m}=e;function v(){d({step:"add-to-braze",trialStatus:o,...h}),u()}function y(){if(u(),s!==In.Staff){_({completionStep:"added-to-braze",trialCreated:!1,trialStatus:null});return}d({step:"request-bdm-trial",...h})}function g(){d({step:"request-access",...h}),u()}async function x(){try{await mo.createAutoJoinRequest(c,{prospectId:h.prospectId,email:S}),p({},{actionType:sn.Click,descriptor:Yt.AutoJoin}),_({completionStep:"trial-status",trialCreated:!0,trialStatus:Dr.Available,...h})}catch{a("Something went wrong! Please try again later."),E(!1);return}}async function T(){var D;let N;h!=null&&h.prospectId&&o===Dr.NotRequired&&(N=(D=(await Zf.getLookups(c,h.prospectId)).find($=>$.type===K_.MasterId))==null?void 0:D.externalId),_({completionStep:"trial-status",trialStatus:o,trialCreated:!1,customerId:N,...h}),u()}function O(){return o===Dr.Active||o===Dr.Available?!0:o===Dr.UserAutoJoinAllowed?f===La.Auth:!1}async function j(){if(s!==In.Staff)return;const N={email:S,custom:{accountName:h==null?void 0:h.schoolName,accountAddress:{countryCode:h==null?void 0:h.country,province:Kt.parseProvince(h.province)},orgSubType:Kt.getSchoolType(h==null?void 0:h.schoolType),syncToCrm:!0,source:Kt.SOURCE},event:{accountCountry:h==null?void 0:h.country,accountPostCode:h==null?void 0:h.schoolPostCode,accountState:Kt.parseProvince(h.province)}},D={form_type:"trial-sign-up",prospect_id:h==null?void 0:h.prospectId};I({user:N,event:{eventType:Tl.ProductFormEvent.FormSubmission,additionalData:D}})}async function k(){var D;E(!0);let N;try{N=await mo.createTrial(c,{userType:s,email:S,prospectId:h==null?void 0:h.prospectId,appLink:R,attribution:{...bi.getDecodedAttributionData(),utms:ss.getUtmParameters()}})}catch{a("Something went wrong! Please try again later."),E(!1);return}o===Dr.UserAutoJoinAllowed&&p({},{actionType:sn.Click,descriptor:Yt.AutoJoin}),b("userId",N.id),_({completionStep:"trial-status",userId:N.id,trialCreated:!0,trialStatus:Dr.Available,customerId:(D=N.data)==null?void 0:D.customerId,...h}),j(),m&&m({masterId:N.id,email:S,countryCode:h==null?void 0:h.country}),u()}return async function(){if(!r){if(!t()){a("Something went wrong! Please try again later.");return}if(w===Dr.BdmTrialAvailable)return y();if(s===In.Staff){if(o===Dr.Unsupported)return v();if(o===Dr.UserJoinApprovalRequired)return g();if(o===Dr.UserAutoJoinAllowed&&f===La.Lite)return await x()}return O()?await k():await T()}}}function Dte(e){return e.toLowerCase().split(" ").map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join(" ")}function Lte(e){const r=[];return e.city&&r.push(Dte(e.city)),e.province&&r.push(e.province),e.postCode&&r.push(e.postCode),r.join(" ")}function Mte(e){const{filteredSchoolsList:r,getSchoolName:t,onSchoolSuggestionClick:a,selectedIndex:o}=e;return A.jsx(A.Fragment,{children:r.map((s,u)=>A.jsxs(Zo,{className:`${zt.suggestionItem} ${o-1===u?zt.selected:""}`,onKeyDown:p=>p.key==="Enter"&&a(s),onMouseDown:()=>a(s),onClick:()=>a(s),children:[t(s)," ",A.jsx("br",{}),A.jsx("small",{className:"text-secondary",children:Lte(s)})]},s.id))})}function Ute(e){return A.jsx("div",{className:`info-link ${zt.suggestionItem} ${zt.noSuggestion} ${e.selected?zt.selected:""}`,onKeyDown:r=>r.key==="Enter"&&e.handleNoSuggestion(),onMouseDown:e.handleNoSuggestion,onClick:e.handleNoSuggestion,children:"Can't find your school?"})}function Fte(e){var N;const r=je.useRef(null),[t,a]=je.useState(!0),[o,s]=je.useState(e.data.schoolName&&e.data.schoolPostCode?e.data.schoolName+", "+e.data.schoolPostCode:e.data.schoolName?e.data.schoolName:""),[u,p]=je.useState(),d=gF(o,250),{selectedIndex:h,onKeyDown:f,containerRef:c,hide:_,onBlur:E,onFocus:S}=g_({onSelected:w,itemCount:((u==null?void 0:u.length)??0)+1,hideOnBlur:e.hideOnBlur});function w(D){if(!u&&!D)return;if(D===u.length){e.onClickNoSuggestions(o);return}const F=u[D];F&&x(F)}const R=!!((N=e.data)!=null&&N.prospectId),b=t&&!R,I=!t&&!R&&(u==null?void 0:u.length)<5,m=(u==null?void 0:u.length)&&!R;je.useEffect(()=>{if(!R){if(!d.length){g();return}if(!R&&d.length>1&&d===o){g(d);return}}},[d,R]);function v(D){(e.data.schoolName||e.data.prospectId)&&e.clearData(),D!==o&&s(D)}function y(){v(""),r.current.focus()}function g(D){if(!e.data.latitude&&!e.data.longitude){a(!1);return}a(!0);const F={latitude:e.data.latitude,longitude:e.data.longitude};D&&D.length&&(F.query=D),Zf.search(e.searchUrl,F,$=>p($),null,()=>a(!1))}function x(D){s(T(D)),e.setData({prospectId:D.id,schoolName:D.name,schoolPostCode:D.postCode,schoolType:D.prospectType,province:D.province,city:D.city,country:D.countryCode})}function T(D){return D.name}const O=(m||b||I)&&!e.disabled&&!_;let j=`form-control ${O?zt.inputFocused:zt.input}`,k="form-group position-relative";return e.size==="lg"&&(j+=" form-control-lg",k+=` ${zt.large}`),A.jsxs("div",{className:k,children:[A.jsxs("label",{className:e.labelClassName,htmlFor:"school-input",children:["School",e.required&&A.jsx("span",{className:"text-danger",children:"*"})]}),A.jsx(Bs,{id:"school-input",value:o,onChange:D=>v(D.currentTarget.value),ref:r,className:j,type:"text",autoComplete:"off",placeholder:e.placeholder||"Select your school below",disabled:e.disabled,autoFocus:!0,onClickClear:y,onKeyDown:f,onFocus:S,onBlur:E}),A.jsx("div",{className:`position-absolute z-1 w-100 ${zt.dropdown} ${_?"d-none":""}`,children:A.jsxs("div",{className:`${zt.suggestionContainer} ${O?"":"d-none"}`,ref:c,children:[m?A.jsx(Mte,{filteredSchoolsList:u,onSchoolSuggestionClick:x,getSchoolName:T,selectedIndex:h}):b&&A.jsx("div",{className:`${zt.suggestionLoading} py-4 d-flex justify-content-center`,children:A.jsx(G_,{animation:"border"})}),!b&&I&&A.jsx(Ute,{selected:h===u.length+1,handleNoSuggestion:()=>{e.onClickNoSuggestions(o)}})]})})]})}function Bte(e){return(e==null?void 0:e.toLowerCase())==="au"?"Enter your school postcode or suburb":(e==null?void 0:e.toLowerCase())==="us"?"Enter your school ZIP code or city":(e==null?void 0:e.toLowerCase())==="ca"?"Enter your school postal code or city":"Enter your school postcode or city"}function $te(e){var j;const{email:r,userType:t}=e,[a,o]=je.useState({schoolLocality:e.schoolLocality,country:e.country,longitude:e.longitude,latitude:e.latitude,city:e.city,province:e.province,prospectId:e.prospectId,schoolName:e.schoolName,schoolType:e.schoolType,schoolPostCode:e.schoolPostCode}),[s,u]=je.useState(e.trialStatus),[p,d]=je.useState(),[h,f]=je.useState(!1),[c,_]=je.useState(!1),[E,S]=je.useState(!1),w=qte({...e,prospectStatus:s,loading:h,data:a,canSubmitForm:b,setSubmissionError:d,logStepEvent:I,setLoadingState:m,setProperty:v});function R(){return!!(a&&a.schoolLocality&&a.longitude&&a.latitude)}function b(){if(!a||!r||!t)return!1;const{prospectId:k}=a;return!!(r&&t&&k)}function I(){const k={actionType:sn.Click,descriptor:Yt.FindSchool,workflowPhase:Ma.Next};e.logUserAction(a||{},k)}function m(k){_(k),S(k),f(k)}function v(k,N){k==="prospectId"&&N&&(f(!0),mo.checkProspectTrialStatus(e.ajaxUrls,{prospectId:N.toString(),email:e.email},D=>{u(D.status)},()=>{console.log("error")},()=>{f(!1)})),o(D=>({...D,[k]:N}))}function y(){v("schoolLocality",void 0),v("longitude",void 0),v("latitude",void 0),v("city",void 0),v("province",void 0),v("country",void 0),g()}function g(){v("prospectId",void 0),v("schoolName",""),v("schoolPostCode",void 0),d(void 0)}function x(k){e.nextStep({step:"cant-find-school",prospectId:a.prospectId,schoolName:k,schoolLocality:a.schoolLocality,longitude:a.longitude,latitude:a.latitude,country:a.country,city:a.city,province:a.province}),e.logUserAction({},{actionType:sn.Click,descriptor:Yt.CantFindSchool,workflowPhase:Ma.Next})}function T(k){v("prospectId",k.prospectId),v("schoolName",k.schoolName),v("schoolPostCode",k.schoolPostCode),v("schoolType",k.schoolType),v("province",k.province),v("city",k.city),v("country",k.country)}function O(k){const{longitude:N,latitude:D,schoolLocality:F,country:$,city:V,province:G}=k;N&&v("longitude",N),D&&v("latitude",D),$&&v("country",$),V&&v("city",V),G&&v("province",G),F&&v("schoolLocality",F)}return A.jsxs(A.Fragment,{children:[A.jsxs("div",{className:"text-center",children:[A.jsx("h1",{className:"h4",children:"Let's find your school"}),A.jsx("p",{children:Bte((j=e.geoLocation)==null?void 0:j.countryCode)})]}),A.jsx(mF,{data:a,setData:O,clearData:y,disabled:c,geoLocation:e.geoLocation,labelClassName:"d-none",logUserAction:e.logUserAction,googleMapsApiKey:e.googleMapsApiKey,autoFocus:!0,size:"lg",useGeoLocationApi:!0}),R()&&A.jsx(Fte,{data:a,setData:T,clearData:g,disabled:E,searchUrl:e.ajaxUrls.searchProspect,onClickNoSuggestions:x,size:"lg",labelClassName:"d-none"}),p&&A.jsx("p",{className:"text-danger mb-2",children:p}),b()&&A.jsx(zf,{className:"btn-lg w-100",variant:"dark",onClick:w,showSpinner:c||E||h,disabled:c||E||h,children:"Get started"})]})}const kD=["38A2E8","7A76E8","40BCC3","F7847B"];function zte(e){const[r,t]=je.useState(null);function a(s){if(!s)return;const u=window.location.pathname+window.location.search;window.location.href=`/challenge?idp=${s.id}&redirectUrl=`+encodeURIComponent(u)}function o(){e.logUserAction({},{actionType:sn.Click,workflowPhase:Ma.Next,descriptor:Yt.SkipIdpSelect}),e.nextStep({step:"find-school",email:e.email,userTrialStatus:e.userTrialStatus})}return A.jsxs(A.Fragment,{children:[A.jsxs("div",{className:"text-center",children:[A.jsx("h1",{className:"h4",children:"Does your school already have ClickView?"}),A.jsx("p",{children:"Find your school from the list below"})]}),e.idps.length>4?A.jsxs(A.Fragment,{children:[A.jsx(Sl,{id:"idp",item:r,items:e.idps,onSelect:t,getName:s=>s.name,clearData:()=>t(null),placeholder:"Select a school",size:"lg"}),A.jsx("button",{className:"btn btn-lg btn-dark w-100 mb-3",disabled:!r,onClick:()=>a(r),children:"Continue"})]}):e.idps.map((s,u)=>A.jsx("button",{className:"btn btn-lg w-100 mb-3",onClick:()=>a(s),style:{backgroundColor:`#${kD[u%kD.length]}`,color:"#FFF"},children:s.name},u)),A.jsx("button",{className:"btn btn-link text-info w-100 no-sso-link",onClick:o,children:"My school does not have ClickView"})]})}const Zte="_userTypeOption_egazo_1",Hte="_selected_egazo_8",Vte="_mobileButtons_egazo_13",db={userTypeOption:Zte,selected:Hte,mobileButtons:Vte};function PD(e){return A.jsxs(A.Fragment,{children:[A.jsxs(Zo,{className:`
|
|
66
66
|
d-flex
|
|
67
67
|
flex-column
|
|
68
68
|
justify-content-between
|
|
@@ -75,4 +75,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
75
75
|
d-md-block
|
|
76
76
|
d-none
|
|
77
77
|
${db.userTypeOption} ${e.selected?db.selected:""}`,onClick:()=>e.onClick(e.type),children:[A.jsx("img",{src:e.imageSrc,className:"rounded-top mx-auto pb-2 w-100"}),A.jsx("div",{className:"py-2",children:A.jsx("span",{className:"h4",children:e.buttonText})})]}),A.jsx(Zo,{className:`btn btn-lg btn-outline-dark w-100 d-md-none d-block mx-auto ${db.mobileButtons}`,onClick:()=>e.onClick(e.type),children:e.buttonText})]})}function Gte(e){function r(t){if(e.logUserAction({userType:t},{actionType:sn.Click,workflowPhase:Ma.Next,descriptor:t===In.Staff?Yt.Educator:Yt.Student}),t===In.Staff){e.nextStep({step:"enter-email",userType:t});return}e.nextStep({step:"enter-age",userType:t})}return A.jsxs("div",{className:"text-center",children:[A.jsx("h1",{className:"h4",children:"Access educational videos at your fingertips"}),A.jsx("p",{className:"mb-3",children:"Sign up for instant access to class-ready videos and worksheets."}),A.jsxs("div",{className:"row",children:[A.jsx("div",{className:"col-lg-6 mb-3",children:A.jsx(PD,{type:In.Staff,buttonText:"I'm an educator",imageSrc:e.imageUrls.educator,onClick:r,selected:e.userType===In.Staff})}),A.jsx("div",{className:"col-lg-6 mb-3",children:A.jsx(PD,{type:In.Learner,buttonText:"I'm a student",imageSrc:e.imageUrls.student,onClick:r,selected:e.userType===In.Learner})})]})]})}const Wte={"select-type":Gte,"enter-email":Ote,"find-school":$te,"cant-find-school":Yre,completed:pte,"add-to-braze":Ere,"enter-age":wte,"request-access":Pte,"request-bdm-trial":jte,"select-idp":zte};function Kte(e){const{state:r,geoLocation:t,layout:a,hasPreviousStep:o,googleMapsApiKey:s,pageAppLinkString:u,back:p,nextStep:d,complete:h,logUserAction:f,logBrazeEvent:c,imageUrls:_,ajaxUrls:E,productName:S,getSignInUrl:w,globalIdps:R,createOrUpdateProfile:b}=e,I=Wte[r.currentStepId],m={...r,geoLocation:t,googleMapsApiKey:s,pageAppLinkString:u,back:p,nextStep:d,complete:h,logUserAction:f,imageUrls:_,ajaxUrls:E,productName:S,getSignInUrl:w,logBrazeEvent:c,globalIdps:R,createOrUpdateProfile:b},v=a;if(!v)return A.jsx(I,{...m});const y=ire.last(e.state.previousStepIds)==="completed";return A.jsx(v,{geoLocation:e.geoLocation,currentStep:r.currentStepId,previousStep:p,closeApp:e.close,logUserAction:f,hasPreviousStep:o,showBackButton:!y,imageUrls:e.imageUrls,getSignInUrl:w,children:A.jsx(I,{...m})})}const Yte=["email","longitude","latitude","trialCreated","idps"],Jte={filterBlacklistedKeys(e){const r={...e};return Yte.forEach(t=>delete r[t]),r}};function Xte(e){const r=[...e.previousStepIds],t=r.pop();return{...e,previousStepIds:r,currentStepId:t}}function Qte(e){return Object.entries(e).filter(([,r])=>r!==null).reduce((r,[t,a])=>({...r,[t]:a}),{})}function ene(e,r){const t={...e,previousStepIds:[...e.previousStepIds,e.currentStepId],currentStepId:r.step};if(r.step==="select-type")return{...t};if(r.step==="enter-email"||r.step==="enter-age")return{...t,userType:r.userType};if(r.step==="select-idp")return{...t,email:r.email,userTrialStatus:r.userTrialStatus,idps:r.idps};if(r.step==="find-school")return{...t,email:r.email,userTrialStatus:r.userTrialStatus};if(r.step==="cant-find-school")return{...t,prospectId:r.prospectId,schoolName:r.schoolName,schoolLocality:r.schoolLocality,country:r.country,longitude:r.longitude,latitude:r.latitude,city:r.city,province:r.province};if(r.step==="add-to-braze"||r.step==="completed"||r.step==="request-access"||r.step==="request-bdm-trial"){let a={...r};return delete a.type,delete a.step,a=Qte(a),{...t,...a}}}function rne(e,r){switch(r.type){case"nextStep":return ene(e,r);case"back":return Xte(e)}}const tne=({location:e,initialValues:r,onStepUpdate:t,externalLogUserAction:a})=>{const o=Kt.removeEmptyKeys(r),s={currentStepId:"select-type",previousStepIds:[],...o},[u,p]=je.useReducer(rne,s);je.useEffect(()=>{t==null||t(u)},[u.currentStepId]);function d(){p({type:"back"})}function h(_){p({type:"nextStep",..._})}function f(_){p({type:"nextStep",step:"completed",..._})}function c(_,E){const S={...u,..._},w=Jte.filterBlacklistedKeys(S),R={currentStepId:u.currentStepId,...w},b=Object.entries(R).filter(([,I])=>I!==void 0).reduce((I,[m,v])=>({...I,[m]:v}),{});a(b,{entity:tF.SignUp,location:e,...E})}return{state:u,back:d,nextStep:h,complete:f,hasPreviousStep:!!u.previousStepIds.length,logUserAction:c}},nne={statusImages:{available:"/images/sign-up/available-v2.png",active:"/images/sign-up/active-v2.png",expired:"/images/sign-up/expired-v2.png",notRequired:"/images/sign-up/active-v2.png",unavailable:"/images/sign-up/unavailable-v2.png",unsupported:"/images/sign-up/unavailable-v2.png",autoJoin:"/images/sign-up/active-v2.png",requestAccess:"/images/sign-up/active-v2.png"}};function ane(e){var E;const r={currentStepId:"find-school",previousStepIds:[],email:e.email,userType:In.Staff},t=(E=e.geoLocation)!=null&&E.countryCode?e.geoLocation:{countryCode:Ze.US,isFallback:!0},{complete:a,...o}=tne({location:nF.AuthProspectSelect,initialValues:r,externalLogUserAction:f}),[s,u]=je.useState(null);je.useEffect(()=>{vt.get("/ajax/config").then(S=>u(S))},[]);const p=je.useMemo(()=>{if(!s)return null;const S={cvApSoutheast1:s.analytics[pn.CvApSoutheast1].collectionApi,cvApSoutheast2:s.analytics[pn.CvApSoutheast2].collectionApi,cvEuWest1:s.analytics[pn.CvEuWest1].collectionApi,cvNaWest1:s.analytics[pn.CvNaWest1].collectionApi};return new are({productName:"auth.web",productVersion:s.version,regionName:Zt.getRegionName(t==null?void 0:t.countryCode),collectionApiUrls:S,collectionApiClientId:"cv_auth",getUser:()=>null,logAttributionData:!0,logUtmParameters:!0})},[s]),d=je.useMemo(()=>{if(!(s!=null&&s.braze))return null;const S=s.braze[Zt.getRegionName(t==null?void 0:t.countryCode)];return new Tl.BrazeClient({apiOptions:{apiKey:S.apiKey,baseUrl:S.url,productName:"auth.web",productVersion:s.version,allowUserSuppliedJavascript:!1,automaticallyShowInAppMessages:!1}})},[s]);Iee({additionalData:e.additionalData});function h(S){var I;if(!d)return;const w=bi.getDecodedAttributionData(),R=((I=S.event)==null?void 0:I.additionalData)||{};w!=null&&w.originalReferrer&&(R.original_referrer=w.originalReferrer),w!=null&&w.internalReferrer&&(R.internal_referrer=w.internalReferrer);const b={...S.event,additionalData:R};d.setUserInit(S.user),d.event.log(b)}function f(S,w){p==null||p.log({type:w.actionType,data:S,actionContext:{productArea:"prospect_select",entity:w.entity,location:w.location,descriptor:w.descriptor,workflowPhase:w.workflowPhase},eventVersion:w.eventVersion||aF.V1})}function c(S){if(!S.trialCreated){a(S);return}vt.post("/ajax/login/select-customer",{customerId:S.customerId,returnUrl:e.returnUrl}).then(w=>Pt(w,e))}if(!s)return A.jsx(A.Fragment,{});const _={...o,complete:c,googleMapsApiKey:s.googleMapsApiKey,ajaxUrls:Tee(s.gatewayApi),imageUrls:nne,geoLocation:t,productName:La.Auth,getSignInUrl:()=>"",logBrazeEvent:h};return A.jsxs(A.Fragment,{children:[A.jsx(yt,{theme:e.theme}),A.jsx(Kte,{..._})]})}function ine(e){return A.jsxs("div",{className:"text-center",children:[A.jsx(yt,{theme:e.theme}),A.jsx("img",{className:"img-fluid mb-4",alt:"error",src:"/images/errors/email-not-allowed-v2.png"}),A.jsx("h1",{className:"h2 mb-3",children:"Oops! Make sure to use your school email address"}),A.jsx("p",{className:"mb-3",children:"This includes the email you use to sign in to Google or Microsoft."}),A.jsx("a",{href:e.liteUrl+"sign-up",className:"btn btn-lg btn-dark w-100 text-decoration-none",children:"Try again"})]})}const _F={username:pW,"username-input":oK,"username-or-guest":sK,"guest-selection":TK,password:NK,"select-idp":jK,error:rY,"verify-email":LK,"verify-email-check-code":zK,"verify-email-link-success":ZK,"verify-email-skip-reason":iY,"forgot-password":HK,"forgot-password-check-code":VK,"reset-password":WK,"change-password":KK,"self-activation":YK,"self-activation-check-code":JK,"verify-email-link-email-in-use":nY,"verify-email-code-email-in-use":aY,logout:oY,loggedout:sY,"activate-user":mQ,"select-customer":TQ,"trial-expired":PQ,"link-account":gee,"link-account-code":mee,invite:See,"invite-success":wee,"select-user-type":Cee,"prospect-select":ane,"email-not-allowed":ine,"organisation-select-customer":uY,"contact-support":eY};function one(e,r){if(r.type!=="navigate")return e;const t=Object.keys(r.data).reduce((a,o)=>{if(o!=="bannerType")return r.data[o]!==void 0&&(a={...a,[o]:r.data[o]}),a},{});return r.data.clearUsername&&(t.username=void 0,t.clearUsername=void 0),{...e,...t}}function sne(e,r){return r.type!=="setBanner"?e:{...e,bannerType:r.data.bannerType}}function une(e,r){switch(r.type){case"navigate":return one(e,r);case"setBanner":return sne(e,r)}}const lne="_footer_psbd8_1",cne={footer:lne};function fne(e){return A.jsx("div",{className:"text-center p-2 text-secondary small",children:A.jsxs("ul",{className:"d-flex flex-wrap list-unstyled justify-content-center",children:[A.jsx("li",{children:A.jsxs("span",{children:["2003 - ",new Date().getFullYear()," © ClickView Pty Limited"]})})," | ",A.jsx("li",{children:A.jsx("a",{href:e.privacyPolicyUrl,className:"text-secondary",children:A.jsx("strong",{children:"Privacy Policy"})})})," | ",A.jsx("li",{children:A.jsx("a",{href:e.termsAndConditionsUrl,className:"text-secondary",children:A.jsx("strong",{children:"Terms and Conditions"})})})," | ",A.jsx("li",{children:A.jsx("span",{children:e.version})})]})})}function dne(e){return A.jsx("footer",{className:cne.footer,children:A.jsx(fne,{...e})})}function hne(){return A.jsx("svg",{viewBox:"0 0 434 71",children:A.jsxs("g",{children:[A.jsx("path",{fill:"#000000",d:"M114.44 56.57l3.5 3.5a32.87 32.87 0 0 1-25.16 11.26c-19.63 0-33.62-15.54-33.62-35.16C59.16 16.55 73.16 1 92.78 1a32.31 32.31 0 0 1 24.19 10.4l-3.6 3.3a27.32 27.32 0 0 0-20.59-8.74c-16.91 0-28.39 13.5-28.39 30.21s11.48 30.21 28.39 30.21a28.08 28.08 0 0 0 21.66-9.81zM126.64 1h4.55v70.22h-4.73L126.64 1zm17.3 10.6a3.7 3.7 0 1 1 0 7.4 3.7 3.7 0 0 1 0-7.4zm-2.41 15.07h4.81v44.56h-4.81V26.67zm48 33.15l3.33 3.15a21.8 21.8 0 0 1-17.31 8.61c-12.59 0-21.76-10-21.76-22.22 0-12.22 9.17-22.22 21.76-22.22a21.84 21.84 0 0 1 16.85 8l-3.43 3.06a17.15 17.15 0 0 0-13.42-6.3c-10.09 0-16.76 8.15-16.76 17.5s6.67 17.5 16.76 17.5a17.38 17.38 0 0 0 13.98-7.08zm14.99-9.33v20.74h-4.73V1.01h4.73v47.75l20.74-19.02h6.64l-21.56 19.84L234 71.23h-7.01l-22.47-20.74z"}),A.jsx("path",{fill:"#F8981D",d:"M304.09 19.4a5.56 5.56 0 1 1 0-11.12 5.56 5.56 0 0 1 0 11.12zm-5.56 7.27h11.11v44.56h-11.11V26.67zm61.42 22.15c0 .81 0 2.42-.09 4h-31.75c.8 3.77 5.2 8.61 11.93 8.61a17.11 17.11 0 0 0 11.66-4.31l5.38 8.16a27.23 27.23 0 0 1-17 6.1c-12.92 0-22.88-9.87-22.88-22.34s9.06-22.33 21.35-22.33c11.62-.04 21.4 9.02 21.4 22.11zm-10.77-3.76c-.18-3.68-3.58-8.62-10.67-8.62-6.91 0-10.05 4.85-10.4 8.62h21.07zM385.92 71h-6.42l-19.64-44.37h13.97l9.16 23.98 9.72-23.98h8.31l9.63 23.98 9.16-23.98h13.97L414.24 71h-6.52l-10.85-23.7L385.92 71zm-120.22.35h-6L226.11 1.01h17.01l19.42 44.18 18.08-44.18h16.91L265.7 71.35zM0 1l41 35L0 71V1z"})]})})}var Bo=(e=>(e[e.Audience=1]="Audience",e[e.Category=2]="Category",e[e.Channel=3]="Channel",e[e.Chapter=4]="Chapter",e[e.Comment=5]="Comment",e[e.OwnerComment=6]="OwnerComment",e[e.Image=7]="Image",e[e.Thumbnail=8]="Thumbnail",e[e.Avatar=9]="Avatar",e[e.Banner=10]="Banner",e[e.Video=11]="Video",e[e.Trailer=12]="Trailer",e[e.Rating=13]="Rating",e[e.Topic=14]="Topic",e[e.Series=15]="Series",e[e.Season=16]="Season",e[e.HostedMediaObjectCollection=17]="HostedMediaObjectCollection",e[e.ExchangeCollection=18]="ExchangeCollection",e[e.CustomMediaObjectCollection=19]="CustomMediaObjectCollection",e[e.Playlist=20]="Playlist",e[e.ClickViewTvCollection=21]="ClickViewTvCollection",e[e.ClickViewProductionsCollection=22]="ClickViewProductionsCollection",e[e.User=23]="User",e[e.SystemUser=24]="SystemUser",e[e.Customer=25]="Customer",e[e.Country=26]="Country",e[e.Organisation=28]="Organisation",e[e.SystemOrganisation=29]="SystemOrganisation",e[e.Group=30]="Group",e[e.SystemGroup=31]="SystemGroup",e[e.FlagReason=32]="FlagReason",e[e.Library=33]="Library",e[e.Interactive=34]="Interactive",e[e.WorkspaceCollection=35]="WorkspaceCollection",e[e.Conversation=36]="Conversation",e[e.Message=37]="Message",e[e.Notification=38]="Notification",e[e.Clip=39]="Clip",e[e.Link=40]="Link",e[e.UserChannel=41]="UserChannel",e[e.Resource=42]="Resource",e[e.VideoStream=43]="VideoStream",e[e.AudioStream=44]="AudioStream",e[e.Tag=45]="Tag",e[e.Subtitle=46]="Subtitle",e[e.LicencedContentCollection=47]="LicencedContentCollection",e[e.PublicCollection=48]="PublicCollection",e[e.CategoryTree=49]="CategoryTree",e[e.Logo=50]="Logo",e[e.Permission=51]="Permission",e[e.Subject=52]="Subject",e[e.Field=53]="Field",e[e.Company=54]="Company",e[e.Person=55]="Person",e[e.Cover=56]="Cover",e[e.Poster=57]="Poster",e[e.SubjectAudience=58]="SubjectAudience",e[e.TallPoster=60]="TallPoster",e[e.Classroom=67]="Classroom",e[e.ClassroomGroup=68]="ClassroomGroup",e[e.UserProfile=74]="UserProfile",e))(Bo||{});const vne="_left_1r3w0_1",pne="_leftWithImage_1r3w0_10",gne="_bgCover_1r3w0_14",mne="_bgFull_1r3w0_17",yne="_right_1r3w0_20",bne="_rightContent_1r3w0_28",_ne="_narrowContent_1r3w0_34",Sne="_logo_1r3w0_37",wne="_buttonContainer_1r3w0_43",Ene="_blur_1r3w0_53",Cne="_imageContainer_1r3w0_65",xne="_imagePosition_1r3w0_73",Ine="_image_1r3w0_65",Ane="_thumbnail_1r3w0_87",Tne="_tallposter_1r3w0_90",Rne="_cover_1r3w0_96",One="_contentBody_1r3w0_102",kne="_contentBodyBase_1r3w0_106",Dt={left:vne,leftWithImage:pne,bgCover:gne,bgFull:mne,right:yne,rightContent:bne,narrowContent:_ne,logo:Sne,buttonContainer:wne,blur:Ene,imageContainer:Cne,imagePosition:xne,image:Ine,thumbnail:Ane,tallposter:Tne,cover:Rne,contentBody:One,contentBodyBase:kne};function Pne(e){switch(e){case Bo.Video:case Bo.Interactive:case Bo.Clip:return Dt.thumbnail;case Bo.Subject:case Bo.Playlist:return Dt.cover;case Bo.Series:return Dt.tallposter;default:return""}}function An(e){return A.jsx("div",{className:"d-flex",children:e.children})}function Nne(e){return A.jsx("div",{className:`${Dt.left} ${e.className?e.className:""}`,children:e.children})}function jne(e){const[r,t]=je.useState(!1),[a,o]=je.useState("");return je.useEffect(()=>{if(!e.imageUrl){const u=e.fallbackImages[Math.floor(Math.random()*e.fallbackImages.length)];o(u.bgUrl);return}const s=new Image;return s.onload=()=>t(!0),s.src=e.imageUrl,()=>s.onload=null},[e.imageUrl]),A.jsx("div",{className:`${Dt.left} ${Dt.leftWithImage} ${Dt.bgCover} bg-light`,style:{backgroundImage:a?`url('${a}')`:""},children:r&&A.jsxs(A.Fragment,{children:[A.jsx("div",{className:Dt.blur,style:{backgroundImage:`url('${e.imageUrl}')`}}),A.jsx("div",{className:`${Dt.imageContainer} ${Pne(e.objectType)}`,children:A.jsx("div",{className:Dt.imagePosition,children:A.jsx("img",{className:Dt.image,src:e.imageUrl,alt:e.title})})})]})})}function qne(e){const[r,t]=je.useState("");return je.useEffect(()=>{const a=e.images[Math.floor(Math.random()*e.images.length)];t(a.bgUrl)},[]),A.jsx("div",{className:`${Dt.left} bg-blue d-flex align-items-center`,children:r&&A.jsx("img",{className:"img-fluid",src:r,draggable:!1})})}const Dne={cover:Dt.bgCover,full:Dt.bgFull};function Lne(e){const r={backgroundImage:e.imageUrl?`url("${e.imageUrl}")`:""};return e.backgroundColor&&(r.backgroundColor=e.backgroundColor),A.jsx("div",{className:`${Dt.left} ${Dt.leftWithImage} ${Dne[e.imageSize||"cover"]} d-flex align-items-center`,style:r,title:e.title})}function Mne(e){return A.jsx("div",{className:`${Dt.right} ${e.className?e.className:""}`,children:e.children})}function Une(e){var t;const r=(e==null?void 0:e.logoComponent)||hne;return A.jsxs("div",{className:"position-relative",children:[!!e.bannerComponent&&e.bannerComponent,A.jsx("div",{className:ri(Dt.logo,"position-absolute",(t=e.className)==null?void 0:t.logoContainer),children:A.jsx(r,{})}),e.children]})}function Fne(e){return A.jsx("div",{className:ri(Dt.rightContent,"d-flex flex-column justify-content-center h-100",e==null?void 0:e.className),children:e.children})}const Bne={base:Dt.contentBodyBase,full:""};function $ne(e){const r=Bne[e.width||"base"];return A.jsx("div",{className:ri(Dt.contentBody,r,"m-auto p-3",e.className),children:e.children})}An.NarrowContent=zne;function zne(e){return A.jsx("div",{className:`${Dt.narrowContent} mx-auto w-100 ${e.className?e.className:""}`,children:e.children})}function Zne(e){return A.jsx("div",{className:ri("position-fixed bg-white d-flex align-items-center",Dt.buttonContainer,e==null?void 0:e.className),children:e.children})}An.Left=Nne;An.LeftImage=jne;An.LeftProductImage=qne;An.LeftImageWithBackground=Lne;An.Right=Mne;An.Header=Une;An.Content=Fne;An.ContentBody=$ne;An.Buttons=Zne;function Hne(){function e(t){t.key==="Tab"&&(document.body.classList.add("user-is-tabbing"),window.removeEventListener("keydown",e),window.addEventListener("mousedown",r))}function r(){document.body.classList.remove("user-is-tabbing"),window.removeEventListener("mousedown",r),window.addEventListener("keydown",e)}Nr.useEffect(()=>(window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)),[])}const Vne="_full_vw1kz_1",Gne="_themeBannerClearance_vw1kz_9",ND={full:Vne,themeBannerClearance:Gne};function Wne(e){return e.imageType==="background"?A.jsx(An.LeftImageWithBackground,{imageUrl:e.imageUrl}):e.imageType==="image"?A.jsx(An.LeftImageWithBackground,{imageUrl:e.imageUrl,imageSize:"full",backgroundColor:e.backgroundColor,title:e.title}):A.jsx(A.Fragment,{})}function Kne(e){var I,m;const{children:r,footer:t,bannerType:a,theme:o}=e,[s,u]=Nr.useState(null);Hne();const{imageUrls:p,imageType:d,backgroundColor:h,banner:f,title:c,logoComponent:_,bannerSpacer:E}=Ba.getDefinition(o),S=p[(m=(I=e.geoLocation)==null?void 0:I.countryCode)==null?void 0:m.toLowerCase()]||p.default;Nr.useEffect(()=>{const v=Math.floor(Math.random()*S.length);u(S[v])},[]);const w=d!=="none",R=!!a,b=["plugin"].includes(a);return A.jsxs(An,{children:[w&&A.jsx(Wne,{title:c,imageUrl:s,imageType:d,backgroundColor:h}),A.jsxs(An.Right,{className:ri(!w&&ND.full),children:[A.jsx(An.Header,{bannerComponent:!!f&&A.jsx(G9,{bannerType:f}),logoComponent:_,className:{logoContainer:!!f&&ND.themeBannerClearance}}),A.jsxs(An.Content,{className:ri(!w&&"px-0 w-100","pb-0"),children:[!b&&A.jsx(G9,{bannerType:a}),A.jsxs(An.ContentBody,{children:[r,!b&&R&&A.jsx(E,{})]}),A.jsx(dne,{...t})]})]})]})}function Yne(e){const{step:r,returnUrl:t,data:a={},footer:o,geoLocation:s,theme:u,additionalData:p}=e,[d,h]=Nr.useReducer(une,{step:r,returnUrl:t,geoLocation:s,theme:u,additionalData:p,...a});function f(_){h({type:"navigate",data:_})}const c=_F[d.step];return c||Pt({step:r,data:a},null),A.jsxs(A.Fragment,{children:[A.jsx(Kne,{footer:{...o,...d},bannerType:d.bannerType,step:r,theme:u,geoLocation:s,children:!!c&&A.jsx(c,{navigate:f,dispatch:h,...d})}),!1]})}function Jne(e){var c;const{id:r,returnUrl:t,footer:a,region:o,config:s,theme:u,additionalData:p}=e,d=e.currentStep||{},h=document.getElementById(r);dW.createRoot(h).render(A.jsx(Yne,{returnUrl:t,step:d.step,data:{...s,...d.data},footer:a,geoLocation:o,theme:((c=d.data)==null?void 0:c.theme)||u,additionalData:p}))}window.cvauth={start:Jne};
|
|
78
|
-
//# sourceMappingURL=index-
|
|
78
|
+
//# sourceMappingURL=index-FTRPVE6X.js.map
|