PageSourceSearch

https://www.comptia.org/_next/static/chunks/442-b86ad5fd9812a6ec.js

js comptia.org collected 2026-09-24 07:51:07 UTC 16,001 bytes, 22 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[442],{189:(e,t,r)=>{r.d(t,{fI:()=>_,cn:()=>c,Tc:()=>M,e8:()=>m,KW:()=>E,EG:()=>P,tL:()=>A,Dj:()=>a,ip:()=>D,W1:()=>N,Rr:()=>k,HV:()=>l,vb:()=>i,aI:()=>v,xs:()=>L,Y6:()=>b,Bu:()=>x,Jn:()=>w,FK:()=>S,uB:()=>F,hn:()=>y,kZ:()=>h,uJ:()=>f});var n,i,o,a,s,l,c,u=function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function a(e){try{l(n.next(e))}catch(e){o(e)}}function s(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(a,s)}l((n=n.apply(e,t||[])).next())})};class d{constructor(e){this.config=e}send(e,t,r,n,i){return u(this,void 0,void 0,function*(){let o=new URL(`${this.config.baseURL}${e}`,"http://temp");if(r)for(var a in r)o.searchParams.set(a,r[a]);let s={method:t,credentials:"include",headers:null!=n?n:this.config.headers,body:i?JSON.stringify(i):void 0};return new Promise((e,t)=>{fetch(o.href,s).then(r=>u(this,void 0,void 0,function*(){r.ok?e((yield r.json())):t(r)})).catch(e=>{t(e)})})})}get(e,t){return u(this,void 0,void 0,function*(){return new Promise((r,n)=>{this.send(e,"GET",t).then(e=>{r(e)}).catch(e=>{n(e)})})})}post(e,t,r){return u(this,void 0,void 0,function*(){return new Promise((n,i)=>{this.send(e,"POST",r,void 0,t).then(e=>{n(e)}).catch(e=>{i(e)})})})}}let p={baseURL:"/",headers:{"Content-Type":"application/json"}};!function(e){e.apiVersion="v1",e.apiEndpoint="_forms/v1/forms"}(n||(n={}));class m{constructor(e){this.client=new d(Object.assign(Object.assign({},p),e))}getForm(e,t){return new Promise((r,i)=>{this.client.get(`${n.apiEndpoint}/${e}`,{locale:t}).then(e=>{r(e)}).catch(e=>{i(e)})})}queryForm(e,t,r){return new Promise((n,i)=>{fetch(e,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({query:`
2            query FormQuery($key: String, $language: String) {
3                FormContainer(where: { Key: { eq: $key }, Locale: { eq: $language } }) {
4                    items {
5                        Key
6                        Locale
7                        Properties
8                        Localizations
9                        FormElements {
10                            Key
11                            ContentType
12                            DisplayName
13                            Locale
14                            Localizations
15                            Properties
16                            Locale
17                        }
18                    }
19                }
20            }
21            `,variables:{key:t,language:r}})}).then(e=>{var t,r,o,a;return t=this,r=void 0,o=void 0,a=function*(){if(e.ok){let t=(yield e.json()).data.FormContainer.items[0];n(this.convertFirstLetterToLowerCase(t))}else i(e)},new(o||(o=Promise))(function(e,n){function i(e){try{l(a.next(e))}catch(e){n(e)}}function s(e){try{l(a.throw(e))}catch(e){n(e)}}function l(t){var r;t.done?e(t.value):((r=t.value)instanceof o?r:new o(function(e){e(r)})).then(i,s)}l((a=a.apply(t,r||[])).next())})}).catch(e=>{i(e)})})}convertFirstLetterToLowerCase(e){let t="object"==typeof e;return e&&t&&!Array.isArray(e)?Object.keys(e).reduce((r,n)=>(r[n.charAt(0).toLowerCase()+n.slice(1)]=t?this.convertFirstLetterToLowerCase(e[n]):e[n],r),{}):Array.isArray(e)?e.map(e=>this.convertFirstLetterToLowerCase(e)):e}}function f(e){return h(e)||""===e}function h(e){return null==e}function v(e,t,r=!1){return r?e.toLowerCase()===t.toLowerCase():e===t}function g(e){return!isNaN(parseFloat(e))&&isFinite(e)}function y(e,t,r=!1){return r&&(e=e.toLowerCase(),t=t.map(e=>e.toLowerCase())),t.indexOf(e)>-1}function S(e){var t=document.createElement("textarea");return t.innerHTML=e,t.value}function x(e){var t;let r=e.properties,n=null!=(t=null==r?void 0:r.forms_ExternalSystemsFieldMappings)?t:[],i=f(null==r?void 0:r.predefinedValue)?n.length>0?n[0]:void 0:r.predefinedValue,o=e.properties;if(!h(null==o?void 0:o.items)){let e=[];o.items.forEach(t=>t.checked&&e.push(t.value)),e.length>0&&(i=e.join(","))}let a=e.properties;if(!h(null==a?void 0:a.min))if(f(i)||!g(i))i=a.min;else{let e=parseInt(i);i=e>a.max||e<a.min?a.min:e}return i}!function(e){e.RequiredValidator="RequiredValidator",e.EmailValidator="EmailValidator",e.RegularExpressionValidator="RegularExpressionValidator",e.DateDDMMYYYYValidator="DateDDMMYYYYValidator",e.DateMMDDYYYYValidator="DateMMDDYYYYValidator",e.DateYYYYMMDDValidator="DateYYYYMMDDValidator",e.UrlValidator="UrlValidator",e.IntegerValidator="IntegerValidator",e.PositiveIntegerValidator="PositiveIntegerValidator",e.AllowedExtensionsValidator="AllowedExtensionsValidator",e.MaxFileSizeValidator="MaxFileSizeValidator",e.NumericValidator="NumericValidator",e.CaptchaValidator="CaptchaValidator"}(i||(i={})),function(e){e.All="All",e.Any="Any"}(o||(o={})),function(e){e.Show="show",e.Hide="hide"}(a||(a={})),function(e){e.MatchRegularExpression="MatchRegularExpression",e.Contains="Contains",e.NotContains="NotContains",e.Equals="Equals",e.NotEquals="NotEquals"}(s||(s={})),function(e){e.PreviousStep="PreviousStep",e.NextStep="NextStep"}(l||(l={})),function(e){e.FormAccessToken="form_access_token",e.FormFieldPrefix="__field_",e.FormCurrentStep="form_current_step_",e.FormSubmissionId="form_submission_id_"}(c||(c={}));class _{constructor(e){this._storage=null!=e?e:window.sessionStorage}get(e){let t=this._storage[e];if(t&&("object"==typeof t&&(t=JSON.parse(t)),t))return t}set(e,t){try{"object"==typeof t?this._storage.setItem(e,JSON.stringify(t)):this._storage.setItem(e,t)}catch(e){console.log("Local Storage not supported: "+e.message)}return t}remove(e){this._storage.removeItem(e)}}class k{constructor(e){this._tempBaseUrl="http://temp",this._form=e}isAllStepsAreNotLinked(){return!this._form.steps.some(e=>{var t;return!f(null==(t=e.formStep.properties)?void 0:t.attachedContentLink)})}isMalFormSteps(){let e=!1;return this._form.steps.length>=2&&!this.isAllStepsAreNotLinked()&&(e=this._form.steps.some(e=>{var t;return f(null==(t=e.formStep.properties)?void 0:t.attachedContentLink)})),e}getCurrentStepIndex(e){let t=0;return this.isAllStepsAreNotLinked()?t=0:this._form.steps.every((r,n)=>{var i;let o=new URL(null==(i=r.formStep.properties)?void 0:i.attachedContentLink,this._tempBaseUrl);return!v(new URL(null!=e?e:"/",this._tempBaseUrl).pathname,o.pathname)||(t=n,!1)}),t}isInCurrentStep(e,t){let r=this._form.steps[t];return!r||r.elements.some(t=>v(t.key,e))}getFirstInvalidElement(e,t){var r;return null==(r=e.filter(e=>
21!e.result.valid&&this.isInCurrentStep(e.elementKey,t))[0])?void 0:r.elementKey}isNeedCheckDependCondition(e){var t,r,n;let i=null==(t=this._form.steps[e])?void 0:t.formStep;return!h(i)&&!f(null==(n=null==(r=i.properties)?void 0:r.dependField)?void 0:n.key)}getFirstInputElement(e,t){var r;let n=this._form.steps[e].elements.find(e=>e.contentType.indexOf("ElementBlock")>0&&0>t.indexOf(e.key));return null!=(r=null==n?void 0:n.key)?r:""}}class E{constructor(e){this._form=e}getStorage(){return window.sessionStorage}saveFormDataToStorage(e){let t=this.getStorage();try{t.setItem(this._form.key,JSON.stringify(e))}catch(e){console.log("Local Storage not supported: "+e.message)}return e}loadFormDataFromStorage(){let e=this.getStorage()[this._form.key];return e&&(e=JSON.parse(e))?e:[]}removeFormDataInStorage(){this.getStorage().removeItem(this._form.key)}}function F(e,t,r){var n;let i=new E(e).loadFormDataFromStorage(),o=new _,a=new k(e),s=[],l=[],u=[],d=[];null==(n=e.steps)||n.forEach(e=>{e.elements.forEach(t=>{t.key!=e.formStep.key&&(l=l.concat({elementKey:t.key,result:{valid:!0,message:""}}),s=s.concat({elementKey:t.key,value:x(t)}),d=d.concat({elementKey:t.key,isSatisfied:!0,sastisfiedAction:t.properties.satisfiedAction}))}),u=u.concat({elementKey:e.formStep.key,isSatisfied:!1})}),i.length>0&&(s=s.map(e=>i.find(t=>
21v(t.elementKey,e.elementKey))||e));let p=o.get(c.FormCurrentStep+e.key);return{isReset:!1,focusOn:"",dependencyInactiveElements:[],currentStepIndex:f(p)?a.getCurrentStepIndex(t):parseInt(p),formSubmissions:s,formValidationResults:l,stepDependencies:u,formContainer:e,history:r,elementDependencies:d}}let C=["FormStepBlock","SubmitButtonElementBlock","PredefinedHiddenElementBlock","ParagraphTextElementBlock"];function w(e){var t;let r=null!=(t=e.value)?t:"";if(Array.isArray(r)&&r.length>0&&null!==r[0]&&"object"==typeof r[0]){let e=r.length,t="";for(let n=0;n<e;n++)t+=`${r[n].name}`,e>1&&n!=e-1&&(t+=" | ");return t}return r}function b(e,t,r,n,i){let o="",a=null!=i?i:C;return e.forEach(e=>{let i=function(e,t,r){let n=null;for(let i=0;i<=r;i++)for(let r of t.steps[i].elements)if(r.key==e){n=r;break}return n}(e.elementKey,t,r),s=w(e);i&&-1===a.indexOf(i.contentType)&&-1===n.indexOf(i.key)&&!f(s)&&(o+=`${i.displayName}: ${s}
22`)}),o}let V=["TextboxElementBlock","TextareaElementBlock","NumberElementBlock","RangeElementBlock","UrlElementBlock","ImageChoiceElementBlock","SelectionElementBlock","ChoiceElementBlock"];function L(e,t){let r=V;return e&&(r=[...e,...V]),t&&r.filter(e=>!t.includes(e)),r}class D{constructor(e){this._form=e}buildForm(){let e=[],t=[],r={key:"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){let t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)})};return this._form.formElements.forEach((n,i)=>{this.isFormStep(n)&&(0!==i&&e.push({formStep:Object.assign({},r),elements:[...t]}),t=[],r=Object.assign({},n)),t.push(n)}),e.push({formStep:Object.assign({},r),elements:[...t]}),Object.assign(Object.assign({},this._form),{steps:e})}isFormStep(e){return v(e.contentType,"FormStepBlock")}}function Y(e,t){return e instanceof Array?e.join(t):e}let I={[s.Contains]:function(e,t){let r=h(e)?"":Y(e.toString(),",").toLocaleUpperCase();return t=t?t.toLocaleUpperCase():"",r.indexOf(t)>=0},[s.NotContains]:function(e,t){let r=e?Y(e.toString(),",").toLocaleUpperCase():"",n=f(r),i=f(t);return!n&&i||n&&!i||!n&&!i&&0>r.indexOf(t.toLocaleUpperCase())},[s.Equals]:function(e,t){return(f(e)?"":Y(e.toString(),",").toLocaleUpperCase())===(t=t?t.toLocaleUpperCase():"")},[s.NotEquals]:function(e,t){return(e?Y(e.toString(),",").toLocaleUpperCase():"")!==(t=t?t.toLocaleUpperCase():"")},[s.MatchRegularExpression]:function(e,t){var r=RegExp(t,"igm");let n=e?Y(e.toString(),","):"";return f(t)||!f(t)&&r.test(n)}};class N{constructor(e,t){this._tempBaseUrl="http://temp",this._form=e,this._formStorage=new E(e),this._inactiveElements=t,this._stepHelper=new k(e)}isSatisfied(e){var t,r,n;let i=null==(t=this._form.steps[e])?void 0:t.formStep;if(!i)return!1;let o=null==(r=i.properties)?void 0:r.dependField,a=this._formStorage.loadFormDataFromStorage().find(e=>e.elementKey===(null==o?void 0:o.key)),s=I[null==(n=i.properties)?void 0:n.dependCondition];return!o||!s||!a||(!o&&y(o,this._inactiveElements)?s(null,i.properties.dependValue):s(null==a?void 0:a.value,i.properties.dependValue))}findNextStep(e){let t=e+1;return this._form.steps[t]?this.isSatisfied(t)?t:this.findNextStep(t):this._form.steps.length-1}findPreviousStep(e){let t=e-1;if(this._form.steps[t])return this.isSatisfied(t)?t:this.findPreviousStep(t)}isStepValidToDisplay(e,t){var r;let n=this._form.steps.length;if(e<0||e>=n)return!1;let i=null==(r=this._form.steps[e].formStep.properties)?void 0:r.attachedContentLink,o=new URL(i,this._tempBaseUrl),a=new URL(t,this._tempBaseUrl);return(!!f(i)||!!v(o.pathname,a.pathname))&&(!(e!=n-1&&this._stepHelper.isNeedCheckDependCondition(e))||0!==this._formStorage.loadFormDataFromStorage().length&&!this.getInactiveStepsIndex().some(t=>t===e))}getInactiveStepsIndex(){if(1===this._form.steps.length)return[];let e=[];return this._form.steps.forEach((t,r)=>{this._stepHelper.isNeedCheckDependCondition(r)&&!this.isSatisfied(r)&&(e=e.concat(r))}),e}}class A{constructor(e){this._element=e}validateRequired(e){return!(h(e)||"string"==typeof e&&f(e.trim()))&&(!(e instanceof Array)||0!==e.length)}validateRegex(e,t){return!!(h(null==t?void 0:t.jsPattern)||f(e))||!!function(e,t){try{var r=new RegExp(t).exec(e);return null!=r&&r.length>0}catch(e){return console.debug(e.message),!1}}(e,t.jsPattern)}validateFileExtension(e,t){if(f(e)||e instanceof Array&&0===e.length)return!0;var r=t.accept,n=f(r)?[]:r.split(","),i=n.length,o=e.length;if(i>0)for(let e=0;e<i;e++)n[e]=n[e].substring(1);for(let t=0;t<o;t++)if(!function(e,t){var r=e.substring((~-e.lastIndexOf(".")>>>0)+2);return!(r.length<1)&&(t.length<1||y(r,t,!0))}(e[t].name,n))return!1;return!0}validateFileSize(e,t){if(h(e))return!0;var r=e.length,n=t.sizeInBytes;for(let t=0;t<r;t++)if(e[t].size>n)return!1;return!0}validateNumeric(e){return f(e)||g(e)}validate(e){let t={valid:!0,message:""},r=this._element.properties;return h(null==r?void 0:r.validators)||r.validators.every(r=>{let n=!0;switch(r.type){case i.CaptchaValidator:case i.RequiredValidator:n=this.validateRequired(e);break;case i.RegularExpressionValidator:case i.EmailValidator:case i.UrlValidator:case i.DateDDMMYYYYValidator:case i.DateMMDDYYYYValidator:case i.DateYYYYMMDDValidator:case i.IntegerValidator:case i.PositiveIntegerValidator:n=this.validateRegex(e,r.model);break;case i.AllowedExtensionsValidator:n=this.validateFileExtension(e,r.model);break;case i.MaxFileSizeValidator:n=this.validateFileSize(e,r.model);break;case i.NumericValidator:n=this.validateNumeric(e)}return!!n||(t={valid:n,message:r.model.message},!1)}),t}}class M{constructor(e){this.checkConditions=(e,t=[])=>{if(!h(e)){let r=this._element.properties;if(h(null==r?void 0:r.conditions))return!0;for(let n=0;n<r.conditions.length;n++){let i=r.conditions[n],a=function(e,t,r){var n,i=null==(n=t.filter(t=>
22v(t.elementKey,e.field))[0])?void 0:n.value;let o=r.find(t=>t.elementKey===e.field);return o&&!o.isSatisfied&&(i=void 0),i}(i,e,t),s=I[i.operator];if(!h(s)){let e=s(null==a?"":a.toString(),i.fieldValue);if(r.conditionCombination===o.Any&&e)return!0;if(r.conditionCombination!==o.Any&&!e)return!1}}return r.conditionCombination!==o.Any}return!1},this._element=e}}class P{constructor(e,t){this._form=e,this._baseUrl=t}combineData(e,t){let r=new Map;return t.forEach(e=>{r.set(e.elementKey,e)}),[...t,...e.filter(e=>!r.has(e.elementKey))]}doSubmit(e){return new Promise((t,r)=>{let i=new FormData,o={};o.FormKey=e.formKey,o.Locale=e.locale,o.IsFinalized=e.isFinalized,o.SubmissionKey=e.partialSubmissionKey,o.HostedPageUrl=e.hostedPageUrl,o.CurrentStep=e.currentStepIndex;let a={};e.submissionData.forEach(e=>{let t=e.value,r=e.elementKey;if(!h(t))if(Array.isArray(t)&&t.length>0&&null!==t[0]&&"object"==typeof t[0]){let o="";for(var n=0;n<t.length;n++){let e=t[n].file;e&&Object.getPrototypeOf(e)===File.prototype&&i.append(r+"_file_"+n,e),n>0&&n!=t.length-1&&(o+=" | "),o+=t[n].name}i.append(r,o),e.prevValue=o}else a[r]=e.value}),o.Fields=a,i.append("data",JSON.stringify(o));let s=new E(this._form),l=s.loadFormDataFromStorage(),c=this.combineData(l,e.submissionData);s.saveFormDataToStorage(c);let u={method:"PUT",headers:{Authorization:`Bearer ${e.accessToken}`},body:i};fetch(`${this._baseUrl}${n.apiEndpoint}`,u).then(n=>{var i,o,a,l;return i=this,o=void 0,a=void 0,l=function*(){let i=yield n.json();n.ok?(i.success&&e.isFinalized&&s.removeFormDataInStorage(),t(i)):r(i)},new(a||(a=Promise))(function(e,t){function r(e){try{s(l.next(e))}catch(e){t(e)}}function n(e){try{s(l.throw(e))}catch(e){t(e)}}function s(t){var i;t.done?e(t.value):((i=t.value)instanceof a?i:new a(function(e){e(i)})).then(r,n)}s((l=l.apply(i,o||[])).next())})}).catch(e=>{r(e)})})}doValidate(e){return this._form.formElements.filter(t=>e.some(e=>v(e.elementKey,t.key))).map(t=>{var r;let n=new A(t),i=null==(r=e.filter(e=>v(e.elementKey,t.key))[0])?void 0:r.value;return{elementKey:t.key,result:n.validate(i)}})}}},8545:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{callServer:function(){return n.callServer},createServerReference:function(){return o.createServerReference},findSourceMapURL:function(){return i.findSourceMapURL}});let n=r(1209),i=r(5153),o=r(7197)}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.