PageSourceSearch

https://www.fortmadison.com/opoClient/opoClient.min.js?v=KKPMlwLHzrdhv8agBm347nZ2CVPhRH1DKZ5pUiVdQFA

js fortmadison.com collected 2026-10-02 11:16:33 UTC 547,280 bytes, 3 lines download raw bytes

1function ocCommon(e){null===e&&(e=this.resolveClientOs()),this.mNotifyDlg=null,this.ocPDFDocArray=[],this.isMobile=!1;const t=window.matchMedia("(pointer:coarse)");t&&t.matches&&(this.isMobile=!0),this.isTouch=!1,("ontouchstart"in window||navigator.maxTouchPoints>0)&&(this.isTouch=!0),this.clientOs=e,this.isSafari=("mac"===e||"ios"===e)&&!CSS.supports("selector(:host-context(a))"),this.temprsrcsCt=0,this.temprsrcsId=null,this.temprsrcsCB=null,this.dlgMsg=null,this.dlgLogin=null,this.dlgReLogin=null,this.dlgCreate=null,this.pzItems=[],this.aiRules=[],this.mbl=!1,this.ocFields=[],this.mwCart={mwid:"",items:[]},this.ipvField=null,this.mwJs=[];var o=document.createElement("dialog");this.supportDialogElem="function"==typeof o.showModal,this.resources=[{id:"ams",loaded:!1,items:[{id:"amsCSS",href:"https://amp.azure.net/libs/amp/latest/skins/amp-default/azuremediaplayer.min.css",type:"stylesheet"},{id:"amsJS",src:"https://amp.azure.net/libs/amp/latest/azuremediaplayer.min.js",type:"script"}]},{id:"trix",loaded:!1,items:[{id:"trixCSS",href:"https://unpkg.com/[email protected]/dist/trix.css",type:"stylesheet"},{id:"trixCustomCSS",href:"/css/trix-custom.css?v=2021.03.10",type:"stylesheet"},{id:"trixJS",src:"https://unpkg.com/[email protected]/dist/trix.umd.min.js",type:"script"},{id:"trixCustomJS",src:"/js/trix-custom.js?v=2023.10.24",type:"script"}]},{id:"stripe",loaded:!1,items:[{id:"stripeJS",src:"https://js.stripe.com/v3/",type:"script"}]},{id:"leaflet",loaded:!1,items:[{id:"leafCSS",href:"/css/leaflet-global-2-0-0.css"},{id:"leafJS",src:"/js/leaflet-global-2-0-0.js",type:"script"}]}]}ocCommon.prototype.setMWJSFunction=function(e,t,o){if(e&&t&&"function"==typeof t&&o&&"function"==typeof o){let l=!1;occ.mwJs.forEach(c=>{c.moduleId===e&&(c.getElementFromString=t,c.getElementsFromString=o,l=!0)}),!1===l&&occ.mwJs.push({moduleId:e,getElementFromString:t,getElementsFromString:o})}},ocCommon.prototype.resolveClientOs=function(){const e=navigator.userAgentData;if(e?.platform){const t=e.platform.toLowerCase(),o=!0===e.mobile;if(t.includes("ios")||t.includes("mac")&&o)return"ios";if(t.includes("android"))return"android";if(t.includes("mac"))return"mac";if(t.includes("win"))return"windows"}const t=(navigator.platform||"").toLowerCase();if(t.includes("iphone")||t.includes("ipad"))return"ios";if(t.includes("mac")&&navigator.maxTouchPoints>1)return"ios";if(t.includes("mac"))return"mac";if(t.includes("win"))return"windows";if(t.includes("android"))return"android";const o=(navigator.userAgent||"").toLowerCase();return o.includes("android")?"android":o.includes("iphone")||o.includes("ipad")?"ios":o.includes("mac os")||o.includes("macintosh")?navigator.maxTouchPoints>1?"ios":"mac":o.includes("windows nt")?"windows":""},ocCommon.prototype.isNullOrEmpty=function(e){return!!(null===e||""===e||"null"===e||Array.isArray(e)&&0===e.length)},ocCommon.prototype.isNothingOrEmpty=function(e){return!!(null==e||""===e||"null"===e||Array.isArray(e)&&0===e.length)},ocCommon.prototype.checkSelector=function(e){return e.indexOf("\\")>-1&&(e=e.replace(/\\/g,"\\\\")),e.indexOf("/")>-1&&(e=e.replace(/\//g,"\\/")),e.indexOf("%")>-1&&(e=e.replace(/\%/g,"\\%")),e.indexOf("=")>-1&&-1===e.indexOf("[")&&-1===e.indexOf('"]')&&(e=e.replace(/\=/g,"\\=")),e.indexOf("+")>-1&&(e=e.replace(/\+/g,"\\+")),e},ocCommon.prototype.getElementFromString=function(e){if("string"==typeof e){let o=null;if(occ.mwJs.length>0){let t="";if(e.startsWith("##")){let o=e.split("##");o.length>1&&(t=o[0],e=o[1])}occ.mwJs.forEach(l=>{if(null===o&&(""===t||l.moduleId===t))try{o=l.getElementFromString(e)}catch(e){}}),e=o||e}if(!o){var t=e;!(e=document.getElementById(t))&&(t.indexOf(".")>-1||t.indexOf(">")>-1||t.indexOf("[")>-1)&&(e=document.querySelector(occ.checkSelector(t)))}}return e},ocCommon.prototype.getElementsFromString=function(e){if("string"==typeof e){let o=null;if(occ.mwJs.length>0){let t="";if(e.startsWith("##")){let o=e.split("##");o.length>1&&(t=o[0],e=o[1])}occ.mwJs.forEach(l=>{if(null===o&&(""===t||l.moduleId===t))try{o=l.getElementFromString(e)}catch(e){}}),e=o||e}if(!o){var t=e;!(e=document.getElementById(t))&&(t.indexOf(".")>-1||t.indexOf(">")>-1||t.indexOf("[")>
1-1)&&(e=document.querySelectorAll(occ.checkSelector(t)))}}return e},ocCommon.prototype.addClasses=function(e,t){if(e&&null!==e&&(e=occ.getElementFromString(e))&&t&&null!=t)for(var o=0;o<t.length;o++)this.addClass(e,t[o])},ocCommon.prototype.addClass=function(e,t){if(e&&null!==e&&null!==t&&""!==t&&!(t.length<2)&&(e=occ.getElementsFromString(e)))if(!e.length&&0!==e.length||e.tagName)if(e.classList&&"object"==typeof e.classList)e.classList.add(t);else{var o="";e.className&&(o=" "+e.className.trim()+" "),o.indexOf(" "+t+" "===-1)&&(e.className=(o+" "+t).trim())}else for(var l=0;l<e.length;l++)this.addClass(e[l],t)},ocCommon.prototype.addClassField=function(e,t){occ.addClass(e,t),occ.addClass(e+"-ctrl",t)},ocCommon.prototype.removeClasses=function(e,t){if(e&&null!==e&&(e=occ.getElementsFromString(e))&&t&&null!=t)for(var o=0;o<t.length;o++)this.removeClass(e,t[o])},ocCommon.prototype.removeClass=function(e,t){if(e&&null!==e&&(e=occ.getElementsFromString(e)))if(!e.length&&0!==e.length||e.tagName)if(e.classList&&"object"==typeof e.classList)e.classList.remove(t);else{var o=" "+t+" ";if(!e.className)return;var l=" "+e.className.trim()+" ";-1!==l.indexOf(o)&&(e.className=l.replace(o," ").trim())}else for(var c=0;c<e.length;c++)this.removeClass(e[c],t)},ocCommon.prototype.removeClassField=function(e,t){occ.removeClass(e,t),occ.removeClass(e+"-ctrl",t)},ocCommon.prototype.toggleClass=function(e,t,o){if(e&&null!==e&&(e=occ.getElementsFromString(e))){if(1===o)return this.addClass(e,t),!0;if(0===o)return this.removeClass(e,t),!1;var l=[];!e.length&&0!==e.length||e.tagName?l.push(e):l=e;for(var c=0;c<l.length;c++)this.hasClass(l[c],t)?this.removeClass(l[c],t):this.addClass(l[c],t)}},ocCommon.prototype.replaceClass=function(e,t,o,l){e&&null!==e&&(e=occ.getElementFromString(e))&&(this.hasClass(e,t)&&(this.removeClass(e,t),l=!0),!0===l&&this.addClass(e,o))},ocCommon.prototype.hasAnyClasses=function(e,t){return occ.hasMultipleClasses(e,t,!0)},ocCommon.prototype.hasAllClasses=function(e,t){return occ.hasMultipleClasses(e,t,!1)},ocCommon.prototype.hasMultipleClasses=function(e,t,o){if(!e||null===e)return!1;if(!(e=occ.getElementFromString(e))||!1===Array.isArray(t))return!1;let l=[];if(l=e.classList&&"object"==typeof e.classList?e.classList:e.className.split(" "),0===l.length)return!1;let c=!1,i=l.length>0;return t.forEach(e=>{if(!1===occ.isNothingOrEmpty(e)){let t=!1;l.forEach(o=>{o===e&&(t=!0,c=!0)}),!1===t&&(i=!1)}}),!1===o?i:c},ocCommon.prototype.hasClass=function(e,t){if(!e||null===e)return!1;if(!(e=occ.getElementFromString(e)))return!1;if(e.classList&&"object"==typeof e.classList)return e.classList.contains(t);var o=" "+t+" ";return!!e.className&&-1!==(" "+e.className.trim()+" ").indexOf(o)},ocCommon.prototype.hasClassField=function(e,t){let o=occ.hasClass(e,t);return 0==o&&(o=occ.hasClass(e+"-ctrl",t)),o},ocCommon.prototype.getNearest=function(e,t,o,l){if(!e||null===t&&(!l||null===l))return null;t&&null!==t||(t=0),l&&null!==l||(l=0);for(var c=!1,i=e;!1===c;)0!==t&&0===l&&!0===this.hasClass(e,t)||0===t&&0!==l&&e.tagName.toLowerCase()===l.toLowerCase()||0!==t&&0!==l&&!0===this.hasClass(e,t)&&e.tagName.toLowerCase()===l.toLowerCase()?c=!0:e.parentElement?e=e.parentElement:(c=!0,e=null);if(null===e&&!1===o){var a=0!==t?i.parentElement.querySelectorAll("."+t):[];if(0===a.length&&0!==l&&(a=i.parentElement.querySelectorAll(l)),a.length>0)e=a[0];else{let o=0!==t?i.querySelectorAll("."+t):[];0===o.length&&0!==l&&(o=i.querySelectorAll(l)),o.length>0&&(e=o[0])}}return e},ocCommon.prototype.isVisible=function(e){if(!(e=occ.getElementFromString(e)))return!1;if(!0===occ.hasClass(e,"hiddenObj"))return!1;if(!1===occ.hasClass(e,"egCtrl")){var t=window.getComputedStyle(e);return"none"!=t.getPropertyValue("display")&&"hidden"!=t.getPropertyValue("visibility")}return!0},ocCommon.prototype.isFieldVisible=function(e){if(!(e=occ.getElementFromString(e)))return!1;if(!1===e.id.endsWith("-ctrl")&&(e=document.getElementById(e.id+"-ctrl")),!e)return!1;let t=occ.isVisible(e);return!0!==t||!0!==occ.hasClass(e.parentElement,"ocFormContainer")&&!0!==occ.hasClass(e.parentElement,"ocFormGroup")||(t=occ.isVisible(e.parentElement)),t},ocCommon.prototype.hideObj=function(e,t){(e=occ.getElementsFromString(e))&&(occ.addClass(e,"hiddenObj"),t&&occ.addClass(e,"hiddenObjV"))},ocCommon.prototype.hideField=function(e,t){if("string"==typeof e&&(e=occ.getElementFromString(e)),!e)return;let o=occ.getNearest(e,"ocFormContainer",!0),l=!o||"0"===o.getAttribute("data-ocfieldct"),c=occ.getElementFromString(e.id+"-ctrl");
1if(c?occ.hideObj(c,t):!1===e.id.endsWith("-ctrl")&&!1===l?e.setAttribute("data-fieldhidden","true"):!0===l&&(occ.hideObj(e,t),c=e),occ.hasClass(c,"aiAssist")){let o=occ.getElementFromString(e.id+"-aiSection");o&&null!==o&&occ.hideObj(o,t)}},ocCommon.prototype.showObj=function(e){(e=occ.getElementsFromString(e))&&(occ.removeClass(e,"hiddenObj"),occ.removeClass(e,"hiddenObjV"))},ocCommon.prototype.showField=function(e){if("string"==typeof e&&(e=occ.getElementFromString(e)),!e)return;let t=occ.getNearest(e,"ocFormContainer",!0),o=!t||"0"===t.getAttribute("data-ocfieldct"),l=occ.getElementFromString(e.id+"-ctrl");if(l){if(occ.showObj(l),occ.hasClass(l,"aiAssist")){let t=occ.getElementFromString(e.id+"-aiSection");t&&null!==t&&occ.initAIAssistText(e.id)}l&&l.parentElement&&occ.resizeFormFields(l.parentElement)}else!1===e.id.endsWith("-ctrl")&&!1===o?e.setAttribute("data-fieldhidden","false"):!0===o&&occ.showObj(e)},ocCommon.prototype.toggleObj=function(e,t){if(!(e=occ.getElementsFromString(e)))return;let o=null;!0===t?o=0:!1===t&&(o=1),occ.toggleClass(e,"hiddenObj",o)},ocCommon.prototype.toggleField=function(e){if(e=occ.getElementsFromString(e),occ.toggleClass(e.id+"-ctrl","hiddenObj"),occ.hasClass(e.id+"-ctrl","aiAssist")){let t=occ.getElementFromString(e.id+"-aiSection");t&&null!==t&&occ.toggleClass(t,"hiddenObj")}},ocCommon.prototype.ocButton=function(e,t,o,l,c,i){let a=null;var n=document.getElementById(e);let r=null,s=null;var d=["opoClient-btn"];if(Array.isArray(i))for(let e=0;e<i.length;e++)d.push(i[e]);var u=!1;if(l&&!1===occ.isNullOrEmpty(l)){l.indexOf("iconRight")>-1&&(l=l.replace("iconRight",""),d.push("iconRight"),u=!0),(l="s-"+l).indexOf(" right")>-1&&(d.push("right"),l=l.replace(" right"," "));let e=l.split(" ");e=e.filter(e=>!occ.isNullOrEmpty(e));let t=!1;for(let o=0;o<e.length;o++)0===o&&(r=e[o].replace("s-","")),e[o].indexOf("sz")>-1&&(t=!0,d.push(e[o])),e[o].indexOf("-t")===e[o].length-2&&d.push("withIcon-t");!1===t&&(e.push("sz2"),d.push("sz2"),t=!0),(1===e.length||2===e.length&&!0===t)&&e.push("tr"),e.push("icon"),s=occ.createDiv("",e),d.push("withIcon")}if(!0===occ.hasClass(n,"opoClient-btn"))return!1===occ.isNullOrEmpty(t)&&(n.querySelector("span").innerHTML=t),void(l&&!1===occ.isNullOrEmpty(l)&&(n.querySelector("div.icon")&&n.querySelector("div.icon").remove(),n.insertBefore(s,n.children[0])));if(n){if(occ.addClasses(n,d),null!==n.getAttribute("name")&&""!==n.getAttribute("name")||n.setAttribute("name",e),!0===occ.isNullOrEmpty(t)&&""!=n.innerText&&(t=n.innerText,n.innerHTML=""),!0===occ.isNullOrEmpty(t)?(d.push("noText"),t="",null!==s&&d.push("icon-only")):(r=null,a=occ.createElement("span",null,null,t)),occ.addClasses(n,d),!1===u&&null!==s&&n.appendChild(s),null!==a&&n.appendChild(a),!0===u&&null!==s&&n.appendChild(s),null!==r&&n.setAttribute("aria-label",r),"function"==typeof o)occ.addClickEvent(n,o);else if(!1===occ.isNullOrEmpty(n.getAttribute("onclick"))){let e=function(e){e.preventDefault(),e.stopPropagation(),occ.triggerEvent(e.currentTarget,"change")};n.setAttribute("onchange",n.getAttribute("onclick")),n.setAttribute("onclick",""),occ.addClickEvent(n,e,"pointerdown")}else if(null!=n.getAttribute("href")&&""!==n.getAttribute("href")&&"javascript:;"!==n.getAttribute("href")){n.setAttribute("data-href",n.getAttribute("href"));let e=function(e){e.preventDefault(),e.stopPropagation(),window.location.href=n.getAttribute("data-href")};null!==n.getAttribute("target")&&""!==n.getAttribute("target")&&(e=function(e){e.preventDefault(),e.stopPropagation(),window.open(n.getAttribute("data-href"),n.getAttribute("target"))}),occ.addClickEvent(n,e)}!0===occ.hasClass(n,"disabled")&&occ.disableControl(n,!0),n.addEventListener("touchstart",function(e){e.preventDefault(),e.stopPropagation()}),n.addEventListener("touchmove",function(e){e.preventDefault(),e.stopPropagation()}),"BUTTON"===n.tagName&&!0===occ.isNullOrEmpty(n.getAttribute("type"))&&n.setAttribute("type","button")}else{null!==t&&""!=t?(r=null,a=occ.createElement("span",null,null,t)):(a=null,d.push("noText"),null!==s&&d.push("icon-only"));var p=occ.createButton("",d,[{name:"id",value:e},{name:"name",value:e}]);if(!1===u&&null!==s&&p.appendChild(s),null!==a&&p.appendChild(a),!0===u&&null!==s&&p.appendChild(s),null!==r&&p.setAttribute("aria-label",r),"function"==typeof o&&occ.addClickEvent(p,o),p.addEventListener("touchstart",function(e){e.preventDefault(),e.stopPropagation()}),p.addEventListener("touchmove",function(e){e.preventDefault(),e.stopPropagation()}),!0===occ.hasClass(p,"disabled")&&occ.disableControl(p,!0),!c||null===c||""===c)return p;document.getElementById(c).appendChild(p)}};let curOcButtonClick=null;ocCommon.prototype.addClickEvent=function(e,t,o){o&&null!=o&&""!=o||(o="pointerup"),occ.addEvent(e,t,o)},ocCommon.prototype.addChangeEvent=function(e,t){if(!(e=occ.getElementFromString(e))||"function"!=typeof t)return;e.addEventListener("change",function(e){occ.cpe(e),t(e)})},ocCommon.prototype.addEvent=function(e,t,o){if(!(e=occ.getElementFromString(e))||"function"!=typeof t)return;if(!o||null==o||""==o)return;"A"===e.tagName&&0!==e.href.indexOf("javascript")&&(e.href="javascript:;");let l=function(e){e.preventDefault(),e.stopPropagation();let o=null==e.currentTarget?e.srcElement:e.currentTarget;if(o&&!1===occ.isNullOrEmpty(o.id)){if(curOcButtonClick===o.id&&!0===e.isTrusted)return;curOcButtonClick=o.id,setTimeout(function(){curOcButtonClick=null},500)}
1if(!1===occ.showTooltip(o,null,e)){if("load"!==e.type&&(!0===o.disabled||"true"===o.getAttribute("disabled")||!0===occ.hasClass(o,"disabled")))return;"mouse"===e.pointerType&&"pointermove"!==e.type&&"wheel"!==e.type&&"touchmove"!==e.type&&"pointerleave"!==e.type&&"pointerenter"!==e.type&&0!==e.button||t(e)}o.dataset&&o.dataset.switchval||occ.cpe(e)};if("pointerdown"===o||"pointerup"===o?document.activeElement.blur():"rightclick"!==o&&"pointerrightdown"!==o&&"pointerrightup"!==o||(l=function(e){e.preventDefault(),e.stopPropagation(),2===e.button&&t(e)},"pointerrightdown"===(o="pointerup")&&(o="pointerdown")),!window.PointerEvent&&"ontouchstart"in window)switch(o){case"pointerdown":o="touchstart";break;case"pointerup":o="touchend";break;case"pointermove":o="touchmove"}if("click"===o||"pointerup"===o||"touchend"===o||"mouseup"===o||"pointerdown"===o||"touchstart"===o||"mousedown"===o){const t=e&&e.tagName?e.tagName.toUpperCase():"";"BUTTON"===t||"INPUT"===t||"SELECT"===t||"TEXTAREA"===t||"SUMMARY"===t||"A"===t&&!1===occ.isNothingOrEmpty(e.getAttribute("href"))||(e.setAttribute("data-occet",o),e.addEventListener("keydown",occ.kbEvent))}e.addEventListener(o,l)},ocCommon.prototype.kbEvent=function(e){if((!e.srcElement||"INPUT"!==e.srcElement.tagName&&"TEXTAREA"!==e.srcElement.tagName&&"TRIX-EDITOR"!==e.srcElement.tagName)&&!(e.altKey||e.ctrlKey||e.metaKey||"Enter"!==e.key&&" "!==e.key&&"Space"!==e.code)){e.preventDefault();let t="";!1===occ.isNothingOrEmpty(e.currentTarget.getAttribute("data-occet"))?t=e.currentTarget.getAttribute("data-occet"):!1===occ.isNothingOrEmpty(e.currentTarget.getAttribute("onpointerup"))?t="pointerup":!1===occ.isNothingOrEmpty(e.currentTarget.getAttribute("onclick"))?t="click":!1===occ.isNothingOrEmpty(e.currentTarget.getAttribute("ontouchend"))?t="touchend":!1===occ.isNothingOrEmpty(e.currentTarget.getAttribute("onmouseup"))?t="mouseup":!1===occ.isNothingOrEmpty(e.currentTarget.getAttribute("onpointerdown"))?t="pointerdown":!1===occ.isNothingOrEmpty(e.currentTarget.getAttribute("ontouchstart"))?t="touchstart":!1===occ.isNothingOrEmpty(e.currentTarget.getAttribute("onmousedown"))&&(t="mousedown"),""!==t&&(occ.triggerEvent(e.currentTarget,t,{source:"keyboard"}),occ.cpe(e))}},ocCommon.prototype.triggerEvent=function(e,t,o){if(e=occ.getElementFromString(e),("string"!=typeof t||occ.isNothingOrEmpty(t))&&(t="pointerup"),e)if(o){const l=new CustomEvent(t,{detail:o});l.button=0,e.dispatchEvent(l)}else{var l=new Event(t);l.button=0,e.dispatchEvent(l)}},ocCommon.prototype.addAttributes=function(e,t){if(Array.isArray(t))for(var o=0;o<t.length;o++)t[o].name&&null!==t[o].name&&null!==t[o].value&&(t[o].Key?e.setAttribute(t[o].Key,t[o].Value):e.setAttribute(t[o].name,t[o].value))},ocCommon.prototype.createElement=function(e,t,o,l,c,i){var a=document.createElement(e);return t&&this.addClasses(a,t),o&&this.addAttributes(a,o),null!==a.getAttribute("name")&&""!==a.getAttribute("name")||null==a.getAttribute("id")||""===a.getAttribute("id")||a.setAttribute("name",a.id),l&&null!==l||(l=""),a.insertAdjacentHTML("afterbegin",l),"function"==typeof i&&!1===occ.isNothingOrEmpty(c)&&occ.addEvent(a,i,c),a},ocCommon.prototype.createDiv=function(e,t,o,l,c){return this.createElement("div",t,o,e,l,c)},ocCommon.prototype.createAnchor=function(e,t,o,l,c,i){var a=this.createElement("a",t,o,e,c,i);if(!0===occ.hasClass(a,"ocPhoneFormat")&&(a.innerHTML=occ.formatTelephone(e)),l&&!1===occ.isNullOrEmpty(l)){a.setAttribute("data-href",l);let e=function(e){e.preventDefault(),e.stopPropagation(),window.location.href=a.getAttribute("data-href")};null!==a.getAttribute("target")&&""!==a.getAttribute("target")&&(e=function(e){e.preventDefault(),e.stopPropagation(),window.open(a.getAttribute("data-href"),a.getAttribute("target"))}),occ.addClickEvent(a,e)}return a},ocCommon.prototype.createButton=function(e,t,o,l,c){var i=this.createElement("button",t,o,e,l,c);let a=!1;if(Array.isArray(o))for(let e=0;e<o.length;e++)"type"===o[e].name.toLowerCase()&&(a=!0);return 0==a&&i.setAttribute("type","button"),i};var tooltipHandler=null;ocCommon.prototype.showTooltip=function(e,t,o){if(e=occ.getElementFromString(e)){if(t&&null!==t||!e.getAttribute("disabledText")||!0!==occ.hasClass(e,"disabled")||(t=e.getAttribute("disabledText")),!t||!1!==occ.isNullOrEmpty(t))return!1;{null!==tooltipHandler&&(occ.destroyTooltip(),clearTimeout(tooltipHandler));var l=occ.createDiv(t,["occ-tooltip"],null);occ.addClickEvent(l,occ.destroyTooltip),o?(occ.addClass(l,"withEvent"),l.style.left=o.x-o.offsetX-5+"px",l.style.top=o.y-o.offsetY-30+"px",document.body.appendChild(l)):e.appendChild(l);let c=8e3;t.length<31&&(c=5e3),t.length>59&&(c=11e3),tooltipHandler=setTimeout(occ.destroyTooltip,c)}}},ocCommon.prototype.destroyTooltip=function(e){e&&null!==tooltipHandler&&clearTimeout(tooltipHandler),tooltipHandler=null;var t=document.querySelector("div.occ-tooltip");t&&t.remove()},ocCommon.prototype.disableControl=function(e,t){if(!e||null===e)return;"string"!=typeof e&&(e=e.id);let o=e.tagName?e:document.getElementById(e);if(o){if(!0===occ.hasClass(o,"ocFormContainer"))return void occ.disableForm(e,t);if(!0===occ.hasClass(o.parentElement,"alwaysDisabled")&&!1===t)return;if(!0===t){let t=occ.isNullOrEmpty(o.getAttribute("disabledtext"));if(occ.addClass(o,"disabled"),!0===t&&o.setAttribute("disabled","true"),!1===occ.hasClass(e,"opoClient-btn")){occ.addClass(e+"-hp","disabled"),occ.addClass(e+"-ip","disabled"),!0===occ.hasAnyClasses(e,["ddl","seg"])?o.setAttribute("disabled","true"):occ.addClass(o.parentElement,"disabled"),document.getElementById(e+"-hp")&&(!0===t&&(document.getElementById(e+"-hp").disabled=!0),document.getElementById(e+"-hp").setAttribute("disabled","true")),document.getElementById(e+"-select")&&(!0===t&&(document.getElementById(e+"-select").disabled=!0),document.getElementById(e+"-select").setAttribute("disabled","true")),document.getElementById(e+"-cancel")&&(!0===t&&(document.getElementById(e+"-cancel").disabled=!0),document.getElementById(e+"-cancel").setAttribute("disabled","true")),document.getElementById(e+"-clear")&&(!0===t&&(document.getElementById(e+"-clear").disabled=!0),document.getElementById(e+"-clear").setAttribute("disabled","true")),document.getElementById(e+"-ip")&&(!0===t&&(document.getElementById(e+"-ip").disabled=!0),document.getElementById(e+"-ip").setAttribute("disabled","true"));let l=o.parentElement.querySelectorAll(".opoClient-btn");for(let e=0;e<l.length;e++)!1===occ.hasClass(l[e],"storeBtn")&&!1===occ.hasClass(l[e],"hp-btn")&&!1===occ.hasClass(l[e],"hp-dbtn")&&(!0===t&&(l[e].disabled=!0),l[e].setAttribute("disabled","true"),occ.addClass(l[e],"disabled"));l=o.parentElement.querySelectorAll("div.ocFieldCbx > input");for(let e=0;e<l.length;e++)l[e].disabled=!0;l=o.parentElement.querySelectorAll("div.ocFieldRadio > input");for(let e=0;e<l.length;e++)l[e].disabled=!0;if(!1===occ.hasClass(o.parentElement,"innerTagField")){l=o.parentElement.querySelectorAll(".ocFoItemTxt.innerTagField input.ocInputControl-ip");for(let e=0;e<l.length;e++)occ.disableControl(l[e].id,!0)}}}else if(occ.removeClass(o,"disabled"),o.removeAttribute("disabled"),!1===occ.hasClass(o,"opoClient-btn")){!1===occ.hasClass(e+"-hp","alwaysDisabled")&&(occ.removeClass(e+"-hp","disabled"),document.getElementById(e+"-hp")&&!1===occ.hasClass(document.getElementById(e+"-hp"),"occolor")&&(document.getElementById(e+"-hp").disabled=!1,document.getElementById(e+"-hp").removeAttribute("disabled"))),document.getElementById(e+"-select")&&(document.getElementById(e+"-select").disabled=!1,document.getElementById(e+"-select").removeAttribute("disabled")),document.getElementById(e+"-cancel")&&(document.getElementById(e+"-cancel").disabled=!1,document.getElementById(e+"-cancel").removeAttribute("disabled")),document.getElementById(e+"-clear")&&(document.getElementById(e+"-clear").disabled=!1,document.getElementById(e+"-clear").removeAttribute("disabled")),occ.removeClass(e+"-ip","disabled"),occ.removeClass(o.parentElement,"disabled"),document.getElementById(e+"-ip")&&(document.getElementById(e+"-ip").disabled=!1,document.getElementById(e+"-ip").removeAttribute("disabled"));let t=o.parentElement.querySelectorAll(".opoClient-btn");for(let e=0;e<t.length;e++)!1===occ.hasClass(t[e],"storeBtn")&&(t[e].disabled=!1,t[e].removeAttribute("disabled"),occ.removeClass(t[e],"disabled"));t=o.parentElement.querySelectorAll("div.ocFieldCbx > input");for(let e=0;e<t.length;e++)t[e].disabled=!1;t=o.parentElement.querySelectorAll("div.ocFieldRadio > input");for(let e=0;e<t.length;e++)t[e].disabled=!1;if(!1===occ.hasClass(o.parentElement,"innerTagField")){t=o.parentElement.querySelectorAll(".ocFoItemTxt.innerTagField input.ocInputControl-ip");for(let e=0;e<t.length;e++)occ.disableControl(t[e].id,!1)}}}},ocCommon.prototype.checkDate=function(e,t){if(e&&null!==e&&-1!==e.indexOf("/")){var o=e.split("/"),l="",c=this.isDate(e,t);if(!1===c&&3===o.length){o[0]=1*o[0],o[1]=1*o[1],o[2]=1*o[2];var i=!1;(0==o[2]%4&&0!=o[2]%100||0==o[2]%400)&&(i=!0),o[0]>12?l="valid month":o[2]<1e3?l="4 digit year":o[1]>(i?29:28)&&(o[1]>31||2===o[0]&&o[1]>(i?29:28)||o[1]>30&&(4===o[0]||6===o[0]||9===o[0]||11===o[0]))&&(l="valid day"),""===l&&!1===c&&(l="valid entry")}else o.length<2?l="valid date format, ie mm/dd/yyyy":!1===c?l="valid entry":(c.getFullYear()-(new Date).getFullYear()>50||(new Date).getFullYear()-c.getFullYear()>50)&&(l=" reasonable year");return l=""!==l?"*Date does not have a "+l+".":"Ok"}},ocCommon.prototype.isDate=function(e,t){var o;if(!e||""===e||null===e)return!1;if("string"==typeof e){const l=e.trim(),c=/^(\d{4})-(\d{2})-(\d{2})$/,i=/^(\d{1,2})\/(\d{1,2})\/(\d{2}|\d{4})$/,a=/^(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2})(?::(\d{2}))?$/;if(c.test(l)){const e=l.match(c),t=+e[1],i=+e[2]-1,a=+e[3];o=new Date(t,i,a,0,0,0,0)}else if(i.test(l)){const e=l.match(i),t=+e[1]-1,c=+e[2];let a=+e[3];a<100&&(a+=a>=70?1900:2e3),o=new Date(a,t,c,0,0,0,0)}else if(a.test(l)&&!0===t){const e=l.match(a),t=+e[1],c=+e[2]-1,i=+e[3],n=+e[4],r=+e[5],s=+(e[6]||0);o=new Date(t,c,i,n,r,s,0)}else o=new Date(l),!0===t&&/Z|[+-]\d{2}:?\d{2}$/.test(l)&&!isNaN(o)&&(o=new Date(o.getFullYear(),o.getMonth(),o.getDate(),o.getHours(),o.getMinutes(),o.getSeconds(),o.getMilliseconds()))}else if("number"==typeof e)o=new Date(e);else try{e.getTime();o=e}catch(e){o=!1}return"Invalid Date"!=o&&o},ocCommon.prototype.isDateObj=function(e){try{let t=JSON.parse(e);return t.start=occ.isDate(t.start),t.end=occ.isDate(t.end),!1!==t.start&&!1!==t.end&&t}catch(e){return!1}},ocCommon.prototype.isDateToday=function(e){let t=occ.isDate(e);if(!1===t)return!1;let o=new Date;return t.getFullYear()===o.getFullYear()&&t.getMonth()===o.getMonth()&&t.getDate()===o.getDate()},ocCommon.prototype.textCheck=function(e){return!!e.match(/^[A-Za-z]+$/)},ocCommon.prototype.alphanumericCheck=function(e){return!!e.match(/^[0-9a-zA-Z]+$/)},ocCommon.prototype.htmlCheck=function(e){return!!e.match(/<|>/g)},ocCommon.prototype.escapeString=function(e){for(
2/*! Extrapolated from https://mths.be/cssescape v1.5.1 by @mathias | MIT license : https://github.com/mathiasbynens/CSS.escape/blob/master/css.escape.js */
3var t,o=String(e),l=o.length,c=-1,i="",a=o.charCodeAt(0);++c<l;)0!==(t=o.charCodeAt(c))?i+=t>=1&&t<=31||127===t||0===c&&t>=48&&t<=57||1===c&&t>=48&&t<=57&&45===a?"\\"+t.toString(16)+" ":(0!==c||1!==l||45!==t)&&(t>=128||45===t||95===t||t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122)?o.charAt(c):"\\"+o.charAt(c):i+="�";return i},ocCommon.prototype.isDisabled=function(e){let t=null;return t=e.currentTarget?e.currentTarget:e.id?e:document.getElementById(e),!t||null==t||!0===t.disabled||"true"===t.getAttribute("disabled")||!0===occ.hasClass(t,"disabled")};var isHolding=!1,curWaiting=[];ocCommon.prototype.showWaiting=function(e,t,o){var l=null;let c=t;if(c&&null!==c&&"BODY"!==c.tagName){if(!(l=c.querySelector(":scope > div.innerWait"))||null===l){var i=occ.createDiv("",["resize-inner-overlay","innerWait"]);c.appendChild(i),l=c.querySelector(":scope > div.innerWait")}}else{if(c=document.querySelector("body"),!document.getElementById("WaitingIndicator")){var a=occ.createDiv("",["resize-overlay"],[{name:"id",value:"WaitingIndicator"}]);document.querySelector("body").appendChild(a)}if(l=document.getElementById("WaitingIndicator"),!t||null===t||"BODY"!==t.tagName){var n=occ.getElementFromString("dialog.ocDialog-dialog.active[open]:not(.hiddenObj)");n&&occ.showWaiting(e,n,o)}}if(l&&null!==l)if(this.removeClass(l,"hasMessage"),!1===occ.isNothingOrEmpty(o)?this.addClass(l,"hasMessage"):o="",0===l.children.length){var r=occ.createDiv('<div class="ocLoader"></div><div class="message">'+o+"</div>",null,null);l.appendChild(r)}else l.querySelector(".message").innerHTML=o;if(c&&("number"==typeof e&&e>0?(isHolding=!0,setTimeout(function(){isHolding&&occ.showWaiting(0,c,o),isHolding=!1},1e3*e)):(this.addClass(c,"waiting"),occ.hasClass(c,"ocDialog-Obj")&&occ.addClass(c.parentElement,"noScroll"))),!0===occ.isNothingOrEmpty(c.getAttribute("data-waitId"))){let e=occ.eid(0)+curWaiting.length;c.setAttribute("data-waitId",e),curWaiting.push({rootObj:c,obj:l,rid:e})}},ocCommon.prototype.updateWaiting=function(e,t){var o=null;if(!e||null===e)for(let t=0;t<curWaiting.length;t++)!0===occ.hasClass(curWaiting[t].obj,"waiting")&&(e=curWaiting[t].rootObj,o=curWaiting[t].obj);if(!e||null===e){if(e=document.querySelector("body"),!document.getElementById("WaitingIndicator")){var l=occ.createDiv("",["resize-overlay"],[{name:"id",value:"WaitingIndicator"}]);document.querySelector("body").appendChild(l)}o=document.getElementById("WaitingIndicator")}o&&(occ.addClass(e,"waiting"),occ.hasClass(e,"ocDialog-Obj")&&occ.addClass(e.parentElement,"noScroll"),!1===occ.isNothingOrEmpty(t)?occ.addClass(o,"hasMessage"):(occ.removeClass(o,"hasMessage"),t=""),o.querySelector(".message").innerHTML=t)},ocCommon.prototype.hideWaiting=function(e){if(isHolding=!1,e&&null!==e)this.removeClass(e,"waiting"),this.hasClass(e,"ocDialog-Obj")&&this.removeClass(e.parentElement,"noScroll");else for(let e=0;e<curWaiting.length;e++)occ.removeClass(curWaiting[e].rootObj,"waiting"),occ.hasClass(curWaiting[e].rootObj,"ocDialog-Obj")&&occ.removeClass(curWaiting[e].rootObj.parentElement,"noScroll")},ocCommon.prototype.bindVirtualKeyboard=function(e){if("ios"===occ.clientOs||"android"===occ.clientOs){for(var t=e.querySelectorAll("textarea"),o=0;o<t.length;o++)!1===occ.hasClass(t[o],"ocKBound")&&(t[o].addEventListener("focus",occ.setVirtualKeyboard),t[o].addEventListener("blur",occ.setVirtualKeyboard),occ.addClass(t[o],"ocKBound"));t=e.querySelectorAll("input");for(var l=0;l<t.length;l++)switch(t[l].getAttribute("type")){case"text":case"email":case"number":case"password":case"search":case"tel":case"url":!1===occ.hasClass(t[l],"ocKBound")&&(t[l].addEventListener("focus",occ.setVirtualKeyboard),t[l].addEventListener("blur",occ.setVirtualKeyboard),occ.addClass(t[l],"ocKBound"))}t=e.querySelectorAll("div.edtrDiv");for(var c=0;c<t.length;c++)!1===occ.hasClass(t[c],"ocKBound")&&(t[c].addEventListener("focus",occ.setVirtualKeyboard),t[c].addEventListener("blur",occ.setVirtualKeyboard),occ.addClass(t[c],"ocKBound"))}},ocCommon.prototype.setVirtualKeyboard=function(){if("ios"===occ.clientOs||"android"===occ.clientOs){var e=document.activeElement;if(!e||!e.tagName)return;switch("android"===occ.clientOs?occ.addClass(document.body,"isAndroid"):occ.addClass(document.body,"isiOS"),e.tagName){case"TEXTAREA":case"INPUT":case"DIV":occ.addClass(document.body,"keyboardOpen");break;default:occ.removeClass(document.body,"keyboardOpen"),window.scrollTo(0,-200)}}},ocCommon.prototype.reLoadResources=function(e,t,o){for(var l=0;l<occ.resources.length;l++)occ.resources[l].id===e&&(occ.resources[l].loaded=!1);this.loadResources(e,t,o)},ocCommon.prototype.loadResources=function(e,t,o){var l=!0;if(null!==e&&""!==e||(e="rsrc-"+Date.now()),null!==t){var c={id:e,status:null,items:[]};c.items=t,occ.resources.push(c)}this.temprsrcsId=e;for(var i=0;i<occ.resources.length;i++)if(occ.resources[i].id===e)if(!0===occ.resources[i].loaded)l=!0;else{t=occ.resources[i].items,l=!1;for(var a=0;a<t.length;
3a++)if(document.getElementById(t[a].id))l=!0;else if(this.temprsrcsCt++,"html"===t[a].type){new ocAjax({jsonRequest:!1,jsonResponse:!1,async:!0,onSuccess:function(e){""!==e?document.body.insertAdjacentHTML("beforeend",e):console.log("ocAjax: no data returned"),occ.loadResourcesCB(null)}}).get(t[a].url,null)}else{var n=[{name:"id",value:t[a].id}];!1===occ.isNothingOrEmpty(t[a].integrity)&&(n.push({name:"integrity",value:t[a].integrity}),n.push({name:"crossorigin",value:""})),t[a].src&&null!==t[a].src&&n.push({name:"src",value:t[a].src});var r="script";t[a].href&&null!==t[a].href&&n.push({name:"href",value:t[a].href}),"stylesheet"===t[a].type&&(r="link",n.push({name:"rel",value:"stylesheet"}),n.push({name:"type",value:"text/css"})),o&&null!=o&&(t[a].cb=o);var s=occ.createElement(r,null,n);s.addEventListener("load",function(e){occ.loadResourcesCB(e)}),!1===occ.isNothingOrEmpty(t[a].integrity)?document.head.appendChild(s):document.body.appendChild(s)}}return l?o&&null!=o&&o():(occ.showWaiting(2,null,"Loading..."),o&&null!=o&&(this.temprsrcsCB=o)),l},ocCommon.prototype.loadResourcesCB=function(e){occ.hideWaiting();for(var t=0;t<occ.resources.length;t++)if(occ.resources[t].id===this.temprsrcsId&&(occ.resources[t].loaded=!0,occ.resources[t].cb&&null!==occ.resources[t].cb))try{occ.resources[t].cb(),this.temprsrcsCB=null}catch(e){}if(this.temprsrcsId,"ams"===this.temprsrcsId){let e=document.querySelectorAll("video.azuremediaplayer");for(let t=0;t<e.length;t++)try{amp(e[t])}catch(e){}}try{this.temprsrcsCB()}catch(e){}this.temprsrcsCB=null,this.temprsrcsId=null},ocCommon.prototype.unLoadResource=function(e){for(var t=0;t<occ.resources.length;t++)if(occ.resources[t].id===e&&!0===occ.resources[t].loaded){for(var o=occ.resources[t].items,l=0;l<o.length;l++){var c=document.getElementById(o[l].id);c&&c.remove()}occ.resources[t].loaded=!1}},ocCommon.prototype.getScrollParent=function(e){var t=getComputedStyle(e),o="absolute"===t.position,l=/(auto|scroll)/;let c=e.offsetTop;if("fixed"===t.position)return{top:c,elem:document.body};for(var i=e;i=i.parentElement;)if(t=getComputedStyle(i),c+=i.offsetTop,(!o||"static"!==t.position)&&l.test(t.overflow+t.overflowY+t.overflowX))return{top:c,elem:i};return{top:c,elem:document.body}},ocCommon.prototype.formatTelephone=function(e,t,o,l){if(!0===t&&(t="a"),!e||null==e)return"";!0===occ.isNothingOrEmpty(o)&&!0===occ.hasClass(document.body,"maskOcPhones")&&(o=!0),o=!0!==occ.isNothingOrEmpty(o)&&("true"===o||!0===o);let c=(e=e.toLowerCase().replace("ext.","x").replace("ext","x")).split("x");e=c[0].trim().replace(/\D/g,""),1===c.length&&e.length>10&&(c.push(e.substring(10)),e=e.substring(0,10));let i=e+"";e.length>0&&((e="("+e).length>=4&&(e=e.substring(0,4)+") "+e.substring(4)),e.length>=9&&(e=e.substring(0,9)+"-"+e.substring(9)),c.length>1&&(e+=" x"+c[1].trim())),!0===o&&(e="Call");let a="";return!1===occ.isNothingOrEmpty(l)?!0!==o?l="<span>"+l.substring(0,1).toLowerCase()+". </span>":(a=" wider",l=" "+l):l="",!1===occ.isNothingOrEmpty(t)&&(!0===o?e+=l:e=l+e),"button"===t?e='<button class="opoClient-btn sz3 phoneBtn'+a+' withIcon" onpointerup="occ.clickPhoneBtn(event)" type="button" data-phone="'+i+'"><div class="s-call2 sz3 tr icon"></div><span>'+e+"</span></button>":"a"===t&&(e='<a href="tel:'+i+'" data-phone="'+i+'">'+e+"</a>"),e},ocCommon.prototype.formatDateSpans=function(e){e&&null!==e||(e=document.querySelector("body"));let t=e.querySelectorAll("span[date-format]");for(let e=0;e<t.length;e++)!1===occ.isNullOrEmpty(t[e].getAttribute("date-format"))&&(t[e].innerText=occ.formatDate(t[e].innerText,t[e].getAttribute("date-format")),t[e].removeAttribute("date-format"),occ.showObj(t[e]))},ocCommon.prototype.formatDate=function(e,t,o){var l="";if(!e||null===e)return"";if("number"!=typeof e||!1!==(e=occ.isDate(e,o))){if("string"==typeof e&&(!0===o&&(e=e.substring(0,16)),!1===(e=occ.isDate(e,o))))return"NaN";if(e.end||e.start)return e.start=occ.formatDate(e.start,t,o),e.end=occ.formatDate(e.end,t,o),JSON.stringify(e);switch(0===t.indexOf("day")&&(l=new Intl.DateTimeFormat("en-US",{weekday:"long"}).format(e)+" ",t=t.substring(3).trim()),0===t.indexOf("dy")&&(l+=(""!==l?" ":"")+new Intl.DateTimeFormat("en-US",{weekday:"short"}).format(e),t=t.substring(2).trim()),0===t.indexOf("Month")&&(l+=(""!==l?" ":"")+new Intl.DateTimeFormat("en-US",{month:"long"}).format(e)+" ",t=t.substring(5).trim()),0===t.indexOf("Mon")&&(l+=(""!==l?" ":"")+new Intl.DateTimeFormat("en-US",{month:"short"}).format(e)+" ",t=t.substring(3).trim()),t){case"d":l+=(""!==l?" ":"")+e.getDate();break;case", Month dyth":switch(l=l.trim()+", "+new Intl.DateTimeFormat("en-US",{month:"long"}).format(e)+" "+e.getDate(),e.getDate()){case 1:case 21:case 31:l+="st";break;case 2:case 22:l+="nd";break;case 3:case 23:l+="rd";break;default:l+="th"}break;case", d Month yyyy":case", d Month yy":l+=e.getDate()+" "+new Intl.DateTimeFormat("en-US",{month:"long"}).format(e)+" "+(", d Month yy"===t?"'"+(e.getFullYear()-2e3):e.getFullYear());break;case"., Mon d h:mm a":case"., Mon d h:mm am":l+=", "+new Intl.DateTimeFormat("en-US",{month:"short"}).format(e)+" "+e.getDate()+", ",l+=(0===e.getHours()?"12":e.getHours()>12?e.getHours()-12:e.getHours())+":",l+=e.getMinutes()<10?"0"+e.getMinutes():e.getMinutes(),l+="., Mon d h:mm am"===t?e.getHours()>11?" PM":" AM":e.getHours()>11?"P":"A";break;case"h:m a":case"h:mm a":case"h:mm am":l+=(0===e.getHours()?"12":e.getHours()>12?e.getHours()-12:e.getHours())+":",l+=e.getMinutes()<10?"0"+e.getMinutes():e.getMinutes(),l+="h:mm am"===t?e.getHours()>11?" PM":" AM":e.getHours()>11?"P":"A";break;case"h:m a z":case"h:mm a z":case"h:mm a [z]":case"h:mm am [z]":l+=(0===e.getHours()?"12":e.getHours()>12?e.getHours()-12:e.getHours())+":",l+=e.getMinutes()<10?"0"+e.getMinutes():e.getMinutes(),l+="h:mm am [z]"===t?e.getHours()>11?" PM":" AM":e.getHours()>11?"P":"A",(c=""+e).indexOf("(")>
30&&(c=occ.formatDateTZ(c),"[z]"===t&&(c=" <span>"+c+"</span>"),l+=" "+c);break;case"YYYY":case"yyyy":l+=e.getFullYear();break;case"d, yyyy":case"d, yy":l+=e.getDate()+", "+("d, yy"===t?"'"+(e.getFullYear()-2e3):e.getFullYear());break;case"dd, yyyy":case"dd, yy":l+=(e.getDate()<10?"0":"")+e.getDate()+", "+("dd, yy"===t?"'"+(e.getFullYear()-2e3):e.getFullYear());break;case"m/d/yyyy":l+=e.getMonth()+1+"/"+e.getDate()+"/"+e.getFullYear();break;case"mm/dd/yyyy":l+=e.getMonth()+1+"/"+(e.getDate()<10?"0":"")+e.getDate()+"/"+e.getFullYear();break;case"m/d":case"m/d":l+=e.getMonth()+1+"/"+e.getDate();break;case"m/d/yy":l+=e.getMonth()+1+"/"+e.getDate()+"/"+(e.getFullYear()+"").substring(2);break;case"mm/dd/yy":l+=e.getMonth()+1+"/"+(e.getDate()<10?"0":"")+e.getDate()+"/"+(e.getFullYear()+"").substring(2);break;case"mm/dd/yyyy hh:mm":l+=e.getMonth()+1+"/"+e.getDate()+"/"+e.getFullYear()+" ",l+=e.getHours()+":",l+=(e.getMinutes()<10?"0"+e.getMinutes():e.getMinutes())+" ";break;case"mm/dd h:m":case"mm/dd h:m a":case"mm/dd h:mm a":case"mm/dd h:mm am":case", mm/dd h:m":case", mm/dd h:m a":case", mm/dd h:mm a":case", mm/dd h:mm am":0===t.indexOf(", ")&&(l=l.trim()+", "),l+=e.getMonth()+1+"/"+(e.getDate()<10?"0":"")+e.getDate()+" ",l+=(0===e.getHours()?"12":e.getHours()>12?e.getHours()-12:e.getHours())+":",l+=e.getMinutes()<10?"0"+e.getMinutes():e.getMinutes(),l+="mm/dd h:mm am"===t?e.getHours()>11?" PM":" AM":e.getHours()>11?"P":"A";break;case"mm/dd/yy h:m":case"mm/dd/yy h:m a":case"mm/dd/yy h:mm a":case"mm/dd/yy h:mm am":l+=e.getMonth()+1+"/"+(e.getDate()<10?"0":"")+e.getDate()+"/"+(e.getFullYear()+"").substring(2)+" ",l+=(0===e.getHours()?"12":e.getHours()>12?e.getHours()-12:e.getHours())+":",l+=e.getMinutes()<10?"0"+e.getMinutes():e.getMinutes(),l+="mm/dd/yy h:mm am"===t?e.getHours()>11?" PM":" AM":e.getHours()>11?"P":"A";break;case"mm/dd/yyyy h:m":case"mm/dd/yyyy h:m a":case"mm/dd/yyyy h:mm a":case"mm/dd/yyyy h:mm am":l+=e.getMonth()+1+"/"+(e.getDate()<10?"0":"")+e.getDate()+"/"+e.getFullYear()+" ",l+=(0===e.getHours()?"12":e.getHours()>12?e.getHours()-12:e.getHours())+":",l+=e.getMinutes()<10?"0"+e.getMinutes():e.getMinutes(),l+="mm/dd/yyyy h:mm am"===t?e.getHours()>11?" PM":" AM":e.getHours()>11?"P":"A";break;case"mm/dd/yyyy h:m a z":case"mm/dd/yyyy h:mm a z":case"mm/dd/yyyy h:mm a [z]":case"mm/dd/yyyy h:mm am [z]":var c;l+=e.getMonth()+1+"/"+(e.getDate()<10?"0":"")+e.getDate()+"/"+e.getFullYear()+" ",l+=(0===e.getHours()?"12":e.getHours()>12?e.getHours()-12:e.getHours())+":",l+=e.getMinutes()<10?"0"+e.getMinutes():e.getMinutes(),l+="mm/dd/yyyy h:mm am [z]"===t?e.getHours()>11?" PM":" AM":e.getHours()>11?"P":"A",(c=""+e).indexOf("(")>0&&(c=occ.formatDateTZ(c),"mm/dd/yyyy h:mm a [z]"===t&&(c=" <span>"+c+"</span>"),l+=" "+c);break;case"mm/dd/yyyy hh:mm zno":l+=e.getMonth()+1+"/"+(e.getDate()<10?"0":"")+e.getDate()+"/"+e.getFullYear()+" ",l+=e.getHours()+":",l+=e.getMinutes()<10?"0"+e.getMinutes():e.getMinutes();var i=e.getTimezoneOffset()/60+"";l+=" -"+(i.indexOf(".")>-1?i.replace(".","")+"0":i+"00");break;case"hh:mm mm/dd/yyyy":l+=e.getHours()+":",l+=(e.getMinutes()<10?"0"+e.getMinutes():e.getMinutes())+" ",l+=e.getMonth()+1+"/"+(e.getDate()<10?"0":"")+e.getDate()+"/"+e.getFullYear();break;case"h:m mm/dd/yyyy":case"h:m a mm/dd/yyyy":case"h:mm a mm/dd/yyyy":l+=(e.getHours()>12?e.getHours()-12:e.getHours())+":",l+=e.getMinutes()<10?"0"+e.getMinutes():e.getMinutes(),l+=(e.getHours()>11?"PM":"AM")+" ",l+=e.getMonth()+1+"/"+(e.getDate()<10?"0":"")+e.getDate()+"/"+e.getFullYear();break;case"sqlnotime":l=(e.getMonth()<9?"0"+(e.getMonth()+1):e.getMonth()+1)+"/"+(e.getDate()<10?"0"+e.getDate():e.getDate())+"/"+e.getFullYear(),l+=" 00:00:00"+(o?"":" -0"+e.getTimezoneOffset()/60+":00");break;case"sql":l=(e.getMonth()<9?"0"+(e.getMonth()+1):e.getMonth()+1)+"/"+(e.getDate()<10?"0"+e.getDate():e.getDate())+"/"+e.getFullYear(),l+=" "+(e.getHours()<10?"0"+e.getHours():e.getHours()),l+=":"+(e.getMinutes()<10?"0"+e.getMinutes():e.getMinutes()),l+=":00"+(o?"":" -0"+e.getTimezoneOffset()/60+":00");break;case"c#notime":l=e.getFullYear(),l+="/"+(e.getMonth()<9?"0"+(e.getMonth()+1):e.getMonth()+1)+"/"+(e.getDate()<10?"0"+e.getDate():e.getDate()),l+=" 00:00"+(o?"":" -0"+e.getTimezoneOffset()/60+":00");break;case"c#":l=e.getFullYear(),l+="/"+(e.getMonth()<9?"0"+(e.getMonth()+1):e.getMonth()+1),l+="/"+(e.getDate()<10?"0"+e.getDate():e.getDate()),l+=" "+(e.getHours()<10?"0"+e.getHours():e.getHours()),l+=":"+(e.getMinutes()<10?"0"+e.getMinutes():e.getMinutes())+":"+(e.getSeconds()<10?"0"+e.getSeconds():e.getSeconds()),l+=o?"":" -0"+e.getTimezoneOffset()/60+":00";break;case"yyyy-MM-dd":case"yyyy-mm-dd":l=e.getFullYear(),l+="-"+(e.getMonth()<9?"0"+(e.getMonth()+1):e.getMonth()+1),l+="-"+(e.getDate()<10?"0"+e.getDate():e.getDate());break;case"yyyy-MM-dd-HH-mm-ss":case"yyyy-MM-dd-HH-mm-ssss":l=e.getFullYear(),l+="-"+(e.getMonth()<9?"0"+(e.getMonth()+1):e.getMonth()+1),l+="-"+(e.getDate()<10?"0"+e.getDate():e.getDate()),l+="-"+(e.getHours()<10?"0"+e.getHours():e.getHours()),l+="-"+(e.getMinutes()<10?"0"+e.getMinutes():e.getMinutes())+"-"+(e.getSeconds()<10?"0"+e.getSeconds():e.getSeconds()),"yyyy-MM-dd-HH-mm-ssss"===t&&(l+=""+e.getMilliseconds());break;case"JS":case"js":case"yyyy-MM-ddTHH:mm:ss":l=e.getFullYear(),l+="-"+(e.getMonth()<9?"0"+(e.getMonth()+1):e.getMonth()+1),l+="-"+(e.getDate()<10?"0"+e.getDate():e.getDate()),l+="T"+(e.getHours()<10?"0"+e.getHours():e.getHours()),l+=":"+(e.getMinutes()<10?"0"+e.getMinutes():e.getMinutes())+":"+(e.getSeconds()<10?"0"+e.getSeconds():e.getSeconds())}return l}},ocCommon.prototype.formatDateTZ=function(e){let t=(e=(e=e.substring(e.indexOf("("))).replace("(","").replace(")","")).split(" ");e=" ";for(let o=0;o<t.length;o++)e+=t[o].substr(0,1);return e},ocCommon.prototype.formatNumber=function(e){return e.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")},ocCommon.prototype.formatMoney=function(e,t,o,l){t=isNaN(t=Math.abs(t))?2:t,o=void 0===o?".":o,l=void 0===l?",":l;var c=Number(e);isNaN(c)&&(c=0);var i=c<0?"-":"",a=Math.abs(c),n=t;0===t&&(n=Math.round(100*a)%100==0?0:2);var r=a.toFixed(n).split("."),s=r[0].replace(/\B(?=(\d{3})+(?!\d))/g,l),d=r[1]||"";return"$"+i+s+(n?o+d:"")},ocCommon.prototype.clickPhoneBtn=function(e){e.preventDefault(),e.stopPropagation();let t=e.currentTarget.getAttribute("data-phone");if(0==occ.isNothingOrEmpty(t))if(occ.isMobile)window.location.href="tel:"+t;else{let o=e.currentTarget.querySelector("textarea");o||(o=document.createElement("textarea"),o.classList="hiddenObj tempobj",e.currentTarget.appendChild(o),o=e.currentTarget.querySelector("textarea")),o.value=t,mwJsCopyToClipboard(o)}},ocCommon.prototype.formatEmailElements=function(e){e&&null!==e||(e=document.body);let t=e.querySelectorAll(".ocEmailFormat");for(let e=0;e<t.length;e++)t[e].innerHTML=occ.formatEmail(t[e].innerText,t[e].getAttribute("data-tag"),t[e].getAttribute("data-mask"),t[e].getAttribute("data-label")),occ.removeClass(t[e],"ocEmailFormat")},ocCommon.prototype.formatEmail=function(e,t,o,l){if(!0===t&&(t="a"),!0===occ.isNothingOrEmpty(t)&&(t="a"),o=!0!==occ.isNothingOrEmpty(o)&&("true"===o||
3!0===o),!e||null==e)return"";let c=e+"";!0===occ.hasClass(document.body,"maskOcEmails")&&(o=!0),!0===o&&(e="Email");let i="";return!1===occ.isNothingOrEmpty(l)?!0!==o?l="<span>"+l.substring(0,1).toLowerCase()+". </span>":(i=" wider",l=" "+l):l="",!1===occ.isNothingOrEmpty(t)&&(!0===o?e+=l:e=l+e),"button"===t?e='<button class="opoClient-btn sz3 emailBtn'+i+' withIcon" onpointerup="occ.clickEmailBtn(event)" type="button" data-email="'+c+'"><div class="s-mail sz3 tr icon"></div><span>'+e+"</span></button>":"a"===t&&(e='<a href="mailto:'+c+'">'+e+"</a>"),e},ocCommon.prototype.clickEmailBtn=function(e){e.preventDefault(),e.stopPropagation();let t=e.currentTarget.getAttribute("data-email");0==occ.isNothingOrEmpty(t)&&(window.location.href="mailto:"+t)},ocCommon.prototype.formatPhoneElements=function(e){e&&null!==e||(e=document.body);let t=e.querySelectorAll(".ocPhoneFormat");for(let e=0;e<t.length;e++)t[e].innerHTML=occ.formatTelephone(t[e].innerText,t[e].getAttribute("data-tag"),t[e].getAttribute("data-mask"),t[e].getAttribute("data-label")),occ.removeClass(t[e],"ocPhoneFormat")},ocCommon.prototype.setATarget=function(e,t,o){if(!0!==occ.isNothingOrEmpty(e)){t&&null!==t&&"string"==typeof t||(t="_blank"),e=occ.getElementsFromString(e);for(let l=0;l<e.length;l++){let c=e[l].querySelectorAll("a");for(let e=0;e<c.length;e++)!occ.isNothingOrEmpty(o)&&0===c[e].getAttribute("href").indexOf(o)||"javascript:;"===c[e].getAttribute("href")||!0!==occ.isNothingOrEmpty(c[e].getAttribute("target"))||c[e].setAttribute("target",t)}}},ocCommon.prototype.setAnAttribute=function(e,t,o,l,c){if(!(e=occ.getElementFromString(e))||null===e)return;if(!t||null===t||"string"!=typeof t)return;if(!o||null===o||"string"!=typeof o)return;if(!l||null===l||"string"!=typeof l)return;let i=e.querySelectorAll(t+(!0===c?"":":not(["+o+"])"));for(let e=0;e<i.length;e++)i[e].setAttribute(o,l)},ocCommon.prototype.dynamicSort=function(e){var t=1;return"-"===e[0]&&(t=-1,e=e.substr(1)),function(o,l){return-1==t?(l[e]+"").localeCompare(o[e]+""):(o[e]+"").localeCompare(l[e]+"")}};let eidCounter=0;ocCommon.prototype.eid=function(e){(!Number.isInteger(e)||e<=0)&&(e=8),e<3&&(e=3),e>9&&(e=9);const t=Date.now().toString(),o=(++eidCounter).toString(),l=e-o.length;if(l<=0)return"-"+t.slice(-e);let c=t.slice(-l)+o;return c.length>e&&(c=c.slice(c.length-e)),"-"+c};let occFieldIconStyleArray=[];ocCommon.prototype.getFieldIconStyleArray=function(e){return 0===occFieldIconStyleArray.length&&(occFieldIconStyleArray.push({eFieldOption:"0",fieldOption:"Artwork",fieldValue:"art",fieldImageUrl:"/ic?i=star&c1=transparent&c2=transparent&c3=%2387949D"}),occFieldIconStyleArray.push({eFieldOption:"1",fieldOption:"Circle",fieldValue:"circle",fieldImageUrl:"/ic?i=star&c1=transparent&c2=%2387949D&c3=%23fff"}),occFieldIconStyleArray.push({eFieldOption:"2",fieldOption:"Square",fieldValue:"square",fieldImageUrl:"/ic?i=star&c1=%2387949D&c2=transparent&c3=%23fff"}),e&&e.indexOf("ng")>-1&&occFieldIconStyleArray.push({eFieldOption:"3",fieldOption:"Shield",fieldValue:"ng",fieldImageUrl:"/ic?i=star&c1=%2387949D&c2=transparent&c3=%23fff&es=ng"})),occFieldIconStyleArray};let occFieldIconArray=[],occFieldIconTextArray=[];ocCommon.prototype.getFieldIconTextArray=function(e){return 0===occFieldIconTextArray.length&&(occFieldIconTextArray=JSON.parse(JSON.stringify(occ.getFieldIconArray(e)))),occFieldIconTextArray.push({fieldOption:"Custom Text",fieldValue:"text",afi:"Y"}),occFieldIconTextArray.sort(occ.dynamicSort("fieldOption")),occFieldIconTextArray},ocCommon.prototype.getFieldIconArray=function(e){return 0===occFieldIconArray.length&&(occFieldIconArray.push({fieldOption:"800",fieldValue:"800"}),occFieldIconArray.push({fieldOption:"3dots",fieldValue:"3dots"}),occFieldIconArray.push({fieldOption:"3circles",fieldValue:"3circles"}),occFieldIconArray.push({fieldOption:"Apple",fieldValue:"apple"}),occFieldIconArray.push({fieldOption:"Alert",fieldValue:"alert"}),occFieldIconArray.push({fieldOption:"AI",fieldValue:"ai"}),occFieldIconArray.push({fieldOption:"AI Search",fieldValue:"ai-search"}
3),occFieldIconArray.push({fieldOption:"Airplane",fieldValue:"airplane"}),occFieldIconArray.push({fieldOption:"Arrows",fieldValue:"arrows"}),occFieldIconArray.push({fieldOption:"Arrow Left",fieldValue:"arrow-left"}),occFieldIconArray.push({fieldOption:"Arrow Right",fieldValue:"arrow-right"}),occFieldIconArray.push({fieldOption:"Arrow Up",fieldValue:"arrow-up"}),occFieldIconArray.push({fieldOption:"Arrow Down",fieldValue:"arrow-down"}),occFieldIconArray.push({fieldOption:"Arrow UP/Down",fieldValue:"arrows-up-down"}),occFieldIconArray.push({fieldOption:"Arrow Inside",fieldValue:"arrow-in"}),occFieldIconArray.push({fieldOption:"ATM",fieldValue:"atm"}),occFieldIconArray.push({fieldOption:"@ at sign",fieldValue:"atsign"}),occFieldIconArray.push({fieldOption:"Barbell",fieldValue:"barbell"}),occFieldIconArray.push({fieldOption:"Bag",fieldValue:"bag"}),occFieldIconArray.push({fieldOption:"Ball Diamond",fieldValue:"balldiamond"}),occFieldIconArray.push({fieldOption:"Barricade",fieldValue:"barricade"}),occFieldIconArray.push({fieldOption:"Basket",fieldValue:"basket"}),occFieldIconArray.push({fieldOption:"Basketball Hoop",fieldValue:"basketball"}),occFieldIconArray.push({fieldOption:"Battery",fieldValue:"charge-battery"}),occFieldIconArray.push({fieldOption:"Bed",fieldValue:"bed"}),occFieldIconArray.push({fieldOption:"Bell",fieldValue:"bell"}),occFieldIconArray.push({fieldOption:"Bell - Alert",fieldValue:"bell-alert"}),occFieldIconArray.push({fieldOption:"Bike",fieldValue:"bike"}),occFieldIconArray.push({fieldOption:"Boat - large",fieldValue:"boat"}),occFieldIconArray.push({fieldOption:"Boat - small",fieldValue:"smallboat"}),occFieldIconArray.push({fieldOption:"Book",fieldValue:"book"}),occFieldIconArray.push({fieldOption:"Bulb",fieldValue:"bulb"}),occFieldIconArray.push({fieldOption:"Bullseye",fieldValue:"bullseye"}),occFieldIconArray.push({fieldOption:"Bus",fieldValue:"bus"}),occFieldIconArray.push({fieldOption:"Calendar",fieldValue:"calendar"}),occFieldIconArray.push({fieldOption:"Call",fieldValue:"call"}),occFieldIconArray.push({fieldOption:"Call: active",fieldValue:"call2"}),occFieldIconArray.push({fieldOption:"Camera",fieldValue:"camera"}),occFieldIconArray.push({fieldOption:"Car",fieldValue:"car"}),occFieldIconArray.push({fieldOption:"Charge station",fieldValue:"charge-station"}),occFieldIconArray.push({fieldOption:"Chat",fieldValue:"chat"}),occFieldIconArray.push({fieldOption:"Checkmark",fieldValue:"check"}),occFieldIconArray.push({fieldOption:"Church",fieldValue:"church"}),occFieldIconArray.push({fieldOption:"City Hall",fieldValue:"cityhall"}),occFieldIconArray.push({fieldOption:"Clock",fieldValue:"clock"}),occFieldIconArray.push({fieldOption:"Clover",fieldValue:"clover"}),occFieldIconArray.push({fieldOption:"Coffee",fieldValue:"coffee"}),occFieldIconArray.push({fieldOption:"Collaboration",fieldValue:"collab"}),occFieldIconArray.push({fieldOption:"Conversations",fieldValue:"convo"}),occFieldIconArray.push({fieldOption:"Shrink/Contract",fieldValue:"contract"}),occFieldIconArray.push({fieldOption:"Document",fieldValue:"doc"}),occFieldIconArray.push({fieldOption:"Document - Locked",fieldValue:"doc-lock"}),occFieldIconArray.push({fieldOption:"Droplet",fieldValue:"droplet"}),occFieldIconArray.push({fieldOption:"EMS - Emergency Medical Services",fieldValue:"ems"}),occFieldIconArray.push({fieldOption:"Envelope ",fieldValue:"mail"}),occFieldIconArray.push({fieldOption:"Expand",fieldValue:"expand"}),occFieldIconArray.push({fieldOption:"External Link",fieldValue:"external-link"}),occFieldIconArray.push({fieldOption:"Exclamation",fieldValue:"exclamation"}),occFieldIconArray.push({fieldOption:"Eye",fieldValue:"eye"}),occFieldIconArray.push({fieldOption:"Facebook",fieldValue:"facebook"}),occFieldIconArray.push({fieldOption:"Fax",fieldValue:"fax"}),occFieldIconArray.push({fieldOption:"Faucet",fieldValue:"faucet"}),occFieldIconArray.push({fieldOption:"Fire",fieldValue:"fire"}),occFieldIconArray.push({fieldOption:"Fire Department",fieldValue:"firedepartment"}),occFieldIconArray.push({fieldOption:"Fire Hydrant",fieldValue:"firehydrant"}
3),occFieldIconArray.push({fieldOption:"First-Aid",fieldValue:"firstaid"}),occFieldIconArray.push({fieldOption:"Fish Hook",fieldValue:"fishhook"}),occFieldIconArray.push({fieldOption:"Folder",fieldValue:"folder"}),occFieldIconArray.push({fieldOption:"Folder - Locked",fieldValue:"folder-lock"}),occFieldIconArray.push({fieldOption:"Folder - plus",fieldValue:"folder-add"}),occFieldIconArray.push({fieldOption:"Folder - open",fieldValue:"folder-open"}),occFieldIconArray.push({fieldOption:"Folder - open - Locked",fieldValue:"folder-open-lock"}),occFieldIconArray.push({fieldOption:"Folder - down",fieldValue:"folder-down"}),occFieldIconArray.push({fieldOption:"Folder - up",fieldValue:"folder-up"}),occFieldIconArray.push({fieldOption:"Football Field",fieldValue:"footballfield"}),occFieldIconArray.push({fieldOption:"Gavel",fieldValue:"gavel"}),occFieldIconArray.push({fieldOption:"Globe",fieldValue:"globe"}),occFieldIconArray.push({fieldOption:"Gear",fieldValue:"gear"}),occFieldIconArray.push({fieldOption:"Graduation Cap",fieldValue:"gradcap"}),occFieldIconArray.push({fieldOption:"Graph line",fieldValue:"graph"}),occFieldIconArray.push({fieldOption:"Gravestone",fieldValue:"gravestone"}),occFieldIconArray.push({fieldOption:"Grid Edit",fieldValue:"gridedit"}),occFieldIconArray.push({fieldOption:"Group",fieldValue:"group"}),occFieldIconArray.push({fieldOption:"H",fieldValue:"H"}),occFieldIconArray.push({fieldOption:"Hair Brush",fieldValue:"hairbrush"}),occFieldIconArray.push({fieldOption:"Hand - palmup",fieldValue:"hand-palmup"}),occFieldIconArray.push({fieldOption:"House",fieldValue:"home"}),occFieldIconArray.push({fieldOption:"Hospital",fieldValue:"hospital"}),occFieldIconArray.push({fieldOption:"Image",fieldValue:"image"}),occFieldIconArray.push({fieldOption:"Info",fieldValue:"info"}),occFieldIconArray.push({fieldOption:"Instagram",fieldValue:"instagram"}),occFieldIconArray.push({fieldOption:"Link",fieldValue:"link"}),occFieldIconArray.push({fieldOption:"Layers",fieldValue:"layers"}),occFieldIconArray.push({fieldOption:"Layout",fieldValue:"layout"}),occFieldIconArray.push({fieldOption:"Lightning",fieldValue:"lightning"}),occFieldIconArray.push({fieldOption:"Linkedin",fieldValue:"linkedin"}),occFieldIconArray.push({fieldOption:"List",fieldValue:"list"}),occFieldIconArray.push({fieldOption:"Magnify",fieldValue:"magnify"}),occFieldIconArray.push({fieldOption:"Masks",fieldValue:"masks"}),occFieldIconArray.push({fieldOption:"Minus/Dash",fieldValue:"minus"}),occFieldIconArray.push({fieldOption:"Map",fieldValue:"map"}),occFieldIconArray.push({fieldOption:"Map pin (light)",fieldValue:"mappin"}),occFieldIconArray.push({fieldOption:"Map pin (medium)",fieldValue:"location"}),occFieldIconArray.push({fieldOption:"Map pin (dark)",fieldValue:"mappin2"}),occFieldIconArray.push({fieldOption:"Microphone",fieldValue:"microphone"}),occFieldIconArray.push({fieldOption:"Microphone - off",fieldValue:"microphone-off"}),occFieldIconArray.push({fieldOption:"Money",fieldValue:"money"}),occFieldIconArray.push({fieldOption:"Parks",fieldValue:"parks"}),occFieldIconArray.push({fieldOption:"Parks & Rec",fieldValue:"parksrec"}),occFieldIconArray.push({fieldOption:"Paint Brush",fieldValue:"paintbrush"}),occFieldIconArray.push({fieldOption:"Paint Palette",fieldValue:"palette"}),occFieldIconArray.push({fieldOption:"Parking",fieldValue:"parking"}),occFieldIconArray.push({fieldOption:"Pencil",fieldValue:"pencil"}),occFieldIconArray.push({fieldOption:"PDF",fieldValue:"pdf"}),occFieldIconArray.push({fieldOption:"Person",fieldValue:"person"}),occFieldIconArray.push({fieldOption:"Phone",fieldValue:"phone"}),occFieldIconArray.push({fieldOption:"Picnic Table",fieldValue:"picnictable"}),occFieldIconArray.push({fieldOption:"Pinterest",fieldValue:"pinterest"}),occFieldIconArray.push({fieldOption:"Play Arrow",fieldValue:"play"}),occFieldIconArray.push({fieldOption:"Plus",fieldValue:"plus"}),occFieldIconArray.push({fieldOption:"Police",fieldValue:"police"}),occFieldIconArray.push({fieldOption:"Recreation",fieldValue:"rec"}),occFieldIconArray.push({fieldOption:"Refresh",fieldValue:"refresh"}
3),occFieldIconArray.push({fieldOption:"Restroom",fieldValue:"restroom"}),occFieldIconArray.push({fieldOption:"Restroom - handicap",fieldValue:"restroom-handicap"}),occFieldIconArray.push({fieldOption:"Rifle",fieldValue:"rifle"}),occFieldIconArray.push({fieldOption:"Rotate",fieldValue:"rotate"}),occFieldIconArray.push({fieldOption:"Scale",fieldValue:"scale"}),occFieldIconArray.push({fieldOption:"School",fieldValue:"school"}),occFieldIconArray.push({fieldOption:"Scissors",fieldValue:"scissors"}),occFieldIconArray.push({fieldOption:"Scooter",fieldValue:"scooter"}),occFieldIconArray.push({fieldOption:"Screenshare",fieldValue:"screenshare"}),occFieldIconArray.push({fieldOption:"Shovel",fieldValue:"shovel"}),occFieldIconArray.push({fieldOption:"Silverware",fieldValue:"silverware"}),occFieldIconArray.push({fieldOption:"Sliders",fieldValue:"sliders"}),occFieldIconArray.push({fieldOption:"Soccer Field",fieldValue:"rec"}),occFieldIconArray.push({fieldOption:"Sound",fieldValue:"sound"}),occFieldIconArray.push({fieldOption:"Squares",fieldValue:"squares"}),occFieldIconArray.push({fieldOption:"Star - open",fieldValue:"star"}),occFieldIconArray.push({fieldOption:"Star",fieldValue:"star2"}),occFieldIconArray.push({fieldOption:"Swim",fieldValue:"swim"}),occFieldIconArray.push({fieldOption:"Train",fieldValue:"train"}),occFieldIconArray.push({fieldOption:"Triangle - down",fieldValue:"triangle-down"}),occFieldIconArray.push({fieldOption:"Triangle - up",fieldValue:"triangle-up"}),occFieldIconArray.push({fieldOption:"Thumbs Down",fieldValue:"thumbsdown"}),occFieldIconArray.push({fieldOption:"Thumbs Up",fieldValue:"thumbsup"}),occFieldIconArray.push({fieldOption:"Threads",fieldValue:"threads"}),occFieldIconArray.push({fieldOption:"TikTok",fieldValue:"tiktok"}),occFieldIconArray.push({fieldOption:"Twinkles",fieldValue:"twinkles"}),occFieldIconArray.push({fieldOption:"X (Twitter)",fieldValue:"x-twitter"}),occFieldIconArray.push({fieldOption:"Twitter",fieldValue:"twitter"}),occFieldIconArray.push({fieldOption:"UofNebraska",fieldValue:"uofnebraska"}),occFieldIconArray.push({fieldOption:"Undo",fieldValue:"undo"}),occFieldIconArray.push({fieldOption:"Redo",fieldValue:"redo"}),occFieldIconArray.push({fieldOption:"Vote - Ballot Box",fieldValue:"votingbox"}),occFieldIconArray.push({fieldOption:"Wheelchair",fieldValue:"wheelchair"}),occFieldIconArray.push({fieldOption:"WiFi",fieldValue:"wifi"}),occFieldIconArray.push({fieldOption:"X",fieldValue:"x"}),occFieldIconArray.push({fieldOption:"YouTube",fieldValue:"youtube"}),occFieldIconArray.push({fieldOption:"Goose",fieldValue:"goose"}),occFieldIconArray.push({fieldOption:"Music",fieldValue:"music"}),occFieldIconArray.push({fieldOption:"Clipboard: Budget",fieldValue:"budget"}),occFieldIconArray.push({fieldOption:"Clipboard: Project",fieldValue:"project"}),occFieldIconArray.push({fieldOption:"Garbage Can",fieldValue:"garbage"}),occFieldIconArray.push({fieldOption:"Newspaper",fieldValue:"news"}),occFieldIconArray.push({fieldOption:"Building",fieldValue:"building"}),occFieldIconArray.push({fieldOption:"Funnel",fieldValue:"funnel"}),occFieldIconArray.push({fieldOption:"Lock",fieldValue:"lock"}),occFieldIconArray.push({fieldOption:"Lock: Open",fieldValue:"lockopen"}),occFieldIconArray.push({fieldOption:"Briefcase",fieldValue:"briefcase"}),occFieldIconArray.push({fieldOption:"Paw Print",fieldValue:"pawprint"}),occFieldIconArray.push({fieldOption:"Accessibility",fieldValue:"accessibility"}),occFieldIconArray.push({fieldOption:"Accessibility: Document",fieldValue:"accessibility-doc"}),occFieldIconArray.sort(occ.dynamicSort("fieldOption"))),occFieldIconArray},ocCommon.prototype.addFieldIconArray=function(e,t){if(Array.isArray(t)&&t.length>0){0===occFieldIconArray.length&&occ.getFieldIconArray(e),0===occFieldIconTextArray.length&&occ.getFieldIconTextArray(e);for(let e=0;e<t.length;e++)!0!==t[e].added&&(occFieldIconArray.push({fieldOption:t[e].iconName,fieldValue:"customicon"+t[e].iconId}),occFieldIconTextArray.push({fieldOption:t[e].iconName,fieldValue:"customicon"+t[e].iconId}),t[e].added=!0);occFieldIconTextArray.sort(occ.dynamicSort("fieldOption")),occFieldIconArray.sort(occ.dynamicSort("fieldOption"))}};let occFieldTZArray=[];ocCommon.prototype.getFieldTZArray=function(){return 0===occFieldTZArray.length&&(occFieldTZArray.push({f
3ieldOption:"Alaskan Time",fieldValue:"Alaskan Standard Time"}),occFieldTZArray.push({fieldOption:"Central Time",fieldValue:"Central Standard Time"}),occFieldTZArray.push({fieldOption:"Eastern Time",fieldValue:"Eastern Standard Time"}),occFieldTZArray.push({fieldOption:"Hawaiian Time",fieldValue:"Hawaiian Standard Time"}),occFieldTZArray.push({fieldOption:"Mountain Time",fieldValue:"Mountain Standard Time"}),occFieldTZArray.push({fieldOption:"Pacific Time",fieldValue:"Pacific Standard Time"})),occFieldTZArray};let occFieldMonthArray=[];ocCommon.prototype.getFieldMonthArray=function(){return 0===occFieldMonthArray.length&&(occFieldMonthArray.push({fieldOption:"January",fieldValue:"1"}),occFieldMonthArray.push({fieldOption:"February",fieldValue:"2"}),occFieldMonthArray.push({fieldOption:"March",fieldValue:"3"}),occFieldMonthArray.push({fieldOption:"April",fieldValue:"4"}),occFieldMonthArray.push({fieldOption:"May",fieldValue:"5"}),occFieldMonthArray.push({fieldOption:"June",fieldValue:"6"}),occFieldMonthArray.push({fieldOption:"July",fieldValue:"7"}),occFieldMonthArray.push({fieldOption:"August",fieldValue:"8"}),occFieldMonthArray.push({fieldOption:"September",fieldValue:"9"}),occFieldMonthArray.push({fieldOption:"October",fieldValue:"10"}),occFieldMonthArray.push({fieldOption:"November",fieldValue:"11"}),occFieldMonthArray.push({fieldOption:"December",fieldValue:"12"})),occFieldMonthArray};let occMinFieldTypeArray=[],occFieldTypeArray=[],occFullFieldTypeArray=[];ocCommon.prototype.getMinFieldTypeArray=function(){return 0===occMinFieldTypeArray.length&&(occMinFieldTypeArray.push({fieldOption:"Checkbox",fieldValue:"checkbox"}),occMinFieldTypeArray.push({fieldOption:"Color Picker",fieldValue:"color"}),occMinFieldTypeArray.push({fieldOption:"Date Picker",fieldValue:"occalendar"}),occMinFieldTypeArray.push({fieldOption:"Email",fieldValue:"email"}),occMinFieldTypeArray.push({fieldOption:"Number",fieldValue:"number"}),occMinFieldTypeArray.push({fieldOption:"Phone",fieldValue:"tel"}),occMinFieldTypeArray.push({fieldOption:"Phone + Extension",fieldValue:"telExt"}),occMinFieldTypeArray.push({fieldOption:"Switch: Yes/No",fieldValue:"yesno"}),occMinFieldTypeArray.push({fieldOption:"Switch: On/Off",fieldValue:"onoff"}),occMinFieldTypeArray.push({fieldOption:"Zip",fieldValue:"zip"}),occMinFieldTypeArray.push({fieldOption:"Text (single Line)",fieldValue:"text"}),occMinFieldTypeArray.push({fieldOption:"Text (plain block)",fieldValue:"textarea"}),occMinFieldTypeArray.push({fieldOption:"Text (rich block)",fieldValue:"richtext"}),occMinFieldTypeArray.sort(occ.dynamicSort("fieldOption"))),occMinFieldTypeArray},ocCommon.prototype.getFieldTypeArray=function(){return 0===occFieldTypeArray.length&&(0===occMinFieldTypeArray.length&&occ.getMinFieldTypeArray(),occFieldTypeArray=JSON.parse(JSON.stringify(occMinFieldTypeArray)),occFieldTypeArray.push({fieldOption:"Social Media",fieldValue:"membersocial"}),occFieldTypeArray.push({fieldOption:"File",fieldValue:"file"}),occFieldTypeArray.push({fieldOption:"Files w/captions",fieldValue:"fileplus"}),occFieldTypeArray.push({fieldOption:"Image",fieldValue:"image"}),occFieldTypeArray.push({fieldOption:"Images w/captions",fieldValue:"imageplus"}),occFieldTypeArray.push({fieldOption:"Data Selection: Preset List",fieldValue:"fieldObj"}),occFieldTypeArray.push({fieldOption:"Data Selection: Custom List",fieldValue:"fieldObj-c"}),occFieldTypeArray.push({fieldOption:"Video URL",fieldValue:"videolink"}),occFieldTypeArray.push({fieldOption:"URL/Website",fieldValue:"link"}),occFieldTypeArray.push({fieldOption:"URL/Website + Email",fieldValue:"link-email"}),occFieldTypeArray.sort(occ.dynamicSort("fieldOption"))),occFieldTypeArray},ocCommon.prototype.getFullFieldTypeArray=function(){return 0===occFullFieldTypeArray.length&&(0===occFieldTypeArray.length&&occ.getFieldTypeArray(),occFullFieldTypeArray=JSON.parse(JSON.stringify(occFieldTypeArray)),occFullFieldTypeArray.push({fieldOption:"URL/Website + Page",fieldValue:"link-page"}),occFullFieldTypeArray.push({fieldOption:"URL/Website + Email + Page",fieldValue:"link-email-page"}),occFullFieldTypeArray.sort(occ.dynamicSort("fieldOption"))),occFullFieldTypeArray};let occColsArray=[];ocCommon.prototype.getColsArray=function(){return 0===occColsArray.length&&(occColsArray.push({f
3ieldOption:"100%",fieldValue:"col-1"}),occColsArray.push({fieldOption:"66%",fieldValue:"col-2-5"}),occColsArray.push({fieldOption:"50%",fieldValue:"col-2"}),occColsArray.push({fieldOption:"33%",fieldValue:"col-3"}),occColsArray.push({fieldOption:"25%",fieldValue:"col-4"})),occColsArray};let ocFontsArray=[];ocCommon.prototype.getFontsArray=function(){return 0===ocFontsArray.length&&(ocFontsArray.push({fieldOption:"Default",fieldValue:""}),ocFontsArray.push({fieldOption:"Arial",fieldValue:"fontArial"}),ocFontsArray.push({fieldOption:"Baskerville",fieldValue:"fontBaskerville"}),ocFontsArray.push({fieldOption:"Calibri",fieldValue:"fontCalibri"}),ocFontsArray.push({fieldOption:"Cambria",fieldValue:"fontCambria"}),ocFontsArray.push({fieldOption:"Century Gothic",fieldValue:"fontCenturyGothic"}),ocFontsArray.push({fieldOption:"Georgia",fieldValue:"fontGeorgia"}),ocFontsArray.push({fieldOption:"Gill Sans",fieldValue:"fontGillSans"}),ocFontsArray.push({fieldOption:"Helvetica",fieldValue:"fontHelvetica"}),ocFontsArray.push({fieldOption:"Tahoma",fieldValue:"fontTahoma"}),ocFontsArray.push({fieldOption:"Times New Roman",fieldValue:"fontTimesNewRoman"})),ocFontsArray};let occEntityArray=[];ocCommon.prototype.getEntityArray=function(e){return 0===occEntityArray.length&&(occEntityArray.push({fieldOption:"Individual",fieldValue:"Person"}),occEntityArray.push({fieldOption:"Business",fieldValue:"Account"}),!0===e?(occEntityArray.push({fieldOption:"Post: Event",fieldValue:"Event"}),occEntityArray.push({fieldOption:"Post: News",fieldValue:"News"}),occEntityArray.push({fieldOption:"Post: Job",fieldValue:"Job"}),occEntityArray.push({fieldOption:"Post: Reminder",fieldValue:"Reminder"}),occEntityArray.push({fieldOption:"Post: General",fieldValue:"General"})):occEntityArray.push({fieldOption:"Post",fieldValue:"Post"}),occEntityArray.push({fieldOption:"Property",fieldValue:"Spot"}),occEntityArray.push({fieldOption:"Resource",fieldValue:"Resource"})),occEntityArray};let occStandardArray=[];ocCommon.prototype.getStandardArray=function(){return 0===occStandardArray.length&&(occStandardArray.push({fieldOption:"Standard",fieldValue:"S"}),occStandardArray.push({fieldOption:"Custom",fieldValue:"C"})),occStandardArray};let occAlignmentArray=[];ocCommon.prototype.getAlignmentArray=function(){return 0===occAlignmentArray.length&&(occAlignmentArray.push({fieldOption:"Left",fieldValue:"left"}),occAlignmentArray.push({fieldOption:"Center",fieldValue:"center"}),occAlignmentArray.push({fieldOption:"Right",fieldValue:"right"})),occAlignmentArray},ocCommon.prototype.getFieldMonthDayArray=function(e,t,o){if("string"==typeof t&&(t.indexOf("-sel")>0&&(t=t.replace("-sel","")),document.getElementById(t)&&!1===occ.isNothingOrEmpty(document.getElementById(t).value))){let o=1*document.getElementById(t).value;NaN!==o&&(e=o)}let l=[],c=31;switch(o*=1,e+""){case"1":case"3":case"5":case"7":case"8":case"10":case"12":c=31;break;case"4":case"6":case"9":case"11":c=30;break;case"2":c=28,(0==o%4&&0!=o%100||0==o%400)&&(c=29)}for(let e=0;e<c;e++)l.push({fieldOptionId:e,eFieldOptionId:"e-"+e,fieldOption:e+1+"",fieldValue:e+1+""});return l},ocCommon.prototype.getFieldMinutesArray=function(e){let t=[];e&&null!=e||(e=1);for(let o=0;o<60/e;o++){let l=e*o;t.push({fieldOptionId:0,fieldOption:(l<10?"0":"")+l,fieldValue:(l<10?"0":"")+l})}return t},ocCommon.prototype.getFieldHoursArray=function(e){let t=[];e&&null!=e||(e=12);for(let o=0;o<e;o++)t.push({fieldOptionId:o,fieldOption:o+1+"",fieldValue:o+1+""});return t},ocCommon.prototype.getFieldAMPMArray=function(e){return[{fieldValue:"AM",fieldOption:"AM"},{fieldValue:"PM",fieldOption:"PM"}]};let occFieldDayArray=[];ocCommon.prototype.getFieldDayArray=function(){return 0===occFieldDayArray.length&&(occFieldDayArray.push({fieldOptionId:0,fieldOption:"Sunday",fieldValue:"0"}),occFieldDayArray.push({fieldOptionId:1,fieldOption:"Monday",fieldValue:"1"}),occFieldDayArray.push({fieldOptionId:2,fieldOption:"Tuesday",fieldValue:"2"}),occFieldDayArray.push({fieldOptionId:3,fieldOption:"Wednesday",fieldValue:"3"}),occFieldDayArray.push({fieldOptionId:4,fieldOption:"Thursday",fieldValue:"4"}
3),occFieldDayArray.push({fieldOptionId:5,fieldOption:"Friday",fieldValue:"5"}),occFieldDayArray.push({fieldOptionId:6,fieldOption:"Saturday",fieldValue:"6"})),occFieldDayArray};let occFieldWDayArray=[];function ocMinResize(e){null!==document&&document.body?("function"==typeof ocFieldResize&&ocFieldResize(e),"function"==typeof ocFormResize&&ocFormResize(e),"function"==typeof ocCommonResize&&ocCommonResize(e),0==occ.hasClass(document.body,"naturalHeight")&&(document.body.style.height=window.innerHeight+"px"),"function"==typeof ocCalendarResize&&ocCalendarResize(e)):setTimeout("ocMinResize(null);",100)}function occInitPause(e){if("function"==typeof occInitPauseField&&occInitPauseField(e),"function"==typeof occInitPauseForm&&occInitPauseForm(e),"function"==typeof occInitPauseCommon&&occInitPauseCommon(e),occ.formatPhoneElements(),1===e)try{afterOccLoad()}catch(e){setTimeout(function(){try{afterOccLoad()}catch(e){}},200)}}ocCommon.prototype.getFieldWDayArray=function(){return 0===occFieldWDayArray.length&&(occFieldWDayArray.push({fieldOptionId:1,fieldOption:"Monday",fieldValue:"1"}),occFieldWDayArray.push({fieldOptionId:2,fieldOption:"Tuesday",fieldValue:"2"}),occFieldWDayArray.push({fieldOptionId:3,fieldOption:"Wednesday",fieldValue:"3"}),occFieldWDayArray.push({fieldOptionId:4,fieldOption:"Thursday",fieldValue:"4"}),occFieldWDayArray.push({fieldOptionId:5,fieldOption:"Friday",fieldValue:"5"})),occFieldWDayArray},ocCommon.prototype.setAIRules=function(e){Array.isArray(e)&&(occ.aiRules=e)},ocCommon.prototype.resetOcFieldSelect=function(e){if(null===e){let e=document.querySelectorAll("div.select.open");for(let t=0;t<e.length;t++)occ.resetOcFieldSelect(e[t]);return}e.style.width="",e.style.bottom="",e.style.top="",e.style.left="";let t=e.parentElement.querySelector("label");t&&(t.style.marginBottom=""),occ.showObj(e.parentElement.querySelector("button.selBtn")),occ.showObj(e.parentElement.querySelector("div.ctrl-other")),!1===occ.hasClass(e.parentElement,"autoWidth")&&(e.parentElement.style.width=""),e.parentElement.style.height="",e.querySelector("div.icon")&&(e.querySelector("div.icon").style.top="6px"),occ.removeClass(e.querySelectorAll("div.preSelected.ocFieldOption"),"preSelected"),occ.removeClass(e,"open")},ocCommon.prototype.isOnScreen=function(e,t,o,l,c,i,a){if(l||(l=0),c||(c=0),i||(i=0),a||(a=0),e=occ.getElementFromString(e),!(t=occ.getElementFromString(t))||!e)return!1;const n=e.getBoundingClientRect(),r=t.getBoundingClientRect();let s={doMove:!1,moveTop:r.top+l-n.top,moveBottom:r.bottom-i-n.bottom,moveLeft:r.left+a-n.left,moveRight:r.right-c-n.right};return s.moveTop<=0?(s.moveTop=0,s.moveBottom>=0?s.moveBottom=0:s.doMove=!0):(s.moveBottom=0,s.doMove=!0),s.moveLeft<=0?(s.moveLeft=0,s.moveRight>=0?s.moveRight=0:s.doMove=!0):(s.moveRight=0,s.doMove=!0),!0===o&&!0===s.doMove&&t.scrollTo({top:t.scrollTop+-1*(s.moveTop+s.moveBottom),left:t.scrollLeft+-1*(s.moveLeft+s.moveRight),behavior:"smooth"}),!s.doMove},ocCommon.prototype.jsonParse=function(e,t){let o=null;if("string"==typeof e)try{o=JSON.parse(e)}catch(e){}else o=e;return t&&null===o&&(o="array"===t?[]:{}),o},ocCommon.prototype.checkGSMText=function(e){const t=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9","@","£","$","¥","è","é","ù","ì","ò","Ç","\n","Ø","ø","\r","Å","å","Δ","_","Φ","Γ","Λ","Ω","Π","Ψ","Σ","Θ","Ξ"," ","!","'","#","¤","%","&",'"',"*","+",",","-",".","/",":",";","<","=",">","?","^","{","}","\\","[","]","~","|","€"];let o="";for(let l=0;l<e.length;l++)t.includes(e[l])||(""!=o&&(o+=" , "),o+=e[l]);return""!=o&&(o="The following characters are not supported in SMS: "+o),o};var occ=null;let occViewportHeight=window.visualViewport.height,occKeyboardOpen=!1;occ=new ocCommon(null),window.onorientationchange=function(){ocMinResize()},window.addEventListener("resize",function(){ocMinResize()}),window.onload=function(){ocMinResize(null),setTimeout(occInitPause(1),100)}
3,window.visualViewport.addEventListener("resize",()=>{if("ios"==occ.clientOs){const e=window.visualViewport.height;!occKeyboardOpen&&e<occViewportHeight-100&&(occKeyboardOpen=!0,occ.addClass(document.body,"keyboardOpen")),occKeyboardOpen&&e>occViewportHeight+100&&(occKeyboardOpen=!1,occ.removeClass(document.body,"keyboardOpen")),occViewportHeight=e}}),ocCommon.prototype.initInputControls=function(e){e&&null!=e||(e=document);let t=e.querySelectorAll("div.ocInputControl-obj");for(let e=0;e<t.length;e++)!1===occ.hasClass(t[e],"ocInputControl")&&occ.createInputControl(t[e].id)},ocCommon.prototype.reInitInputControl=function(e){let t=occ.getElementFromString(e+"-ctrl");t?(occ.removeClasses(t,["useExt","hasLabel","hasValue","defColor","hasIcon"]),t.setAttribute("data-defval",""),t.innerHTML="",t.id=e,occ.createInputControl(t.id)):occ.createInputControl(e)};let waitingCtrls=[],mbltypes=["richtext","rich-text"];ocCommon.prototype.createInputControl=function(e,t,o,l,c,i,a,n){let r=occ.getElementFromString(e);if(r&&occ.hasClass(r,"loading"))return;if(!0!==this.mbl&&("richtext"===o||r&&"richtext"===r.getAttribute("data-type"))){occ.addClasses(r,["loading","trixLoading"]),r&&r.setAttribute("data-type","rich-text");let o={objid:e};o.label=t,o.value=l,o.classes=c,o.attributes=i,o.onChange=a,o.ctrl=r,waitingCtrls.push(o);let n=function(){let e=document.querySelectorAll(".trixLoading");for(let t=0;t<e.length;t++)for(let o=0;o<waitingCtrls.length;o++)e[t].id===waitingCtrls[o].objid&&(occ.addClass(e[t],"trixLoaded"),occ.removeClasses(e[t],["loading","trixLoading"]),occ.createInputControl(waitingCtrls[o].objid,waitingCtrls[o].label,"textarea",waitingCtrls[o].value,waitingCtrls[o].classes,waitingCtrls[o].attributes,waitingCtrls[o].onChange),waitingCtrls[o]={})};return void(!1===occ.hasClass(r,"trixLoaded")&&occ.loadResources("trix",null,n))}let s=!1,d=null,u=!1,p=!1,m=null,h=null,g=null,f=null,y=null,C=null,v=null,b=null,E=null,A="",O=0,S=[];if(r){if(A=r.getAttribute("data-eTenantId"),s=!0,t=r.getAttribute("data-label"),o=r.getAttribute("data-type"),occ.isNothingOrEmpty(o))return;o=o.toLowerCase(),l=r.getAttribute("data-value"),null!==(c=r.getAttribute("data-classes"))&&""!==c&&(c=c.split(" ")),null!==(i=r.getAttribute("data-attributes"))&&""!==i&&(i=JSON.parse(i)),a=r.getAttribute("onchange"),!1===occ.isNothingOrEmpty(a)&&(a="occalendar"!==o?null:occ.changeInputControlCB),this.mbl||(r.id=e+"-ctrl",r.getAttribute("name")!==e&&(S.push({name:"name",value:r.getAttribute("name")}),r.setAttribute("name",r.id))),u="true"===r.getAttribute("data-confirm"),p="true"===r.getAttribute("data-duplicate"),m=r.getAttribute("data-inputmode"),h=r.getAttribute("data-step"),g=r.getAttribute("data-minlength"),f=r.getAttribute("data-maxlength"),b=r.getAttribute("data-placeholder"),E=r.getAttribute("data-info"),y=r.getAttribute("data-autocomplete"),C=r.getAttribute("data-autocorrect"),v=r.getAttribute("data-autocapitalize")}else{if(occ.isNothingOrEmpty(o))return;if(o=o.toLowerCase(),r=occ.createDiv("",null,[{name:"id",value:e+"-ctrl"}]),!0!==n&&occ.addClass(r,"ocInputControl-obj"),r.setAttribute("data-type",o),i&&Array.isArray(i))for(let e=0;e<i.length;e++)"classes"===i[e].name&&(c="string"==typeof i[e].value?JSON.parse(i[e].value):i[e].value),"value"===i[e].name&&(l=i[e].value),"label"===i[e].name&&(t=i[e].value),"type"===i[e].name&&(o=i[e].value.toLowerCase(),r.setAttribute("data-type",o)),"data-confirm"!==i[e].name&&"confirm"!==i[e].name||!0!==i[e].value&&"true"!==i[e].value||(u=!0),"data-duplicate"!==i[e].name&&"duplicate"!==i[e].name||!0!==i[e].value&&"true"!==i[e].value||(p=!0),"data-inputmode"!==i[e].name&&"inputmode"!==i[e].name||(m=i[e].value),"data-step"===i[e].name|"step"===i[e].name&&(h=i[e].value),"data-minlength"===i[e].name|"minlength"===i[e].name&&(g=i[e].value),"data-maxlength"!==i[e].name&&"maxlength"!==i[e].name||(f=i[e].value),"data-autocomplete"!==i[e].name&&"autocomplete"!==i[e].name||(y=i[e].value),"data-autocorrect"!==i[e].name&&"autocorrect"!==i[e].name||(C=i[e].value),"data-autocapitalize"!==i[e].name&&"autocapitalize"!==i[e].name||(v=i[e].value),"data-placeholder"!==i[e].name&&"placeholder"!==i[e].name||(b=i[e].value),"data-info"!==i[e].name&&"info"!==i[e].name||(E=i[e].value),"data-accepts"!==i[e].name&&"accepts"!==i[e].name||r.setAttribute("data-accepts",i[e].value),"data-eTenantId"!==i[e].name&&"eTenantId"!==i[e].name||(A=i[e].value),"tabindex"===i[e].name&&(O=1*i[e].value),"data-rid"===i[e].name&&r.setAttribute("data-rid",i[e].value)}"link"===o&&(o="url");let I=!1;
3if("rich-text"===o?I=!0:"telext"===o&&(o="tel",occ.addClass(r,"useExt")),this.mbl&&mbltypes.includes(String(o).toLowerCase())&&("richtext"!==o&&"rich-text"!==o||!1===r.classList.contains("aiAssist"))){occ.removeClass(r,"ocInputControl-obj");let c={dataCol:"0"};return c.type=o,c.label=t,c.info=E,c.required=r.classList.contains("required"),c.opts=[],c.opt=null,c.attr=[],c.clss=[],c.width="1",r.classList.contains("col-2")?c.width="2":r.classList.contains("col-3")?c.width="3":r.classList.contains("col-4")?c.width="4":r.classList.contains("col-5")&&(c.width="5"),c.defaultValue=null,c.colTitle=t,c.colWidth=0,c.colShow=!1,c.colAlign="left",c.colMobile=!1,c.colFilter=!1,c.colSort=!1,c.colCsv=!1,c.colAgg="",c.min=g,c.max=f,c.validator="",c.twoDigitYear=!1,c.yyPivot=0,c.step=null,c.displayFormat=null,c.timeStart=null,c.timeEnd=null,c.thisConfig=null,window.mbl.prototype.createInputControl(e,l,c,null)}!0===occ.isNullOrEmpty(y)&&(y="off"),!1===occ.isNullOrEmpty(g)&&(g*=1),occ.addClasses(r,["ocInputControl","oc"+o]);let D=[];"occalendar"===o&&(r.setAttribute("data-defval",l),D.push("ocDateControl-obj")),c&&Array.isArray(c)&&occ.addClasses(r,c),D.push("ocInputControl-ip"),D.push("ocFormField");let F=null,w=[];i&&Array.isArray(i)&&(S=i),S.push({name:"id",value:e}),O>0&&S.push({name:"tabindex",value:O}),occ.isNullOrEmpty(t)||(u&&(d="Confirm: "+t+"<span>values do not match</span>"),"json"===o?(v="none",C="off",t+="<span>not valid JSON</span>",o="textarea"):"tel"===o?(t.toLowerCase().indexOf("phone")>-1?t+="<span>(xxx) xxx-xxxx"+(occ.hasClass(r,"useExt")?" xExt":"")+"</span>":t+="<span>enter a telephone #: (xxx) xxx-xxxx"+(occ.hasClass(r,"useExt")?" xExt":"")+"</span>",m="numeric"):"secure"===o||"password"===o?(!0===occ.isNullOrEmpty(g)&&"password"===o&&(g=6),o="password",v="none",C="off",t+=g>0?"<span>this value is too short</span>":"<span>please enter a value</span>"):"link"===o||"url"===o?(o="url",v="none",C="off",m="url",t+='<span class="url">enter a valid url</span>',t+='<span class="email">enter a valid email address</span>',t+='<span class="ip">enter a valid IP address</span>'):"videolink"===o?(o="text",v="none",C="off",t+="<span>enter a valid url</span>",E=occ.hasClass(r,"allowMP4")?"*URLs from SoundCloud, Vimeo or YouTube are preferred"+(occ.isNothingOrEmpty(E)?"":". "+E):"*use URLs from SoundCloud, Vimeo or YouTube only"+(occ.isNothingOrEmpty(E)?"":". "+E)):"email"===o?(v="none",C="off",t+="<span>enter a valid email address</span>"):"zip"===o?(f=5,o="number",v="none",C="off",t+="<span>enter a valid zip</span>",m="numeric"):"number"===o?(v="none",C="off",t+="<span>",!0===occ.hasClass(r,"money")?!1===occ.isNullOrEmpty(g)&&!1===occ.isNullOrEmpty(f)?t+="between "+occ.formatMoney(g)+" and "+occ.formatMoney(f):!1===occ.isNullOrEmpty(g)?t+=occ.formatMoney(g)+" min":!1===occ.isNullOrEmpty(f)&&(t+=occ.formatMoney(f)+" max"):(t+="enter a valid"+("1"===h?" integer":" number"),!1===occ.isNullOrEmpty(g)&&!1===occ.isNullOrEmpty(f)?t+=" between "+g+" and "+f:!1===occ.isNullOrEmpty(g)?t+=" at least "+g:!1===occ.isNullOrEmpty(f)&&(t+=" no more than "+f)),t+='</span><div class="customTextDisplay"></div>',m="numeric"):"textnohtml"===o?t+="<span>no html characters allowed</span>":"alphanumeric"===o?t+="<span>letters and numbers only</span>":"alphanumericdash"===o?t+="<span>letters, numbers, and dashes only</span>":"alphanumericspace"===o?t+="<span>letters, numbers, and spaces only</span>":"textonly"===o?t+="<span>letters only</span>":"gsmms"===o?(t+="<span>SMS compatible characters only</span>",m="gsmMS",o="textarea"):t+=g>0?"<span>this value is too short</span>":"imageplus"===o||"fileplus"===o?'<span><span class="cptNt">captions are&nbsp;</span>required</span>':"<span>required</span>","file"!==o&&"image"!==o&&"imageplus"!==o&&"fileplus"!==o||(t+='<span class="invalidFile">one of the files chosen is not a supported format</span>'),!0===p&&(t+='<span class="duplicateMsg">similar or duplicate value</span>'),occ.addClass(r,"hasLabel")),"textarea"!==o&&("tel"===o||"url"===o||"occalendar"===o||"file"===o||"image"===o||"pdfviewer"===o||"imageplus"===o||"fileplus"===o||"rich-text"===o||"color"===o&&!1===occ.hasClass(r,"required")?(S.push({name:"type",value:"hidden"}),"rich-text"===o&&S.push({name:"name",value:"content"})):("alphanumeric"===o||"alphanumericspace"===o||"alphanumericdash"===o||"textonly"===o||"textnohtml"===o?S.push({name:"type",value:"text"}):S.push({name:"type",value:o}),!1===occ.isNullOrEmpty(g)&&S.push({name:"minlength",value:g}))),"number"===o&&(!1===occ.isNullOrEmpty(f)&&S.push({name:"max",value:f}),!1===occ.isNullOrEmpty(g)&&S.push({name:"min",value:g}),!1===occ.isNullOrEmpty(h)&&S.push({name:"step",value:h})),"textarea"!==o&&"text"!==o&&"alphanumeric"!==o&&"alphanumericspace"!==o&&"alphanumericdash"!==o&&"textnohtml"!==o&&"textonly"
3!==o&&"email"!==o||(!1===occ.isNullOrEmpty(f)&&S.push({name:"maxlength",value:f}),!1===occ.isNullOrEmpty(b)&&S.push({name:"placeholder",value:b}));let T=occ.createElement("textarea"===o?"textarea":"input",D,S);"occalendar"!==o&&(T.addEventListener("change",occ.checkInputControl),(g>0||"1"===h)&&T.addEventListener("keyup",occ.checkInputControlLength)),"zip"===r.getAttribute("data-type")&&T.addEventListener("paste",occ.setZipPaste),"function"==typeof a?"checkbox"===o?occ.addClickEvent(T,a):"occalendar"!==o&&(T.addEventListener("change",a),T.addEventListener("keydown",occ.keyInputControlCB),T.addEventListener("keyup",occ.keyInputControlCB)):"zip"===r.getAttribute("data-type")&&T.addEventListener("keydown",occ.keyInputControlCB);let x=null,N=null,k="",q=null;if(!1===occ.isNothingOrEmpty(r.getAttribute("data-opts")))if("string"==typeof l&&l.indexOf("|")>-1&&(k=l.substring(0,l.indexOf("|")),l=l.substring(l.indexOf("|")+1)),1==occ.isNothingOrEmpty(k)&&!1===occ.isNothingOrEmpty(r.getAttribute("data-optsval"))&&(k=r.getAttribute("data-optsval")),T.setAttribute("data-optsval",k),T.setAttribute("data-optsvalcv",k),k="#*"+k+"*#",x=r.getAttribute("data-opts"),0===x.indexOf("[")&&(x=JSON.parse(x)),Array.isArray(x)){for(let e=0;e<x.length;e++)x[e].fieldValue="#*"+x[e].fieldValue+"*#";N=function(e){let t=e.currentTarget.id;t.endsWith("-hp")&&(t=t.substring(0,t.length-3)),t.endsWith("-sel")&&(t=t.substring(0,t.length-4)),t.endsWith("-useg")&&(t=t.substring(0,t.length-5));let o=occ.getElementFromString(t);if(o){let e="",l=occ.getElementFromString(t+"-useg");e="INPUT"===l.tagName?l.value:occ.switchGet(t+"-useg")+"",o.setAttribute("data-optsval",e.replace("#*","").replace("*#",""))}(occ.hasClass(e.currentTarget,"select")||occ.hasClass(e.currentTarget,"switchGroup"))&&(occ.resizeOptsDdl({currentTarget:occ.hasClass(e.currentTarget,"select")?e.currentTarget.parentElement:e.currentTarget}),occ.triggerEvent(o.parentElement,"change")),occ.checkInputControl(o)}}else x=null;if("file"===o||"image"===o||"imageplus"===o||"fileplus"===o){let t=occ.getNearest(r,null,!0,"form");t&&null!==t&&t.setAttribute("enctype","multipart/form-data");let l=null;!1===occ.isNullOrEmpty(r.getAttribute("data-accepts"))&&(l=r.getAttribute("data-accepts")),"image"!==o&&"imageplus"!==o||(D.push("isImage"),!0===occ.isNullOrEmpty(l)&&(l=".png, .jpg, .jpeg, .gif, .svg")),"fileplus"===o&&(D.push("isImage"),!0===occ.isNullOrEmpty(l)&&(l=".pdf, .png, .jpg, .jpeg, .gif, .svg")),!1===occ.isNullOrEmpty(l)&&w.push({name:"accept",value:l}),(r.getAttribute("data-multiple")&&"true"===r.getAttribute("data-multiple")||"imageplus"===o||"fileplus"===o)&&w.push({name:"multiple",value:"true"}),w.push({name:"type",value:"file"}),w.push({name:"id",value:e+"-hp"}),F=occ.createElement("input",["ocInputControl-hp"],w),"imageplus"!==o&&"fileplus"!==o||(F.style.width="auto"),F.addEventListener("change",occ.fileInputControlCB)}else if("color"===o&&!1===occ.hasClass(r,"required")){F=occ.createElement("input",["occolor"],[{name:"id",value:e+"-hp"},{name:"type",value:"color"}]);let t=function(e){e.currentTarget.style.backgroundColor=e.currentTarget.value;let t=e.currentTarget.parentElement.querySelector("input.ocInputControl-ip");t.value=e.currentTarget.value,occ.checkInputControl({currentTarget:t}),occ.changeInputControlCB(e)};F.value=occ.isNothingOrEmpty(l)?"#ffffff":l,F.style.backgroundColor=l,occ.addChangeEvent(F,t),occ.isNothingOrEmpty(l)&&(F.disabled=!0,F.setAttribute("disabled","disabled"))}else if("pdfviewer"===o){F=occ.createDiv("",["fileViewer"]);let t=occ.createDiv("",["pdfDiv"],[{name:"id",value:e+"-hp-pdf"}]);F.appendChild(t);let o=function(t){!1===occ.hasClass(F,"pdfReady")?(r.setAttribute("data-ourl",r.getAttribute("data-url")),occ.initPdfViewer(e)):(occ.toggleClass(t.currentTarget.parentElement,"ocActivePDF"),occ.toggleClass(document.body,"ocActivePDF"))},l=function(e){e.preventDefault(),e.stopPropagation();let t="",o=e.currentTarget.parentElement.parentElement.getAttribute("data-fdl");"dl"===o&&(t="_blank",o=e.currentTarget.parentElement.parentElement.getAttribute("data-url"));let l=function(e){e&&occ.dlgMsg.close(),""===t?window.location.href=o:window.open(o,t)},c=e.currentTarget.parentElement.parentElement.getAttribute("data-fdlm");if(!1===occ.isNothingOrEmpty(c)){let e=occ.createDiv(c);""!==e.innerText?occ.msgDlg("Attention",c,"mini",[{id:"dlClose"+occ.eid(),content:"Close",onClick:function(){occ.dlgMsg.close()}
3,align:"L"},{id:"dlView"+occ.eid(),content:"Download",onClick:l}]):l(),e=null}else l()},c=r.getAttribute("data-fn");occ.isNothingOrEmpty(c)&&(c="untitled document"),F.appendChild(occ.ocButton(e+"-hp-btn","Open PDF<span>"+c+"</span>",o,"pdf grey sz-3",null,["hp-btn"])),!1===occ.isNothingOrEmpty(r.getAttribute("data-fdl"))&&(occ.addClass(F,"hasDL"),F.appendChild(occ.ocButton(e+"-hp-dbtn","",l,"download grey sz-3",null,["hp-dbtn"]))),F.appendChild(occ.ocButton(e+"-hp-rbtn","Clear Respose",occ.resetPdfViewer,null,null,["hp-rbtn"]));let i=occ.createDiv('<div class="s-x tr sz3 icon"></div>',["fvClose"]);occ.addClickEvent(i,o),F.appendChild(i)}if(T.setAttribute("data-cv",""),l&&null!==l?"checkbox"===o?"checked"===l||"Y"===l||"true"===l||!0===l?(T.checked=!0,T.setAttribute("data-cv","true")):T.setAttribute("data-cv","false"):(T.value=l,T.setAttribute("data-cv",T.value),occ.addClass(r,"hasValue")):"checkbox"===o&&T.setAttribute("data-cv","false"),"url"===o)F=occ.createElement("input",["ocInputControl-hp"],[{name:"type",value:"url"},{name:"id",value:e+"-hp"}]),F.addEventListener("keyup",occ.urlFn),l&&null!==l&&(0===l.indexOf("/")&&occ.hasClass(r,"usePage")?F.value=l.substring(1):F.value=l.replace("https://","").replace("http://","").replace("mailto:",""),T.value=l,T.setAttribute("data-value",l),occ.addClass(r,"hasValue"));else if("tel"===o){if(F=occ.createElement("input",["ocInputControl-hp"],[{name:"type",value:"text"},{name:"id",value:e+"-hp"}]),F.addEventListener("paste",occ.setTelephonePaste),F.addEventListener("keyup",occ.setTelephoneUp),F.addEventListener("keydown",occ.setTelephoneDown),l&&null!==l){let e=occ.formatTelephone(l,null,!1);F.value=e;let t=e.split("x");e=t[0].trim().replace(/\D/g,""),t.length>1&&(e+="x"+t[1].trim()),T.value=e,T.setAttribute("data-value",e),occ.addClass(r,"hasValue")}!1===occ.isNothingOrEmpty(y)&&F.setAttribute("autocomplete",y),!1===occ.isNothingOrEmpty(C)&&F.setAttribute("autocorrect",C),!1===occ.isNothingOrEmpty(v)&&F.setAttribute("autocapitalize",v),!1===occ.isNothingOrEmpty(m)&&F.setAttribute("inputMode",m)}else"resource"===o||"systemresource"===o||"systemadminresource"===o?(F=occ.createElement("input",["ocInputControl-hp","disabled","alwaysDisabled"],[{name:"type",value:"text"},{name:"id",value:e+"-hp"}]),l&&!0!==occ.isNullOrEmpty(l)?("string"==typeof l&&!1===occ.isNothingOrEmpty(l)&&(l=JSON.parse(l)),"object"==typeof l&&(T.value=l.eFileId?l.eFileId:"",T.setAttribute("data-cv",T.value),F.value=l.fileTitle?l.fileTitle:"",occ.addClass(r,"hasValue"))):(T.value="",T.setAttribute("data-cv","")),T.setAttribute("type","hidden"),!1===occ.isNothingOrEmpty(y)&&F.setAttribute("autocomplete",y),!1===occ.isNothingOrEmpty(C)&&F.setAttribute("autocorrect",C),!1===occ.isNothingOrEmpty(v)&&F.setAttribute("autocapitalize",v),!1===occ.isNothingOrEmpty(m)&&F.setAttribute("inputMode",m),F.setAttribute("disabled","disabled"),F.disabled=!0):(!1===occ.isNothingOrEmpty(y)&&T.setAttribute("autocomplete",y),!1===occ.isNothingOrEmpty(C)&&T.setAttribute("autocorrect",C),!1===occ.isNothingOrEmpty(v)&&T.setAttribute("autocapitalize",v),!1===occ.isNothingOrEmpty(m)&&T.setAttribute("inputMode",m));if("text"===o&&"true"===r.dataset.rich){let t=function(e){e.preventDefault(),e.stopPropagation();let t=e.currentTarget.parentElement.querySelector("input.ocInputControl-ip"),o=t.value,l=!1===occ.isNothingOrEmpty(o)&&0===o.indexOf("{")?JSON.parse(o):{text:"",size:"",color:"",align:"",padding:""};l.text=e.currentTarget.value,o=JSON.stringify(l),t.value=o,occ.triggerEvent(e.currentTarget.parentElement,"change")};F=occ.createElement("input",["ocInputControl-hp"],S,null,"change",t),F.setAttribute("id",e+"-hp");let o=!1===occ.isNothingOrEmpty(l)&&0===l.indexOf("{")?JSON.parse(l):{text:l,size:"",color:"",align:"",padding:""};F.value=o.text,T=occ.createElement("input",["ocInputControl-ip"],[{name:"type",value:"hidden"},{name:"id",value:e}]),T.value=JSON.stringify(o),T.dataset.cv=T.value}let B=null;occ.isNullOrEmpty(t)||(B=occ.createElement("label",null,[{name:"for",value:e}],t));let V=null;if(occ.isNullOrEmpty(E)||(V=occ.setInputControlInfo(null,E,!0)),"checkbox"===o)r.appendChild(T),null!=B&&r.appendChild(B),null!==V&&r.appendChild(V);else{if(null!=B&&r.appendChild(B),"color"===o&&0==occ.hasClass(r,"required")){occ.isNothingOrEmpty(l)?occ.addClass(r,"defColor"):occ.removeClass(r,"defColor");
3let t=occ.createDiv("",["ocField-obj","required","internalField"],[{name:"id",value:e+"-cseg"},{name:"data-tableName",value:"Standard"},{name:"data-segment",value:"true"}]);t.setAttribute("data-value",occ.isNothingOrEmpty(l)?"S":"C");let o=function(e){let t=e.currentTarget.parentElement.querySelector('input[type="color"]'),o=e.currentTarget.parentElement.querySelector("input.ocInputControl-ip"),l=e.currentTarget.querySelector('input[type="hidden"]');"C"===l.value?(occ.removeClass(t.parentElement,"defColor"),t.disabled=!1,t.removeAttribute("disabled"),occ.triggerEvent(t,"pointerup"),t.value=o.getAttribute("data-cv"),t.style.backgroundColor=t.value):(occ.addClass(t.parentElement,"defColor"),t.disabled=!0,t.setAttribute("disabled","disabled"),t.value="#ffffff",o.value=""),occ.checkInputControl({currentTarget:l}),occ.changeInputControlCB(t)};occ.addChangeEvent(t,o),r.appendChild(t),occ.initFields(r),r.appendChild(occ.createDiv("<span></span>",["defColorBg"]))}if("url"===o)if(x=[{name:"https://",value:"https://",order:2},{name:"http://",value:"http://",order:3}],occ.hasClass(r,"useEmail")&&x.push({name:"Email",value:"mailto:",order:5}),occ.hasClass(r,"usePage")&&(occ.removeClass(r,"allowLocal"),x.push({name:"Page",value:"/",order:1})),occ.hasClass(r,"useIP")&&x.push({name:"IP Address",value:"IP",order:4}),x.sort((e,t)=>e.order-t.order),N=function(e){let t=e.currentTarget.id.replace("-useg","").replace("-sel","");occ.hideField(t+"-pageList");let o=occ.getElementFromString(t+"-useg"),l="";l="INPUT"===o.tagName?o.value:occ.switchGet(t+"-useg"),"/"===l&&occ.showField(t+"-pageList"),""!==occ.getElementFromString(t+"-hp").value&&("/"===l?occ.setOCFormField(t+"-pageList",occ.getElementFromString(t+"-hp").value):occ.hasClass(e.currentTarget.parentElement,"allowLocal")&&0===occ.getElementFromString(t+"-hp").value.indexOf("/")?occ.getElementFromString(t).value=occ.getElementFromString(t+"-hp").value:occ.getElementFromString(t).value=("IP"!==l?l:"")+occ.getElementFromString(t+"-hp").value),occ.checkInputControl(t)},l&&null!==l){let e=l.replace(/./g,"");0===l.indexOf("https://")||0===l.indexOf("https://")?k="https://":0===l.indexOf("mailto:")?k="mailto:":0===l.indexOf("/")&&occ.hasClass(r,"usePage")?k="/":!1===occ.isNothingOrEmpty(e)&&1*e!==NaN&&(k="IP")}else k=occ.hasClass(r,"usePage")?"/":"https://";if(null!==x&&x.length>1){let t=occ.createDiv("",["innerSeg"],[{name:"id",value:e+"-useg"}]);occ.addClass(null===F?T:F,"ddl"),t=occ.createDropDown(e+"-useg",x,["dynamic","mini"],null,N,k),q=occ.createDiv("",["posDiv"]),q.appendChild(t)}if("url"===o&&occ.hasClass(r,"usePage")){let t=[{name:"id",value:e+"-pageList"},{name:"data-tableName",value:"TenantContentPage"},{name:"data-fieldName",value:"PageUrl"}];t.push({name:"data-rid",value:r.getAttribute("data-rid")}),t.push({name:"data-eTenantId",value:A});let o=occ.createDiv("",["ocField-obj","PageList","internalField","required"],t),c=function(e){let t=e.currentTarget.querySelector("input.divSelect").value;t.length>0&&occ.setOCFormField(e.currentTarget.id.replace("-pageList-ctrl",""),"/"+t,!0)};occ.addChangeEvent(o,c),"/"!==k?occ.hideObj(o):o.setAttribute("data-value",occ.isNothingOrEmpty(l)||l.length<2?"":l.substring(1)),null===q&&(q=occ.createDiv("",["posDiv"])),q.appendChild(o)}if(null!==q&&(r.appendChild(q),occ.initFields(r)),null!==F){if(r.appendChild(F),"text"===o&&"true"===r.dataset.rich&&r.appendChild(occ.ocButton(e+"-rich","",occ.textStyleEdit,"numbereddot sz3",null,["richBtn"])),("file"===o||"image"===o)&&!0===occ.hasClass(r,"allowFolder")){let t=occ.ocButton(e+"-folder","Choose a Folder",occ.folderInputControlClick,"folder-open");occ.addClass(t,"folderBtn"),r.appendChild(t)}if("imageplus"===o||"fileplus"===o){if("imageplus"===o&&0==occ.hasClass(r,"novideo")||"fileplus"===o&&occ.hasClass(r,"allowVideo")){let t=occ.ocButton(e+"-video","Add a video",occ.addImagePlusVideo,null,null);occ.addClass(t,"ImagePlusBtn"),r.appendChild(t)}}else if("file"!==o&&"image"!==o||"true"===r.getAttribute("data-multiple")){if("resource"===o||"systemresource"===o||"systemadminresource"===o){let t=occ.ocButton(e+"-select","Select",occ.chooseResource,null,null,["inLine"]);t.style.marginRight="0",r.appendChild(t);let o=occ.ocButton(e+"-cancel","Cancel",occ.chooseResourceClose,null,null,["inLine"]);occ.hideObj(o),o.style.marginRight="0",r.appendChild(o);let c=occ.ocButton(e+"-clear","",occ.chooseResourceClear,"x",null);if(occ.addClass(c,"clearButton"),r.appendChild(c),!1===occ.isNullOrEmpty(r.getAttribute("data-accepts"))&&"true"!==r.getAttribute("data-multiple")){let e=occ.createElement("img",["ocInputControl-icon"]);l&&null!==l&&l.fileUrl&&!1===occ.isNullOrEmpty(l.fileUrl)&&(e.src=l.fileUrl+"&s=thumb",occ.addClass(r,"hasIcon")),r.appendChild(e)}"true"===r.getAttribute("data-multiple")&&r.appendChild(occ.createDiv("",["ocInputControl-resources"],null))}}else{let t=occ.ocButton(e+"-hpRep","Replace",occ.fileInputControlReplace);occ.addClasses(t,["inLine","replaceBtn"]),r.appendChild(t);let o=occ.ocButton(e+"-hpDel","Clear",occ.fileInputControlDelete);occ.addClasses(o,["inLine","hpDel"]),r.appendChild(o)}}r.appendChild(T),"occalendar"!==o&&null!==V&&r.appendChild(V),!l||null===l||"[]"===l||"file"!==o&&"image"!==o&&"imageplus"!==o&&"fileplus"!==o||setTimeout(function(){T=occ.getElementFromString(e),"string"==typeof l&&0===l.indexOf("[")&&(l=JSON.parse(l)),occ.setFileControl(T,l),occ.addClass(r,"hasValue")},500)}if(u){occ.isNullOrEmpty(d)||(B=occ.createElement("label",["domatch"],[{name:"for",value:e+"-cp"}
3],d),r.appendChild(B));let t=occ.createElement("input",["ocInputControl-cp"],S);t.id=e+"-cp",t.addEventListener("keyup",occ.confirmValue),r.appendChild(t)}if(occ.hasClass(r,"disabled")&&(occ.removeClass(r,"disabled"),occ.disableControl(e,!0)),"occalendar"===o&&setTimeout(function(){occ.addClass(e,"ocCalendar");let t=occ.initOCCalendar(e,a);t&&null!==t&&(occ.isNothingOrEmpty(l)&&!1===occ.isNothingOrEmpty(r.getAttribute("data-val"))&&(l=r.getAttribute("data-val")),occ.isNothingOrEmpty(l)&&null!==r.querySelector("input.ocInputControl-ip")&&(l=r.querySelector("input.ocInputControl-ip").getAttribute("data-val")),t.setDate(l)),null!==V&&r.appendChild(V)},100),!1===s){return setTimeout(function(){occ.removeClass(r,"loading")},100),r}if(!0===I&&occ.trixCreate(e),occ.removeClass(r,"loading"),occ.hasClass(r,"aiAssist-obj")&&occ.initAIAssistText(r),occ.hasClass(r,"ignoreField")){let e=r.querySelector("input.ocInputControl-hp");e?e.setAttribute("disabled","disabled"):(e=r.querySelector("input.ocInputControl-ip"),e&&e.setAttribute("disabled","disabled")),e=r.querySelector("textarea"),e&&e.setAttribute("disabled","disabled"),e=r.querySelector("trix-editor"),e&&e.setAttribute("disabled","disabled")}},ocCommon.prototype.textStyleEdit=function(e){let t=e.currentTarget.parentElement.querySelector("label"),o=e.currentTarget.parentElement.querySelector("input.ocInputControl-ip"),l=o.value,c=!1===occ.isNothingOrEmpty(l)&&0===l.indexOf("{")?JSON.parse(l):{text:l,size:"",color:"",align:"",padding:"",mode:"C"};occ.msgDlg("Style Editor"+(null!==t?" for "+t.innerText:""),"","medium",[{id:"textStyleEditClose"+occ.eid(),content:"Cancel",onClick:function(e){occ.dlgMsg.close()},align:"L"},{id:"textStyleEditOk"+occ.eid(),content:"Save",onClick:function(e){occ.textStyleEditClose(o)}}],!0),occ.dlgMsg.content.appendChild(occ.createElement("h3",null,null,"Leave fields blank to use default values")),!0===occ.isNothingOrEmpty(c.font)&&(c.font=""),!0===occ.isNothingOrEmpty(c.mode)&&(c.mode="");let i=function(e){let t="C"===document.getElementById("textStyleEditMode").value;occ.toggleObj("textStyleEditFont-ctrl",t),occ.toggleObj("textStyleEditColor-ctrl",t),occ.toggleObj("textStyleEditSize-ctrl",t),occ.toggleObj("textStyleEditAlign-ctrl",t),occ.toggleObj("textStyleEditPadding-ctrl",t)},a=!0;!0===occ.hasAnyClasses(e.currentTarget.parentElement,["useSiteGroup","useSiteGroupS","useSiteGroupG","useSiteGroupC"])&&(""===c.mode&&(c.mode="C",!0===occ.hasClass(e.currentTarget.parentElement,"useSiteGroupS")?c.mode="S":!0===occ.hasClass(e.currentTarget.parentElement,"useSiteGroupG")&&(c.mode="G")),a="C"===c.mode,occ.dlgMsg.content.appendChild(occ.createDiv("",["ocField-obj"],[{name:"id",value:"textStyleEditMode"},{name:"data-label",value:"Inherit Styles"},{name:"data-fieldOptions",value:'[{"fieldOption": "Site", "fieldValue":"S"},{"fieldOption": "Group", "fieldValue":"G"},{"fieldOption": "Section", "fieldValue":"C"}]'},{name:"data-value",value:c.mode},{name:"data-segment",value:"true"}],"change",i))),!1===occ.hasClass(e.currentTarget.parentElement,"noFonts")&&occ.dlgMsg.content.appendChild(occ.createDiv("",["ocField-obj","col-2",a?"":"hiddenObj"],[{name:"id",value:"textStyleEditFont"},{name:"data-label",value:"Font"},{name:"data-tableName",value:"Tenant"},{name:"data-fieldName",value:"HeaderFont"},{name:"data-value",value:c.font}])),occ.dlgMsg.content.appendChild(occ.createDiv("",["ocInputControl-obj","col-2",a?"":"hiddenObj"],[{name:"id",value:"textStyleEditColor"},{name:"data-label",value:"Text Color"},{name:"data-type",value:"color"},{name:"data-value",value:c.color}])),occ.dlgMsg.content.appendChild(occ.createDiv("",["ocInputControl-obj","col-2",a?"":"hiddenObj"],[{name:"id",value:"textStyleEditSize"},{name:"data-label",value:"Text Size"},{name:"data-type",value:"number"},{name:"data-minlength",value:"0"},{name:"data-maxlength",value:"200"},{name:"data-value",value:c.size.replace("px","")},{name:"data-info",value:"*this value is pixels"}])),occ.dlgMsg.content.appendChild(occ.createDiv("",["ocField-obj","col-2",a?"":"hiddenObj"],[{name:"id",value:"textStyleEditAlign"},{name:"data-label",value:"Text Align"},{name:"data-tableName",value:"Alignment"},{name:"data-value",value:c.align}])),occ.dlgMsg.content.appendChild(occ.createDiv("",["ocInputControl-obj","col-2",a?""
3:"hiddenObj"],[{name:"id",value:"textStyleEditPadding"},{name:"data-label",value:"Top/Bottom Padding"},{name:"data-type",value:"number"},{name:"data-minlength",value:"0"},{name:"data-maxlength",value:"200"},{name:"data-value",value:c.padding.replace("px","")},{name:"data-info",value:"*this value is pixels"}])),occ.initInputControls(occ.dlgMsg.content),occ.initFields(occ.dlgMsg.content)},ocCommon.prototype.textStyleEditClose=function(e){let t=occ.checkOCFormContainer("occ-dlgMsgDiv");if(!1===t.clean&&!0===t.complete){let t=e.value,o=!1===occ.isNothingOrEmpty(t)&&0===t.indexOf("{")?JSON.parse(t):{text:t,size:"",color:"",mode:"C",align:"",padding:"",font:""};o.color=document.getElementById("textStyleEditColor").value,o.size=document.getElementById("textStyleEditSize").value,o.align=document.getElementById("textStyleEditAlign").value,o.padding=document.getElementById("textStyleEditPadding").value,document.getElementById("textStyleEditMode")&&(o.mode=document.getElementById("textStyleEditMode").value),document.getElementById("textStyleEditFont")&&(o.font=document.getElementById("textStyleEditFont").value),!0===occ.isNothingOrEmpty(o.font)&&(o.font=""),!1===occ.isNothingOrEmpty(o.size)&&(o.size=o.size+"px"),!1===occ.isNothingOrEmpty(o.padding)&&(o.padding=o.padding+"px"),e.value=JSON.stringify(o),occ.triggerEvent(e.parentElement,"change"),occ.dlgMsg.content.innerHTML=""}occ.dlgMsg.close()},ocCommon.prototype.urlFn=function(e){let t=e.currentTarget.value.toLowerCase(),o=e.currentTarget.id;o.endsWith("-hp")&&(o=o.substring(0,o.length-3)),t=t.replace("https%3A//","https://").replace("https%3a//","https://");let l=occ.getElementFromString(o+"-useg");if(occ.hasClass(l.parentElement,"allowLocal")&&0===t.indexOf("/"))""!==e.currentTarget.value&&(occ.getElementFromString(o).value=e.currentTarget.value,occ.checkInputControl({currentTarget:e.currentTarget}));else{let c="",i=t.replace(/./g,"");0===t.indexOf("https://")?c="https://":0===t.indexOf("http://")?c="http://":0===t.indexOf("mailto://")?c="mailto:":0===t.indexOf("/")&&occ.hasClass(l.parentElement,"usePage")?c="/":t.indexOf("@")>0?c="mailto:":!1===occ.isNothingOrEmpty(i)&&1*i!==NaN&&(c="IP"),""!=c&&(0===e.currentTarget.value.indexOf(c)&&(e.currentTarget.value=e.currentTarget.value.substring(c.length)),"INPUT"===l.tagName?occ.setDropDown(l,c):occ.switchSet(l,c)),occ.getElementFromString(o).value="",""!==e.currentTarget.value&&(c="INPUT"===l.tagName?l.value:occ.switchGet(o+"-useg"),occ.getElementFromString(o).value=("IP"!==c?c:"")+e.currentTarget.value,occ.checkInputControl({currentTarget:e.currentTarget}))}},ocCommon.prototype.setZipPaste=function(e){e.preventDefault(),e.stopPropagation();let t=e.clipboardData.getData("text/plain");t=t.replace(/\D/g,""),t.length>5&&(t=t.substring(0,5)),e.currentTarget.value=t;let o=e.currentTarget;setTimeout(function(){occ.checkInputControl(o.id),occ.triggerEvent(o.parentElement,"change")},200)},ocCommon.prototype.setTelephonePaste=function(e){e.preventDefault(),e.stopPropagation();let t=e.clipboardData.getData("text/plain");t=t.toLowerCase().replace("ext.","x").replace("ext","x");let o=t.split("x");t=o[0].trim().replace(/\D/g,""),0===t.indexOf("1")&&(t=t.substring(1)),t.length>10&&(t=t.substring(0,10)),o.length>1&&(t+=" x"+o[1].trim()),e.currentTarget.value=t;let l=e.currentTarget;setTimeout(function(){l.setSelectionRange(26,26),occ.checkInputControl(l.id),occ.triggerEvent(l.parentElement,"change")},200)};let ocTelLastKey=null;ocCommon.prototype.setTelephoneDown=function(e){let t=!1;e.key?(("Backspace"===e.key||"Delete"===e.key||e.key.indexOf("Arrow")>-1||"Tab"===e.key||ocTelLastKey+e.key==="Controlv"||ocTelLastKey+e.key==="Metav")&&(t=!0),ocTelLastKey=e.key):((e.keyCode>36&&e.keyCode<41||8===e.keyCode||9===e.keyCode||46===e.keyCode||ocTelLastKey+e.keyCode==="1786"||ocTelLastKey+e.keyCode==="9186")&&(t=!0),ocTelLastKey=e.keyCode+"");var o="";e.key?o=e.key.replace("Numpad",""):(o=1*e.keyCode-48)>9&&(o=1*e.keyCode-96);let l=e.currentTarget.value,c=document.activeElement.selectionEnd-document.activeElement.selectionStart,i=occ.hasClass(e.currentTarget.parentElement,"useExt");o>=0&&o<=9&&l.length-c<(!0===i?26:14)&&(t=!0),!1===t&&(e.preventDefault(),e.stopPropagation())};let ocNumLastKey=null;ocCommon.prototype.checkNumberInput=function(e,t){let o=e.currentTarget;var l="";let c=-1;if(ocNumLastKey+e.key==="Controlv"||ocNumLastKey+e.key==="Metav"||ocNumLastKey+e.keyCode==="1786"||ocNumLastKey+e.keyCode==="9186")return!0;e.key?("ArrowLeft"!==(l=e.key.replace("Numpad",""))&&"ArrowRight"!==l&&"Backspace"!==l&&"Delete"!==l&&"Tab"!==l||(c=1e4),1!==l.length||isNaN(l)||(c=1*l),ocNumLastKey=e.key):((l=1*e.keyCode-48)>9&&(l=1*e.keyCode-96),-11!==l&&-9!==l&&-39!==l&&-40!==l&&-2!==l||(l=1e4),c=l,ocNumLastKey=e.keyCode+"");let i=document.activeElement.selectionEnd-document.activeElement.selectionStart,a=o.value;return!(c<1e3&&(c<0||c>9||a.length-i>t))},ocCommon.prototype.setTelephoneUp=function(e){let t=e.currentTarget,o=document.activeElement.selectionEnd,l=document.activeElement.selectionEnd-document.activeElement.selectionStart,c=t.value,i=occ.hasClass(e.currentTarget.parentElement,"useExt");if(!1===occ.checkNumberInput(e,!0===i?26:13)&&(e.preventDefault(),e.stopPropagation()),"ArrowLeft"===e.key||"ArrowRight"===e.key||"Shift"===e.key||"Control"
3===e.key)return;"Backspace"!==e.key&&8!==e.keyCode&&(c=occ.formatTelephone(c,null,!1)),t.value=c;let a=c.split("x");c=a[0].trim().replace(/\D/g,"")+(a.length>1?"x"+a[1].trim():"");let n=t.id;if(n.endsWith("-hp")&&(n=n.substring(0,n.length-3)),occ.getElementFromString(n).value=c,occ.getElementFromString(n).setAttribute("data-value",c),l>0){let e;t.createTextRange?(e=t.createTextRange(),e.move("character",o),e.select()):(t.focus(),void 0!==t.selectionStart&&t.setSelectionRange(o,o))}else o>0&&"v"!==e.key&&(1===o?o=2:4===o?o=6:9===o||9===o?o=10:14===o?o=16:15===o&&(o=17),t.setSelectionRange(o,o));occ.checkInputControl(e),occ.triggerEvent(t.parentElement,e.type),ocTelLastKey=null},ocCommon.prototype.changeInputControlCB=function(e){let t=e.tagName?e:e.currentTarget;e.currentTarget&&(e.preventDefault(),e.stopPropagation()),occ.triggerEvent(t.parentElement,"change"),t.parentElement.parentElement&&t.parentElement.parentElement.getAttribute("onchange")&&occ.triggerEvent(t.parentElement.parentElement,"change")},ocCommon.prototype.keyInputControlCB=function(e){let t=e.currentTarget;occ.hasClass(t.parentElement,"oczip")&&("keydown"===e.type&&!1===occ.checkNumberInput(e,4)&&(e.preventDefault(),e.stopPropagation()),"keyup"===e.type&&(ocNumLastKey=null)),t.parentElement&&t.parentElement.getAttribute("on"+e.type)?occ.triggerEvent(t.parentElement,e.type):t.parentElement.parentElement&&t.parentElement.parentElement.getAttribute("on"+e.type)&&occ.triggerEvent(t.parentElement.parentElement,e.type)},ocCommon.prototype.checkInputControlLength=function(e){let t=e.currentTarget,o="number"===t.getAttribute("type"),l=1*t.getAttribute("minlength");o&&(l=1*t.getAttribute("min")),occ.removeClass(t,"invalid"),occ.removeClass(t.parentElement,"invalid"),(o&&("1"===t.getAttribute("step")&&t.value.indexOf(".")>-1||NaN!==l&&1*t.value<l)||!1===o&&t.value.length<l)&&(occ.addClass(t,"invalid"),occ.addClass(t.parentElement,"invalid"));let c=occ.getElementFromString(t.id+"-cp");c&&c.value.length>0&&occ.triggerEvent(c,"keyup")},ocCommon.prototype.setInputControlLabel=function(e,t){let o=null,l=occ.getElementFromString(e);if(l&&(!1===occ.hasAnyClasses(l,["ocField-obj","ocInputControl-obj"])&&(l=l.parentElement),o=l.querySelector("label"),o)){let e=o.querySelector("span"),l=o.querySelector("div");o.innerHTML=t,e&&o.appendChild(e),l&&o.appendChild(l)}},ocCommon.prototype.setInputControlInfo=function(e,t,o){let l=null,c=null,i=null;if(!0!==o){if(c=occ.getElementFromString(e),!c)return;!1===occ.hasAnyClasses(c,["ocField-obj","ocInputControl-obj"])&&(i=c.parentElement,l=i.querySelector("div.fieldInfo"))}if(!l||!0===o){l=occ.createDiv("<span></span>",["fieldInfo"]),occ.addClickEvent(l.querySelector("span"),occ.fieldInfoClick);let e=occ.createAnchor("more...",["moreDiv"]);l.appendChild(e),!0!==o&&null!==i&&i.appendChild(l)}return l.querySelector("span").innerHTML=t,!0!==o?(occ.checkFieldInfo(l),null):l},ocCommon.prototype.setInputControlValue=function(e,t,o,l){let c=occ.getElementFromString(e),i=null;if(c){if(t=t&&null!==t||0===t?t:"",!0===occ.hasClass(c,"ocDateControl-obj"))occ.setDateObj(e,t,o);else{if(!1===occ.hasClass(c.parentElement,"ocurl")&&c.parentElement.querySelector("div.posDiv")&&("string"==typeof t&&t.indexOf("|")>-1&&(l=t.substring(0,t.indexOf("|")),t=t.substring(t.indexOf("|")+1)),c.setAttribute("data-optsval",l),c.setAttribute("data-optsvalcv",!0!==o?l:""),l="#*"+l+"*#",i=c.parentElement.querySelector("div.posDiv > div.ocDropDown > div.select"),i?(occ.setDropDown(e+"-useg",l),occ.resizeOptsDdl({currentTarget:i.parentElement})):(i=e+"-useg",occ.switchSet(e+"-useg",l))),!0===occ.hasClass(c.parentElement,"ocpdfviewer"))"string"==typeof t&&!1===occ.isNothingOrEmpty(t)&&(t=JSON.parse(t)),Array.isArray(t)&&t.length>0?(occ.isNothingOrEmpty(c.parentElement.getAttribute("data-ourl"))&&!1===occ.isNothingOrEmpty(c.parentElement.getAttribute("data-url"))&&c.parentElement.setAttribute("data-url",c.parentElement.getAttribute("data-url")),c.parentElement.setAttribute("data-fdl",t[0].dl),c.parentElement.setAttribute("data-url",t[0].fileUrl),c.parentElement.setAttribute("data-fn",t[0].fileTitle),c.value="-1",!0!==o?c.setAttribute("data-cv","-1"):c.setAttribute("data-cv","")):(c.value="",c.setAttribute("data-cv",""));else if(!0===occ.hasClass(c.parentElement,"ocfile")||!0===occ.hasClass(c.parentElement,"ocimage")||!0===occ.hasClass(c.parentElement,"ocimageplus")||!0===occ.hasClass(c.parentElement,"ocfileplus"))occ.setFileControl(c,t,o);else if(!0===occ.hasClass(c.parentElement,"ocresource")||occ.hasClass(c.parentElement,"ocsystemresource")||!0===occ.hasClass(c.parentElement,"ocsystemadminresource")){occ.removeClasses(c.parentElement,["hasIcon","hasValue"]);let l=c.parentElement.querySelector("div.ocInputControl-resources");if(l&&(l.innerHTML=""),t&&!0!==occ.isNullOrEmpty(t)&&"[]"!==t){"string"==typeof t&&!1===occ.isNothingOrEmpty(t)&&(t=JSON.parse(t));let i="";if(Array.isArray(t)&&t.length>0){occ.addClass(c.parentElement,"hasValue");let e="^";for(let o=0;o<t.length;o++)-1===e.indexOf("^"+t[o].eFileId+"^")&&(""!=i&&(i+=","),i+="["+t[o].fileTitle+"]",l&&("pdf"===t[o].fileType?l.appendChild(occ.createDiv("",["icon","s-pdf","sz6","rv"],null)):"mp4"===t[o].fileType?l.appendChild(occ.createDiv("",["icon","s-play","sz6","rv"],null)):0===t[o].fileUrl.toLowerCase().indexOf("http")?l.appendChild(occ.createDiv("",["icon","s-link","sz6","rv"],null)):l.appendChild(occ.createElement("img",null,[{name:"src",value:t[o].fileUrl+"&s=thumb"}]))),e+=t[o].eFileId+"^");i="("+t.length+") "+i,c.value=JSON.stringify(t)}else{occ.addClass(c.parentElement,"hasValue"),c.value=t.eFileId?t.eFileId:"",i=t.fileTitle?t.fileTitle:"";let e=c.parentElement.querySelector("img.ocInputControl-icon");e&&(e.src=t.fileUrl+"&s=thumb",occ.addClass(c.parentElement,"hasIcon"))}!0!==o&&c.setAttribute("data-cv",c.value),occ.getElementFromString(e+"-hp").value=i}else c.value="",c.setAttribute("data-cv",""),occ.getElementFromString(e+"-hp").value="";occ.chooseResourceClose(e)}else if("checkbox"===c.getAttribute("type"))"checked"===t||"Y"===t||"true"===t||!0===t?(c.checked=!0,!0!==o&&c.setAttribute("data-cv","true")):(c.checked=!1,!0!==o&&c.setAttribute("data-cv","false"));else{if(!0!==o&&c.setAttribute("data-cv",t),c.value=t,!0===occ.hasClass(c.parentElement,"occolor")&&!1===occ.hasClass(c.parentElement,"required")){let o=occ.getElementFromString(e+"-hp");o.value=t,occ.setOCFormField(e+"-cseg",occ.isNothingOrEmpty(t)?"S":"C"),occ.isNothingOrEmpty(t)?(occ.addClass(c.parentElement,"defColor"),o.disabled=!0,o.setAttribute("disabled","disabled")):(occ.removeClass(c.parentElement,"defColor"),o.disabled=!1,o.removeAttribute("disabled"))}if(!0===occ.hasClass(c.parentElement,"octext")&&"true"===c.parentElement.dataset.rich){let o=!1===occ.isNothingOrEmpty(t)&&0===t.indexOf("{")?JSON.parse(t):{text:t,size:"",color:"",align:"",padding:""};occ.getElementFromString(e+"-hp").value=o.text,occ.getElementFromString(e).value=JSON.stringify(o),occ.getElementFromString(e).dataset.cv=JSON.stringify(o)}if(!0===occ.hasClass(c.parentElement,"ocurl")){let o=occ.getElementFromString(e+"-hp");if(o)if(!1===occ.hasClass(c.parentElement,"useEmail")&&occ.hasClass(c.parentElement,"allowLocal")&&0===t.indexOf("/"))o.value=t,occ.switchSet(e+"-useg","https://");else{occ.hideField(e+"-pageList");let l="";if(occ.hasClass(c.parentElement,"useEmail")||occ.hasClass(c.parentElement,"usePage")||occ.hasClass(c.parentElement,"useIP")){let i=t.replace(/./g,"");i.length>0&&(i*=1),0===t.indexOf("mailto:")?l="mailto:":0===t.indexOf("http://")?l="http://":0===t.indexOf("https://")?l="https://":i.length>0&&NaN!==i?l="IP":(occ.hasClass(c.parentElement,"usePage")||""===t)&&(l="/"),o.value=0===t.indexOf(l)?t.substring(l.length):t,occ.setDropDown(e+"-useg",l),"/"===l&&(occ.showField(e+"-pageList"),occ.setOCFormField(e+"-pageList",t.substring(1)))}else o.value=t.substring(t.indexOf("//")+2),t.substring(0,t.indexOf("//")+2),occ.isNullOrEmpty(l)&&(l="https://"),occ.switchSet(e+"-useg",l)}}if(!0===occ.hasClass(c.parentElement,"octel")){occ.getElementFromString(e+"-hp").value=occ.formatTelephone(t,null,!1);let l=occ.formatTelephone(t,null,!1);l=l.replace(/\D/g,""),c.value=l,!0!==o&&c.setAttribute("data-cv",c.value)}let l=occ.getElementFromString(c.id+"-cp");l&&(l.value=c.value)}occ.checkInputControl(e)}occ.disableControl(e,!1),!0===occ.hasClass(c.parentElement,"aiAssist")&&occ.triggerEvent(c.parentElement,"assistChange"),i&&occ.triggerEvent(c.parentElement,"change")}},ocCommon.prototype.trixCreate=function(e){let t=occ.getElementFromString(e+"-ctrl"),o=t.querySelector("div.fieldInfo"),l=t.querySelector("div.trix-editor");l&&l.remove(),l=t.querySelector("trix-editor"),l&&l.remove(),l=t.querySelector("trix-toolbar"),l&&l.remove(),t.appendChild(occ.createDiv(occ.getElementFromString(e).value,["trix-editor"])),l=occ.createElement("trix-editor",["trix-content"],[{name:"id",value:e+"-te"},{name:"input",value:e}]),"ios"!==occ.clientOs&&"android"!==occ.clientOs||(l.addEventListener("focus",occ.setVirtualKeyboard),l.addEventListener("blur",occ.setVirtualKeyboard)),l.addEventListener("trix-change-occ",occ.trixChangeCB),o?t.insertBefore(l,o):t.appendChild(l),setTimeout(function(){occ.triggerEvent(t,"load")},500)},ocCommon.prototype.trixChangeCB=function(e){let t=e.currentTarget,o=t.parentElement.querySelector("div.trix-editor");t=t.parentElement.querySelector('input[type="hidden"]'),o&&(o.innerHTML=t.value),0===lastTrixChange&&setTimeout(function(){occ.trixChangeCBCheck(t)},5e3),lastTrixChange++};let lastTrixChange=0;ocCommon.prototype.trixChangeCBCheck=function(e){let t=e.parentElement.querySelector("div.trix-editor");e.value=t.innerHTML,lastTrixChange=0,occ.checkInputControl(e,null,!0),occ.changeInputControlCB(e)},ocCommon.prototype.trixTextCleaner=function(e){return e=occ.replaceTag(e,"<div><center></center></div>",'<div style="text-align: center;"></div>'),e=occ.replaceTag(e,"<div><right></right></div>",'<div style="text-align: right;"></div>')},ocCommon.prototype.checkInputControl=function(e,t,o){let l=null,c=null;if(l="string"==typeof e||void 0===e.currentTarget?occ.getElementFromString(e):e.currentTarget,!l||null===l)return null;if(l.id.endsWith("-hp")?(c=l,l=occ.getElementFromString(l.id.substring(0,l.id.length-3))):c=occ.getElementFromString(l.id+"-hp"),"hidden"===l.getAttribute("type")&&!1===occ.isFieldVisible(l)||!0===occ.hasClass(l.parentElement,"ignoreField")||"hidden"
3!==l.getAttribute("type")&&(!1===occ.isVisible(l)||!1===occ.isVisible(l.parentElement)))return{valid:!0,clean:!0,complete:!0};let i=!1;if((l.disabled||occ.hasClass(l,"disabled"))&&occ.hasClass(l.parentElement,"disabled")&&(i=!0,occ.disableControl(l,!1)),null!==l.getAttribute("list")&&""!=l.getAttribute("list")&&!1===occ.hasClass(l.parentElement,"allowMultiple")){let e=occ.getElementFromString(l.getAttribute("list"));l.setAttribute("data-value","");for(let t=0;t<e.children.length;t++)l.value===e.children[t].value&&l.setAttribute("data-value",e.children[t].getAttribute("data-value"))}let a=0;!1===occ.isNullOrEmpty(l.getAttribute("minlength"))&&(a=1*l.getAttribute("minlength"));let n=0;!1===occ.isNullOrEmpty(l.getAttribute("maxlength"))&&(n=1*l.getAttribute("maxlength")),occ.removeClasses(l,["invalid","complete","incomplete","dirty","invalidEmail","invalidTelephone","hasValue","invalidIP","filedirty","datadirty"]),occ.removeClasses(l.parentElement,["invalid","complete","incomplete","dirty","nomatch","hasValue","duplicate","invalidEmail","invalidIP","filedirty","datadirty"]);let r=!0,s=!0,d=!0,u=!0,p=!1,m=!1;if((occ.hasClass(l,"required")||occ.hasClass(l.parentElement,"required"))&&!1===occ.hasClass(l.parentElement,"readOnly")&&(p=!0),!0===t){if(!1===occ.hasClass(l.parentElement,"ocurl")&&l.parentElement.querySelector("div.posDiv")){let e=l.parentElement.querySelector("div.posDiv > div.ocDropDown > div.select");e?(occ.setDropDown(l.id+"-useg",""),occ.resizeOptsDdl({currentTarget:e.parentElement})):occ.switchSet(l.id+"-useg","")}if(!0===occ.hasClass(l.parentElement,"ocpdfviewer")&&occ.resetPdfViewerCB({currentTarget:l},!0),occ.removeClass(l,"hasFile"),occ.removeClass(l.parentElement,"hasFile"),l.value="",l.setAttribute("data-cv",""),l.removeAttribute("data-optsval"),l.removeAttribute("data-optsvalcv"),!0===occ.hasClass(l,"ocDateControl-obj"))occ.addClass(l.parentElement,"clearValue"),occ.setDateObj(l.id,null,!1),occ.removeClass(l.parentElement,"clearValue");else if(!0===occ.hasClass(l.parentElement,"ocresource")||!0===occ.hasClass(l.parentElement,"ocsystemresource")||!0===occ.hasClass(l.parentElement,"ocsystemadminresource"))c.value="",c.setAttribute("data-cv","");else if(!0===occ.hasClass(l.parentElement,"ocswitch"))occ.switchClick(c.id,""),l.setAttribute("data-cv","");else if(!0===occ.hasClass(l.parentElement,"ocField")&&!0===occ.hasClass(l.parentElement,"occheckbox")){let e=l.parentElement.querySelectorAll(".ocFoItem.isChecked");for(let t=0;t<e.length;t++){occ.removeClass(e[t],"isChecked");let o=e[t].querySelector("input[type=checkbox]");o&&(o.checked=!1);let l=e[t].querySelector(".ocInputControl > input");l?(l.value="",occ.hideObj(l.parentElement)):(l=e[t].querySelector("input[type=text]"),l&&(l.value="",occ.hideObj(l)));let c=e[t].querySelector("input[type=hidden]");c&&(c.value="")}l.value=""}else!0===occ.hasClass(l.parentElement,"ocurl")?(occ.hasClass(l.parentElement,"usePage")&&(occ.setInputControlValue(l.id+"-pageList",""),this.hideField(l.id+"-pageList")),!1===occ.hasClass(l.parentElement,"useEmail")&&occ.hasClass(l.parentElement,"allowLocal")?occ.switchSet(l.id+"-useg","https://"):occ.setInputControlValue(l.id+"-useg","https://")):c&&!0===occ.hasClass(c.parentElement,"octel")?c.value="":c&&"file"===c.getAttribute("type")?occ.setFileControl(l,""):!0===occ.hasClass(l,"divSelect")&&occ.setOcFieldSelect(l),l.setAttribute("data-cv",l.value),"checkbox"===l.getAttribute("type")&&(l.checked=!1,l.setAttribute("data-cv","false"))}else{if(c&&"file"===c.getAttribute("type")){if(m=occ.hasClass(c.parentElement,"captionsRequired"),c&&c.files.length>0)d=!1;else if(1!=occ.isNullOrEmpty(l.value)&&"[]"!==l.value||!0!==p||(r=!1),0==occ.isNullOrEmpty(l.value)&&"[]"!==l.value){let e=JSON.parse(l.value),t=0;for(let o=0;o<e.length;o++)null!==e[o]&&!0===e[o].delete&&(d=!1,t++),!0===m&&!0===occ.isNullOrEmpty(e[o].fileCaption)&&(u=!1,r=!1);t===e.length&&!0===p&&(r=!1)}!0===occ.hasClass(l.parentElement,"invalidFile")&&(u=!1),!1===d&&(occ.addClass(l,"filedirty"),occ.addClass(l.parentElement,"filedirty"))}else if(l.value&&l.value.length>0)if(!0===occ.hasClass(l,"ocField")&&!0===occ.hasClass(l.parentElement,"invali
3dFillin"))r=!1;else{let e=occ.getElementFromString(l.id+"-cp");if(e&&l.value!==e.value)r=!1,s=!1;else if("number"!==l.getAttribute("type")&&(a>0&&l.value.length<a||n>0&&l.value.length>n))r=!1;else{" "!==l.value&&"  "!==l.value&&"   "!==l.value||(l.value=""),l.parentElement.querySelector("div.resourceContainer")&&(r=!occ.isVisible(l.parentElement.querySelector("div.resourceContainer")),!1===r&&(u=r,d=r));let e=l.value;if(!0===occ.hasClass(l.parentElement,"ocresource")){let t=JSON.parse(0===e.indexOf("[")?e:"[]"),o=JSON.parse(0===l.getAttribute("data-cv").indexOf("[")?l.getAttribute("data-cv"):"[]"),c=0,i=0;for(let e=0;e<o.length;e++){let l=!1;for(let i=0;i<t.length;i++)t[i].eFileId===o[e].eFileId&&(c++,l=!0);!1===l&&i++}i>0||0===i&&t.length>o.length?d=!1:0===i&&(d=!0)}else if(!0===occ.hasClass(l,"ocField")&&!0===p&&!0===occ.hasClass(l.parentElement,"retainDelete")){let t=JSON.parse(e),o=0;for(let e=0;e<t.length;e++)!0!==t[e].deleted&&o++;0===o&&(r=!1)}else if(!0===occ.hasClass(l.parentElement,"octel")||"tel"===l.getAttribute("type")){let t=e.split("x");e=t[0].trim().replace(/\D/g,""),e.length<10&&(occ.addClass(l,"invali
3dTelephone"),r=!1)}else if("email"===l.parentElement.getAttribute("data-type")||"email"===l.getAttribute("type")){let t=/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*(\.\w{2,})+$/;(e.length<8||!t.test(e))&&(occ.addClass(l,"invalidEmail"),r=!1)}else if("zip"===l.parentElement.getAttribute("data-type")){let t=e.replace(/\D/g,""),o=1*e;(1>o||99999<o||t.length<5)&&(r=!1)}else if("number"===l.getAttribute("type")){let t=e.replace(/\D/g,""),o=l.getAttribute("min"),c=l.getAttribute("max"),i=1*e;("1"===l.getAttribute("step")&&l.value.indexOf(".")>-1||!1===occ.isNothingOrEmpty(o)&&1*o>i||!1===occ.isNothingOrEmpty(c)&&1*c<i||p&&0===t.length)&&(r=!1),!0===occ.hasClass(l.parentElement,"money")&&(l.value=Number.parseFloat(l.value).toFixed(2))}else if("link"===l.parentElement.getAttribute("data-type")||"url"===l.parentElement.getAttribute("data-type")){let t=l.value.toLowerCase(),o="",c=occ.getElementFromString(l.id+"-useg");if(c&&(o=c.value),occ.hasClass(l.parentElement,"allowLocal")&&0===t.indexOf("/"))t.length<2&&(r=!1);else if(c&&"https://"!==o&&"http://"!==o||-1!==t.indexOf("."))if("IP"===o){let t=e.split(".");if(1*e.replace(/\./g,"")===NaN||4!==t.length)r=!1;else for(let e=0;e<t.length;e++)if(t[e].length<1||t[e].length>3)r=!1;else{let o=1*t[e];(NaN===o||o<1&&0===e||o<0||o>255)&&(r=!1)}!1===r&&occ.addClass(l.parentElement,"invalidIP")}else if("mailto:"===o){let t=/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*(\.\w{2,})+$/;e=e.replace("mailto:",""),(e.length<8||!t.test(e))&&(occ.addClass(l.parentElement,"invalidEmail"),r=!1)}else if("/"===o&&occ.hasClass(l.parentElement,"usePage")){let e=occ.getElementFromString(l.id+"-pageList");e&&(""===e.value?(r=!1,l.value=""):l.value="/"+e.value)}else{t=t.replace("http://","").replace("https://",""),t.indexOf("/")>0&&(t=t.substring(0,t.indexOf("/"))),t.indexOf("?")>0&&(t=t.substring(0,t.indexOf("?")));let e=t.split(".");(t.indexOf("@")>-1||e.length<2||e[e.length-2].length<1||e[e.length-1].length<2)&&(r=!1)}else r=!1}else if("videolink"===l.parentElement.getAttribute("data-type")){let e=l.value.toLowerCase();5===e.indexOf("%")&&(l.value=l.value.replace("%3A//","://").replace("%3a//","://"),e=l.value.toLowerCase()),(l.value.length<14||l.value.length>0&&0!==e.indexOf("https://")||!1===occ.checkVideoCode(e,occ.hasClass(l.parentElement,"allowMP4")))&&(r=!1)}else if("alphanumericspace"===l.parentElement.getAttribute("data-type")){let e=l.value;e=e.replaceAll(/ /g,""),r=occ.alphanumericCheck(e)}else if("alphanumericdash"===l.parentElement.getAttribute("data-type")){let e=l.value;e=e.replaceAll(/-/g,""),r=occ.alphanumericCheck(e)}else"alphanumeric"===l.parentElement.getAttribute("data-type")?r=occ.alphanumericCheck(l.value):"textnohtml"===l.parentElement.getAttribute("data-type")?r=!occ.htmlCheck(l.value):"textonly"===l.parentElement.getAttribute("data-type")&&(r=occ.textCheck(l.value))}}else!0===p&&(r=!1);if(l.parentElement.querySelector("div.posDiv")&&l.getAttribute("data-optsval")!==l.getAttribute("data-optsvalcv")&&(d=!1),occ.hasAllClasses(l.parentElement,["ococcalendar","active"]))r=!1,d=!1,u=!1;else{if(!0===occ.hasClass(l,"ocField"))if(!0===occ.hasClass(l,"ocField")&&!0===occ.hasClass(l.parentElement,"invali
3dFillin"))r=!1,l.getAttribute("data-cv")!==l.value&&(d=!1);else if(!1===occ.isNothingOrEmpty(l.getAttribute("data-cv"))&&0===l.getAttribute("data-cv").indexOf("["))try{let e=JSON.parse(0===l.getAttribute("data-cv").indexOf("[")?l.getAttribute("data-cv"):"[]"),t=JSON.parse(l.value),o=0;if(e.length>0&&t.length>0&&t.length===e.length)for(let l=0;l<t.length;l++){let c=!1;for(let o=0;o<e.length;o++)t[l].fieldValue===e[o].fieldValue&&(c=!0,t[l].fieldFillIn===e[o].fieldFillIn&&t[l].fieldStart===e[o].fieldStart&&t[l].fieldEnd===e[o].fieldEnd&&t[l].deleted===e[o].deleted&&t[l].isDefault===e[o].isDefault||(d=!1));0==c&&o++}(o>0||t.length!==e.length)&&(d=!1)}catch(e){l.getAttribute("data-cv")!==l.value&&(d=!1)}else l.getAttribute("data-cv")!==l.value&&(d=!1);else if("checkbox"===l.getAttribute("type"))(!0===l.checked&&"false"===l.getAttribute("data-cv")||!1===l.checked&&"true"===l.getAttribute("data-cv"))&&(d=!1),!1===l.checked&&!0===p&&(r=!1);else if("TEXTAREA"===l.tagName){let t=l.value,o=l.getAttribute("data-cv"),c=l.getAttribute("inputMode");if(t.indexOf("<xml")>-1||t.indexOf("</")>-1){let e=occ.createDiv(t),l=occ.createDiv(o);e.innerHTML!=l.innerHTML&&(d=!1)}else t!=o&&(d=!1);if("gsmMS"===c){let e=occ.checkGSMText(t);occ.setInputControlInfo(l,""===e?"":"*"+e),""!==e&&(r=!1)}else if(!0===occ.hasClass(l.parentElement,"ocjson"))try{if(-1===t.indexOf("{")&&-1===t.indexOf("["))r=!1;else JSON.parse(t)}catch(e){r=!1}}else("number"===l.type&&l.value!==l.getAttribute("data-cv")&&1*l.value!=1*l.getAttribute("data-cv")||!0===occ.hasClass(l,"ocDateControl-obj")&&l.value!==l.getAttribute("data-cv")||"number"!==l.type&&!1===occ.hasClass(l,"ocDateControl-obj")&&l.value!==l.getAttribute("data-cv")&&null!=l.getAttribute("data-cv"))&&(d=!1,occ.addClass(l,"datadirty"),occ.addClass(l.parentElement,"datadirty"));!1===s&&(occ.addClass(l,"nomatch"),occ.addClass(l.parentElement,"nomatch")),!1===r&&!0===s&&(occ.addClass(l,"invali
3d"),occ.addClass(l.parentElement,"invalid")),!1===d&&(occ.addClass(l,"dirty"),occ.addClass(l.parentElement,"dirty")),!0!==p&&!0!==m||(!1===r||"checkbox"===l.getAttribute("type")&&!1===l.checked?(u=!1,occ.addClass(l,"incomplete"),occ.addClass(l.parentElement,"incomplete")):(u=!0,occ.addClass(l,"complete"),occ.addClass(l.parentElement,"complete")));let t=l.parentElement.getAttribute("data-child");null!==t&&""!==t&&occ.filterFieldValue(t,occ.getElementFromString(l.id).value)}}return!0===i&&occ.disableControl(l,!0),l.value&&!1===occ.isNullOrEmpty(l.value)&&"[]"!==l.value&&(occ.addClass(l.parentElement,"hasValue"),e.currentTarget&&!0===p&&!0===u&&!0===r&&occ.cpe(e)),!0===occ.hasClass(l.parentElement,"trixLoaded")&&!0!==o&&occ.trixCreate(l.id),occ.hasClass(l.parentElement.parentElement,"ocTagCtrl")&&occ.saveTagControl(e),{valid:r,clean:d,complete:u}};let cFields=[];ocCommon.prototype.loadOCFormCheck=function(e,t){if(e&&!1===occ.isNullOrEmpty(e)&&(e=occ.getElementFromString(e))&&null!==e){let o=!1;for(let l=0;l<cFields.length;l++)if(cFields[l].fi===e.id){o=!0;let e=0;if(t!==cFields[l].complete){if(!1===t)e=1,!1===occ.hasClass(cFields[l].parentObj,"fieldChecking")&&occ.showWaiting(0,cFields[l].parentObj,"Loading..."),occ.addClass(cFields[l].parentObj,"fieldChecking");else if(!0===t){e=-1;let t=occ.getElementFromString(cFields[l].fi+"-ctrl");t&&("true"===t.getAttribute("data-fieldhidden")&&occ.hideField(cFields[l].fi),"false"===t.getAttribute("data-fieldhidden")&&occ.showField(cFields[l].fi),t.removeAttribute("data-fieldhidden"))}cFields[l].parentObj.setAttribute("data-ocFieldCT",""+(1*cFields[l].parentObj.getAttribute("data-ocFieldCT")+e))}cFields[l].complete=t}let l=occ.getNearest(e,"ocFormContainer",!0);l||(l=document.body),o||(!1===t&&(occ.addClass(l,"fieldChecking"),!0===occ.isNothingOrEmpty(l.getAttribute("data-ocFieldCT"))?l.setAttribute("data-ocFieldCT","1"):l.setAttribute("data-ocFieldCT",""+(1*l.getAttribute("data-ocFieldCT")+1)),occ.showWaiting(0,l,"Loading...")),cFields.push({fi:e.id,parentObj:l,complete:t}))}let o=document.querySelectorAll(".fieldChecking");for(let e=0;e<o.length;e++)1*o[e].getAttribute("data-ocFieldCT")<1&&(o[e].setAttribute("data-ocFieldCT","0"),occ.removeClass(o[e],"fieldChecking"),occ.hideWaiting(o[e]))},ocCommon.prototype.checkOCFormContainer=function(e,t,o){let l=!0,c=!0,i=!0;if(e=occ.getElementFromString(e)){let a=[],n=[],r=[],s=e.querySelectorAll(".ocInputControl-obj:not(.disabled):not(.internalField) .ocInputControl-ip"),d=s.length;for(let e=0;e<s.length;e++)if(!0===occ.hasClass(s[e].parentElement.parentElement,"ocFormTab-innerSection")&&!1===occ.hasClass(s[e].parentElement.parentElement.parentElement,"innerSectionActive"));else{let o=occ.checkInputControl(s[e].id,t);null!==o&&(!1===o.valid&&(l=!1,r.push(s[e].id)),!1===o.clean&&(c=!1,a.push(s[e].id)),!1!==o.valid&&!1!==o.complete||(i=!1,n.push(s[e].id)))}s=e.querySelectorAll('.ocField:not(.disabled):not(.internalField) > input[type="hidden"]'),d+=s.length;for(let e=0;e<s.length;e++)if(!0===occ.hasClass(s[e].parentElement.parentElement,"ocFormTab-innerSection")&&!1===occ.hasClass(s[e].parentElement.parentElement.parentElement,"innerSectionActive"));else{let o=occ.checkInputControl(s[e].id,t);null!==o&&(!1===o.valid&&(l=!1,r.push(s[e].id)),!1===o.clean&&(c=!1,a.push(s[e].id)),!1!==o.valid&&!1!==o.complete||(i=!1,n.push(s[e].id)))}if(t){s=e.querySelectorAll("div.ocTagCtrl-obj.ocTagCtrl"),d+=s.length;for(let e=0;e<s.length;e++)occ.setTagControlValues(s[e],"",!1);occ.setOCFormMode(e,"RemoveALL"),occ.removeClasses(e,["forceDirty","forceInvalid","forceInComplete"]),occ.removeClass(e.querySelectorAll("div.ocFormTab.unsaved"),"unsaved"),occ.removeClass(e.querySelectorAll("div.ocFormTab.forceDirty"),"forceDirty")}else(occ.hasClass(e,"forceDirty")||e.querySelector("div.ocFormTab.forceDirty"))&&(c=!1),(occ.hasClass(e,"forceInvalid")||e.querySelector("div.ocFormTab.forceInvalid"))&&(l=!1),(occ.hasClass(e,"forceInComplete")||e.querySelector("div.ocFormTab.forceInComplete"))&&(i=!1);if(d>0&&(o||(o=occ.hasClass(t,"ocDialog-Obj")),!0!==t&&!0!==o&&!0!==c&&(!0!==l||!0!==i))){let e=n.concat(r),t="",o="^";for(let l=0;l<e.length;l++){if(-1===o.indexOf("^"+e[l]+"^")){let o=occ.getElementFromString(e[l]),c="field";if(o.parentElement.querySelector("label")&&occ.isVisible(o.parentElement.querySelector("label")))c=o.parentElement.getAttribute("data-label"),occ.isNothingOrEmpty(c)&&(c=o.parentElement.querySelector("label").innerHTML.replace("*required","").replace("enter/select a value",""));else{let e=o.parentElement.getAttribute("data-type");switch(!0===occ.isNothingOrEmpty(e)&&occ.hasClass(o.parentElement,"ocField")&&(e="true"===o.parentElement.getAttribute("data-segment")?"switch":"selection"),e){case"occalendar":e="date";break;case"switch":e="",o.parentElement.querySelectorAll("div.switchGroup > a").forEach(t=>{""!==e&&(e+="/"),e+=t.innerText})}!1===occ.isNothingOrEmpty(e)&&(c+=" ("+e+")")}t+="&nbsp;&#x2022;&nbsp;&nbsp;"+c+'<span data-id="'+e[l]+'"></span>'+"<br>"}o+=e[l]+"^"}if(""!==t){let o=function(){occ.dlgMsg.close(),occ.getElementFromString(e[0]).parentElement.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})},l=[{id:"close"+occ.eid(),content:"Close",onClick:function(){occ.dlgMsg.close()}
3,align:"L"},{id:"view"+occ.eid(),content:"Show Field",onClick:o}];occ.msgDlg("Incomplete Or Invalid Entry",'<p class="formMsgList">The following field(s) need attention:<br>'+t+"</p>","mini",l)}}occ.resizeFormFields();let u=e.querySelectorAll(".dt-form-field");if(u&&u.length>0){let t=window.mbl.prototype.validateForm(e);if(!1===t.valid&&(l=!1),!1===t.clean&&(c=!1),!1===t.complete&&(i=!1),Array.isArray(t.dirtyIds)&&t.dirtyIds.length>0)for(let e=0;e<t.dirtyIds.length;e++)-1===a.indexOf(t.dirtyIds[e])&&a.push(t.dirtyIds[e]);if(Array.isArray(t.incompleteIds)&&t.dirtyIds.incompleteIds>0)for(let e=0;e<t.incompleteIds.length;e++)-1===n.indexOf(t.dirincompleteIdstyIds[e])&&n.push(t.incompleteIds[e])}return{valid:l,clean:c,complete:i,dirty:a,invalid:r,incomplete:n}}return null},ocCommon.prototype.setOCFormMode=function(e,t,o){let l;if("string"==typeof e?(!0===e.endsWith("-ctrl")&&(e=e.substring(0,e.length-5)),l=occ.getElementFromString(e)):l=e,l)if("RemoveALL"===t)occ.removeClass(l,"compareMode");else if(!1!==o){let e=l.querySelectorAll(".ocInputControl");for(let t=0;t<e.length;t++)occ.addRevertObj(e[t]);e=l.querySelectorAll("input.ocField");for(let t=0;t<e.length;t++)occ.addRevertObj(e[t]);occ.addClass(l,t+"Mode")}else occ.removeClass(l,t+"Mode")},ocCommon.prototype.addRevertObj=function(e){if(e){let t=e.id.replace("-ctrl",""),o=occ.getElementFromString(t);if("INPUT"===e.tagName&&(e=o.parentElement),!1===occ.hasClass(o.parentElement,"ocFoItem")&&!1===occ.hasClass(o.parentElement,"fieldFillIn")){let l=o.getAttribute("data-cv");if(0===l.indexOf("[")||0===l.indexOf("{"))try{let t=JSON.parse(l);if(l="",Array.isArray(t))for(let o=0;o<t.length;o++){let c=!0;!1===occ.isNothingOrEmpty(t[o].etCatId)&&(c=!1,e.getAttribute("data-eFieldId")===t[o].etCatId&&(c=!0)),occ.isNothingOrEmpty(t[o].fieldOption)&&(c=!1),!0===c&&(""!==l&&(l+=", "),t[o].fieldOption?(l+="<br>"+t[o].fieldOption,!1===occ.isNothingOrEmpty(t[o].fieldFillIn)&&(l+=" : "+t[o].fieldFillIn),!1===occ.isNothingOrEmpty(t[o].fieldStart)&&(l+=" : "+t[o].fieldStart),!1===occ.isNothingOrEmpty(t[o].fieldEnd)&&(l+=" : "+t[o].fieldEnd)):!1===occ.isNothingOrEmpty(t[o].fileName)&&(occ.hasClass(e,"ocfileplus")||occ.hasClass(e,"ocimageplus")?(l+='<div data-fileid="'+t[o].eFileId+'" class="cvPVRow"><img class="icon-jpg" src="'+t[o].fileUrl+'&s=thumb" />',l+="<span>"+(occ.isNullOrEmpty(t[o].fileCaption)?"no caption":t[o].fileCaption)+"</span></div>"):l+='<div data-fileid="'+t[o].eFileId+'" class="cvPV"><img class="icon-jpg" src="'+t[o].fileUrl+'&s=thumb" /><br>'+t[o].fileTitle+"</div>"))}}catch(e){console.log(e)}else if(!0===occ.hasClass(o,"ocField")){let e=o.parentElement.querySelector('option[data-value="'+l+'"]');e?l=e.getAttribute("data-option"):(e=o.parentElement.querySelector('a[data-switchval="'+l+'"]'),e&&(l=e.innerHTML))}if(l="<span>Current Value:</span> "+l,occ.getElementFromString(t+"-rbtn")){e.querySelector("div.cvDiv").innerHTML=l}else{let o=occ.createDiv(l,["cvDiv"]);e.appendChild(o);let c=occ.ocButton(t+"-rbtn","Revert",occ.revertBtnClick,"refresh");occ.addClass(c,"rvBtn"),e.appendChild(c)}}}},ocCommon.prototype.revertBtnClick=function(e){let t=occ.getElementFromString(e.currentTarget.id.replace("-rbtn",""));if(t&&!1===occ.isNothingOrEmpty(t.id)){let e=t.getAttribute("data-cv");if(0===e.indexOf("[")||0===e.indexOf("{"))try{e=JSON.parse(e)}catch(e){console.log(e)}occ.setOCFormField(t.id,e,!1)}},ocCommon.prototype.setOCFormField=function(e,t,o,l){let c;if("string"==typeof e?(!0===e.endsWith("-ctrl")&&(e=e.substring(0,e.length-5)),c=occ.getElementFromString(e)):c=e,c&&c.parentElement)if(!0!==this.mbl||!0!==occ.hasClass(c.parentElement,"dt-form-field")){if(null==t?t="":"object"!=typeof t&&(t+=""),!0===occ.hasClass(c,"loading")&&!0===occ.hasClass(c,"ocField-obj")&&!1===occ.isNullOrEmpty(t))return!0===o&&occ.addClass(c,"setDirtyTemp"),void c.setAttribute("data-loadvalue","object"!=typeof t?t:JSON.stringify(t));if(occ.hasClass(c.parentElement,"ocInputControl")||occ.hasClass(c.nextElementSibling,"ocDateControl"))occ.setInputControlValue(e,t,o,l);else if((occ.hasClass(c.parentElement,"ocField")||occ.hasClass(c,"divSelect"))&&!1===occ.hasClass(c.parentElement,"ocTag-Item"))occ.updateField(e,null,t,!1,o);else if(occ.hasClass(c.parentElement,"ocTagCtrl")||occ.hasClass(c,"ocTagCtrl-obj")||occ.hasClass(c.parentElement,"ocTag-Item"))if(occ.hasClass(c,"ocTagCtrl-obj")&&!1===occ.hasClass(c,"ocTagCtrl"))occ.reInitTagControl(c,null,null,null,t,o);else{if(!1===Array.isArray(t)&&!1===occ.isNothingOrEmpty(t))try{t=JSON.parse(t)}catch(e){}!0===Array.isArray(t)&&occ.setTagControlValues(c,t,o)}if(!0===occ.hasClass(c.parentElement,"occolor")){c.parentElement.querySelector("input.occolor").style.backgroundColor=t}if(0==occ.hasClass(c,"allowMultiple")&&!0===occ.hasClass(c,"required")&&(!t||!0===occ.isNullOrEmpty(t))){let t=
3occ.getElementFromString(e);if(!0===occ.hasClass(t,"divSelect")&&3===t.parentElement.children.length){let o=t.parentElement.querySelectorAll("div.option");!1===occ.isNullOrEmpty(o[0].getAttribute("data-fieldValue"))?occ.setOCFormField(e,o[0].getAttribute("data-fieldValue")):occ.setOCFormField(e,o[1].getAttribute("data-fieldValue"))}else t=occ.getElementFromString(e+"-ip"),t&&t.list&&1===t.list.children.length&&occ.setOCFormField(e,t.list.children[0].getAttribute("data-value"))}}else window.mbl.prototype.updateInputControl(c,t,l,{forceDirty:o})},ocCommon.prototype.resizeFormFields=function(e){let t=(e=e&&null!==e?occ.getElementFromString(e):document).querySelectorAll("div.ocInputControl");for(let e=0;e<t.length;e++)occ.resizeFormField(t[e]);t=e.querySelectorAll("div.ocField");for(let e=0;e<t.length;e++)occ.resizeFormField(t[e]);t=[];let o=e.querySelectorAll("div.ocField.dynamic");if(o.length>0)for(let e=0;e<o.length;e++)t.push({wd:o[e].clientWidth,obj:o[e]});let l=e.querySelectorAll("div.select.dynamic");if(l.length>0)for(let e=0;e<l.length;e++)t.push({wd:l[e].parentElement.clientWidth,obj:l[e]});for(let e=0;e<t.length;e++){occ.addClasses(t[e].obj,["segment","checking"]);let o=t[e].obj.querySelectorAll("div.option"),l=15,c=0;for(let e=0;e<o.length;e++)l+=o[e].clientWidth,o[e].clientWidth>c&&(c=o[e].clientWidth);t[e].wd<=l&&occ.removeClass(t[e].obj,"segment"),occ.removeClass(t[e],"checking")}},ocCommon.prototype.resizeFormField=function(e){if(0==occ.hasClass(e,"col-force")&&(occ.removeClasses(e,["col-2m","col-2-5m","col-3m","col-4m"]),(occ.hasClass(e,"col-4")||occ.hasClass(e,"col-5"))&&e.clientWidth<160&&occ.addClass(e,"col-2m"),occ.hasClass(e,"col-3")&&e.clientWidth<200&&occ.addClass(e,"col-2m"),occ.hasClass(e,"col-5")&&occ.hasClass(e,"col-2m")&&e.clientWidth<200&&(occ.removeClass(e,"col-2m"),occ.addClass(e,"col-5m")),occ.hasClass(e,"col-4")&&occ.hasClass(e,"col-2m")&&e.clientWidth<200&&(occ.removeClass(e,"col-2m"),occ.addClass(e,"col-4m")),occ.hasClass(e,"col-3")&&occ.hasClass(e,"col-2m")&&e.clientWidth<250&&(occ.removeClass(e,"col-2m"),occ.addClass(e,"col-3m")),occ.hasClass(e,"col-2-5")&&e.clientWidth<250&&occ.addClass(e,"col-2-5m"),occ.hasClass(e,"col-2")&&e.clientWidth<250&&occ.addClass(e,"col-2m")),occ.checkFieldInfo(e.querySelector("div.fieldInfo > span")),e.querySelector(".imageTbl.ocTable")){let t=e.querySelector(".imageTbl.ocTable").id;t&&occ.setUpTable(t)}},ocCommon.prototype.checkFieldInfo=function(e){e&&null!==e&&("SPAN"!==e.tagName&&(e=e.querySelector("span")),occ.removeClass(e.parentElement,"moreDiv"),occ.addClass(e.parentElement,"fsize"),e.clientHeight>20&&occ.addClass(e.parentElement,"moreDiv"),occ.removeClass(e.parentElement,"fsize"))},ocCommon.prototype.fieldInfoClick=function(e){e.preventDefault(),e.stopPropagation();let t=e.currentTarget.parentElement;occ.toggleClass(t,"moreDiv1")},ocCommon.prototype.disableForm=function(e,t,o){let l=occ.getElementFromString(e);if(l){let e=l.querySelectorAll(".ocFormField");for(let o=0;o<e.length;o++)occ.disableControl(e[o].id,t);e=l.querySelectorAll("div.ocTagCtrl-obj");for(let o=0;o<e.length;o++)occ.toggleClass(e[o].id,"disabled",!0===t?1:0);e=l.querySelectorAll(".opoClient-btn");for(let o=0;o<e.length;o++)!1===occ.hasClass(e[o],"storeBtn")&&occ.disableControl(e[o].id,t);if(o&&Array.isArray(o))for(let e=0;e<o.length;e++)!0===occ.hasClass(o[e],"ocTagCtrl")?occ.removeClass(o[e],"disabled"):occ.disableControl(o[e],!1)}},ocCommon.prototype.setFileControl=function(e,t,o){let l=e.parentElement.querySelectorAll(".filePV_temp");for(let e=0;e<l.length;e++)l[e].remove();l=e.parentElement.querySelectorAll(".filePV_DB");for(let e=0;e<l.length;e++)l[e].remove();let c=occ.getElementFromString(e.id+"-hp");c&&(c.value="");let i=[];Array.isArray(t)?i=t:t.indexOf("{")>-1&&(i=JSON.parse(t)),e.value=JSON.stringify(i),!0!==o&&e.setAttribute("data-cv",e.value);let a=occ.hasClass(e.parentElement,"ocimageplus"),n=occ.hasClass(e.parentElement,"ocfileplus"),r=null;if(a||n)if(r=e.parentElement.querySelector("div.imageTbl"),r)occ.clearTable(e.parentElement.id+"-tbl");else{r=occ.createDiv("",["imageTbl"],[{name:"id",value:e.parentElement.id+"-tbl"}]),n&&occ.addClass(r,"filePlus");
3let t=occ.createDiv('<div class="minWidth mobileCol center">'+(n?"File":"Image")+'</div><div class="mobileCol">'+(n?"File Title":"Image Caption")+' <span style="font-weight:normal; font-size:11px;">(also for screen readers) <i style="color: var(--Active-Text);">* required</i></span></div>',["ocTable-head"]);r.appendChild(t),e.parentElement.appendChild(r)}for(let t=0;t<i.length;t++)i[t]&&null!==i[t]&&occ.createImagePlusRow(r,i[t],e,!0);(a||n)&&r&&occ.setUpTable(r.id,!0,occ.updateImageJSON)},ocCommon.prototype.switchSet=function(e,t,o,l,c){var i="DIV"===e.tagName?e:occ.getElementFromString(e);if(e=i.id,i){if(this.addClass(i,"switchObj"),null===o&&(o=i.getAttribute("data-optns")),o&&null!==o&&o.indexOf("{")>0?o=JSON.parse(o):"Yes"===o?o=[{name:"No",value:"N"},{name:"Yes",value:"Y"}]:"YesI"===o?o=[{name:"No",value:"N"},{name:"Yes",value:"Y"},{name:"Inherit",value:"I"}]:"On"===o?o=[{name:"Off",value:"N"},{name:"On",value:"Y"}]:"OnI"===o?o=[{name:"Off",value:"N"},{name:"On",value:"Y"},{name:"Inherit",value:"I"}]:"Status"===o?o=[{name:"In-Active",value:"I"},{name:"Active",value:"A"}]:"StatusP"===o?o=[{name:"In-Active",value:"I"},{name:"Pending",value:"P"},{name:"Active",value:"A"}]:"StatusC"===o?o=[{name:"In-Active",value:"I"},{name:"Canceled",value:"C"},{name:"Active",value:"A"}]:"StatusPC"===o?o=[{name:"In-Active",value:"I"},{name:"Canceled",value:"C"},{name:"Pending",value:"P"},{name:"Active",value:"A"}]:"Publish"===o?o=[{name:"Pending",value:"P"},{name:"Publish",value:"A"}]:"Standard"===o?o=occ.getStandardArray():"Alignment"===o&&(o=occ.getAlignmentArray()),null===t&&(t=i.getAttribute("data-defval")),o&&o.length>0&&o[0].fieldOption)for(let e=0;e<o.length;e++)o[e].name=o[e].fieldOption,o[e].value=o[e].fieldValue,o[e].id=o[e].eFieldOptionId;if(t&&null!==t||(t=""),c&&!1!==c||!occ.hasClass(i,"switchGroup")){if(o&&i)if(o.length>1){occ.showObj(i),i.innerHTML="",this.addClass(i,"switchGroup"),i.setAttribute("data-switchVal",t),l&&null!==l&&occ.addClickEvent(i,l);for(var a=0;a<o.length;a++){var n=this.createAnchor(o[a].name,o[a].value===t?["active"]:null,[{name:"data-switchVal",value:o[a].value}]);!1===occ.isNothingOrEmpty(o[a].id)&&n.setAttribute("id",o[a].id),0===a&&occ.addClass(n,"first"),a===o.length-1&&occ.addClass(n,"last"),occ.addClickEvent(n,this.switchOnClick.bind(this)),o[a].width&&null!==o[a].width?(n.style.width=o[a].width+"px",n.style.minWidth="auto"):(n.style.width="",n.style.minWidth=""),i.appendChild(n)}occ.removeClass(i.parentElement,"emptyField")}else occ.addClass(i.parentElement,"emptyField"),occ.hideObj(i)}else{let e=occ.hasClass(i.id,"disabled");e&&this.disableControl(i.id,!1),this.switchClick(i.id,t),e&&this.disableControl(i.id,!0)}}},ocCommon.prototype.switchClick=function(e,t){var o=occ.getElementFromString(e);if(o&&!1!==occ.hasClass(o,"switchGroup")){var l=o.children;occ.removeClass(l,"active");for(var c=0;c<l.length;c++)(t===l[c].getAttribute("data-switchval")||""===t&&"all"===l[c].getAttribute("data-switchval"))&&occ.triggerEvent(l[c],"pointerup")}},ocCommon.prototype.switchGet=function(e){var t="DIV"===e.tagName?e:occ.getElementFromString(e);if(t)return t.getAttribute("data-switchVal")},ocCommon.prototype.switchDisable=function(e,t){var o=occ.getElementFromString(e);o&&(!0===t?(null!==o.getAttribute("onclick")&&""!==o.getAttribute("onclick")&&o.setAttribute("onclick-disabled",o.getAttribute("onclick")),null!==o.getAttribute("ontouchend")&&""!==o.getAttribute("ontouchend")&&o.setAttribute("ontouchend-disabled",o.getAttribute("ontouchend")),occ.addClass(o,"disabled")):(null!==o.getAttribute("onclick-disabled")&&""!==o.getAttribute("onclick-disabled")&&o.setAttribute("onclick",o.getAttribute("onclick-disabled")),null!==o.getAttribute("ontouchend-disabled")&&""!==o.getAttribute("ontouchend-disabled")&&o.setAttribute("ontouchend",o.getAttribute("ontouchend-disabled")),occ.removeClass(o,"disabled")))},ocCommon.prototype.switchOnClick=function(e){e.preventDefault(),e.stopPropagation();let t=e.currentTarget,o=t.parentElement;if(!1===occ.hasClass(t,"disabled")&&!1===occ.hasClass(o,"disabled")&&(occ.removeClass(o.children,"active"),occ.addClass(t,"active"),o.setAttribute("data-switchVal",t.getAttribute("data-switchVal")),occ.triggerEvent(o,"pointerup")),!0===occ.hasClass(o.parentElement,"ocField")&&!1===occ.hasClass(o.parentElement,"disabled")){let l=o.id;l.endsWith("-hp")&&(l=l.substring(0,l.length-3)),occ.getElementFromString(l).value=t.getAttribute("data-switchVal"),occ.checkInputControl(o.id),!0===e.isTrusted&&occ.changeInputControlCB(o)}};let ocAssistArray=[];ocCommon.prototype.initAIAssistText=function(e){if(null==e){let e=document.querySelectorAll("aiAssist-obj");for(let t=0;t<e.length;t++)occ.initAIAssistText(e[t])}else{let t=(e=occ.getElementFromString(e)).id.replace("-ctrl","");if(!1===occ.hasClass(t+"-ctrl","aiAssist-obj")&&!0===occ.hasClass(t+"-ctrl","aiAssist")){let e=0;for(let o=0;o<ocAssistArray.length;o++)t===ocAssistArray[o].elem&&(e=o);ocAssistArray[e].messages=[],occ.setOCFormField(t+"-aiMode",""),occ.setOCFormField(t+"-aiText",""),occ.getElementFromString(t+"-aiResponse").innerHTML="",occ.removeClasses(t+"-aiSection",["modeSelected","resultReady"]),occ.addClasses(t+"-aiSection",["noText","noSearch"]),!1===occ.isNothingOrEmpty(occ.getElementFromString(t).value)&&occ.removeClass(t+"-aiSection","noText")}else if(!0===occ.hasClass(t+"-ctrl","aiAssist-obj")&&!1===occ.hasClass(t+"-ctrl","aiAssist")){let o=[],l="This tool will assist you in generating content based on your query. Select a Mode and enter the appropriate information to query the AI Assist tool for the content you would like use.";if("BlockContent"===(e=this.getElementFromString(t)).parentElement.getAttribute("data-aiMode"))o.push({eFieldOptionId:"7",fieldOption:"Top Things for Visitors To Do",fieldValue:"topX"}),l="This tool will assist you in generating content based on a given topic or location. Select a Mode and enter the appropriate information to query the AI Assist tool for the content you would like use in this section.";o.push({eFieldOptionId:"1",fieldOption:"Location Summary",fieldValue:"location"}),o.push({eFieldOptionId:"8",fieldOption:"Person Summary",fieldValue:"person"}),o.push({eFieldOptionId:"9",fieldOption:"Business Summary",fieldValue:"business"}),o.push({eFieldOptionId:"0",fieldOption:"General Topic",fieldValue:"topic"}),o.push({eFieldOptionId:"2",fieldOption:"Revise text to include",fieldValue:"revise"}),o.push({eFieldOptionId:"3",fieldOption:"Add more detail",fieldValue:"moredetail"}),o.push({eFieldOptionId:"4",fieldOption:"Translate",fieldValue:"translate"}),o.push({eFieldOptionId:"5",fieldOption:"Apply Word Limit",fieldValue:"wordlimit"}),o.push({eFieldOptionId:"6",fieldOption:"Suggest Improvements",fieldValue:"improve"}),o.push({eFieldOptionId:"10",fieldOption:"Generate FAQ",fieldValue:"faq"});let c=occ.createDiv("<h1>AI Assist Tool</h1>",["ocFormSection","Boxed","ocAssistSection","noSearch"],[{name:"id",value:t+"-aiSection"},{name:"data-ctrl",value:t}]),i=function(e){occ.initAIAssistText(t)}
3,a=occ.ocButton(t+"-sBtn","Start Over",i);occ.addClass(a,"assistSBtn"),c.appendChild(a),c.appendChild(occ.createElement("p",null,null,l)),c.appendChild(occ.createDiv("",["ocAssistResponse"],[{name:"id",value:t+"-aiResponse"}]));let n=occ.createDiv("",["ocField-obj","assistMode","autoWidth"],[{name:"id",value:t+"-aiMode"},{name:"data-label",value:"Mode"},{name:"data-fieldOptions",value:JSON.stringify(o)},{name:"data-includeAll",value:"true"}]);occ.addChangeEvent(n,occ.setAssistMode),c.appendChild(n);let r=occ.createDiv("",["ocInputControl-obj","assistText"],[{name:"id",value:t+"-aiText"},{name:"data-label",value:"Request Query"},{name:"data-type",value:"text"},{name:"data-info",value:"*"}]);occ.addEvent(r,occ.keyAssistText,"keyup"),c.appendChild(r);let s=occ.ocButton(t+"-aiBtn","Submit",occ.sendAssistRequest);occ.addClass(s,"assistBtn"),c.appendChild(s),e.parentElement.parentElement.insertBefore(c,e.parentElement),occ.addClass(e.parentElement,"aiAssist"),occ.removeClass(e.parentElement,"aiAssist-obj"),ocAssistArray.push({elem:t,messages:[]}),occ.initInputControls(c),occ.initFields(c),occ.addClass(t+"-aiMode-fo-0","mustNotHaveValue"),occ.addClass(t+"-aiMode-fo-1","mustNotHaveValue"),occ.addClass(t+"-aiMode-fo-2","mustHaveValue"),occ.addClass(t+"-aiMode-fo-3","mustHaveValue"),occ.addClass(t+"-aiMode-fo-4","mustHaveValue"),occ.addClass(t+"-aiMode-fo-5","mustHaveValue"),occ.addClass(t+"-aiMode-fo-6","mustHaveValue"),occ.addClass(t+"-aiMode-fo-7","mustHaveValue"),occ.addClass(t+"-aiMode-fo-8","mustNotHaveValue"),occ.addClass(t+"-aiMode-fo-9","mustNotHaveValue"),occ.addClass(t+"-aiMode-fo-10","mustHaveValue");let d=function(e){let t=e.currentTarget.id.replace("-ctrl",""),o=occ.getElementFromString(t+"-te");o&&(occ.isNothingOrEmpty(o.innerText)?occ.addClass(t+"-aiSection","noText"):occ.removeClass(t+"-aiSection","noText"))};occ.addEvent(e.parentElement,d,"keyup"),occ.addEvent(e.parentElement,d,"assistChange"),occ.isNothingOrEmpty(e.value)?occ.addClass(t+"-aiSection","noText"):occ.removeClass(t+"-aiSection","noText")}!0===occ.hasClass(e,"hiddenObj")?occ.hideObj(t+"-aiSection"):occ.showObj(t+"-aiSection")}},ocCommon.prototype.setAssistMode=function(e){let t=e.currentTarget.id.replace("-ctrl",""),o=occ.getElementFromString(t).value;!0===occ.isNothingOrEmpty(o)?occ.removeClass(t.replace("-aiMode","-aiSection"),"modeSelected"):occ.addClass(t.replace("-aiMode","-aiSection"),"modeSelected");let l="",c="",i=!1;if(occ.aiRules.length>0){for(let e=0;e<occ.aiRules.length;e++)if("aiAssist"===occ.aiRules[e].ruleType)for(let t=0;t<occ.aiRules[e].rules.length;t++)occ.aiRules[e].rules[t].mode===o&&(l=occ.aiRules[e].rules[t].labelText,c=occ.aiRules[e].rules[t].infoText,i=occ.aiRules[e].rules[t].hideText)}else switch(o){case"topX":l="Enter the number of items to suggest",c="";break;case"location":l="Enter your county, city or area name",c="*e.g. St. Louis County, MO, St Charles, MO, or Main Street St Charles, MO";break;case"person":l="Enter the name of a person",c="";break;case"business":l="Enter the name of a Business",c="";break;case"revise":l="Enter a topic to be added to the existing text",c="";break;case"translate":l="Enter the langauge to use to translate this text",c="";break;case"moredetail":l="Enter the topic that you want more detail to be added about",c="";break;case"custom":l="Enter a question about a given topic",c="";break;case"topic":l="Get information about the given topic",c="";break;case"wordlimit":l="Enter the number of words to limit this text to",c="";break;case"improve":case"faq":l="",c="",i=!0;break;default:l="",c=""}let a=occ.getElementFromString(t.replace("-aiMode","-aiText")+"-ctrl").querySelector("label");a&&""!==l&&(a.innerHTML=l);let n=occ.getElementFromString(t.replace("-aiMode","-aiText")+"-ctrl").querySelector("div.fieldInfo > span");n&&(n.innerHTML=c,occ.resizeFormField(n.parentElement.parentElement)),!0===i?occ.hideField(t.replace("-aiMode","-aiText")):occ.showField(t.replace("-aiMode","-aiText"))},ocCommon.prototype.keyAssistText=function(e){13===e.keyCode&&occ.sendAssistRequest(e)},ocCommon.prototype.sendAssistRequest=function(e,t,o,l){let c=!1,i=null;if("string"==typeof e)i=e,c=!0;else if(i=null===e?e:e.currentTarget.id.replace("-ctrl","").replace("-aiBtn","").replace("-aiText",""),null!=i&&!document.querySelector("#"+i+"-aiSection div.option.selected"))return;let a=-1;if(null!=i)for(let e=0;e<ocAssistArray.length;e++)i===ocAssistArray[e].elem&&(a=e);-1===a&&(a=ocAssistArray.length,ocAssistArray.push({messages:[]}));let n=t||occ.getElementFromString(i+"-aiMode").value,r=o||occ.getElementFromString(i+"-aiText").value,s=null;if(occ.aiRules.length>0){for(let e=0;e<occ.aiRules.length;e++)if("aiAssist"===occ.aiRules[e].ruleType||"CallChatGPT"===occ.aiRules[e].ruleType)for(let t=0;t<occ.aiRules[e].rules.length;t++)if("CallChatGPT"===occ.aiRules[e].ruleType&&occ.aiRules[e].rules[t].mode===n&&!1===occ.isNothingOrEmpty(occ.aiRules[e].rules[t].request)){let o=occ.aiRules[e].rules[t].request;o.indexOf("##RQ##")>0&&(o=o.replace("##RQ##",r),r="##none##"),ocAssistArray[a].messages.push({role:"system",content:o}),!1===occ.isNothingOrEmpty(occ.aiRules[e].rules[t].structured_output)&&(s=occ.aiRules[e].rules[t].structured_output)}else occ.aiRules[e].rules[t].mode===n&&"##none##"!==r&&(r=occ.aiRules[e].rules[t].request.replace("##RQ##",r),!1===occ.isNothingOrEmpty(occ.aiRules[e].rules[t].structured_output)&&(s=occ.aiRules[e].rules[t].structured_output));
3"revise"!==n&&"translate"!==n&&"moredetail"!==n&&"wordlimit"!==n&&"improve"!==n&&"faq"!==n||0===ocAssistArray[a].messages.length&&ocAssistArray[a].messages.push({role:"user",content:occ.getElementFromString(i+"-te").innerText})}else"location"===n||"person"===n||"business"===n?r="please create a summary marketing description for "+r:"topX"===n?r="please list the top "+r+" things to do":"revise"!==n&&"translate"!==n&&"moredetail"!==n&&"wordlimit"!==n&&"improve"!==n&&"faq"!==n||(0===ocAssistArray[a].messages.length&&ocAssistArray[a].messages.push({role:"user",content:occ.getElementFromString(i+"-te").innerText}),"revise"===n?r="please revise to include "+r:"translate"===n?r="please translate to "+r:"moredetail"===n?r="please add more detail about "+r:"wordlimit"===n?r="please limit to "+r+" words":"improve"===n?r="please revise with suggested improvements":"faq"===n?r="please revise to include an faq":"topic"===n&&(r="please provide summary information about "+r));let d=new ocAjax({jsonResponse:!0,jsonRequest:!0,showWaiting:!0,onSuccess:function(e){null!==e.error&&null!==e.choices&&e.choices.length>0?null===i||!0===c?l(e):occ.addAssistResponse(i,e.choices[0].message):console.log(e.error),occ.hideWaiting()},onFailure:function(e,t,o){console.log("occ.sendAssistRequest Error: "+e+"("+t+")")}});"##none##"!==r&&ocAssistArray[a].messages.push({role:"user",content:r}),!1===occ.isNothingOrEmpty(s)&&ocAssistArray[a].messages.push({role:"structured_output",content:s}),occ.showWaiting();var u="@(PageId)";"@(PageId)"===u&&(u="0");var p="@(BlockId)";"@(BlockId)"===p&&(p="0");let m={data:ocAssistArray[a].messages,tenantId:"0",pageId:u,sectionId:p};d.put("/api/Public/mwjsAssist?ak=rq",m)},ocCommon.prototype.addAssistResponse=function(e,t){let o=0;for(let t=0;t<ocAssistArray.length;t++)e===ocAssistArray[t].elem&&(o=t,occ.removeClass(e+"-aiSection","noSearch"));ocAssistArray[o].messages.push(t);let l=occ.getElementFromString(e+"-aiSection").querySelector("div.ocAssistResponse"),c=document.querySelector("#"+e+"-aiSection div.option.selected");c=c?c.innerText:"General Question";let i=occ.createDiv("",["ocAssistRow"]);i.appendChild(occ.createDiv("<b>Mode</b>"+c,["assistMode"])),i.appendChild(occ.createDiv("<b>Request</b>"+occ.getElementFromString(e+"-aiText").value,["assistText"])),i.appendChild(occ.createDiv("<b>Response</b>"+t.content.trim().replace(/(?:\r\n|\r|\n)/g,"<br>"),["assistRequest"]));let a=occ.ocButton(ocAssistArray[o].elem+"-aic-"+ocAssistArray[o].messages.length,"Continue",occ.anotherAssistResponse);occ.addClass(a,"snButton"),i.appendChild(a);let n=occ.ocButton(ocAssistArray[o].elem+"-aia-"+ocAssistArray[o].messages.length,"Add Below",occ.acceptAssistResponse);occ.addClass(n,"acButton"),i.appendChild(n),l.appendChild(i),occ.removeClass(e+"-aiSection","modeSelected"),occ.addClass(e+"-aiSection","resultReady"),occ.setOCFormField(e+"-aiMode",""),occ.setOCFormField(e+"-aiText",""),occ.triggerEvent(e+"-aiMode","change")},ocCommon.prototype.acceptAssistResponse=function(e){let t=e.currentTarget.parentElement.parentElement.id.replace("-aiSection","").replace("-aiResponse","");occ.hideObj(e.currentTarget),occ.hideObj(e.currentTarget.id.replace("aia-","aic-")),occ.collapseAssistResponse(t,e.currentTarget.parentElement),occ.addClass(e.currentTarget.parentElement,"accepted");let o=e.currentTarget.parentElement.querySelector("div.assistRequest").innerHTML;o=occ.getElementFromString(t).value+"<p>"+o.replace("<b>Response</b>","")+"</p>",occ.setOCFormField(t,o),occ.setOCFormField(t+"-aiMode",""),occ.removeClass(t+"-aiSection","resultReady"),occ.triggerEvent(t+"-aiMode","change")},ocCommon.prototype.anotherAssistResponse=function(e){let t=e.currentTarget.parentElement.parentElement.id.replace("-aiResponse","");occ.setOCFormField(t+"-aiMode",""),occ.hideObj(e.currentTarget),occ.hideObj(e.currentTarget.id.replace("aic-","aia-")),occ.collapseAssistResponse(t,e.currentTarget.parentElement)},ocCommon.prototype.collapseAssistResponse=function(e,t){e.currentTarget&&(e=(t=e.currentTarget).parentElement.id.replace("-aiResponse","")),occ.removeClass(e+"-aiSection","resultReady"),occ.isNothingOrEmpty(occ.getElementFromString(e+"-te").innerText)?occ.addClass(e+"-aiSection","noText"):occ.removeClass(e+"-aiSection","noText"),occ.hasClass(t,"collapsed")?(occ.removeClass(t,"collapsed"),!1===occ.hasClass(t,"accepted")&&occ.showObj(t.querySelector("button.acButton"))):(!1===occ.hasClass(t,"collapsedOnce")&&(occ.addClickEvent(t,occ.collapseAssistResponse),t.appendChild(occ.createDiv("",["icon","sz3","s-arrow-up","tr","assistArrow"]))),occ.addClass(t,"collapsed"),occ.addClass(t,"collapsedOnce"),occ.hideObj(t.querySelector("button.acButton")),occ.hideObj(t.querySelector("button.snButton")))},ocCommon.prototype.resizeOptsDdl=function(e){let t=e.currentTarget.clientWidth,o=e.currentTarget.parentElement.parentElement.querySelector("input.ocInputControl-hp");if(o&&"file"!==o.getAttribute("type")){let l=occ.hasClass(e.currentTarget,"ocDropDown")?65:115;t<l&&(t=l),o.style.paddingLeft=t+15+"px",o.style.width="calc(100% - "+(t+23)+"px)"}}
3,ocCommon.prototype.initPdfViewer=function(e){try{let t=occ.getElementFromString(e+"-hp-pdf"),o=t.parentElement.parentElement,l=o.getAttribute("data-url"),c=o.getAttribute("data-fn"),i="true"===o.getAttribute("data-pt"),a=o.getAttribute("data-dl");occ.isNothingOrEmpty(a)&&(a="false");let n="true"===a||a.length>5;occ.isNothingOrEmpty(c)&&(c="untitled");let r="true"===o.getAttribute("data-readonly")||"true"===occ.hasClass(o,"disabled");if(t.innerHTML="",occ.isNothingOrEmpty(l))t.innerHTML='<div class="pdfHolder"></div>';else{occ.addClass(o.querySelector("div.fileViewer"),"ocActivePDF"),occ.addClass(document.body,"ocActivePDF");const s=new AdobeDC.View({clientId:AdobePDFEmbed,divId:e+"-hp-pdf"});s.previewFile({content:{location:{url:l}},metaData:{fileName:c}},{embedMode:"FULL_WINDOW",showAnnotationTools:!1,defaultViewMode:"FIT_WIDTH",enableFormFilling:!r,showDownloadPDF:n,showPrintPDF:i}),r||s.registerCallback(AdobeDC.View.Enum.CallbackType.SAVE_API,function(l,c,i){let n=l.fileName+(l.fileName.toLowerCase().endsWith(".pdf")?"":".pdf"),r=[{fileId:1*occ.eid(),fileNo:0,fileOrder:0,fileCaption:""}];const s=new File([c],n,{type:"application/pdf"});let d=[s];occ.removeClass(t.parentElement,"ocActivePDF"),occ.removeClass(document.body,"ocActivePDF"),occ.removeClass(t.parentElement,"pdfReady"),o.querySelector("input.ocInputControl-ip").value=occ.ocPDFDocArray.length,occ.ocPDFDocArray.push({fieldId:e,data:r,files:d}),o.setAttribute("data-url",window.URL.createObjectURL(s)),("true"===a||a.length>5)&&(o.setAttribute("data-fdl","dl"),o.setAttribute("data-fdlm","You can open a copy of your PDF entry, but you will need to submit this form complete your submission. Once open in a new tab/window, use the browser's Save As function to save a copy of your PDF.")),occ.checkInputControl(e)},{autoSaveFrequency:0,enableFocusPolling:!1,showSaveButton:!0}),occ.addClass(t.parentElement,"pdfReady")}}catch(e){console.log(e)}};let ocResetPDf=null;function ocFormResize(e){occ.resizeFormFields()}function occInitPauseForm(e){occ.initInputControls()}ocCommon.prototype.resetPdfViewer=function(e){ocResetPDf=e.currentTarget.parentElement;let t='<p style="line-height: 23px;font-size: 13px;">Are you sure that you want to clear your entries for "'+ocResetPDf.parentElement.getAttribute("data-fn")+'"? This action cannot be undone.</p>';occ.msgDlg("Clear your entry?",t,"mini",[{id:"ocResetPDf-yes",content:"Yes",onClick:function(e){occ.resetPdfViewerCB()}},{id:"ocResetPDf-cancel",content:"No",onClick:function(e){occ.dlgMsg.close()},align:"L"}])},ocCommon.prototype.resetPdfViewerCB=function(e,t){if(occ.dlgMsg.close(),e&&e.currentTarget&&(ocResetPDf=e.currentTarget.parentElement.querySelector("div.fileViewer")),ocResetPDf){let e=ocResetPDf.parentElement.querySelector("input.ocInputControl-ip");occ.removeClass(ocResetPDf,"pdfReady");let o=1*e.value;"number"==typeof o&&(occ.ocPDFDocArray[o].fieldId=null,occ.ocPDFDocArray[o].data=null,occ.ocPDFDocArray[o].files=null);let l=ocResetPDf.parentElement.getAttribute("data-ourl");occ.isNothingOrEmpty(l)&&(l=""),ocResetPDf.parentElement.setAttribute("data-url",l),!0!==t&&occ.checkInputControl({currentTarget:e},!0)}ocResetPDf=null},ocCommon.prototype.openEditGrid=function(e){let t=null;for(let o=0;o<occTables.length;o++)occTables[o].tableId===e&&(t=occTables[o]);null!==t&&occ.createEditGrid(t)},ocCommon.prototype.createEditGrid=function(e){let t=window.location.href.indexOf("griddebug")>-1,o=occ.getElementFromString(e.tableId);if(e.gridElem=o.querySelector("div.ocEditGrid"),e.gridElem||(e.gridElem=occ.createDiv("",["ocEditGrid"],[{name:"id",value:e.tableId+"-eg"}]),o.appendChild(e.gridElem)),e.gridElem){e.gridElem.innerHTML="";let l=e.gridElem.id,c={r:-1,i:-1},i=function(e){if(!0===t&&console.log("exitRowFN:"+(null===e?"null":"event")+":"+JSON.stringify(c)),null!==e&&(e.preventDefault(),e.stopPropagation()),-1===c.r)return!1;if(null!==e&&(!0===t&&console.log("exitRowFN:from row click:currentTarget="+occ.hasClass(e.currentTarget,"egRow")+":srcElement="+occ.hasClass(e.srcElement,"egRow")),occ.hasClass(e.srcElement,"egRow"))){if(1*e.srcElement.getAttribute("data-r")===c.r)return!0===t&&console.log("exitRowFN:samerow:false"),!1}if(!0===c.rowDone||c.done){let e=occ.getElementFromString("egRow-"+l+"-"+c.r).querySelectorAll("div.invalid"),o=e.length>0;if(!1===o&&(e=occ.getElementFromString("egRow-"+l+"-"+c.r).querySelectorAll("div.egCol.required"),e.forEach(e
3=>{if(!1===o){let t=e.querySelector("div.egCtrl");(occ.isNullOrEmpty(e.innerText.trim())&&!t||t&&!1===occ.hasClass(t,"hasValue"))&&(o=!0)}})),!0===t&&console.log("exitRowFN:notReady="+o+":checkElems = "+e.length),!0===o){c.invalid=!1;let e="egCell-"+l+"-"+c.r+"-"+c.i;return c.r=-1,c.i=-1,u({internal:!0,currentTarget:occ.getElementFromString(e)}),!1}}return null!==e&&!occ.hasAnyClasses(e.currentTarget,["ocEditGrid","ocGridHeader","ocGridFooter"])||(c.rowSave=c.r+0,occ.addClass("egRow-"+l+"-"+c.rowSave,"egSaving"),c.waiting=!0,h(),occ.showWaiting(0,null,"Checking/Saving Row Data..."),setTimeout(function(){!0===t&&console.log("exitRowFN;in timer"),!0===c.waiting&&(!0===t&&console.log("exitRowFN;timer fired"),c.waiting=!1,a())},1e3),!1===c.rowFull||!c.rowFull)},a=function(){if(!0===t&&console.log("saveRowFN:"+JSON.stringify(c)),!0===c.invalid&&(occ.hideWaiting(),c.waiting=!1,c.rowSave=-1),null!==c.rowSave&&c.rowSave>-1){if(!0===t&&console.log(e.data[c.rowSave]),"function"==typeof e.gridRowCB&&e.data[c.rowSave]&&e.data[c.rowSave].editValues&&null!==e.data[c.rowSave].editValues){let t=[];for(let o=0;o<e.gridCols.length;o++)"image"===e.gridCols[o].type&&t.push({fi:"egCtrl-"+l+"-"+c.r+"-"+o,prop:e.gridCols[o].property}),"data"!==e.gridCols[o].type&&(e.data[c.rowSave].editValues[e.gridCols[o].propertyroot]?"number"==typeof e.gridCols[o].propertyindex&&e.data[c.rowSave].editValues[e.gridCols[o].propertyroot][e.gridCols[o].propertyindex][e.gridCols[o].property]?e.data[c.rowSave][e.gridCols[o].propertyroot][e.gridCols[o].propertyindex][e.gridCols[o].property]=e.data[c.rowSave].editValues[e.gridCols[o].propertyroot][e.gridCols[o].propertyindex][e.gridCols[o].property]:e.data[c.rowSave].editValues[e.gridCols[o].propertyroot][e.gridCols[o].property]&&(e.data[c.rowSave][e.gridCols[o].propertyroot][e.gridCols[o].property]=e.data[c.rowSave].editValues[e.gridCols[o].propertyroot][e.gridCols[o].property]):e.data[c.rowSave].editValues[e.gridCols[o].property]&&(e.data[c.rowSave][e.gridCols[o].property]=e.data[c.rowSave].editValues[e.gridCols[o].property]));return e.data[c.rowSave].editValues=null,e.gridRowCB(JSON.parse(JSON.stringify(e.data[c.rowSave])),n,t),void(c.saving=!0)}{!0===t&&console.log("saveRowFN:nothing to save");let o=occ.getElementFromString("egRow-"+l+"-"+c.rowSave);if(occ.hasClass(o,"newRow"))o.remove();else{occ.removeClass("egCell-"+l+"-"+c.rowSave+"-"+c.i,"active"),occ.removeClass(o,"egSaving"),occ.removeClass(o,"isActive");let t=e.gridElem.querySelectorAll("#egRow-"+l+"-"+c.rowSave+" div.egCtrl");for(let e=0;e<t.length;e++)occ.removeClass(t[e].parentElement,"active"),t[e].remove()}if(occ.hideWaiting(),c.r=-1,c.i=-1,c.rowSave=-1,c.waiting=!1,c.nr>-1&&c.ni>-1){let e="egCell-"+l+"-"+c.nr+"-"+c.ni;c.nr=-1,c.ni=-1,u({internal:!0,currentTarget:occ.getElementFromString(e)})}if(!0!==c.rowDone&&!c.rowFull)return}}c.rowSave=null,c.nr=-1,c.ni=-1,occ.hideWaiting(),!0===c.rowDone?(c.rowFull&&(e.gridFullCB(c.rowFull),c.rowFull=null),F(-1),c.rowDone=!1):!0===c.done&&f(!1)},n=function(o){if(!0===t&&console.log("saveCBCompletFN:"+(!0===o.error?"error":"ok")+":"+JSON.stringify(c)),occ.removeClass("egRow-"+l+"-"+c.rowSave,"egSaving"),c.saving=!1,!0===o.error)occ.addClass("egCell-"+l+"-"+c.rowSave+"-"+c.i,"active"),occ.addClass("egRow-"+l+"-"+c.rowSave,"isActive"),F(1),occ.msgDlg("ERROR","<h3>"+o.msg+"</h3>","mini"),c.done=!1,occ.hideWaiting(),c.rowSave=-1;else{let t=e.gridElem.querySelectorAll("#egRow-"+l+"-"+c.rowSave+" div.egCtrl");for(let e=0;e<t.length;e++)occ.removeClasses(t[e].parentElement,["dirty","active"]),t[e].remove();if(null!==c.rowSave&&(e.data[c.rowSave].changed=!1),occ.removeClass("egRow-"+l+"-"+c.rowSave,"isActive"),-1===c.i&&(c.r=-1),c.rowDone=!1,c.rowSave=-1,F(-1),c.rowFull)e.gridFullCB(c.rowFull),c.rowFull=null;else if(c.nr>-1&&c.ni>-1){let e=occ.getElementFromString("egCell-"+l+"-"+c.nr+"-"+c.ni);c={r:-1,i:-1},u({currentTarget:e,internal:!0}),c.done=!1}else!0===c.done&&f(!1)}};occ.addEvent(e.gridElem,"pointerup",i);let r=function(e){!0===t&&console.log("focusCellFN:"+JSON.stringify(c)),e.preventDefault(),e.stopPropagation(),!0!==c.invalid&&u(e)},s=function(e){"Tab"!==e.key&&9!==e.keyCode||(!0===t&&console.log("tabKeyFN:tab"),e.preventDefault(),e.stopPropagation(),h())},d=function(e,t){let o=occ.getElementFromString(t+"-sel");!o&&e&&(o=e.querySelector("trix-editor")),o||(o=occ.getElementFromString(t+"-ctrl-dp")),o||(o=occ.getElementFromString(t+"-hp")),o||(o=occ.getElementFromString(t+"-ip")),!o&&e&&(o=e.querySelector("#"+t+"-ctrl > input.ocInputControl-ip")),o||(o=occ.getElementFromString(t)),o&&o.focus()},u=function(o){!0!==o.internal&&(o.preventDefault(),o.stopPropagation()),!0===t&&console.log("enterCellFN:"+JSON.stringify(c));let a=o.currentTarget;if("SPAN"===a.tagName&&(a=a.parentElement),occ.hasClass(a,"active")||!0===c.invalid)return;if(c.r>-1){let e=1*a.getAttribute("data-r");
3if(e!==c.r&&(c.nr=e,c.ni=1*a.getAttribute("data-i"),!0===i(null)))return void(!0===t&&console.log("enterCellFN:return1"));if(h(),!0===c.invalid)return!0===t&&console.log("enterCellFN:previous cell invalid"),void d(null,"egCtrl-"+l+"-"+c.r+"-"+c.i)}c.i=1*a.getAttribute("data-i"),c.r=1*a.getAttribute("data-r");let n=1*a.getAttribute("data-i"),r=1*a.getAttribute("data-r"),u="egCtrl-"+l+"-"+r+"-"+n,m=e.gridCols[n];if(!m||!e.data[r]||occ.hasClass(a,"egInfoCell"))return;0===a.parentElement.getAttribute("data-rid").indexOf("-")?occ.addClass(e.gridElem,"newRow"):occ.removeClass(e.gridElem,"newRow"),!1===Array.isArray(m.clss)&&(m.clss=[]),!1===Array.isArray(m.attrs)&&(m.attrs=[]);let g=m.eventCB;m=JSON.parse(JSON.stringify(e.gridCols[n])),m.eventCB=g,m.clss.push("egCtrl");let f=a.querySelector(":scope > span").getAttribute("tabindex");!1===occ.isNothingOrEmpty(f)&&m.attrs.push({name:"tabindex",value:f});let y="";"string"==typeof m.propertyroot?"number"==typeof m.propertyindex?(y=e.data[r][m.propertyroot][m.propertyindex][m.property],e.data[r].editValues&&e.data[r].editValues[m.propertyroot]&&e.data[r].editValues[m.propertyroot][m.propertyindex]&&!0!==occ.isNothingOrEmpty(e.data[r].editValues[m.propertyroot][m.propertyindex][m.property])&&(y=e.data[r].editValues[m.propertyroot][m.propertyindex][m.property])):(y=e.data[r][m.propertyroot][m.property],e.data[r].editValues&&e.data[r].editValues[m.propertyroot]&&!0!==occ.isNothingOrEmpty(e.data[r].editValues[m.propertyroot][m.property])&&(y=e.data[r].editValues[m.propertyroot][m.property])):(y=e.data[r][m.property],e.data[r].editValues&&void 0!==e.data[r].editValues[m.property]&&(y=e.data[r].editValues[m.property]));let C=occ.hasClass(a,"doPop"),b=function(e){if(!0===t&&console.log("popFN"),e&&(e.preventDefault(),e.stopPropagation()),occ.hasAllClasses(a,["active","popReady"])){occ.addClass(a,"ckSize");let e=50,t=a.querySelector("div.ocPopDiv"),o=a.querySelector("div.ocPopDiv > button"),l=a.querySelector("div.egCtrl");window.innerWidth>750&&(e=t.clientHeight-l.clientHeight,e>200?e/=2:e=100),o.style.top=e-50+"px",l.style.top=e+"px",l.style.bottom=e+"px",l.style.maxHeight=t.clientHeight-2*e+"px",occ.removeClass(a,"ckSize"),d(a,u)}};if(occ.getElementFromString(u));else{if(!0===C&&!occ.getElementFromString(u+"-opoX")){let e=occ.createDiv("",["ocPopDiv"],null,"keyup",s);e.appendChild(occ.ocButton(u+"-opoX","",h,"x")),a.appendChild(e)}y&&null!==y&&"string"!=typeof y&&(y=JSON.stringify(y));let o=function(e){if(!0===t&&console.log("enterCellFN:CB finishFN:"+u),!0===C)occ.addClass(a,"popReady"),b();else{let t=e.currentTarget;setTimeout(function(e){let o=occ.getElementFromString(u+"-ctrl").querySelector("label");occ.isOnScreen(o,v,!0,0,20,10,20),d(t,u)},300)}};if(!0===m.required&&m.clss.push("required"),"ocField"===m.type||"ocTag"===m.type){"ocField"===m.type?m.clss.push("ocField-obj"):"ocTag"===m.type&&m.clss.push("ocTagCtrl-obj"),!1===Array.isArray(m.attrs)&&(m.attrs=[]);for(let t=0;t<m.attrs.length;t++)"data-ItemId"===m.attrs[t].name&&(m.attrs[t].value=e.data[r][m.attrs[t].value]);m.attrs.push({name:"id",value:u}),m.attrs.push({name:"data-label",value:m.label}),m.attrs.push({name:"data-value",value:y}),"number"==typeof m.fieldwidth&&m.fieldwidth>0&&m.attrs.push({name:"style",value:"width:"+m.fieldwidth+"px;"});let l=function(o){!0===t&&console.log("ccFN"),p(o),"function"==typeof m.eventCB&&!1===occ.isNothingOrEmpty(m.event)&&"change"===m.event&&m.eventCB(o,e.data[r]),!0===C&&b(o)},c=occ.createDiv("",m.clss,m.attrs,"change",l);occ.addEvent(c,o,"load"),"function"==typeof m.eventCB&&!1===occ.isNothingOrEmpty(m.event)&&"cellChange"!==m.event&&"change"!==m.event&&occ.addEvent(c,function(t){m.eventCB(t,e.data[r])},m.event),a.appendChild(c),"ocTag"===m.type?occ.initTagControl(a):occ.initFields(a)}else if("richtext"===m.type){m.clss.push("ocInputControl-obj"),m.attrs.push({name:"id",value:u}),m.attrs.push({name:"data-label",value:m.label}),m.attrs.push({name:"data-value",value:y}),m.attrs.push({name:"data-type",value:"richtext"}),"number"==typeof m.fieldwidth&&m.fieldwidth>0&&m.attrs.push({name:"style",value:"max-height:300px;width:"+m.fieldwidth+"px;"});let t=occ.createDiv("",m.clss,m.attrs,"change",p);"function"==typeof m.eventCB&&!1===occ.isNothingOrEmpty(m.event)&&"change"===m.event&&occ.addEvent(t,function(t){console.log(t),m.eventCB(t,e.data[r])},m.event),a.appendChild(t),occ.initInputControls(a),occ.addEvent(t,o,"load")}else{let t=function(t){p(t),"function"==typeof m.eventCB&&!1===occ.isNothingOrEmpty(m.event)&&"change"===m.event&&m.eventCB(t,e.data[r])},l=occ.createInputControl(u,m.label,m.type+"",y,m.clss,m.attrs,t,!1);"number"==typeof m.fieldwidth&&m.fieldwidth>0&&(l.style.width=m.fieldwidth+"px"),a.appendChild(l),o({currentTarget:l})}}occ.addClass(a,"active"),occ.addClass(a.parentElement,"isActive"),F(1),!0===C&&b()},p=function(e){if(!0===t){let t=e.currentTarget;"INPUT"===t.tagName&&(t=t.parentElement),console.log("cellChangeFN:"+t.parentElement.getAttribute("data-r")+":"+t.parentElement.getAttribute("data-i"))}m(e)},m=function(o){!0===t&&console.log("saveCellFN:"+JSON.stringify(c));let i=o.currentTarget;"INPUT"===i.tagName&&(i=i.parentElement);let n=1*i.parentElement.getAttribute("data-r"),r=1*i.parentElement.getAttribute("data-i"),s=l+"-"+n+"-"+r;if(n>-1&&r>-1){let o=occ.getElementFromString("egCtrl-"+s);if(occ.removeClass(o.parentElement.parentElement,"dirty"),c.invalid=!1,!0===occ.hasClass(o.parentElement,"dirty")){if(!1!==occ.hasAnyClasses(o.parentElement,["invali
3d","incomplete","duplicate"]))return occ.hideWaiting(),!0===t&&console.log("saveCellFN:incomplete"),occ.addClass("egCell-"+s,"active"),occ.removeClass("egCell-"+l+"-"+c.r+"-"+c.i,"active"),c.r=n+0,c.i=r+0,void(c.invalid=!0);{occ.addClass(o.parentElement.parentElement,"dirty");let l=e.gridCols[r];e.data[n].editValues||(e.data[n].editValues={});let i=o.value;if(!0===occ.hasAnyClasses(o.parentElement,["ocimage","ocimageplus","ocfile","ocfileplus"])){let e=occ.getElementFromString(o.id+"-hp");e&&(i=e.files)}switch(l.type){case"number":i*=1;break;case"occalendar":i=occ.isDate(i),!1===i&&(i=null)}!1===occ.hasAnyClasses(o.parentElement,["ocimage","ocimageplus","ocfile","ocfileplus"])&&(e.data[n].editValues||(e.data[n].editValues={}),"string"==typeof l.propertyroot?(e.data[n].editValues[l.propertyroot]||("number"==typeof l.propertyindex?e.data[n].editValues[l.propertyroot]=[{}]:e.data[n].editValues[l.propertyroot]={}),"number"==typeof l.propertyindex?e.data[n].editValues[l.propertyroot][l.propertyindex][l.property]=i:e.data[n].editValues[l.propertyroot][l.property]=i):e.data[n].editValues[l.property]=i),e.data[n].changed=!0;let a="";a=!1===occ.isNothingOrEmpty(o.getAttribute("data-display"))?o.getAttribute("data-display"):y(l,i),document.querySelector("#egCell-"+s+" > span").innerHTML=a,document.querySelector("#egCell-"+s+" > span").setAttribute("title","&nbsp;"===a?"":a),"function"==typeof l.eventCB&&"cellChange"===l.event&&(l.propertyroot?"number"==typeof l.propertyindex?e.data[n][l.propertyroot][l.propertyindex][l.property]=i:e.data[n][l.propertyroot][l.property]=i:e.data[n][l.property]=i,l.eventCB(JSON.parse(JSON.stringify(e.data[n])))),!0===t&&console.log("saveCellFN:done"),c.invalid=!1,"number"==typeof c.ni&&c.ni>-1&&(c.i=-1)}}else c.invalid=!1,!0===t&&console.log("saveCellFN:clean")}null!==c.rowSave&&c.rowSave>0&&(c.waiting=!1,a())},h=function(){if(!0===t&&console.log("exitCellFN:"+JSON.stringify(c)),c.r>-1&&c.i>-1){let e=occ.getElementFromString("egCtrl-"+l+"-"+c.r+"-"+c.i+"-ctrl");!0===occ.hasClass(e,"required")&&!1===occ.hasClass(e,"hasValue")||!0===occ.hasAnyClasses(e,["invalid","incomplete","duplicate"])?c.invalid=!0:(c.invalid=!1,occ.removeClass("egCell-"+l+"-"+c.r+"-"+c.i,"active"))}},g=function(o){!0===t&&console.log("gridDoneFN:"+JSON.stringify(c)),o.preventDefault(),o.stopPropagation();let l=e.gridElem.querySelector("div.egCol.active div.dirty"),i=!1;for(let t=0;t<e.data.length;t++)!0===e.data[t].changed&&(i=!0);!0===i||l?occ.msgDlg("Unsaved Row","<h3>There is an unsaved row. Do you want to save this data?</h3>","mini",[{id:"tempEG-yes",content:"Save",onClick:function(e){f(!0),occ.dlgMsg.close()}},{id:"tempEG-No",content:"Ignore",onClick:function(e){f(!1),occ.dlgMsg.close()},align:"L"}]):(h(),c.done=!0,f(!1))},f=function(a){if(!0===t&&console.log("gridDoneCBFN:"+(a.type?"event":a)+":"+JSON.stringify(c)),!1!==a&&(c.done=!0,!0!==i(null)))return void(c.done=!1);if(!1===((!0!==c.done||-1!==c.r)&&!1!==a&&F(0))){if(c.r>-1&&!1===a){e.data[c.r]&&!0===occ.hasClass("egRow-"+l+"-"+c.r,"newRow")&&e.data.splice([c.r],1),occ.removeClasses(e.gridElem,["isActive","newRow"])}occ.removeClass(o,"egEdit"),!0!==a&&(e.gridElem.innerHTML=""),x&&occ.resetElementSearch(x.querySelector(".dlgSearchDiv.occElemSearch.active")),"function"==typeof e.gridDoneCB&&e.gridDoneCB(e.tableId),occ.setUpTable(e.tableId)}},y=function(e,t){if(occ.isNothingOrEmpty(t))t="&nbsp;";else switch(e.type){case"file":case"fileplus":t=!0===Array.isArray(t)&&t.length>0||t[0].name?"[file]":"&nbsp;";break;case"image":case"imageplus":t=!0===Array.isArray(t)&&t.length>0||t[0].name?"[image]":"&nbsp;";break;case"richtext":t=occ.createDiv(t).innerText;break;case"telext":case"tel":t=occ.formatTelephone(t,null,!1);break;case"number":let o=!1;if(Array.isArray(e.clss))for(let t=0;t<e.clss.length;t++)"money"===e.clss[t]&&(o=!0);t=o?occ.formatMoney(t):occ.formatNumber(t);break;case"ocField":case"ocTag":let l=null;if("string"!=typeof t||0!==t.indexOf("{")&&0!==t.indexOf("[")?"string"==typeof t||!0===t||!1===t?"Y"===t||!0===t?t="Yes":"N"!==t&&!1!==t||(t="No"):Array.isArray(t)||"object"==typeof t?l=JSON.parse(JSON.stringify(t)):"boolean"==typeof t?t=!0===t?"Yes":"No":l=t:l=JSON.parse(t),Array.isArray(l)){t="";for(let e=0;e<l.length;e++)!0!==l[e].deleted&&!0!==l[e].Deleted&&"D"!==l[e].tagStatus&&"D"!==l[e].TagStatus&&(""!==t&&(t+=", "),l[e].tagName?(t+=l[e].tagName,!1===occ.isNothingOrEmpty(l[e].itemText)&&(t+=" ("+l[e].itemText+")")):l[e].TagName?(t+=l[e].TagName,!1===occ.isNothingOrEmpty(l[e].ItemText)&&(t+=" ("+l[e].ItemText+")")):l[e].fieldOption&&(t+=l[e].fieldOption,!1===occ.isNothingOrEmpty(l[e].fieldFillIn)&&(t+=" ("+l[e].fieldFillIn+")"),!1===occ.isNothingOrEmpty(l[e].fieldStart)&&(t+=": "+l[e].fieldStart),!1===occ.isNothingOrEmpty(l[e].fieldEnd)&&(t+=" : "+l[e].fieldEnd)))}else null!==l&&"object"==typeof l&&(!1===occ.isNothingOrEmpty(l.tagName)?(t=l.tagName,!1===occ.isNothingOrEmpty(l[j].itemText)&&(t+=" ("+l[j].itemText+")")):!1===occ.isNothingOrEmpty(l.fieldOption)&&(t=l.fieldOption,!1===occ.isNothingOrEmpty(l[j].fieldFillIn)&&(t+=" ("+l[j].fieldFillIn+")"),!1===occ.isNothingOrEmpty(l[j].fieldStart)&&(t+=" : "+l[j].fieldStart+")"),!1===occ.isNothingOrEmpty(l[j].fieldEnd)&&(t+=" : "+l[j].fieldEnd+")")))}return t},C=function(t){t.preventDefault(),t.stopPropagation(),t.currentTarget.querySelector("div.ocGridHeader").style.top=t.currentTarget.scrollTop+"px";let o=e.gridElem.querySelector("div.egRow.isActive");o&&(e.gridElem.querySelector("div.egRowBtns").style.top=o.offsetTop-o.parentElement.scrollTop+2+"px")},v=occ.createDiv("",["ocGridList"],null,"scroll",C);occ.addEvent(v,i,"pointerup");let b=occ.createDiv("",["ocGridHeader"],[{name:"tabindex",value:"1"}],"pointerup",i);for(let t=0;t<e.gridCols.length;t++)if("data"!==e.gridCols[t].type){let o=occ.createDiv("<span>"+e.gridCols[t].title+"</span>",["egCol",!0===e.gridCols[t].required?"required":""],"keyup",s);o.style.width=e.gridCols[t].width+"px","info"===e.gridCols[t].type&&occ.addClass(o,"egInfoCell"),b.appendChild(o)}v.appendChild(b);let E=2,A=0;for(let t=0;t<e.data.length;t++)if(e.data[t].inGrid===e.tableId||occ.isNothingOrEmpty(e.data[t].inGrid)){let o=occ.createDiv("",["egRow"],[{name:"id",value:"egRow-"+l+"-"+t}],"pointerup",i);for(let c=0;c<e.gridCols.length;c++)if("data"===e.gridCols[c].type)o.setAttribute("data-"+e.gridCols[c].title,e.data[t][e.gridCols[c].property]);else{let i="&nbsp;",a=[];if(!0!==e.gridCols[c].property.indexOf(".")>0||e.gridCols[c].propertyroot||(a=e.gridCols[c].property.split("."),e.gridCols[c].propertyroot=a[0],3===a.length&&(e.gridCols[c].propertyindex=1*a[1]),e.gridCols[c].property=a[a.length-1]),e.gridCols[c].propertyroot){e.data[t][e.gridCols[c].propertyroot]||("number"==typeof e.gridCols[c].propertyindex?e.data[t][e.gridCols[c].propertyroot]=[{}]:e.data[t][e.gridCols[c].propertyroot]={});let o=e.data[t][e.gridCols[c].propertyroot];"number"==typeof e.gridCols[c].propertyindex?o&&o[e.gridCols[c].propertyindex]&&(i=o[e.gridCols[c].propertyindex][e.gridCols[c].property]):o&&(i=o[e.gridCols[c].property])}else!1===occ.isNothingOrEmpty(e.data[t][e.gridCols[c].dispproperty])?i=e.data[t][e.gridCols[c].dispproperty]:!1===occ.isNothingOrEmpty(e.data[t][e.gridCols[c].property])&&(i=e.data[t][e.gridCols[c].property]);i=y(e.gridCols[c],i);let n=occ.createDiv("",["egCol",!0===e.gridCols[c].required?"required":"",!0===e.gridCols[c].popup?"doPop":""],[{name:"id",value:"egCell-"+l+"-"+t+"-"+c},{name:"data-r",value:t},{name:"data-i",value:c}]);n.style.width=e.gridCols[c].width+"px";let s=[];!1===occ.isNothingOrEmpty(e.gridCols[c].align)&&s.push(e.gridCols[c].align);let d=occ.createElement("span",s,[{name:"tabindex",value:E},{name:"title",value:"&nbsp;"===i?"":i}],i,"pointerup",u);occ.addEvent(d,function(e){e.preventDefault(),e.stopPropagation()},"pointerdown"),E++,occ.addEvent(d,r,"focus"),n.appendChild(d),"info"===e.gridCols[c].type&&occ.addClass(n,"egInfoCell"),o.appendChild(n)}v.appendChild(o),A++}let O=function(){let t=e.data.length,o=-1,c=occ.eid(),a=JSON.parse(JSON.stringify(e.newRow).replace("occ.eid()",c));a.gridTempId=1*c;let n=occ.createDiv("",["egRow","newRow"],[{name:"id",value:"egRow-"+l+"-"+t}],"pointerup",i);for(let c=0;c<e.gridCols.length;c++)if("data"===e.gridCols[c].type)n.setAttribute("data-"+e.gridCols[c].title,a[e.gridCols[c].property]);else{-1===o&&(o=c);let i=occ.createDiv("",["egCol",!0===e.gridCols[c].required?"required":"",!0===e.gridCols[c].popup?"doPop":""],[{name:"id",value:"egCell-"+l+"-"+t+"-"+c},{name:"data-r",value:t},{name:"data-i",value:c}]);i.style.width=e.gridCols[c].width+"px";let s=[];!1===occ.isNothingOrEmpty(e.gridCols[c].align)&&s.push(e.gridCols[c].align);let d="&nbsp;";if(e.gridCols[c].propertyroot){a[e.gridCols[c].propertyroot]||("number"==typeof e.gridCols[c].propertyindex?a[e.gridCols[c].propertyroot]=[{}]:a[e.gridCols[c].propertyroot]={});let t=a[e.gridCols[c].propertyroot];"number"==typeof e.gridCols[c].propertyindex?t&&t[e.gridCols[c].propertyindex]&&(d=t[e.gridCols[c].propertyindex][e.gridCols[c].property]):t&&(d=t[e.gridCols[c].property])}else!1===occ.isNothingOrEmpty(a[e.gridCols[c].dispproperty])?d=a[e.gridCols[c].dispproperty]:!1===occ.isNothingOrEmpty(a[e.gridCols[c].property])&&(d=a[e.gridCols[c].property]);d=y(e.gridCols[c],d);let p=occ.createElement("span",s,[{name:"tabindex",value:E},{name:"title",value:"&nbsp;"===d?"":d}],d,"pointerup",u);E++,occ.addEvent(p,r,"focus"),i.appendChild(p),n.appendChild(i)}v.appendChild(n),e.data.push(a),e.gridElem.querySelector("div.ocGridFooter").setAttribute("tabindex",E),u({internal:!0,currentTarget:occ.getElementFromString("egCell-"+l+"-"+t+"-"+
3o)})},S=function(o){!0===t&&console.log("rowFullFN:"+JSON.stringify(c)),c.rowDone=!0,c.rowFull=e.gridElem.querySelector("#egRow-"+l+"-"+c.r),!1!==o&&!0!==i(null)||(e.gridFullCB(c.rowFull),c.rowFull=!1,c.rowDone=!1,F(0))},I=function(t){let o=e.gridElem.querySelector("div.egRow.newRow.isActive");if(o){let t=1*o.getAttribute("data-rid");!0===e.data[e.data.length-1].newRow&&e.data[e.data.length-1].gridTempId===t&&e.data.splice(e.data.length-1,1),o.remove(),c={r:-1,i:-1}}occ.removeClasses(e.gridElem,["isActive","newRow"])},D=function(e){!0===t&&console.log("rowEscFN:"+JSON.stringify(c)),c.rowDone=!0,F(0)},F=function(o){if(!0===t&&console.log("editToggleFN:"+(o.type?"event":o)+":"+JSON.stringify(c)),1===o){occ.addClass(e.gridElem,"isActive");let t=e.gridElem.querySelector("div.egRow.isActive");t&&(e.gridElem.querySelector("div.egRowBtns").style.top=t.offsetTop-t.parentElement.scrollTop+2+"px")}else if(0===o||-1===o){if(0===o&&!0!==i(null))return c.rowDone=!1,!0;occ.removeClasses(e.gridElem,["isActive","newRow"])}return!1};e.gridElem.appendChild(v);let w=occ.createDiv("",["ocGridFooter"],[{name:"tabindex",value:E+""}],"pointerup",i);void 0!==e.newRow&&w.appendChild(occ.ocButton("egNew-"+l,"Record",O,"plus",null,["egNewBtn"])),w.appendChild(occ.ocButton("egDone-"+l,"Done",g,null,null,["egDoneBtn"])),e.gridElem.appendChild(w);let T=occ.createDiv("",["egRowBtns"]);"function"==typeof e.gridFullCB&&T.appendChild(occ.ocButton("egRowFull-"+l,"Edit",S,null,null,["egRowBtn","edit"])),"function"==typeof e.gridFullCB&&T.appendChild(occ.ocButton("egRowAdd-"+l,"Cancel",I,null,null,["egRowBtn","add"])),T.appendChild(occ.ocButton("egRowEsc-"+l,"Done",D,null,null,["egRowBtn"])),e.gridElem.appendChild(T),occ.addClass(o,"egEdit");let x=occ.getNearest(o,"ocDialog-dialog",!0,"dialog");x&&occ.resetElementSearch(x.querySelector(".dlgSearchDiv.occElemSearch.active"))}},ocCommon.prototype.initFormTabs=function(e){let t=occ.getElementFromString(e.obj);if(t&&!1===occ.hasClass(t,"tabsSet")){"function"==typeof e.tabChangeCB&&occ.addClickEvent(t,e.tabChangeCB,"occ::tabChange");for(let o=0;o<e.tabs.length;o++){!1===Array.isArray(e.tabs[o].css)&&(e.tabs[o].css=[]),e.tabs[o].css.push("ocFormTab"),!0===e.tabs[o].disabled&&e.tabs[o].css.push("disabled"),!0===e.tabs[o].hidden&&e.tabs[o].css.push("hiddenObj");let l=occ.createDiv("",e.tabs[o].css),c=occ.createElement("h3",null,null,e.tabs[o].label,"pointerup",occ.formTabClick),i=occ.createDiv("",["content"]);l.appendChild(c),l.appendChild(i),0===o&&occ.addClass(l,"active"),t.appendChild(l),e.tabs[o].element=i}occ.addClasses(t,["hasTabs","tabsSet"])}return e},ocCommon.prototype.formTabReset=function(e){let t=occ.getElementFromString(e);if(t){let e=t.querySelector("div.ocFormTab h3");e&&occ.triggerEvent(e,"pointerup")}},ocCommon.prototype.formTabClick=function(e){let t=e.currentTarget.parentElement;if(!0===occ.hasClass(t,"disabled"))return;let o=t.parentElement.parentElement.querySelector("div.ocFormTab.active"),l=occ.checkOCFormContainer(o,null,!0);if(!1===l.complete)return;if(!0===e.isTrusted&&document.body.clientWidth<701){let e=t.parentElement;if(!occ.hasClass(e,"open")){return occ.addClass(e,"open"),void e.querySelectorAll(".ocFormTab:not(.active)").forEach(function(e,t){e.style.top=15+52*(1+t)+"px"})}if(occ.removeClass(e,"open"),e.querySelectorAll(".ocFormTab").forEach(function(e,t){e.style.top=""}),occ.hasClass(t,"active"))return}l.destinationTab=t,l.sourceTab=o,occ.triggerEvent(t.parentElement,"occ::tabChange",l);let c=t.parentElement.parentElement.querySelectorAll("div.ocFormTab");occ.removeClass(c,"active"),occ.addClass(t,"active"),occ.resizeFormFields(t),occ.checkMyTables(t)},ocCommon.prototype.getPersonValidator=function(e,t,o){if(null===!(e=occ.getElementFromString(e)))return;let l="",c=occ.createDiv("",["iaapCt"]),i=function(t){new ocAjax({jsonResponse:!1,showWaiting:!0,onSuccess:function(t){l=t,c.querySelector("img.iaapImg").setAttribute("src","/api/blob/viewTextBlob?x="+encodeURIComponent(l)),occ.getElementFromString(e.id+"personValidator").value="",occ.getElementFromString(e.id+"personValidator").focus()},onFailure:function(e,t,o){occ.hideWaiting(document.body),console.log("getPersonValidator Error1: "+e+"("+t+")")}}).get("/api/public/iaap?ak=1")};c.appendChild(occ.createElement("img",["iaapImg"],[{name:"src",value:""},{name:"fetchpriority",value:"high"},{name:"loading",value:"eager"}])),c.appendChild(occ.createDiv("",["ocInputControl-obj","iaapFld","required"],[{name:"id",value:e.id+"personValidator"},{name:"data-placeholder",value:"Enter the text from above"},{name:"data-type",value:"text"},{name:"data-required",value:"true"}])),c.appendChild(occ.ocButton(e.id+"personValidatorBtn1","Validate",function(a){let n=occ.getElementFromString(e.id+"personValidator").value;if(n.length>
36){new ocAjax({jsonResponse:!0,showWaiting:!0,onSuccess:function(e){!0===e.valid?(occ.addClass(c,"valid"),occ.removeClass(c,"invalid")):(occ.addClass(c,"invalid"),i()),t(e)},onFailure:function(e,o,l){t({valid:!1}),occ.addClass(c,"invalid"),i(),occ.hideWaiting(document.body),console.log("getPersonValidator Error2: "+e+"("+o+")")}}).get("/api/public/ciaap?ak=2&x="+encodeURIComponent(l)+"&c="+encodeURIComponent(n)+(o?"&"+o:""))}},null,null,["iaapBtn"])),c.appendChild(occ.ocButton(e.id+"personValidatorBtn2","New Text",i,null,null,["iaapBtn"])),e.appendChild(c),occ.initInputControls(e),i()},ocCommon.prototype.createFilterControls=function(e,t,o,l,c,i){let a=!0===i?1:i&&!1!==i?i:0,n=function(i){let n=occ.checkOCFormContainer(occ.dlgMsg.dialog);if(!1===n.clean&&!0===n.complete){l=occ.isDate(document.getElementById("ocFilterSDate"+e).value),c=occ.isDate(document.getElementById("ocFilterEDate"+e).value);let i="";i=a>0?occ.formatDate(l,"m/d")+" "+occ.formatDate(l,"h:mm am")+" - "+occ.formatDate(c,"m/d")+" "+occ.formatDate(c,"h:mm am"):l.getFullYear()===c.getFullYear()?occ.formatDate(l,"m/d")+" - "+occ.formatDate(c,"m/d/yy"):occ.formatDate(l,"m/d/yy")+" - "+occ.formatDate(c,"m/d/yy"),t.querySelector("div.ocFilter h3").textContent=i,occ.dlgMsg.close(),o(l,c)}else!0===n.clean&&occ.dlgMsg.close()},r=function(t){let o='<div id="ocFilterSDate'+e+'" class="ocInputControl-obj required" data-label="Start Date" data-type="occalendar" data-showToday="true" data-time="'+(a>0?"true":"false")+'"'+(2===a?' data-minTime="0"':"")+(2===a?' data-maxTime="2359"':"")+"></div>";o+='<div id="ocFilterEDate'+e+'" class="ocInputControl-obj required" data-label="End Date" data-type="occalendar" data-showToday="true" data-time="'+(a>0?"true":"false")+'"'+(2===a?' data-minTime="0"':"")+(2===a?' data-maxTime="2359"':"")+"></div>",occ.msgDlg("Set the Date Filter",o,"small",[{id:"ocFilter-run"+e,content:"Apply",onClick:n},{id:"ocFilter-close"+e,content:"Cancel",onClick:function(e){closeDialogByEvent(e)},align:"L"}]),occ.dlgMsg.dialog.querySelector(".ocDialog-content").style.height="330px",occ.initInputControls(occ.dlgMsg.dialog),occ.setOCFormField("ocFilterSDate"+e,l),occ.setOCFormField("ocFilterEDate"+e,c)};if(t&&!t.querySelector(".ocFilter")){let o="";o=a>0?occ.formatDate(l,"m/d")+" "+occ.formatDate(l,"h:mm am")+" - "+occ.formatDate(c,"m/d")+" "+occ.formatDate(c,"h:mm am"):l.getFullYear()===c.getFullYear()?occ.formatDate(l,"m/d")+" - "+occ.formatDate(c,"m/d/yy"):occ.formatDate(l,"m/d/yy")+" - "+occ.formatDate(c,"m/d/yy");let i=occ.createDiv("<h3>"+o+"</h3>",["ocFilter"]);
3i.appendChild(occ.ocButton("ocFilterBTN"+e,"Filter",r,"funnel sz2")),t.appendChild(i)}},ocCommon.prototype.createFields=function(e,t){for(let c=0;c<e.length;c++){let i=!1;if(e[c].parentFieldId&&!1===occ.isNullOrEmpty(e[c].parentFieldId)){if(occ.removeClass(e[c].parentFieldId,"loading"),!occ.getElementFromString(e[c].parentFieldId))return;occ.getElementFromString(e[c].parentFieldId).appendChild(occ.createDiv("",["ocField-obj"],[{name:"id",value:e[c].fi},{name:"data-store",value:"true"},{name:"data-multiple",value:"true"}])),occ.addClass(e[c].parentFieldId,"ocFieldParent"),i=!0}let a=occ.getElementFromString(e[c].fi),n=!0;if(!a||null===a)return;if(!1===occ.isNullOrEmpty(a.getAttribute("data-loadvalue"))&&(e[c].cv=a.getAttribute("data-loadvalue"),a.removeAttribute("data-loadvalue"),!0===occ.hasClass(a,"setDirtyTemp")&&(occ.removeClass(a,"setDirtyTemp"),t=!0)),occ.hasClass(a,"ocField")?n=!1:a.id=e[c].fi+"-ctrl",e[c].eFieldId&&!1===occ.isNullOrEmpty(e[c].eFieldId)&&a.setAttribute("data-eid",e[c].eFieldId),!0===e[c].readOnly&&occ.addClass(a,"readOnly"),!0===e[c].allowEdit?occ.addClasses(a,["allowEdit","noitems","readOnly"]):occ.hasClass(a,"ignoreEmpty")?occ.addClass(a,"n
3oitems"):occ.addClass(a,"emptyField"),occ.removeClass(a,"loading"),e[c].ac&&!0!==occ.isNullOrEmpty(e[c].ac)||(e[c].ac="off"),!0===n){!0===i&&occ.addClickEvent(a,occ.showOCStoreDetail),"function"!=typeof e[c].onChange&&(e[c].onChange=occ.changeInputControlCB);let n=occ.createDiv("",["fieldImage"]);if(e[c].fieldImageUrl&&!1===occ.isNullOrEmpty(e[c].fieldImageUrl)?n.style.backgroundImage='url("'+e[c].fieldImageUrl+'&s=large")':occ.addClass(a,"noImage"),e[c].fieldOptions&&1===e[c].fieldOptions.length&&i){let t=occ.createDiv("+ quick add",["fieldQA"]);t.setAttribute("id",e[c].fi+"-qa"),occ.addClickEvent(t,occ.updateOcCart),n.appendChild(t)}let r=!1;if(e[c].fieldOptions&&Array.isArray(e[c].fieldOptions))for(let t=0;t<e[c].fieldOptions.length;t++)!occ.hasClass(a.parentElement,"ocTagCtrl")&&"TagCategory"!==a.getAttribute("data-tableName")||!1!==occ.hasClass(a,"allowFillIn")||!1!==occ.hasClass(a.parentElement,"allowFillIn")||(e[c].fieldOptions[t].afi="N"),"Y"===e[c].fieldOptions[t].afi&&(r=!0);!0===r&&(!0===e[c].mtp&&(e[c].cbx=!0),e[c].atp=!1),a.appendChild(n);var o=occ.createElement("label",null,[{name:"for",value:e[c].fi+"-ip"}],e[c].fieldLabel);!0===e[c].atp?o.innerHTML+="<span>enter/select a value</span>":(o.setAttribute("for",e[c].fi),o.innerHTML+="<span>select a value</span>",!0===occ.hasClass(a,"money")&&(o.innerHTML+='<span class="money">check amount</span>')),e[c].fieldLabel&&!0!==occ.isNullOrEmpty(e[c].fieldLabel)?occ.addClass(a,"hasLabel"):occ.hideObj(o),a.appendChild(o),e[c].fieldDescription&&!1===occ.isNullOrEmpty(e[c].fieldDescription)&&a.appendChild(occ.createDiv(e[c].fieldDescription,["fieldDescription"]));let s=null,d=null;if(!0===e[c].cbx||!0===e[c].radio||!0===e[c].segment)s=occ.createElement("input",["ocField","ocFormField"],[{name:"type",value:"hidden"},{name:"id",value:e[c].fi},{name:"data-cv",value:""}]),d=occ.createDiv("",null,[{name:"id",value:e[c].fi+"-hp"}]),!0===e[c].ia&&!0===occ.isNullOrEmpty(e[c].cv)&&(e[c].cv="all"),!0===e[c].segment?occ.addClass(d,"switchObj"):!0!==e[c].cbx&&!0!==e[c].radio||(!1===occ.isNullOrEmpty(a.getAttribute("data-optns"))&&d.setAttribute("data-optns",a.getAttribute("data-optns")),occ.addClass(d,"controlList"),!0===e[c].store&&occ.addClass(a,"ocstore"),!0===e[c].radio?occ.addClass(a,"ocradio"):occ.addClass(a,"occheckbox"));else if("Y"===e[c].hc){occ.addClass(a,"pcDisplay"),s=occ.createDiv("",["ocMfList"],[{name:"id",value:e[c].fi+"-ip"}]);let t=occ.ocButton(e[c].fi+"-ipbtn","View List",function(e){occ.addClass(e.currentTarget.parentElement,"active")},"list");occ.addClass(t,"ipBtn");let o=occ.ocButton(e[c].fi+"-idbtn","Close List",function(e){occ.removeClass(e.currentTarget.parentElement,"active")},"list");occ.addClass(o,"idBtn");let l=occ.createDiv("",["ocFList"]);s.appendChild(t),s.appendChild(o),s.appendChild(l),d=occ.createElement("input",["pcDisplay","ocField","ocFormField"],[{name:"type",value:"hidden"},{name:"id",value:e[c].fi},{name:"data-cv",value:""}]),!0===occ.hasClass(a,"required")&&occ.addClass(d,"required")}else if(!0===e[c].atp){s=occ.createElement("input",["hasList","ocInputControl-ip"],[{name:"type",value:"text"},{name:"list",value:e[c].fi+"-dl"},{name:"id",value:e[c].fi+"-ip"}]);let t=function(e){let t=e.currentTarget.id.substring(0,e.currentTarget.id.length-3);occ.getElementFromString(t).setAttribute("data-display",e.currentTarget.value)};s.addEventListener("change",t),e[c].placeholder&&!1===occ.isNullOrEmpty(e[c].placeholder)&&s.setAttribute("placeholder",e[c].placeholder),s.addEventListener("keydown",occ.keyInputControlCB),s.addEventListener("keyup",occ.keyInputControlCB)}else{s=occ.createDiv("",["select"],[{name:"id",value:e[c].fi+"-sel"},{name:"tabindex",value:"0"}]),occ.addEvent(s,occ.downOcFieldSelect,"keydown");let t=this.createDiv("",["icon","s-arrow-down","tr"]);occ.addClass(t,occ.hasClass(a,"mini")?"sz1":"sz3"),occ.addClickEvent(t,occ.clickOcFieldSelect),s.appendChild(t),d=occ.createElement("input",["divSelect","ocField","ocFormField"],[{name:"type",value:"hidden"},{name:"id",value:e[c].fi},{name:"data-cv",value:""}]),!0===occ.hasClass(a,"required")&&occ.addClass(d,"required"),!0===e[c].ia&&!0===occ.isNullOrEmpty(e[c].cv)&&!0===occ.hasClass(a,"hideBlank")&&(e[c].cv="all")}if(!1===occ.isNothingOrEmpty(a.getAttribute("tabindex"))&&(s.setAttribute("tabindex",a.getAttribute("tabindex")),a.removeAttribute("tabindex","")),s.setAttribute("autocomplete",e[c].ac),!0!==e[c].segment&&"Y"!==e[c].hc&&(!1===occ.hasClass(s,"select")&&s.addEventListener("change",function(e){occ.addFieldValue(e)}),e[c].onChange&&"function"==typeof e[c].onChange&&s.addEventListener("change",e[c].onChange)),!0===e[c].mtp&&(occ.addClass(a,"allowMultiple"),!0===e[c].retain&&occ.addClass(a,"retainDelete")),a.appendChild(s),"Y"===e[c].hc&&a.appendChild(occ.createDiv("",["ocField-cvs"],[{name:"id",value:e[c].fi+"-cvs"}])),!0===e[c].allowEdit){a.appendChild(occ.createDiv("",["ocField-fieldset"]));let t=occ.ocButton(e[c].fi+"-sel-btn",null,occ.editFieldOption,"plus tr");occ.addClass(t,"selBtn"),a.appendChild(t);let o=occ.createDiv("",["ocField-obj","col-2","ctrl-other"],[{name:"id",value:a.id+"-other"},{name:"data-label",value:'Allow "Other" '+(!0===occ.hasClass(a,"money")?"Amount ":"")+"Entry"},{name:"data-segment",value:"true"},{name:"data-fieldOptions",value:"Yes"}]);occ.addChangeEvent(o,occ.editFieldOptionCB),a.appendChild(o),setTimeout(function(e){occ.initFields(a)},500)}if(null!==d&&(a.appendChild(d),!0===e[c].segment&&(occ.switchSet(e[c].fi+"-hp",e[c].cv,e[c].fieldOptions,null,!0),occ.addClass(a,"ocswitch"))),!0===e[c].atp){let t=
3occ.createElement("input",["ocField","ocFormField"],[{name:"type",value:"hidden"},{name:"id",value:e[c].fi},{name:"data-cv",value:""}]);!0===occ.hasClass(a,"required")&&occ.addClass(t,"required"),t.addEventListener("change",occ.checkInputControl),a.appendChild(t);var l=occ.createElement("datalist",null,[{name:"id",value:e[c].fi+"-dl"}]);a.appendChild(l),!0===e[c].mtp&&a.appendChild(occ.createDiv("",["ocField-cvs"],[{name:"id",value:e[c].fi+"-cvs"}]))}if(!1===occ.isNothingOrEmpty(e[c].info)){let t=occ.setInputControlInfo(null,e[c].info,!0);!0===occ.hasClass(d,"controlList")?d.appendChild(t):a.appendChild(t)}occ.addClasses(a,e[c].classes),occ.addAttributes(a,e[c].attributes),null!==a.getAttribute("data-child")&&""!==a.getAttribute("data-child")&&occ.addClass(a,"ocField-hasChild"),occ.addClasses(a,["ocField","ocFormField"]);let u="";if(!1===occ.isNothingOrEmpty(a.getAttribute("data-val"))?u=a.getAttribute("data-val"):!1===occ.isNothingOrEmpty(a.getAttribute("data-value"))&&(u=a.getAttribute("data-value")),!1===occ.isNothingOrEmpty(u)&&(u.indexOf("{")>0?e[c].cv=JSON.parse(u):e[c].cv=u),"string"==typeof e[c].cv&&e[c].cv.indexOf("{")>0&&(e[c].cv=JSON.parse(e[c].cv)),e[c].cv&&Array.isArray(e[c].cv)){for(let t=0;t<e[c].cv.length;t++)if(e[c].cv[t].TagId||e[c].cv[t].eTagId){e[c].cv[t].deleted=!0,e[c].cv[t].remove=!0;for(let o=0;o<e[c].fieldOptions.length;o++)e[c].cv[t].eTagId===e[c].fieldOptions[o].fieldValue&&(e[c].cv[t]=JSON.parse(JSON.stringify(e[c].fieldOptions[o])))}for(let t=0;t<e[c].cv.length;t++)!0===e[c].cv[t].remove&&e[c].cv.splice(t,1)}let p=!1;for(let t=0;t<this.ocFields.length;t++)!1===p&&this.ocFields[t].fi===e[c].fi&&(p=!0,this.ocFields[t]=e[c]);!1===p&&this.ocFields.push(e[c]),occ.updateField(e[c].fi,e[c].fieldOptions,e[c].cv,null,t,!1);let m=document.querySelectorAll(".ocField-hasChild");for(let t=0;t<m.length;t++)if(e[c].fi===m[t].getAttribute("data-child")){occ.disableControl(e[c].fi,!0);let o=occ.createDiv("Please select a value for ",["ocFieldParentMSG"]);m[t].getAttribute("data-label")?o.innerHTML+=" "+m[t].getAttribute("data-label"):o.innerHTML+=" "+m[t].querySelector("LABEL").innerHTML,a.querySelector("LABEL").appendChild(o)}let h=a.querySelector("div.fieldInfo"),g=a.querySelector("a.moreDiv");if(occ.addClickEvent(g,occ.fieldInfoClick),occ.addClickEvent(h,occ.fieldInfoClick),occ.triggerEvent(e[c].fi+"-ctrl","load"),occ.hasClass(e[c].fi+"-ctrl","PageList")&&occ.hasClass(e[c].fi+"-ctrl","emptyField")){let t=a.parentElement.querySelector('div.option[data-fieldvalue="/"]');t&&(occ.hasClass(t,"selected")&&(occ.removeClass(t,"selected"),occ.addClass(t.parentElement.querySelector("div.option"),"selected"),occ.checkInputControl(e[c].fi.replace("-parentList",""))),occ.hideObj(t))}}else{occ.loadOCFormCheck(e[c].fi,!0);let t=!1;for(let o=0;o<this.ocFields.length;o++)!1===t&&this.ocFields[o].fi===e[c].fi&&(t=!0,this.ocFields[o]=e[c]);!1===t&&this.ocFields.push(e[c])}}},ocCommon.prototype.updateField=function(e,t,o,l,c,a){(void 0===o||"[]"===o||Array.isArray(o)&&0===o.length)&&(o=null);let n=occ.getElementFromString(e+"-ctrl"),r=occ.getElementFromString(e);if(!r||!n)return;let s=null;for(let o=0;o<occ.ocFields.length;o++)this.ocFields[o].fi===e&&(Array.isArray(t)&&t.length>0&&(occ.ocFields[o].fieldOptions=t),s=occ.ocFields[o]);let d=occ.hasClass(n,"allowMultiple"),u=occ.hasClass(n,"required"),p="true"===n.getAttribute("data-allowEdit"),m=occ.hasClass(n,"money"),h=occ.hasClass(n.parentElement,"ocFieldParent"),g=occ.hasClass(n,"ocIcon"),f="";if(occ.removeClass(n.querySelectorAll("div.isChecked"),"isChecked"),!0===p&&(!0===occ.isNothingOrEmpty(t)&&!1===occ.isNothingOrEmpty(o)&&(t=o),!1===occ.isNullOrEmpty(t)&&"string"==typeof t&&0===t.indexOf("[")&&(t=JSON.parse(t)),Array.isArray(t)))for(let e=0;e<t;e++)if(occ.isNothingOrEmpty(t[e].eFieldOptionId)){let o=null;o="Other"===t[e].fieldValue&&"Other"===t[e].fieldOption&&"Y"===t[e].afi?"O":occ.eid(),t[e].eFieldOptionId=o}if(Array.isArray(t))if(t.length>0){if(!0===p?occ.removeClasses(n,["emptyField","noitems","readOnly"]):occ.removeClasses(n,["emptyField","noitems"]),occ.hasClass(n,"pcDisplay")){let o=n.querySelector("div.ocFList"),l=t,c=function(o,i,a){let n=!1;if(i)for(let r=0;r<l.length;r++)if(l[r].fpi===o){n=!0;let o=occ.createDiv("",["ocmfRow"],null);occ.addClickEvent(o,function(e){occ.toggleClass(e.currentTarget,"active")});let s=occ.createDiv(l[r].fieldOption,["name"],null),u=occ.createElement("input",["pcCBX"],[{name:"id",value:e+"-cbx-"+r},{name:"type",value:!0===d?"checkbox":"radio"},{name:"value",value:l[r].fieldValue},{name:"data-value",value:l[r].fieldValue},{name:"data-option",value:l[r].fieldOption},{name:"data-foid",value:l[r].fieldOptionId},{name:"data-pt",value:l[r].fpt}]);!1===d&&u.setAttribute("name",e+"-cbx-"),!1===occ.isNothingOrEmpty(l[r].fpt)&&u.setAttribute("data-title",l[r].fpt+" > "+l[r].fieldOption),occ.addChangeEvent(u,function(e){e.stopPropagation(),e.preventDefault()}),occ.addClickEvent(u,occ.addFieldPCValue),s.appendChild(u),s.appendChild(occ.createDiv("",["icon","s-arrow-down","tr","sz2-5"])),o.appendChild(s),"N"===t[r].cu&&"Y"!==a&&occ.addClasses(o,["hiddenObj","noAccess"]),i.appendChild(o),occ.addClass(i,"hasChild"),c(l[r].fieldValue,o,"Y"===a||"Y"===l[r].cu?"Y":null)}!1===n&&occ.addClass(i,"nochild")};occ.removeClasses(n,["emptyField","noitems"]),c("",o)}else{let l=0;for(let e=0;e<t.length;e++)occ.isNothingOrEmpty(t[e].eFieldOptionId)&&(l++,t[e].eFieldOptionId="fkeId-"+l);let i=occ.getElementFromString(e+"-dl");if(i){i.innerHTML="";let e="^";for(let o=0;o<t.length;
3o++)if(e.indexOf("^"+t[o].fieldOption+"^")<0){e+=t[o].fieldOption+"^";var y=occ.createElement("option",["ocFieldOption"],[{name:"value",value:t[o].fieldOption},{name:"data-foid",value:t[o].fieldOptionId},{name:"data-value",value:t[o].fieldValue},{name:"data-option",value:t[o].fieldOption}]);if(t[o].eFieldOptionId&&null!==t[o].eFieldOptionId&&y.setAttribute("data-efoid",t[o].eFieldOptionId),t[o].fieldGroup&&null!==t[o].fieldGroup&&y.setAttribute("data-fieldGroup",t[o].fieldGroup),!1===d&&"Y"===t[o].afi&&occ.addClass(y,"hasFillIn"),!0===g){let e=occ.createDiv("",["icon","sz3","tr","s-"+t[o].fieldValue]);y.appendChild(e)}"N"===t[o].cu&&(occ.addClasses(y,["hiddenObj","noAccess"]),y.setAttribute("disabled","true")),i.appendChild(y)}}else if(!0===s.cbx||!0===s.radio){let l=occ.getElementFromString(e+"-hp"),i=l.querySelector("div.fieldInfo")?l.querySelector("div.fieldInfo").innerHTML:"";l.innerHTML="",""!==i&&l.appendChild(occ.createDiv(i,["fieldInfo"]));let a=!1,r=0;for(let e=0;e<t.length;e++)!0===h&&(t[e].fieldPrice=1*t[e].fieldPrice,(0===r||r>t[e].fieldPrice)&&(r=t[e].fieldPrice)),"Y"===t[e].ad&&(a=!0);if(!0===h){let e=occ.createDiv("From $"+r/100,["ocFoPrice"]);1===t.length&&(e.innerHTML="$"+r/100),n.querySelector("label").appendChild(e)}let u=!1;if(!0===a&&!0===d){occ.addClass(n,"hasDates");let o=occ.createElement(["textarea"],["hiddenObj","hiddenJson"],[{name:"id",value:e+"-json"}]);
3o.value=JSON.stringify(t),l.appendChild(o);let c=occ.ocButton(e+"-add","Add Option",occ.createFieldOptionRow,"plus rv",null,["topAdd"]);l.appendChild(c)}else for(let i=0;i<t.length;i++){let a=occ.createDiv("",["ocFoItem"]),r=occ.createDiv("",["fieldObj"]),d=occ.createElement("input",null,[{name:"value",value:t[i].fieldValue},{name:"data-value",value:t[i].fieldValue},{name:"data-option",value:t[i].fieldOption},{name:"data-foid",value:t[i].fieldOptionId}]);d.setAttribute("id",e+"-fo-"+t[i].eFieldOptionId);let p=null;if(t[i].eFieldOptionId&&null!==t[i].eFieldOptionId&&d.setAttribute("data-efoid",t[i].eFieldOptionId),!0===s.radio?(d.setAttribute("name",e+"-fo"),d.setAttribute("type","radio"),occ.addClass(r,"ocFieldRadio")):!0===s.cbx&&(d.setAttribute("type","checkbox"),occ.addClass(r,"ocFieldCbx")),!0===t[i].isDefault&&occ.isNothingOrEmpty(o)&&(o=t[i].fieldValue,c=!0),t[i].fieldGroup&&null!==t[i].fieldGroup&&d.setAttribute("data-fieldGroup",t[i].fieldGroup),t[i].fieldPrice&&null!==t[i].fieldPrice&&d.setAttribute("data-fieldPrice",t[i].fieldPrice),
3!0===s.store)if(occ.removeClasses(r,["ocFieldCbx","ocFieldCbx"]),occ.addClass(d,"curQty"),t[i].fieldQty&&null!==t[i].fieldQty&&t[i].fieldQty>1){occ.addClass(n,"curQty"),d.setAttribute("type","text"),d.value="0";let e=occ.createDiv("",["fieldQty"],[{name:"data-max",value:t[i].fieldQty}]),o=occ.createDiv("",["icon","s-minus","sz2","tr"]);occ.addClickEvent(o,occ.qtyDown),e.appendChild(o),occ.addEvent(d,occ.qtyKeyDown,"keydown"),occ.addEvent(d,occ.qtyKeyUp,"keyup"),e.appendChild(d);let l=occ.createDiv("",["icon","s-plus","sz2","tr"]);occ.addClickEvent(l,occ.qtyUp),e.appendChild(l),r.appendChild(e)}else d.value="0",!1===s.radio?(d.setAttribute("type","checkbox"),occ.addClickEvent(d,occ.qtyCbx,"pointerup")):occ.addClickEvent(d,occ.qtyCbxDown,"pointerdown"),r.appendChild(d);else d.addEventListener("change",occ.addFieldValue),r.appendChild(d),"Y"===t[i].afi&&(occ.addClass(d,"hasFillIn"),occ.addClass(a,"hasFillIn"),p="website"===t[i].fieldOption.toLowerCase()?occ.createInputControl(e+"afi"+i,"","url","",["fieldFillIn","hiddenObj"],[{name:"placeholder",value:"please fill in a value"}],null,!0):"fax"===t[i].fieldOption.toLowerCase()||"800"===t[i].fieldOption.toLowerCase()||"phone"===t[i].fieldOption.toLowerCase()?occ.createInputControl(e+"afi"+i,"","tel","",["fieldFillIn","hiddenObj"],[{name:"placeholder",value:"please fill in a value"}],null,!0):"Email"===t[i].fieldOption||"email"===t[i].fieldOption||"Public Email"===t[i].fieldOption?occ.createInputControl(e+"afi"+i,"","email","",["fieldFillIn","hiddenObj"],[{name:"placeholder",value:"please fill in a value"}],null,!0):occ.createElement("input",["fieldFillIn","hiddenObj"],[{name:"type",value:"text"},{name:"placeholder",value:"please fill in a value"}]),occ.addChangeEvent(p,occ.fieldFillInChange));a.appendChild(r);let m=function(e){let t=e.currentTarget.parentElement.querySelector("input");t&&(t.checked=!0,occ.addFieldValue({currentTarget:t}))},h=occ.createDiv(t[i].fieldOption,["fieldOption"],null);if(occ.addClickEvent(h,m),a.appendChild(h),t[i].fieldPrice&&null!==t[i].fieldPrice){let e=occ.createDiv("0"===t[i].fieldPrice?"Free":"$"+1*t[i].fieldPrice/100,["fieldPrice"],null);occ.addClickEvent(e,m),a.appendChild(e)}if(t[i].fieldDescription&&null!==t[i].fieldDescription){let e=occ.createDiv(t[i].fieldDescription,["fieldDescription"],null);occ.addClickEvent(e,m),a.appendChild(e)}if(t[i].fieldImageUrl&&null!==t[i].fieldImageUrl){let e=occ.createElement("img",["fieldImage"],[{name:"src",value:t[i].fieldImageUrl}]);occ.addClickEvent(e,m),a.appendChild(e)}null!==p&&a.appendChild(p),!0!==s.radio&&!0!==s.cbx||(u=t[i].fieldOption.length>30),"N"===t[i].cu&&occ.addClasses(a,["hiddenObj","noAccess"]),l.appendChild(a)}!0!==s.radio&&!0!==s.cbx||(!0===u?occ.addClass(l,"wide"):occ.removeClass(l,"wide")),!1===a&&l.querySelector("div.ocFoItem.hasFillIn")&&occ.reviewFamily(l,!0,!1,"div.ocFoItem.hasFillIn");let p=document.querySelector("div.ocStoreCart");if(!0===s.store&&l.children.length>0&&p){let t=occ.ocButton(e+"-crt","Add to Cart",occ.updateOcCart,"bag");occ.addClass(t,"storeBtn"),1===l.children.length&&occ.addClass(t,"singlePrice"),n.appendChild(t),l.children.length>1&&occ.disableControl(e+"-crt",!0)}}else if(!0===occ.hasClass(n,"ocswitch"))occ.switchSet(e+"-hp",null,t,null,!0);else if(!0===occ.hasClass(r,"divSelect")){let l=occ.getElementFromString(e+"-sel"),c=l.querySelectorAll("div.option");for(let e=0;e<c.length;e++)c[e].remove();let i="^",a=!1,r=null,d=occ.hasClass(n,"innerDDL");for(let c=0;c<t.length;c++)if(i.indexOf("^"+t[c].fieldOption+"^")<0){if(i+=t[c].fieldOption+"^",0===c&&""!==t[c].fieldValue){let e="-- not required --";!0===u&&(e="-- select a value --"),r=occ.createDiv(e,["option","blank","default","selected","ocFieldOption"],[{name:"data-fieldValue",value:""}]),r.setAttribute("data-fieldGroup","--any--"),occ.addClickEvent(r,occ.setOcFieldSelect),l.appendChild(r)}"all"===t[c].fieldValue&&!0===s.ia&&"true"!==n.getAttribute("data-includeAll")&&(t[c].fieldOption=n.getAttribute("data-includeAll")),!0===u&&1===t.length&&0===c&&(o=t[c].fieldValue);let m=occ.createDiv(t[c].fieldOption,["option","ocFieldOption"],[{name:"data-fieldValue",value:t[c].fieldValue}]);if(!1===p&&!0===t[c].isDefault&&(occ.removeClasses(r,["default","selected"]),occ.addClass(m,"default")),!0===p&&!0===t[c].isDefault&&occ.addClass(m,"isDefault"),t[c].fieldGroup&&null!==t[c].fieldGroup&&m.setAttribute("data-fieldGroup",t[c].fieldGroup),p&&m.setAttribute("data-efoid",t[c].eFieldOptionId),m.setAttribute("id",e+"-fo-"+t[c].eFieldOptionId),occ.addClickEvent(m,occ.setOcFieldSelect),"Y"===t[c].afi&&!0!==d&&(occ.addClass(m,"hasFillIn"),a=!0),!0===g){let e=occ.createDiv("",["icon","sz3","tr","s-"+t[c].fieldValue]);m.appendChild(e)}"N"===t[c].cu&&occ.addClasses(m,["hiddenObj","noAccess"]),l.appendChild(m)}if(!0===a){if(occ.addClass(l.parentElement,"hasFillIn"),a=occ.createElement("input",["fieldFillIn","hiddenObj"],[{name:"type",value:"text"}]),m){let e=n.getAttribute("data-minlength");""!==e&&(a.setAttribute("data-value",Number.parseFloat(e).toFixed(2)),a.setAttribute("minlength",e),a.setAttribute("min",e),a.setAttribute("type","number"),a.setAttribute("inputmode","numeric"))}else occ.hasClass(l.parentElement,"ocIcon")&&(occ.addClass(a,"required"),a.setAttribute("maxlength","5"));if(occ.addChangeEvent(a,occ.fieldFillInChange),l.parentElement.querySelector("div.fieldInfo"))try{l.parentElement.insertBefore(a,l.parentElement.querySelector("div.fieldInfo")),m&&l.parentElement.appendChild(occ.createDiv("",["customTextDisplay"]),l.parentElement.querySelector("div.fieldInfo"))}catch(e){}else l.parentElement.appendChild(a),m&&l.parentElement.appendChild(occ.createDiv("",["customTextDisplay"]))}}}!1!==a&&occ.triggerEvent(n,"load")}else!0===p?occ.addClasses(n,["noitems","readOnly"]):occ.hasClass(n,"ignoreEmpty")?occ.addClass(n,"noitems"):occ.addClass(n,"emptyField");let C=occ.getElementFromString(e+"-cvs"),v=occ.getElementFromString(e+"-ip");if(v&&v.list&&!0!==l){let t=occ.getElementFromString(e+"-dl").querySelectorAll("option.ocField-used");for(let e=0;e<t.length;e++)occ.removeClass(t[e],"ocField-used"),t[e].removeAttribute("disabled"),t[e].disabled=!1}if(!0===p){o=null;let e="N";if(null!==t)for(let o=0;o<t.length;o++)"N"===e&&"Other"===t[o].fieldValue&&(e="Y");else t=[];setTimeout(function(t){occ.setOCFormField(n.id+"-other",e,!1)},500),r.value=JSON.stringify(t),!0!==l&&!0!==c&&r.setAttribute("data-cv",null===r.value?"":r.value)}let b=!1,E="";if(""===o||null!==o)if(v&&v.list&&(v.value=""),Array.isArray(o)){if(o.length>0)if(occ.hasClass(n,"pcDisplay")){if(C){C.innerHTML="";let t=occ.getElementFromString(e+"-ip").querySelectorAll("input.pcCBX");for(let e=0;e<t.length;e++){t[e].checked=!1;for(let l=0;l<o.length;l++)o[l].fieldValue===t[e].getAttribute("data-value")&&!0!==o[l].deleted&&(t[e].checked=!0,o[l].found=!0)}for(let e=0;e<o.length;e++)if(!0===o[e].found&&!0!==o[e].deleted){let t=[{name:"data-foid",value:o[e].fieldOptionId},{name:"data-value",value:o[e].fieldValue}];!1===occ.isNothingOrEmpty(o[e].fpt)&&t.push({name:"title",value:o[e].fpt+" > "+o[e].fieldOption});let l=occ.createDiv("",["ocField-item"],t);
3if(o[e].fieldUrl&&!1===occ.isNullOrEmpty(o[e].fieldUrl)){let t=occ.createElement("img",["ocField-icon"]);t.src=o[e].fieldUrl,occ.addClass(l,"hasIcon"),l.appendChild(t);let c=occ.createDiv(o[e].fieldOption);c.appendChild(occ.createDiv("",["icon","s-x","sz2-5","tr"])),l.appendChild(c)}else l.innerHTML=o[e].fieldOption+' <div class="icon s-x sz2-5 tr"></div>';""!==E&&(E+=", "),E+=o[e].fieldOption,occ.addClickEvent(l,occ.removeFieldValue);let c=C.parentElement.querySelector('datalist > option.noAccess[data-value="'+o[e].fieldValue+'"]');("N"===o[e].cu||c)&&occ.addClasses(l,["hiddenObj","noAccess"]),C.appendChild(l)}f=JSON.stringify(o),r.value=f,!0!==l&&!0!==c&&r.setAttribute("data-cv",r.value),occ.changeInputControlCB(r)}}else{let i=occ.getElementFromString(e+"-dl");if(i){let e=i.querySelectorAll("option.ocFieldOption");if(e.length>0)for(let t=0;t<o.length;t++)if(!0===occ.isNothingOrEmpty(o[t].fieldOption))for(let l=0;l<e.length;l++)o[t].fieldValue===e[l].getAttribute("data-value")&&(o[t].fieldOption=e[l].getAttribute("data-option"))}if(!0!==s.mtp&&!0!==s.store)o[0].exists,r.value=o[0].fieldValue,!0===occ.hasClass(r,"divSelect")&&occ.setOcFieldSelect(e,r.value),!0!==l&&!0!==c&&r.setAttribute("data-cv",null===o[0].fieldValue?"":o[0].fieldValue);else{let i=occ.hasClass(n,"hasDates");if(C){C.innerHTML="";for(let e=0;e<o.length;e++)if(!0!==o[e].deleted){let l=!0;if(!1===occ.isNothingOrEmpty(o[e].etCatId)&&(l=!1,n.getAttribute("data-eFieldId")===o[e].etCatId&&(l=!0)),occ.isNothingOrEmpty(o[e].fieldOption)&&(l=!1),!0===l){let l=occ.createDiv("",["ocField-item"],[{name:"data-foid",value:o[e].fieldOptionId},{name:"data-value",value:o[e].fieldValue}]);if(null!=t&&t[e].eFieldOptionId&&null!==t[e].eFieldOptionId&&l.setAttribute("data-efoid",t[e].eFieldOptionId),o[e].fieldUrl&&!1===occ.isNullOrEmpty(o[e].fieldUrl)){let t=occ.createElement("img",["ocField-icon"]);
3t.src=o[e].fieldUrl,occ.addClass(l,"hasIcon"),l.appendChild(t);let c=occ.createDiv(o[e].fieldOption);c.appendChild(occ.createDiv("",["icon","s-x","sz2-5","tr"])),l.appendChild(c)}else l.innerHTML=o[e].fieldOption+' <div class="icon s-x sz2-5 tr"></div>',""!==E&&(E+=", "),E+=o[e].fieldOption;occ.addClickEvent(l,occ.removeFieldValue);let c=C.parentElement.querySelector('datalist > option.noAccess[data-value="'+o[e].fieldValue+'"]');if(("N"===o[e].cu||c)&&occ.addClasses(l,["hiddenObj","noAccess"]),C.appendChild(l),v&&v.list){E="";for(let t=0;t<v.list.children.length;t++)if(o[e].fieldOption!==v.list.children[t].value&&o[e].fieldValue!==v.list.children[t].getAttribute("data-value")||(!0===d&&(occ.addClass(v.list.children[t],"ocField-used"),v.list.children[t].disabled=!0),o[e].fieldUrl&&!0!==occ.isNullOrEmpty(o[e].fieldUrl)||(l.innerHTML=v.list.children[t].value+' <div class="icon s-x sz2-5 tr"></div>',""!==E&&(E+=", "),E+=v.list.children[t].value)),!0===occ.hasClass(v.list.children[t],"hasFillIn")){let l=v.list.children[t].parentElement.parentElement.querySelector(".fieldFillIn");!0===v.list.children[t].disabled?(!1===occ.isNothingOrEmpty(o[e].fieldFillIn)&&(!0===occ.hasClass(l,"ocInputControl")?occ.setOCFormField(l.id,o[e].fieldFillIn):l.value=o[e].fieldFillIn),occ.showObj(l)):occ.hideObj(l)}}}}}if(!0===i&&!0===d){if(f=JSON.stringify(o),r.value=f,!0!==l&&!0!==c&&r.setAttribute("data-cv",r.value),!0!==l)for(let t=0;t<o.length;t++)!0!==o[t].deleted&&occ.createFieldOptionRow(e,o[t])}else if(C||!0===s.cbx||!0===s.store){f=JSON.stringify(o),r.value=f,!0!==l&&!0!==c&&r.setAttribute("data-cv",r.value);let e=n.querySelectorAll("div.ocFieldCbx > input");!0===s.store&&(e=n.querySelectorAll("div.ocFieldRadio > input"));for(let l=0;l<e.length;l++){e[l].checked=!1;let c=e[l].parentElement.parentElement.querySelector(".fieldFillIn");c&&(occ.hideObj(c),!0===occ.hasClass(c,"ocInputControl")?occ.setOCFormField(c.id.replace("-ctrl",""),""):c.value="");for(let i=0;i<o.length;i++){let a=!0;if(!1===occ.isNothingOrEmpty(o[i].etCatId)&&(a=!1,n.getAttribute("data-eFieldId")===o[i].etCatId&&(a=!0)),occ.isNothingOrEmpty(o[i].fieldOption)&&(a=!1),!0===a){let a=!1;!0===o[i].deleted||o[i].fieldValue!==e[l].value&&o[i].fieldValue!==e[l].getAttribute("data-value")?a=!1:(e[l].checked=!0,a=!0,null!==t&&!0===s.store&&!1===s.cbx&&occ.addClass(e[l],"isDisabled"),""!==E&&(E+=", "),E+=o[i].fieldOption),!0===a&&!0===occ.hasClass(e[l],"hasFillIn")&&e[l].checked&&(!1===occ.isNothingOrEmpty(o[i].fieldFillIn)&&(!0===occ.hasClass(c,"ocInputControl")?occ.setOCFormField(c.id.replace("-ctrl",""),o[i].fieldFillIn):c.value=o[i].fieldFillIn),occ.showObj(c)),e[l].checked?occ.addClass(e[l].parentElement.parentElement,"isChecked"):occ.removeClass(e[l].parentElement.parentElement,"isChecked")}}}occ.changeInputControlCB(r)}}}else f="",r.value="",!0!==l&&!0!==c&&r.setAttribute("data-cv",""),!0===occ.hasClass(r,"divSelect")&&occ.setOcFieldSelect(e,0);if(occ.getElementFromString(e+"-crt")){let t=0;for(let e=0;e<o.length;e++)!0!==o[e].deleted&&(t+=o[e].fieldQty);t>0?occ.disableControl(e+"-crt",!1):occ.disableControl(e+"-crt",!0)}}else{let t="";if(occ.hasClass(n,"pcDisplay")){let t=occ.getElementFromString(e+"-ip").querySelector('input.pcCBX[data-value="'+o+'"]');if(t&&(t.checked=!0,C)){C.innerHTML="";let t=occ.getElementFromString(e+"-ip").querySelectorAll("input.pcCBX");for(let e=0;e<t.length;e++)if(t[e].checked=!1,o===t[e].getAttribute("data-value")){t[e].checked=!0;let o=[{name:"data-foid",value:t[e].getAttribute("data-foid")},{name:"data-value",value:t[e].getAttribute("data-value")}];o.push({name:"title",value:t[e].getAttribute("data-title")});let l=occ.createDiv("",["ocField-item","ocFlistOpt"],o);l.innerHTML=t[e].getAttribute("data-option")+' <div class="icon s-x sz2-5 tr"></div>',occ.addClickEvent(l,occ.removeFieldValue),C.appendChild(l),""!==E&&(E+=", "),E+=t[e].getAttribute("data-title")}r.value=o,!0!==l&&!0!==c&&r.setAttribute("data-cv",r.value),occ.changeInputControlCB(r)}}else{if(v&&v.list){let e=!1,l=null;for(let c=0;c<v.list.children.length;c++)v.list.children[c].getAttribute("data-value")===""+o&&(t=v.list.children[c].value,!0===occ.hasClass(v.list.children[c],"hasFillIn")&&(e=!0),l=[{fieldOptionId:v.list.children[c].getAttribute("data-foid"),fieldValue:v.list.children[c].getAttribute("data-value"),fieldOption:v.list.children[c].value}],l.fieldGroup=v.list.children[c].getAttribute("data-fieldGroup"),l.deleted=!1,o=JSON.stringify(l),""!==E&&(E+=", "),E+=v.list.children[c].value),v.list.children[c].getAttribute("data-value")===o.fieldValue&&!0===occ.hasClass(v.list.children[c],"hasFillIn")&&(e=!0);let c=v.parentElement.querySelector(".fieldFillIn");
3!0===e?(!1===occ.isNothingOrEmpty(o[i].fieldFillIn)&&(!0===occ.hasClass(c,"ocInputControl")?occ.setOCFormField(c.id,o[i].fieldFillIn):c.value=o[i].fieldFillIn,E+=": "+o[i].fieldFillIn),occ.showObj(c)):occ.hideObj(c),!1===occ.isNullOrEmpty(t)&&(v.value=t),0==d&&0==e&&null!=l&&l[0].fieldValue&&(o=l[0].fieldValue)}if(!0===occ.hasClass(n,"ocswitch"))switch(!0===o&&(o="true"),!1===o&&(o="false"),o.toLowerCase()){case"yes":case"true":o="Y";break;case"no":case"false":o="N"}else if(!0===s.cbx){let e=n.querySelectorAll("div.ocFieldCbx > input");for(let t=0;t<e.length;t++){if(e[t].value===o?(""!==E&&(E+=", "),E+=e[t].getAttribute("data-title"),o='[{"fieldOptionId":'+e[t].getAttribute("data-foid")+',"eFieldOptionId":"'+e[t].getAttribute("data-efoid")+'","fieldOption":"'+e[t].getAttribute("data-option")+'","fieldValue":"'+e[t].value+'","fieldGroup":"'+e[t].getAttribute("data-fieldGroup")+'","deleted":false}]',e[t].checked=!0):e[t].checked=!1,!0===occ.hasClass(e[t],"hasFillIn")){let l=e[t].parentElement.parentElement.querySelector(".fieldFillIn");e[t].checked?(!1===occ.isNothingOrEmpty(o.fieldFillIn)&&(!0===occ.hasClass(l,"ocInputControl")?(occ.setOCFormField(l.id,o[t].fieldFillIn),E+=": "+o[t].fieldFillIn):(l.value=o.fieldFillIn,E+=": "+o.fieldFillIn)),occ.showObj(l)):(occ.hideObj(l),!0===occ.hasClass(l,"ocInputControl")?occ.setOCFormField(l.id,""):l.value="")}e[t].checked?occ.addClass(e[t].parentElement.parentElement,"isChecked"):occ.removeClass(e[t].parentElement.parentElement,"isChecked")}}else if(!0===s.radio){let e=n.querySelectorAll("div.ocFieldRadio > input");for(let t=0;t<e.length;t++){if(e[t].checked=!1,(e[t].value===o+""||o.fieldValue&&e[t].value===o.fieldValue)&&(e[t].checked=!0,""!==E&&(E+=", "),E+=o.fieldOption,!0===occ.hasClass(e[t],"hasFillIn"))){let l=e[t].parentElement.parentElement.querySelector(".fieldFillIn");!0===e[t].checked?(!1===occ.isNothingOrEmpty(o.fieldFillIn)&&(!0===occ.hasClass(l,"ocInputControl")?occ.setOCFormField(l.id,o.fieldFillIn):l.value=o.fieldFillIn),occ.showObj(l),E+=": "+o.fieldFillIn):(occ.hideObj(l),!0===occ.hasClass(l,"ocInputControl")?occ.setOCFormField(l.id,""):l.value="")}e[t].checked?occ.addClass(e[t].parentElement.parentElement,"isChecked"):occ.removeClass(e[t].parentElement.parentElement,"isChecked")}}}if(f="string"!=typeof o?JSON.stringify(o):o,r.value=f,!0===occ.hasClass(r,"divSelect")&&occ.setOcFieldSelect(e,o),!0!==l&&!0!==c&&r.setAttribute("data-cv",null===o?"":f),!0===occ.hasClass(n,"ocswitch")){let t=occ.hasClass(e+"-hp","disabled");t&&this.disableControl(e+"-hp",!1),occ.switchClick(e+"-hp",f),t&&this.disableControl(e+"-hp",!0),b=t}}else f=o,null===o&&Array.isArray(t)&&occ.setOcFieldSelect(e);if(!1===occ.isNothingOrEmpty(E)&&r.setAttribute("data-display",E),C){if(!0===Array.isArray(o)){let e=!1;for(let t=0;t<o.length;t++)!0!==o[t].deleted&&(e=!0);!1===e&&(f="")}!0===s.mtp&&(""===f||null===f||0===f.length||o.fieldValue&&!0===occ.isNullOrEmpty(o.fieldValue))&&(C.innerHTML="<i>one or more values can be selected by clicking on the above field</i><span><i>no values have been selected</i></span>"),0===C.children.length&&!0===occ.hasClass(n,"readOnly")&&(occ.hasClass(n,"ignoreEmpty")?occ.addClass(n,"noitems"):occ.addClass(n,"emptyField"))}occ.disableControl(e,b),occ.checkInputControl(e),occ.resizeFormFields(),occ.loadOCFormCheck(e,!0)},ocCommon.prototype.updateFieldLabel=function(e,t){if(!t)return;let o=occ.getElementFromString(e+"-ctrl");if(o.querySelector("label")){let e=o.querySelector("label > span");o.querySelector("label").innerHTML=t+(e?e.outerHTML:"")}!0===occ.isNullOrEmpty(t)?occ.addClass(o,"hasLabel"):occ.removeClass(o,"hasLabel")},ocCommon.prototype.removeFieldValue=function(e){var t=e.currentTarget,o=t.parentElement.parentElement.id.replace("-ctrl","");if(!0===occ.hasClass(o,"disabled")||!0===occ.hasClass(t.parentElement.parentElement,"readOnly")||!0===occ.hasClass(t.parentElement.parentElement.parentElement,"readOnly"))return;let l=occ.hasClass(t.parentElement.parentElement,"retainDelete");if(occ.hasClass(t,"ocFlistOpt")){let e=document.querySelector("#"+o+'-ctrl input[type="radio"]:checked');e&&(e.checked=!1),occ.getElementFromString(o).value=""}
3else{let e=JSON.parse(occ.getElementFromString(o).value),c=0,i=null,a=!1;!0===occ.isNullOrEmpty(occ.getElementFromString(o).getAttribute("data-cv"))&&(a=!0);for(let o=0;o<e.length;o++)e[o].fieldValue==t.getAttribute("data-value")&&(c=t.getAttribute("data-foid"),i=t.getAttribute("data-value"),l&&!a?e[o].deleted=!0:e.splice(o,1));if(occ.hasClass(o+"-ctrl","pcDisplay")){let e=document.querySelectorAll("#"+o+'-ctrl input[type="checkbox"]:checked');for(let t=0;t<e.length;t++)e[t].getAttribute("data-value")===i&&(e[t].checked=!1)}else{let e=t.parentElement.parentElement.querySelectorAll("option.ocField-used");for(let t=0;t<e.length;t++)(e[t].getAttribute("data-foid")===c||!1===occ.isNullOrEmpty(e[t].getAttribute("data-value"))&&e[t].getAttribute("data-value")===i)&&(occ.removeClass(e[t],"ocField-used"),e[t].removeAttribute("disabled"),e[t].disabled=!1)}occ.getElementFromString(o).value=JSON.stringify(e)}let c=t.parentElement;t.remove(),0===c.children.length&&!0===occ.hasClass(o+"-ctrl","allowMultiple")&&(c.innerHTML="<i>one or more values can be selected by clicking on the above field</i>"),occ.checkInputControl(o),occ.triggerEvent(o+"-ip","change"),occ.changeInputControlCB(occ.getElementFromString(o))},ocCommon.prototype.addFieldPCValue=function(e){let t=e.currentTarget.id,o=e.currentTarget,l=t.substring(0,t.indexOf("-cbx-"));t=occ.getElementFromString(l+"-ctrl").querySelector("div.ocMfList");setTimeout(function(){occ.addFieldPCValueCB(t,l,"radio"===o.getAttribute("type")?o.value:null),"radio"===o.getAttribute("type")&&occ.removeClass(t,"active")},100)},ocCommon.prototype.addFieldPCValueCB=function(e,t,o){if(e){let l=occ.getElementFromString(t);if(l){let c=[];if(null===o){let o=occ.hasClass(t+"-ctrl","retainDelete"),i=0===l.value.indexOf("[")?JSON.parse(l.value):[],a=e.querySelectorAll('input[type="checkbox"]:checked');for(let e=0;e<a.length;e++)c.push({fieldOption:a[e].getAttribute("data-option"),fieldValue:a[e].getAttribute("data-value"),fieldOptionId:1*a[e].getAttribute("data-foid"),eFieldOptionId:a[e].getAttribute("data-efoid"),fpt:a[e].getAttribute("data-pt"),deleted:!1});if(!0===o)for(let e=0;e<i.length;e++){let t=!1;for(let o=0;o<c.length;o++)i[e].fieldValue===c[o].fieldValue&&(t=!0);!1===t&&(i[e].deleted=!0,c.push(i[e]))}}else c=o;occ.updateField(t,null,c,!0);let i=l.parentElement.getAttribute("data-child");null!==i&&""!==i&&"function"==typeof occ.filterFieldValue&&occ.filterFieldValue(i,occ.getElementFromString(t).value)}}},ocCommon.prototype.addFieldValue=function(e){var t=e.currentTarget,o=t.parentElement.id.replace("-ctrl","");!0===occ.hasClass(t,"fieldQA")&&(o=t.id.replace("-qa",""),t=occ.getElementFromString(o)),!0!==occ.hasClass(t.parentElement,"ocFieldCbx")&&!0!==occ.hasClass(t.parentElement,"ocFieldRadio")||(o=t.id.substr(0,t.id.indexOf("-fo-")),t=occ.getElementFromString(o)),!0!==occ.hasClass(t.parentElement,"fieldQty")&&!0!==occ.hasClass(t,"curQty")||(o=(t=occ.getNearest(t,"ocField","div")).id.replace("-ctrl",""),t=occ.getElementFromString(o));let l=occ.hasClass(o+"-ctrl","allowMultiple"),c=occ.hasClass(o+"-ctrl","occheckbox"),i=occ.hasClass(o+"-ctrl","ocradio");!0===i&&(l=!1);let a=occ.hasClass(o+"-ctrl","ocstore"),n=occ.hasClass(o+"-ctrl","retainDelete"),r=t.value,s="",d=[];l&&""!=occ.getElementFromString(o).value&&(d=JSON.parse(occ.getElementFromString(o).value));let u=occ.getElementFromString(t.id.replace("-ip","-cvs")),p=!1;if(t.list&&t.list.children){for(let e=0;e<t.list.children.length;e++){if(t.list.children[e].getAttribute("value")===r)if(!1===l&&!0===occ.hasClass(t.list.children[e],"hasFillIn")&&(p=!0),!0===l&&(occ.addClass(t.list.children[e],"ocField-used"),t.list.children[e].disabled=!0),!1===l&&!1===c)s=t.list.children[e].getAttribute("data-value");else if(!u.querySelector('[data-value="'+t.list.children[e].getAttribute("data-value")+'"]')){let o=t.list.children[e].getAttribute("data-value"),l=!0;if(!0===n)for(let e=0;e<d.length;e++)d[e].fieldValue===o&&!0===d[e].deleted&&(d[e].deleted=!1,l=!1);!0===l&&d.push({fieldOption:t.list.children[e].getAttribute("value"),fieldValue:o,fieldOptionId:1*t.list.children[e].getAttribute("data-foid"),eFieldOptionId:t.list.children[e].getAttribute("data-efoid"),deleted:!1})}}if(!0===p)occ.showObj(t.parentElement.querySelector(".fieldFillIn"));else{let e=t.parentElement.querySelector(".fieldFillIn");e&&(!0===occ.hasClass(e,"ocInputControl")?occ.setOCFormField(e.id,""):e.value="",occ.hideObj(e))}}else if(!0===c){let e=t.parentElement.querySelectorAll(".ocFieldCbx > input");for(let o=0;o<e.length;o++){let l=!0,c={};if(c.fieldOptionId=1*e[o].getAttribute("data-foid"),c.eFieldOptionId=e[o].getAttribute("data-efoid"),c.fieldOption=e[o].getAttribute("data-option"),c.fieldValue=e[o].getAttribute("value"),c.fieldPrice=e[o].getAttribute("data-fieldPrice"),c.fieldGroup=e[o].getAttribute("data-fieldGroup"),!0===a){let e=t.parentElement.querySelector("div.fieldImage");e&&(c.fieldImageUrl=e.style.backgroundImage)}c.fieldQty=1,c.deleted=!1;for(let t=0;t<d.length;t++)d[t].fieldValue===c.fieldValue&&(d[t].deleted=!e[o].checked,l=!1);!0===l&&e[o].checked&&d.push(c),!0===occ.hasClass(e[o],"hasFillIn")&&(e[o].checked?occ.showObj(e[o].parentElement.parentElement.querySelector(".fieldFillIn")):occ.hideObj(e[o].parentElement.parentElement.querySelector(".fieldFillIn")))}}if(!0===a){let e=t.parentElement.querySelectorAll("input.curQty");for(let o=0;o<e.length;o++){let l=!0,i={};i.fieldOptionId=1*e[o].getAttribute("data-foid"),i.eFieldOptionId=e[o].getAttribute("data-efoid"),i.fieldOption=e[o].getAttribute("data-option"),i.fieldValue=e[o].getAttribute("data-value"),i.fieldPrice=e[o].getAttribute("data-fieldPrice"),i.fieldGroup=e[o].getAttribute("data-fieldGroup"),"checkbox"===e[o].getAttribute("type")||"radio"===e[o].getAttribute("type")?!0===e[o].checked?i.fieldQty=1:i.fieldQty=0:i.fieldQty=1*e[o].value;let a=t.parentElement.querySelector("div.fieldImage");
3if(a&&(i.fieldImageUrl=a.style.backgroundImage),i.deleted=!1,!0===c)for(let e=0;e<d.length;e++)d[e].fieldValue===i.fieldValue&&(0===i.fieldQty?d.splice(e,1):d[e].fieldQty=i.fieldQty,l=!1);!0===l&&i.fieldQty>0&&d.push(i)}}if(!0===i){let e=t.parentElement.querySelectorAll("div.ocFieldRadio > input");for(let t=0;t<e.length;t++)!0===e[t].checked?(s=e[t].value,occ.addClass(e[t].parentElement.parentElement,"isChecked")):occ.removeClass(e[t].parentElement.parentElement,"isChecked"),!0===occ.hasClass(e[t],"hasFillIn")&&(e[t].checked?occ.showObj(e[t].parentElement.parentElement.querySelector(".fieldFillIn")):occ.hideObj(e[t].parentElement.parentElement.querySelector(".fieldFillIn")))}if(!1===l&&!1===a){if(!0===i||!1===occ.hasClass(o,"divSelect")){let e="";occ.getElementFromString(o).value.indexOf("{")>-1&&(e=JSON.parse(occ.getElementFromString(o).value),e.fieldValue=s,e.fieldFillIn="",s=JSON.stringify(e)),occ.getElementFromString(o).value=s}occ.checkInputControl(o)}else t.value="",occ.updateField(o,null,d,!0);let m=t.parentElement.getAttribute("data-child");null!==m&&""!==m&&"function"==typeof occ.filterFieldValue&&occ.filterFieldValue(m,occ.getElementFromString(o).value)},ocCommon.prototype.suppressFieldValue=function(e,t){if(!1===occ.isNothingOrEmpty(e)){let o=occ.getElementFromString(e+"-ctrl");if(o&&(occ.removeClass(o.querySelectorAll("div.option.tempHide"),"tempHide"),!1===occ.isNothingOrEmpty(t))){let e=o.querySelector('div.option[data-fieldvalue="'+t+'"]');e&&occ.addClass(e,"tempHide")}}},ocCommon.prototype.clickOcFieldSelect=function(e){let t=null;if("string"==typeof e?t=occ.getElementFromString(e):(t=e.tagName?e:e.currentTarget,occ.hasClass(t,"icon")&&(t=t.parentElement)),!(occ.hasClass(e.currentTarget,"select")&&occ.hasClass(e.currentTarget,"open")||occ.hasClass(t.parentElement,"readOnly")||occ.hasClass(t.parentElement,"disabled")))if(occ.hasClass(t,"open"))occ.resetOcFieldSelect(t);else{if(!0===occ.hasClass(t.parentElement,"disabled")||!0===occ.hasClass(t,"disabled"))return;if(occ.resetOcFieldSelect(null),document.body.addEventListener("pointerup",occ.blurOcFieldSelect),!0===occ.hasClass(t.parentElement,"ocField")){!1===occ.hasClass(t.parentElement,"autoWidth")?(t.style.minWidth=t.clientWidth+"px",t.parentElement.style.width=t.parentElement.clientWidth-25+"px",t.style.left=t.offsetLeft+1+"px"):t.style.left=t.offsetLeft+"px";let e=0;!0===occ.hasClass(t.parentElement,"allowEdit")&&(occ.hideObj(t.parentElement.querySelector("button.selBtn")),occ.hideObj(t.parentElement.querySelector("div.ctrl-other"))),!0===occ.hasClass(t.parentElement,"leftLabel")?(t.style.top="0px",t.style.left=t.parentElement.querySelector("label").clientWidth+"px"):(t.style.top=t.offsetTop+"px",e=t.parentElement.clientHeight,t.parentElement.style.height=e+"px");let o=occ.getScrollParent(t.parentElement);if(null!==o&&null!==o.elem){o.top+e>o.elem.scrollHeight-300&&o.elem.scrollHeight>o.elem.clientHeight&&(t.style.bottom="0",t.style.top="")}}if(!0===occ.hasClass(t.parentElement,"ocDropDown")){!1===occ.hasClass(t.parentElement,"autoWidth")&&(t.style.minWidth=t.clientWidth+"px",t.parentElement.style.width=t.parentElement.clientWidth+"px"),t.style.top=t.offsetTop-1+"px",t.style.left=t.offsetLeft+"px",!1===occ.hasClass(t.parentElement,"autoWidth")&&(t.style.minWidth=t.clientWidth+25+"px");let e=t.parentElement.clientHeight;t.parentElement.style.height=e-5+"px";let o=occ.getScrollParent(t.parentElement);if(null!==o&&null!==o.elem){(o.top+e>o.elem.scrollHeight-165&&o.elem.scrollHeight>o.elem.clientHeight||occ.hasClass(t,"mini"))&&(t.style.bottom="0",t.style.top="")}}occ.addClass(t,"open");let e=t.querySelector("div.icon"),o=t.querySelector("div.option.selected");o?(t.scrollTo(0,o.offsetTop),e.style.top=o.offsetTop+6+"px"):e.style.top="6px"}},ocCommon.prototype.blurOcFieldSelect=function(e){!0===occ.hasClass(e.target,"select")&&!0===occ.hasClass(e.target,"open")||(occ.resetOcFieldSelect(null),document.body.removeEventListener("pointerup",occ.blurOcFieldSelect))},ocCommon.prototype.downOcFieldSelect=function(e){let t=occ.hasClass(e.currentTarget,"open");
3if(!1!==t||"ArrowDown"!==e.key&&40!==e.keyCode&&"ArrowUp"!==e.key&&38!==e.keyCode&&"Enter"!==e.key&&13!==e.keyCode){if(!0===t)if("Escape"===e.key||27===e.keyCode)occ.resetOcFieldSelect(null);else if("Enter"===e.key||13===e.keyCode){let t=e.currentTarget.querySelector("div.preSelected.ocFieldOption");t&&occ.triggerEvent(t)}else{let t=e.currentTarget.querySelector("div.preSelected.ocFieldOption");t?occ.removeClass("div.preSelected.ocFieldOption","preSelected"):t=e.currentTarget.querySelector("div.selected.ocFieldOption");let o=null;"ArrowDown"!==e.key&&40!==e.keyCode||!t.nextElementSibling||(o=t.nextElementSibling),"ArrowUp"!==e.key&&38!==e.keyCode||!t.previousElementSibling||(o=t.previousElementSibling),o&&null!==o&&(occ.addClass(o,"preSelected"),o.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"}))}}else{let t=e.currentTarget.querySelector("div.selected.ocFieldOption");occ.setOcFieldSelect(t)}},ocCommon.prototype.setOcFieldSelect=function(e,t){let o=null,l=null,c=null;if(o="string"==typeof e?occ.getElementFromString(e):e.tagName?e:e.currentTarget,!o)return;if(!0===occ.hasClass(o,"divSelect"))c=e.currentTarget,o=occ.getElementFromString(o.id+"-sel");else if(!0===occ.hasClass(o,"pcDisplay"))c=e.currentTarget,o=occ.getElementFromString(o.id+"-ip");else if(!0===occ.hasClass(o,"option")&&(l=e.currentTarget,o=o.parentElement,!1===occ.hasClass(o,"open")&&!1===occ.hasClass(o.parentElement,"segment")&&!1===occ.hasClass(o,"segment")))return void occ.clickOcFieldSelect(o);c&&null!==c||(c=occ.getElementFromString(o.id.replace("-sel",""))),c&&null!==c||(c=o.querySelector('input[type="hidden"]')),occ.removeClass(o.querySelectorAll("div.option.selected"),"selected"),occ.removeClass(o.parentElement,"invalidFillin");let i=occ.hasClass(o.parentElement,"allowEdit"),a=!1,n={};if("string"==typeof t&&0===t.indexOf("{")&&(t=JSON.parse(t)),t&&t.fieldValue&&(n=t,t=n.fieldValue,!1===occ.isNothingOrEmpty(n.fieldFillIn)&&o.parentElement.querySelector('input.fieldFillIn[type="text"]')&&(o.parentElement.querySelector('input.fieldFillIn[type="text"]').value=n.fieldFillIn)),null!==l)l.getAttribute("data-fieldValue")!==c.value&&(
3a=!0),occ.addClass(l,"selected");else if(t&&null!==t&&""!==t&&"0"!==t){let e=o.querySelectorAll("div.option");if("string"==typeof t&&t.length>0)for(let o=0;o<e.length;o++)e[o].getAttribute("data-fieldValue")===t&&(occ.addClass(e[o],"selected"),l=e[o]);else"number"==typeof t&&occ.addClass(e[t],"selected")}else{let e=o.querySelector("div.option.default");e&&(occ.addClass(e,"selected"),a=!0)}occ.resetOcFieldSelect(o);let r=null,s=occ.hasClass(o.parentElement,"money");if(c&&"string"!=typeof t&&a){null===l&&(l=o.querySelector("div.option.selected"));let e=l.getAttribute("data-fieldValue");occ.hasClass(l,"hasFillIn")&&(c.value.indexOf("{")>-1?(n=JSON.parse(c.value),n.fieldValue=e):n={fieldValue:e,fieldFillIn:""},null!==l&&(r=o.parentElement.querySelector(".fieldFillIn"),s&&(occ.isNothingOrEmpty(n.fieldFillIn)&&(n.fieldFillIn=r.getAttribute("data-value")),1*n.fieldFillIn!==NaN&&(n.fieldFillIn=Number.parseFloat(n.fieldFillIn).toFixed(2)))),e=JSON.stringify(n)),!0!==i&&(c.value=e,occ.hasClass(c,"ocField")&&occ.checkInputControl(c.id),(occ.hasClass(c,"dirty")||a)&&occ.triggerEvent(o,"change"))}if(l&&null!==l)if(!0===i)occ.editFieldOption({currentTarget:l});else if(occ.hasClass(l,"hasFillIn"))occ.showObj(o.parentElement.querySelector(".fieldFillIn")),occ.addClass(o.parentElement,"showFillIn"),r&&null!==r&&(!1===occ.isNothingOrEmpty(n.fieldFillIn)?r.value=n.fieldFillIn:!0===occ.hasClass(r,"ocInputControl")?occ.setOCFormField(r.id,""):r.value="");else{occ.removeClass(o.parentElement,"showFillIn");let e=o.parentElement.querySelector(".fieldFillIn");e&&(!0===occ.hasClass(e,"ocInputControl")?occ.setOCFormField(e.id,""):e.value="",occ.hideObj(e))}},ocCommon.prototype.fieldFillInChange=function(e){let t=e.currentTarget,o=t.parentElement.querySelector("div > input");!0===occ.hasClass(t,"ocInputControl")&&(t=t.querySelector("input.ocInputControl-ip")),!0===occ.hasClass(t,"ocFormField")&&(o=t.parentElement.parentElement.querySelector("div > input"));let l=occ.getNearest(t,"ocField",!0,"div");if(l){let e=l.id.replace("-ctrl",""),c=occ.hasClass(l,"money"),i=null;if(""!=occ.getElementFromString(e).value&&occ.getElementFromString(e).value.indexOf("{")>-1&&(i=JSON.parse(occ.getElementFromString(e).value)),null===i&&(i={fieldValue:"",fieldFillIn:"",fieldOptionId:0}),"radio"!==o.getAttribute("type")&&"checkbox"!==o.getAttribute("type")||!0!==o.checked)!0===occ.hasClass(occ.getElementFromString(e),"divSelect")&&(!0===occ.isNothingOrEmpty(i.fieldValue)&&(i.fieldValue=occ.getElementFromString(e).value),i.fieldFillIn=t.value.trim(),occ.getElementFromString(e).value=JSON.stringify(i));else{if(!1===Array.isArray(i))i.fieldValue=o.value,i.fieldOptionId=1*o.getAttribute("data-foid"),i.fieldFillIn=t.value;else for(let e=0;e<i.length;e++)i[e].fieldValue===o.getAttribute("data-value")&&(i[e].fieldFillIn=t.value);occ.updateField(e,null,i,!0)}if(c){let e=1*t.getAttribute("min");
3NaN!==e&&(1*t.value<e?occ.addClass(l,"invalidFillin"):occ.removeClass(l,"invalidFillin")),t.value=Number.parseFloat(1*t.value).toFixed(2)}let a=l.id;a.endsWith("-ctrl")&&(a=a.substr(0,a.length-5)),occ.checkInputControl(a),occ.triggerEvent(l,"change")}},ocCommon.prototype.fieldRowChange=function(e){let t=e.currentTarget?occ.getNearest(e.currentTarget,"ddlRow",!0,"div"):e,o=occ.getNearest(t,"ocField",!0,"div");if(o){let l=t.querySelector("div.innerDDL input.divSelect");if(l){l=l.value;let c=o.id.replace("-ctrl",""),i=null;if(""!=occ.getElementFromString(c).value&&occ.getElementFromString(c).value.indexOf("[")>-1&&(i=JSON.parse(occ.getElementFromString(c).value)),null===i&&(i=[]),!1===occ.isNothingOrEmpty(l)){let o=t.querySelector("div.ocFoItemTxt input.ocInputControl-ip");o&&(o=o.value);let a=t.querySelector("div.ads input.ocInputControl-ip");a&&(a=a.value,!1===occ.isNothingOrEmpty(a)&&(a=occ.formatDate(a,"mm/dd/yyyy")));let n=t.querySelector("div.ade input.ocInputControl-ip");n&&(n=n.value,!1===occ.isNothingOrEmpty(n)&&(n=occ.formatDate(n,"mm/dd/yyyy")));let r=!1;for(let e=0;e<i.length;e++)i[e].fieldValue===l&&(r=!0,i[e].fieldFillIn=o,i[e].fieldStart=a,i[e].fieldEnd=n);
3!1===r&&i.push({fieldOption:l,fieldValue:l,fieldFillIn:o,fieldStart:a,fieldEnd:n,ad:a?"Y":"N",afi:o?"Y":"N"}),e.currentTarget&&occ.updateField(c,null,i,!0)}let a=o.id;a.endsWith("-ctrl")&&(a=a.substr(0,a.length-5)),occ.checkInputControl(a,!1,!0),occ.triggerEvent(o,"change")}}},ocCommon.prototype.changeFieldOptionDDL=function(e,t){let o="string"==typeof e?occ.getElementFromString(e):e.currentTarget,l=o.parentElement,c=l.parentElement.querySelector("textarea.hiddenJson");if(c&&""!==c.value){let e=null;if(0===c.value.indexOf("[")&&(e=JSON.parse(c.value)),!1===Array.isArray(e))return;let i=o.querySelector("input.divSelect").value;if(!0===occ.isNothingOrEmpty(i))return;e.forEach(function(e){e.fieldValue===i&&(t?(t.ad=e.ad,t.afi=e.afi):t=e)}),"Y"===t.afi?occ.addClass(l,"hasFillIn"):occ.removeClass(l,"hasFillIn"),"Y"===t.ad?occ.addClass(l,"hasDates"):occ.removeClass(l,"hasDates"),"N"===t.afi&&t.ad,occ.replaceClass(o,"col-2","col-3"),occ.setOCFormField(o.id.replace("-ddl-","-txt-"),t.fieldFillIn),occ.setOCFormField(o.id.replace("-ddl-","-ads-"),t.fieldStart),occ.setOCFormField(o.id.replace("-ddl-","-ade-"),t.fieldEnd),occ.resizeFormFields(l),occ.checkFieldOptionRow(l)}},ocCommon.prototype.checkFieldOptionRow=function(e){let t=e.parentElement.querySelectorAll(".ddlRow:not(.deleted) .innerDDL div.select > div.option.selected");if(t.length>0){e.parentElement.querySelectorAll(".ddlRow:not(.deleted) .innerDDL:not(.disabled) div.select > div.option:not(.selected)").forEach(function(e){let o=!1;t.forEach(function(t){t.getAttribute("data-fieldvalue")===e.getAttribute("data-fieldvalue")&&(o=!0)}),1==o?occ.addClass(e,"tempHide"):occ.removeClass(e,"tempHide")})}let o=e;setTimeout(function(){occ.fieldRowChange(o)},100)},ocCommon.prototype.deleteFieldOptionRow=function(e){let t=e.currentTarget.parentElement;occ.addClass(t,"deleted"),occ.checkFieldOptionRow(t)},ocCommon.prototype.createFieldOptionRow=function(e,t){let o="string"==typeof e?occ.getElementFromString(e+"-hp"):e.currentTarget.parentElement,l=o.querySelector("textarea.hiddenJson");if(l&&""!==l.value){let c=o.id.replace("-hp",""),i=o.querySelector('div.ddlRow[data-id="'+c+"-row-"+t.fieldOption+'"]'),a=0;if(i)a=i.getAttribute("data-i");else{a=o.children.length+1;let i=occ.hasClass(e.currentTarget,"topAdd")&&o.children.length>2,n=occ.createDiv("",["ocFoItem","ddlRow"],[{name:"data-id",value:c+"-row-"+t.fieldOption},{name:"data-i",value:a}]);
3n.appendChild(occ.createDiv("",["ocField-obj","col-2","innerDDL","innerTagField"],[{name:"id",value:c+"-ddl-"+a},{name:"data-label",value:"Name"},{name:"data-fieldOptions",value:l.value}])),n.appendChild(occ.createDiv("",["ocInputControl-obj","col-2","ocFoItemTxt","innerTagField"],[{name:"id",value:c+"-txt-"+a},{name:"data-label",value:"Title"},{name:"data-type",value:"text"}],"change",occ.fieldRowChange)),n.appendChild(occ.ocButton(c+"-del-"+a,"",occ.deleteFieldOptionRow,"garbage grey sz3",null,["delRowBtn","innerTagField"])),n.appendChild(occ.createDiv("",["rowBullet"])),n.appendChild(occ.createDiv("",["ocInputControl-obj","col-3","ocFoItemDt","ads","innerTagField"],[{name:"id",value:c+"-ads-"+a},{name:"data-label",value:"Start Date"},{name:"data-type",value:"ocCalendar"}],"change",occ.fieldRowChange)),n.appendChild(occ.createDiv("",["ocInputControl-obj","col-3","ocFoItemDt","ade","innerTagField"],[{name:"id",value:c+"-ade-"+a},{name:"data-label",value:"End Date"},{name:"data-type",value:"ocCalendar"}],"change",occ.fieldRowChange)),!0===i?o.insertBefore(n,o.children[2]):o.appendChild(n,e.currentTarget),occ.initInputControls(n),occ.initFields(n),occ.addChangeEvent(c+"-ddl-"+a+"-ctrl",occ.changeFieldOptionDDL),occ.checkFieldOptionRow(n)}t&&(occ.setOCFormField(c+"-ddl-"+a,t.fieldValue),occ.changeFieldOptionDDL(c+"-ddl-"+a+"-ctrl",t),occ.disableControl(c+"-ddl-"+a,!0))}},ocCommon.prototype.getFieldOptions=function(e){let t=null;for(let o=0;o<this.ocFields.length;o++)this.ocFields[o].fi===e&&(t=this.ocFields[o].fieldOptions);return t},ocCommon.prototype.getFieldOptionInfo=function(e,t){let o={},l=occ.getFieldOptions(e);if(Array.isArray(l))for(let e=0;e<l.length;e++)l[e].foid===t&&(o=l[e]);return o},ocCommon.prototype.getFieldOptionsInfo=function(e,t){if(!t||null==t){t=[];let o=occ.getElementFromString(e).value;if(o&&!1===occ.isNullOrEmpty(o))if(o.indexOf("{")>-1){o=JSON.parse(o);for(let e=0;e<o.length;e++)!1===o[e].deleted&&t.push({foid:o[e].fieldOptionId,value:o[e].fieldValue})}else t.push({foid:null,value:o})}let o=[],l=occ.getFieldOptions(e);if(Array.isArray(l))for(let e=0;e<l.length;e++)for(let c=0;c<t.length;c++)(null!==t[c].foid&&l[e].foid===t[c].foid||null===t[c].foid&&l[e].fieldValue===t[c].value)&&o.push(l[e]);return o},ocCommon.prototype.initFields=function(e){e&&null!=e||(e=document);let t=e.querySelectorAll("div.ocField-obj"),o={eTenantId:"",fields:[]};for(let e=0;e<t.length;e++)if(!1===occ.hasClass(t[e],"ocField")&&!1===occ.hasClass(t[e],"loading")){let c=t[e].getAttribute("data-tableName");if(!0===occ.isNullOrEmpty(c)||"State"===c||"timezones"===c||"icon"===c||"icontext"===c||c.startsWith("iconstyle")||"minutes"===c||"5minutes"===c||"10minutes"===c||"15minutes"===c||"20minutes"===c||"30minutes"===c||"hours"===c||"12hours"===c||"24hours"===c||"AMPM"===c||"days"===c||"weekdays"===c||"months"===c||"entity"===c||"entityfull"===c||"columns"===c||"fonts"===c||"fieldtype"===c||"fieldtypemin"===c||"fieldtypefull"===c||"Standard"===c||"Alignment"===c)occ.initField(t[e]);else{var l={fi:t[e].id,tn:c,fn:t[e].getAttribute("data-fieldname")};0==occ.isNullOrEmpty(t[e].getAttribute("data-eTenantId"))&&(l.eTenantId=t[e].getAttribute("data-eTenantId")),0==occ.isNullOrEmpty(t[e].getAttribute("data-rid"))&&(l.rid=t[e].getAttribute("data-rid")),!1===occ.isNothingOrEmpty(t[e].getAttribute("data-multiple"))&&(l.mtp="true"==t[e].getAttribute("data-multiple")),l.cbx="true"==t[e].getAttribute("data-checkbox"),l.radio="true"==t[e].getAttribute("data-radio"),l.store="true"==t[e].getAttribute("data-store"),l.atp="true"==t[e].getAttribute("data-allowType"),l.ia="false"!==t[e].getAttribute("data-includeAll")&&0==occ.isNullOrEmpty(t[e].getAttribute("data-includeAll")),l.segment="true"==t[e].getAttribute("data-segment"),l.allowEdit="true"===t[e].getAttribute("data-allowEdit"),!0===l.allowEdit&&(l.ia=!1),!0===l.segment&&(l.atp=!1,l.mtp=!1),l.ac=t[e].getAttribute("data-autocomplete"),l.fieldLabel=t[e].getAttribute("data-label")?t[e].getAttribute("data-label"):"",l.placeholder=t[e].getAttribute("data-placeholder")?t[e].getAttribute("data-placeholder"):"",l.info=t[e].getAttribute("data-info")?t[e].getAttribute("data-info"):"",!0===l.mtp&&(l.atp=!0,l.retain="true"===t[e].getAttribute("data-retain")),!0===l.cbx&&(l.atp=!1,l.mtp=!0,l.retain="true"===t[e].getAttribute("data-retain")),!0===l.radio&&(l.atp=!1,l.mtp=!1,l.ia=!1,l.retain="true"===t[e].getAttribute("data-retain")),!0===l.store&&(l.cbx=!1,l.radio=!1,1==l.mtp?l.cbx=!0:l.radio=!0,l.atp=!1,l.ia=!1,l.retain="true"===t[e].getAttribute("data-retain")),l.cv=!1===occ.isNullOrEmpty(t[e].getAttribute("data-value"))?t[e].getAttribute("data-value"):null,""===o.eTenantId?o.eTenantId=l.eTenantId:o.eTenantId===l.eTenantId&&(l.eTenantId=""),o.fields.push(l),occ.addClass(t[e],"loading"),occ.loadOCFormCheck(t[e].id,!1)}}o.fields.length>0&&this.loadFields(o)},ocCommon.prototype.reInitField=function(e,t,o,l){let c=occ.getElementFromString(e+"-ctrl");c?(t&&0==occ.isNullOrEmpty(t)&&c.setAttribute("data-eTenantId",t),o&&!1===occ.isNullOrEmpty(o)&&c.setAttribute("data-rid",o),null!=l&&occ.getElementFromString(e+"-ctrl").setAttribute("data-value",l),c.innerHTML="",c.setAttribute("id",c.id.replace("-ctrl","")),occ.loadOCFormCheck(c.id,!1),occ.removeClass(c,"loading"),occ.removeClass(c,"ocField")):(t&&0==occ.isNullOrEmpty(t)&&occ.getElementFromString(e).setAttribute("data-eTenantId",t),o&&!1===occ.isNullOrEmpty(o)&&occ.getElementFromString(e).setAttribute("data-rid",o),null!=l&&occ.getElementFromString(e).setAttribute("data-value",l)),occ.initField(e)},ocCommon.prototype.initField=function(e){let t=occ.getElementFromString(e);if(e=t.id,!0===occ.hasClass(t,"loading"))return;let o=t.getAttribute("data-tableName")+"";if("NULL"!==o&&"null"!==o||(o=""),"State"===o||"timezones"===o||"icon"===o||"icontext"===o||o.startsWith("iconstyle")||"minutes"===o||"5minutes"===o||"10minutes"===o||"15minutes"===o||"20minutes"===o||"30minutes"===o||"hours"===o||"12hours"===o||"24hours"===o||"AMPM"===o||"days"===o||"weekdays"===o||"months"===o||"entity"===o||"entityfull"===o||"columns"===o||"fonts"===o||"fieldtype"===o||"fieldtypemin"===o||"fieldtypefull"===o||"Standard"===o||"Alignment"===o||
3!0===occ.isNullOrEmpty(o)){let l=[],c={fi:e,tn:o,fn:t.getAttribute("data-fieldname")};0==occ.isNullOrEmpty(t.getAttribute("data-eTenantId"))&&(c.eTenantId=t.getAttribute("data-eTenantId")),!1===occ.isNullOrEmpty(t.getAttribute("data-rid"))&&(c.rid=t.getAttribute("data-rid")),!1===occ.isNothingOrEmpty(t.getAttribute("data-multiple"))&&(c.mtp="true"===t.getAttribute("data-multiple")),c.cbx="true"===t.getAttribute("data-checkbox"),c.radio="true"===t.getAttribute("data-radio"),c.store="true"===t.getAttribute("data-store"),c.atp="true"===t.getAttribute("data-allowType"),c.ia="false"!==t.getAttribute("data-includeAll")&&0==occ.isNullOrEmpty(t.getAttribute("data-includeAll")),c.segment="true"===t.getAttribute("data-segment"),c.allowEdit="true"===t.getAttribute("data-allowEdit"),!0===c.allowEdit&&(c.ia=!1),!0===c.segment&&(c.atp=!1,c.mtp=!1,c.cbx=!1),c.ac=t.getAttribute("data-autocomplete"),c.fieldLabel=t.getAttribute("data-label")?t.getAttribute("data-label"):"",c.placeholder=t.getAttribute("data-placeholder")?t.getAttribute("data-placeholder"):"",c.info=t.getAttribute("data-info")?t.getAttribute("data-info"):"","State"===o?c.fieldOptions=occ.getFieldStateArray():"minutes"===o?c.fieldOptions=occ.getFieldMinutesArray(1):"5minutes"===o?c.fieldOptions=occ.getFieldMinutesArray(5):"10minutes"===o?c.fieldOptions=occ.getFieldMinutesArray(10):"15minutes"===o?c.fieldOptions=occ.getFieldMinutesArray(15):"20minutes"===o?c.fieldOptions=occ.getFieldMinutesArray(20):"30minutes"===o?c.fieldOptions=occ.getFieldMinutesArray(30):"hours"===o||"12hours"===o?c.fieldOptions=occ.getFieldHoursArray(12):"24hours"===o?c.fieldOptions=occ.getFieldHoursArray(24):"days"===o?c.fieldOptions=occ.getFieldDayArray():"weekdays"===o?c.fieldOptions=occ.getFieldWDayArray():"months"===o?c.fieldOptions=occ.getFieldMonthArray():"timezones"===o?c.fieldOptions=occ.getFieldTZArray():"AMPM"===o?c.fieldOptions=occ.getFieldAMPMArray():0===o.indexOf("iconstyle")?c.fieldOptions=occ.getFieldIconStyleArray(o.replace("iconstyle","")):"entity"===o?c.fieldOptions=occ.getEntityArray():"entityfull"===o?c.fieldOptions=occ.getEntityArray(!0):"columns"===o?c.fieldOptions=occ.getColsArray():"fonts"===o?c.fieldOptions=occ.getFontsArray():"fieldtype"===o?c.fieldOptions=occ.getFieldTypeArray():"fieldtypemin"===o?c.fieldOptions=occ.getMinFieldTypeArray():"fieldtypefull"===o?c.fieldOptions=occ.getFullFieldTypeArray():"Standard"===o?c.fieldOptions=occ.getStandardArray():"Alignment"===o?c.fieldOptions=occ.getAlignmentArray():"icon"!==o&&"icontext"!==o||(c.fieldOptions="icontext"===o?occ.getFieldIconTextArray(null):occ.getFieldIconArray(null),occ.addClass(t,"ocIcon"));let i=t.getAttribute("data-fieldOptions");t.removeAttribute("data-fieldOptions"),!1===occ.isNullOrEmpty(i)&&0===i.indexOf("[")&&(c.fieldOptions=JSON.parse(i)),"Status"===i?c.fieldOptions=[{fieldOptionId:1,fieldOption:"Active",fieldValue:"A"},{fieldOptionId:2,fieldOption:"In-Active",fieldValue:"I"}]:"StatusP"===i?c.fieldOptions=[{fieldOptionId:1,fieldOption:"Active",fieldValue:"A"},{fieldOptionId:2,fieldOption:"Pending",fieldValue:"P"},{fieldOptionId:3,fieldOption:"In-Active",fieldValue:"I"}]:"StatusC"===i?c.fieldOptions=[{fieldOptionId:1,fieldOption:"Active",fieldValue:"A"},{fieldOptionId:2,fieldOption:"Canceled",fieldValue:"C"},{fieldOptionId:3,fieldOption:"In-Active",fieldValue:"I"}]:"StatusPC"===i?c.fieldOptions=[{fieldOptionId:1,fieldOption:"Active",fieldValue:"A"},{fieldOptionId:2,fieldOption:"Pending",fieldValue:"P"},{fieldOptionId:3,fieldOption:"Canceled",fieldValue:"C"},{fieldOptionId:4,fieldOption:"In-Active",fieldValue:"I"}]:"Publish"===i?c.fieldOptions=[{fieldOptionId:2,fieldOption:"Pending",fieldValue:"P"},{fieldOptionId:3,fieldOption:"Publish",fieldValue:"A"}]:i&&null!==i&&"null"!==i&&i.length>0&&i.length<7&&(c.fieldOptions=i),!0===c.mtp&&(c.atp=!0,c.retain="true"===t.getAttribute("data-retain")),!0===c.cbx&&(c.atp=!1,c.mtp=!0,c.retain="true"===t.getAttribute("data-retain")),!0===c.radio&&(c.atp=!1,c.mtp=!1,c.ia=!1,c.retain="true"===t.getAttribute("data-retain")),!0===c.store&&(c.cbx=!1,c.radio=!1,1==c.mtp?c.cbx=!0:c.radio=!0,c.atp=!1,c.ia=!1,c.retain="true"===t.getAttribute("data-retain")),c.cv=!1===occ.isNullOrEmpty(t.getAttribute("data-value"))?t.getAttribute("data-value"):null,l.push(c),occ.createFields(l)}else if(!1===occ.isNullOrEmpty(o)){let l={eTenantId:"",fields:[]},c={fi:e,tn:o,fn:t.getAttribute("data-fieldname")};0==occ.isNullOrEmpty(t.getAttribute("data-eTenantId"))&&(c.eTenantId=t.getAttribute("data-eTenantId")),!1===occ.isNullOrEmpty(t.getAttribute("data-rid"))&&(c.rid=t.getAttribute("data-rid")),!1===occ.isNothingOrEmpty(t.getAttribute("data-multiple"))&&(c.mtp="true"===t.getAttribute("data-multiple")),c.cbx="true"===t.getAttribute("data-checkbox"),c.radio="true"===t.getAttribute("data-radio"),c.store="true"===t.getAttribute("data-store"),c.atp="true"===t.getAttribute("data-allowType"),c.ia="false"!==t.getAttribute("data-includeAll")&&0==occ.isNullOrEmpty(t.getAttribute("data-includeAll")),c.segment="true"===t.getAttribute("data-segment"),c.allowEdit="true"===t.getAttribute("data-allowEdit"),!0===c.allowEdit&&(c.ia=!1),!0===c.segment&&(c.atp=!1,c.mtp=!1,c.cbx=!1),c.ac=t.getAttribute("data-autocomplete"),c.fieldLabel=t.getAttribute("data-label")?t.getAttribute("data-label"):"",c.placeholder=t.getAttribute("data-placeholder")?t.getAttribute("data-placeholder"):"",c.info=t.getAttribute("data-info")?t.getAttribute("data-info"):"",!0===c.mtp&&(c.atp=!0,c.retain="true"===t.getAttribute("data-retain")),!0===c.cbx&&(c.atp=!1,c.mtp=!0,c.retain="true"===t.getAttribute("data-retain")),!0===c.radio&&(c.atp=!1,c.mtp=!1,c.ia=!1,c.retain="true"===t.getAttribute("data-retain")),!0===c.store&&(c.cbx=!1,c.radio=!1,!0===c.mtp?c.cbx=!0:c.radio=!0,c.atp=!1,c.ia=!1,c.retain="true"===t.getAttribute("data-retain")),c.cv=!1===occ.isNullOrEmpty(t.getAttribute("data-value"))?t.getAttribute("data-value"):null,occ.addClass(t,"loading"),""===l.eTenantId&&(l.eTenantId=c.eTenantId),l.eTenantId===c.eTenantId&&(c.eTenantId=""),l.fields.push(c),this.loadFields(l)}};let curCustomOptionId=null;ocCommon.prototype.editFieldOption=function(e){let t=e.currentTarget.parentElement,o="",l="",c=!1;if(!0===occ.hasClass(t,"select")&&(t=t.parentElement,o=e.currentTarget.getAttribute("data-fieldvalue"),l=e.currentTarget.innerText,c=occ.hasClass(e.currentTarget,"isDefault"),curCustomOptionId=e.currentTarget.getAttribute("data-efoid"),!0===occ.hasClass(e.currentTarget,"blank")||"Other"==o&&"Other"===l))return;let i=t.querySelector("div.ocField-innerForm"),a=occ.hasClass(t,"money");if(!i){i=occ.createDiv("",["ocField-innerForm"]);let e="text";!0===a&&(e="number");let o=occ.createDiv("",["ocInputControl-obj","col-2","ctrl-fo","required","hiddenObj"],[{name:"id",value:t.id+"-fo"},{name:"data-label",value:"Option Text"},{name:"data-type",value:"text"},{name:"style",value:"width: calc(50% - 26px);
3display: inline-block;"}]),l=occ.createDiv("",["ocInputControl-obj","col-2","ctrl-fv","required","hiddenObj"],[{name:"id",value:t.id+"-fv"},{name:"data-label",value:"Option value"},{name:"data-type",value:e},{name:"style",value:"width: calc(50% - 26px);display: inline-block;"}]);!0===a&&(l.setAttribute("data-minlength","1"),occ.addClass(l,"money")),i.appendChild(o),i.appendChild(l),i.appendChild(occ.createDiv("",["ocInputControl-obj","col-3","ctrl-def"],[{name:"id",value:t.id+"-def"},{name:"data-label",value:"Default **"},{name:"data-type",value:"checkbox"},{name:"style",value:"width: calc(50% - 26px);display: inline-block;margin-top:0;"}])),i.appendChild(occ.createDiv("",["ocCol-break"])),i.appendChild(occ.ocButton(t.id+"-fSBtn","Apply",occ.editFieldOptionCB)),i.appendChild(occ.ocButton(t.id+"-fCBtn","Cancel",occ.editFieldOptionCancel)),i.appendChild(occ.ocButton(t.id+"-fRBtn","Remove",occ.editFieldOptionRemove)),t.insertBefore(i,t.querySelector("div.ctrl-other")),occ.initInputControls(i)}!0===a&&(""===l&&(l="1"),""===o&&(o="1")),occ.setOCFormField(t.id+"-fo",l),occ.setOCFormField(t.id+"-fv",o),occ.setOCFormField(t.id+"-def",c),occ.showField(t.id+"-fo"),occ.showField(t.id+"-fv"),occ.addClass(i,"active"),occ.resizeFormFields(i),occ.hideObj(i.parentElement.querySelector("button.selBtn")),occ.addClass(i.parentElement,"readOnly"),null===curCustomOptionId?occ.hideObj(t.id+"-fRBtn"):occ.showObj(t.id+"-fRBtn")},ocCommon.prototype.editFieldOptionCancel=function(e){occ.editFieldOptionCB(e,"C")},ocCommon.prototype.editFieldOptionRemove=function(e){occ.editFieldOptionCB(e,"R")},ocCommon.prototype.editFieldOptionCB=function(e,t){let o=e.currentTarget.parentElement,l=null,c=e.currentTarget.id;c=c.substring(0,e.currentTarget.id.indexOf("-ctrl"));let i=occ.getElementFromString(c),a=i.value;a=!1===occ.isNothingOrEmpty(a)?JSON.parse(a):[];let n=!1;if("C"===t);else if(!t)if(e.currentTarget.id.indexOf("-other")>-0){let e="Y"===occ.getElementFromString(c+"-ctrl-other").value;if(!0===e){l={eFieldOptionId:"O",fieldValue:"Other",fieldOption:"Other",afi:"Y"};let e=1*i.getAttribute("data-minlength");NaN!==e&&(l.fieldFillIn=Number.parseFloat(1*e).toFixed(2))}else!1===e&&(curCustomOptionId="O",t="R")}else{let e=occ.checkOCFormContainer(o);if(!1!==e.clean||!0!==e.complete)return;{let e=occ.getElementFromString(c+"-ctrl-fv").value,t=occ.getElementFromString(c+"-ctrl-fo").value,i=occ.getElementFromString(c+"-ctrl-def").checked;for(let o=0;o<a.length;o++)!0===i&&(a[o].isDefault=!1),curCustomOptionId!==a[o].eFieldOptionId&&a[o].fieldValue.toLowerCase()===e.toLowerCase()&&a[o].fieldOption.toLowerCase()===t.toLowerCase()&&(n=!0);if(null===curCustomOptionId)l={eFieldOptionId:occ.eid(),fieldOption:t,fieldValue:e,isDefault:i};else for(let o=0;o<a.length;o++)curCustomOptionId===a[o].eFieldOptionId&&(a[o].fieldValue=e,a[o].fieldOption=t,a[o].isDefault=i);!0!==n&&occ.checkOCFormContainer(o,!0)}}if(!0===n){occ.setInputControlInfo(c+"-ctrl-fv","*must be unique"),occ.setInputControlInfo(c+"-ctrl-fo","*must be unique"),setTimeout(function(){occ.setInputControlInfo(c+"-ctrl-fv",""),occ.setInputControlInfo(c+"-ctrl-fo","")},6e3)}else{if(null!==l||"R"===t){if("R"===t)for(let e=0;e<a.length;e++)"R"===t&&(a[e].eFieldOptionId===curCustomOptionId||"O"===curCustomOptionId&&"Other"===a[e].fieldValue&&"Other"===a[e].fieldOption)&&a.splice(e,1);Array.isArray(a)&&null!==l&&a.push(l)}!0===Array.isArray(a)&&occ.updateField(c,a,null,!0,!0),occ.removeClass(o,"active"),occ.hideField(c+"-ctrl-fo"),occ.hideField(c+"-ctrl-fv"),curCustomOptionId=null,occ.showObj(o.parentElement.querySelector("button.selBtn")),!0!==occ.hasClass(o.parentElement,"noItems")&&occ.removeClass(o.parentElement,"readOnly"),occ.changeInputControlCB(i)}},ocCommon.prototype.loadFields=function(e){var t=new ocAjax({jsonResponse:!0,showWaiting:!1,jsonRequest:!0,onSuccess:function(t){var o=t;for(let t=0;t<o.length;t++)for(let l=0;l<e.fields.length;l++)if(o[t].fi===e.fields[l].fi){if(o[t].parentFieldId===e.fields[l].fi&&e.fields[l].onChange&&(o[t].onChange=e.fields[l].onChange),!1===occ.isNullOrEmpty(o[t].cv)&&0===o[t].cv.indexOf("["))try{o[t].cv=JSON.parse(o[t].cv)}catch(e){}o[t].info=e.fields[l].info,e.fields[l].found=!0}for(let e=0;e<o.length;e++)!0===o[e].mtp&&!1===o[e].atp&&(o[e].cbx=!0);occ.createFields(o)},onFailure:function(e,t,o){console.log("loadField Error: "+e+"("+t+")")}});if(e.fields.sort(occ.dynamicSort("tn")),e.fields.length>6){let o={eTenantId:e.eTenantId,fields:[]},l=0;for(let c=0;c<e.fields.length;c++)o.fields.push(e.fields[c]),l++,6===l&&(t.post("/api/common/GetFieldObj",o),o.fields=[],l=0);o.fields.length>0&&t.post("/api/common/GetFieldObj",o)}else t.post("/api/common/GetFieldObj",e)};let occFieldStateArray=[];function ocFieldResize(e){}function occInitPauseField(e){}ocCommon.prototype.getFieldStateArray=function(){return 0===occFieldStateArray.length&&(occFieldStateArray.push({f
3ieldOptionId:0,fieldOption:"Alabama",fieldValue:"AL"}),occFieldStateArray.push({fieldOptionId:0,fieldOption:"Alaska",fieldValue:"AK"}),occFieldStateArray.push({fieldOptionId:0,fieldOption:"Arizona",fieldValue:"AZ"}),occFieldStateArray.push({fieldOptionId:0,fieldOption:"Arkansas",fieldValue:"AR"}),occFieldStateArray.push({fieldOptionId:0,fieldOption:"California",fieldValue:"CA"}),occFieldStateArray.push({fieldOptionId:0,fieldOption:"Colorado",fieldValue:"CO"}),occFieldStateArray.push({fieldOptionId:0,fieldOption:"Connecticut",fieldValue:"CT"}),occFieldStateArray.push({fieldOptionId:0,fieldOption:"Delaware",fieldValue:"DE"}),occFieldStateArray.push({fieldOptionId:0,fieldOption:"District of Columbia",fieldValue:"DC"}),occFieldStateArray.push({fieldOptionId:0,fieldOption:"Florida",fieldValue:"FL"}),occFieldStateArray.push({fieldOptionId:0,fieldOption:"Georgia",fieldValue:"GA"}),occFieldStateArray.push({fieldOptionId:0,fieldOption:"Hawaii",fieldValue:"HI"}),occFieldStateArray.push({fieldOptionId:0,fieldOption:"Idaho",fieldValue:"ID"}),occFieldStateArray.push({fieldOptionId:0,fieldOption:"Illinois",fieldValue:"IL"}),occFieldStateArray.push({fieldOptionId:0,fieldOption:"Indiana",fieldValue:"IN"}),occFieldStateArray.push({fieldOptionId:0,fieldOption:"Iowa",fieldValue:"IA"}),occFieldStateArray.push({fieldOptionId:0,fieldOption:"Kansas",fieldValue:"KS"}),occFieldStateArray.push({fieldOptionId:0,fieldOption:"Kentucky",fieldValue:"KY"}),occFieldStateArray.push({fieldOptionId:0,fieldOption:"Louisiana",fieldValue:"LA"}),occFieldStateArray.push({fieldOptionId:0,fieldOption:"Maine",fieldValue:"ME"}),occFieldStateArray.push({fieldOptionId:0,fieldOption:"Maryland",fieldValue:"MD"}),occFieldStateArray.push({fieldOptionId:0,fieldOption:"Massachusetts",fieldValue:"MA"}),occFieldStateArray.push({fieldOptionId:0,fieldOption:"Michigan",fieldValue:"MI"}),occFieldStateArray.push({fieldOptionId:0,fieldOption:"Minnesota",fieldValue:"MN"}),occFieldStateArray.push({fieldOptionId:0,fieldOption:"Mississippi",fieldValue:"MS"}),occFieldStateArray.push({fieldOptionId:0,fieldOption:"Missouri",fieldValue:"MO"}),occFieldStateArray.push({fieldOptionId:0,fieldOption:"Montana",fieldValue:"MT"}),occFieldStateArray.push({fieldOptionId:0,fieldOption:"Nebraska",fieldValue:"NE"}),occFieldStateArray.push({fieldOptionId:0,fieldOption:"Nevada",fieldValue:"NV"}),occFieldStateArray.push({fieldOptionId:0,fieldOption:"New Hampshire",fieldValue:"NH"}),occFieldStateArray.push({fieldOptionId:0,fieldOption:"New Jersey",fieldValue:"NJ"}),occFieldStateArray.push({fieldOptionId:0,fieldOption:"New Mexico",fieldValue:"NM"}),occFieldStateArray.push({fieldOptionId:0,fieldOption:"New York",fieldValue:"NY"}),occFieldStateArray.push({fieldOptionId:0,fieldOption:"North Carolina",fieldValue:"NC"}),occFieldStateArray.push({fieldOptionId:0,fieldOption:"North Dakota",fieldValue:"ND"}),occFieldStateArray.push({fieldOptionId:0,fieldOption:"Ohio",fieldValue:"OH"}),occFieldStateArray.push({fieldOptionId:0,fieldOption:"Oklahoma",fieldValue:"OK"}),occFieldStateArray.push({fieldOptionId:0,fieldOption:"Oregon",fieldValue:"OR"}),occFieldStateArray.push({fieldOptionId:0,fieldOption:"Pennsylvania",fieldValue:"PA"}),occFieldStateArray.push({fieldOptionId:0,fieldOption:"Rhode Island",fieldValue:"RI"}),occFieldStateArray.push({fieldOptionId:0,fieldOption:"South Carolina",fieldValue:"SC"}),occFieldStateArray.push({fieldOptionId:0,fieldOption:"South Dakota",fieldValue:"SD"}),occFieldStateArray.push({fieldOptionId:0,fieldOption:"Tennessee",fieldValue:"TN"}),occFieldStateArray.push({fieldOptionId:0,fieldOption:"Texas",fieldValue:"TX"}),occFieldStateArray.push({fieldOptionId:0,fieldOption:"Utah",fieldValue:"UT"}),occFieldStateArray.push({fieldOptionId:0,fieldOption:"Vermont",fieldValue:"VT"}),occFieldStateArray.push({fieldOptionId:0,fieldOption:"Virginia",fieldValue:"VA"}),occFieldStateArray.push({fieldOptionId:0,fieldOption:"Washington",fieldValue:"WA"}),occFieldStateArray.push({fieldOptionId:0,fieldOption:"West Virginia",fieldValue:"WV"}),occFieldStateArray.push({fieldOptionId:0,fieldOption:"Wisconsin",fieldValue:"WI"}
3),occFieldStateArray.push({fieldOptionId:0,fieldOption:"Wyoming",fieldValue:"WY"})),occFieldStateArray};var holdReloginAjax=[];function ocAjax(e){if(this.version="1.01.0003",this.onSuccess=e.onSuccess,this.onFailure=e.onFailure,this.jsonRequest=!0,this.jsonResponse=!0,this.allowRelogin=!!e.allowRelogin&&e.allowRelogin,this.checkOffline=!!e.checkOffline&&e.checkOffline,this.async=!0,this.headers=[],this.method="",this.formData=null,this.url="",this.showWaiting=!1!==e.showWaiting,this.data=null,this.cors=e.cors,this.fileReader={},this.files=[],this.curFile={},this.chunkSize=1*1024*1024,this.callBack=null,e.chunkSize&&e.chunkSize>0&&(this.chunkSize=1024*e.chunkSize*1024),"boolean"==typeof e.jsonRequest&&(this.jsonRequest=e.jsonRequest),"boolean"==typeof e.jsonResponse&&(this.jsonResponse=e.jsonResponse),"boolean"==typeof e.async&&(this.async=e.async),Array.isArray(e.headers))for(var t=0;t<e.headers.length;t++)"object"==typeof e.headers[t]&&null!==e.headers[t].name&&null!==e.headers[t].value&&this.headers.push({name:e.headers[t].name,value:e.headers[t].value})}function ocRelogin(e){if(null===occ.dlgReLogin){var t=occ.createElement("form",["occ-dlgReLogin-form"],[{name:"id",value:"dlgReLogin-form"}],null),o=occ.createElement("label",["occ-dlgReLogin-pass"],[{name:"for",value:"RePassword"}],"Password<span> - please enter a valid password</span>"),l=occ.createElement("input",["occ-dlgReLogin-pass"],[{name:"type",value:"password"},{name:"id",value:"RePassword"}]);t.appendChild(o),t.appendChild(l),t.appendChild(occ.createDiv("",["inValidErrorMsg"],[{name:"id",value:"dlgReLogin-form-msg"}])),occ.dlgReLogin=new ocDialog({id:"occ-dlgReLoginDiv-ctrl",content:t,title:"Authenticate",class:["occ-loginDlg","dlgsize-small"],onOpen:function(e){occ.addClass(document.body,"occ-loginDlg-isOpen")},onClose:function(e){occ.removeClass(document.body,"occ-loginDlg-isOpen")}})}var c=[{id:"occ-dlgReLoginDiv-loginBtn",content:"Login",onClick:ocRevalidate,align:"R"}];return occ.dlgReLogin.setButtons(c),occ.dlgReLogin.open(),holdReloginAjax.push(e),document.getElementById("RePassword").focus(),!0}function ocReloginCompleted(){holdReloginAjax.forEach(function(e){e.ajaxCall()}),occ.dlgReLogin.close(),holdReloginAjax.length=0,document.getElementById("RePassword").value="",document.getElementById("RePassword").blur(),document.getElementById("dlgReLogin-form-msg").innerHTML="Your session has timed out. Please enter your password to continue."}function ocRevalidate(e){var t=document.getElementById("RePassword").value.trim();if(0!==t.length){var o=new XMLHttpRequest;document.getElementById("dlgReLogin-form-msg").innerHTML="Authenticating...";let e="?md=auth&username=relogin&password="+encodeURIComponent(t);o.addEventListener("load",ocRevalidateCB,!1),o.open("POST","/api/auth",holdReloginAjax[0].async),o.setRequestHeader("Content-type","application/x-www-form-urlencoded"),o.send(e)}}function ocRevalidateCB(e){var t=e.currentTarget;t.removeEventListener("load",ocRevalidateCB,!1);var o=JSON.parse(t.responseText.trim());o.valid?ocReloginCompleted():"bad password"===o.message&&(document.getElementById("dlgReLogin-form-msg").innerHTML="The password you entered for this user is not valid.",document.getElementById("RePassword").focus(),document.getElementById("RePassword").select())}function ocOnLogout(){holdReloginXhr.length=0;var e=new XMLHttpRequest;e.addEventListener("load",ocOnLogoutCB,!1),e.open("POST","/api/auth",!0),e.setRequestHeader("Content-type","application/x-www-form-urlencoded"),e.setRequestHeader("x-bp-xhr","Y"),e.send("md=deauth")}function ocOnLogoutCB(e){e.currentTarget.removeEventListener("load",ocOnLogoutCB,!1),window.location.replace(window.location.href)}ocAjax.prototype.get=function(e,t){this.method="GET",this.url=e,this.data=t,this.jsonRequest=!1,this.ajaxCall()},ocAjax.prototype.post=function(e,t){this.method="POST",this.url=e,this.data=t,this.ajaxCall()},ocAjax.prototype.put=function(e,t){this.method="PUT",this.url=e,this.data=t,this.ajaxCall()},ocAjax.prototype.delete=function(e,t){this.method="DELETE",this.url=e,this.data=t,this.ajaxCall()},ocAjax.prototype.fileUpload=function(e,t,o,l,c){if(this.method="POST",this.url=e+"?",Array.isArray(c)&&1===c.length&&null!==c[0]&&0===c[0].fileId&&!1===occ.isNothingOrEmpty(c[0].eFileId)&&0!==c[0].eFileId.indexOf("-")&&(this.url+="ef="+encodeURIComponent(c[0].eFileId)),l&&Array.isArray(l)&&l.length>0){this.url+="&";for(let e=0;e<l.length;e++)this.url+=l[e]}if("string"==typeof t){this.files=document.getElementById(t+"-hp").files;let e=document.getElementById(t);!1===occ.isNullOrEmpty(e.parentElement.getAttribute("data-blobtype"))?o=e.parentElement.getAttribute("data-blobtype"):!1===occ.isNullOrEmpty(e.getAttribute("data-blobtype"))&&(o=e.getAttribute("data-blobtype"));let l=[];
3if("[null]"!=e.value&&!1===occ.isNullOrEmpty(e.value)){let t=JSON.parse(e.value),o=0;for(let e=0;e<t.length;e++)if(t[e].fileNo==o){let c={fileNo:t[e].fileNo};t[e].fileCaption?c.fileCaption=t[e].fileCaption:c.fileCaption="",t[e].fileOrder?c.fileOrder=t[e].fileOrder:c.fileOrder=0,l.push(c),o++}}this.fileData=l}else if(this.files=t,this.fileData=[],c&&null!==c&&!0===Array.isArray(c))for(let e=0;e<c.length;e++)if(null!==c[e])for(let t=0;t<this.files.length;t++)c[e].fileNo===t&&c[e].fileId<0&&this.fileData.push({fileId:c[e].fileId,fileOrder:c[e].fileOrder,fileCaption:c[e].fileCaption,fileNo:c[e].fileNo});this.respFiles=[],this.curFileNo=0,this.blobType=o,this.chunkDate=occ.formatDate(new Date,"yyyy-MM-dd-HH-mm-ssss"),this.chunkIndex=0,this.chunkCount=0,this.fileReader=new FileReader,this.jsonRequest=!0,this.jsonResponse=!0,this.fileUploadDone=this.onSuccess,null==this.chunkSize&&this.chunkSize,this.showWaiting=!1,occ.showWaiting(null,null,"Uploading "+this.files.length+" file(s)..."),this.fileCall(0)},ocAjax.prototype.resend=function(){this.ajaxCall()},ocAjax.prototype.fileCall=function(e){0===this.chunkCount&&(this.chunkCount=Math.ceil(this.files[this.curFileNo].size/this.chunkSize),this.chunkIndex=0),this.chunkIndex++;let t=e+this.chunkSize+1,o=this.files[this.curFileNo].slice(e,t),l=this;this.fileReader.onloadend=function(o){if(o.target.readyState!==FileReader.DONE)return;let c=null;for(let e=0;e<l.fileData.length;e++)l.fileData[e].fileNo===l.curFileNo&&(c=l.fileData[e]);l.data={chunkStr:o.target.result,fileName:l.files[l.curFileNo].name,chunkDate:l.chunkDate,chunkCount:l.chunkCount,chunkIndex:l.chunkIndex,blobType:l.blobType,fileOrder:null!==c?c.fileOrder:null,fileCaption:null!==c?c.fileCaption:null,fileId:l.files[l.curFileNo].fileId},l.onSuccess=function(o,l){if("ok"===o.status){var c=e+l.chunkSize,i=Math.floor(c/l.files[l.curFileNo].size*100);t<l.files[l.curFileNo].size?(occ.updateWaiting(null,l.files[l.curFileNo].name+" is "+i+"% done"),l.fileCall(t)):(occ.updateWaiting(null,l.files[l.curFileNo].name+" is done"),null===o.file?l.respFiles.push({error:!0,eFileId:null}):l.respFiles.push(o.file),l.chunkCount=0,l.files.length>l.curFileNo+1?(l.curFileNo++,l.chunkDate=occ.formatDate(new Date,"yyyy-MM-dd-HH-mm-ssss"),l.fileCall(0)):(occ.updateWaiting(null,"All File(s) are done"),l.fileUploadDone&&l.fileUploadDone(l.respFiles),occ.hideWaiting()))}},l.ajaxCall()},this.fileReader.readAsDataURL(o)},ocAjax.prototype.ajaxCall=function(){var e=this,t=e.url,o=null,l="",c="";if(c=e.jsonResponse?"json":"text",!0===e.jsonRequest&&e.data)l="application/json",e.data&&(o=JSON.stringify(e.data));else{if(l="application/x-www-form-urlencoded",o=e.data,null!==e.data&&"object"==typeof e.data){let t=e.data.entries;if(e.data.entries&&"function"==typeof t)e.formData=e.data,l=null;else for(var i in o="",e.data)o+="&"+i+"="+e.data[i]}"string"==typeof o&&(0!==o.indexOf("&")&&0!==o.indexOf("?")||(o=o.substr(1)),t+="?"+o),o=null}const a=new Headers;for(var n=0;n<e.headers.length;n++)a.append(e.headers[n].name,e.headers[n].value);"PUT"!==e.method&&"POST"!==e.method||!document.querySelector('input[name="__RequestVerificationToken"]')||a.append("RequestVerificationToken",document.querySelector('input[name="__RequestVerificationToken"]').value),!1===occ.isNullOrEmpty(l)&&a.append("Content-Type",l);var r={method:e.method,headers:a};null!==o&&(r.body=o),null!==e.formData&&(r.body=e.formData),e.cors&&null!==e.cors&&(r.cors=e.cors);const s=new Request(t,r);!0===e.showWaiting&&occ.showWaiting(2);var d=function(t,o){if(!0===e.showWaiting&&occ.hideWaiting(),e.res=t,t.ok)e.onSuccess&&e.onSuccess(o,e);else{if(400===t.StatusCode||400===t.status?console.log("400 error"):429!==t.StatusCode&&429!==t.status||(console.log("429 error - too many requests"),occ.msgDlg("Our Apologies","<h3>We're handling a lot of requests right now. Please try again in a moment.</3>")),401===t.StatusCode||401===t.status)if(!0===e.allowRelogin){if(ocRelogin(e))return}else t.error=!0,t.Error=!0,t.ErrorMessage="User Session is Timed out.";!0===e.showWaiting&&occ.hideWaiting(),e.onFailure&&e.onFailure(t.status,t.statusText,e)}},u=function(t){console.log(t),occ.hideWaiting(),e.onFailure&&e.onFailure(this.status,this.statusText,e)};e.res=null,"json"===c?fetch(s).then(e=>{!0!==e.ok?d(e,null):e.json().then(t=>{d(e,t)})}).catch(e=>{u(e)}):"text"===c&&fetch(s).then(e=>{!0!==e.ok?d(e,null):e.text().then(t=>{d(e,t)})}).catch(e=>{u(e)})}
3,ocCommon.prototype.processFileFields=function(e,t,o,l,c,i,a,n){let r=!1;if(!0===Array.isArray(e)&&e.length>0){let s=null,d=[];"function"==typeof o&&(s=function(e,t){let l=0;for(let o=0;o<d.length;o++)t==d[o].fieldId&&(d[o].done=!0,null!==e&&!0!==e.error||(d[o].error=!0),d[o].data=e),!0===d[o].done&&l++;l===d.length&&o(d)});for(let o=0;o<e.length;o++){let u=t;Array.isArray(u)&&u.length>o&&(u=t[o]),occ.processFileField(e[o],u,s,l,c,i,a,n)&&(!0!==l&&d.push({fieldId:e[o],done:!1,error:!1}),r=!0)}}return r},ocCommon.prototype.processFileField=function(e,t,o,l,c,i,a,n){let r=null,s=null;if(occ.isFieldVisible(e)&&occ.hasClassField(e,"dirty")){if(!1===occ.hasAnyClasses(e+"-ctrl",["filedirty","datadirty"]))return!1;if(occ.hasClassField(e,"ocpdfviewer")){if(occ.ocPDFDocArray.length>0){let t=1*document.getElementById(e).value;"number"==typeof t&&(r=occ.ocPDFDocArray[t].data,s=occ.ocPDFDocArray[t].files,occ.ocPDFDocArray[t].used=t)}}else"[]"!==document.getElementById(e).value&&'[""]'!==document.getElementById(e).value||(document.getElementById(e).value=""),r=occ.isNothingOrEmpty(document.getElementById(e).value)?"":JSON.parse(document.getElementById(e).value),s=document.getElementById(e+"-hp").files;if((occ.isNothingOrEmpty(s)||s.length<1)&&occ.isNothingOrEmpty(r))return!1;if(!0!==l){let l=document.getElementById(e).parentElement.getAttribute("data-eTenantId"),d=document.getElementById(e+"-ctrl").getAttribute("data-blobtype");!0===occ.isNullOrEmpty(d)&&(d=document.getElementById(e).getAttribute("data-blobtype")),occ.callFileAPI(s,r,d,t,o,e,l,c,i,a,n)}return!0}return!1},ocCommon.prototype.callFileAPI=function(e,t,o,l,c,i,a,n,r,s,d){if(null===e&&null===t)return;let u=new ocAjax({onSuccess:function(e){u.fieldId&&null!==u.fieldId&&(occ.removeClass(u.fieldId,"dirty"),occ.removeClass(u.fieldId+"-ctrl","dirty"));for(let e=0;e<occ.ocPDFDocArray.length;e++)occ.ocPDFDocArray[e].used===e&&(occ.ocPDFDocArray[e].fieldId=null,occ.ocPDFDocArray[e].data=null,occ.ocPDFDocArray[e].files=null);"function"==typeof u.callBack&&u.callBack(e,u.fieldId)},onFailure:function(e,t,o){"function"==typeof u.callBack&&u.callBack(null,u.fieldId),occ.hideWaiting(),console.log("occ.callFileAPI()  Error: "+e+"("+t+")")}});u.fieldId=i,u.callBack=c;let p=null,m="";if(n&&(m+="&dl="+n),r&&(m+="&it="+r),s&&(m+="&sr="+s),d&&(m+=(0===d.indexOf("&")?"":"&")+d),null!==t&&("string"==typeof t&&t.length>10||Array.isArray(t)&&t.length>0)&&null!==t[0]){u.jsonRequest=!0,u.jsonResponse=!1;for(let e=0;e<t.length;e++)1*t[e].eFileId<0&&(t[e].fileId=1*t[e].eFileId);u.post("/api/Blob/UploadFileData?ii="+encodeURIComponent(l)+"&b="+o+(0==occ.isNothingOrEmpty(a)?"&et="+encodeURIComponent(a):"")+m,t)}if(null!==e&&e.length>0){if(Array.isArray(t))for(let o=0;o<t.length;o++)if(null!==t[o])for(let l=0;l<e.length;l++)t[o].fileTitle===e[l].name&&1*t[o].eFileId<0&&(e[l].fileId=1*t[o].eFileId);p=["ii="+encodeURIComponent(l)+(0==occ.isNothingOrEmpty(a)?"&t="+encodeURIComponent(a):"")+m],u.fileUpload("/api/Blob/UploadFileChunk",e,o,p,t)}},ocCommon.prototype.serializeEvent=function(e){return{type:e.type,trusted:e.isTrusted,timestamp:Date.now(),eventTimestamp:e.timeStamp,clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY,screenX:e.screenX,screenY:e.screenY,movementX:e.movementX,movementY:e.movementY,button:e.button,buttons:e.buttons,detail:e.detail,altKey:e.altKey,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,metaKey:e.metaKey,target:{tagName:e.currentTarget?.tagName,id:e.currentTarget?.id,className:e.currentTarget?.className,name:e.currentTarget?.name,type:e.currentTarget?.type},url:location.href,path:location.pathname,referrer:document.referrer,viewportWidth:window.innerWidth,viewportHeight:window.innerHeight,sessionId:window.mySessionId}},ocCommon.prototype.cpe=function(e){if("string"!=typeof tfSite)return null;e=JSON.stringify(occ.serializeEvent(e));const t=JSON.stringify(e);return fetch("/api/public/pe",{method:"PUT",headers:{"Content-Type":"application/json; charset=utf-8"},body:t}).then(function(e){}).catch(function(e){})};var ocCalendars=[];function ocCalendar(e){let t;this.months=[{t:"January"},{t:"February"},{t:"March"},{t:"April"},{t:"May"},{t:"June"},{t:"July"},{t:"August"},{t:"September"},{t:"October"},{t:"November"},{t:"December"}],"string"==typeof e.input&&(e.input=document.getElementById(e.input));for(let o=0;o<ocCalendars.length;o++)ocCalendars[o].input===e.input&&(t=ocCalendars[o]);if(!e.input||t&&t.elem)return t;if(!1===occ.hasClass(e.input,"ocDateObj")){var o=e.input;if(!1===occ.hasClass(o.parentElement,"ocInputControl")?(occ.addClass(o,"ocDateControl-obj"),o.insertAdjacentHTML("afterend",'<div class="ocDateControl" id="'+e.input.id+'-ctrl"></div>')):occ.addClass(o.parentElement,"ocDateControl"),occ.hideObj(e.input),this.id=e.input.id,e.elem=d
3ocument.getElementById(o.id+"-ctrl"),e.elem||(e.elem=o.parentElement.querySelector("#"+o.id+"-ctrl")),e&&null!==e||(e={}),!0===e.alwaysOpen&&occ.addClass(e.elem,"alwaysOpen"),!0===e.dataView&&occ.addClass(e.elem,"dataView"),!0!==e.time&&(e.time=!1),!1!==e.offset&&(e.offset=!0),"number"!=typeof e.minIncrement&&(e.minIncrement=30),"boolean"==typeof e.range&&!1!==e.time||(e.range=!1),!0===e.range&&occ.addClass(e.elem,"range"),"boolean"!=typeof e.showDay&&(e.showDay=!0),"boolean"!=typeof e.showDayGrid&&(e.showDayGrid=!0),"boolean"!=typeof e.weeks&&(e.weeks=!0),"boolean"!=typeof e.weekDayOnly&&(e.weekDayOnly=!1),("string"!=typeof e.dispFormat||e.dispFormat.length<3)&&(e.dispFormat="mm/dd/yyyy",!0===e.time&&(!0===e.offset?e.dispFormat="mm/dd/yyyy h:mm a [z]":e.dispFormat="mm/dd/yyyy h:mm a")),"number"!=typeof e.minTime&&(e.minTime=700),"number"!=typeof e.maxTime&&(e.maxTime=2300),e.label&&null!==e.label&&""!==e.label&&e.elem.appendChild(occ.createElement("label",null,null,e.label)),!0!==e.alwaysOpen){var l=occ.ocButton(e.elem.id+"-dp","Select a Date"+(!0===e.time?"/Time":""),this.toggleDateControl.bind(this),"calendar sz3",null,["inLine","ocDateControl-dispButton"]);e.elem.appendChild(l);var c=occ.ocButton(e.elem.id+"-clr","",this.clearDateControl.bind(this),"x tr sz3",null,["clrButton","inLine"]);e.elem.appendChild(c),!1===occ.isNothingOrEmpty(e.input.getAttribute("tabindex"))&&(l.setAttribute("tabindex",e.input.getAttribute("tabindex")),e.input.removeAttribute("tabindex"))}var i=occ.createDiv("",["ocDateControl-calendar"]);!0!==e.alwaysOpen&&occ.hideObj(i);var a=occ.createDiv("",["ocDateControl-nav"]),n=occ.createDiv("",["ocDateControl-monav"]),r=occ.ocButton(e.elem.id+"-pm","",null,"arrow-left tr sz3",null);occ.addClickEvent(r,this.setDateMonthInternal.bind(this)),occ.addClass(r,"prevMo"),n.appendChild(r);for(var s=0;s<this.months.length;s++){var d=occ.createDiv(this.months[s].t+'<span class="yr"></span>',["ocNavMonth"],[{name:"data-mo",value:s+1}]);occ.addClickEvent(d,this.toggleWeeksDisplay.bind(this)),n.appendChild(d)}var u=occ.ocButton(e.elem.id+"-nm","",null,"arrow-right tr sz3",null);occ.addClickEvent(u,this.setDateMonthInternal.bind(this)),occ.addClass(u,"nextMo"),n.appendChild(u),a.appendChild(n);var p=occ.createDiv("",["ocDateControl-tdynav"]);!1===e.showDay&&occ.hideObj(p);var m=occ.ocButton(e.elem.id+"-pd","",null,"arrow-left tr sz3",null);occ.addClickEvent(m,this.setDateTDayInternal.bind(this)),occ.addClass(m,"prevDy"),p.appendChild(m);var h=occ.createDiv("",["ocTNavDay"],null);occ.addClickEvent(h,this.toggleWeeksDisplay.bind(this)),p.appendChild(h);var g=occ.ocButton(e.elem.id+"-nd","",null,"arrow-right tr sz3",null);occ.addClickEvent(g,this.setDateTDayInternal.bind(this)),occ.addClass(g,"nextDy"),p.appendChild(g),a.appendChild(p);var f=occ.createDiv("",["ocDateControl-yrnav"]);!1===e.showYear&&occ.hideObj(f);var y=occ.ocButton(e.elem.id+"-ny","",null,"arrow-right tr sz3",null);occ.addClickEvent(y,this.setDateYearInternal.bind(this)),occ.addClass(y,"nextYr");var C=occ.ocButton(e.elem.id+"-py","",null,"arrow-left tr sz3",null);occ.addClickEvent(C,this.setDateYearInternal.bind(this)),occ.addClass(C,"prevYr"),f.appendChild(C);var v=occ.createDiv((new Date).getFullYear(),["ocNavYear"]);for(occ.addClickEvent(v,this.toggleWeeksDisplay.bind(this)),f.appendChild(v),f.appendChild(y),a.appendChild(f),i.appendChild(a),(p=occ.createDiv("",["ocDateControl-dynav"])).appendChild(occ.createDiv("S<span>un</span>",["ocNavDay","label"],null)),p.appendChild(occ.createDiv("M<span>on</span>",["ocNavDay","label"],null)),p.appendChild(occ.createDiv("T<span>ues</span>",["ocNavDay","label"],null)),p.appendChild(occ.createDiv("W<span>eds</span>",["ocNavDay","label"],null)),p.appendChild(occ.createDiv("T<span>hurs</span>",["ocNavDay","label"],null)),p.appendChild(occ.createDiv("F<span>ri</span>",["ocNavDay","label"],null)),p.appendChild(occ.createDiv("S<span>at</span>",["ocNavDay","label"],null)),!1===e.showDayGrid&&(occ.hideObj(p),e.showDay),!1===e.showDay&&occ.addClass(p,"active"),s=0;s<31;s++){var b=occ.createDiv(s+1,["ocNavDay","dyItem","dy"+(s+1)],[{name:"data-day",value:s+1}]);0===s&&occ.addClass(b,"firstDay"),occ.addClickEvent(b,this.setDateDayInternal.bind(this)),p.appendChild(b)}if(p.appendChild(occ.createDiv("",["weekendCover","weekendCoverLeft","hiddenObj"],null)),p.appendChild(occ.createDiv("",["weekendCover","weekendCoverRight","hiddenObj"],null)),i.appendChild(p),!0===e.time){var E=occ.createDiv("",["ocDateControl-tmnav"]);!1===e.showYear&&!0===e.time&&e.minIncrement>30&&occ.hideObj(E);var A=occ.createDropDown(e.elem.id+"-time",[],["mini"],null,this.updateDateControl.bind(this));if(E.appendChild(A),!0===e.range){E.appendChild(occ.createDiv("&nbsp;-&nbsp;"));var O=occ.createDropDown(e.elem.id+"-etime",[],["mini"],null,this.updateDateControl.bind(this));E.appendChild(O)}i.appendChild(E)}if(!0!==e.alwaysOpen&&"function"==typeof e.doSave){var S=occ.ocButton(e.elem.id+"-sv","Save",e.doSave);occ.addClass(S,"saveButton"),e.elem.appendChild(S)}if(!1!==e.showToday){var I=occ.ocButton(e.elem.id+"-td","Go to Today",null,null,null);occ.addClickEvent(I,this.todayDateControl.bind(this)),occ.addClass(I,"tdButton"),i.appendChild(I)}if(!0!==e.alwaysOpen){var D=occ.ocButton(e.elem.id+"-dn","Done",null,"check gr-t",null);
3occ.addClickEvent(D,this.finishDateControl.bind(this)),"function"==typeof e.done&&occ.addClickEvent(D,e.done),occ.addClass(D,"doneButton"),i.appendChild(D);var F=occ.ocButton(e.elem.id+"-cn","Cancel",null,"x tr sz2",null);occ.addClickEvent(F,this.cancelDateControl.bind(this)),occ.addClass(F,"cancelButton"),i.appendChild(F)}e.elem.appendChild(i),e.elem.appendChild(occ.createDiv("",["inValidErrorMsg"])),occ.addClass(e.id,"ocDateObj")}else e.elem=document.getElementById(e.id+"-ctrl"),null===e.defaultValue&&(e.defaultValue=e.elem.getAttribute("data-defval"));var w=occ.isDate(e.defaultValue,!e.offset);if(!1!==w&&"now"!==e.defaultValue||(w=new Date),e.defaultValue=w,!0===e.time&&!0===e.offset&&e.elem.setAttribute("data-tz",w.getTimezoneOffset()),e.elem.setAttribute("data-defval",e.defaultValue),this.currentValue=occ.isDate(e.currentValue,!e.offset),this.currentEValue=occ.isDate(e.currentEValue,!e.offset),this.defaultValue=e.defaultValue,this.container=e.container,this.input=e.input,this.elem=e.elem,this.time=e.time,this.offset=e.offset,this.range=e.range,this.weeks=e.weeks,this.weekDayOnly=e.weekDayOnly,occ.toggleObj(this.elem.querySelectorAll("div.weekendCover"),this.weekDayOnly),this.dispFormat=e.dispFormat,this.alwaysOpen=e.alwaysOpen,this.showDay=e.showDay,this.showDayGrid=e.showDayGrid,this.showToday=e.showToday,this.showYear=e.showYear,this.minDate=e.minDate,this.maxDate=e.maxDate,this.minTime=e.minTime,this.maxTime=e.maxTime,this.minIncrement=e.minIncrement,this.onChange=e.onChange,this.parentOnChange=e.parentOnChange,this.dataView=e.dataView,!1===this.showDay&&(this.weeks=!0),this.toggleWeeksDisplay(null,!0===this.weeks?1:0),this.clickActive=!1,this.clickMoActive=!1,!0===this.time&&this.setTimeOptions(),""===this.input.value&&!1!==this.currentValue){let e="sql";!0!==this.time&&!1===this.range&&(e="sqlnotime"),!0===this.range&&(null!==this.currentValue.start||this.currentValue.indexOf("{")>-1)?this.setDate(this.currentValue):(this.input.value=occ.formatDate(this.currentValue,e,!this.offset),this.setDate(this.input.value))}this.setDateControlInternal(),ocCalendars.push(this),ocCalendarResize()}ocCommon.prototype.initOCCalendar=function(e,t){let o=occ.getElementFromString(e);if(!o||!o.parentElement)return;let l=o.parentElement;if(!1===occ.hasClass(l,"ocCalendar")){var c={input:e};return c.parentOnChange=t,c.currentValue=!0===occ.isNullOrEmpty(l.getAttribute("data-cv"))?null:l.getAttribute("data-cv"),occ.isNothingOrEmpty(c.currentValue)&&(c.currentValue=!0===occ.isNullOrEmpty(o.getAttribute("data-val"))?null:o.getAttribute("data-val")),!1===occ.isNothingOrEmpty(c.currentValue)&&(c.currentValue.indexOf("{")>-1?c.currentValue=JSON.parse(c.currentValue):c.currentValue=occ.isDate(c.currentValue,!this.offset)),c.defaultValue=!0===occ.isNullOrEmpty(l.getAttribute("data-defval"))?null:l.getAttribute("data-defval"),c.container=l.getAttribute("data-container"),c.time="true"===l.getAttribute("data-time"),c.offset="false"!=l.getAttribute("data-offset")&&!1!==c.time,c.minIncrement=occ.isNullOrEmpty(l.getAttribute("data-minIncrement"))?null:1*l.getAttribute("data-minIncrement"),null!==c.minIncrement&&""!=c.minIncrement||(c.minIncrement=1),c.alwaysOpen="true"===l.getAttribute("data-alwaysOpen"),c.showYear="false"!==l.getAttribute("data-showYear"),c.showDay="false"!==l.getAttribute("data-showDay"),c.showDayGrid="false"!==l.getAttribute("data-showDayGrid"),c.showToday="false"!==l.getAttribute("data-showToday"),c.range="true"===l.getAttribute("data-range"),!0===c.range&&(c.time=!0),c.dispFormat=!1===occ.isNullOrEmpty(l.getAttribute("data-dispFormat"))?l.getAttribute("data-dispFormat"):null,("string"!=typeof c.dispFormat||c.dispFormat.length<3)&&(c.dispFormat="mm/dd/yyyy",!0===c.time&&(!0===c.offset?c.dispFormat="mm/dd/yyyy h:mm a [z]":c.dispFormat="mm/dd/yyyy h:mm a")),c.weeks="false"!==l.getAttribute("data-weeks"),c.weekDayOnly="true"===l.getAttribute("data-weekDayOnly"),c.minDate=!1===occ.isNullOrEmpty(l.getAttribute("data-minDate"))?occ.isDate(l.getAttribute("data-minDate"),!this.offset):null,c.maxDate=!1===occ.isNullOrEmpty(l.getAttribute("data-maxDate"))?occ.isDate(l.getAttribute("data-maxDate"),!this.offset):null,c.minTime=!1===occ.isNullOrEmpty(l.getAttribute("data-minTime"))?1*l.getAttribute("data-minTime"):700,c.maxTime=!1===occ.isNullOrEmpty(l.getAttribute("data-maxTime"))?1*l.getAttribute("data-maxTime"):2300,new ocCalendar(c)}},ocCalendar.prototype.setTimeOptions=function(){let e=[],t=this.minTime,o=1*this.maxTime,l=1*t;for(;
3l<o+1;){var c="AM";let t=(l<100?"0":"")+l,o=1*t.substring(0,l<1e3?1:2);o>11&&l<2400&&(c="PM"),o>12&&(o-=12),0===o&&(o=12);let i=1*t.substring(l<1e3?1:2);if(i<60){i=(i<10?"0":"")+i;let t=(o<10?"0":"")+o+":"+i+" "+c;"12:00 AM"===t&&(t="00:00 AM");let a={name:o+":"+i+" "+c,value:t};e.push(a),l+=this.minIncrement}else l+=40}occ.createDropDown(this.elem.id+"-time",e),!0===this.range&&occ.createDropDown(this.elem.id+"-etime",e)},ocCalendar.prototype.setDateControlInternal=function(){this.elem.setAttribute("data-val","");var e=this.elem.querySelector("button.ocDateControl-dispButton > span");e&&(e.innerHTML="Select a Date"+(this.elem.querySelector("div.ocDateControl-tmnav")?"/Time":""));var t=this.currentValue;let o;null===t||!1===t?(o=!0,t=occ.isDate(this.defaultValue,!this.offset)):e&&(e.innerHTML=occ.formatDate(t,this.dispFormat,!this.offset));let l=1*(this.minTime+"").substring(0,this.minTime<1e3?1:2),c=1*(this.minTime+"").substring(this.minTime<1e3?1:2),i=1*(this.maxTime+"").substring(0,this.maxTime<1e3?1:2),a=1*(this.maxTime+"").substring(this.maxTime<1e3?1:2);if(1*(t.getHours()+(t.getMinutes()<10?"0":"")+t.getMinutes())<this.minTime&&(t.setHours(l),t.getMinutes()<c&&t.setMinutes(c)),1*(t.getHours()+(t.getMinutes()<10?"0":"")+t.getMinutes())>this.maxTime&&(t.setHours(i),t.getMinutes()>a&&t.setMinutes(a)),!1!==t){let e="sql";if(!0!==this.time&&!1===this.range&&(e="sqlnotime"),this.elem.querySelector("div.ocDateControl-monav").setAttribute("data-cv",t.getMonth()+1),occ.removeClass(this.elem.querySelectorAll("div.ocNavMonth.active"),"active"),occ.addClass(this.elem.querySelector('div.ocNavMonth[data-mo="'+(t.getMonth()+1)+'"]'),"active"),!1===this.showYear&&!1===this.showDay){let e=this.elem.querySelector("div.ocNavMonth.active > span.yr");e&&(e.innerHTML=" "+t.getFullYear())}if(this.elem.querySelector("div.ocDateControl-yrnav").setAttribute("data-cv",t.getFullYear()),this.elem.querySelector("div.ocNavYear").innerHTML=t.getFullYear(),this.elem.querySelector("div.ocDateControl-dynav").setAttribute("data-cv",t.getDate()),!0===this.time){if(this.minIncrement>1){let e=Math.round(t.getMinutes()/this.minIncrement)*this.minIncrement;t.setMinutes(e)}let e=t.getHours()-(t.getHours()>12?12:0),o=(t.getMinutes()<10?"0":"")+t.getMinutes();occ.setDropDown(this.elem.id+"-time",(e<10?"0":"")+e+":"+o+" "+(t.getHours()>11?"PM":"AM"))}if(!1===this.range&&this.updateDateControl(o),null!==this.currentValue&&!1!==this.currentValue&&(null!==this.minDate&&!1!==this.minDate||occ.hasClass(this.elem,"preventOld"))){let e=!1===this.minDate?new Date:this.minDate;e.getMonth()===this.currentValue.getMonth()&&e.getFullYear()===this.currentValue.getFullYear()?occ.hideObj(this.elem.id+"-pm",!0):occ.showObj(this.elem.id+"-pm"),this.showYear?e.getFullYear()===this.currentValue.getFullYear()||e.getMonth()>this.currentValue.getMonth()&&e.getFullYear()+1===this.currentValue.getFullYear()?occ.hideObj(this.elem.id+"-py",!0):occ.showObj(this.elem.id+"-py"):!1===this.minDate&&occ.hasClass(this.elem,"preventedOld")&&(occ.showObj(this.elem.id+"-pm"),occ.showObj(this.elem.id+"-py"))}}if(!0===this.range){var n=occ.isDate(this.currentEValue,!this.offset);if(!1===n?(o=!0,(n=occ.isDate(this.defaultValue,!this.offset)).getHours()+1<=this.maxTime&&n.setHours(n.getHours()+1)):e&&(e.innerHTML=occ.formatDate(t,this.dispFormat,!this.offset)+" - "+occ.formatDate(n,"h:mm a"+(this.offset?" [z]":""),!this.offset)),!1!==n){if(1*(n.getHours()+(n.getMinutes()<10?"0":"")+n.getMinutes())<this.minTime&&(n.setHours(l),n.getMinutes()<c&&n.setMinutes(c)),1*(n.getHours()+(n.getMinutes()<10?"0":"")+n.getMinutes())>this.maxTime&&(n.setHours(i),n.getMinutes()>a&&n.setMinutes(a)),this.minIncrement>1){let e=Math.round(n.getMinutes()/this.minIncrement)*this.minIncrement;n.setMinutes(e)}let e=n.getHours()-(n.getHours()>12?12:0),t=(n.getMinutes()<10?"0":"")+n.getMinutes();occ.setDropDown(this.elem.id+"-etime",(e<10?"0":"")+e+":"+t+" "+(n.getHours()>11?"PM":"AM")),this.updateDateControl(o)}}""!==this.elem.getAttribute("data-val")?occ.addClass(this.elem,"hasValue"):occ.removeClass(this.elem,"hasValue")},ocCalendar.prototype.destroyDateCtrl=function(){let e,t;for(let o=0;o<ocCalendars.length;o++)ocCalendars[o].input===config.input&&(e=ocCalendars[o],t=o);e.input&&(document.getElementById(e.elem.id).remove(),occ.removeClass(e.input,"ocDateObj"),ocCalendars.splice(t))},ocCommon.prototype.dateObjConfig=function(e,t,o){let l,c=document.getElementById(e),i=!1;for(let e=0;e<ocCalendars.length;e++)ocCalendars[e].input===c&&(l=ocCalendars[e],i=!0);if(i)switch(!0!==o&&"true"!=o||(o=!0),t){case"minIncrement":l.minIncrement=1*o,l.setTimeOptions();break;case"minTime":l.minTime=1*o,l.setTimeOptions();break;case"maxTime":l.maxTime=1*o,l.setTimeOptions();break;case"weeks":l.weeks=!0===o,l.toggleWeeksDisplay(null,!0===l.weeks?1:0);break;case"weekDayOnly":l.weekDayOnly=!0===o,occ.toggleObj(this.elem.querySelectorAll("div.weekendCover"),l.weekDayOnly);break;case"alwaysOpen":l.alwaysOpen=!0===o,occ.toggleClass(l.elem,"alwaysOpen",l.alwaysOpen?1:0);break;case"defaultValue":let e=occ.isDate(o,!this.offset);!1!==e&&(l.defaultValue=e,l.elem.setAttribute("data-defval",o))}},ocCommon.prototype.openDateObj=function(e){let t,o=occ.getElementFromString(e),l=!1;for(let e=0;e<ocCalendars.length;e++)ocCalendars[e].input===o&&(t=ocCalendars[e],l=!0);l&&(t.toggleDateControl(1),occ.resetOcFieldSelect(null))},ocCommon.prototype.setDateObj=function(e,t,o){let l,c=occ.getElementFromString(e),i=!1;for(let e=0;e<ocCalendars.length;e++)ocCalendars[e].input===c&&(l=ocCalendars[e],i=!0);i?!0===occ.hasClass(this.elem,"clearValue")?l.clearDateControl(null,o):(l.cancelDateControl(),l.setDate(t,o)):(!0!==o&&c.setAttribute("data-cv","object"==typeof t?occ.formatDate(t,"js"):t),c.setAttribute("data-val","object"==typeof t?occ.formatDate(t,"js"):t))},ocCalendar.prototype.setDate=function(e,t){if(!1===occ.hasClass(this.elem,"clearValue")){let l=null;var o=occ.isDate(e,!this.offset);if(!0===this.range){let t;t=e&&null!==e&&e.end?e:!0===occ.isNullOrEmpty(e)?{start:null,end:null}:JSON.parse(e),o=occ.isDate(t.start,!this.offset),l=occ.isDate(t.end,!this.offset)}!1===occ.isNullOrEmpty(this.input.getAttribute("data-minDate"))&&(this.minDate=occ.isDate(this.input.getAttribute("data-minDate"),!this.offset)),!1===occ.isNullOrEmpty(this.input.getAttribute("data-maxDate"))&&(this.maxDate=occ.isDate(this.input.getAttribute("data-maxDate"),!this.offset)),!1===occ.isNullOrEmpty(this.input.getAttribute("data-minTime"))&&(this.minTime=this.input.getAttribute("data-minTime")),!1===occ.isNullOrEmpty(this.input.getAttribute("data-maxTime"))&&(this.maxTime=this.input.getAttribute("data-maxTime")),"false"===this.input.getAttribute("data-offset")?this.offset=!1:void 0===this.offset&&(this.offset=!0);let c=this.elem.querySelector("label > span");if(c){if(null!==this.minDate&&!1!==this.minDate){c.querySelector("span.minDate")||c.appendChild(occ.createElement("span",["minDate"]));let e=occ.formatDate(this.minDate,this.dispFormat,!this.offset);c.querySelector("span.minDate").innerText=", the date selected must be after "+e}else c.querySelector("span.minDate")&&(c.querySelector("span.minDate").innerText="");if(null!==this.maxDate&&!1!==this.maxDate){c.querySelector("span.maxDate")||c.appendChild(occ.createElement("span",["maxDate"]));let e=occ.formatDate(this.maxDate,this.dispFormat,!this.offset);c.querySelector("span.maxDate").innerText=", the date selected must be before "+e}else c.querySelector("span.maxDate")&&(c.querySelector("span.maxDate").innerText="")}this.currentValue=null;let i="sql";!0!==this.time&&!1===this.range&&(i="sqlnotime"),!1!==o&&null===l&&(this.currentValue=o,this.defaultValue=o,!0===this.offset&&this.elem.setAttribute("data-tz",o.getTimezoneOffset()),!0!==t&&(this.elem.setAttribute("data-cv",occ.formatDate(o,i,!this.offset)),this.input.setAttribute("data-cv",occ.formatDate(o,i,!this.offset)),this.elem.setAttribute("data-defval",occ.formatDate(o,i,!this.offset)))),!1!==o&&null!==l&&!1!==l&&(this.currentValue=o,this.defaultValue=o,this.currentEValue=l,!0===this.offset&&this.elem.setAttribute("data-tz",o.getTimezoneOffset()),e='{"start":"'+occ.formatDate(o,i,!this.offset)+'","end":"'+occ.formatDate(l,i,!this.offset)+'"}',!0!==t&&(this.elem.setAttribute("data-cv",e),this.input.setAttribute("data-cv",e),this.elem.setAttribute("data-defval",e)))}else this.input.value="",this.currentValue=null,this.currentEValue=null,!0!==t&&(this.elem.setAttribute("data-cv",""),this.input.setAttribute("data-cv",""));occ.removeClass(this.elem,"used"),this.setDateControlInternal()},ocCalendar.prototype.toggleDateControl=function(e){var t=document.querySelectorAll("div.ocDateControl-calendar");if(null!==e)for(var o=0;o<t.length;o++)!0===occ.isVisible(t[o])&&(t[o].parentElement.querySelector(".ocDateControl-dispButton")&&occ.disableControl(t[o].parentElement.querySelector(".ocDateControl-dispButton"),!1),!1===occ.hasClass(t[o].parentElement,"alwaysOpen")&&(occ.hideObj(t[o]),occ.removeClass(t[o].parentElement,"active")));var l=this.elem.querySelector(".ocDateControl-calendar");if(!0!==occ.hasClass(l.parentElement,"disabled")&&(null!==e&&(occ.toggleObj(l),this.toggleWeeksDisplay(1,!0===this.weeks?1:0)),l.style.left="auto",l.style.bottom="-4px",!0===occ.isVisible(l))){null!==e&&(occ.disableControl(e.currentTarget,!0),occ.addClass(this.elem,"active"));var c=this.elem.querySelector(".ocDateControl-dispButton");c&&(l.style.left=c.offsetLeft-13+"px");let t=295;if(!0===this.time&&(t=330),l.parentElement.offsetTop<t&&(!0===occ.hasClass(this.elem.querySelector("div.ocDateControl-dynav"),"active")?l.style.bottom=l.parentElement.offsetTop-(t-40)+"px":l.parentElement.offsetTop<85&&(l.style.bottom=l.parentElement.offsetTop-85+"px")),l.parentElement.parentElement.clientWidth<375)occ.addClass(l.parentElement,"small"),l.style.left="-6px";else if(occ.removeClass(l.parentElement,"small"),(!0===occ.hasClass(l.parentElement,"col-2")||!0===occ.hasClass(l.parentElement,"col-3")||!0===occ.hasClass(l.parentElement,"col-4")||!0===occ.hasClass(l.parentElement,"col-5"))&&l.parentElement.offsetLeft>30&&l.clientWidth>l.parentElement.clientWidth){let e=l.parentElement.clientWidth-l.clientWidth;l.style.left=e<0?e+10+"px":""}}},ocCalendar.prototype.toggleWeeksDisplay=function(e,t){occ.toggleClass(this.elem.querySelector("div.ocDateControl-dynav"),"active",t),!1===occ.hasClass(this.elem,"alwaysOpen")&&1!==e&&this.toggleDateControl(null)},ocCalendar.prototype.todayDateControl=function(e){var t=e.currentTarget.parentElement.parentElement;this.clickActive=!0,this.setDateYearInternal(e,t.id),this.setDateMonthInternal(t.id),this.setDateDayInternal("div.ocNavDay.dy"+(new Date).getDate()),this.updateDateControl(),this.clickActive=!1},ocCalendar.prototype.clearDateControl=function(e,t){occ.addClass(this.elem,"clearValue"),this.setDate("","boolean"!=typeof t||t),this.input.value="",occ.removeClasses(this.elem,["hasValue","complete","
3incomplete","dirty","clearValue","invalid"]),occ.removeClasses(this.input,["hasValue","complete","incomplete","dirty","clearValue","invalid"]),!0===occ.hasClass(this.elem,"required")&&(occ.addClasses(this.elem,["incomplete","invalid"]),occ.addClasses(this.input,["incomplete","invalid"])),this.elem.getAttribute("data-cv")!==this.elem.getAttribute("data-val")&&(occ.addClass(this.elem,"dirty"),occ.addClass(this.input,"dirty")),this.onChange?this.onChange(this.elem.getAttribute("data-val")):occ.triggerEvent(this.elem,"change"),this.parentOnChange&&this.parentOnChange(this.input)},ocCalendar.prototype.cancelDateControl=function(e){var t=this.elem.querySelector(".cancelButton"),o=this.elem;!0===this.range?this.input.value=o.getAttribute("data-cv"):this.input.value=occ.formatDate(o.getAttribute("data-cv"),"sql",!this.offset),t&&occ.hideObj(t.parentElement),occ.removeClasses(o,["active","hasValue"]),this.toggleWeeksDisplay(1,0),occ.disableControl(o.querySelector(".ocDateControl-dispButton"),!1),""!==o.getAttribute("data-val")&&occ.addClass(o,"hasValue");let l=o.querySelectorAll("div.select.open");for(let e=0;e<l.length;e++)occ.resetOcFieldSelect(l[e])}
3,ocCalendar.prototype.finishDateControl=function(e){var t=e&&null!==e?e.currentTarget:null;e&&null!==e&&this.updateDateControl();var o=this.elem.querySelector("button.ocDateControl-dispButton > span");if(o){if(occ.disableControl(o.parentElement,!1),!1===this.range)o.innerHTML=occ.formatDate(this.elem.getAttribute("data-val"),"mm/dd/yyyy"),!0===this.time&&(o.innerHTML=occ.formatDate(this.elem.getAttribute("data-val"),this.dispFormat,!this.offset));else{let e=JSON.parse(this.elem.getAttribute("data-val")),t=occ.isDate(e.start,!this.offset),l=occ.isDate(e.end,!this.offset),c="h:mm a [z]";!0!==this.offset&&(c="h:mm a"),o.innerHTML=occ.formatDate(t,this.dispFormat,!this.offset)+" - "+occ.formatDate(l,c,!this.offset)}this.input.setAttribute("data-display",o.innerHTML)}if(this.elem.getAttribute("data-cv")!==this.elem.getAttribute("data-val")?(occ.addClass(this.elem,"dirty"),occ.addClass(this.input,"dirty"),occ.addClass(this.elem,"used")):(occ.removeClass(this.elem,"dirty"),occ.removeClass(this.input,"dirty")),""!==this.elem.getAttribute("data-val")?occ.addClass(this.elem,"hasValue"):occ.removeClass(this.elem,"hasValue"),null!==this.minDate&&!1!==this.minDate){let e=occ.isDate(this.elem.getAttribute("data-val"),!this.offset);!1!==e&&(e<this.minDate?occ.addClass(this.elem,"invalid"):occ.removeClass(this.elem,"invalid"))}if(null!==this.maxDate&&!1!==this.maxDate){let e=occ.isDate(this.elem.getAttribute("data-val"),!this.offset);!1!==e&&(e<this.maxDate?occ.addClass(this.elem,"invalid"):occ.removeClass(this.elem,"invalid"))}if(null!=t){let e=t.parentElement.querySelectorAll("div.select.open");for(let t=0;t<e.length;t++)occ.resetOcFieldSelect(e[t]);occ.toggleObj(t.parentElement),occ.removeClass(this.elem,"active"),this.toggleWeeksDisplay(1,0)}this.onChange&&(occ.hasClass(this.elem,"dirty")||occ.hasClass(this.elem,"used"))&&this.onChange(this.elem.getAttribute("data-val")),(occ.hasClass(this.elem,"dirty")||occ.hasClass(this.elem,"used")||1==this.alwaysOpen)&&(this.parentOnChange?this.parentOnChange(this.input):occ.triggerEvent(this.input.parentElement,"change"))},ocCalendar.prototype.setDateYearInternal=function(e,t){var o=e.currentTarget,l=0;t&&null!==t&&(1===t&&(o=o.parentElement.parentElement.querySelector(".ocDateControl-yrnav .nextYr")),-1===t&&(o=o.parentElement.parentElement.querySelector(".ocDateControl-yrnav .prevYr")),"string"==typeof t&&(o=document.getElementById(t).querySelector("div.ocNavYear"),t=100,l=(new Date).getFullYear()));var c=o.parentElement;if(100!==t&&(!0===occ.hasClass(o,"nextYr")&&(l=1*c.getAttribute("data-cv")+1),!0===occ.hasClass(o,"prevYr")&&(l=1*c.getAttribute("data-cv")-1)),c.querySelector("div.ocNavYear").innerHTML=l,c.setAttribute("data-cv",l),this.clearCalendarViewData(e),!1===this.clickActive&&!1===this.clickMoActive&&this.updateDateControl(),null!==this.currentValue&&!1!==this.currentValue&&null!==this.minDate&&!1!==this.minDate||occ.hasClass(this.elem,"preventOld")){let e=0==this.minDate?new Date:this.minDate;e.getMonth()===this.currentValue.getMonth()&&e.getFullYear()===this.currentValue.getFullYear()?occ.hideObj(this.elem.id+"-pm",!0):occ.showObj(this.elem.id+"-pm"),this.showYear?e.getFullYear()===this.currentValue.getFullYear()||e.getMonth()>this.currentValue.getMonth()&&e.getFullYear()+1===this.currentValue.getFullYear()?occ.hideObj(this.elem.id+"-py",!0):occ.showObj(this.elem.id+"-py"):!1===this.minDate&&occ.hasClass(this.elem,"preventedOld")&&(occ.showObj(this.elem.id+"-pm"),occ.showObj(this.elem.id+"-py"))}},ocCalendar.prototype.setDateMonthInternal=function(e){var t,o="";"string"==typeof e?(o=(new Date).getMonth()+1,t=document.getElementById(e).querySelector("div.ocNavMonth")):t=e.currentTarget;var l=this.elem.querySelector(".ocNavMonth.active");if("string"!=typeof e&&(!0!==occ.hasClass(t,"nextMo")&&!0!==occ.hasClass(t,"nextDy")||(o=1*l.getAttribute("data-mo")+1),!0!==occ.hasClass(t,"prevMo")&&!0!==occ.hasClass(t,"prevDy")||(o=1*l.getAttribute("data-mo")-1),this.clickMoActive=!0,o>12&&(o=1,this.setDateYearInternal(e,1)),o<1&&(o=12,this.setDateYearInternal(e,-1)),this.clickMoActive=!1),occ.removeClass(this.elem.querySelectorAll("div.ocNavMonth.active"),"active"),occ.addClass(this.elem.querySelector('div.ocNavMonth[data-mo="'+o+'"]'),"active"),!1===this.showYear&&!1===this.showDay){let e=t.parentElement.parentElement.querySelector("div.ocNavMonth.active > span.yr");e&&(e.innerHTML=" "+t.parentElement.parentElement.querySelector("div.ocNavYear").innerHTML)}if(this.elem.querySelector("div.ocDateControl-monav").setAttribute("data-cv",o),this.clearCalendarViewData(e),!1===this.clickActive&&this.updateDateControl(),null!==this.currentValue&&!1!==this.currentValue&&(null!==this.minDate&&!1!==this.minDate||occ.hasClass(this.elem,"preventOld"))){let e=!1===this.minDate?new Date:this.minDate;e.getMonth()===this.currentValue.getMonth()&&e.getFullYear()===this.currentValue.getFullYear()?occ.hideObj(this.elem.id+"-pm"):occ.showObj(this.elem.id+"-pm"),this.showYear?e.getFullYear()===this.currentValue.getFullYear()||e.getMonth()>this.currentValue.getMonth()&&e.getFullYear()+1===this.currentValue.getFullYear()?occ.hideObj(this.elem.id+"-py",!0):occ.showObj(this.elem.id+"-py"):!1===this.minDate&&occ.hasClass(this.elem,"preventedOld")&&(occ.showObj(this.elem.id+"-pm"),occ.showObj(this.elem.id+"-py"))}},ocCalendar.prototype.setDateTDayInternal=function(e,t){var o=e.currentTarget;t&&null!==t&&(1===t&&(o=o.parentElement.parentElement.querySelector(".ocDateControl-tdynav .nextDy")),-1===t&&(o=o.parentElement.parentElement.querySelector(".ocDateControl-tdynav .prevDy")));var l=1*this.elem.querySelector("div.ocNavDay.active").getAttribute("data-day"),
3c=this.getMonthDays();!0===occ.hasClass(o,"prevDy")&&(l-=1),!0===occ.hasClass(o,"nextDy")&&(l+=1),this.clickActive=!0,l>c[1]&&(l=1,this.setDateMonthInternal(e)),l<1&&(l=c[0],this.setDateMonthInternal(e)),this.setDateDayInternal("div.ocNavDay.dy"+l),this.clickActive=!1,this.updateDateControl()},ocCalendar.prototype.setDateDayInternal=function(e){var t;(t="string"==typeof e?this.elem.querySelector(e):e.currentTarget)&&(occ.removeClass(t.parentElement.querySelectorAll(".active"),"active"),occ.addClass(t,"active"),t.parentElement.setAttribute("data-cv",t.getAttribute("data-day")),"string"!=typeof e&&this.updateDateControl())},ocCalendar.prototype.updateDateControl=function(e){var t=this.elem,o=!1;if(e&&!0!==occ.hasClass(e.currentTarget,"select"))try{e.preventDefault(),e.stopPropagation()}catch(e){}else o=!0;if(!t)return;!1===occ.hasClass(t,"ocDateControl")&&(t=occ.getNearest(t,"ocDateControl",!0)),occ.removeClasses(this.input,["dirty","invalid","hasValue","complete","incomplete"]),occ.removeClasses(this.elem,["dirty","invalid","hasValue","complete","incomplete"]);var l="",c=t.querySelector(".ocDateControl-monav"),i=t.querySelector(".ocDateControl-yrnav"),a=t.querySelector(".ocDateControl-tdynav"),n=t.querySelector(".ocDateControl-dynav"),r=t.querySelector(".ocDateControl-tmnav"),s=1*n.getAttribute("data-cv"),d=31;if("2"===c.getAttribute("data-cv")){d=28;var u=1*i.getAttribute("data-cv");(0==u%4&&0!=u%100||0==u%400)&&(d=29)}"4"!==c.getAttribute("data-cv")&&"6"!==c.getAttribute("data-cv")&&"9"!==c.getAttribute("data-cv")&&"11"!==c.getAttribute("data-cv")||(d=30),d<31?occ.hideObj(n.querySelector("div.dy31")):occ.showObj(n.querySelector("div.dy31")),d<30?occ.hideObj(n.querySelector("div.dy30")):occ.showObj(n.querySelector("div.dy30")),d<29?occ.hideObj(n.querySelector("div.dy29")):occ.showObj(n.querySelector("div.dy29"));var p=new Date(c.getAttribute("data-cv")+"/01/"+i.getAttribute("data-cv"));occ.removeClasses(n.querySelector("div.ocNavDay.firstDay"),["offset0","offset1","offset2","offset3","offset4","offset5","offset6"]);let m=p.getDay();occ.addClass(n.querySelector("div.ocNavDay.firstDay"),"offset"+m),s>d&&(s=d,this.setDateDayInternal("div.ocNavDay.dy"+s));let h=n.querySelectorAll("div.ocNavDay.dyItem"),g=m+1,f=1;for(let e=0;e<h.length;e++)8===g&&(g=1,f++),g++,occ.removeClasses(h[e],["wk1","wk2","wk3","wk4","wk5","wk6"]),occ.addClass(h[e],"wk"+f);occ.removeClass(n.querySelectorAll("div.ocNavDay"),"active"),occ.addClass(n.querySelector("div.dy"+s),"active"),a.querySelector("div.ocTNavDay").innerText=s;let y={start:l+=c.getAttribute("data-cv")+"/"+n.getAttribute("data-cv")+"/"+i.getAttribute("data-cv"),end:null},C=l;if(r){if(l+=" "+document.getElementById(t.id+"-time").value+(!0===this.offset?" -0"+t.getAttribute("data-tz")/60:""),y.start=l,!0===this.range){let e=document.getElementById(t.id+"-etime");y.end=C+" "+e.value+(!0===this.offset?" -0"+t.getAttribute("data-tz")/60:"")}}if(!1===occ.hasClass(t,"clearValue")){var v=occ.isDate(y.start,!this.offset),b=occ.isDate(y.end,!this.offset);if(!1===v||null!=y.end&&!1===b||!1!==b&&v>b){occ.addClasses(t,["invalid","incomplete"]),occ.addClasses(t.parentElement,["invalid","incomplete"]);var E=occ.checkDate(y.start,!this.offset);"Ok"===E&&!1===b&&(v=y.start,E=occ.checkDate(y.end,!this.offset)),"Ok"===E&&!1!==b&&v>b?(b=y.end,t.querySelector("div.inValidErrorMsg").innerHTML="Start time must be before the end time"):"Ok"!==E&&(t.querySelector("div.inValidErrorMsg").innerHTML=E)}else!0===occ.hasClass(t,"required")&&occ.addClass(t,"complete");!0===o?!0===this.range?(y.start=occ.formatDate(v,"sql",!this.offset),y.end=occ.formatDate(b,"sql",!this.offset),this.input.value=JSON.stringify(y)):(!1===this.showDayGrid&&!1===this.showDay&&v.setDate(1),this.input.value=occ.formatDate(v,"sql",!this.offset)):this.input.value="",t.setAttribute("data-val",this.input.value),this.currentValue=v,this.currentEValue=b,occ.removeClass(t.querySelector("div.ocNavDay.today"),"today"),!1!==v&&v.getMonth()===(new Date).getMonth()&&v.getFullYear()===(new Date).getFullYear()&&occ.addClass(t.querySelector("div.dy"+(new Date).getDate()),"today")}
3!0===occ.hasClass(this.elem,"alwaysOpen")&&this.finishDateControl()},ocCalendar.prototype.getMonthDays=function(e){var t=1*this.elem.querySelector(".ocDateControl-monav").getAttribute("data-cv"),o=1*this.elem.querySelector(".ocDateControl-yrnav").getAttribute("data-cv");e&&((t+=e)<1&&(t=12,o-=1),t>12&&(t=1,o+=1));var l=31;return 2===t&&(l=28,(0==o%4&&0!=o%100||0==o%400)&&(l=29)),4!==t&&6!==t&&9!==t&&11!==t||(l=30),e?l:[this.getMonthDays(-1),l]},ocCalendar.prototype.setCalendarViewData=function(e,t,o){if(!0===this.dataView&&Array.isArray(e)&&e.length>0){occ.addClass(this.elem,"dataView"),ocCalendarResize();for(let l=0;l<e.length;l++)this.setCalendarViewDataItem(e[l].itemDate,e[l].itemEndDate,e[l].itemTitle,e[l].itemId,t,o,e[l].itemCategory,!0);occ.reviewFamily(this.elem.querySelector("div.ocDateControl-dynav"),!0,!1,"div.wk1"),occ.reviewFamily(this.elem.querySelector("div.ocDateControl-dynav"),!0,!1,"div.wk2"),occ.reviewFamily(this.elem.querySelector("div.ocDateControl-dynav"),!0,!1,"div.wk3"),occ.reviewFamily(this.elem.querySelector("div.ocDateControl-dynav"),!0,!1,"div.wk4"),occ.reviewFamily(this.elem.querySelector("div.ocDateControl-dynav"),!0,!1,"div.wk5"),occ.reviewFamily(this.elem.querySelector("div.ocDateControl-dynav"),!0,!1,"div.wk6")}},ocCalendar.prototype.clearCalendarViewData=function(e){let t=this.elem.querySelectorAll("div.ocNavDay > div");for(let e=0;e<t.length;e++)t[e].remove();occ.removeClass("div.ocDateControl-dynav > div.ocNavDay.hasItem","hasItem")},ocCalendar.prototype.setCalendarViewDataItem=function(e,t,o,l,c,i,a,n){if(!0===this.dataView){!0!==n&&(occ.addClass(this.elem,"dataView"),ocCalendarResize());let r=occ.isDate(e,!this.offset),s=occ.isDate(t,!this.offset);if(!1===s&&(s=r),!1!==r&&(r.getFullYear()<this.currentValue.getFullYear()||r.getMonth()<=this.currentValue.getMonth()&&r.getFullYear()===this.currentValue.getFullYear())&&(s.getFullYear()>this.currentValue.getFullYear()||s.getMonth()>=this.currentValue.getMonth()&&s.getFullYear()===this.currentValue.getFullYear())){let e=r,t=s,n=0;if(r.getDate()===s.getDate()&&r.getMonth()===s.getMonth()&&r.getFullYear()===s.getFullYear())n=1;else{let o=new Date(this.currentValue.getFullYear(),this.currentValue.getMonth(),1),l=new Date(this.currentValue.getFullYear(),this.currentValue.getMonth()+1,0);r<o&&(e=o),s>l&&(t=l),n=t.getDate()-e.getDate()+1}for(let t=0;t<n;t++){let n=this.elem.querySelector("div.ocDateControl-dynav > div.dy"+(e.getDate()+t));if(n){let e=document.createElement("div"),t="<br>";if(Array.isArray(a)&&a.length>0)for(let e=0;e<a.length;e++)!1===occ.isNothingOrEmpty(a[e].color)&&(t+='<div class="cDot" style="background-color: '+a[e].color+";right:"+(5+5*e)+'px"><span>'+a[e].name+"</span></div>");if(e.classList=i,e.innerHTML=o+t,e.setAttribute("alt",o),e.setAttribute("title",o),l.indexOf(":")>0){let t=l.split(":");e.setAttribute("data-rid",t[0]),e.setAttribute("data-iid",t[1])}else e.setAttribute("data-rid",l);"function"==typeof c&&(e.style.cursor="pointer",e.addEventListener("pointerup",c)),occ.addClass(n,"hasItem"),n.appendChild(e),n.querySelectorAll("div").length>2?occ.addClass(n,"oneLine"):occ.removeClass(n,"oneLine")}}}}},ocCommon.prototype.createDropDown=function(e,t,o,l,c,i){let a=!0;var n=document.getElementById(e);let r=null,s=null;if(n&&"INPUT"===n.tagName&&(r=document.getElementById(e),n=n.parentElement),n)s=n,r=n.querySelector("input"),n=n.parentElement,!0===occ.hasClass(n,"ocDropDown")&&(a=!1),occ.addClass(n,"ocDropDown");else{n=this.createDiv("",["ocDropDown"]),s=this.createDiv("",["select"],[{name:"id",value:e+"-sel"},{name:"data-value",value:i}]),o&&occ.addClasses(s,o),l&&this.addAttributes(s,l);let t=this.createDiv("",["icon","s-arrow-down","tr"]);occ.addClass(t,occ.hasClass(s,"mini")?"sz1":"sz3"),occ.addClickEvent(t,occ.clickOcFieldSelect),s.appendChild(t),occ.addClickEvent(s,occ.clickOcFieldSelect),r=occ.createElement("input",null,[{name:"id",value:e},{name:"type",value:"hidden"}]),c&&"function"==typeof c&&occ.addChangeEvent(s,c),s.appendChild(r),n.appendChild(s)}let d=s.getAttribute("data-value");if(s.querySelectorAll("div.option").length>0){if(!Array.isArray(t)){t=[];let e=s.querySelectorAll("div.option");for(let o=0;o<e.length;o++){var u={name:e[o].innerText,value:e[o].getAttribute("data-fieldValue")};u.value===r.value&&(u.isDef=!0),t.push(u)}}let e=s.querySelectorAll("div.option");for(let t=0;t<e.length;t++)e[t].remove()}if(Array.isArray(t))for(var p=0;p<t.length;p++)if(t[p].fieldOption&&(t[p].name=t[p].fieldOption,t[p].value=t[p].fieldValue),null!==t[p].name&&null!==t[p].value){var m=this.createDiv(t[p].name,["option"]);(!0===occ.isNothingOrEmpty(d)&&!0===t[p].isDef||!1===occ.isNothingOrEmpty(d)&&t[p].value===d)&&(occ.addClasses(m,["
3selected","default"]),s.setAttribute("data-defval",t[p].value),!1===occ.isNothingOrEmpty(d)&&(r.value=d)),occ.addClickEvent(m,occ.setOcFieldSelect),m.setAttribute("data-fieldValue",t[p].value),t[p].fieldOptionId&&(m.setAttribute("id","foid-"+t[p].fieldOptionId),occ.addClass(m,"ocFieldOption")),s.appendChild(m)}return n},ocCommon.prototype.setDropDown=function(e,t){let o=e.tagName?e:document.getElementById(e);if(!o)return;"INPUT"===o.tagName&&(o=o.parentElement),t&&null!==t||(t=""),t=""+t;let l=o.querySelector('input[type="hidden"]');l.value=t,occ.removeClass(o.querySelectorAll("div.option.selected"),"selected");let c=!1;if(!1===occ.isNullOrEmpty(t)){let e=o.querySelectorAll("div.option");for(let o=0;o<e.length;o++)e[o].getAttribute("data-fieldValue")===t&&(occ.addClass(e[o],"selected"),c=e[o])}if(!1===c){let e=o.querySelector("div.option.default");e&&(l.value=e.getAttribute("data-fieldValue"),occ.addClass(e,"selected"))}};let ocRecurrenceControls=[];function ocCalendarResize(e){for(let e=0;e<ocCalendars.length;e++)if(!0===ocCalendars[e].dataView&&(ocCalendars[e].elem.clientWidth<335?occ.replaceClass(ocCalendars[e].elem,"dataView","dataView1"):occ.replaceClass(ocCalendars[e].elem,"dataView1","dataView")),null!==ocCalendars[e].minDate&&!1!==ocCalendars[e].minDate||occ.hasClass(ocCalendars[e].elem,"preventOld")){let t=!1===ocCalendars[e].minDate?new Date:ocCalendars[e].minDate;t.getMonth()>=ocCalendars[e].currentValue.getMonth()&&t.getFullYear()===ocCalendars[e].currentValue.getFullYear()?occ.hideObj(ocCalendars[e].elem.id+"-pm"):occ.showObj(ocCalendars[e].elem.id+"-pm"),ocCalendars[e].showYear&&(t.getFullYear()===ocCalendars[e].currentValue.getFullYear()||t.getMonth()>ocCalendars[e].currentValue.getMonth()&&t.getFullYear()+1===ocCalendars[e].currentValue.getFullYear()?occ.hideObj(ocCalendars[e].elem.id+"-py",!0):occ.showObj(ocCalendars[e].elem.id+"-py"))}else!1===ocCalendars[e].minDate&&occ.hasClass(ocCalendars[e].elem,"preventedOld")&&(occ.showObj(ocCalendars[e].elem.id+"-pm"),occ.showObj(ocCalendars[e].elem.id+"-py"))}ocCommon.prototype.createRecurrenceControl=function(e){let t=null;if(!e)return;let o=occ.getElementFromString(e.id);if(!o)return;let l=!1;if(ocRecurrenceControls.forEach(o=>{o.id===e.id&&(l=!0,t=o,t.startDate=e.startDate,t.endDate=e.endDate,t.dates=e.dates,t.type=e.type,t.limitDate=e.limitDate,t.limitCount=e.limitCount,t.monthMode=e.monthMode)}),!1===l&&(t=e,t.tempId=occ.eid(),ocRecurrenceControls.push(t)),o=occ.getElementFromString(t.id),t.startDate=occ.isDate(t.startDate,!this.offset),t.endDate=occ.isDate(t.endDate,!this.offset),!1===t.startDate||!1===t.endDate)return;!1===Array.isArray(t.dates)&&(t.dates=[]),occ.isNothingOrEmpty(t.type)&&(t.type="N"),occ.isNothingOrEmpty(t.title)&&(t.title="Recurrence Tool"),occ.isNothingOrEmpty(t.monthMode)&&(t.monthMode="Date"),t.limitDate=occ.isDate(t.limitDate,!this.offset),!1===t.limitDate&&(t.limitDate=new Date(t.startDate.getFullYear()+1,t.startDate.getMonth(),t.startDate.getDate(),t.endDate.getHours(),t.endDate.getMinutes())),t.orgDates=JSON.parse(JSON.stringify(t.dates)),t.orgDates.forEach(e=>{e.startDate=occ.isDate(e.startDate,!this.offset),e.startDay=e.startDate.getTime()+"",e.startDay=e.startDay.substring(0,e.startDay.length-9),null!==e.endDate&&(e.endDate=occ.isDate(e.endDate,!this.offset)),e.orgDate&&null!==e.orgDate&&(e.orgDate=occ.isDate(e.orgDate,!this.offset),e.orgDay=e.orgDate.getTime()+"",e.orgDay=e.orgDay.substring(0,e.orgDay.length-9))});let c="occRecur-"+t.id+"-r",i=function(e){t.type=document.getElementById(c+"Type").value,"N"===t.type||""===t.type?(occ.hideField(c+"Date"),occ.hideField(c+"Limit"),occ.hideField(c+"MonthMode")):(occ.hideField(c+"MonthMode"),"M"===t.type&&(occ.showField(c+"MonthMode"),""===document.getElementById(c+"MonthMode").value&&occ.setOCFormField(c+"MonthMode","Date")),occ.showField(c+"Date"),occ.showField(c+"Limit"),m(e))},a=function(e){e&&"change"===e.type&&m(e)},n=!1,r="",s=-1,d=-1,u=0,p=0,m=function(o){if("N"===t.type||""===t.type)return;if(s=-1,d=-1,u=0,p=0,o){t.limitCount=document.getElementById(c+"Limit").value;let o=occ.isDateObj(document.getElementById(c+"SDate").value);t.startDate=o.start,t.endDate=o.end,t.limitDate=occ.isDate(document.getElementById(c+"Date").value,!this.offset),t.monthMode=document.getElementById(c+"MonthMode").value,e&&e!==t&&(e.startDate=t.startDate,e.endD
3ate=t.endDate,e.limitDate=t.limitDate,e.limitCount=t.limitCount,e.monthMode=t.monthMode,e.type=t.type)}n=new Date(t.limitDate),t.tempDates=[];let l=[];r=""!==t.monthMode?t.monthMode:"Date",!1!==t.startDate&&!1!==t.endDate&&"Day"==r&&"M"===t.type&&(d=t.startDate.getDay(),t.startDate.getDate()<8?p=1:t.startDate.getDate()<15?p=2:t.startDate.getDate()<22?p=3:t.startDate.getDate()<29?p=4:t.startDate.getDate()<32&&(p=5));let i=""!==t.limitCount?1*t.limitCount:-1;if(i>0){let e=0,t=1;for(;e<1;){let o=y(l,t,-100);!0===o.useDate&&l.length===i&&(e=2),t>("Day"==r?1096:200)&&(e=1),t=o.row}}else if(t.limitDate){let e=0,t="Day"==r?0:1;for(;e<1;){let o=y(l,t,e);1===o.i||2===o.i?e=o.i:t=o.row}}l.forEach(e=>{let o=!1;e.selected=!1;let l=e.startDate.getTime()+"";l=l.substring(0,l.length-9),t.orgDates.forEach(t=>{!1===o&&(t.startDay===l||t.orgDate&&t.orgDay===l)&&(o=!0,!0===t.instanceStatus.startsWith("G")&&(o=!1,e.instanceId=t.instanceId,e.instanceStatus=t.instanceStatus))}),!1===o&&(!0===t.preSelectAll&&"GDeleted"!==e.instanceStatus&&(e.selected=!0),t.tempDates.push(e))}),t.orgDates.forEach(e=>{!1===e.instanceStatus.startsWith("G")&&t.tempDates.push(e)}),t.tempDates.sort((e,t)=>e.startDate.getTime()-t.startDate.getTime()),h()},h=function(e){occ.clearTable(c+"DatesTbl"),occ.hideObj(c+"DatesTblNav");let o={tableId:c+"DatesTbl",data:t.tempDates,columns:[{label:"Date",mobile:!0,width:0,total:"count"},{label:"Status",mobile:!1,width:-1,align:"center"},{label:"Include?",mobile:!1,width:-1,align:"center"}],rowCB:g,loadCB:function(e){e.querySelector("input.rcrRowCBX")&&occ.showObj(c+"DatesTblNav")}};occ.showObj(c+"DatesTbl"),occ.createTable(o)},g=function(e,t){var o=occ.createDiv("",null,[{name:"data-rid",value:t.instanceId}]);void 0===t.selected&&(t.selected=!1);let l="";if("string"==typeof t.startDate&&(t.startDate=occ.isDate(t.startDate,!this.offset)),"string"==typeof t.endDate&&(t.endDate=occ.isDate(t.endDate,!this.offset)),l=occ.formatDate(t.startDate,"mm/dd/yy"),t.endDate&&!1!==t.endDate){let e=occ.formatDate(t.endDate,"mm/dd/yy");if(l!==e)l+=" - "+e;else{let o=occ.formatDate(t.startDate,"h:mm am");e=occ.formatDate(t.endDate,"h:mm am"),l+=" "+o+" - "+e}}else l=occ.formatDate(t.startDate,"mm/dd/yy h:mm am");o.appendChild(occ.createDiv(l));let c=t.instanceStatus.replace("GD","D").replace("GC","C").replace("AC","C");switch(c){case"A":c="Added";break;case"M":c="Moved";break;case"G":c="Generated";break;case"D":c="Deleted"}o.appendChild(occ.createDiv(c));let i=occ.createDiv("");if(1*t.instanceId<0&&t.instanceStatus.startsWith("G")){let e=occ.createElement("input",["rcrRowCBX"],[{name:"type",value:"checkbox"}],null,"change",f);occ.addClickEvent(e,function(e){e.preventDefault(),e.stopPropagation()}),i.appendChild(e),!0===t.selected&&(e.checked=!0,occ.addClass(o,"selected"))}o.appendChild(i),occ.addTableRow(e,o,"Existing"!==c?f:null,null,!1)},f=function(e){e.preventDefault(),e.stopPropagation();let o=!1,l=null;if("INPUT"===e.srcElement.tagName)o=e.currentTarget.checked,l=e.currentTarget.parentElement.parentElement,occ.toggleClass(l,"selected",e.currentTarget.checked?1:0);else{l=e.currentTarget,occ.toggleClass(l,"selected");let t=e.currentTarget.querySelector("input.rcrRowCBX");t&&(t.checked=occ.hasClass(e.currentTarget,"selected"),o=t.checked)}if(l){let e=l.getAttribute("data-rid"),c=t.tempDates.filter(t=>t.instanceId===e);console.log(c),1===c.length&&(c[0].selected=o)}},y=function(e,o,l){let c=!0,i=occ.isDate(t.startDate,!this.offset),a=occ.isDate(t.endDate,!this.offset);if(!1!==i&&!1!==a){switch(i=new Date(i.getTime()),a=new Date(a.getTime()),t.type){case"W":i.setDate(i.getDate()+7*o),a.setDate(a.getDate()+7*o);break;case"BW":i.setDate(i.getDate()+14*o),a.setDate(a.getDate()+14*o);break;case"M":"Day"==r?(i.setDate(i.getDate()+o),a.setDate(a.getDate()+o)):"Date"==r&&(i.setMonth(i.getMonth()+1*o),a.setMonth(a.getMonth()+1*o));break;case"BM":i.setMonth(i.getMonth()+2*o),a.setMonth(a.getMonth()+2*o);break;case"Y":i.setFullYear(i.getFullYear()+1*o),a.setFullYear(a.getFullYear()+1*o)}if(s!==i.getMonth()&&(u=0,s=i.getMonth()),l>-100&&(i>=n||o>("Day"==r?1096:200)))l=1;else if(d===i.getDay()&&u<p&&(t.startDate.getMonth()!==i.getMonth()||t.startDate.getFullYear()!==i.getFullYear())?(u++,c=u===p):!0===c&&d>-1&&(c=!1),!0===c){let t={instanceId:occ.eid(4)+o,startDate:i,endDate:a,instanceStatus:"Generated"};e.push(t)}o++}else l=2;return{useDate:c,row:o,i:l}},C=function(e){occ.removeClass(o,"active"),e.currentTarget.id===c+"DoneBtn"&&(t.tempDates.forEac
3h(e=>{e.instanceId=e.instanceId+"","Generated"===e.instanceStatus&&!1===e.selected?e.instanceStatus="GDeleted":"GDeleted"===e.instanceStatus&&!0===e.selected&&(e.instanceStatus="Generated"),e.startDate=occ.formatDate(e.startDate,"c#"),e.endDate=occ.formatDate(e.endDate,"c#")}),t.dates=JSON.parse(JSON.stringify(t.tempDates.filter(e=>!0===e.instanceId.startsWith("-")))),t.listCB(t)),t.tempDates=[]},v=function(e){let o=document.getElementById(c+"DatesTbl").querySelectorAll("div.ocTable-row"),l=document.getElementById(c+"DatesTbl").querySelectorAll("input.rcrRowCBX"),i=!1;e.currentTarget.id===c+"saBtn"?(i=!0,occ.addClass(o,"selected")):occ.removeClass(o,"selected"),t.tempDates.forEach(e=>{e.selected=i}),l.forEach(e=>{e.checked=i})};if(0==occ.hasClass(o,"occRecurSet")){let e=occ.createDiv("",["occRecurControl"],[{name:"id",value:c+"MainDiv"}]);e.appendChild(occ.createElement("h2",["ocDialog-titlebar"],null,t.title)),e.appendChild(occ.ocButton(c+"DoneBtn","Apply",C,null,null,["occRecurDone"])),e.appendChild(occ.ocButton(c+"CancelBtn","Cancel",C,null,null,["occRecurCancel"])),e.appendChild(occ.createDiv("",["ocField-obj","dynamic","hideBlank"],[{name:"id",value:c+"Type"},{name:"data-label",value:"Recurrence Mode"},{name:"data-fieldOptions",value:'[{"fieldOption":"Off", "fieldValue":"N"},{"fieldOption":"Weekly","fieldValue":"W"},{"fieldOption":"Bi-Weekly","fieldValue":"BW"},{"fieldOption":"Monthly", "fieldValue":"M"},{"fieldOption":"Bi-Monthly", "fieldValue":"BM"},{"fieldOption":"Yearly", "fieldValue":"Y"}]'},{name:"data-value",value:occ.isNothingOrEmpty(t.type)?"N":t.type}],"change",i)),e.appendChild(occ.createDiv("",["ocInputControl-obj","col-2"],[{name:"id",value:c+"SDate"},{name:"data-label",value:"Start on this Day"},{name:"data-type",value:"occalendar"},{name:"data-range",value:"true"},{name:"data-showToday",value:"false"},{name:"data-time",value:"true"},{name:"data-minTime",value:"200"},{name:"data-minIncrement",value:"30"},{name:"data-value",value:JSON.stringify({start:t.startDate,end:t.endDate})}],"change",m)),e.appendChild(occ.createDiv("",["ocInputControl-obj","col-2"],[{name:"id",value:c+"Date"},{name:"data-label",value:"Stop Repeating on this Day"},{name:"data-type",value:"occalendar"},{name:"data-showToday",value:"false"},{name:"data-time",value:"false"},{name:"data-minTime",value:"200"},{name:"data-value",value:t.limitDate}],"change",m)),e.appendChild(occ.createDiv("",["ocInputControl-obj","col-2"],[{name:"id",value:c+"Limit"},{name:"data-label",value:"# of times to repeat this item"},{name:"data-type",value:"number"},{name:"data-info",value:"*this overrides the selected date"},{name:"data-value",value:t.limitCount}],"change",m)),e.appendChild(occ.createDiv("",["ocField-obj","col-2"],[{name:"id",value:c+"MonthMode"},{name:"data-label",value:"Monthly Repeat"},{name:"data-segment",value:"true"},{name:"data-fieldOptions",value:'[{"fieldOption":"Date Specific", "fieldValue":"Date"},{"fieldOption":"Day Specific", "fieldValue":"Day"}]'},{name:"data-value",value:occ.isNothingOrEmpty(t.monthMode)?"Date":t.monthMode}],"change",a)),e.appendChild(occ.createDiv("",["hiddenObj"],[{name:"id",value:c+"DatesTbl"}]));let l=occ.createDiv("",["occRecurDatesTblNav","hiddenObj"],[{name:"id",value:c+"DatesTblNav"}]);l.appendChild(occ.ocButton(c+"dsaBtn","Deselect All",v)),l.appendChild(occ.ocButton(c+"saBtn","Select All",v)),e.appendChild(l),o.appendChild(e),occ.addClass(o,"occRecurSet"),occ.initInputControls(o),occ.initFields(o)}else occ.setOCFormField(c+"Type",t.type),occ.setOCFormField(c+"SDate",{start:t.startDate,end:t.endDate}),occ.setOCFormField(c+"Date",t.limitDate),occ.setOCFormField(c+"Limit",t.limitCount),occ.setOCFormField(c+"MonthMode",t.monthMode);occ.addClass(o,"active"),occ.resizeFormFields(o),occ.clearTable(c+"DatesTbl"),i(null),m(null)},ocCommon.prototype.switchPageLoad=function(){for(var e=document.querySelectorAll("div.switchObj"),t=0;t<e.length;t++)if(!1===this.hasClass(e[t],"switchGroup"))try{this.switchSet(e[t].id,null,null,null)}catch(e){console.log(e)}},ocCommon.prototype.loadOcButtons=function(e){e&&null!==e&&(e=occ.getElementFromString(e)),e&&null!==e||(e=document);for(var t=e.querySelectorAll("div.opoClient-btn-Obj"),o=0;o<t.length;o++)!1===this.hasClass(t[o],"opoClient-btn")&&this.ocButton(t[o].id,t[o].getAttribute("data-text"),null,t[o].getAttribute("data-icon"),null);t=e.querySelectorAll("button.opoClient-btn-Obj");for(o=0;o<t.length;o++)!1===this.hasClass(t[o],"opoClient-btn")&&this.ocButton(t[o].id,t[o].getAttribute("data-text"),null,t[o].getAttribute("data-icon"),null);t=e.querySelectorAll("a.opoClient-btn-Obj");for(o=0;o<t.length;o++)if(!1===this.hasClass(t[o],"opoClient-btn")){let e=t[o].getAttribute("data-text");!0===occ.isNullOrEmpty(e)&&(e=t[o].innerText,t[o].innerHTML=""),this.ocButton(t[o].id,e,null,t[o].getAttribute("data-icon"),null)}},ocCommon.prototype.ocButtonBadge=function(e,t){let o=document.getElementById(e);if(!o)return;t+="",occ.removeClass(o,"noBadge");let l=o.querySelector("span.badge");l||o.appendChild(occ.createElement("span",["badge"],null,"text")),l=o.querySelector("span.badge"),l.innerHTML=t,t&&null!=t&&0!==t.length||occ.addClass(o,"noBadge")};let hasOcTabsObjs=!1;ocCommon.prototype.ocTabCheckAllTabs=function(e){if(!1!==hasOcTabsObjs)for(var t=document.querySelectorAll("div.ocTabs-Obj"),o=0;o<t.length;o++)occ.ocTabCheckTabs(t[o],"resize")},ocCommon.prototype.ocTabClickTab=function(e){var t=document.getElementById(e+"-tb");t&&occ.triggerEvent(t,"pointerup")},ocCommon.prototype.ocTabCheckTabs=function(e,t){var o=e.querySelector("div.ocTabs");if(o.children.length>2&&(occ.removeClass(e,"panels"),o)){occ.addClass(o,"checking"),occ.removeClasses(o,["t2","t3","t4","t5","t6","t7","t8"]);let c=0,i=null,a=0;occ.removeClass(o,"small-tabs");let n=o.querySelectorAll(".ocTab");for(var l=0;l<n.length;l++)n[l].style.width="",c<n[l].clientWidth&&(c=n[l].clientWidth),null===i&&(i=!1===occ.hasClass(n[l],"hiddenObj")?n[l]:null),!1===occ.hasClass(n[l],"hiddenObj")&&a++;occ.addClass(o,"t"+a),c*=a,o.clientWidth<c&&occ.addClass(e,"panels");let r=e.querySelector(".ocTabContent > div.ocTab.active");occ.removeClass(n,"active"),r?occ.addClass(document.getElementById(r.id+"-tb"),"active"):"changeTab"!==t&&i&&occ.triggerEvent(i,"pointerup"),occ.removeClass(o,"checking")}},ocCommon.prototype.ocTabChangeTab=function(e){document.activeElement&&document.activeElement.blur();var t=e.currentTarget?e.currentTarget:occ.getElementFromString(e),o=t.parentElement,l=o.parentElement.querySelector(".ocTabContent > div.ocTab.active");occ.ocTabCheckTabs(o.parentElement,"changeTab"),occ.hasClass(o.parentElement,"panels")&&occ.addClass(o.parentElement,"panel-active"),occ.removeClass(o.children,"active"),occ.removeClass(o.nextSibling.children,"active"),occ.addClass(t,"active"),occ.addClass(document.getElementById(t.id.replace("-tb","")),"active"),occ.resizeFormFields(document.getElementById(t.id.replace("-tb",""))),occ.checkMyTables(t.id.replace("-tb","")),l&&(l.parentElement.scrollTop=0);let c=!1,i=!1;(l=o.querySelector(".ocTab.active"))&&(c=occ.hasClass(l,"first"),i=occ.hasClass(l,"last")),occ.removeClasses(o.parentElement.querySelector(".ocTabContent"),["first","last"]),c&&occ.addClass(o.parentElement.querySelector(".ocTabContent"),"first"),i&&occ.addClass(o.parentElement.querySelector(".ocTabContent"),"last")},ocCommon.prototype.initTabs=function(e,t,o){let l=occ.getElementFromString(e);if(l&&Array.isArray(t)){if(occ.hasClass(l,"ocTabs")){if(void 0!==o&&"number"==typeof o&&o>=0){let e=l.querySelectorAll(".ocTab");e.length>
3o&&occ.triggerEvent(e[o],"pointerup")}return}let e=function(e){var t=e.currentTarget.parentElement;occ.removeClass(t.parentElement,"panel-active"),occ.removeClass(t.children,"active")};var c=occ.createDiv("",["ocTabs"]),i=occ.createAnchor('<div class="icon s-arrow-left sz3"></div>',["ocTab-back"]);occ.addClickEvent(i,e),c.appendChild(i),occ.addClass(c,"t"+t.length);let s=occ.createDiv("",["ocTabContent"]);for(var a=0;a<t.length;a++)if("string"==typeof t[a].obj&&(t[a].obj=document.getElementById(t[a].obj)),t[a].obj&&null!==t[a].obj){var n=occ.createDiv(""+t[a].title,["ocTab"]);if(occ.addClasses(t[a],t[a].classes),0===a&&occ.addClass(n,"first"),a+1===t.length&&occ.addClass(n,"last"),n.setAttribute("id",t[a].obj.id+"-tb"),t[a].onClick&&"function"==typeof t[a].onClick){var r=function(e,t){!1!==this.allowTabClick&&(!1===occ.hasClass(e.id,"disabled")?e.onClick(t):e.disabledText&&""!==e.disabledText&&occ.showTooltip(e.id,e.disabledText,t)),this.allowTabClick=!0,occ.ocTabChangeTab(e.obj.id+"-tb")};occ.addClickEvent(n,r.bind(this,t[a]),"pointerup")}else occ.addClickEvent(n,occ.ocTabChangeTab);"ios"===occ.clientOs&&(n.addEventListener("touchstart",function(e){e.preventDefault(),e.stopPropagation()}),n.addEventListener("touchmove",function(e){e.preventDefault(),e.stopPropagation()})),!1===occ.isNothingOrEmpty(t[a].fnIcon)&&"function"==typeof t[a].fn&&n.appendChild(occ.ocButton(t[a].obj.id+"-tb-fncall","",t[a].fn,t[a].fnIcon,null,["tabAction"])),c.appendChild(n),occ.addClass(t[a].obj,"ocTab"),0===a&&(occ.addClass(t[a].obj,"active"),occ.addClass(l,"panel-active")),s.appendChild(t[a].obj)}occ.addClass(l,"ocTabs-Obj"),l.appendChild(c),l.appendChild(s),occ.ocTabCheckTabs(l,"load"),hasOcTabsObjs=!0,occ.addClass(l,"ocTabs")}else{let e=[];if(e=l?l.querySelectorAll(".ocTabs-obj"):document.querySelectorAll(".ocTabs-obj"),e.length>0)for(let t=0;t<e.length;t++){let o=e[t].children;occ.addClass(e[t].parentElement,"ocTabsParent"),occ.hasClass(e[t],"mobileOnly")?occ.addClass(e[t].parentElement,"mobileOnly"):occ.addClass(e[t].parentElement,"always");for(let e=0;e<o.length;e++){if(!1===occ.hasClass(o[e],"ocTab")){occ.addClass(o[e],"ocTab");let t=o[e].getAttribute("data-id");null!==t&&""!==t&&occ.addClass(t,"ocTab-Content"),occ.addClickEvent(o[e],this.tabClick.bind(this))}!1===occ.hasClass(o[e].parentElement,"minWidth")&&(o[e].style.width="calc("+100/o.length+"% - "+(25+1/o.length)+"px)")}occ.addClass(e[t],"ocTabs"),occ.resetTabs(e[t].parentElement)}}},ocCommon.prototype.resizeTabs=function(){let e=document.querySelectorAll("div.ocTabsParent");for(let t=0;t<e.length;t++)occ.resetTabs(e[t])},ocCommon.prototype.resetTabs=function(e){if((e=occ.getElementFromString(e))&&occ.hasClass(e,"ocTabsParent")){let t=e.querySelectorAll(".ocTab");if(occ.removeClass("div.first","first"),occ.removeClass("div.last","last"),t.length>0){let e=0,o=null,l=null,c=null;for(let i=0;i<t.length;i++)if(occ.isVisible(t[i])){if(e++,null===l){occ.addClass(t[i],"first"),l=t[i];let e=t[i].getAttribute("data-id");null!==e&&""!==e&&occ.addClass(e,"first")}occ.hasClass(t[i],"active")&&(o=t[i]),c=t[i]}occ.addClass(c,"last");let i=c.getAttribute("data-id");null!==i&&""!==i&&occ.addClass(i,"last");for(let o=0;o<t.length;o++)t[o].style.width="",e>1&&!1===occ.hasClass(t[o].parentElement,"minWidth")&&(t[o].style.width="calc("+100/e+"% - "+(25+1/e)+"px)");!o&&l&&(occ.triggerEvent(l),!1===occ.isNullOrEmpty(l.onClick)&&occ.triggerEvent(l,"click"))}}},ocCommon.prototype.clickTab=function(e){let t=document.querySelector('div.ocTab[data-id="'+e+'"]');t||(t=document.querySelector(e+"-tb")),t&&occ.triggerEvent(t)},ocCommon.prototype.tabClick=function(e){let t=e.currentTarget,o=t.parentElement.querySelector(".ocTab.active"),l=null;o&&(l=o.getAttribute("data-id")),occ.removeClass(t.parentElement.querySelectorAll(".ocTab.active"),"active"),occ.removeClass(t.parentElement.parentElement,l),occ.removeClass(t.parentElement.parentElement.querySelectorAll(".ocTab-Content.active"),"active"),occ.addClass(t,"active");let c=t.getAttribute("data-id");null!==c&&""!==c&&(occ.addClass(c,"active"),occ.addClass(t.parentElement.parentElement,c)),occ.checkMyTables(t.parentElement.parentElement)},ocCommon.prototype.createBar=function(e,t,o,l){Array.isArray(l)||(l=[]),l.push("ocBar");let c=this.createElement("div",l);if(e>-1&&t>=e){o&&null!==o?o+="":o="0",c.appendChild(occ.createElement("span",null,null,o));let l=(e/t*100).toFixed(0)+"",i=occ.createDiv("<span>"+l+"%</span>"),a=occ.createDiv("");a.style.width=l+"%",i.appendChild(a),c.appendChild(i),c.appendChild(occ.createElement("span",null,null,t))}return c},ocCommon.prototype.initTagControl=function(e){e&&null!==e||(e=document.querySelector("body"));let t=e.querySelectorAll("div.ocTagCtrl-obj");for(let e=0;e<t.length;e++)!1===occ.hasClass(t[e],"ocTagCtrl")&&!1===occ.hasClass(t[e],"loading")&&!1===occ.isNullOrEmpty(t[e].getAttribute("data-ItemId"))&&occ.initTagControlCB(t[e])},ocCommon.prototype.reInitTagControl=function(e,t,o,l,c,i){let a=occ.getElementFromString(e);if(!a)return;"INPUT"===a.tagName?a=a.parentElement:-1===a.id.indexOf("-ctrl")&&a.setAttribute("id",a.id+"-ctrl");let n=0,r=a.querySelectorAll("div.ocFormField");for(let e=0;e<r.length;e++)0===n&&(n=e),r[n].remove();if(1!==t&&0!==t||(t+=""),t&&null!==t?a.setAttribute("data-ItemId",t):a.querySelector("input")&&a.querySelector("input").getAttribute("data-ItemId")&&!1===occ.isNullOrEmpty(a.querySelector("input").getAttribute("data-ItemId"))&&a.setAttribute("data-ItemId",a.querySelector("input").getAttribute("data-ItemId")),!1===occ.isNothingOrEmpty(o))a.setAttribute("data-ItemEntity",o);else{let e=a.querySelector("input");e&&e.getAttribute("data-ItemEntity")&&!1===occ.isNullOrEmpty(e.getAttribute("data-ItemEntity"))&&a.setAttribute("data-ItemEntity",e.getAttribute("data-ItemEntity"))}l&&null!==l&&(!0===Array.isArray(l)&&(l=JSON.stringify(l)),a.setAttribute("data-tags",l)),c&&null!==c&&(!0===Array.isArray(c)&&(c=JSON.stringify(c)),a.setAttribute("data-lv",c)),!0===i&&occ.addClass(a,"setDirty"),occ.showObj(a),occ.initTagControlCB(a)},ocCommon.prototype.initTagControlCB=function(e){occ.loadOCFormCheck(e.id,!1);let t=[];"INPUT"===e.tagName?e=e.parentElement:-1===e.id.indexOf("-ctrl")&&e.setAttribute("id",e.id+"-ctrl");let o={ControlId:e.id.replace("-ctrl",""),ItemEntity:"",ItemId:"0",readOnly:!1,required:null,TagItems:[{tCatId:0,ControlId:"",readOnly:!1,required:null}]};o.ItemEntity=e.getAttribute("data-ItemEntity"),"true"===e.getAttribute("data-readOnly")&&(o.readOnly=!0),o.allowEdit="true"===e.getAttribute("data-allowEdit"),!0===occ.hasClass(e,"required")&&(o.required=!0),!1===occ.isNothingOrEmpty(e.getAttribute("data-eTenantId"))&&(o.eTenantId=e.getAttribute("data-eTenantId")),o.ItemId=e.getAttribute("data-ItemId");let l=e.getAttribute("data-tags");if(!1===occ.isNullOrEmpty(l)&&(o.TagItems=JSON.parse(l)),t.push(o),occ.addClass(e,"loading"),t.length>0)for(let e=0;e<t.length;e++)occ.loadTagControl(t[e])}
3,ocCommon.prototype.loadTagControl=function(e){new ocAjax({jsonResponse:!0,showWaiting:!1,jsonRequest:!0,onSuccess:function(e){var t=e.fields;let o=document.getElementById(e.controlId+"-ctrl");if(o&&!0===occ.hasClass(o,"ocTagCtrl-obj")&&t.length>0){let l="Tags";if(!1===occ.isNullOrEmpty(o.getAttribute("data-label"))&&(l=o.getAttribute("data-label")),o.querySelector("h4")?o.querySelector("h4").innerHTML=l:o.appendChild(occ.createElement("h4",null,null,l)),"false"!==o.getAttribute("data-autoupdate")&&occ.addClass(o,"autoUpdate"),!o.querySelector("input.groupInput")){let t=occ.createElement("input",["groupInput"],[{name:"type",value:"hidden"},{name:"id",value:e.controlId}]);o.appendChild(t)}let c=occ.hasClass(o,"setDirty");occ.removeClass(o,"setDirty");for(let e=0;e<t.length;e++){t[e].mtp=!0;let l=[],c=o.getAttribute("data-lv");l=!1===occ.isNothingOrEmpty(c)&&c.length>2?JSON.parse(c+""):JSON.parse(t[e].cv);let i=occ.createDiv("");i.setAttribute("id",t[e].fi),!0===t[e].required&&occ.addClass(i,"required"),o.appendChild(i),t[e].onChange=occ.saveTagControl,"false"!==o.getAttribute("data-retain")&&(t[e].classes=["retainDelete"]),t[e].cv=[];for(let o=0;o<l.length;o++){let c=!1;for(let i=0;i<t[e].fieldOptions.length;i++)l.length>0&&(l[o].eTagId===t[e].fieldOptions[i].fieldValue||l[o].fieldValue===t[e].fieldOptions[i].fieldValue)&&(c=!0),!1===occ.isNothingOrEmpty(t[e].fieldOptions[i].itemText)&&(t[e].fieldOptions[i].fieldFillIn=t[e].fieldOptions[i].itemText),!1===occ.isNothingOrEmpty(t[e].fieldOptions[i].itemStart)&&(t[e].fieldOptions[i].fieldStart=t[e].fieldOptions[i].itemStart),!1===occ.isNothingOrEmpty(t[e].fieldOptions[i].itemEnd)&&(t[e].fieldOptions[i].fieldEnd=t[e].fieldOptions[i].itemEnd);c&&t[e].cv.push(l[o])}Array.isArray(t[e].classes)?t[e].classes.push("ocTag-Item"):t[e].classes=["ocTag-Item"],!1===occ.isNothingOrEmpty(t[e].eFieldId)&&(t[e].attributes=[{name:"data-eFieldId",value:t[e].eFieldId}])}occ.createFields(t,c),o.setAttribute("data-lv",""),occ.addClass(o,"ocTagCtrl"),"false"===o.getAttribute("data-autoupdate")&&occ.saveTagControl(document.getElementById(e.controlId)),!0===occ.hasClass(o,"disabled")&&occ.disableForm(o.id,!0),occ.removeClass(o,"emptyGroup");let i=o.querySelectorAll("div.ocField.readOnly.emptyField").length;if(i>0){i===o.querySelectorAll("div.ocField").length&&occ.addClass(o,"emptyGroup")}let a=occ.getNearest(o,"ocFormContainer",!0);a&&occ.hasClass(a,"compareMode")&&occ.setOCFormMode(a,"compare",!0)}else occ.hideObj(o);occ.loadOCFormCheck(e.controlId+"-ctrl",!0),occ.removeClass(o,"loading"),occ.triggerEvent(o,"load")},onFailure:function(e,t,o){console.log("loadTagControl Error")}}).put("/api/tag/GetTagControl",e)},ocCommon.prototype.saveTagControl=function(e){let t=occ.getElementFromString(e.currentTarget?e.currentTarget:e),o=occ.getNearest(t,"ocTagCtrl");if(!1===occ.hasClass(o,"autoUpdate")){if(!o)return;let e=[],t=o.querySelectorAll("div.ocField:not(.innerDDL)");for(let l=0;l<t.length;l++){let c=occ.hasClass(t[l],"retainDelete"),i=document.getElementById(t[l].id.replace("-ctrl","")),a=i.value;if(!1===occ.isNullOrEmpty(a)){a=JSON.parse(a);for(let t=0;t<a.length;t++)if(!0===c||!1===a[t].deleted){let l={eTagId:a[t].fieldValue};l.TagId=a[t].fieldOptionId,l.TagStatus=!0===a[t].deleted?"D":"A",l.ItemId=o.getAttribute("data-ItemId"),l.TagEntity=o.getAttribute("data-ItemEntity"),l.TagName=a[t].fieldOption,l.ItemText=a[t].fieldFillIn,l.ItemStart=a[t].fieldStart,l.ItemEnd=a[t].fieldEnd,l.etCatId=i.parentElement.getAttribute("data-efieldid"),e.push(l)}}}document.getElementById(o.id.replace("-ctrl","")).value=JSON.stringify(e),o.querySelector("input.ocFormField.dirty")?occ.addClass(o,"dirty"):occ.removeClass(o,"dirty")}else{var l=new ocAjax({jsonResponse:!1,showWaiting:!1,jsonRequest:!0,onSuccess:function(){},onFailure:function(e,t,o){console.log("saveTagControl: "+e+"("+t+")")}});t=document.getElementById(t.id.replace("-ip",""));let e=occ.hasClass(t.parentElement,"retainDelete"),c=t.value;if(!0===occ.isNullOrEmpty(c))return;c=JSON.parse(c);let i=[];for(let t=0;t<c.length;t++)!0!==e&&!1!==c[t].deleted||i.push({eTagId:c[t].fieldValue,TagId:c[t].fieldOptionId,TagStatus:!0===c[t].deleted?"D":"A",ItemId:o.getAttribute("data-ItemId"),TagEntity:o.getAttribute("data-ItemEntity"),ItemText:c[t].fieldFillIn,ItemStart:c[t].fieldStart,ItemEnd:c[t].fieldEnds});l.post("/api/tag/PostTagItem",i)}},ocCommon.prototype.setTagControlValues=function(e,t,o){e=occ.getElementFromString(e),"string"==typeof t&&t.indexOf("{")>-1&&(t=JSON.parse(t));var l=e.parentElement.querySelectorAll("div.ocField.ocFormField > input.ocField.ocFormField");let c=[];if(1==Array.isArray(t)&&t.length>0&&!1===occ.isNothingOrEmpty(t[0].eTagId))for(let e=0;e<l.length;e++){c=[];let i=l[e].parentElement.getAttribute("data-eid");for(let e=0;e<t.length;e++)if(i===t[e].etCatId){let o={};o.fieldOption=t[e].TagName?t[e].TagName:t[e].tagName,o.fieldValue=t[e].eTagId,o.etCatId=t[e].etCatId,o.fieldFillIn=t[e].ItemText?t[e].ItemText:t[e].fieldFillIn,!1===occ.isNothingOrEmpty(t[e].itemText)&&(o.fieldFillIn=t[e].itemText),o.fieldStart=t[e].ItemStart?t[e].ItemStart:t[e].fieldStart,!1===occ.isNothingOrEmpty(t[e].itemStart)&&(o.fieldStart=t[e].itemStart),o.fieldEnd=t[e].ItemEnd?t[e].ItemEnd:t[e].fieldEnd,!1===occ.isNothingOrEmpty(t[e].itemEnd)&&(o.fieldEnd=t[e].itemEnd),c.push(o)}occ.updateField(l[e].id,null,c,o)}else{c=t;
3for(let e=0;e<l.length;e++)occ.updateField(l[e].id,null,c,o)}},ocCommon.prototype.qtyUp=function(e){let t=e.currentTarget.parentElement;!0===occ.hasClass(t,"fieldImage")&&(t=t.parentElement);let o=!0===occ.isNullOrEmpty(t.getAttribute("data-max"))?1:1*t.getAttribute("data-max"),l=t.querySelector("input");if(l&&"hidden"!==l.getAttribute("type")){let e=1*l.value;o>e&&(e+=1,t.querySelector("input").value=e)}occ.addFieldValue(e)},ocCommon.prototype.qtyCbxDown=function(e){if(!0===occ.hasClass(e.currentTarget,"isDisabled")){let t=occ.getNearest(e.currentTarget,"controlList",!0,"div");t=t.querySelector('input[type="radio"]:checked'),t&&setTimeout(function(){t.checked=!0,occ.qtyCbx({currentTarget:t})},100)}else{let t=e.currentTarget;setTimeout(function(){t.checked=!0,occ.qtyCbx({currentTarget:t})},100)}},ocCommon.prototype.qtyCbx=function(e){if(!0===occ.hasClass(e.currentTarget,"isDisabled"))return void(e.currentTarget.checked=!1);let t=e.currentTarget;setTimeout(function(){!0===t.checked?t.value="1":t.value="0";let e=occ.getNearest(t,"ocFormField",!0,"div");if(e.querySelector("button.storeBtn")){let t=0,o=e.querySelectorAll("input");for(let e=0;e<o.length;e++)1*o[e].value>0&&(t+=1);t>0?occ.disableControl(e.querySelector("button.storeBtn"),!1):occ.disableControl(e.querySelector("button.storeBtn"),!0)}occ.addFieldValue({currentTarget:t})},10)},ocCommon.prototype.qtyDown=function(e){let t=e.currentTarget.parentElement,o=1*t.querySelector("input").value;o>0&&(o-=1,t.querySelector("input").value=o),occ.addFieldValue(e)},ocCommon.prototype.qtyKeyDown=function(e){let t=e.keyCode;(t<48||t>57)&&(e.preventDefault(),e.stopPropagation())},ocCommon.prototype.qtyKeyUp=function(e){let t=e.currentTarget,o=1*t.parentElement.getAttribute("data-max");o<1*t.value?t.value=o:0>1*t.value&&(t.value=0),occ.addFieldValue(e)};let ffvAttempt=0;ocCommon.prototype.filterFieldValue=function(e,t){let o=document.getElementById(e);if(!document.getElementById(e+"-ctrl")){if(ffvAttempt<5){let o=e,l=t;setTimeout(function(){ffvAttempt++,occ.filterFieldValue(o,l)},500)}return}if(ffvAttempt=0,!o)return;let l=[],c=document.getElementById(e+"-dl");if(c&&c.children?l=c.children:!0===occ.hasClass(o,"divSelect")&&(l=o.parentElement.querySelectorAll("div.option"),occ.setOcFieldSelect(e,0)),!1===occ.isNullOrEmpty(t)){let c=0,i=0;occ.disableControl(e,!1);for(let e=0;e<l.length;e++)l[e].getAttribute("data-fieldGroup")===t||"--any--"===l[e].getAttribute("data-fieldGroup")?(occ.showObj(l[e]),0===i&&(i=e),c++):occ.hideObj(l[e]);occ.hideObj(document.getElementById(e+"-ctrl").querySelector(".ocFieldParentMSG")),!1===occ.isNullOrEmpty(o.value)?occ.setOcFieldSelect(e,o.value):2===c&&i>0&&occ.setOcFieldSelect(e,i)}else document.getElementById(e+"-ctrl")&&null!==document.getElementById(e+"-ctrl")&&(occ.showObj(document.getElementById(e+"-ctrl").querySelector(".ocFieldParentMSG")),occ.updateField(e,null,""),occ.showObj(l),occ.disableControl(e,!0));occ.checkInputControl(e)},ocCommon.prototype.confirmValue=function(e){let t=e.currentTarget,o=document.getElementById(t.id.replace("-cp",""));occ.removeClass(t.parentElement,"nomatch"),t.value!==o.value&&occ.addClass(t.parentElement,"nomatch")},ocCommon.prototype.folderInputControlClick=function(e){let t=e.currentTarget.parentElement.querySelector("input.ocInputControl-hp");t.setAttribute("webkitdirectory","webkitdirectory"),t.setAttribute("directory","directory"),t.setAttribute("multiple","true"),t.click()},ocCommon.prototype.fileInputControlReplace=function(e){e.currentTarget.parentElement.querySelector("input.ocInputControl-hp").click()},ocCommon.prototype.fileInputControlImgPV=function(e){let t,o,l,c="Preview",i=occ.eid(),a='<img id="IMGPV'+i+'" style="width: 100%;height: 100%;object-fit: contain;">';if("IMG"===e.tagName?(o=e,t=e.parentElement.parentElement.querySelector("input.captionInput"),t&&(c+=": "+t.value)):occ.hasClass(e,"s-play")?(l=e.parentElement.parentElement.getAttribute("data-vurl"),a='<div id="IMGPV'+i+'"></div>'):(o=e.querySelector("img"),t=e.querySelector("b"),t&&(c+=": "+t.innerHTML)),o||!1===occ.isNothingOrEmpty(l)){occ.msgDlg(c,'<div style="width: calc(100% - 10px
3);height: calc(100% - 20px);text-align: center;">'+a+"</div>","large",[{id:"close-"+occ.eid(),content:"Close",onClick:function(e){occ.dlgMsg.content.innerHTML="",occ.dlgMsg.close()},align:"L"}]);let e=document.getElementById("IMGPV"+i);if(e)if(!1===occ.isNothingOrEmpty(l))occ.embedVideoCode(l,!1,e.parentElement);else{let t=o.getAttribute("src");t=t.replace("&s=thumb","&s=large"),e.src=t}else occ.dlgMsg.close()}},ocCommon.prototype.fileInputControlDelete=function(e){let t=null,o=null,l=null;if("BUTTON"===e.currentTarget.tagName&&occ.hasClass(e.currentTarget,"hpDel")?(t=e.currentTarget.parentElement.querySelector("div.pvRow").children[0],t.nextElementSibling&&occ.hasClass(t.nextElementSibling,"filePV_temp")&&(t=t.nextElementSibling),o=e.currentTarget.parentElement.querySelector("input.ocInputControl-hp"),l=e.currentTarget.parentElement.querySelector("input.ocInputControl-ip")):"BUTTON"===e.currentTarget.tagName&&occ.hasClass(e.currentTarget,"ocTable-DelButton")?(t=occ.getNearest(e.currentTarget,"ocTable-row",!0,"div"),l=t.parentElement.parentElement.parentElement.querySelector("input.ocInputControl-ip"),o=document.getElementById(l.id+"-hp")):!0!==e.isTrusted||"DIV"!==e.currentTarget.tagName&&"IMG"!==e.currentTarget.tagName||!1!==occ.hasClass(e.currentTarget,"icon")?(t=e.currentTarget,occ.hasClass(t,"icon")&&(t=e.currentTarget.parentElement),o=t.parentElement.parentElement.querySelector("input.ocInputControl-hp"),l=t.parentElement.parentElement.querySelector("input.ocInputControl-ip")):occ.fileInputControlImgPV(e.currentTarget),!t||null===t)return;let c=t.getAttribute("data-fileId");if(!0===occ.hasClass(t,"ocTable-row")&&(c=t.getAttribute("data-rid")),occ.hasClass(t,"filePV_temp")){if(o.value="",occ.removeClass(o.parentElement,"invalidFile"),!1===o.multiple){let e=[];!0===occ.hasClass(t,"ocTable-row")?e=t.parentElement.querySelectorAll("div.filePV_DB.delete > .opoClient-btn.ocTable-DelButton"):occ.removeClass(l.parentElement,"hasFile"),1===e.length&&occ.triggerEvent(e[0])}let e=t.parentElement;t.remove(),occ.updateImageJSON({currentTarget:e}),e&&0===e.children.length&&occ.removeClass(l.parentElement,"hasFile")}(occ.hasClass(t,"filePV_DB")||occ.hasClass(t,"fileVideo_temp"))&&(occ.toggleClass(t,"delete"),occ.removeClass(l.parentElement,"hasFile"));let i=JSON.parse(l.value);for(let e=0;e<i.length;e++)null!==i[e]&&i[e].eFileId===c&&(!0===i[e].delete?i[e].delete=!1:1*i[e].eFileId<0?(i.splice(e,1),e--):i[e].delete=!0);l.value=JSON.stringify(i),occ.checkInputControl(l.id),occ.triggerEvent(l.parentElement,"change")},ocCommon.prototype.fileInputControlCB=function(e){try{let o=e.currentTarget;const l=occ.isNothingOrEmpty(o.parentElement.getAttribute("data-fileLimit"))?0:1*o.parentElement.getAttribute("data-fileLimit");let c=o.parentElement.querySelectorAll(".filePV_temp");for(let e=0;e<c.length;e++)c[e].remove();if(occ.removeClass(o.parentElement,"invalidFile"),o.files.length>0){if(l>0&&o.files.length>l)return occ.msgDlg("File Limit Exceeded","You can only upload a maximum of "+l+" files at a time.","mini"),void(o.value="");let e=!0,c=o.getAttribute("accept");"image/*"===c&&(c=".png, .jpg, .jpeg, .gif, .svg");let i=c.replaceAll(" ","").split(",");for(let t=0;t<o.files.length;t++){let l=o.files[t].name.toLowerCase();l=l.substring(l.lastIndexOf("."));let c=!1;for(let e=0;e<i.length;e++)i[e]===l&&(c=!0);!1===c&&(occ.addClass(o.parentElement,"invalidFile"),e=!1)}if(!1===e)o.value="";else{let e=0,l=occ.hasClass(o.parentElement,"ocimageplus")||occ.hasClass(o.parentElement,"ocfileplus"),c=null;l&&(c=occ.createImagePlusHeader(o.parentElement));for(let i=0;i<o.files.length;i++){let a=o.files[i].name.toLowerCase();a=a.substring(a.length-6),a=a.substring(a.indexOf(".")+1);let n={fileType:a,eFileId:occ.eid()+""+i,fileUrl:"",fileCaption:"",fileTitle:o.files[i].name,fileNo:i};var t=new FileReader;t.readAsDataURL(o.files[i]),t.onload=function(t){n.src=t.target.result,n.name=o.files[i].name,n.fileType=a,!0!==occ.hasClass(o.parentElement,"ocimageplus")&&!0!==occ.hasClass(o.parentElement,"ocfileplus")||(n.fileCaption=o.files[i].name.replace("."+a,"")),e++,occ.createImagePlusRow(c,n,o),e===o.files.length&&l&&occ.updateImageJSON({currentTarget:c})}}}}if(!0!==o.multiple){c=o.parentElement.querySelectorAll(".filePV_DB");for(let e=0;e<c.length;e++)!1===occ.hasClass(c[e],"delete")&&occ.triggerEvent(c[e])}o.removeAttribute("webkitdirectory"),o.removeAttribute("directory"),o.removeAttribute("multiple"),occ.checkInputControl(e)}catch(e){console.log("fileInputControlCB:"+e)}},ocCommon.prototype.chooseResource=function(e){let t=e.currentTarget;occ.hideObj(t),occ.showObj(t.id.replace("-select","-cancel"));let o=t.parentElement,l=o.id.replace("-ctrl",""),c=document.querySelectorAll("div.ocInputControl .resourceContainer");for(let e=0;e<c.length;e++)!0===occ.hasClass(c[e].parentElement,"openResource")&&occ.chooseResourceClose(c[e].parentElement.id.replace("-ctrl",""));let i=document.getElementById(l+"-ctrl").querySelector("div.resourceContainer");i?i.innerHTML="":(o.appendChild(occ.createDiv("",["resourceContainer"])),i=document.getElementById(l+"-ctrl").querySelector("div.resourceContainer")),occ.showWaiting(0,null,"Loa
3ding Resources...");let a=new ocAjax({jsonResponse:!1,jsonRequest:!1,showWaiting:!1,onSuccess:function(e){let t=document.querySelector("script.resourcesScript"),c=occ.createDiv("");c.innerHTML=e;let a=c.querySelector("script"),n=!1;t?"true"!==o.getAttribute("data-multiple")&&(resourcePageDefID=document.getElementById(l).value):(t=occ.createElement("script",["resourcesScript"]),t.innerHTML=a.innerHTML+"",n=!0),a.remove(),i.innerHTML=c.innerHTML,c.innerHTML="",!0===n&&document.body.appendChild(t),occ.hideWaiting(),occ.addClass(o,"openResource"),occ.showObj(i);try{afterResourceLoad(l)}catch(e){console.log(e)}},onFailure:function(e,t,o){occ.hideWaiting(),console.log("chooseResource Error: "+e+"("+t+")")}}),n="/Resources?";!0===occ.hasClass(o,"ocsystemresource")&&(n="/admin/SystemResources?"),!0===occ.hasClass(o,"ocsystemadminresource")&&(n="/systemadmin/AllSystemResources?"),!1===occ.isNullOrEmpty(o.getAttribute("data-accepts"))&&(n+="da="+o.getAttribute("data-accepts")+"&"),!1===occ.isNothingOrEmpty(o.getAttribute("data-eTenantId"))&&(n+="tId="+encodeURIComponent(o.getAttribute("data-eTenantId"))+"&");let r="chooser";"true"===o.getAttribute("data-multiple")?r="mchooser":n+="c="+document.getElementById(l).value+"&",a.get(n+"pm="+r+"&i="+l)},ocCommon.prototype.finishChooseResource=function(e){occ.loadOcButtons();let t=document.getElementById(e);if(!1===occ.isNullOrEmpty(t.value)&&"true"===t.parentElement.getAttribute("data-multiple")){let o=JSON.parse(t.value);for(let t=0;t<o.length;t++){let l=document.querySelector("#"+e+'-ctrl div.ocTable-row[data-rid="'+occ.checkSelector(o[t].eFileId)+'"]');l&&(l.setAttribute("data-fileTitle",o[t].fileTitle),l.setAttribute("data-fileUrl",o[t].fileUrl),occ.addClass(l,"rowSelected"))}}},ocCommon.prototype.chooseResourceCB=function(e,t,o,l){if(null===e){let t=document.querySelector(".ocInputControl.openResource");if(!t)return;e=t.id.replace("-ctrl","")}let c=document.getElementById(e),i=c.parentElement.querySelector("div.ocInputControl-resources");if(i&&(i.innerHTML=""),"true"===c.parentElement.getAttribute("data-multiple")){let t=[],o="",l=document.querySelectorAll("#"+e+"-ctrl div.rowSelected"),a="^";for(let e=0;e<l.length;e++)if(-1===a.indexOf("^"+l[e].getAttribute("data-rid")+"^")){""!=o&&(o+=","),o+="["+l[e].getAttribute("data-fileTitle")+"]";let c=l[e].getAttribute("data-filetype");i&&("pdf"===c?i.appendChild(occ.createDiv("",["icon","s-pdf","sz6","rv"],null)):"mp4"===c?i.appendChild(occ.createDiv("",["icon","s-play","sz6","rv"],null)):0===l[e].getAttribute("data-fileUrl").toLowerCase().indexOf("http")?i.appendChild(occ.createDiv("",["icon","s-link","sz6","rv"],null)):i.appendChild(occ.createElement("img",null,[{name:"src",value:l[e].getAttribute("data-fileUrl")+"&s=thumb"}]))),a+=l[e].getAttribute("data-rid")+"^",t.push({fileId:0,eFileId:l[e].getAttribute("data-rid"),fileTitle:l[e].getAttribute("data-fileTitle"),fileUrl:l[e].getAttribute("data-fileUrl")})}return c.value=JSON.stringify(t),t.length>0&&(occ.addClass(e+"-ctrl","hasValue"),o="("+t.length+") "+o),document.getElementById(e+"-hp").value=o,occ.chooseResourceClose(e),occ.checkInputControl(e),void occ.changeInputControlCB(c)}if(occ.removeClasses(e+"-ctrl",["hasValue","hasIcon"]),o&&!0!==occ.isNullOrEmpty(o)){let i={eFileId:o,fileTitle:t,fileUrl:l};occ.addClass(e+"-ctrl","hasValue"),c.value=i.eFileId?i.eFileId:"",document.getElementById(e+"-hp").value=i.fileTitle?i.fileTitle:"";let a=c.parentElement.querySelector("img.ocInputControl-icon");a&&(a.src=i.fileUrl+"&s=thumb",occ.addClass(c.parentElement,"hasIcon"))}else c.value="",document.getElementById(e+"-hp").value="";occ.chooseResourceClose(e),occ.checkInputControl(e),occ.changeInputControlCB(c)},ocCommon.prototype.chooseResourceClear=function(e){occ.chooseResourceClose(e);let t=e.currentTarget.id.replace("-clear","");document.getElementById(t+"-hp").value="",document.getElementById(t).value="",occ.removeClasses(document.getElementById(t+"-ctrl"),["hasValue","hasIcon"]);let o=document.querySelector("#"+t+"-ctrl div.ocInputControl-resources");o&&(o.innerHTML=""),occ.checkInputControl(t),occ.changeInputControlCB(document.getElementById(t))},ocCommon.prototype.chooseResourceClose=function(e){let t;t="string"==typeof e?e:e.currentTarget.id.replace("-cancel",""),t=t.replace("-clear",""),occ.hideObj(t+"-cancel"),occ.showObj(t+"-select"),occ.hideObj(document.getElementById(t+"-ctrl").querySelector("div.resourceContainer")),occ.removeClass(t+"-ctrl","openResource")},ocCommon.prototype.addImagePlusVideo=function(e){occ.ipvField=e.currentTarget.parentElement;let t=occ.hasClass(occ.ipvField,"allowMP4")?" allowMP4":"",o='<p><div id="'+occ.ipvField.id.replace("-ctrl","-videoUrl")+'" class="ocInputControl-obj'+t+'" data-label="Video URL" data-type="videolink"></div></p>';occ.msgDlg("Add a Video",o,"small",[{id:"addImagePlusVideo-y",content:"Add",onClick:occ.addImagePlusVideoCB},{id:"addImagePlusVideo-c",content:"Cancel",onClick:function(e){occ.dlgMsg.close(),occ.ipvField=null},align:"L"}]),occ.createInputControl(occ.ipvField.id.replace("-ctrl","-videoUrl")),document.getElementById(occ.ipvField.id.replace("-ctrl","-videoUrl")).focus()},ocCommon.prototype.addImagePlusVideoCB=function(e){if(!occ.ipvField||null===occ.ipvField)return;let t=document.getElementById(occ.ipvField.id.replace("-ctrl","-videoUrl"));if(!1===occ.isNullOrEmpty(t.value)&&!0===occ.hasClass(t,"dirty")&&!1===occ.hasClass(t,"invali
3d")){t.value=t.value.replace("https%3A//","https://");let e=occ.createImagePlusHeader(occ.ipvField),o={fileType:"play",eFileId:occ.eid(),fileNo:-1,fileUrl:t.value,name:t.value,fileCaption:"",fileTitle:"Video Item",src:null};occ.dlgMsg.close(),occ.createImagePlusRow(e,o,null),occ.updateImageJSON({currentTarget:e}),occ.checkInputControl({currentTarget:occ.ipvField}),occ.ipvField=null}},ocCommon.prototype.createImagePlusHeader=function(e){let t=occ.hasClass(e,"ocfileplus"),o=e.querySelector("div.imageTbl");if(!o){o=occ.createDiv("",["imageTbl"],[{name:"id",value:e.id.replace("-ctrl","-tbl")}]);let l=occ.createDiv('<div class="minWidth mobileCol center">'+(t?"File":"Image")+'</div><div class="mobileCol">'+(t?"File Title":"Image Caption")+' <span style="font-weight:normal; font-size:11px;">(also for screen readers)</span></div>',["ocTable-head"]);o.appendChild(l),e.appendChild(o)}return o},ocCommon.prototype.createImagePlusRow=function(e,t,o,l){let c=t.fileType;occ.isNothingOrEmpty(c)&&t.fileName.indexOf(".")>0&&(c=t.fileName.toLowerCase().substring(t.fileName.length-6),c=c.substring(c.indexOf(".")+1));let i=occ.createDiv(""),a=null,n=!(!e||null===e);if(!0===n)a=occ.createDiv("",["filePV","filePVRow"]),a.setAttribute("data-rid",t.eFileId),!1===isNaN(t.fileNo)&&a.setAttribute("data-fid",t.fileNo);else if(i.setAttribute("data-fileId",t.eFileId),occ.addClass(i,"filePV"),""===t.fileUrl?occ.addClass(i,"filePV_temp"):occ.addClass(i,"filePV_DB"),"true"===o.parentElement.getAttribute("data-multiple")){let e=occ.createDiv("",["icon","s-x","sz2","delIcon"]);occ.addClickEvent(e,occ.fileInputControlDelete),i.appendChild(e)}else occ.addClickEvent(i,occ.fileInputControlDelete);let r=occ.createDiv();if("png"===c||"jpg"===c||"jpeg"===c||"gif"===c||"tif"===c||"svg"===c||"webp"===c?(r=occ.createElement("img",["icon-"+c]),""===t.fileUrl?(r.src=t.src,null!==a&&(a.setAttribute("data-name",t.name),occ.addClass(a,"filePV_temp"))):(occ.addClass(a,"filePV_DB"),r.src=t.fileUrl+("svg"===c?"":"&s=thumb")),occ.addClickEvent(r,occ.fileInputControlDelete)):(r.style.margin="0","mp4"===c||"mov"===c?c="play":"pdf"!==c&&"play"!==c&&(c="doc"),r.classList="icon s-"+c+" tr sz4","play"===c?(occ.addClass(a,"fileVideo_temp"),a.setAttribute("data-vurl",t.fileUrl),occ.addClickEvent(r,occ.fileInputControlDelete),r.style.cursor="pointer"):occ.addClass(a,"filePV_DB")),!0===n){""===t.fileUrl&&a.setAttribute("data-fid",t.fileNo);let o=occ.createDiv("",["center"]);o.style.width="45px",o.appendChild(r),a.appendChild(o);let l=occ.createDiv("",["captionRow"]),c=e.parentElement.getAttribute("data-maxlength");occ.isNullOrEmpty(c)&&(c="100");let i=occ.createElement("input",["captionInput"],[{name:"type",value:"text"},{name:"maxLength",value:c}]);i.style.width="calc(100% - 10px)",i.style.marginRight="10px",i.setAttribute("placeholder","enter a caption"),i.setAttribute("onchange","occ.captionChange(event)"),i.setAttribute("onload","occ.captionChange(event)"),!1===occ.isNothingOrEmpty(t.fileCaption)&&(i.value=t.fileCaption),l.appendChild(i),a.appendChild(l)}else i.appendChild(r),t.fileTitle&&i.appendChild(occ.createElement("B",null,null,t.fileTitle));if(n)occ.addTableRow(e.id,a,null,null,null,null,occ.fileInputControlDelete),!0!==l&&occ.setUpTable(e.id,!0,occ.updateImageJSON);else{let e=o.parentElement.querySelector("div.pvRow");if(!e){e=occ.createDiv("",["pvRow"]);let t=o.parentElement.querySelector("button.opoClient-btn.replaceBtn");o.parentElement.querySelector("div.cvDiv")?o.parentElement.insertBefore(e,o.parentElement.querySelector("div.cvDiv")):t?t.parentElement.insertBefore(e,t):o.parentElement.appendChild(e)}e=o.parentElement.querySelector("div.pvRow"),e.appendChild(i),e.querySelectorAll("div.filePV.filePV_temp").length>5?occ.addClass(e,"list"):occ.removeClass(e,"list"),occ.addClass(o.parentElement,"hasFile")}},ocCommon.prototype.captionChange=function(e){if(occ.hasClass(e.currentTarget.parentElement,"captionRow")){let t=e.currentTarget.parentElement.parentElement.querySelector("div.ocTable-SummaryCell > input.captionInput");t&&(t.value=e.currentTarget.value)}else{let t=occ.getNearest(e.currentTarget,"ocTable-row",!0,"div");if(t){let o=t.querySelector("div.ocTable-cell > input.captionInput");o&&("load"===e.type?e.currentTarget.value=o.value:o.value=e.currentTarget.value)}}"load"!==e.type&&occ.updateImageJSON(e)},ocCommon.prototype.updateImageJSON=function(e){let t=[],o=!0===occ.hasClass(e.currentTarget,"ocTable")?e.currentTarget:occ.getNearest(e.currentTarget,"ocTable",!0,"div");if(o){let e=o.parentElement.querySelector("input.ocInputControl-ip.ocFormField"),l=e.value;t=occ.isNothingOrEmpty(l)?[]:JSON.parse(l),o=o.querySelectorAll("div.ocTable-row");for(let e=0;e<o.length;e++){let l=!1;for(let c=0;c<t.length;c++)if(t[c].eFileId===o[e].getAttribute("data-rid")){l=!0,t[c].fileOrder=e+1,isNaN(1*t[c].fileNo)&&(t[c].fileNo=1*o[e].getAttribute("data-fid")),isNaN(1*t[c].fileNo)&&(t[c].fileNo=1e7);let i=o[e].querySelector("input.captionInput");i&&(t[c].fileCaption=i.value)}if(!1===l){let l={eFileId:o[e].getAttribute("data-rid"),fileOrder:e+1,fileNo:1*o[e].getAttribute("data-fid")},c=o[e].getAttribute("data-vurl");!1===occ.isNullOrEmpty(c)&&(l.fileName=c);let i=o[e].querySelector("input.captionInput");i&&(l.fileCaption=i.value);let a=o[e].getAttribute("data-name");!1===occ.isNullOrEmpty(a)&&(l.fileTitle=a),t.push(l)}}e.value=JSON.stringify(t),occ.checkInputControl(e.id)}},ocCommon.prototype.reviewFamily=function(e,t,o,l){if(!(e=occ.getElementFromString(e)))return;if(occ.isNothingOrEmpty(l)&&!1===this.isNothingOrEmpty(e.getAttribute("data-famSelector"))){let t=e.getAttribute("data-famSelector");if(0===t.indexOf("[")){let o=JSON.parse(t);for(let t=0;t<o.length;t++)occ.reviewFamily(e,null,null,o[t]);return}l=t}occ.isNothingOrEmpty(l)&&(l=".ocFamily");let c=e.querySelectorAll(":scope > "+l);if(c.length>0){let i=[],a=!1;if(!1===this.isNothingOrEmpty(e.getAttribute("data-famSelector"))){let t=e.getAttribute("data-famSelector");0===t.indexOf("[")?i=JSON.parse(t):i.push(t);for(let e=0;e<i.length;e++)i[e]===l&&(a=!0)}if(!1===a&&i.push(l),l=JSON.stringify(i),!1===occ.isNothingOrEmpty(l)&&e.setAttribute("data-famSelector",l),t&&null!==t||o&&null!==o){let l=["ocFamilyHead"];!0===t&&l.push("familyHt"),!0===o&&l.push("familyWd"),occ.addClasses(e,l)}
3else t=occ.hasClass(e,"familyHt"),o=occ.hasClass(e,"familyWd");if(!0===t||!0===o)if(occ.isMobile&&!1===occ.hasClass(e,"ignoreMobile"))for(let e=0;e<c.length;e++)!0===t&&(c[e].style.height="auto"),!0===o&&(c[e].style.width="auto");else{let e=0,l=0;for(let i=0;i<c.length;i++){let a=getComputedStyle(c[i]);if(!0===t){c[i].style.height="auto";let t=parseInt(a.paddingTop),o=parseInt(a.paddingBottom),l=c[i].clientHeight-t-o;l>e&&(e=l)}if(!0===o){c[i].style.width="auto";let e=parseInt(a.paddingLeft),t=parseInt(a.paddingRight),o=c[i].clientWidth-e-t;o>maxHmaxWidtheight&&(l=o)}}for(let i=0;i<c.length;i++)!0===t&&(c[i].style.height=e+"px"),!0===o&&(c[i].style.width=l+"px")}}},ocCommon.prototype.fitInTheFamily=function(e,t,o){let l=occ.getElementFromString(e);if(l&&null!==l){let e=l.offsetHeight-l.clientHeight,c=l.offsetWidth-l.clientWidth;if(l.style.height="",l.style.width="",occ.hideObj(l),!0===t){let t=l.parentElement.clientHeight,o=l.parentElement.offsetHeight-t;if(t>0){let c=e+o;for(let e=0;e<l.parentElement.children.length;e++)if(l!==l.parentElement.children[e]){let t=getComputedStyle(l.parentElement.children[e]),o=parseInt(t.marginTop),i=parseInt(t.marginBottom);c+=l.parentElement.children[e].offsetHeight+o+i}occ.showObj(l),l.style.height=t-c+"px"}}if(!0===o){let e=l.parentElement.clientWidth,t=l.parentElement.offsetWidth-e;if(e>0){let o=c+t;for(let e=0;e<l.parentElement.children.length;e++)l!==l.parentElement.children[e]&&(o+=l.parentElement.children[e].offsetWidth);occ.showObj(l),l.style.width=e-o+"px"}}}};var scrollElemList=!1;ocCommon.prototype.turnOnScrollY=function(){occ.removeClass(document.querySelectorAll(".scroll-y.scroll-y-disabled"),"scroll-y-disabled"),occ.removeClass(document.querySelectorAll(".scroll-y.importantEmphasis"),"importantEmphasis")},ocCommon.prototype.turnOffScrollY=function(){occ.addClass(document.querySelectorAll(".scroll-y"),"scroll-y-disabled"),occ.addClass(document.querySelectorAll(".scroll-y.scroll-y-disabled"),"importantEmphasis")},ocCommon.prototype.toggleScrollY=function(){!0!==scrollElemList?(scrollElemList=!0,occ.turnOffScrollY()):(scrollElemList=!1,occ.turnOnScrollY())},ocCommon.prototype.escapeGuid=function(e){return e.replace(/(:|\.|\[|\]|\/|,|=|@)/g,"\\$1")},ocCommon.prototype.initObserver=function(e){let t=[];if("string"==typeof e){if(!occ.getElementFromString(e))return;occ.addClass(e,"observeMe"),t.push(document.getElementById(e))}e&&e.tagName&&(occ.addClass(e,"observeMe"),t.push(e)),e||(t=document.querySelectorAll(".observeMe"));for(let e=0;e<t.length;e++){let o=!1===occ.isNullOrEmpty(t[e].getAttribute("data-threshold"))?1*t[e].getAttribute("data-threshold"):.75,l=!1===occ.isNullOrEmpty(t[e].getAttribute("data-root"))?t[e].getAttribute("data-root"):"0px",c={root:t[e],rootMargin:l,threshold:o},i=new IntersectionObserver(occ.respondToObserver,c),a=t[e].querySelectorAll(".observeChild");for(let e=0;e<a.length;e++)!1===occ.hasClass(a[e],"observing")&&(i.observe(a[e]),occ.addClass(a[e],"observing"))}},ocCommon.prototype.respondToObserver=function(e,t){e.forEach(e=>{if(!0===e.isIntersecting){let t=e.target.querySelectorAll("img[data-src]");for(let e=0;e<t.length;e++)!0===occ.isNullOrEmpty(t[e].getAttribute("src"))&&!1===occ.isNullOrEmpty(t[e].getAttribute("data-src"))&&(t[e].setAttribute("src",t[e].getAttribute("data-src")),t[e].removeAttribute("data-src"));t=e.target.querySelectorAll("div[data-bg]");for(let e=0;e<t.length;e++)!0===occ.isNullOrEmpty(t[e].style.backgroundImage)&&!1===occ.isNullOrEmpty(t[e].getAttribute("data-bg"))&&(t[e].style.backgroundImage='url("'+t[e].getAttribute("data-bg")+'")',t[e].removeAttribute("data-bg"));"N"===e.target.getAttribute("observed")&&(e.target.getAttribute("observed","Y"),occ.triggerEvent(e.target,"observed"))}})},ocCommon.prototype.checkMyTables=function(e){for(var t=(e=occ.getElementFromString(e)).querySelectorAll(".ocTable"),o=0;o<t.length;o++)occ.setUpTable(t[o].id)},ocCommon.prototype.setUpTable=function(e,t,o){let l=document.getElementById(e);if(occ.addClass(l,"ocTable"),l&&"table"!==l.nodeName.toLowerCase()){!0===occ.hasClass(e,"oc-orderable")&&(t=!0);let c=l.querySelector(".ocTable-head"),i=l.querySelectorAll(".ocTable-row");
3if(0===i.length?occ.addClass(l,"noRows"):1===i.length?occ.addClass(l,"singleRow"):occ.removeClasses(l,["noRows","singleRow"]),!c||null===c)return;if(!0===t){let e=c.querySelector("div.orderBlank");e||(e=occ.createDiv("",["orderBlank","minWidth"]),c.insertBefore(e,c.children[0]))}l.querySelector("h2")&&occ.addClass(l,"hasTitle");let a=l.querySelector("style"),n="";a&&null!==a||(a=document.createElement("style"),a.type="text/css",l.appendChild(a),a=l.querySelector("style")),a.innerText="";let r=[],s=0,d=0,u=[],p=[],m=[],h=0,g=0;if(occ.addClass(l.querySelectorAll(".ocTable-row"),"checking"),occ.addClass(c,"checking"),!0===t)for(let e=0;e<i.length;e++)i[e].querySelector("div.oc-orderable-tools")||i[e].insertBefore(occ.createDiv("",["orderBlank","minWidth"]),i[e].firstChild);let f=l.querySelectorAll(".ocTable-head > div");for(let e=0;e<f.length;e++){!0===occ.hasClass(f[e],"tbl-rowIndex")?(r.push(30.5),d++):!0===occ.hasClass(f[e],"minWidth")?(!0===occ.hasClass(f[e],"orderBlank")?r.push(55):!0===occ.hasClass(f[e],"allowFilter")?r.push(f[e].clientWidth+22):r.push(f[e].clientWidth+2),u.push(e),d++):""!=f[e].style.width?(r.push(f[e].clientWidth>1&&f[e].clientWidth<50?40:f[e].clientWidth+2),d++):r.push(-1);let t=[];if(!0===occ.hasClass(f[e],"center")&&t.push("center"),!0===occ.hasClass(f[e],"right")&&t.push("right"),!0===occ.hasClass(f[e],"exclude")&&t.push("exclude"),t.length>0)for(let o=0;o<i.length;o++)occ.addClasses(i[o].querySelectorAll(":scope > div")[e],t);if(!0===occ.hasClass(f[e],"mobileCol")){if(!0===occ.hasClass(f[e],"minWidth"))m.push(0),g++;else if(""!=f[e].style.width){let t=f[e].clientWidth;t>2&&(t=t<60?40:t-20),m.push(t),h+=t,g++}else m.push(-1);p.push(e)}}0===i.length&&(i=l.querySelectorAll(".ocTable-head"));for(let e=0;e<i.length;e++)if(!1===occ.hasClass(i[e],"groupParent")){let t=i[e].querySelectorAll("div:scope > div");for(let e=0;e<u.length;e++)t.length>u[e]&&t[u[e]].clientWidth>r[u[e]]&&(r[u[e]]=t[u[e]].clientWidth+2);for(let e=0;e<p.length;e++)occ.addClass(t[p[e]],"ocInternal-mobileCell"),!0===occ.hasClass(f[p[e]],"minWidth")&&t[p[e]].clientWidth-20>m[e]&&(m[e]=t[p[e]].clientWidth,m[e]>2&&(m[e]=m[e]-20,m[e]=m[e]<40?40:m[e]))}for(let e=0;e<r.length;e++)r[e]>0&&(s+=r[e]>2&&r[e]<40&&30.5!==r[e]?40:r[e]);for(let e=0;e<m.length;e++)m[e]>0&&(h+=m[e]>2&&m[e]<40?40:m[e]);for(let e=0;e<r.length;e++)r[e]<0?r[e]=0===d?1/f.length*100+"%":"calc("+100/(r.length-d)+"% - "+s/(r.length-d)+"px)":r[e]=(r[e]>2&&r[e]<40&&30.5!==r[e]?40:r[e])+"px";if(m.length>1){c.querySelector(".ocTable-row-tool")&&(c.parentElement.querySelector(".ocTable-ViewButton")||c.parentElement.querySelector(".ocTable-SelectButton"))&&(m.push(72),h+=72,g++);for(let e=0;e<m.length;e++)m[e]<0?m[e]=0===g?1/p.length*100+"%":"calc("+100/(m.length-g)+"% - "+(20+h)/(m.length-g)+"px)":m[e]=m[e]+"px"}else m=["calc(100% - 30px)"];let y="";for(let e=0;e<r.length;e++)y+=r[e]+" ";let C="";for(let e=0;e<m.length;e++)C+=m[e]+" ";if(n+="#"+occ.checkSelector(e)+" .ocTable-head, #"+occ.checkSelector(e)+" .ocTable-list >.ocTable-row { grid-template-columns:"+y+";}",n+="#"+occ.checkSelector(e)+" div.summaryDiv { grid-template-columns: 20px "+C+";}",n+="@media screen and (max-width: 700px) { #"+occ.checkSelector(e)+" .ocTable-head { grid-template-columns:"+C+";}}",a.styleSheet?a.styleSheet.cssText=n:a.appendChild(document.createTextNode(n)),occ.removeClass(l.querySelectorAll(".checking"),"checking"),c&&(c.clientWidth>0||"ios"==this.clientOs||"mac"==this.clientOs)){let e=l.querySelectorAll(".ocTable-head > div"),o=l.querySelectorAll(".ocTable-row");if(!1===occ.hasClass(l,"noMobileTable")&&!1===occ.hasClass(l,"mobileTable")&&m.length>0&&o&&o.length>0){occ.addClass(l,"mobileTable");for(let i=0;i<o.length;i++)if(!1===occ.hasClass(o[i],"groupParent")){let a=occ.createDiv("",["detailsDiv"],[{name:"id",value:l.id+"-row"+i+"-Detail"}]),n=occ.createDiv("",["summaryDiv"]);occ.addClickEvent(a,occ.summaryDivToggle),n.appendChild(occ.createDiv("",["caretDiv"],[{name:"style",value:"width:20px"}]));let r=o[i].querySelectorAll(".ocTable-row:scope > div");for(let t=0;t<r.length;t++)if(!1===occ.hasClass(r[t],"ocTable-row-tool")&&!1===occ.hasClass(r[t],"orderBlank"))if(!0===occ.hasClass(r[t],"ocInternal-mobileCell")){let o=occ.createDiv(r[t].innerHTML,["ocTable-SummaryCell"]);(occ.hasClass(r[t],"mobileCenter")||occ.hasClass(e[t],"mobileCenter"))&&occ.addClass(o,"mobileCenter"),(occ.hasClass(r[t],"mobileRight")||occ.hasClass(e[t],"mobileRight"))&&occ.addClass(o,"mobileRight"),(occ.hasClass(r[t],"center")||occ.hasClass(e[t],"center"))&&occ.addClass(o,"center"),(occ.hasClass(r[t],"right")||occ.hasClass(e[t],"right"))&&occ.addClass(o,"right");let l=o.querySelectorAll(".opoClient-btn");for(let e=0;e<l.length;e++){let t=l[e].id;l[e].id=t+"-Copy";let o=function(){occ.triggerEvent(t)};occ.addClickEvent(l[e],o)}n.appendChild(o)}else{let o=occ.createDiv("",["rowSummaryChild"]),l=occ.createDiv(e[t].innerHTML,["ocTable-Detail
3Label"]);o.appendChild(l);let c=occ.createDiv(r[t].innerHTML,["ocTable-DetailCell"]);(occ.hasClass(r[t],"mobileCenter")||occ.hasClass(e[t],"mobileCenter"))&&occ.addClass(c,"mobileCenter"),(occ.hasClass(r[t],"mobileRight")||occ.hasClass(e[t],"mobileRight"))&&occ.addClass(c,"mobileRight");let i=c.querySelectorAll(".opoClient-btn");for(let e=0;e<i.length;e++){let t=i[e].id;i[e].id=t+"-Copy";let o=function(){occ.triggerEvent(t)};occ.addClickEvent(i[e],o)}o.appendChild(c),a.appendChild(o)}if(r=o[i].querySelectorAll("div.ocTable-row-tool > button"),r.length>0||!0===t){let e=occ.createDiv("",["ocTable-SummaryCell"]),o=occ.createDiv("",["ocTable-DetailButtons","rowSummaryChild"]);if(!0===t){let e=occ.createAnchor('<div class="icon s-arrow-up tr sz3"></div>',["moveup"]);occ.addClickEvent(e,occ.rowUpClick),o.appendChild(e);let t=occ.createAnchor('<div class="icon s-arrow-down tr sz3"></div>',["movedown"]);occ.addClickEvent(t,occ.rowDownClick),o.appendChild(t)}occ.addClass(e,"noViewBtn");for(let t=0;t<r.length;t++){if(occ.hasClass(r[t],"ocTable-ViewButton")){let t=occ.ocButton(l.id+"-viewBtn"+i,"",occ.rowDetailBtnClick,null,null);occ.addClass(t,"ocTable-viewBtn"),e.appendChild(t),occ.removeClass(e,"noViewBtn")}if(occ.hasClass(r[t],"ocTable-EditButton")){let e=occ.ocButton(l.id+"-editBtn"+i,"",occ.rowEditBtnClick);occ.addClass(e,"ocTable-editBtn"),o.appendChild(e)}if(occ.hasClass(r[t],"ocTable-DelButton")){let e=occ.ocButton(l.id+"-delBtn"+i,"",occ.rowDeleteBtnClick);occ.addClass(e,"ocTable-deleteBtn"),o.appendChild(e)}if(occ.hasClass(r[t],"ocTable-SelectButton")){let t=occ.ocButton(l.id+"-selectBtn"+i,"",occ.rowSelectBtnClick);occ.addClass(t,"ocTable-selectBtn"),e.appendChild(t),occ.removeClass(e,"noViewBtn")}}n.appendChild(e),a.appendChild(o)}if(occ.addClickEvent(a,occ.rowDetailClick),!0===occ.hasClass(o[i],"ocTable-rowclick")&&0===c.querySelectorAll("div.ocTable-row-tool").length){let e=occ.createDiv("",["ocTable-DetailButtons","rowSummaryChild"]),t=occ.ocButton(l.id+"-DetailBtn"+i,"View/Edit this Record",occ.rowDetailBtnClick,"edit",null);e.appendChild(t),a.appendChild(e)}if(a.insertBefore(n,a.children[0]),occ.addClickEvent(a,function(e){occ.tableDetailClose(null,e.currentTarget)}),o[i].appendChild(a),a.querySelector("input")){let e=a.querySelectorAll("input");for(let t=0;t<e.length;t++)occ.triggerEvent(e[t],"load")}}}}if(!0===t&&occ.setUpOrder(e,!1,o),occ.formatDateSpans(l),!1===occ.isNothingOrEmpty(l.getAttribute("data-ss"))&&!1===occ.hasClass(l,"hasSearch")){let t=occ.createDiv("",["ocTableSearchDiv"]);t.setAttribute("data-parent",e),t.setAttribute("data-ss",l.getAttribute("data-ss"));let o=l.getAttribute("data-sp");occ.isNothingOrEmpty(o)&&(o="search this table"),t.setAttribute("data-placeholder",o),occ.createElementSearch(t),l.appendChild(t),occ.addClass(l,"hasSearch")}}},ocCommon.prototype.summaryDivToggle=function(e){let t=e.currentTarget;occ.toggleClass(t,"active")},ocCommon.prototype.tableDetailClose=function(e,t){if(null===(e=occ.getElementFromString(e))&&t&&null!==t&&(e=t.parentElement.parentElement),!1===occ.hasClass(e,"ocTable")&&!1===occ.hasClass(e,"ocTable-list"))return;e.querySelectorAll("detailsDiv.active").forEach(e=>{t&&null!==t&&t.id===e.id||occc.removeClass(e,"active")})},ocCommon.prototype.rowDetailBtnClick=function(e){e.preventDefault(),e.stopPropagation();let t=occ.getNearest(e.currentTarget,"ocTable-row");t.querySelector(".ocTable-ViewButton")?occ.triggerEvent(t.querySelector(".ocTable-ViewButton")):occ.triggerEvent(t)},ocCommon.prototype.rowEditBtnClick=function(e){e.preventDefault(),e.stopPropagation();let t=occ.getNearest(e.currentTarget,"ocTable-row");console.log(t.querySelector(".ocTable-EditButton")),occ.triggerEvent(t.querySelector(".ocTable-EditButton"))},ocCommon.prototype.rowDeleteBtnClick=function(e){e.preventDefault(),e.stopPropagation();let t=occ.getNearest(e.currentTarget,"ocTable-row");occ.triggerEvent(t.querySelector(".ocTable-DelButton"))},ocCommon.prototype.rowSelectBtnClick=function(e){e.preventDefault(),e.stopPropagation();let t=occ.getNearest(e.currentTarget,"ocTable-row");occ.triggerEvent(t.querySelector(".ocTable-SelectButton"))},ocCommon.prototype.rowUpClick=function(e){e.preventDefault(),e.stopPropagation();let t=occ.getNearest(e.currentTarget,"ocTable-row");occ.triggerEvent(t.querySelector(".orderBlank a.moveup"))},ocCommon.prototype.rowDownClick=function(e){e.preventDefault(),e.stopPropagation();let t=occ.getNearest(e.currentTarget,"ocTable-row");occ.triggerEvent(t.querySelector(".orderBlank a.movedown"))},ocCommon.prototype.rowClick=function(e){let t=e.currentTarget;if(occ.hasClass(t,"groupParent")){let e=t.getAttribute("data-groupid");occ.toggleClass(t,"active"),occ.toggleClass(".groupItem-"+e,"active")}else occ.removeClass(".lastActive","lastActive"),occ.addClass(t,"lastActive")},ocCommon.prototype.addTableRow=function(e,t,o,l,c,i,a,n,r){let s=document.getElementById(e);occ.addClass(t,"ocTable-row");let d=t.children;for(let e=0;e<d.length;e++){let t=[];
3"DIV"==d[e].tagName&&(t.push("ocTable-cell"),t.push("rowCell")),"SPAN"==d[e].tagName&&(t.push("rowCell"),t.push("hiddenObj")),t.length>0&&occ.addClasses(d[e],t)}if(s.querySelector("div.ocTable-list")||s.appendChild(occ.createDiv("",["ocTable-list"])),!0!==c){let l=document.getElementById(e).querySelector(".ocTable-head");if(i&&null!==i||a&&null!==a||n&&null!==n||r&&null!==r){let c=document.getElementById(e).querySelectorAll(".ocTable-row").length+occ.eid();occ.addClass(l,"noViewBtn"),l.querySelector("div.ocTable-row-tool")||l.appendChild(occ.createDiv("Tools",["ocTable-row-tool","minWidth"]));let d=occ.createDiv("",["ocTable-row-tool"]);if(n&&null!=n&&(o=n),o){let t=occ.ocButton(e+"-row-V"+c,"",o,null,null);occ.addClasses(t,["ocTable-viewBtn","ocTable-ViewButton"]),d.appendChild(t),occ.removeClass(l,"noViewBtn")}if(i&&null!=i){let t=occ.ocButton(e+"-row-E"+c,"",i,null,null);occ.addClasses(t,["ocTable-editBtn","ocTable-EditButton"]),d.appendChild(t)}if(a&&null!==a){let t=occ.ocButton(e+"-row-D"+c,"",a,null,null);occ.addClasses(t,["ocTable-deleteBtn","ocTable-DelButton"]),d.appendChild(t)}if(r&&null!==r){if(!0===occ.hasClass(s,"multiSelect")){let t=occ.ocButton(e+"-row-DS"+c,"",r,null,null);occ.addClass(t,["ocTable-deselectBtn","ocTable-DeSelectButton"]),d.appendChild(t)}let t=occ.ocButton(e+"-row-S"+c,"",r,null,null);occ.addClasses(t,["ocTable-selectBtn","ocTable-SelectButton"]),d.appendChild(t),occ.removeClass(l,"noViewBtn")}t.appendChild(d)}else o&&(occ.addClickEvent(t,o),occ.addClass(t,"ocTable-rowclick"));l.querySelector("div.ocTable-row-tool")&&!t.querySelector("div.ocTable-row-tool")&&t.appendChild(occ.createDiv("",["ocTable-row-tool"]))}l&&!1===occ.isNullOrEmpty(l)&&(!0===c?occ.addClasses(t,["ocTable-rowclick","groupParent"]):occ.addClasses(t,["groupItem","groupItem-"+l]),t.setAttribute("data-groupid",l)),s&&t&&s.querySelector("div.ocTable-list").appendChild(t),occ.addClickEvent(t,occ.rowClick)},ocCommon.prototype.tableRowDelete=function(e){let t=e.currentTarget,o='<p>Are you sure you want to delete this item: "'+curFile.fileTitle+'"?</p>';occ.msgDlg("Delete Item",o,"mini",[{id:"ocRowDelIitem",content:"Yes",onClick:function(){occ.triggerEvent(t,"onDelete")}},{id:"ocRowDelIitem-cancel",content:"No",onClick:function(e){occ.dlgMsg.close()},align:"L"}])},ocCommon.prototype.clearTable=function(e,t){let o=document.getElementById(e);if(o){o.querySelector("div.ocTable-head")&&(occ.removeClass(o.querySelector(".ocTable-filter"),"filterSet"),occ.removeClass(o.querySelector(".ocTable-head"),"headSet")),o.querySelector("div.ocTable-list")&&(o.querySelector("div.ocTable-list").innerHTML=""),occ.removeClasses(o,["mobileTable","egReady","csvReady","egEdit"]),!0!==t&&occ.removeClasses(o,["navSet","hasPgNav"]),occ.removeClass(o.querySelector("div.egCol.active"),"active"),occ.removeClass(o.querySelector("div.egRow.isActive"),"isActive"),occ.removeClass(o.querySelector("div.ocEditGrid.isActive"),"isActive"),occ.setUpTable(e);let l=o.querySelector("div.dlgSearchDiv");l&&occ.resetElementSearch(l)}};let occTables=[];ocCommon.prototype.updateTableData=function(e,t){for(let o=0;o<occTables.length;o++)occTables[o].tableId===e&&(occTables[o].data=t,occ.clearTable(e),occ.createTable(occTables[o]))},ocCommon.prototype.createTable=function(e){let t=!1;for(let o=0;o<occTables.length;o++)occTables[o].tableId===e.tableId&&(occTables[o].table=document.getElementById(occTables[o].tableId),occ.removeClass(occTables[o].table,"filtered"),occ.removeClass(occTables[o].table.querySelector(".ocTable-filter"),"filterSet"),occ.removeClass(occTables[o].table.querySelector(".ocTable-head"),"headSet"),occTables[o].hasFilter=!1,occTables[o].hasTableFilter=!1,occTables[o].curFilter=[],occTables[o].data=e.data,occTables[o].columns=e.columns,occTables[o].pageTotal=occTables[o].rowCt>0?Math.ceil(occTables[o].data.length/occTables[o].rowCt):0,t=!0,e=occTables[o]);!1===t&&(e.table=document.getElementById(e.tableId),e.pageTotal=e.rowCt>0?Math.ceil(e.data.length/e.rowCt):0,e.hasFilter=!1,e.hasTableFilter=!1,e.curFilter=[],!0===e.rowIndex&&(occ.addClass(e.tableId,"showIndex"),e.columns.unshift({label:"#",mobile:!1,showColumn:!0,class:"tbl-rowIndex",width:-1})),occTables.push(e)),e.hasCSV=!occ.isNothingOrEmpty(e.csv),!0===e.hasCSV&&e.table.setAttribute("data-csv",e.csv),!1===e.scrolling?occ.addClass(e.tableId,"n
3oScroll"):occ.removeClass(e.tableId,"noScroll"),!1===occ.isNothingOrEmpty(e.width)?(occ.addClass(e.tableId,"tblSetStyle"),document.getElementById(e.tableId).style.width=e.width,document.getElementById(e.tableId).style.display="inline-block"):!0===occ.hasClass(e.tableId,"tblSetStyle")&&(occ.removeClass(e.tableId,"tblSetStyle"),document.getElementById(e.tableId).style.width="",document.getElementById(e.tableId).style.display="");let o=function(e,t){let o=null;for(let e=0;e<occTables.length;e++)occTables[e].tableId===t&&(o=occTables[e]);if(null===o)return;occ.removeClass("a.current","current"),e<0&&(e=o.pageTotal),e>o.pageTotal&&(e=0),occ.addClass("a.a"+e,"current"),occ.clearTable(o.tableId,!0),o.pageTotal>1?occ.addClass(o.table,"hasPgNav"):occ.removeClass(o.table,"hasPgNav");let l=o.rowCt*e,c="";for(;l<o.rowCt*(e+1);){if(o.data[l]){try{if(o.rowCB(o.tableId,o.data[l]),!0===o.rowIndex){let e=document.getElementById(o.tableId).querySelector("div.ocTable-list > div:last-child");e&&e.insertBefore(occ.createDiv(d+1,["tbl-rowIndex"]),e.children[0])}}catch(e){console.log("pageTable error ("+o.tableId+") rowCB("+l+")")}c=l+1+""}l++}occ.setUpTable(o.tableId,!0===o.allowOrdering,"function"==typeof o.onReOrder?o.onReOrder:null),o.table.setAttribute("data-cr",e);let a=o.table.querySelector("div.pgNavCount");if(a&&(a.innerHTML="("+(o.rowCt*e+1)+" to "+c+")",o.table.querySelector("div.pgNav a.pageP").style.visibility=0===e?"hidden":"visible",o.pageTotal===e+1?o.table.querySelector("div.pgNav a.pageN").style.visibility="hidden":o.table.querySelector("div.pgNav a.pageN").style.visibility="visible"),o.pageTotal>10)for(let t=0;t<o.pageTotal;t++)0!==t&&t!==o.pageTotal-1&&(e>2&&e<o.pageTotal-3&&(t<e-4||t>e+4)||e<3&&t>7||e>o.pageTotal-4&&t<o.pageTotal-5)?occ.addClass(o.table.querySelector("div.pgNav a.a"+t),"hideMe"):occ.removeClass(o.table.querySelector("div.pgNav a.a"+t),"hideMe");i(),"function"==typeof o.loadCB&&o.loadCB(o.table)},l=function(e){if("SPAN"===e.srcElement.tagName){let t=occ.hasClass(e.currentTarget,"active");if(occ.removeClass(e.currentTarget.parentElement.querySelectorAll("div.allowFilter.active"),"active"),!1===t){occ.addClass(e.currentTarget,"active");let t=e.currentTarget.parentElement.parentElement,o=e.currentTarget.querySelector("div.ocDropDown").clientWidth;1*o===NaN&&(o=150),t.clientWidth-e.currentTarget.offsetLeft<o?occ.addClass(e.currentTarget,"colRight"):occ.removeClass(e.currentTarget,"colRight")}}},c=function(e){let t=null,o=e.currentTarget;t=occ.hasClass(o,"fItem")?o.parentElement.parentElement.id:o.parentElement.parentElement.parentElement.parentElement.id;let l=null;for(let e=0;e<occTables.length;e++)occTables[e].tableId===t&&(l=occTables[e]);if(null===l)return;if(occ.hasClass(o,"fItem")){if(o=l.table.querySelector('div.ocTable-head > div.allowFilter[data-cindex="'+o.getAttribute("data-cindex")+'"] > div.ocDropDown > div.select'),!o)return;occ.setDropDown(o,"ALL")}let i=o.parentElement.parentElement;occ.removeClass(i.parentElement.querySelectorAll("div.allowFilter.active"),"active");let a=o.querySelector("input").value;occ.hasClass(o,"hFilter"),"ALL"===a?occ.removeClass(i,"filtered"):occ.addClass(i,"filtered");let n=1*i.getAttribute("data-cindex"),r=!1;for(let e=0;e<l.curFilter.length;e++)l.curFilter[e].c===n&&(r=!0,l.curFilter[e].v=a,l.curFilter[e].n=i.querySelector("span").innerHTML);!1===r&&l.curFilter.push({c:n,v:a,n:i.querySelector("span").innerHTML});let s=l.table.querySelectorAll("div.ocTable-list > div.ocTable-row");for(let e=0;e<s.length;e++){let t=!0;for(let o=0;o<l.curFilter.length;o++){let c=s[e].querySelectorAll("div.ocTable-cell")[l.curFilter[o].c];c&&-1===c.innerHTML.indexOf(l.curFilter[o].v)&&c.innerHTML!==l.curFilter[o].v&&"ALL"!==l.curFilter[o].v&&("empty"!==l.curFilter[o].v||"empty"===l.curFilter[o].v&&""!==c.innerHTML)&&(t=!1)}t?occ.showObj(s[e]):occ.hideObj(s[e])}let d=l.table.querySelector(".ocTable-filter");d.innerHTML=0===l.curFilter.length?"":"<label>Filter:</label>";for(let e=0;e<l.curFilter.length;e++)if("ALL"!==l.curFilter[e].v){let t=occ.createDiv(l.curFilter[e].n+"<span>"+l.curFilter[e].v+"</span>",["fItem"],[{name:"data-cindex",value:l.curFilter[e].c}]);occ.addClickEvent(t,c),d.appendChild(t)}occ.removeClasses(l.table,["sz2","sz3","sz4","sz5"]),occ.addClass(l.table,"sz0"),d.clientHeight>40&&occ.addClass(l.table,"sz"+Math.ceil(d.clientHeight/30)),occ.removeClass(l.table,"sz0"),l.table.querySelector("div.ocTable-head > div.filtered")?occ.addClass(l.table,"filtered"):occ.removeClass(l.table,"filtered")},i=function(){if(!0===e.doTotal){let t=null;t=occ.createDiv("",["ocTable-totals"]);let o=[],l=0;for(let c=0;c<e.columns.length;c++)!1!==e.columns[c].showColumn&&(o.push({index:l,type:e.columns[c].total,values:[],isMoney:!1,align:e.columns[c].align,exclude:e.columns[c].exclude}),t.appendChild(occ.createDiv("")),l++);if(t.children.length>0&&o.length>
30){let l=document.getElementById(e.tableId).querySelectorAll(".ocTable-row:not(.ocTable-totals)");for(let e=0;e<l.length;e++){let t=l[e].querySelectorAll("div.ocTable-cell");for(let e=0;e<t.length;e++){let l=t[e].innerText;if(0===l.indexOf("$")&&(o[e].isMoney=!0),t[e].children.length>1)for(let c=0;c<t[e].children.length;c++)!1===occ.hasClass(t[e].children[c],"ignoreVal")&&(l=t[e].children[c].innerText,l=l.replace(/[^0-9.-]/g,""),l.indexOf("-")>0&&(l=l.replace(/-/g,"")),l*=1,o[e].values.push(isNaN(l)?0:l));else l=l.replace(/[^0-9.-]/g,""),l.indexOf("-")>0&&(l=l.replace(/-/g,"")),l*=1,o[e].values.push(isNaN(l)?0:l)}}for(let e=0;e<o.length;e++)if(!1===occ.isNothingOrEmpty(o[e].type))if(!1===occ.isNothingOrEmpty(o[e].align)&&occ.addClass(t.children[o[e].index],o[e].align),!0===o[e].exclude&&occ.addClass(t.children[o[e].index],"exclude"),occ.addClass(t.children[o[e].index],o[e].type),"count"===o[e].type)t.children[o[e].index].innerText=o[e].values.length,t.children[o[e].index].setAttribute("title","Row Count");else{let l=0;for(let t=0;t<o[e].values.length;t++)l+=o[e].values[t];"avg"===o[e].type?(l/=o[e].values.length,t.children[o[e].index].setAttribute("title","Average")):t.children[o[e].index].setAttribute("title","Total"),t.children[o[e].index].innerText=!0===o[e].isMoney?occ.formatMoney(l):l.toFixed(2)}occ.addTableRow(e.tableId,t)}else t=null}},a=function(t){let o=null,i=0;for(let e=0;e<occTables.length;e++)occTables[e].tableId===t&&(o=occTables[e],i=e);if(null===o)return;let a=o.table.querySelector(".ocTable-filter"),n=o.table.querySelector(".ocTable-head");a||(a=occ.createDiv("",["ocTable-filter"]),o.table.insertBefore(a,n),occ.addClass(o.table,"hasFilterStatus"));let r=o.table.querySelector(".ocTable-filterNav");if(r||(r=occ.createDiv("",["ocTable-filterNav"]),o.table.insertBefore(r,a)),!1===occ.hasClass(a,"filterSet")){a.innerHTML="";let t=o.table.querySelectorAll("div.ocTable-head > div.allowFilter"),n=o.table.querySelectorAll("div.ocTable-list > div.ocTable-row:not(.ocTable-totals)");for(let o=0;o<t.length;o++){let a=1*t[o].getAttribute("data-cindex"),r=1*t[o].getAttribute("data-aindex"),s="##",d=function(t){!0===occ.isNothingOrEmpty(t)&&(t="empty"),-1===s.indexOf("##"+t+"##")&&(e.columns[r].opts.push({fieldOption:t,fieldValue:t}),s+=t+"##")};for(let e=0;e<n.length;e++){let t=n[e].children[r];if(t)if(t.querySelector("span.opt")){let e=t.querySelectorAll("span.opt");for(let t=0;t<e.length;t++)d(e[t].outerHTML)}else d(t.innerHTML)}e.columns[r].opts.sort((e,t)=>{const o=e.fieldOption.toUpperCase(),l=t.fieldOption.toUpperCase();return o<l?-1:o>l?1:0}),e.columns[r].opts.length>1&&(e.columns[r].opts.splice(0,0,{fieldOption:"ALL",fieldValue:"ALL"}),t[o].innerHTML="<span>"+t[o].innerHTML+"</span>",occ.addClickEvent(t[o],l),t[o].appendChild(occ.createDropDown(e.tableId+"-filter"+i+"-"+a,e.columns[r].opts,["filterDDL"],null,c,"ALL")))}occ.addClass(a,"filterSet")}if(!1===occ.hasClass(a,"filterNavSet")){let t=!1,l=o.table.querySelectorAll("div.ocTable-list > div.ocTable-row"),n=0;for(let o=0;o<e.columns.length;o++)if(!1===e.columns[o].showColumn&&!0===e.columns[o].allowFilter){t=!0;let a="##";for(let t=0;t<l.length;t++){let c=l[t].getAttribute("data-filtervals");!1===occ.isNothingOrEmpty(c)&&(c=JSON.parse(c),Array.isArray(c)&&-1===a.indexOf("##"+c[n]+"##")&&(e.columns[o].opts.push({fieldOption:c[n],fieldValue:c[n]}),a+=c[n]+"##"))}a.length>2&&e.columns[o].opts.splice(0,0,{fieldOption:"ALL",fieldValue:"ALL"});let s=occ.createDiv("");s.appendChild(occ.createElement("label",null,null,e.columns[o].title)),s.appendChild(occ.createDropDown(e.tableId+"-hfilter"+i+"-"+n,e.columns[o].opts,["filterDDL","hFilter"],null,c,"ALL")),r.appendChild(s),n++}t?occ.addClass(o.table,"hasFilterNav"):occ.removeClass(o.table,"hasFilterNav"),occ.addClass(a,"filterNavSet")}o.table=document.getElementById(t)};if(e.columns.length>0){let t=e.table.querySelector(".ocTable-head");if(t||(t=occ.createDiv("",["ocTable-head"]),e.table.appendChild(t)),!1===occ.hasClass(t,"headSet")){t.innerHTML="";let o=0;for(let l=0;l<e.columns.length;l++)if(!1!==e.columns[l].showColumn){!1===occ.isNothingOrEmpty(e.columns[l].total)&&(e.doTotal=!0),e.columns[l].opts=[];let c=[];!0===e.hasCSV&&c.push("headCell"),!0===e.columns[l].exclude&&c.push("exclude"),!1===occ.isNothingOrEmpty(e.columns[l].class)&&c.push(e.columns[l].class),!1===occ.isNothingOrEmpty(e.columns[l].align)&&c.push(e.columns[l].align);let i=[{name:"data-cindex",value:o},{name:"data-aindex",value:l}];!1===occ.isNothingOrEmpty(e.columns[l].id)&&i.push({name:"id",value:e.columns[l].id}),!0===e.columns[l].mobile&&c.push("mobileCol"),!0===e.columns[l].allowFilter&&(c.push("allowFilter"),e.hasFilter=!0),!0===e.columns[l].allowSort&&c.push("allowSort"),-1===e.columns[l].width&&c.push("minWidth");let a=occ.createDiv(e.columns[l].label,c,i);e.columns[l].width>0&&(a.style.width=e.columns[l].width+"px"),t.appendChild(a),o++}else t.appendChild(occ.createElement("span",["hiddenObj","headCell"],null,e.columns[l].label)),!0===e.columns[l].allowFilter&&(e.columns[l].opts=[],e.hasTableFilter=!0);occ.addClass(t,"headSet")}if(e.hasCSV){let o=occ.ocButton(e.tableId+"-a","",occ.createCSV,"download sz3");occ.addClass(o,"csvIcon"),t.appendChild(o)}if(!0===e.gridEdit){let o=function(){occ.createEditGrid(e)},l=occ.ocButton(e.tableId+"-egbtn","",o,"gridedit sz3");occ.addClass(l,"egEditBtn"),t.appendChild(l)}}if(e.rowCt>0){e.table.querySelector("div.ocTable-list")||e.table.appendChild(occ.createDiv("",["ocTable-list"]));let t=function(t){let l=1*t.currentTarget.getAttribute("data-ct");o(l,e.table.id)},l=function(t){o(1*e.table.getAttribute("data-cr")-1,e.tableId)},c=function(t){o(1*e.table.getAttribute("data-cr")+1,e.tableId)},i=e.table.querySelector("div.pgNav");if(i?i.innerHTML="":i=occ.createDiv("",["pgNav"]),e.pageTotal>1){i.appendChild(occ.createDiv("",["pgNavCount"]));let o=occ.createAnchor("",["pageP"]);occ.addClickEvent(o,l),i.appendChild(o);for(let o=0;o<e.pageTotal;o++){let l=occ.createAnchor("<span>"+(o+1)+"</span>",["a"+(o===e.pageTotal?"Last":o)],[{name:"data-ct",value:o},{name:"title",value:o+1}]);occ.addClickEvent(l,t),i.appendChild(l)}let a=occ.createAnchor("",["pageN"]);occ.addClickEvent(a,c),i.appendChild(a),occ.addClass(e.table,"hasPgNav")}!1===occ.hasClass(e.table,"navSet")&&(e.table.appendChild(i),occ.addClass(e.table,"navSet")),e.table.setAttribute("data-cr",0),o(0,e.tableId),!0!==e.hasFilter&&!0!==e.hasTableFilter||a(e.tableId),!0===e.gridEdit&&Array.isArray(e.data)&&occ.addClass(e.table,"egReady")}else{if(e.data.length>0)for(let t=0;t<e.data.length;t++){let o=e.rowCB(e.tableId,e.data[t]);if(!0===e.rowIndex&&!1!==o){let o=document.getElementById(e.tableId).querySelector("div.ocTable-list >
3 div:last-child");o&&o.insertBefore(occ.createDiv(t+1,["tbl-rowIndex","ocTable-cell"]),o.children[0])}}occ.setUpTable(e.tableId,!0===e.allowOrdering,"function"==typeof e.onReOrder?e.onReOrder:null),i(),!0!==e.hasFilter&&!0!==e.hasTableFilter||a(e.tableId),e.hasCSV&&e.data.length>0&&occ.addClass(e.table,"csvReady"),!0===e.gridEdit&&Array.isArray(e.data)&&occ.addClass(e.table,"egReady"),"function"==typeof e.loadCB&&e.loadCB(e.table)}},ocCommon.prototype.pageTable=function(e,t,o,l){let c=document.getElementById(e),i=o,a=Math.ceil(o.length/l),n=function(o){occ.removeClass("a.current","current"),o<0&&(o=a),o>a&&(o=0),occ.addClass("a.a"+o,"current"),occ.clearTable(e,!0);let n=l*o;for(;n<l*(o+1);){try{t(e,i[n])}catch(t){console.log("pageTable error ("+e+") rowCB("+n+")")}n++}if(occ.setUpTable(e),c.setAttribute("data-cr",o),c.querySelector("div.pgNavCount").innerHTML="("+(l*o+1)+" to "+l*(o+1)+")",a>10)for(let e=0;e<a;e++)0!==e&&e!==a-1&&(o>2&&o<a-3&&(e<o-4||e>o+4)||o<3&&e>7||o>a-4&&e<a-5)?occ.addClass(c.querySelector("div.pgNav a.a"+e),"hideMe"):occ.removeClass(c.querySelector("div.pgNav a.a"+e),"hideMe")};if(!1===occ.hasClass(c,"navSet")){c.querySelector("div.ocTable-list")||c.appendChild(occ.createDiv("",["ocTable-list"]));let e=function(e){let t=1*e.currentTarget.getAttribute("data-ct");n(t)},t=function(e){n(1*c.getAttribute("data-cr")-1)},o=function(e){n(1*c.getAttribute("data-cr")+1)};if(a>1){pgNav=occ.createDiv("",["pgNav"]),pgNav.appendChild(occ.createDiv("",["pgNavCount"]));let l=occ.createAnchor("&lt;");occ.addClickEvent(l,t),pgNav.appendChild(l);for(let t=0;t<a;t++){let o=occ.createAnchor("<span>"+(t+1)+"</span>",["a"+(t===a?"Last":t)],[{name:"data-ct",value:t}]);occ.addClickEvent(o,e),pgNav.appendChild(o)}let i=occ.createAnchor("&gt;");occ.addClickEvent(i,o),pgNav.appendChild(i),c.appendChild(pgNav),occ.addClass(c,"hasPgNav")}occ.addClass(c,"navSet")}c.setAttribute("data-cr",0),n(0)},ocCommon.prototype.createCSV=function(e){let t=e.currentTarget.parentElement.parentElement,o="",l="",c="",i=t.querySelectorAll(":scope > div.ocTable-head > .headCell:not(.exclude)");for(let e=0;e<i.length;e++)""!==c&&(c+=","),c+='"'+(i[e].innerText+"").replace(/"/g,'""')+'"',!1===occ.hasClass(i[e],"hiddenObj")&&(l+=",");let a=t.querySelectorAll("div.ocTable-row");for(let e=0;e<a.length;e++){o+="\r\n";let t=a[e].querySelectorAll(":scope > .rowCell:not(.exclude)");for(let e=0;e<t.length;e++){if(e>0&&(o+=","),o+='"',t[e].children.length>1)for(let l=0;l<t[e].children.length;l++)l>0&&(o+=","),o+=(t[e].children[l].innerText+"").replace(/"/g,'""');else o+=(t[e].innerText+"").replace(/"/g,'""');o+='"'}}if(o.length>10){o=c+o;let e=document.getElementById(t.id+"-a-temp");e&&e.remove();let l=t.getAttribute("data-csv"),i=document.getElementById(t.id+"-a");e=occ.createElement("a",["hiddenObj"],[{name:"download",value:l+"_data.csv"},{name:"id",value:t.id+"-a-temp"}],"");let a=new Blob([o],{type:"text/csv;charset=utf-8;"}),n=URL.createObjectURL(a);e.setAttribute("href",n),e.click(),i.appendChild(e)}},ocCommon.prototype.setUpOrder=function(e,t,o,l,c){var i="string"==typeof e?document.getElementById(e).querySelector("div.ocTable-list"):occ.getElementFromString(e);if(i&&0!==i.children.length){if(occ.addClass(e,"oc-orderable"),!0===c&&occ.addClass(e,"orderstacked"),!0===t&&occ.addClass(e,"allowdrag"),"div"===i.nodeName.toLowerCase()||"section"===i.nodeName.toLowerCase())if(!0===t){if(!i.querySelector(".dragTop")){var a=occ.createDiv("",["dragTop"]);occ.hasClass(i.firstElementChild,"ocTable-head")?i.insertBefore(a,i.firstElementChild.nextElementSibling):i.insertBefore(a,i.firstElementChild)}if(!i.querySelector(".dragBottom")){var n=occ.createDiv("",["dragBottom"]);occ.hasClass(i.lastElementChild,"ocTable-foot")?i.insertBefore(n,i.lastElementChild):i.appendChild(n)}}else for(var r=i.children,s=0;s<r.length;s++){var d=r[s].querySelector(".orderBlank");if(d&&!1===occ.hasClass(d,"oc-orderable-tools")){occ.addClasses(r[s],["oc-orderable-item","dragItem","orderrow"+s]),occ.addClass(d,"oc-orderable-tools");var u=occ.createAnchor('<div class="icon s-arrow-up tr sz3"></div>',["moveup"]);if(occ.addClickEvent(u,this.moveOrderItem.bind(this)),occ.addClickEvent(u,o),d.appendChild(u),!0===t){var p=occ.createAnchor('<div class="icon s-arrows tr sz3"></div>',["dragControl"]);occ.addClickEvent(p,this.setDragElement.bind(this,i.querySelector(".orderrow"+s),l),"pointerdown"),d.appendChild(p)}var m=occ.createAnchor('<div class="icon s-arrow-down tr sz3"></div>',["movedown"]);occ.addClickEvent(m,this.moveOrderItem.bind(this)),occ.addClickEvent(m,o),d.appendChild(m)}}this.setOrderClass(e)}},ocCommon.prototype.moveOrderItem=function(e){var t=null;if(occ.hasClass(e.currentTarget,"moveup")&&(t=-1),occ.hasClass(e.currentTarget,"movedown")&&(t=1),null!==t){var o=e.currentTarget.parentElement.parentElement;if(!1===occ.hasClass(o,"oc-orderable-item")&&(o=o.parentElement),occ.hasClass(o,"oc-orderable-item")){var l=o.parentElement,c=null;occ.addClass(o,"moving"),setTimeout(function(e){occ.removeClass("div.moving","moving")},750),t<0&&(c=o.previousElementSibling,!1===occ.hasClass(c,"dragTop")&&l.insertBefore(o,c)),t>0&&((c=o.nextElementSibling.nextElementSibling)?l.insertBefore(o,c):l.appendChild(o)),this.setOrderClass(l),occ.addClass(l,"dirty")}}},ocCommon.prototype.setOrderClass=function(e){var t;if(e&&e.tagName?t=e:"string"==typeof e?t=occ.getElementFromString(e):(t=e.currentTarget.parentElement.parentElement,occ.hasClass(t,"oc-orderable-item")&&(t=t.parentElement),occ.hasClass(t,"oc-orderable-item")&&(t=t.parentElement)),t){occ.removeClass(t.querySelectorAll(".oc-orderable-first"),"oc-orderable-first"),occ.removeClass(t.querySelectorAll(".oc-orderable-last"),"oc-orderable-last");var o=t.querySelectorAll(".oc-orderable-item");occ.addClass(o[0],"oc-orderable-first"),occ.addClass(o[o.length-1],"oc-orderable-last")}},ocCommon.prototype.setDragElement=function(e,t){this.dragElement(e,t)},ocCommon.prototype.dragElement=function(e,t){var o=null,l=null,c=e.parentElement,i=!1;e.onmousedown=function(e){(e=e||window.event).preventDefault(),document.addEventListener("mouseup",r,!0),document.addEventListener("mousemove",n,!0)},e.previousElementSibling&&occ.addClass(e.previousElementSibling,"dragPlaceholder");var a=c.children;function n(t){(t=t||window.event).preventDefault(),e.style.top=t.clientY+10+"px",e.style.left=t.clientX+10+"px";var a=document.elementFromPoint(t.clientX,t.clientY);if(null!==a&&a!==o&&!1===occ.hasClass(a,"dragging")&&(null!==l&&occ.removeClass(l,"dragOver"),null!==(o=a)&&null!==(l=occ.hasClass(o,"dragTop")?o:o.closest(".dragItem")))){occ.addClass(l,"dragOver");var n=o.closest(".scroll-y");if(n){for(var r=l.previousElementSibling,s=0,d=0,u=c,p=null;d<1;
3)occ.hasClass(u,"scroll-y")?(u.offsetParent===p&&(s-=u.offsetTop),d=1):p!==u.offsetParent&&(p=u.offsetParent,s+=u.offsetTop,u=u.parentElement);var m=s+(r?r.offsetTop:0),h=s+l.offsetTop+l.clientHeight+40,g=n.scrollTop+n.clientHeight;m<n.scrollTop?i?i=!1:(i=!0,n.scrollTop=n.scrollTop-(n.scrollTop-m)):i=!1,h>g?i?i=!1:(i=!0,n.scrollTop=n.scrollTop+(h-g)):i=!1}}}function r(){document.removeEventListener("mouseup",r,!0),document.removeEventListener("mousemove",n,!0),e.onmousedown=null;for(var i="No action",s=!1,d=0;d<a.length;d++)a[d]===l&&(s=!0);s&&(null!==l?(i="done",e.parentElement.insertBefore(e,l.nextElementSibling)):i="failed"),occ.setOrderClass(c.id),o=null,l=null,c=null,occ.removeClass(e,"dragging"),occ.removeClass(document.querySelectorAll(".dragOver"),"dragOver"),occ.removeClass(document.querySelectorAll(".dragPlaceholder"),"dragPlaceholder"),e.style.top="",e.style.left="",occ.removeClass(a,"dragAdjacent"),occ.removeClass(e.parentElement,"dragActive"),t(i,e)}occ.addClass(a,"dragAdjacent"),occ.addClass(c,"dragActive"),occ.addClass(e,"dragging")},ocCommon.prototype.apiError=function(e,t){},ocCommon.prototype.checkVideoCode=function(e,t){if(!1===occ.isNothingOrEmpty(e)){let o=e.split("/");if((e=e.toLowerCase()).indexOf("youtu.be")>0||e.indexOf("youtube.com/")>0)return!0;if(e.indexOf("soundcloud.com/tracks")>-1||e.indexOf("soundcloud.com/playlists")>-1)return!0;if(e.indexOf("vimeo.com/")>0&&o.length<5||e.indexOf("vimeo.com/video")>0&&o.length<6)return!0;if(0===e.indexOf("https://")&&t&&e.indexOf(".mp4")>14)return!0;if(0===e.indexOf("https://mwmedia-usct.streaming.media.azure.net"))return!0;if(0===e.indexOf("e="))return!0}return!1},ocCommon.prototype.embedVideoCode=function(e,t,o,l,c){occ.isNullOrEmpty(e)&&o&&(e=o.getAttribute("data-url"));let i="",a=null;if(!0===occ.isNothingOrEmpty(e)||"undefined"===e)return;e.indexOf("watch?v=")>-1&&(e=e.replace("watch?v=","").replace("&","?"));let n="";e.indexOf("?")>0&&(n=e.substring(e.indexOf("?")-1),e=e.substring(0,e.indexOf("?")-1)),"string"==typeof o&&(o=occ.getElementFromString(o));let r=e.split("/");if(e.toLowerCase().indexOf("youtu.be")>0||e.toLowerCase().indexOf("youtube.com/")>0)""===n&&(n="?"),n+="&rel=0&modestbranding=1",i='<iframe class="videoContainer" src="https://www.youtube.com/embed/'+r[r.length-1]+n+'" width="560" height="315" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>',a=occ.createDiv(i,["ocVideo"]),o&&o.setAttribute("data-url","https://www.youtube.com/embed/"+r[r.length-1]+n);else if(e.toLowerCase().indexOf("soundcloud.com/tracks")>-1||e.toLowerCase().indexOf("soundcloud.com/playlists")>-1){let e="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/"+r[3]+"/"+r[4]+"&color=%23ff5500&auto_play=false&hide_related=true&show_comments=false&show_user=false&show_reposts=false&show_teaser=false&sharing=false&show_artywork=true&show_playcount=false";i='<iframe class="videoContainer" src="" width="640" height="272" frameborder="0" allow="autoplay; fullscreen"',o?(occ.addClass(o,"isAudio"),o.setAttribute("data-url",e)):i+=' src="'+e+'"',i+=" allowfullscreen></iframe>",a=occ.createDiv(i,["ocVideo","isAudio"])}else if(e.toLowerCase().indexOf("vimeo.com/")>0&&r.length<5||e.toLowerCase().indexOf("vimeo.com/video")>0&&r.length<6)i='<iframe class="videoContainer" src="https://player.vimeo.com/video/'+r[r.length-1]+'?title=0" width="640" height="272" frameborder="0" allow="autoplay; fullscreen" allowfullscreen></iframe>',a=occ.createDiv(i,["ocVideo"]),o&&o.setAttribute("data-url","https://player.vimeo.com/video/"+r[r.length-1]);else if(e.toLowerCase().indexOf("https://mwmedia-usct.streaming.media.azure.net")>-1||0===e.toLowerCase().indexOf("e=")){let t=occ.createElement("video",["videoContainer","azuremediaplayer","amp-default-skin"],[{name:"width",value:"640"},{name:"height",value:"400"},{name:"controls",value:""},{name:"data-setup",value:'{"logo": { "enabled": false }, "techOrder": ["azureHtml5JS", "flashSS", "html5FairPlayHLS","silverlightSS", "html5"], "nativeControlsForTouch": '+("ios"==occ.clientOs?"true":"false")+', "controls": true}'}]),i=occ.createElement("source",[],[{name:"src",value:e},{name:"type",value:"ios"===occ.clientOS?"application/vnd.apple.mpegurl":"application/vnd.ms-sstr+xml"}]);o&&o.getAttribute("data-protection")&&(c=o.getAttribute("data-protection")),o&&o.getAttribute("data-token")&&(l=o.getAttribute("data-token")),"AES"===c&&l&&!1===occ.isNullOrEmpty(l)&&i.setAttribute("data-setup",'{"protectionInfo": [{"type": "'+c+'", "authenticationToken": "'+l+'"}]}'),"ios"==occ.clientOs&&"AES"==c||t.appendChild(i);let n=occ.createElement("p",["amp-no-js"],null,"To view this video please enable JavaScript, and consider upgrading to a web browser that supports HTML5 video");t.appendChild(n),a=occ.createDiv("",["ocVideo"]),a.appendChild(t)}else if(e.indexOf(".mp4")>14){let t=occ.createElement("video",["videoContainer","staticVideoSize"],[{name:"width",value:"100%"},{name:"height",value:"100%"},{name:"controls",value:"controls"}]),l=document.createElement("source");l.setAttribute("src",e),l.setAttribute("type","video/mp4"),o&&"true"===o.getAttribute("data-autoplay")&&t.setAttribute("autoplay","autoplay"),t.appendChild(l),a=occ.createDiv("",["ocVideo"]),a.appendChild(t)}else if(0==t){let t=function(){window.open(e,"_newWin")};a=occ.ocButton("pvideourl"+(new Date).getMilliseconds,"Watch Video",t)}if(!o||null===a)return a;o.appendChild(a),occ.setVideoSize(o.querySelector(".videoContainer"))},ocCommon.prototype.initVideos=function(e){let t=(e=e&&null!==e?occ.getElementFromString(e):document).querySelectorAll("div.ocVideo-obj");e.querySelector("div.azuremediaplayer")&&occ.loadResources("ams",null,null);for(let e=0;e<t.length;e++)!1===occ.hasClass(t[e],"vidAdded")&&(occ.addClass(t[e],"vidAdded"),occ.embedVideoCode(t[e].getAttribute("data-url"),null,t[e]))},ocCommon.prototype.setVideosSize=function(e){(e=occ.getElementFromString(e))||(e=document.body);let t=e.querySelectorAll(".ocVideo > .videoContainer");for(var o=0;o<t.length;o++)occ.setVideoSize(t[o])},ocCommon.prototype.setVideoSize=function(e){if(!1===occ.hasClass(e.parentElement.parentElement,"staticVideoSize")&&!1===occ.hasClass(e,"staticVideoSize")){e.
3style.width="",e.style.height="";let t=e.clientHeight/e.clientWidth;e.style.display="none";let o=e.parentElement.clientWidth,l=e.parentElement.clientHeight;e.style.display="",o>954&&(o=954),e.style.width=o+"px",e.style.height=o*t+"px",e.style.display="inline-block",e.parentElement.style.overflow="",l>0&&(e.style.marginTop=(l-e.clientHeight)/2+"px"),e.clientHeight>l&&l>100&&(t=e.clientWidth/e.clientHeight,e.style.width=l*t+"px",e.style.height=l+"px",e.style.marginTop="")}},ocCommon.prototype.initPinchObj=function(){if(!0===this.isTouch){let e=document.querySelectorAll(".ocPinch-obj");for(let t=0;t<e.length;t++)if(!1===this.isNullOrEmpty(e[t].id)&&!1===occ.hasClass(e[t],"ocPinch")){let o=null;!1===occ.isNullOrEmpty(e[t].getAttribute("onchange"))&&(o=function(e,t){occ.triggerEvent(e,"change")}),occ.addPinchEvent(e[t].id,e[t].getAttribute("data-child"),o)}}},ocCommon.prototype.addPinchEvent=function(e,t,o){if(!(e=occ.getElementFromString(e))||!1===this.isTouch||!0===this.isNullOrEmpty(e.id))return;e.parentElement.style.touchAction="none";let l=-1;for(let t=0;t<occ.pzItems.length;t++)e.id===occ.pzItems[t].id&&(l=t);let c={id:e.id,cb:null,moving:!1,pointers:[],startDelta:1,curDelta:0,prevScale:1,curScale:1,intervalFN:null,dX:-1,dY:-1};occ.addClasses(e,["zoomParent","ocPinch"]);c.cb="function"==typeof o?o:null,c.iCB=e=>{let t=this.pzItems[e];if(1===t.pointers.length&&!1===t.moving&&!0===occ.hasClass(t.cbTarget.parentElement,"zoomed")){let e=-1*(t.dX-t.pointers[0].pageX),o=-1*(t.dY-t.pointers[0].pageY);t.cbTarget.style.transform="scale("+t.curScale+") translate("+e+"px, "+o+"px)"}if(t.cbTarget&&t.pointers.length>1&&!0===t.moving)if(t.curScale>1){occ.addClass(t.cbTarget.parentElement,"zoomed"),null!==t.cb&&t.cb(t.id,"zoom");let e=-1*(t.dX-t.cX),o=-1*(t.dY-t.cY);t.cbTarget.style.transform="scale("+t.curScale+") translate("+e+"px, "+o+"px)"}else t.cbTarget.style.transform="",occ.removeClass(t.cbTarget.parentElement,"zoomed"),null!==t.cb&&t.cb(t.id,"pinch")},-1===l&&(this.addClickEvent(e,occ.startPinchEvent,"pointerdown"),this.addClickEvent(e,occ.movePinchEvent,"pointermove"),this.addClickEvent(e,occ.endPinchEvent,"pointerup"),this.addClickEvent(e,occ.endPinchEvent,"pointerleave"),this.addClickEvent(e,occ.endPinchEvent,"pointercancel"),this.addClickEvent(e,occ.endPinchEvent,"pointerout")),t&&("string"==typeof t&&!1===occ.isNullOrEmpty(t)?"child"===t?c.cbTarget=e.children[0]:(c.cbTarget=document.getElementById(t),c.cbTarget||(c.cbTarget=document.querySelector(t))):c.cbTarget=t,occ.addClass(c.cbTarget,"zoomChild")),t&&!0!==occ.isNullOrEmpty(t)||(c.cbTarget=e),-1===l?occ.pzItems.push(c):occ.pzItems[l]=c},ocCommon.prototype.startPinchEvent=function(e){if("touch"===e.pointerType)for(let t=0;t<occ.pzItems.length;t++)e.currentTarget.id!==occ.pzItems[t].cbTarget.id&&e.target.id!==occ.pzItems[t].cbTarget.id||(occ.pzItems[t].pointers.length<2&&(occ.pzItems[t].pointers.push(e),1===occ.pzItems[t].pointers.length&&(occ.pzItems[t].dX=e.pageX,occ.pzItems[t].dY=e.pageY)),2===occ.pzItems[t].pointers.length&&null===occ.pzItems[t].intervalFN&&(occ.pzItems[t].startDelta=Math.sqrt(Math.pow(occ.pzItems[t].pointers[0].pageX-occ.pzItems[t].pointers[1].pageX,2)+Math.pow(occ.pzItems[t].pointers[0].pageY-occ.pzItems[t].pointers[1].pageY,2)),occ.pzItems[t].dX=occ.pzItems[t].pointers[0].pageX+(occ.pzItems[t].pointers[1].pageX-occ.pzItems[t].pointers[0].pageX)/2,occ.pzItems[t].dY=occ.pzItems[t].pointers[0].pageY+(occ.pzItems[t].pointers[1].pageY-occ.pzItems[t].pointers[0].pageY)/2,occ.pzItems[t].intervalFN=setInterval(occ.pzItems[t].iCB,1e3/25,t),occ.pzItems[t].moving=!0))},ocCommon.prototype.movePinchEvent=function(e){if("touch"===e.pointerType)for(let o=0;o<occ.pzItems.length;o++)if(e.currentTarget.id===occ.pzItems[o].cbTarget.id||e.target.id===occ.pzItems[o].cbTarget.id){for(var t=0;t<occ.pzItems[o].pointers.length;t++)if(e.pointerId===occ.pzItems[o].pointers[t].pointerId){occ.pzItems[o].pointers[t]=e;break}1===occ.pzItems[o].pointers.length&&null===occ.pzItems[o].intervalFN&&(occ.pzItems[o].intervalFN=setInterval(occ.pzItems[o].iCB,1e3/25,o)),occ.pzItems[o].pointers.length>1&&(occ.pzItems[o].cX=occ.pzItems[o].pointers[0].pageX+(occ.pzItems[o].pointers[1].pageX-occ.pzItems[o].pointers[0].pageX)/2,occ.pzItems[o].cY=occ.pzItems[o].pointers[0].pageY+(occ.pzItems[o].pointers[1].pageY-occ.pzItems[o].pointers[0].pageY)/2,occ.pzItems[o].curDelta=Math.sqrt(Math.pow(occ.pzItems[o].pointers[0].pageX-occ.pzItems[o].pointers[1].pageX,2)+Math.pow(occ.pzItems[o].pointers[0].pageY-occ.pzItems[o].pointers[1].pageY,2)),occ.pzItems[o].curScale=occ.pzItems[o].curDelta/occ.pzItems[o].startDelta,occ.pzItems[o].prevScale>1&&(occ.pzItems[o].curScale=occ.pzItems[o].prevScale*occ.pzItems[o].curScale),occ.pzItems[o].curScale>12&&(occ.pzItems[o].curScale=12),occ.pzItems[o].curScale<1&&(occ.pzItems[o].prevScale=1,occ.pzItems[o].curScale=1))}},ocCommon.prototype.endPinchEvent=function(e){if("touch"===e.pointerType)for(let t=0;t<occ.pzItems.length;t++)e.currentTarget.id!==occ.pzItems[t].cbTarget.id&&e.target.id!==occ.pzItems[t].cbTarget.id||(null!==occ.pzItems[t].intervalFN&&(clearInterval(occ.pzItems[t].intervalFN),occ.pzItems[t].intervalFN=null),occ.pzItems[t].iCB(t),occ.pzItems[t].prevScale=occ.pzItems[t].curScale,occ.pzItems[t].pointers=[],occ.pzItems[t].startDelta=1,occ.pzItems[t].curDelta=0,occ.pzItems[t].mov
3ing=!1)},ocCommon.prototype.msgDlg=function(e,t,o,l,c){if(document.getElementById("occ-dlgMsgDiv")||document.body.appendChild(occ.createDiv("",null,[{name:"id",value:"occ-dlgMsgDiv"}])),null===this.dlgMsg&&(this.dlgMsg=new ocDialog({id:"occ-dlgMsgDiv-ctrl",content:document.getElementById("occ-dlgMsgDiv"),title:"",class:"occ-msgDlg",allowMaximize:!0===c,onOpen:function(e){occ.addClass(document.getElementById("occ-dlgMsgDiv-ctrl").parentElement,"occ-msgDlg-isOpen")},onClose:function(e){occ.removeClass(document.getElementById("occ-dlgMsgDiv-ctrl").parentElement,"occ-msgDlg-isOpen")}})),document.getElementById("occ-dlgMsgDiv")){let e=document.getElementById("occ-dlgMsgDiv");occ.isNothingOrEmpty(t)?e.innerHTML="":e.innerHTML=t.indexOf("</")>-1?t:"<p>"+t+"</p>"}o&&null!==o||(o="mini"),occ.removeClass("occ-dlgMsgDiv-ctrl","dlgsize-mini"),occ.removeClass("occ-dlgMsgDiv-ctrl","dlgsize-small"),occ.removeClass("occ-dlgMsgDiv-ctrl","dlgsize-medium"),occ.removeClass("occ-dlgMsgDiv-ctrl","dlgsize-large"),occ.addClass("occ-dlgMsgDiv-ctrl","dlgsize-"+o),l&&null!==l||(l=[{id:this.dlgMsg.id+"-close",content:"Close",onClick:function(e){closeDialogByEvent(e)},align:"L"}]),this.dlgMsg.setButtons(l),this.dlgMsg.setTitle(e),this.dlgMsg.open()},this.curSearchText="",this.curSearchItem=0,this.searchElems=[],ocCommon.prototype.createElementSearch=function(e){if(!e)return;let t=e.getAttribute("data-parent");occ.addClass(e,"occElemSearch");let o=occ.createAnchor('<div class="icon s-magnify sz3 tr"></div>',["searchIcon"],null);occ.addClickEvent(o,this.showElementSearch.bind(this)),e.appendChild(o);let l=occ.createDiv("",["occSearchForm"]),c=occ.createElement("input",["occElSearch"],[{name:"type",value:"text"},{name:"style",value:"min-width: 50px"}]);c.setAttribute("placeholder",e.getAttribute("data-placeholder")),occ.addEvent(c,occ.elementSearchUp,"keyup"),c.addEventListener("keydown",occ.elementSearchDown),c.addEventListener("blur",occ.elementSearchDown),l.appendChild(c);let i=occ.ocButton(t+"occElSearchBtnLeft","",this.doElementSearch.bind(this),"arrow-up sz3");occ.addClass(i,"upBtn"),l.appendChild(i);let a=occ.createElement("span",["occElSearchCt"],null,"0/0");l.appendChild(a);let n=occ.ocButton(t+"occElSearchBtnRight","",this.doElementSearch.bind(this),"arrow-down sz3");occ.addClass(n,"dnBtn"),l.appendChild(n);let r=occ.ocButton(t+"occElSearchBtnX","",this.hideElementSearch.bind(this),"x sz3");occ.addClass(r,"xBtn"),l.appendChild(r),e.appendChild(l)},ocCommon.prototype.elementSearchUp=function(e){e&&(e.key?"Enter"===e.key&&occ.doElementSearch(e):e.keyCode&&13===e.keyCode&&occ.doElementSearch(e))},ocCommon.prototype.elementSearchDown=function(e){if(e)if("blur"==e.type){0===e.currentTarget.value.length&&!0===occ.hasClass(e.currentTarget.parentElement.parentElement,"alwaysOpen")&&occ.resetElementSearch(e.currentTarget.parentElement.parentElement)}else"Tab"!==e.key&&9!==e.keyCode||occ.doElementSearch(e)},ocCommon.prototype.showElementSearch=function(e){occ.addClass(e.currentTarget.parentElement,"active"),e.currentTarget.parentElement.querySelector("input").focus()},ocCommon.prototype.hideElementSearch=function(e){occ.resetElementSearch(e.currentTarget.parentElement.parentElement)},ocCommon.prototype.resetElementSearch=function(e){if(!e)return;occ.removeClass(e,"active");let t=e.getAttribute("data-ss");if(t.indexOf(",")>0){let e=t.split(",");for(let t=0;t<e.length;t++)occ.removeClass(e[t]+".ocSearchActive","ocSearchActive"),occ.removeClass(e[t]+".current","current")}else occ.removeClass(t+".ocSearchActive","ocSearchActive"),occ.removeClass(t+".current","current");e.querySelector("input").value="",e.querySelector("span.occElSearchCt").innerHTML="0/0",this.searchElems=[],this.curSearchText="",this.curSearchItem=0},ocCommon.prototype.doElementSearch=function(e){let t=null,o="",l=e.currentTarget.parentElement.parentElement.getAttribute("data-parent"),c=occ.getElementFromString(l),i=e.currentTarget.parentElement.parentElement.getAttribute("data-ss");occ.hasClass(c,"hastabs")&&(o="div.ocDialog-tabContent div.ocDialog-Obj.active "),c.querySelector(o+" .ocTable.egEdit div.ocEditGrid")&&(o+="div.ocGridList "),i.indexOf(",")>0&&(t=i.split(","));let a=e.currentTarget.parentElement.querySelector("input.occElSearch").value.toLowerCase();if(a.length>1){if(occ.addClass(e.currentTarget.parentElement,"active"),a!==this.curSearchText&&a.length>1){if(!c)return;this.curSearchItem=0,this.searchElems=[];let e=[];
3if(null!==t)for(let l=0;l<t.length;l++){let i=c.querySelectorAll(o+t[l]);for(let t=0;t<i.length;t++)e.push(i[t]);occ.removeClass(o+t[l]+".ocSearchActive","ocSearchActive")}else e=c.querySelectorAll(o+i),occ.removeClass(o+i+".ocSearchActive","ocSearchActive");this.curSearchText=a;for(let t=0;t<e.length;t++)e[t].innerText.toLowerCase().indexOf(a)>-1&&(occ.addClass(e[t],"ocSearchActive"),this.searchElems.push(e[t]))}else if(a===this.curSearchText){if(1===this.searchElems.length)return;occ.hasClass(e.currentTarget,"dnBtn")?(this.curSearchItem++,this.curSearchItem>=this.searchElems.length&&(this.curSearchItem=0)):occ.hasClass(e.currentTarget,"upBtn")&&(this.curSearchItem--,this.curSearchItem<0&&(this.curSearchItem=this.searchElems.length-1))}if(this.searchElems.length>0&&this.curSearchItem<this.searchElems.length){if(e.currentTarget.parentElement.querySelector("span.occElSearchCt").innerHTML=this.curSearchItem+1+"/"+this.searchElems.length,null!==t)for(let e=0;e<t.length;e++)occ.removeClass(o+t[e]+".current","current");else occ.removeClass(o+i+".current","current");occ.addClass(this.searchElems[this.curSearchItem],"current"),this.searchElems[this.curSearchItem].scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})}}else occ.resetElementSearch(e.currentTarget.parentElement.parentElement)},ocCommon.prototype.replaceTag=function(e,t,o){t=t.replaceAll('"',"'"),o=o.replaceAll('"',"'");let l=t.substr(0,t.indexOf("</")),c="";t.indexOf("</")>-1?c=t.substr(t.indexOf("</")):(l=t,c=l.replace("<","</"));let i=o.substr(0,o.indexOf("</")),a="";o.indexOf("</")>-1?a=o.substr(o.indexOf("</")):(i=o,a=i.replace("<","</"));for(let t=0;t<e.length;t++)if(e.indexOf(l)>-1){t=e.indexOf(l,t)+(l.length-1);let o=e.indexOf(c,t);o>t?e=(e=e.substr(0,o)+a+e.substr(o+c.length)).replace(l,i):t=e.indexOf(l,t)>-1?e.indexOf(l,t)-1:e.length}else t=e.length;return e},ocCommon.prototype.showLogin=function(e,t){if(null!==this.dlgCreate&&this.dlgCreate.close(),null===this.dlgLogin){let t=occ.createDiv("",["occLoginLogo"]),u=occ.createElement("form",["ocFormContainer","occ-dlgLogin-form"],[{name:"id",value:"dlgLogin-form"}],null),p=occ.createInputControl("myun","Enter your Email","email");var o=occ.createElement("input",["pass-code2"],[{name:"type",value:"radio"},{name:"id",value:"pass-code2"},{name:"name",value:"pass-code"}]),l=occ.createElement("label",["wrap","pass-code2"],[{name:"for",value:"pass-code2"}],"Use a password to login."),c=occ.createElement("input",["pass-code1"],[{name:"type",value:"radio"},{name:"id",value:"pass-code1"},{name:"name",value:"pass-code"}]),i=occ.createElement("label",["wrap","pass-code1"],[{name:"for",value:"pass-code1"}],"Send a code to my email to login."),a=occ.createElement("input",["pass-code0"],[{name:"type",value:"radio"},{name:"id",value:"pass-code0"},{name:"name",value:"pass-code"}]),n=occ.createElement("label",["wrap","pass-code0"],[{name:"for",value:"pass-code0"}],"Send a code to my phone to login."),r=occ.createElement("input",["pass-code4"],[{name:"type",value:"radio"},{name:"id",value:"pass-code4"},{name:"name",value:"pass-code"}]),s=occ.createElement("label",["wrap","pass-code4"],[{name:"for",value:"pass-code4"}],"Use "+occ.getAuthnMethod().toLowerCase()+" to login.");occ.addClickEvent(o,occ.usePassword),occ.addClickEvent(l,occ.usePassword),occ.addClickEvent(c,occ.useCode),occ.addClickEvent(i,occ.useCode),occ.addClickEvent(a,occ.useCode),occ.addClickEvent(n,occ.useCode),occ.addClickEvent(r,occ.setMwCidOption),occ.addClickEvent(s,occ.setMwCidOption);let m=occ.createInputControl("ocPassword","Password","password",null,["occ-dlgLogin-pass"],[{name:"placeholder",value:"enter your password"}]),h=occ.createInputControl("vc","Code","number",null,["occ-dlgLogin-code"],[{name:"placeholder",value:"enter code you received"}]);var d=occ.createAnchor("Create/Reset My Password",null,[{name:"id",value:"forgotPassBtn"}]);occ.addClickEvent(d,occ.sendReset),occ.addClass(d,"occ-dlgLogin-pass"),occ.addEvent(p.querySelector("input"),occ.validateUsername,"blur"),occ.addEvent(p.querySelector("input"),occ.validateUsername,"keyup"),occ.addChangeEvent(p.querySelector("input"),occ.validateUsername),occ.addEvent(m.querySelector("input"),occ.validatePassword,"keyup"),occ.addChangeEvent(m.querySelector("input"),occ.validatePassword),occ.addEvent(h.querySelector("input"),occ.validateVC,"keyup"),occ.addChangeEvent(h.querySelector("input"),occ.validateVC),occ.addEvent(u,occ.validateUsername,"blur"),occ.addEvent(u,occ.validatePassword,"blur"),occ.addEvent(u,occ.validateUsername,"focus"),occ.addEvent(u,occ.validatePassword,"focu
3s"),u.appendChild(t),u.appendChild(p),u.appendChild(r),u.appendChild(s),u.appendChild(a),u.appendChild(n),u.appendChild(c),u.appendChild(i),u.appendChild(h),u.appendChild(o),u.appendChild(l),u.appendChild(m),u.appendChild(d),u.appendChild(occ.createDiv("",["inValidErrorMsg"],[{name:"id",value:"dlgLogin-form-msg"}]));let g=[{id:"occ-dlgLoginDiv-loginBtn",content:"Login",onClick:occ.doLogin,align:"R",disabled:!0,disabledText:"Please enter valid credentials"},{id:"occ-dlgLoginDiv-resetBtn",content:"Restart",hidden:!0,onClick:occ.resetLogin,align:"L"}];e&&g.push({id:"occ-dlgLoginDiv-closeBtn",content:"Cancel",hidden:!1,onClick:function(){occ.dlgLogin.close()},align:"L"}),this.dlgLogin=new ocDialog({id:"occ-dlgLoginDiv-ctrl",content:u,title:"Login",class:"occ-loginDlg dlgsize-mini",height:450,width:350,onOpen:function(e){occ.addClass(document.body,"occ-loginDlg-isOpen")},onClose:function(e){occ.removeClass(document.body,"occ-loginDlg-isOpen")},buttons:g})}occ.isNothingOrEmpty(t)&&(t="all"),"all"!==t?(occ.hideObj("pass-code2"),occ.hideObj(this.dlgLogin.dialog.querySelector('label[for="pass-code2"]'))):(occ.showObj("pass-code2"),occ.showObj(this.dlgLogin.dialog.querySelector('label[for="pass-code2"]'))),occ.setLoginMsg(),occ.hideField("ocPassword"),occ.hideField("vc"),this.dlgLogin.open(),"credentials"in navigator&&null!=localStorage.getItem("mwkid")&&0!=localStorage.getItem("mwkid").trim().length?(occ.showObj(".pass-code4"),document.getElementById("pass-code4").checked=!0,document.getElementById("myun").value=localStorage.getItem("mwuid"),occ.disableControl("occ-dlgLoginDiv-loginBtn",!1)):occ.hideObj(".pass-code4")},ocCommon.prototype.resetLogin=function(){occ.checkInputControl("vc",!0),occ.checkInputControl("ocPassword",!0),occ.setLoginMsg(),occ.removeClass("occ-dlgLoginDiv-ctrl","useCode"),occ.removeClass("occ-dlgLoginDiv-ctrl","usePass"),occ.disableControl("occ-dlgLoginDiv-loginBtn",!0),occ.hideField("vc"),occ.hideField("ocPassword"),occ.resetPassCodeRadio(),occ.hideObj("occ-dlgLoginDiv-resetBtn"),occ.showObj(".pass-code0"),occ.showObj(".pass-code1"),occ.showObj(".pass-code2")},ocCommon.prototype.sendReset=function(e){if(occ.setLoginMsg(),occ.removeClass("occ-dlgLoginDiv-ctrl","usePass"),occ.hideObj("crtAccountBtn"),occ.validateUsername()){var t=new ocAjax({jsonRequest:!1,jsonResponse:!0,showWaiting:!0,onSuccess:function(e){"ok"===e.message?occ.setLoginMsg("An email has been sent with a reset link."):occ.setLoginMsg("Unable to send reset link at this time."),occ.hideObj("occ-dlgLoginDiv-loginBtn")},onFailure:function(e,t,o){occ.setLoginMsg(t)}}),o="md=reset&username="+document.getElementById("myun").value;t.post("/api/auth/",o)}},ocCommon.prototype.validateVC=function(e){if(occ.setLoginMsg(),occ.hasClass("occ-dlgLoginDiv-ctrl","useCode")){if(6!==document.getElementById("vc").value.length){return e&&setTimeout(function(){occ.validateVC()},500),occ.disableControl("occ-dlgLoginDiv-loginBtn",!0),!1}occ.disableControl("occ-dlgLoginDiv-loginBtn",!1),e&&(e.key?"Enter"===e.key&&occ.doLogin(e):e.keyCode&&13===e.keyCode&&occ.doLogin(e))}return!0},ocCommon.prototype.validatePassword=function(e){if(occ.setLoginMsg(),occ.hasClass("occ-dlgLoginDiv-ctrl","usePass")){if(document.getElementById("ocPassword").value.length<6){return e&&setTimeout(function(){occ.validatePassword()},500),!1}occ.disableControl("occ-dlgLoginDiv-loginBtn",!1),e&&(e.key?"Enter"===e.key&&occ.doLogin(e):e.keyCode&&13===e.keyCode&&occ.doLogin(e))}return!0},ocCommon.prototype.validateUsername=function(e){occ.setLoginMsg();let t=document.getElementById("myun");return!(t.value.length<8&&t.value.indexOf("@")>0&&t.value.indexOf(".")>0)||(occ.addClass(t,"invalidEmail"),!1)},ocCommon.prototype.getAuthnMethod=function(e){return"Passkey"},ocCommon.prototype.setMwCidOption=function(e){!1===document.getElementById("pass-code4").checked&&(occ.disableControl("occ-dlgLoginDiv-loginBtn",!1),occ.removeClasses("occ-dlgLoginDiv-ctrl",["useCode","usePass"]))},ocCommon.prototype.validateMwCid=function(e){document.getElementById("myun").value=localStorage.getItem("mwuid");let t=new ArrayBuffer(32);occ.hideField("ocPassword"),occ.setOCFormField("ocPassword",""),fetch("/api/public/challenge",{method:"POST"}).then(e=>{if(!e.ok)throw Error(e.statusTest);return e}).then(e=>e.text()).then(e=>{const o=new TextEncoder;t=o.encode(e);return{publicKey:{challenge:t,userVerification:"required",allowCredentials:[{type:"public-key",id:Uint8Array.from(atob(localStorage.getItem("mwkid")),e=>e.charCodeAt(0))}]}}}).then(e=>navigator.credentials.get(e)).then(e=>{const t={rawId:btoa(String.fromCharCode.apply(null,new Uint8Array(e.rawId))),clientDataJSON:String.fromCharCode.apply(null,new Uint8Array(e.response.clientDataJSON)),signature:btoa(String.fromCharCode.apply(null,new Uint8Array(e.response.signature))),authenticatorData:btoa(String.fromCharCode.apply(null,new Uint8Array(e.response.authenticatorData)))};return console.log("submit validation to server"),t}).then(t=>fetch("/api/public/validate",{method:"POST",body:JSON.stringify(t),headers:{"content-type":"application/json"}}).then(e=>{if(!e.ok)throw Error(e.statusText);return e}).then(e=>e.text()).then(t=>{if(console.log(t),"RSA: verified"!=t&&"ECDsa: verified"!=t)return"Abandoned Credential"==t&&(localStorage.removeItem("mwkid"),occ.setLoginMsg("You need to update your "+("ios"==this.clientOs?"Touch ID or Face ID ":"android"==this.clientOs?"Face Unlock ":"mac"==this.clientOs?"Touch ID ":"Windows Hello ")+"credential.  Please try another login type."),!1);occ.doLogin(e,!0)}).catch(e=>(console.log(e),!1)))},ocCommon.prototype.resetMwcid=function(e){localStorage.removeItem("mwkid"),occ.msgDlg(occ.getAuthnMethod(),"The next time you logout you will not be able to use "+occ.getAuthnMethod().toLowerCase()+" to log back in.")},ocCommon.prototype.registerMwcid=async function(e,t,o){let l=new ArrayBuffer(32),c=localStorage.getItem("mwkid");if(null!=c&&0!=c.trim().length)return console.log("already enrolled"),null;{console.log("fetch registration from server");const e=await fetch("/api/public/register/fetch",{method:"GET"});let o=await e.text();null==o||0==o.trim().length?console.log("not enrolled"):(localStorage.setItem("mwkid",o),localStorage.setItem("mwuid",t),console.log("already enrolled"),occ.msgDlg(occ.getAuthnMethod(),"The next time you logout you can use "+occ.getAuthnMethod().toLowerCase()+" to log back in."))}const i=await fetch("/api/public/challenge",{method:"POST"});let a=await i.text();l=(new TextEncoder).encode(a);let n={publicKey:{rp:{name:"MembershipWare"},user:{name:t,id:Uint8Array.from("UZSL85T9AFC",e=>e.charCodeAt(0)),displayName:o},challenge:l,authenticatorSelection:{authenticatorAttachment:"platform",userVerification:"required"},pubKeyCredParams:[{type:"public-key",alg:-7},{type:"public-key",alg:-257}],attestation:"none"}},r=localStorage.getItem("mwkid");if(null==r||0==r.trim().length){const e=await navigator.credentials.create(n).catch(e=>{console.log(`enroll cancelled - ${e.message}`)});if(e){const o={rawId:btoa(String.fromCharCode.apply(null,new Uint8Array(e.rawId))),clientDataJSON:String.fromCharCode.apply(null,new Uint8Array(e.response.clientDataJSON)),attestationObject:btoa(String.fromCharCode.apply(null,new Uint8Array(e.response.attestationObject))),name:t},l=await fetch("/api/public/pkregister",{method:"POST",body:JSON.stringify(o),headers:{"content-type":"application/json"}});let c=await l.text();c.includes("**")?(r=c.split("**")[0].toString(),localStorage.setItem("mwkid",r),localStorage.setItem("mwuid",t)):(r=c,localStorage.setItem("mwkid",r))}console.log(r)}},ocCommon.prototype.useCode=function(e){occ.showObj("occ-dlgLoginDiv-resetBtn");let t=e.currentTarget,o="pass-code0"===t.id||"pass-code0"===t.htmlFor?"phone":"email";if(occ.removeClass("occ-dlgLoginDiv-ctrl","usePass"),occ.disableControl("occ-dlgLoginDiv-loginBtn",!0),occ.showObj("occ-dlgLoginDiv-loginBtn"),occ.hideField("ocPassword"),occ.setOCFormField("ocPassword",""),occ.setOCFormField("vc",""),!1===occ.validateUsername())return e.preventDefault(),e.stopPropagation(),void setTimeout("occ.resetPassCodeRadio();",500);occ.showField("vc"),occ.addClass("occ-dlgLoginDiv-ctrl","useCode"),occ.sendCode(document.getElementById("myun").value,o,"dlgLogin-form-msg"),document.getElementById("vc").focus(),"email"===o?document.getElementById("pass-code1").checked=!0:document.getElementById("pass-code0").checked=!0,document.getElementById("dlgLogin-form-msg").scrollIntoView()},ocCommon.prototype.usePassword=function(e){if(occ.showObj("occ-dlgLoginDiv-resetBtn"),occ.removeClass("occ-dlgLoginDiv-ctrl","useCode"),occ.disableControl("occ-dlgLoginDiv-loginBtn",!0),occ.hideField("vc"),occ.setOCFormField("ocPassword",""),occ.setOCFormField("vc",""),!1===occ.validateUsername())return e.preventDefault(),e.stopPropagation(),void setTimeout("occ.resetPassCodeRadio();",500);occ.showField("ocPassword"),occ.addClass("occ-dlgLoginDiv-ctrl","usePass"),occ.showObj("occ-dlgLoginDiv-loginBtn"),document.getElementById("ocPassword").focus(),document.getElementById("pass-code2").checked=!0,document.getElementById("dlgLogin-form-msg").scrollIntoView()},ocCommon.prototype.resetPassCodeRadio=function(){document.getElementById("pass-code0").checked=!1,document.getElementById("pass-code1").checked=!1,document.getElementById("pass-code2").checked=!1,document.getElementById("pass-code4").checked=!1}
3,ocCommon.prototype.doLogin=function(e,t){if(!1===occ.validateVC()||!1===occ.validatePassword()||!1===occ.validateUsername()||null!=e&&occ.hasClass(e.currentTarget,"disabled")){let e=!1===occ.validateVC()?"Invalid Code":!1===occ.validateUsername()||!1===occ.validatePassword()?"Invalid Username or Password":"";return console.log("validation failed: "+e),void occ.setLoginMsg(e)}if(document.getElementById("pass-code4").checked&&!0!==t)occ.validateMwCid(e);else{var o=new ocAjax({jsonRequest:!1,jsonResponse:!0,showWaiting:!0,onSuccess:function(e){if(!0===e.valid){occ.dlgLogin.close();let e=window.location.href;e.indexOf("?")>0?e+="&md=auth":e+="?md=auth",window.location.href=e}else occ.hideField("vc"),occ.isVisible("pass-code0")&&occ.toggleObj(".pass-code0"),occ.isVisible("pass-code1")&&occ.toggleObj(".pass-code1"),occ.isVisible("pass-code2")&&occ.toggleObj(".pass-code2"),occ.setLoginMsg(e.message)},onFailure:function(e,t,o){occ.hideWaiting(),occ.setLoginMsg(t)}}),l="md=auth&username="+document.getElementById("myun").value.trim();l+="&method="+(document.getElementById("pass-code0").checked?"phone":"email"),document.getElementById("pass-code4").checked?l+="&mc="+(null!=localStorage.getItem("mwkid")?encodeURIComponent(localStorage.getItem("mwkid")):""):(l+="&password="+(""!==document.getElementById("ocPassword").value?document.getElementById("ocPassword").value.trim():""),l+="&vc="+(""!==document.getElementById("vc").value?document.getElementById("vc").value.trim():"")),o.get("/api/auth/",l)}},ocCommon.prototype.setLoginMsg=function(e){e&&null!==e||(e=""),document.getElementById("dlgLogin-form-msg").innerHTML=e,e.length>0&&(document.getElementById("dlgLogin-form-msg").scrollIntoView(),document.getElementById("dlgLogin-form-msg").focus())},ocCommon.prototype.doLogout=function(e){let t="/index";!0===e&&(t="");new ocAjax({jsonRequest:!1,jsonResponse:!0,showWaiting:!0,onSuccess:function(e){!0===e.valid&&(window.location.href=t+"?md=deauth")}}).get("/api/auth/","md=deauth")},ocCommon.prototype.showCreateUser=function(e,t){if(null!==this.dlgLogin&&this.dlgLogin.close(),null===this.dlgCreate){var o=occ.createElement("form",["ocFormContainer","occ-dlgCreate-form"],[{name:"id",value:"dlgCreate-form"}],null);let l=occ.createInputControl("ocemail","Email","email",null,["required"]);o.appendChild(l);let c=occ.createInputControl("ocfirst","First Name","text",null,["required"]);o.appendChild(c);let i=occ.createInputControl("oclast","Last Name","text",null,["required"]);if(o.appendChild(i),!1!==e){let e=occ.createInputControl("occompany","Company Name","text",null,["required"]);o.appendChild(e)}let a=occ.createInputControl("ocphone","Phone Number","tel",null,["required"]);o.appendChild(a);let n=occ.createInputControl("cPasswordCbx","Use Password","checkbox");occ.addClickEvent(n,occ.enablePassword);let r=occ.createInputControl("cPassword1","Password","secure",null,null,[{name:"data-confirm",value:"true"},{name:"data-minlength",value:"5"}]);occ.hideObj(r),o.appendChild(n),o.appendChild(r),o.appendChild(occ.createDiv("",["inValidErrorMsg"],[{name:"id",value:"dlgCreate-form-msg"}])),o.appendChild(occ.createElement("input",null,[{name:"id",value:"ceTenantId"},{name:"type",value:"hidden"},{name:"value",value:t&&null!==t?t:""}])),this.dlgCreate=new ocDialog({id:"occ-dlgCreateDiv-ctrl",content:o,title:"Create an Account",class:["occ-createDlg","dlgsize-small"],onOpen:function(e){occ.addClass(document.body,"occ-createDlg-isOpen"),document.getElementById("eAccountID")&&""!==document.getElementById("eAccountID").value?(document.getElementById("ocemail").value=d
3ocument.getElementById("newEmail").value,document.getElementById("occompany").value=document.getElementById("acctName").value,document.getElementById("occompany").disabled=!0,occ.hideObj("occ-dlgCreateDiv-Btn1")):(occ.showObj("occ-dlgCreateDiv-Btn1"),document.getElementById("occompany").disabled=!1)},onClose:function(e){occ.removeClass(document.body,"occ-createDlg-isOpen")},buttons:[{id:"occ-dlgCreateDiv-Btn1",content:"Existing Account",onClick:function(e){occ.showLogin()},align:"L"},{id:"occ-dlgCreateDiv-Btn2",content:"Create",onClick:occ.doCreate,align:"R"}]})}this.dlgCreate.open()},ocCommon.prototype.enablePassword=function(e){occ.toggleObj("cPassword1-ctrl"),occ.isVisible("cPassword1-ctrl")&&(document.getElementById("cPassword1-cp").scrollIntoView(),document.getElementById("cPassword1").focus())},ocCommon.prototype.doCreate=function(e){if(document.getElementById("dlgCreate-form-msg").innerHTML="",!0===occ.checkOCFormContainer("dlgCreate-form").valid){var t=new ocAjax({showWaiting:!0,jsonResponse:!0,onSuccess:function(e){if(!0===e.valid){null!==occ.dlgCreate&&occ.dlgCreate.close();try{afterOccDoCreate(e)}catch(e){let t=window.location.href;t.indexOf("?")>0?t+="&md=create":t+="/index?md=create",window.location.href=t}}else{try{afterOccDoCreate(e)}catch(e){}document.getElementById("dlgCreate-form-msg").innerHTML=e.message}},onFailure:function(e,t,o){occ.hideWaiting()}}),o={email:"",firstname:"",lastname:"",password:"",companyname:"",phonenumber:"",eAccountID:"",eTenantId:"",doConnect:!1};o.email=document.getElementById("ocemail").value,o.firstname=document.getElementById("ocfirst").value,o.lastname=document.getElementById("oclast").value,o.password=document.getElementById("cPassword1").value,o.companyname="",document.getElementById("occompany")&&""!==document.getElementById("occompany").value&&(o.companyname=document.getElementById("occompany").value),o.phonenumber=document.getElementById("ocphone").value,o.eTenantId=document.getElementById("ceTenantId").value,document.getElementById("eAccountID")&&""!==document.getElementById("eAccountID").value&&(o.eAccountID=document.getElementById("eAccountID").value),"true"===document.getElementById("dlgCreate-form").getAttribute("data-connect")&&(o.doConnect=!0),"true"===document.getElementById("dlgCreate-form").getAttribute("data-al")&&(o.al=!0),t.post("/api/auth/?md=create",o)}},ocCommon.prototype.sendCode=function(e,t,o,l){var c=new ocAjax({jsonRequest:!1,jsonResponse:!0,showWaiting:!0,onSuccess:function(e){!0===e.valid?"ok"===e.message.substring(0,2)?(occ.isVisible("pass-code0")||occ.toggleObj(".pass-code0"),occ.isVisible("pass-code1")||occ.toggleObj(".pass-code1"),occ.isVisible("pass-code2")||occ.toggleObj(".pass-code2"),document.getElementById(o).innerHTML="A code has been sent to "+("phone"==t?"XXX-XXX-"+e.message.substring(2,6)+".":" your email."),document.getElementById("vc").focus()):"sendsms"===e.message.substring(0,7)?(occ.hideField("vc"),occ.isVisible("pass-code0")||occ.toggleObj(".pass-code0"),document.getElementById(o).innerHTML="Unable to send to XXX-XXX-"+e.message.substring(7,11)+". Please use your email or password to login."):(occ.hideField("vc"),occ.isVisible("pass-code0")||occ.toggleObj(".pass-code0"),"np"===e.message.substring(0,2)?document.getElementById(o).innerHTML="No cellphone on file. Please use your email or password to login.":(occ.isVisible("pass-code1")||occ.toggleObj(".pass-code1"),document.getElementById(o).innerHTML="Unable to send authentication code. Please try again later or use a password to login.")):"na"===e.message?document.getElementById(o).innerHTML="Sorry, this address cannot be used.":document.getElementById(o).innerHTML=e.message}}),i="md=sendcode&username="+e+"&method="+t;l&&null!==l&&""!==l&&(i+="&et="+l),c.get("/api/auth/",i)},ocCommon.prototype.updateOcCart=function(e){if(!document.querySelector("div.ocStoreCart"))return;if(null===e&&!1===occ.hasClass("div.ocStoreCart","dbInit"))return void occ.initMWCart(e);let t=[],o=null,l="";if(null!==e&&(l=e.currentTarget.id,(l.indexOf("-qa")>0||!0===occ.hasClass(e.currentTarget,"singlePrice"))&&occ.qtyUp(e),o=document.getElementById(l.replace("-crt","").replace("-qa","")),t=o.value,!1===occ.isNullOrEmpty(t)&&(t=JSON.parse(t))),Array.isArray(t)){for(let e=0;e<t.length;e++)if(!0!==t[e].deleted){let o=!1,l=JSON.parse(JSON.stringify(t[e]));l.fieldOptionId=(new Date).getTime();for(let t=0;t<occ.mwCart.items.length;t++)l.fieldValue===occ.mwCart.items[t].fieldValue&&!0!==occ.mwCart.items[e].deleted&&(o=!0,occ.mwCart.items[t].fieldQty+=l.fieldQty);!1===o&&occ.mwCart.items.push(l)}occ.saveCartData(null)}let c=document.querySelector("div.ocStoreCart");if(c){let t=document.getElementById("ocCartTitleBar");if(!t){t=occ.createDiv("<h2>All Products</h2>",null,[{name:"id",value:"ocCartTitleBar"}]),c.insertBefore(t,c.childNodes[0]),t=document.getElementById("ocCartTitleBar");let e=occ.ocButton("ocCartTitleBarBk",null,occ.hideOCStoreDetail,"arrow-left sz4 tr");occ.hideObj(e),t.insertBefore(e,t.childNodes[0])}let i=document.getElementById("ocCartDisplayBtn");if(i||(i=occ.ocButton("ocCartDisplayBtn",null,occ.showOCCart,"bag sz4 bk"),t.insertBefore(i,t.childNodes[0]),i=document.getElementById("ocCartDisplayBtn")),i){let t=0;for(let e=0;e<occ.mwCart.items.length;e++)!0!==occ.mwCart.items[e].deleted&&(t+=occ.mwCart.items[e].fieldQty);if(occ.ocButtonBadge("ocCartDisplayBtn",t),null!==o){if(o.value="",l.indexOf("-qa")<0){let t=
3o.parentElement.querySelectorAll("input.curQty");if(t.length>1){for(let e=0;e<t.length;e++)t[e].value="0","checkbox"!==t[e].getAttribute("type")&&"radio"!==t[e].getAttribute("type")||(t[e].checked=!1);occ.disableControl(e.currentTarget,!0)}}occ.showControlMsg(o.parentElement,"Added","check gr")}occ.hideObj("btnOcCartClear"),occ.hideObj("btnOcCartBuy"),t>0&&(occ.showObj("btnOcCartClear"),occ.showObj("btnOcCartBuy"))}}},ocCommon.prototype.showOCStoreDetail=function(e){if(!1===occ.hasClass(e.currentTarget,"active")){occ.showObj("ocCartTitleBarBk"),occ.addClass(e.currentTarget.parentElement,"detailOpen"),occ.addClass(e.currentTarget,"active"),e.currentTarget.querySelector("div.fieldImage").style.height=e.currentTarget.clientHeight-10+"px"}},ocCommon.prototype.hideOCStoreDetail=function(e){occ.hideObj("ocCartTitleBarBk");let t=document.querySelector("div.ocFieldParent.detailOpen > div.ocField.active > div.fieldImage");t&&(t.style.height=""),occ.removeClass("div.ocFieldParent.detailOpen > div.ocField.active","active"),occ.removeClass("div.ocFieldParent.detailOpen","detailOpen")},ocCommon.prototype.clearOcCart=function(e){occ.msgDlg("Empty the cart","<p>Are you sure you want to empty the cart?</p>","mini",[{id:"ocRowCartIitem",content:"Yes",onClick:occ.clearOcCartCB},{id:"ocCartDelIitem-cancel",content:"No",onClick:function(e){occ.dlgMsg.close()},align:"L"}])},ocCommon.prototype.clearOcCartCB=function(e){occ.mwCart.items=[],occ.saveCartData(null),occ.updateOcCart(null);let t=document.querySelector("div.ocCartDlgDiv-List");t&&(t.innerHTML="");let o=ocCartDlg.dialog.querySelector("div.ocCartTotal");o&&(o.innerHTML="Total:&nbsp;&nbsp;&nbsp;$0.00"),occ.ocButtonBadge("ocCartDisplayBtn","0"),occ.dlgMsg.close()};let ocCartDlg=null;ocCommon.prototype.showOCCart=function(e){null===ocCartDlg&&(document.body.appendChild(occ.createDiv('<div class="ocCartDlgDiv-List"></div><div class="ocCartTotal"></div>',["ocDialog-Obj","ocFormContainer"],[{name:"id",value:"ocCartDlgDiv"}])),ocCartDlg=new ocDialog({id:"ocCartDlgObj",content:document.getElementById("ocCartDlgDiv"),title:"Cart",class:"ocCartDlg",allowMaximize:!1,buttons:[{id:"btnOcCartClose",content:"Close",onClick:function(e){closeDialogByEvent(e)},align:"L"},{id:"btnOcCartClear",content:"Clear",onClick:occ.clearOcCart,align:"L"},{id:"btnOcCartBuy",content:"Checkout",onClick:occ.gotoOcCheckOut,align:"L"}]}));let t=document.getElementById("ocCartDlgDiv");if(null!==t&&null!==ocCartDlg){let e=ocCartDlg.dialog.querySelector("h2.ocDialog-titlebar");if(!e.querySelector("div.s-bag")){let t=occ.createDiv("",["icon","s-bag","sz3","tr","right"],[{name:"style",value:"margin:0;cursor:pointer;"}]);occ.addClickEvent(t,function(){ocCartDlg&&ocCartDlg.close()}),e.appendChild(t),e.style.padding="8px 10px 8px 10px"}let o=t.querySelector("div.ocCartDlgDiv-List");o=t.querySelector("div.ocCartDlgDiv-List"),o.innerHTML="";let l=0,c=0;for(let e=0;e<occ.mwCart.items.length;e++){l+=1*occ.mwCart.items[e].fieldQty*(1*occ.mwCart.items[e].fieldPrice),c+=1*occ.mwCart.items[e].fieldQty;let t=occ.createDiv(""),i='<div class="fieldImage" style=\'background-image: '+occ.mwCart.items[e].fieldImageUrl+";'></div>";i+='<div class="fieldProduct">'+(!0===occ.isNullOrEmpty(occ.mwCart.items[e].fieldGroup)?"":occ.mwCart.items[e].fieldGroup+": ")+occ.mwCart.items[e].fieldOption+"</div>",i+='<div class="fieldPrice">$'+1*occ.mwCart.items[e].fieldPrice/100+"</div>",t.innerHTML=i;let a=occ.createDiv("",["cartReduce","icon","s-minus","sz2","tr"]);occ.addClickEvent(a,occ.adjustOcCartItem),t.appendChild(a);let n=occ.createElement("input",["curQty"],[{name:"type",value:"text"}]);n.value=occ.mwCart.items[e].fieldQty,t.appendChild(n);let r=occ.createDiv("",["cartIncrease","icon","s-plus","sz2","tr"]);occ.addClickEvent(r,occ.adjustOcCartItem),t.appendChild(r),t.setAttribute("data-eFieldOptionId",occ.mwCart.items[e].eFieldOptionId),o.appendChild(t)}let i=ocCartDlg.dialog.querySelector("div.ocCartTotal");i&&(l=1*l/100,i.innerHTML="Total&nbsp;&nbsp;&nbsp;$"+((l+"").indexOf(".")>-1?l:l+".00")),occ.ocButtonBadge("ocCartDisplayBtn",c),occ.hideObj("btnOcCartClear"),occ.hideObj("btnOcCartBuy"),occ.mwCart.items.length>0&&(occ.showObj("btnOcCartClear"),occ.showObj("btnOcCartBuy")),ocCartDlg.open()}},ocCommon.prototype.initMWCart=function(e){if(occ.mwCart={mwid:"ct-"+(new Date).getTime(),items:[]},!0===occ.hasClass("div.ocStoreCart","dbIniting"))return;occ.addClass("div.ocStoreCart","dbIniting"),new ocAjax({jsonRequest:!1,jsonResponse:!0,showWaiting:!0,onSuccess:function(e,t){e&&e.mwid&&!1===occ.isNullOrEmpty(e.mwid)&&(occ.mwCart.mwid=e.mwid,e.items&&e.items.length>0&&0===occ.mwCart.items.length&&(occ.mwCart.items=e.items)),occ.addClass("div.ocStoreCart","dbInit"),occ.removeClass("div.ocStoreCart","dbIniting"),occ.updateOcCart(null)}
3,onFailure:function(e,t,o){}}).get("/api/prod/GetClientCart/")},ocCommon.prototype.adjustOcCartItem=function(e){let t=e.currentTarget,o=t.parentElement,l=o.getAttribute("data-eFieldOptionId"),c=o.querySelector("input"),i=0,a=0;for(let e=0;e<occ.mwCart.items.length;e++)l===occ.mwCart.items[e].eFieldOptionId+""&&(!0===occ.hasClass(t,"cartRemove")||!0===occ.hasClass(t,"cartReduce")&&1===occ.mwCart.items[e].fieldQty?(occ.mwCart.items.splice(e,1),o.remove()):(!0===occ.hasClass(t,"cartIncrease")?occ.mwCart.items[e].fieldQty++:!0===occ.hasClass(t,"cartReduce")&&occ.mwCart.items[e].fieldQty--,c&&(c.value=occ.mwCart.items[e].fieldQty))),occ.mwCart.items[e]&&(i+=1*occ.mwCart.items[e].fieldQty*(1*occ.mwCart.items[e].fieldPrice),a+=1*occ.mwCart.items[e].fieldQty);occ.ocButtonBadge("ocCartDisplayBtn",a),occ.saveCartData(null);let n=ocCartDlg.dialog.querySelector("div.ocCartTotal");n&&(i=i/100+"",-1===i.indexOf(".")?i+=".00":i.indexOf(".")===i.length&&(i+="0"),n.innerHTML="Total:&nbsp;&nbsp;&nbsp;$"+i)},ocCommon.prototype.gotoOcCheckOut=function(e){occ.saveCartData(e)},ocCommon.prototype.saveCartData=function(e){let t=document.querySelector("div.ocStoreCart"),o=null!==e&&e.currentTarget&&e.currentTarget.id&&e.currentTarget.id?e.currentTarget.id:"";if(t){if(!occ.mwCart.mwid||!occ.mwCart.items||!Array.isArray(occ.mwCart.items))return void ocCartDlg.close();new ocAjax({jsonRequest:!0,jsonResponse:!1,showWaiting:!0,onSuccess:function(e,l){if((200===l.res.status||204===l.res.status)&&"btnOcCartBuy"===o){ocCartDlg.close();let e=t.getAttribute("data-checkout");!1===occ.isNullOrEmpty(e)&&(window.location.href=e)}},onFailure:function(e,t,o){}}).post("/api/prod/PostClientCart",occ.mwCart)}},ocCommon.prototype.showControlMsg=function(e,t,o,l){if(!e||null===e||1==occ.isNullOrEmpty(t)||t.length<2)return;if(!(e=occ.getElementFromString(e)))return;let c=occ.createDiv("",["ocControlMsg"]);c.innerHTML=(o&&0==occ.isNullOrEmpty(o)?'<div class="icon sz4 th s-'+o+'"></div>':"")+"<div>"+t+"</div>",e.appendChild(c),c=e.querySelector("div.ocControlMsg"),c.style.paddingTop=c.clientHeight/2-40+"px",(!l||null===l||l<1)&&(l=1.5),setTimeout(function(){occ.hideControlMsg(e)},1e3*l)},ocCommon.prototype.hideControlMsg=function(e){if(!(e=occ.getElementFromString(e))||null===e)return;let t=e.querySelector("div.ocControlMsg");t&&t.remove()},ocCommon.prototype.padText=function(e,t,o,l){let c=e;for(;c.length<o;)"right"==l?c+=t:c="center"==l?t+c+t:t+c;return o<c.length&&(c=c.substring(1,o))," "===t&&(c=c.replace(/\s/g,"&nbsp;")),c},ocCommon.prototype.copyToClipboard=function(e){let t=!0;if(e=occ.getElementFromString(e),occ.isVisible(e)&&(t=!1),occ.showObj(e),"INPUT"!==e.tagName&&"TEXTAREA"!==e.tagName){if(e.parentElement.querySelector("textarea.tempobj"))e.parentElement.querySelector("textarea.tempobj").value=e.innerText;else{let t=occ.createElement("textarea",["tempobj"],null,e.innerText);e.parentElement.appendChild(t)}e=e.parentElement.querySelector("textarea.tempobj"),t=!0}e.select(),e.setSelectionRange(0,99999),document.execCommand("copy"),e.setSelectionRange(0,0),occ.showTooltip(e.parentElement,"COPIED"),1==t&&occ.hideObj(e)};let ocirmbuttons=0;ocCommon.prototype.initReadMe=function(e){e&&null!=e||(e=document);let t=e.querySelectorAll(".readToMe-obj");for(let e=0;e<t.length;e++)if(0==this.hasClass(t[e],"readToMe")){occ.addClass(t[e],"readToMe");let o=null;if(occ.hasClass(t[e],"readMore")||!1===occ.isNullOrEmpty(t[e].getAttribute("data-label"))){let l="Listen";!1===occ.isNullOrEmpty(t[e].getAttribute("data-label"))&&(l=t[e].getAttribute("data-label")),o=occ.ocButton("ocir"+ocirmbuttons,l,occ.readMyText,"sound sz3 gr")}else o=occ.createDiv("",["icon","s-sound","sz3","gr"]),occ.addClickEvent(o,occ.readMyText);occ.addClass(o,"readToMeBtn"),t[e].prepend(o),ocirmbuttons++}},this.speechObj=null,this.speechArray=[],this.speachCT=0,ocCommon.prototype.readMyText=function(e){if(null!=occ.speechObj&&!0===occ.hasClass(e.currentTarget,"activeReading"))occ.stopReading();else{occ.stopReading();let o=e.currentTarget.parentElement,l="",c=occ.createDiv("");!1===occ.isNullOrEmpty(o.getAttribute("data-tts"))?c.innerHTML=o.getAttribute("data-tts"):(c.innerHTML=o.innerHTML,!1===occ.hasClass(e.currentTarget,"icon")&&c.querySelector("button.readToMeBtn").remove()),c.innerHTML=c.innerHTML.replaceAll("<br>","*,*").replaceAll("</p>","</p>*,**,*"),l=c.innerText,occ.replaceClass(e.currentTarget,"gr","bl"),occ.addClass(e.currentTarget,"activeReading");try{let e=l.split("*,*");for(let o=0;o<e.length;o++){var t=new SpeechSynthesisUtterance;t.text=e[o]+"",t.volume=.5,o===e.length-1?t.onend=occ.stopReading:t.onend=occ.continueReading,occ.speechArray.push(t)}occ.continueReading()}catch(e){}}},ocCommon.prototype.continueReading=function(){occ.speechArray.length>occ.speachCT&&(occ.speechObj=window.speechSynthesis,occ.speechObj.speak(occ.speechArray[occ.speachCT]),occ.speachCT++)},ocCommon.prototype.stopReading=function(){null!=occ.speechObj&&(occ.replaceClass(".activeReading","bl","gr"),occ.removeClass(".activeReading","activeReading"),occ.speechObj.cancel(),occ.speechObj=null,occ.speechArray=[],occ.speachCT=0)},ocCommon.prototype.checkResponseHeader=function(e,t,o){let l="";if(!1===occ.isNothingOrEmpty(e)&&!1===occ.isNothingOrEmpty(t)){let i=new FormData;i.append("url",e),i.append("headerName",t),0==occ.isNothingOrEmpty(o)&&i.append("valuetocheck",o);var c=new XMLHttpRequest;c.open("POST","/api/public/chku",!1),c.send(i),l=c.responseText}return!!occ.isNothingOrEmpty(o)&&("true"==l&&(l=!0),l)},ocCommon.prototype.ampVideos=function(e){let t=document.querySelectorAll(".ocVideo-min");if(t.length>0&&!document.getElementById("ampCSS")&&document.querySelector("div.azuremediaplayer")&&occ.loadResources("ams",null,null),e&&null!==e&&(e=occ.getElementFromString(e)),e&&null!==e&&occ.hasClass(e,"ocVideo-min"))occ.removeClass(e,"ocVideo-min"),!0===occ.hasClass(e.parentElement,"ocItemCol")||!0===occ.hasClass(e.parentElement,"ocCarousel")?occ.addClass(e,"hasVideo"):occ.addClass(e,"staticVideoSize"),occ.embedVideoCode(null,null,e),occ.finalAmp(e);else{t=e.querySelectorAll(".ocVideo-min");for(let e=0;e<t.length;e++)occ.ampVideos(t[e])}};let tryOPOCt=0;ocCommon.prototype.finalAmp=function(e){let t=function(){try{let t=amp(e.querySelector("video"),{fluid:!1});if("ios"===clientOs&&"AES"==e.getAttribute("data-protection")){let e=linkUrl.replace("(format=mpd-time-csf,encryption=cbc)",""),o="/api/ManifestLoad?token="+token+"&playbackUrl="+e+"(format=m3u8-aapl)";t.src([{src:o,type:"application/vnd.apple.mpegurl",disableUrlRewriter:!0}])}tryOPOCt=0}catch(e){tryOPOCt++,tryOPOCt<5&&setTimeout(t,500)}};setTimeout(t,500)},ocCommon.prototype.itemCarouselNavClick=function(e){let t=e.currentTarget;if(!1===occ.hasClass(t,"active")){let e=t.getAttribute("data-item");if(1*e!==NaN){let o=t.parentElement.parentElement.querySelectorAll("div.cItem");o.length>1&&occ.triggerEvent(o[1*e])}}},ocCommon.prototype.itemCarouselClick=function(e){licFirst=!1;let t=e.target;if(!1===occ.hasClass(t,"active")){let o=occ.getNearest(t,"ocCarousel");occ.cancelCarouselTimer(e.isTrusted,o.parentElement);let l=o.querySelector("div.active");if(!l)return;l.querySelector("video")?l.querySelector("video").pause():l.querySelector("div.isAudio > iframe.videoContainer")?l.querySelector("iframe.videoContainer").src="":l.querySelector("iframe.videoContainer")&&(l.querySelector("iframe.videoContainer").src=l.getAttribute("data-url")),occ.removeClass(l,"active");let c=null,i=o.querySelectorAll("div.cItem");c=occ.hasClass(t,"s-arrow-left")?"SPAN"!=l.previousElementSibling.tagName?l.previousElementSibling:i[i.length-1]:occ.hasClass(t,"s-arrow-right")||occ.hasClass(t,"autoN")?"SPAN"!=l.nextElementSibling.tagName&&0==occ.hasClass(l.nextElementSibling,"ocItemNav")?l.nextElementSibling:i[0]:e.currentTarget,occ.itemCarouselAdjust(c),occ.triggerEvent(o.parentElement,"occ::slide-change",{prevItem:l,curItem:c}),c.querySelector("div.isAudio > iframe.videoContainer")&&(c.querySelector("iframe.videoContainer").src=c.getAttribute("data-url"))}},ocCommon.prototype.itemCarouselAdjust=function(e){if(e&&null!==e){let t=e.parentElement;if(!1===occ.isVisible(t))return;occ.removeClass(t.querySelectorAll("div.cItem.active"),"active");let o=t.querySelectorAll("div.ocItemNav > div");if(o.length>1){occ.removeClass(t.querySelectorAll("div.ocItemNav > div.active"),"active");let l=e.getAttribute("data-item");1*l!==NaN&&occ.addClass(o[1*l],"active")}occ.addClass(e,"active"),e.style.width="";let l=e.clientWidth,c=t.clientWidth,i=0;i=c-l<241?c-1+"px":l+"px",e.querySelector("div.azuremediaplayer")&&(e.style.width=i),l=(c-l)/2-40,occ.ampVideos(e),occ.setVideosSize(e),!0!==occ.hasClass(e.parentElement.parentElement,"auto
3play")&&!0!==occ.hasClass(e.parentElement,"autoplay")||!e.querySelector("video")||e.querySelector("video").play()}},ocCommon.prototype.globalLinkExit=function(e){if(null!==e){if(e.srcElement&&!0===occ.hasClass(e.srcElement.parentElement.parentElement.parentElement,"ocItemGridCover"))return;if(e.currentTarget&&""!==e.currentTarget.getAttribute("data-href")&&(e=e.currentTarget.getAttribute("data-href")),"string"==typeof e&&!1===occ.isNothingOrEmpty(e))try{linkExit(e)}catch(e){}}},ocCommon.prototype.itemGridClick=function(e){try{licFirst=!1;let t=e.currentTarget,o=occ.getNearest(t,"ocItemGrid"),l=o.querySelector("div.ocItemGridCover div.cItem.active");if(l&&(l.querySelector("video")?l.querySelector("video").pause():l.querySelector("iframe.videoContainer")&&l.querySelector("iframe.videoContainer").contentDocument.location.reload(!0),l.querySelector("img").src=l.querySelector("img").src.replace("=xlarge","=large")),l=o.querySelector('div.ocItemGridCover div.cItem[data-item="'+t.getAttribute("data-item")+'"]'),l){occ.globalLinkExit(l.querySelector("img.cImg").getAttribute("data-href")),occ.showObj(o.querySelector("div.ocItemGridCover")),setTimeout(function(){occ.itemCarouselAdjust(l)},500)}}catch(e){console.log(e)}},ocCommon.prototype.itemGridClose=function(e){let t=e.currentTarget,o=occ.getNearest(t,"ocItemGridCover"),l=o.querySelector("div.isAudio.active");l&&(l.querySelector("iframe.videoContainer").src=""),occ.hideObj(o)};let licFirst=!0;ocCommon.prototype.loadImageCarousel=function(e,t,o,l,c,i){occ.loadCarousel(e,t,o,l,c,i)},ocCommon.prototype.loadCarousel=function(e,t,o,l,c,i){if(!t||null===t||!1===Array.isArray(t))return;(e=occ.getElementFromString(e)).querySelector("div.ocItemCt")&&e.querySelector("div.ocItemCt").remove();let a=null;if(!1===occ.isNothingOrEmpty(e.id)&&"true"!=e.getAttribute("data-grid")){let t=e.id;a=function(){!0===licFirst&&occ.itemCarouselAdjust(document.querySelector("#"+t+" div.cItem"))}}let n="true"==e.getAttribute("data-grid");for(let o=0;o<t.length;o++){let r=[],s=[],d="lazy";n||0!==o||(d="",s.push("cItem"));let u=null,p=null;if("mp4"==t[o].imageType||"mov"==t[o].imageType)r.push({name:"data-url",value:t[o].imageUrl}),s.push("ocVideo-min"),null!==t[o].token&&r.push({name:"data-token",value:t[o].token}),null!==t[o].protection&&r.push({name:"data-protection",value:t[o].protection});else if(0==occ.isNothingOrEmpty(t[o].imageType)){let l="large";if(occ.hasClass(e,"xLarge")&&!occ.isMobile&&(l="xlarge"),u=occ.createElement("img",["cImg"],[{name:"src",value:t[o].imageUrl+"&s="+l},{name:"loading",value:d},{name:"alt",value:t[o].imageCaption}]),0===o&&null!==a&&(occ.addEvent(u,a,"load"),"function"==typeof i)){u.setAttribute("observed","N"),occ.addClass(u,"observeChild");let e=function(){u.removeEventListener("observed",i),i("observed")};occ.addEvent(u,e,"observed")}}if(!1===occ.isNothingOrEmpty(t[o].imageCaption)&&(!1!==l&&(s.push("hasCaptions"),p=occ.createDiv(t[o].imageCaption,["caption"])),t[o].imageCaption.toLowerCase().indexOf("https://")>-1)){t[o].imageCaption=t[o].imageCaption.replace("HTTPS","https").replace("Https","https");let e="https://"+t[o].imageCaption.split("https://")[1];e.length>12&&(e.indexOf(" ")>0&&(e=e.split(" ")[0]),u.setAttribute("data-href",e),u.style.cursor="pointer",occ.addClickEvent(u,occ.globalLinkExit),null!=p&&(p.setAttribute("data-href",e),p.style.cursor="pointer",occ.addClickEvent(p,occ.globalLinkExit)))}let m=occ.createDiv("",s,r);null!=u?(!0!==c&&occ.addClass(u,"noClick"),m.appendChild(u)):!1===occ.isNothingOrEmpty(t[o].html)&&(m.innerHTML=t[o].html),null!=p&&m.appendChild(p),null!==a&&setTimeout(a,1200),e.appendChild(m)}if(t.length>1?occ.removeClass(e,"single"):occ.addClass(e,"single"),occ.initItemCarousel(e,o,t,c),"function"==typeof i&&setTimeout(function(){occ.initObserver(e)},500),n){let t=e.querySelectorAll("div.isAudio > iframe.videoContainer");for(let e=0;e<t.length;e++)t[e].src=t[e].parentElement.parentElement.getAttribute("data-url")}else{let t=e.querySelector("div.isAudio.active iframe.videoContainer");t&&(t.src=t.parentElement.parentElement.getAttribute("data-url"))}},ocCommon.prototype.initItemCarousel=function(e,t,o,l){try{if(void 0===l&&(l=!0),(e=occ.getElementFromString(e)).querySelector("div.ocItemCt"))return;let c=occ.createDiv("",["ocItemCt"]),i=occ.createDiv("",["ocItemNav"]),a=null,n=null,r=null,s=null,d=null,u=0,p="true"==e.getAttribute("data-grid"),m=e.children.length,h=e.children;if(p)a=occ.createDiv("",["mCol1","ocItemCol"]),n=occ.createDiv("",["mCol2","ocItemCol"]),r=occ.createDiv("",["dCol1","ocItemCol"]),s=occ.createDiv("",["dCol2","ocItemCol"]),d=occ.createDiv("",["dCol3","ocItemCol"]),occ.addClass(c,"ocItemGrid");else{occ.addClass(c,"ocCarousel"),h.length>1&&occ.addClass(c,"carousel"),(t+="")&&null!==t&&(-1===t.indexOf("%")&&-1===t.indexOf("px")&&(t+="px"),c.style.height=t);let e=document.createElement("span");e.innerHTML='<div class="icon s-arrow-left sz3 rv"></div>',occ.addClickEvent(e,occ.itemCarouselClick),occ.addClass(e,"ocCarouselClick"),c.appendChild(e)}let g=0,f=!1;for(let t=0;t<m;t++)if(!0===occ.hasClass(h[g],"icon"))g++,m--,t--;else if(h[g].setAttribute("data-item",t),occ.addClass(h[g],"cItem"),h[g].querySelector(".hasCaptions")&&occ.addClass(e,"hasCaptions"),p)u++,3===u?(d.appendChild(h[g].cloneNode(!0)),u=0):2===u?s.appendChild(h[g].cloneNode(!0)):1===u&&r.appendChild(h[g].cloneNode(!0)),(t+1)%2==0?n.appendChild(h[g].cloneNode(!0)):a.appendChild(h[g].cloneNode(!0)),h[g].remove();else{f||t!==g||(f=!0,occ.addClass(h[g],"active")),occ.addClickEvent(h[g],occ.itemCarouselClick),c.appendChild(h[g]);let e=occ.createDiv("",null,[{name:"data-item",value:t}]);occ.addClickEvent(e,occ.itemCarouselNavClick),f||t!==g||occ.addClass(e,"active"),i.appendChild(e)}
3if(p){if(!document.getElementById(e.id+"-cover")){let t=occ.createDiv("",["ocItemGridCover","hiddenObj"],[{name:"id",value:e.id+"-cover"}]);occ.addClickEvent(t,occ.itemGridClose),occ.addClickEvent(t,function(e){e.preventDefault(),e.stopPropagation()},"click");let o=occ.createDiv("",["icon","s-x","sz3","rv"]);occ.addClickEvent(o,occ.itemGridClose),occ.addClickEvent(o,function(e){e.preventDefault(),e.stopPropagation()},"click"),t.appendChild(o),c.appendChild(t)}c.appendChild(a),c.appendChild(n),c.appendChild(r),c.appendChild(s),c.appendChild(d),occ.addClass(c,"ready")}else{c.appendChild(i);let e=document.createElement("span");e.innerHTML='<div class="icon s-arrow-right sz3 rv"></div>',occ.addClasses(e,["ocCarouselClick","autoN"]),occ.addClickEvent(e,occ.itemCarouselClick),c.appendChild(e)}if(e.appendChild(c),occ.ampVideos(e),p){let t=e.querySelectorAll("div.ocItemCol > div.cItem");if(!0===l)for(let e=0;e<t.length;e++)occ.addClickEvent(t[e],occ.itemGridClick);occ.loadImageCarousel(e.id+"-cover",o,null,l)}!1===occ.isNothingOrEmpty(e.getAttribute("data-auto"))&&occ.startCarouselTimer(e);let y=e.querySelector("div.ocItemNav");y&&y.clientHeight>20&&occ.hideObj(y)}catch(e){console.log(e)}},occ.carouselAction=[],ocCommon.prototype.startCarouselTimer=function(e){try{let t=1*e.getAttribute("data-auto");if(NaN!==t&&t>0){let o=e.id,l=function(e){occ.triggerEvent(document.querySelector("#"+o+" span.ocCarouselClick.autoN"))};occ.carouselAction.push({p:e.id,f:setInterval(l,1e3*t,occ.carouselAction.length)})}}catch(e){console.log("startCarouselTimer error:"+e)}},ocCommon.prototype.cancelCarouselTimer=function(e,t){if(!0===e&&occ.carouselAction.length>0)for(let e=0;e<occ.carouselAction.length;e++)occ.carouselAction[e].p===t.id&&null!==occ.carouselAction[e].f&&(clearInterval(occ.carouselAction[e].f),occ.carouselAction[e].f=null)},ocCommon.prototype.initMasonry=function(e,t,o){if(!(e=occ.getElementFromString(e))||occ.hasClass(e,"bricked")||occ.isNothingOrEmpty(t))return;let l=e.querySelectorAll(t);if(l.length>0){for(let e=0;e<l.length;e++)occ.addClass(l[e],"brick"),occ.addClass(l[e],"brick"+(e+1));for(let t=0;t<o;t++){let o=document.createElement("div");o.classList="surface surface"+(t+1),e.appendChild(o)}e.setAttribute("data-walls",o),occ.addClass(e,"bricked"),occ.addClass(e,"bricked"+o),occ.adjustMasonry(),window.addEventListener("resize",occ.adjustMasonry)}},ocCommon.prototype.adjustMasonry=function(){let e=document.querySelectorAll("div.bricked");for(let t=0;t<e.length;t++){let o=1*e[t].getAttribute("data-walls"),l=1200/o+20;if(document.body.clientWidth<l)o=1;else if(o>2&&document.body.clientWidth<1200){let e=Math.round(document.body.clientWidth/l);e<o&&(o=e)}if(o+""!==e[t].getAttribute("data-wallCt")){let l=e[t].querySelectorAll("div.surface"),c=e[t].querySelectorAll("div.brick"),i=0;for(let a=0;a<c.length;a++)l[i].appendChild(e[t].querySelector("div.brick"+(a+1))),i++,i===o&&(i=0);occ.removeClass(e[t],"bricked"+e[t].getAttribute("data-wallCt")),occ.addClass(e[t],"bricked"+o),e[t].setAttribute("data-wallCt",o)}}},ocCommon.prototype.initItemOrder=function(e,t,o,l,c,i){e=occ.getElementFromString(e),occ.addClass(e,"occOrderContainer"),!1===occ.isNothingOrEmpty(i)&&e.setAttribute("data-api",i),!1===occ.isNothingOrEmpty(o)&&e.setAttribute("data-entity",o),!1===occ.isNothingOrEmpty(l)&&e.setAttribute("data-attr",l);let a=e.querySelectorAll(t);for(let e=0;e<a.length;e++)if(!a[e].querySelector("div.arrows")){occ.addClass(a[e],"occOrderItem");let t=document.createElement("div");t.classList="arrows",t.innerHTML="vertical"===c?'<div class="icon s-arrow-up sz3 tr"></div><div class="icon s-arrow-down sz3 tr"></div>':'<div class="icon s-arrow-left sz3 tr"></div><div class="icon s-arrow-right sz3 tr"></div>',t.addEventListener("pointerup",occ.changeItemOrder),a[e].appendChild(t)}occ.setItemOrderClass(a[0].parentElement)},ocCommon.prototype.changeItemOrder=function(e){e.preventDefault(),e.stopPropagation();var t=null;if(occ.hasClass(e.srcElement,"s-arrow-left")||occ.hasClass(e.srcElement,"s-arrow-up")){if(occ.hasClass(e.currentTarget.parentElement,"firstItem"))return;t=-1}if(occ.hasClass(e.srcElement,"s-arrow-right")||occ.hasClass(e.srcElement,"s-arrow-down")){if(occ.hasClass(e.currentTarget.parentElement,"lastItem"))return;t=1}if(null!==t){var o=e.currentTarget.parentElement;occ.addClass(o,"moving"),setTimeout(function(e){occ.removeClass("div.moving","moving")},750);var l=o.parentElement,c=null;t<0&&(c=o.previousElementSibling)&&null!==c&&l.insertBefore(o,c),t>0&&((c=o.nextElementSibling).nextElementSibling?l.insertBefore(o,c.nextElementSibling):c&&null!==c&&l.a
3ppendChild(o)),occ.setItemOrderClass(o.parentElement)}occ.saveItemOrder(e)},ocCommon.prototype.setItemOrderClass=function(e){let t=e.querySelectorAll("div.occOrderItem");occ.removeClass("div.occOrderContainer div.firstItem","firstItem"),occ.removeClass("div.occOrderContainer div.lastItem","lastItem"),occ.addClass(t[0],"firstItem");let o=t[t.length-1];occ.addClass(o,"lastItem")},ocCommon.prototype.saveItemOrder=function(e){let t=occ.getNearest(e.currentTarget,"occOrderContainer","div"),o=t.getAttribute("data-attr");if(!t||occ.isNothingOrEmpty(o))return void occ.addClass(t,"dirty");let l=t.getAttribute("data-rid");l.indexOf("-")>0&&(l=l.split("-")[0]);let c={eItemId:l,entity:t.getAttribute("data-entity"),items:[]},i=t.getAttribute("data-api"),a=t.querySelectorAll("div.occOrderItem");for(let e=0;e<a.length;e++)c.items.push({eItemId:a[e].getAttribute(o),ItemId:0,ItemOrder:e+1});let n=new ocAjax({jsonResponse:!1,jsonRequest:!0,showWaiting:!0,onSuccess:function(e){},onFailure:function(e,t,o){console.log("saveItemOrder() Error: "+e+"("+t+")")}});!0===occ.isNothingOrEmpty(i)&&(i="/api/common/PostOccOrder"),n.post(i,c)},ocCommon.prototype.clickFilm=function(e){if(!e||!1===occ.isMobile&&!0===occ.hasClass(e.srcElement,"occPreview")||!0===occ.hasClass(e.currentTarget,"closeX")){let e=document.querySelector("dialog.occFileContainer");e.close(),occ.removeClass(e,"active"),occ.removeClass(document.body,"occPlayerActive"),occ.removeClass("occ-adobe-dc-view","active");let t=e.querySelector("div.occPreview");t&&(t.innerHTML="");let o=e.querySelector("div.occDocViewer");o&&(o.innerHTML="")}},ocCommon.prototype.checkOpenFile=function(e,t){!0!==e.internal&&(e.preventDefault(),e.stopPropagation());try{e&&e.currentTarget&&occ.hasClass(e.currentTarget,"ptLink")&&occ.dlgMsg.close()}catch(e){}let o=e.currentTarget;t=t||e.currentTarget.getAttribute("data-forceTab");let l=document.querySelector("dialog.occFileContainer");l||(l=occ.createElement("dialog",["occFileContainer"]),l.addEventListener("pointerup",occ.clickFilm),document.body.appendChild(l),l=document.querySelector("dialog.occFileContainer"));let c=l.querySelector("div.menu");c||(l.appendChild(occ.createElement("div",["menu"])),c=l.querySelector("div.menu")),l.close(),occ.removeClass(l,"active"),occ.removeClass(document.body,"occPlayerActive"),occ.removeClass("occ-adobe-dc-view","active");let i=l.querySelector("div.occPreviewTitle");i&&(i.innerHTML="");let a=l.querySelector("div.occPreview");a&&(a.innerHTML="");let n=l.querySelector("div.occDocViewer");if(n&&(n.innerHTML="",n.setAttribute("data-rid","")),l)if(occ.removeClasses(l,["hasAI","haspdf"]),!0===occ.hasClass(o,"closeX")||!0===occ.hasClass(o,"occFileContainer"))occ.removeClass(o.parentElement,"active");else if(!1===occ.isNullOrEmpty(o.getAttribute("data-url"))){let e=o.getAttribute("data-url"),r=o.getAttribute("data-rid"),s=o.getAttribute("data-dl"),d=o.getAttribute("data-pf"),u=o.getAttribute("data-st"),p="",m=null,h=o.getAttribute("data-type");switch("pdf"===h&&(occ.addClass(l,"haspdf"),"true"===o.getAttribute("data-ai")&&occ.addClass(l,"hasAI")),h){case"pdf":case"mp4":case"mov":case"link":p="",!0===occ.checkVideoCode(e)&&(p="video",m=occ.embedVideoCode(e));break;case"png":case"jpg":case"jpeg":case"svg":case"webp":p='<img src="'+e+'">'}c.querySelector("button.closeX")||c.appendChild(occ.ocButton("occClosePDFButton","",occ.clickFilm,"x sz4 rv",null,["closeX"]));let g=c.querySelector("button.fullView");g||c.appendChild(occ.ocButton("occFVButton","",occ.showFullDoc,"accessibility-doc sz4 rv",null,["fullView",!0===occ.hasClass(o,"mr")?"mr":""])),!1===occ.isNothingOrEmpty(r)?occ.showObj(g):occ.hideObj(g);let f=c.querySelector("button.fullDL"),y=function(e){let t=e.currentTarget.getAttribute("data-dl");!1===occ.isNothingOrEmpty(t)&&t.length>5&&(window.location.href=t)};f||(c.appendChild(occ.ocButton("occDLButton","",y,"download sz4 rv",null,["fullDL"])),f=c.querySelector("button.fullDL")),f.setAttribute("data-dl",s),!1===occ.isNothingOrEmpty(s)&&s.length>5?occ.showObj(f):occ.hideObj(f);let C=function(e){if(!1===occ.isNothingOrEmpty(d)&&d.length>5){let e=JSON.parse(d),t="";Array.isArray(e)&&e.length>0&&e.forEach(function(e){t+='<li><a href="javascript:void(0);" class="ptLink" onpointerup="occ.checkOpenFile(event);" data-url="'+e.fileUrl+'" data-rid="'+e.fileId+'" data-type="'+h+'" data-st="'+u+'"'+("Y"===e.hasAI?' data-ai="true"':"")+' data-title="'+e.fileTitle+'" >'+e.fileTitle+" ("+occ.formatDate(e.fileDate,"m/d/yy")+")</a></li>"}),""!==t&&occ.msgDlg("This Document has a newer version","<ul>"+t+"</ul>",e.length>3?"small":"mini")}},v=c.querySelector("button.fullParent");v||(c.appendChild(occ.ocButton("occNVButton","",C,"alert sz4 rv",null,["fullParent"])),v=c.querySelector("button.fullParent")),!1===occ.isNothingOrEmpty(d)&&d.length>5?occ.showObj(v):occ.hideObj(v),i||(i=document.createElement("div"),i.classList="occPreviewTitle",l.appendChild(i)),a||(a=document.createElement("div"),a.classList="occPreview",a.addEventListener("touchstart",function(e){e.preventDefault(),e.stopPropagation()}),a.addEventListener("touchmove",function(e){e.preventDefault(),e.stopPropagation()}),a.addEventListener("scroll",function(e){e.preventDefault(),e.stopPropagation()}),l.appendChild(a)),a.innerHTML="",i.innerHTML="";let b=o.getAttribute("data-title");if(occ.isNullOrEmpty(b)&&(b=o.innerText),o.querySelector("div.name")&&(b=o.querySelector("div.name").innerText),!1!==occ.isNullOrEmpty(p)||"Y"===t&&"link"===h){if(!1===occ.isNullOrEmpty(e)){occ.showObj(n),occ.hideObj(a),occ.hideObj(i);let l="true"===o.getAttribute("data-pt"),c="true"===s,r="Y"===o.getAttribute("data-fp")&&"TF"===u,d="false"!==o.getAttribute("data-ai")||"Y"===o.getAttribute("data-fp")?o.getAttribute("data-rid"):"";occ.openFile(e,h,b,o.getAttribute("data-page"),t,l,c,d,u,r)}}else occ.hideObj(n),occ.showObj(a),occ.showObj(i),occ.addClass(l,"active"),l.showModal(),occ.addClass(document.body,"occPlayerActive"),null!==m?(a.appendChild(m),setTimeout(occ.pVHeight,100),setTimeout(occ.pVHeight,500)):a.innerHTML=p,i.innerHTML=occ.isNothingOrEmpty(b)?"":b}};let docTextDlg=null,docSectionTextDlg=null;function ocCommonResize(e){for(var t=Math.max(document.documentElement["scrollTop"],document.body["scrollTop"])+"px",o=document.documentElement["clientHeight"]+"px",l=document.documentElement["scrollTop"]+document.documentElement["clientHeight"]+"px",c=document.querySelectorAll("div.resize-overlay"),i=0;i<c.length;i++)c[i].style.top=t,c[i].style.bottom=l,c[i].style.height=o;
30==occ.hasClass(document.body,"naturalHeight")&&(document.body.style.height=window.innerHeight+"px"),c=document.querySelectorAll("div.ocCarousel.carousel > div.cItem.active");for(i=0;i<c.length;i++)occ.itemCarouselAdjust(c[i]);c=document.querySelectorAll("div.ocFamilyHead");for(i=0;i<c.length;i++)occ.reviewFamily(c[i]);ocDialogResize(),occ.setVideosSize(),occ.resizeTabs(),occ.ocTabCheckAllTabs()}function occInitPauseCommon(e){occ.switchPageLoad(),occ.initTabs(),occ.initFields(),occ.initPinchObj(),occ.loadOcButtons(),occ.initVideos(),occ.initTagControl(),occ.updateOcCart(null),occ.initObserver(),occ.initReadMe()}ocCommon.prototype.showFullDoc=function(e,t){let o=occ.hasClass(e.currentTarget,"doReset"),l=occ.hasClass(e.currentTarget,"mr"),c=e.currentTarget,i=c.parentElement.querySelector("div.occDocViewer");occ.hasClass(c.parentElement,"menu")&&(c=e.currentTarget.parentElement,i=c.parentElement.querySelector("div.occDocViewer"));let a="",n="";if(!0===t&&(a=c.getAttribute("data-rid"),n=c.getAttribute("data-st"),i=document.body.querySelector("div.occSectionDocViewer"),i||(document.body.appendChild(occ.createDiv("",["occSectionDocViewer"])),i=document.body.querySelector("div.occSectionDocViewer"))),i||!0===o){let e=document.getElementById("doc"+(!0===t?"Section":"")+"TextDlgDiv");if(e||(e=occ.createDiv("",null,[{name:"id",value:"doc"+(!0===t?"Section":"")+"TextDlgDiv"}]),c.parentElement.appendChild(e)),!0===o?(a=e.getAttribute("data-rid"),n=e.getAttribute("data-st")):!0!==t&&(a=i.getAttribute("data-rid"),n=i.getAttribute("data-st")),!1===occ.isNullOrEmpty(a)){i&&i.setAttribute("data-rid",""),e.innerHTML="",!0===o&&(e.innerHTML="<h2>Resetting Document...</h2><p> this may take a few moments.</p>",occ.hideObj(document.getElementById("docTextDlgCtrl-reset")),occ.hideObj(document.getElementById("docSectionTextDlgCtrl-reset"))),e.setAttribute("data-rid",a),e.setAttribute("data-st",n);let c=new ocAjax({jsonResponse:!1,showWaiting:!1,onSuccess:function(e){occ.showFullDocCB(e,t,l)},onFailure:function(e,t,o){console.log("showFullDoc Error: "+e+"("+t+")")}}),r=document.querySelector("dialog.occFileContainer");occ.showWaiting(0,!0===t?null:r,"Loading Text..."),c.get("/api/public/grt?ak="+occ.eid()+"&rid="+(o?":R:":"")+encodeURIComponent(a)+(!1===occ.isNothingOrEmpty(n)?"&st="+n:""))}else""!==e.getAttribute("data-rid")&&occ.showFullDocCB("show",t,l)}},ocCommon.prototype.showFullDocCB=function(e,t,o){let l=document.getElementById("doc"+(!0===t?"Section":"")+"TextDlgDiv");!0===t&&null===docSectionTextDlg&&(docSectionTextDlg=new ocDialog({id:"docSectionTextDlgCtrl",content:l,title:"Doc Viewer",class:"dlgsize-large rawTextView",buttons:[{id:"docSectionTextDlgCtrl-reset",content:"Reset",classes:["hiddenObj","doReset"],onClick:occ.showFullDoc},{id:"docSectionTextDlgCtrl-close",content:"Close",classes:["closeOK"],onClick:function(e){closeDialogByEvent(e)},align:"L"}],allowMaximize:!0})),!0!==t&&null===docTextDlg&&(docTextDlg=new ocDialog({id:"docTextDlgCtrl",content:l,title:"Doc Viewer",class:"dlgsize-large rawTextView",buttons:[{id:"docTextDlgCtrl-reset",content:"Reset",classes:["hiddenObj","doReset"],onClick:occ.showFullDoc},{id:"docTextDlgCtrl-close",content:"Close",classes:["closeOK"],onClick:function(e){closeDialogByEvent(e)},align:"L"}],allowMaximize:!0})),!0===t?!0===o?occ.showObj(document.getElementById("docSectionTextDlgCtrl-reset")):occ.hideObj(document.getElementById("docSectionTextDlgCtrl-reset")):!0===o?occ.showObj(document.getElementById("docTextDlgCtrl-reset")):occ.hideObj(document.getElementById("docTextDlgCtrl-reset")),"show"!==e&&(!0!==(e=JSON.parse(e.replace(/\\(?!["\\/bfnrtu0-9])/g,"\\\\"))).canReset&&(occ.hideObj(document.getElementById("docTextDlgCtrl-reset")),occ.hideObj(document.getElementById("docSectionTextDlgCtrl-reset"))),l.innerHTML=e.content);let c=document.querySelector("dialog.occFileContainer");occ.hideWaiting(!0===t?null:c),!0===t?(docSectionTextDlg.setTitle(e.title+" (Accessible HTML Version)"),docSectionTextDlg.open()):(docTextDlg.setTitle(e.title+" (Accessible HTML Version)"),docTextDlg.open())},ocCommon.prototype.pVHeight=function(e){let t=document.querySelector("div.occPreview");if(t){let e=t.children.length>0?t.children[0]:null;e&&null!==e&&"IFRAME"!==e.tagName&&!0===occ.hasClass(e,"ocVideo")&&(e.style.width="calc(100% - 40px)",e.style.height="calc(100% - 40px)",e.style.padding="0",e.style.margin="20px",occ.setVideoSize(e.querySelector("iframe")))}},ocCommon.prototype.openFile=function(e,t,o,l,c,i,a,n,r,s){let d=document.querySelector("dialog.occFileContainer"),u=d.querySelector("div.occPreviewTitle");u.innerHTML=occ.isNothingOrEmpty(o)?"":o;let p=d.querySelector("div.occPreview"),m=document.getElementById("occLinkViewBtn");if("link"===t&&"Y"!==c){if(1==occ.checkResponseHeader(e,"blocked"))return void window.open(e,"_blank");if(!m){let e=function(e){window.open(e.currentTarget.getAttribute("tu"),"_newWin")};m=occ.ocButton("occLinkViewBtn","Open In New Window",e),d.appendChild(m)}occ.showObj(m),m.setAttribute("tu",e),p.innerHTML='<iframe src="'+e+'"></iframe>',occ.showObj(p),occ.showObj(u)}else{if("pdf"!==t||0!=occ.isNullOrEmpty(AdobePDFEmbed))return void window.open(e,"{newWin}");{occ.hideObj(m),occ.hideObj(p),occ.hideObj(u);let t=d.querySelector("div.occDocViewer");t||(t=document.createElement("div"),t.classList="occDocViewer",t.setAttribute("id","occ-ad
3obe-dc-view"),d.appendChild(t)),occ.addClass(t,"active"),occ.removeClass(d,"active");const c=new AdobeDC.View({clientId:AdobePDFEmbed,divId:"occ-adobe-dc-view"});n&&!1===occ.isNullOrEmpty(n)?t.setAttribute("data-rid",n):t.setAttribute("data-rid",""),r&&!1===occ.isNullOrEmpty(r)?t.setAttribute("data-st",r):t.setAttribute("data-st","");var h=c.previewFile({content:{location:{url:e,page:l}},metaData:{fileName:o}},{embedMode:"FULL_WINDOW",showAnnotationTools:!1,defaultViewMode:"FIT_WIDTH",enableFormFilling:!0===s,showDownloadPDF:a,showPrintPDF:i});if(!0===s&&c.registerCallback(AdobeDC.View.Enum.CallbackType.SAVE_API,function(e,t,o){let l=e.fileName+(e.fileName.toLowerCase().endsWith(".pdf")?"":".pdf");let c=[new File([t],l,{type:"application/pdf"})];occ.callFileAPI(c,null,"P"+r,n,function(e){occ.closeFile(null),occ.hideWaiting(),occ.msgDlg("Save Status","<h3>"+(Array.isArray(e)&&e.length>0?"Response saved successfully.":"Response save failed.")+"</h3>","mini")},"occ-adobe-dc-view-file-edit",tId)},{autoSaveFrequency:0,enableFocusPolling:!1,showSaveButton:!0}),c.registerCallback(AdobeDC.View.Enum.CallbackType.EVENT_LISTENER,function(e){"PDF_VIEWER_CLOSE"===e.type&&occ.closeFile(null)},{listenOn:[AdobeDC.View.Enum.Events.PDF_VIEWER_CLOSE]}),1*l>=0){h.then(e=>{e.getAPIs().then(e=>{e.gotoLocation(1*l,0,0).then(()=>console.log("Success")).catch(e=>console.log(e))})});let t=d.querySelector('div.resourceItem[data-url="'+e+'"]');if(t){let e=t;for(let t=0;t<1;t++)e=e.parentElement,occ.hasClass(e,"resourceCategory")&&(t=-1,occ.addClass(e,"active"),console.log("go next"));occ.addClass(t,"active"),console.log("stop")}}}}window.location.href="#occdrw",window.addEventListener("hashchange",occ.urlChange),occ.addClass(d,"active"),d.showModal(),occ.addClass(document.body,"occPlayerActive")},ocCommon.prototype.closeFile=function(e){window.removeEventListener("hashchange",occ.urlChange),occ.clickFilm()},ocCommon.prototype.urlChange=function(e){-1===window.location.href.indexOf("#occdrw")&&occ.closeFile()},ocCommon.prototype.sendNote=function(e,t,o,l,c,i,a){if(!e||occ.isNothingOrEmpty(e)||Array.isArray(e)&&0===e.length)return void occ.msgDlg("No Recipients","<h3>No recipients  have been specified.</h3>",5e3);if(null===occ.mNotifyDlg){let e=occ.createDiv('<div class="bodyCopy"></div>',["ocDialog-Obj"],[{name:"id",value:"occSNote-dlg"}]);e.appendChild(occ.createDiv("")),e.appendChild(occ.createDiv("",["ocInputControl-obj"],[{name:"id",value:"occSendNote-s"},{name:"data-label",value:"Email Subject"},{name:"data-type",value:"text"}])),e.appendChild(occ.createDiv("",["ocInputControl-obj"],[{name:"id",value:"occSendNote-m"},{name:"data-label",value:"Email Body"},{name:"data-type",value:"richtext"}])),e.appendChild(occ.createDiv("",["ocInputControl-obj"],[{name:"id",value:"occSendNote-sm"},{name:"data-label",value:"SMS Content (limited to 270 characters)"},{name:"data-type",value:"gsmMS"},{name:"data-maxlength",value:"270"}])),document.body.appendChild(e),occ.initInputControls(e),occ.mNotifyDlg=new ocDialog({id:"occSNote-dlg-obj",content:document.getElementById("occSNote-dlg"),title:"",class:"dlgsize-large",allowMaximize:!0,onClosed:function(){occ.mNotifyDlg.sId=null,occ.mNotifyDlg.st=null},buttons:[{id:"occSNote-cancel",content:"Cancel",onClick:closeDialogByEvent,align:"L"},{id:"occSNote-apply",content:"Send",onClick:occ.sendNoteCB}]})}occ.mNotifyDlg.setTitle(occ.isNothingOrEmpty(i)?"Send Notification":i);let n=occ.mNotifyDlg.dialog.querySelector("div.bodyCopy");if(n.innerHTML=null==a?"<p>Send a notification message.</p>":a,n.innerHTML+='<h3>Recipients: <span style="font-weight:normal;font-size:12px;">(uncheck to exclude)</span></h3>',"string"==typeof e&&0===e.indexOf("[")&&(e=JSON.parse(e)),Array.isArray(e)){let t=0;e.forEach(function(e){let o=(""!==e.e?e.e:"")+(""!==e.p?(""!==e.e?", ":"")+'<span class="ocPhoneFormat">'+e.p+"</span>":""),l=occ.createDiv("",["ocInputControl-obj","col-2","occ-UCBX"],[{name:"id",value:"occ-UCBX-"+t},{name:"data-label",value:e.n+(""!==o?" ("+o+")":"")},{name:"data-type",value:"checkbox"},{name:"data-value",value:"Y"},{name:"data-rid",value:e.t}]);n.appendChild(l),t++})}occ.formatPhoneElements(n),occ.checkOCFormContainer("occSNote-dlg-obj",!0),!0===l?(occ.showField("occSendNote-s"),occ.showField("occSendNote-m")):(occ.hideField("occSendNote-s"),occ.hideField("occSendNote-m")),!0===c?occ.showField("occSendNote-sm"):occ.hideField("occSendNote-sm"),occ.mNotifyDlg.sId=o,occ.mNotifyDlg.st=t,occ.mNotifyDlg.open()},ocCommon.prototype.sendNoteCB=function(){try{let e=occ.checkOCFormContainer("occSNote-dlg-obj");if(!0===e.clean||!0===e.invalid)return;let t=occ.isFieldVisible("occSendNote-s")?document.getElementById("occSendNote-s").value:null,o=occ.isFieldVisible("occSendNote-m")?document.getElementById("occSendNote-m").value:null,l=occ.isFieldVisible("occSendNote-sm")?document.getElementById("occSendNote-sm").value:null;if(null==l&&(""===t||""===o)||null==t&&""===l||""===t&&""===o&&""===l)return void occ.msgDlg("Check Fields","<h3>Please provide message content to send.</h3>","mini");
3if(""!=t&&""!=o||(t="",o=""),!0===occ.isNothingOrEmpty(t)&&!0===occ.isNothingOrEmpty(o)&&!0===occ.isNothingOrEmpty(l))return;occ.showWaiting(0,occ.mNotifyDlg.dialog,"Sending Notification...");let c="",i=occ.mNotifyDlg.dialog.querySelectorAll('div.occ-UCBX input[type="checkbox"]');for(let e=0;e<i.length;e++)!0===i[e].checked&&(c+=(""===c?"":",")+i[e].parentElement.getAttribute("data-rid"));occ.sendObj(c,t,o,l)}catch(e){console.log("occ.sendNoteCB error: "+e)}},ocCommon.prototype.sendObj=function(e,t,o,l){let c=new ocAjax({jsonRequest:!0,jsonResponse:!1,showWaiting:!1,onSuccess:function(){occ.hideWaiting(occ.mNotifyDlg.dialog),occ.mNotifyDlg.close(),occ.msgDlg("Success","<h3>Notification has been sent.</h3>")},onFailure:function(e,t,o){occ.hideWaiting(occ.mNotifyDlg.dialog),occ.mNotifyDlg.close(),occ.msgDlg("Error","<h3>Notification has not been sent.</h3>")}}),i={eTo:e,eSubject:t,eMsg:o,sMsg:l,sId:occ.mNotifyDlg.sId,st:occ.mNotifyDlg.st};c.post("/api/notification/sen/",i)},ocCommon.prototype.checkShowMore=function(e){let t=(e=occ.getElementFromString(e)).querySelectorAll(".showMore");if(t.length>0){for(let e=0;e<t.length;e++)occ.addShowMore(t[e]);if(!0===occ.hasClass(e,"showMoreParent")){let o=document.getElementById(e.id+"-exCtrl");o?occ.removeClass(o,"moreShown"):(o=occ.ocButton(e.id+"-exCtrl","All",occ.clickAllShowMore,"fakeIcon sz3 tr"),occ.addClass(o,"exCtrl"),e.parentElement.insertBefore(o,e.parentElement.querySelector("b.rltdDocs"))),t=e.querySelectorAll(".showMoreDiv"),t.length>0?occ.showObj(o):occ.hideObj(o)}}else occ.hideObj(e.id+"-exCtrl")},ocCommon.prototype.addShowMore=function(e){e=occ.getElementFromString(e),occ.removeClass(e,"showMoreReady");let t=e.clientHeight;if(occ.addClass(e,"showMoreCheck"),t<e.clientHeight){occ.removeClass(e.parentElement,"noMore");let t=document.createElement("div");t.innerHTML=e.innerHTML,t.classList="smContent",e.innerHTML="",e.appendChild(t);let o=document.createElement("div");o.classList="showMoreDiv",o.innerHTML='<a href="javascript:;"></a>',o.addEventListener("pointerup",occ.clickShowMore),e.appendChild(o)}else occ.addClass(e.parentElement,"noMore");occ.removeClass(e,"showMoreCheck"),occ.addClass(e,"showMoreReady")},ocCommon.prototype.clickAllShowMore=function(e){let t=e.currentTarget.parentElement.querySelector(".showMoreParent"),o=t.querySelectorAll(".showMore");if(o.length>0){let l=occ.hasClass(t,"moreShown");for(let e=0;e<o.length;e++)occ.toggleClass(o[e],"moreShown",l?0:1);occ.toggleClass(t,"moreShown"),occ.toggleClass(e.currentTarget,"moreShown")}},ocCommon.prototype.clickShowMore=function(e){try{e.preventDefault(),e.stopPropagation()}catch(e){}occ.toggleClass(e.currentTarget.parentElement,"moreShown"),!1===occ.hasClass(e.currentTarget.parentElement,"moreShown")&&e.currentTarget.parentElement.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})};var activeDlgs=[];function ocDialog(e){if(this.version="06.09.0023",this.overlay=document.querySelector(".ocDialog-overlay"),null===this.overlay&&(this.overlay=occ.createDiv("",["ocDialog-overlay"],null,"scroll",function(e){e.preventDefault(),e.stopPropagation()}),document.querySelector("body").appendChild(this.overlay)),"string"==typeof e.content&&(e.content=document.getElementById(e.content)),e.content&&null!==e.content||e.tabs&&e.tabs.length>0){e.tabs&&e.tabs.length>0?e.content=e.tabs[0].obj:e.tabs=[];var t=null,o=e.id?e.id:"dlg-"+Date.now();if(occ.addClass(e.content,"ocDialog-Obj"),!1===occ.hasClass(e.content.parentElement,"ocDialog-content")){!1===occ.supportDialogElem||!0===e.inline?(t=occ.createDiv("",["ocDialog-dialog",!0===e.inline?"ocDialog-dialog-inline":""],[{name:"id",value:o}])).style.display="none":((t=occ.createElement("dialog",["ocDialog-dialog"],[{name:"id",value:o}])).addEventListener("close",function(e){closeDialogByEvent(e)}),t.addEventListener("cancel",function(e){closeDialogByEvent(e)})),occ.hasClass(document.body,"useLocalStyles")&&occ.addClass(t,"localOccStyles"),this.overlay.appendChild(t),occ.isNothingOrEmpty(e.mode)&&(e.mode="default");var l=occ.createDiv("",["ocDialog-container","mode-"+e.mode]);t.appendChild(l);var c=occ.createElement("h2",["ocDialog-titlebar"]);if("viewer"===e.mode&&"function"==typeof this.navCB){let e=occ.createDiv("",["ocDialog-topNav"]);e.appendChild(occ.createDiv("",["icon","s-arrow-left","sz3","tr"],null,"pointerup",this.topNavClick.bind(this))),e.appendChild(occ.createDiv("",["icon","s-arrow-right","sz3","tr"],null,"pointerup",this.topNavClick.bind(this))),e.appendChild(occ.createElement("span")),c.appendChild(e)}c.appendChild(occ.createDiv("",["ocDialog-titlebar-title"])),"viewer"===e.mode&&c.appendChild(occ.createDiv("",["icon","s-x","sz4","tr"],null,"pointerup",this.close.bind(this))),l.appendChild(c);var i=null;if(e.tabs.length>0){var a=occ.createDiv("",["ocDialog-tabs"]),n=occ.createDiv("",["ocDialog-tabs-btns"]),r=occ.createDiv("",["ocDialog-tabs-titles"]),s=occ.createAnchor('<div class="icon s-arrow-left sz3"></div>',["ocDialog-back"]);occ.addClickEvent(s,this.returnToTabPanel.bind(this)),a.appendChild(s),i=occ.createDiv("",["ocDialog-tabContent"]),"viewer"===e.mode&&i.appendChild(r),occ.addClass(a,"t"+e.tabs.length);for(var d=0;d<e.tabs.length;d++)if(e.tabs[d].obj&&null!==e.tabs[d].obj){var u=occ.createDiv(""+e.tabs[d].title,["ocDialog-tab"]);if(!1===occ.isNothingOrEmpty(e.tabs[d].tbIcon)&&u.insertAdjacentHTML("afterbegin",'<div class="icon s-'+e.tabs[d].tbIcon+' sz3 tr"></div>'),occ.addClasses(e.tabs[d],e.tabs[d].classes),0===d&&occ.addClass(u,"first"),d+1===e.tabs.length&&occ.addClass(u,"last"),u.setAttribute("id",e.tabs[d].obj.id+"-tb"),!0===e.tabs[d].disabled&&occ.addClass(u,"disabled"),e.tabs[d].onClick&&"function"==typeof e.tabs[d].onClick){var p=function(e,t){!1!==this.allowTabClick&&(!1===occ.hasClass(e.id,"disabled")?e.onClick(t):e.disabledText&&""!==e.disabledText&&occ.showTooltip(e.id,e.disabledText,t)),this.allowTabClick=!0,this.changeTab(e.obj.id+"-tb")};occ.addClickEvent(u,p.bind(this,e.tabs[d]),"pointerup")}else occ.addClickEvent(u,this.changeTab.bind(this));if("ios"===occ.clientOs&&(u.addEventListener("touchstart",function(e){e.preventDefault(),e.stopPropagation()}),u.addEventListener("touchmove",function(e){e.preventDefault(),e.stopPropagation()})),!1===occ.isNothingOrEmpty(e.tabs[d].fnIcon)&&"function"==typeof e.tabs[d].fn){let t=
3occ.ocButton(e.tabs[d].obj.id+"-tb-fncall","",e.tabs[d].fn,e.tabs[d].fnIcon);occ.addClass(t,"tabAction"),u.appendChild(t)}if(a.appendChild(u),occ.addClass(e.tabs[d].obj,"ocDialog-Obj"),Array.isArray(e.tabs[d].buttons)&&e.tabs[d].buttons.length>0){occ.addClass(e.tabs[d].obj,"hasBtns");var m=occ.createDiv("",["ocDialog-tab-btns"],[{name:"id",value:e.tabs[d].obj.id+"-tb-btns"}]);e.tabs[d].buttons.forEach(function(e,t){e.id&&!0!==occ.isNullOrEmpty(e.id)||(e.id=this.id+"-btn-"+d+"-"+t),e.classes&&null!==e.classes||(e.classes=[]),e.classes.push("ocDialog-tab-btn"),(!e.align||null===e.align||"string"==typeof e.align&&"L"!==e.align)&&e.classes.push("opoClient-btn-right");let o=occ.ocButton(e.id,e.content,e.onClick,e.class,null,e.classes);e.disabledText&&""!==e.disabledText&&o.setAttribute("disabledText",e.disabledText),"object"==typeof e.attr&&occ.addAttributes(o,e.attr),"boolean"==typeof e.hidden&&!0===e.hidden&&occ.hideObj(o),"boolean"==typeof e.disabled&&!0===e.disabled&&occ.addClass(o,"disabled"),m.appendChild(o)}),n.appendChild(m)}if("viewer"===e.mode&&!1===occ.isNothingOrEmpty(e.tabs[d].contentTitle)){let t=occ.createDiv("",["ocDialog-tab-title"],[{name:"id",value:e.tabs[d].obj.id+"-tb-title"}]);t.innerHTML=e.tabs[d].contentTitle,r.appendChild(t),occ.addClass(e.tabs[d].obj,"hasTitle")}i.appendChild(e.tabs[d].obj)}"viewer"===e.mode&&i.appendChild(n),l.appendChild(a),occ.addClass(t,"hastabs")}else i=occ.createDiv("",["ocDialog-content"]),!0===occ.hasClass(e.content,"hasTabs")&&occ.addClass(i,"hasFormTabs"),i.appendChild(e.content),occ.removeClass(t,"hastabs");for(l.appendChild(i),l.appendChild(occ.createDiv("",["ocDialog-btns"])),d=0;d<e.tabs.length;d++)"object"==typeof e.tabs[d].wizard&&(e.tabs[d].wizard.parentId=e.tabs[d].obj.id,this.createWizard(e.tabs[d].wizard))}else if(o=e.content.parentElement.parentElement.parentElement.id,!(t=document.getElementById(o)))return console.log("no dialog element found"),null;if(this.id=o,this.dialog=t,this.titlebar=this.dialog.querySelector(".ocDialog-titlebar"),!1===occ.isNothingOrEmpty(e.searchSelector)){let t=occ.createDiv("",["dlgSearchDiv"]);t.setAttribute("data-parent",this.id),t.setAttribute("data-ss",e.searchSelector),occ.isNothingOrEmpty(e.searchPlaceholder)&&(e.searchPlaceholder="search this dialog"),t.setAttribute("data-placeholder",e.searchPlaceholder),occ.createElementSearch(t),this.titlebar.appendChild(t),occ.addClass(this.dialog,"hasSearch")}if(!0===e.allowMaximize){occ.addClass(this.dialog,"allowMaximize");var h=occ.createAnchor('<div class="icon s-expand sz4 wh-t"></div>',["maximizeIcon"],null);occ.addClickEvent(h,this.maximizeDialog.bind(this)),this.titlebar.appendChild(h);var g=occ.createAnchor('<div class="icon s-contract sz4 wh-t"></div>',["restoreIcon"],null);occ.addClickEvent(g,this.restoreDialog.bind(this)),this.titlebar.appendChild(g),occ.addClass(this.dialog,"hasMax")}if(this.buttonbar=this.dialog.querySelector(".ocDialog-container > div.ocDialog-btns"),this.content=e.content,this.tabs=e.tabs,this.height=0,this.width=0,this.buttons=new Array,this.onOpen=null,this.onOpened=null,this.onClose=null,this.onClosed=null,this.doSave=null,this.helpId=e.helpId,this.confirmCallBackObj=null,this.navCB=null,this.mode=e.mode,null!==e&&("number"==typeof e.height&&(this.height=e.height),"number"==typeof e.width&&(this.width=e.width),e.buttons&&null!==e.buttons||(e.buttons=[{id:o+"-close",content:"Close",onClick:function(e){closeDialogByEvent(e)},align:"L"}]),Array.isArray(e.buttons)&&this.setButtons(e.buttons),"object"==typeof e.wizard&&(e.wizard.parentId=this.content.id,this.createWizard(e.wizard)),"string"==typeof e.class&&(e.class.indexOf(" ")>0?occ.addClasses(this.dialog,e.class.split(" ")):occ.addClass(this.dialog,e.class)),e.class&&""!==e.class&&-1!==e.class.indexOf("dlgsize-")||occ.addClass(this.dialog,"dlgsize-small"),"function"==typeof e.onOpen&&(this.onOpen=e.onOpen),"function"==typeof e.onOpened&&(this.onOpened=e.onOpened),"function"==typeof e.onClose&&(this.onClose=e.onClose),"function"==typeof e.onClosed&&(this.onClosed=e.onClosed),"function"==typeof e.doSave&&(this.doSave=e.doSave),"function"==typeof e.navCB&&(this.navCB=e.navCB),this.setTitle(e.title),this.setTopNav(e.n
3avItems)),this.dialog.addEventListener("keydown",this.handleTabKey.bind(this)),activeDlgs.push(this),!1===occ.isNothingOrEmpty(this.helpId)){let e=this;new ocAjax({jsonRequest:!1,jsonResponse:!0,onSuccess:function(t){let o=t.posts[0],l=!1;var c=occ.createDiv("",["ocDialog-HelpCover"]);occ.addClickEvent(c,e.showDialogHelp.bind(e)),e.dialog.appendChild(c);var i=occ.createDiv("");i.appendChild(occ.createElement("h4",null,null,o.postTitle)),o.postDescription&&""!==o.postDescription&&i.appendChild(occ.createElement("div",null,null,o.postDescriptionHtml));let a=null;o.postUrl&&""!==o.postUrl&&(a=function(){openLink(o.postUrl,o.postTitle)});let n=occ.createDiv("",["postImage"]);if(Array.isArray(o.postImages)&&occ.loadImageCarousel(n,o.postImages,"300px"),o.postImages&&0!=o.postImages.length||occ.addClass(n,"empty"),i.appendChild(n),o.postVideo&&""!==o.postVideo&&0===o.postVideo.indexOf("http")){let e=occ.createDiv("",["postVideo"]);e.appendChild(occ.embedVideoCode(o.postVideo)),i.appendChild(e),l=!0}let r=occ.createDiv("",["postButtons"]);if(o.fileUrl&&!1===occ.isNullOrEmpty(o.fileUrl))if("jpg"===o.fileType||"png"==o.fileType||"svg"==o.fileType||"bmp"==o.fileType||"webp"==o.fileType)i.appendChild(occ.createElement("img",["postResourceImage"],[{name:"src",value:o.fileUrl+"&s=large"}]));else{let e=0===o.fileUrl.indexOf("http")?"link":"pdf";!0===occ.checkVideoCode(o.fileUrl)&&(e="play",o.fileUrl.indexOf("media.azure.net")>0&&(l=!0));let t=function(){openLink(o.fileUrl,o.fileTitle,null,o.fileToken,o.fileProtection)};r.appendChild(occ.ocButton("pfurl"+o.ePostId,o.fileTitle,t,e))}null!==a&&r.appendChild(occ.ocButton("purl"+o.ePostId,o.postUrlText,a)),i.appendChild(r);var s=occ.createDiv("",["ocDialog-Help"]);s.appendChild(i),e.dialog.appendChild(s),!0===l&&occ.loadResources("ams",null,null);var d=occ.createAnchor('<div class="icon s-info sz3 wh-t"></div>',["infoIcon"],null);occ.addClickEvent(d,e.showDialogHelp.bind(e)),e.titlebar.appendChild(d),occ.addClass(e.dialog,"hasHelp"),e=null}}).get("/api/post/GetPosts/H?id="+encodeURIComponent(e.helpId))}}}ocDialog.prototype.createWizard=function(e){new ocWizard(e).start(!1)},ocDialog.prototype.setButtons=function(e){this.buttons=e;var t=this.dialog.querySelector(".ocDialog-container > div.ocDialog-btns");t.innerHTML="";var o=this.dialog.querySelector(".ocDialog-titlebar > div.ocDialog-btns");if(o&&(o.innerHTML=""),occ.addClass(this.titlebar,"nobtns"),occ.addClass(this.dialog,"nobtns"),Array.isArray(e)){let e=0;for(var l=0;l<this.buttons.length;l++){var c=this.buttons[l];c.id&&!0!==occ.isNullOrEmpty(c.id)||(c.id=this.id+"-btn-"+l),null!==c.classes&&c.classes||(c.classes=[]),(!c.align||null===c.align||"string"==typeof c.align&&"L"!==c.align)&&(c.classes.push("opoClient-btn-right"),e++);let i=occ.ocButton(c.id,c.content,c.onClick,c.class,null,c.classes);c.disabledText&&""!==c.disabledText&&i.setAttribute("disabledText",c.disabledText),"object"==typeof c.attr&&occ.addAttributes(i,c.attr),"boolean"==typeof c.hidden&&!0===c.hidden&&occ.hideObj(i),"boolean"==typeof c.disabled&&!0===c.disabled&&occ.addClass(i,"disabled"),"top"===c.align?(o||(this.titlebar.appendChild(occ.createDiv("",["ocDialog-btns"])),o=this.dialog.querySelector(".ocDialog-titlebar > div.ocDialog-btns")),occ.removeClass(this.titlebar,"nobtns"),o.appendChild(i)):(occ.removeClass(this.dialog,"nobtns"),t.style.display="block",t.appendChild(i))}}else t.style.display="none";this.setSize()},ocDialog.prototype.addButton=function(e){for(var t=!1,o=0;o<this.buttons.length;o++)this.buttons[o].id===e.id&&(t=!0,this.buttons[o].hidden=!1,occ.showObj(document.getElementById(e.id)));if(!t){var l=this.dialog.querySelector(".ocDialog-container > div.ocDialog-btns"),c=this.dialog.querySelector(".ocDialog-titlebar > div.ocDialog-btns");c&&(c.innerHTML=""),this.buttons.push(e);var i=occ.createButton(e.content,["opoClient-btn"]);"string"==typeof e.align&&"L"!==e.align&&occ.addClass(i,"opoClient-btn-right"),"string"==typeof e.class&&occ.addClass(i,e.class),"string"==typeof e.id&&(i.id=e.id),"object"==typeof e.attr&&occ.addAttributes(e,e.attr),"function"==typeof e.onClick&&occ.addClickEvent(i,e.onClick),"boolean"==typeof e.hidden&&!0===e.hidden&&occ.hideObj(i),"boolean"==typeof e.disabled&&!0===e.disabled&&occ.addClass(i,"disabled"),"i
3os"===occ.clientOs&&(i.addEventListener("touchstart",function(e){e.preventDefault(),e.stopPropagation()}),i.addEventListener("touchmove",function(e){e.preventDefault(),e.stopPropagation()})),e.content.indexOf("icon")>-1&&e.content.indexOf("s-")>-1&&occ.addClass(i,"withIcon"),"top"===e.align?(c||(this.titlebar.appendChild(occ.createDiv("",["ocDialog-btns"])),c=this.dialog.querySelector(".ocDialog-titlebar > div.ocDialog-btns")),occ.addClass(this.titlebar,"hasBtns"),c.appendChild(i)):l.appendChild(i)}this.setSize()},ocDialog.prototype.toggleButton=function(e,t){"close"===e&&(e=this.id+"-close");var o=document.getElementById(e);o&&(!0===t?occ.showObj(o):!1===t?occ.hideObj(o):occ.toggleClass(o,"hiddenObj",null),this.setSize())},ocDialog.prototype.enableButton=function(e,t){var o=document.getElementById(e);o&&(t?occ.removeClass(o,"disabled"):occ.addClass(o,"disabled"))},ocDialog.prototype.topNavClick=function(e){var t=this.titlebar.querySelector(".ocDialog-topNav > span");if(!t)return;let o=1*t.getAttribute("data-nav");e.currentTarget&&e.currentTarget.classList.contains("s-arrow-left")?o--:e.currentTarget&&e.currentTarget.classList.contains("s-arrow-right")&&o++,o<0?o=this.navItems.length-1:o>=this.navItems.length&&(o=0),this.navItems.forEach(function(e,t){e.active=o===t}),t.setAttribute("data-nav",o),t.innerHTML=o+1+"/"+navItems.length,this.navCB(this.navItems[o])},ocDialog.prototype.setTopNav=function(e){var t=this.titlebar.querySelector(".ocDialog-topNav > span");if(t){if(t.innerHTML="","viewer"===this.mode&&Array.isArray(e)&&e.length>1){this.navItems=e;let o=0;this.navItems.forEach(function(e,t){!0===e.active&&(o=t)}),this.titlebar.style.display="block",t.setAttribute("data-nav",o),t.innerHTML=o+1+"/"+this.navItems.length,occ.removeClass(this.dialog,"noTopNav")}else occ.addClass(this.dialog,"noTopNav");this.setSize()}},ocDialog.prototype.setLogo=function(e){var t=this.dialog.querySelector(".ocDialog-tabs");if(t){let o=t.querySelector(".ocDialog-tab-logo");!1===occ.isNothingOrEmpty(e)?(o||(o=occ.createDiv("",["ocDialog-tab-logo"]),t.appendChild(o)),o.style.backgroundImage='url("'+e+'")',occ.removeClass(t,"emptyLogo")):occ.addClass(t,"emptyLogo")}},ocDialog.prototype.setTitle=function(e){if(null!==e&&"string"==typeof e){this.titlebar.style.display="block";var t=this.titlebar.querySelector(".ocDialog-titlebar-title");if(!t)return;t.innerHTML=e,occ.removeClass(this.dialog,"notitle")}else this.titlebar.style.display="none",occ.addClass(this.dialog,"notitle");this.setSize()},ocDialog.prototype.disableTab=function(e){var t=document.getElementById(e+"-tb");occ.addClass(t,"disabled")},ocDialog.prototype.enableTab=function(e){var t=document.getElementById(e+"-tb");occ.removeClass(t,"disabled")},ocDialog.prototype.setTabTitle=function(e,t){var o=document.getElementById(e+"-tb");o&&(o.innerHTML=t)},ocDialog.prototype.toggleTab=function(e,t){var o=document.getElementById(e+"-tb");!0===t?occ.showObj(o):!1===t?occ.hideObj(o):occ.toggleClass(o,"hiddenObj",null),o=document.getElementById(e),!0===t?occ.showObj(o):!1===t?occ.hideObj(o):occ.toggleClass(o,"hiddenObj",null),this.checkTabs("toggle")},ocDialog.prototype.setDefaultTab=function(e){var t=document.getElementById(e);t&&(occ.removeClass(t.parentElement.parentElement.querySelector(".ocDialog-tab.active"),"active"),occ.removeClass(t.parentElement.parentElement.querySelector(".ocDialog-tab-title.active"),"active"),occ.removeClass(t.parentElement.parentElement.querySelector(".ocDialog-Obj.active"),"active"),occ.removeClass(t.parentElement.parentElement.querySelector(".ocDialog-tab-btns.active"),"active"),occ.addClass(t,"active"),occ.addClass(e+"-tb","active"),occ.addClass(e+"-tb-title","active"),occ.addClass(e+"-tb-btns","active"),occ.addClass(e+"-title","active"))},ocDialog.prototype.returnToTabPanel=function(e){var t=e.currentTarget.parentElement;occ.removeClass(t.parentElement,"panel-active"),occ.removeClass(t.children,"active")},ocDialog.prototype.clickTab=function(e){var t=document.getElementById(e+"-tb");if(t){var o=this.dialog.querySelector(".ocDialog-tabContent > div.ocDialog-Obj.active");occ.hasClass(o,"tabSts-dirty")&&null!==this.doSave?(this.confirmCallBackObj=t,this.doConfirm()):occ.triggerEvent(t,"pointerup")}},ocDialog.prototype.changeTab=function(e){var t=e.currentTarget?e.currentTarget:occ.getElementFromString(e);if(!0!==occ.hasClass(t,"disabled")){var o=t.parentElement;if("viewer"===this.mode&&document.body.clientWidth<701){if(!occ.hasClass(o,"open")){return occ.addClass(o,"open"),void o.querySelectorAll(".ocDialog-tab:not(.active)").forEach(function(e,t){e.style.top=15+52*(1+t)+"px"})}if(occ.removeClass(o,"open"),o.querySelectorAll(".ocDialog-tab").forEach(function(e,t){e.style.top=""}),occ.hasClass(t,"active"))return}document.activeElement&&document.activeElement.blur(),this.checkTabs("changeTab"),occ.resetElementSearch(o.parentElement.querySelector(".dlgSearchDiv.occElemSearch.active"));var l=this.dialog.querySelector(".ocDialog-tabContent > div.ocDialog-Obj.active");occ.hasClass(l,"tabSts-dirty")&&null!==this.doSave?(this.allowTabClick=!1,this.confirmCallBackObj=t,this.doConfirm()):(occ.hasClass(this.dialog,"panels")&&occ.addClass(o.parentElement,"panel-active"),occ.removeClass(o.children,"active"),occ.removeClass(o.nextSibling.children,"active"),occ.removeClass(o.parentElement.querySelectorAll(".ocDialog-tab-btns.active"),"active"),occ.removeClass(o.parentElement.querySelectorAll(".ocDialog-tab-title.active"),"active"),occ.addClass(t,"active"),occ.addClass(document.getElementById(t.id.replace("-tb","")),"active"),occ.resizeFormFields(document.getElementById(t.id.replace("-tb",""))),occ.addClass(document.getElementById(t.id+"-btns"),"active"),occ.addClass(document.getElementById(t.id+"-title"),"active"),occ.checkMyTables(t.id.replace("-tb","")),l&&(this.clearTabStatus("ALL",l),l.parentElement.scrollTop=0))}},ocDialog.prototype.showWaiting=function(e,t){occ.showWaiting(e,this.dialog,t)},ocDialog.prototype.updateWaiting=function(e){occ.updateWaiting(this.dialog,e)},ocDialog.prototype.hideWaiting=function(){occ.hideWaiting(this.dialog)},ocDialog.prototype.setSize=function(){var e=document;if(this.dialog.style.height="",this.dialog.style.width="",this.height&&null!==this.height){var t=window.innerHeight-40,o=this.height;0===o?o=this.titlebar.offsetHeight+this.content.offsetHeight+10+this.buttonbar.offsetHeight+11:o>0&&(o>t&&(o=t),this.dialog.style.height=o+"px",!1===occ.supportDialogElem&&(this.dialog.style.top=(e.documentElement["clientHeight"]-o)/2+"px"))}if(this.width&&null!==this.width){var l=window.innerWidth-40,c=this.width;c>0&&(c>
3l&&(c=l),!1===occ.supportDialogElem&&(this.dialog.style.left="calc(50% - "+c/2+"px)"),this.dialog.style.width=c+"px")}var i=70;if(window.innerWidth<600&&(i=40),this.titlebar.querySelector("div.ocDialog-btns")){var a=this.titlebar.clientWidth-(this.titlebar.querySelector("div.ocDialog-btns").clientWidth+i);a>0&&(this.titlebar.querySelector(".ocDialog-titlebar-title").style.width=a+"px")}occ.resizeFormFields(this.dialog)},ocDialog.prototype.checkTabs=function(e){var t=this.dialog.querySelector("div.ocDialog-tabs");if("viewer"!==this.mode){if(this.tabs.length>1&&(occ.removeClass(this.dialog,"panels"),t)){occ.addClass(t,"checking"),occ.removeClasses(t,["t2","t3","t4","t5","t6","t7","t8"]);let l=0,c=null,i=0;occ.removeClass(t,"small-tabs");let a=t.querySelectorAll(".ocDialog-tab");for(var o=0;o<a.length;o++)a[o].style.width="",l<a[o].clientWidth&&(l=a[o].clientWidth),null===c&&(c=!1===occ.hasClass(a[o],"hiddenObj")?a[o]:null),!1===occ.hasClass(a[o],"hiddenObj")&&i++;occ.addClass(t,"t"+i),l*=i,t.parentElement.clientWidth<l&&occ.addClass(this.dialog,"panels");let n=this.dialog.querySelector(".ocDialog-tabContent > div.ocDialog-Obj.active");occ.removeClass(a,"active"),n?occ.addClass(document.getElementById(n.id+"-tb"),"active"):"changeTab"!==e&&c&&occ.triggerEvent(c,"pointerup"),occ.removeClass(t,"checking")}}else if(document.body.clientWidth>700){let e=175;t.querySelectorAll(".ocDialog-tab").forEach(function(t){t.style.top="",e+=t.clientHeight}),e>t.clientHeight?occ.addClass(t,"hideLogo"):occ.removeClass(t,"hideLogo"),occ.removeClass(t,"open")}},ocDialog.prototype.forceConfirm=function(e){var t=this.dialog.querySelector(".ocDialog-tabContent > div.ocDialog-Obj.active");return null!==this.doSave&&(!(!occ.hasClass(t,"tabSts-dirty")&&!occ.hasClass(this.dialog,"dlgSts-dirty"))&&(this.confirmCallBackObj=e,this.doConfirm(),!0))};var activeConfirm=!1;function closeDialogByEvent(e){let t="";if(t="DIALOG"===e.srcElement.tagName?e.srcElement.getAttribute("id"):e.currentTarget.parentElement.parentElement.parentElement.getAttribute("id"),!1===occ.isNothingOrEmpty(t))for(var o=0;o<activeDlgs.length;o++)activeDlgs[o].id===t&&activeDlgs[o].close()}function ocDialogResize(){for(var e=0;e<activeDlgs.length;e++)activeDlgs[e].setSize(),activeDlgs[e].checkTabs("resize")}ocDialog.prototype.doConfirm=function(){var e=this.dialog.querySelector("div.ocDialog-confirm");if(!e){let i="There are unsaved changes";e=occ.createDiv("<div><div>"+i+'<span id="invalidConfirmMsg" class="hiddenObj">,<br /> but there are errors</span>.<span id="fieldsConfirmMsg" class="hiddenObj"></span></div><div class="ocDialog-confirm-btns"></div></div>',["ocDialog-confirm","hiddenObj"]),this.dialog.appendChild(e);var t=this.dialog.querySelector("div.ocDialog-confirm-btns"),o=occ.createDiv("Discard Changes",["opoClient-btn"],[{name:"id",value:"dlgConfirmBtn1"}]);occ.addClickEvent(o,this.ignoreConfirm.bind(this)),t.appendChild(o);var l=occ.createDiv("Save Changes",["opoClient-btn","saveOK"],[{name:"id",value:"dlgConfirmBtn2"}]);occ.addClickEvent(l,this.completeConfirm.bind(this)),t.appendChild(l);var c=occ.createDiv("Correct Changes",["opoClient-btn"],[{name:"id",value:"dlgConfirmBtn3"}]);occ.addClickEvent(c,this.cancelConfirm.bind(this)),t.appendChild(c)}occ.hideObj("invalidConfirmMsg");var i=occ.hasClass(this.dialog,"invalid");if(!1===i&&null!==this.formStatus&&(i=!this.formStatus.valid),occ.hideObj("fieldsConfirmMsg"),document.getElementById("fieldsConfirmMsg").innerHTML="",!1===i){var a=this.dialog.querySelector(".ocDialog-tabContent > div.ocDialog-Obj.active");i=occ.hasClass(a,"invalid")}if(!1===i?(occ.hideObj("dlgConfirmBtn3"),occ.showObj("dlgConfirmBtn2")):(occ.hideObj("dlgConfirmBtn2"),occ.showObj("dlgConfirmBtn3"),occ.showObj("invalidConfirmMsg")),!0!==this.formStatus.valid||!0!==this.formStatus.complete){let e=this.formStatus.incomplete.concat(this.formStatus.invalid),t="",o="^";for(let l=0;l<e.length;l++){if(-1===o.indexOf("^"+e[l]+"^")){let o=document.getElementById(e[l]);o.parentElement.querySelector("label")&&(t+="&nbsp;&#x2022;&nbsp;&nbsp;",!1===occ.isNothingOrEmpty(o.parentElement.getAttribute("data-label"))?t+=o.parentElement.getAttribute("data-label"):t+=o.parentElement.querySelector("label").innerHTML,t+="<br>")}o+=e[l]+"^"}""!==t&&(document.getElementById("fieldsConfirmMsg").innerHTML="<br>"+t,occ.showObj("fieldsConfirmMsg"))}occ.showObj(e),activeConfirm=!0},ocDialog.prototype.cancelConfirm=function(e){var t=this.dialog.querySelector("div.ocDialog-confirm");occ.hideObj(t);let o=this.dialog.querySelector("div.incomplete");o||(o=this.dialog.querySelector("div.invalid")),o&&o.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"}),activeConfirm=!1,this.confirmCallBackObj=null},ocDialog.prototype.ignoreConfirm=function(e){this.clearStatus("ALL"),this.clearTabStatus("ALL"),this.setStatus("ignore"),this.setTabStatus("ignore");var t=this.dialog.querySelector("div.ocDialog-confirm");occ.hideObj(t),null!==this.confirmCallBackObj&&"close"!==this.confirmCallBackObj?("function"==typeof this.confirmCallBackObj?this.confirmCallBackObj(!0):occ.triggerEvent(this.confirmCallBackObj,"pointerup"),this.confirmCallBackObj=null):this.close()},ocDialog.prototype.completeConfirm=function(e){var t=this.dialog.querySelector("div.ocDialog-confirm");occ.hideObj(t),null!==this.doSave?(this.doSave(),this.clearTabStatus("ALL"),this.clearStatus("ALL"),this.setStatus("saved"),null!==this.confirmCallBackObj&&"close"!==this.confirmCallBackObj?"function"==typeof this.confirmCallBackObj?this.confirmCallBackObj(!1):occ.triggerEvent(this.confirmCallBackObj,"pointerup"):"close"===this.confirmCallBackObj&&this.close()):this.finalConfirm(!0)},ocDialog.prototype.finalConfirm=function(e){if(!0===activeConfirm){if(this.hideWaiting(),!0===e){var t=this.dialog.querySelector("div.ocDialog-confirm");occ.hideObj(t),this.clearTabStatus("dirty"),this.clearTabStatus("invalid"),"close"===this.confirmCallBackObj?this.close():null!==this.confirmCallBackObj&&("function"==typeof this.confirmCallBackObj?this.confirmCallBackObj(!1):occ.triggerEvent(this.confirmCallBackObj,"pointerup"))}activeConfirm=!1}},ocDialog.prototype.open=function(e){let t=[],o=this.dialog.id;if(!0===occ.supportDialogElem){t=document.querySelectorAll("body > div.ocDialog-overlay > dialog.ocDialog-dialog");let e=null;for(let l=0;l<t.length;l++)t[l].id!==o&&!0===t[l].open&&(!0===occ.hasClass(this.dialog,"hiddenBy"+t[l].id)?e=t[l]:(occ.addClass(t[l],"hiddenBy"+o),occ.hideObj(t[l])));null!==e&&(e.close(),occ.removeClass(this.dialog,"hiddenBy"+e.id),occ.showObj(this.dialog)),!1===this.dialog.open&&this.dialog.showModal()}else{t=document.querySelectorAll("body > div.ocDialog-overlay > div.ocDialog-dialog.active");for(let e=0;e<t.length;e++)t[e].id!==o&&(occ.addClass(t[e],"hiddenBy"+o),occ.hideObj(t[e]));this.dialog.style.display="none",this.setSize(),this.dialog.style.display="block"}if(occ.addClass(this.dialog,"active"),this.overlay.style.display="block",0===this.tabs.length&&(this.content.style.display="block"),"function"==typeof this.onOpen&&this.onOpen({currentTarget:this.content}),this.confirmCallBackObj=null,occ.addClass(document.body,"ocDialog-open"),this.tabs.length>
30){var l=this.dialog.querySelector('a[href], area[href], input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, *[tabindex], *[contenteditable]');null!==l&&l.focus()}if(this.checkTabs("open"),occ.checkMyTables(this.dialog),occ.checkOCFormContainer(this.dialog,null,!0),"function"==typeof this.onOpened&&this.onOpened({currentTarget:this.content}),this.tabs.length>0){if(!this.dialog.querySelector(".ocDialog-tab.active")){var c=this.dialog.querySelector("div.ocDialog-tabs");if(!1===occ.hasClass(c.parentElement,"panel-active")){let e=c.children[1];if(!this.dialog.querySelector("div.ocDialog-tabContent > div.ocDialog-Obj.active")){var i=this.dialog.querySelector("div.ocDialog-tabContent");occ.removeClass(c.parentElement.querySelector(".ocDialog-tab.active"),"active"),occ.removeClass(c.parentElement.querySelector(".ocDialog-tab-title.active"),"active"),occ.removeClass(c.parentElement.querySelector(".ocDialog-Obj.active"),"active"),occ.removeClass(c.parentElement.querySelector(".ocDialog-tab-btns.active"),"active"),i.scrollTop=0,occ.addClass(e.id.replace("-tb",""),"active"),occ.addClass(e.id+"-tb-title","active"),occ.addClass(e.id+"-title","active"),occ.addClass(e.id+"-btns","active")}occ.addClass(e,"active")}}}else this.dialog.querySelector("div.ocDialog-content").scrollTop=0;this.overlay.scrollIntoView(),occ.turnOffScrollY(),this.clearStatus("ALL"),occ.removeClass(this.dialog.querySelector(".tabSts-ignore"),"tabSts-ignore"),occ.bindVirtualKeyboard(this.dialog),!0===e&&this.maximizeDialog(),this.hideWaiting(),occ.initInputControls(this.dialog),occ.initFields(this.dialog),occ.resizeFormFields(this.dialog),occ.resetOcFieldSelect(null)},ocDialog.prototype.close=function(){document.activeElement.blur();let e=occ.hasClass(this.dialog,"dlgSts-dirty"),t=occ.hasClass(this.dialog,"dlgSts-ignore"),o=occ.hasClass(this.dialog,"dlgSts-saved");if(this.formStatus=occ.checkOCFormContainer(this.dialog,null,!0),(1==e||null!==this.formStatus&&!1===this.formStatus.clean&&null!==this.doSave)&&!1===t&&!1===o)this.confirmCallBackObj="close",this.doConfirm();else{let o=this.dialog.querySelector(".ocDialog-tabContent > div.ocDialog-Obj.active");if(e=occ.hasClass(o,"tabSts-dirty"),!0===e&&null!==this.doSave&&!1===t)this.confirmCallBackObj="close",this.doConfirm();else{let e=!0;if("function"==typeof this.onClose&&(e=this.onClose({currentTarget:this.content})),!1===e)return;let t=this.dialog.querySelector("div.dlgSearchDiv");t&&occ.resetElementSearch(t),occ.removeClass(document.body,"ocDialog-open"),occ.removeClass(this.dialog.children[0],"panel-active"),!0===occ.supportDialogElem?this.dialog.close():this.dialog.style.display="none",occ.removeClass(this.dialog,"active");let o=this.dialog.id,l=document.querySelectorAll("body > div.ocDialog-overlay > .hiddenBy"+o);for(let e=0;e<l.length;e++)occ.removeClass(l[e],"hiddenBy"+o),occ.showObj(l[e]),occ.resizeFormFields(l[e]),!0===occ.supportDialogElem?!1===l[e].open&&l[e].showModal():ocDialogResize();let c=this.overlay.querySelectorAll(".ocDialog-dialog"),i=0;for(let e=0;e<c.length;e++)"block"!==c[e].style.display&&!0!==c[e].open||i++;0===i&&(this.overlay.style.display=""),"function"==typeof this.onClosed&&this.onClosed(),occ.turnOnScrollY(),occ.removeClass(this.dialog.querySelector(".tabSts-invalid"),"tabSts-invalid"),occ.removeClass(this.dialog.querySelector(".tabSts-ignore"),"tabSts-ignore"),occ.removeClasses(this.dialog,["dlgSts-saved","dlgSts-ignore"]),occ.removeClass(this.dialog.querySelectorAll("div.advancedSection.open"),"open")}}},ocDialog.prototype.getTabStatus=function(e){var t=this.dialog.querySelector(".ocDialog-tabContent > div.ocDialog-Obj.active");return occ.hasClass(t,e)},ocDialog.prototype.setTabStatus=function(e,t){return t&&null!==t||(t=this.dialog.querySelector(".ocDialog-tabContent > div.ocDialog-Obj.active")),occ.addClass(t,"tabSts-"+e),this.checkTabFormButtons(t),t},ocDialog.prototype.clearTabStatus=function(e){var t=this.dialog.querySelector(".ocDialog-tabContent > div.ocDialog-Obj.active");if("ALL"===e){let e=this.dialog.classList;for(let o=0;o<e.length;o++)0===e[o].indexOf("tabSts-")&&occ.removeClass(t,e[o])}else occ.removeClass(t,"tabSts-"+e);return this.checkTabFormButtons(t),t},ocDialog.prototype.checkTabFormButtons=function(e){e&&null!==e&&(occ.disableControl(e.querySelector("button.ocDialog-tab-btn.saveOK"),!0),occ.disableControl(e.querySelector("button.ocDialog-tab-btn.reset"),!0),occ.hasClass(e,"tabSts-saving")?occ.disableControl(e.querySelector("button.ocDialog-tab-btn.saveOK"),!0):(occ.hasClass(e,"tabSts-dirty")&&(occ.disableControl(e.querySelector("button.ocDialog-tab-btn.saveOK"),!1),occ.disableControl(e.querySelector("button.ocDialog-tab-btn.reset"),!1)),occ.hasClass(e,"tabSts-invalid")&&(occ.disableControl(e.querySelector("button.ocDialog-tab-btn.saveOK"),!0),occ.disableControl(e.querySelector("button.ocDialog-tab-btn.reset"),!1))))},ocDialog.prototype.setStatus=function(e){occ.addClass(this.dialog,"dlgSts-"+e),this.checkDialogFormButtons()},ocDialog.prototype.clearStatus=function(e){if("ALL"===e){let e=this.dialog.classList;for(let t=0;t<e.length;t++)0===e[t].indexOf("dlgSts-")&&occ.removeClass(this.dialog,e[t])}else occ.removeClass(this.dialog,"dlgSts-"+e);this.checkDialogFormButtons()},ocDialog.prototype.checkDialogFormButtons=function(){occ.disableControl(this.dialog.querySelector("div.ocDialog-btns button.saveOK"),!1),occ.disableControl(this.dialog.querySelector("div.ocDialog-btns button.closeOK"),!1),occ.disableControl(this.dialog.querySelector("div.ocDialog-btns button.deleteOK"),!1),occ.disableControl(this.dialog.querySelector("div.ocDialog-btns button.reset"),!0),occ.hasClass(this.dialog,"dlgSts-saving")?(occ.disableControl(this.dialog.querySelector("div.ocDialog-btns button.saveOK"),!0),occ.disableControl(this.dialog.querySelector("div.ocDialog-btns button.closeOK"),!0),occ.disableControl(this.dialog.querySelector("div.ocDialog-btns button.deleteOK"),!0)):(occ.hasClass(this.dialog,"dlgSts-dirty")&&(occ.disableControl(this.dialog.querySelector("div.ocDialog-btns button.saveOK"),!1),occ.disableControl(this.dialog.querySelector("div.ocDialog-btns button.reset"),!1)),occ.hasClass(this.dialog,"dlgSts-invalid")&&(occ.disableControl(this.dialog.querySelector("div.ocDialog-btns button.saveOK"),!0),occ.disableControl(this.dialog.querySelector("div.ocDialog-btns button.reset"),!1)))},ocDialog.prototype.maximizeDialog=function(){occ.addClass(this.dialog,"dlgsize-maximize"),this.setSize(),occ.resizeFormFields(this.dialog),ocWizardResize(),this.checkTabs("resize")},ocDialog.prototype.restoreDialog=function(){occ.removeClass(this.dialog,"dlgsize-maximize"),this.setSize(),ocWizardResize(),occ.resizeFormFields(this.dialog),this.checkTabs("resize")},ocDialog.prototype.showDialogHelp=function(){if(occ.toggleClass(this.dialog,"helpActive"),!0===occ.hasClass(this.dialog,"helpActive")){let e=this.dialog.querySelectorAll("div.postVideo");for(let t=0;t<e.length;t++)occ.setVideosSize(e[t])}},ocDialog.prototype.toggle=function(){"block"===this.dialog.style.display?this.close():this.open()},ocDialog.prototype.handleTabKey=function(e){if(9!==e.keyCode)return!0;var t;e.srcElement?t=e.srcElement:e.target&&(t=e.target);
3var o=this.dialog.querySelectorAll('a[href], area[href], input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, *[tabindex], *[contenteditable]');return e.shiftKey&&t===o[0]?(e.preventDefault(),o[o.length-1].focus()):e.shiftKey||t!==o[o.length-1]||(e.preventDefault(),o[0].focus()),!1};var activeWizards=[],openWizard=null;function ocWizard(e){if(e.parentId&&null!==e.parentId){for(var t=null,o=0;o<activeWizards.length;o++)activeWizards[o].id===e.id&&null!==document.getElementById(e.id)&&(!0===e.regenerate?document.getElementById(e.parentId).innerHTML="":(openWizard=activeWizards[o],t=document.getElementById(e.parentId)));if(!openWizard||null===openWizard){t=document.getElementById(e.parentId),occ.addClass(t,"ocWizard-parent"),e.doResize=!1,!0===e.linear&&(e.doResize="first");var l=occ.createDiv("",["ocWizard-container"],[{name:"id",value:e.id}]);"number"==typeof e.height&&e.height>-1&&(0===e.height&&(e.doResize=!0),e.height>0&&(l.style.height=e.height+"px"));var c=occ.createDiv('<div class="ocWizard-titlebar-title"></div>',["ocWizard-titlebar"]);if(!0!==e.linear&&c.appendChild(occ.createDiv("",["ocWizard-btns"])),l.appendChild(c),e.info&&""!==e.info&&l.appendChild(occ.createDiv(e.info,["ocWizard-info"],null)),e.steps.length>0){if(!0===e.linear){occ.addClasses(t,["ocWizard-linearMode","invalid"]);for(var i=occ.createDiv("",["ocWizard-stepParent","ocWizard-linearSteps"]),a=occ.createDiv("",["ocWizard-content"]),n=0;n<e.steps.length;n++){var r=occ.createDiv("<span>"+(n+1)+'</span><div class="icon sz2 s-check gr-t"></div><div class="stepText"><span>'+e.steps[n].title+"</span></div>",["ocWizard-step","ocWizard-linear","invalid","required"]);r.setAttribute("id",e.steps[n].id+"-step"),i.appendChild(r),e.steps[n].obj=document.getElementById(e.steps[n].id),occ.removeClass(e.steps[n].obj,"ocWizard-object");var s=occ.createDiv("",["ocWizard-stepcontent"],[{name:"id",value:e.steps[n].id+"-ct"}]);s.appendChild(e.steps[n].obj),a.appendChild(s)}l.appendChild(i),l.appendChild(a);var d=occ.createDiv("",["ocWizard-btns"]);if(!1!==e.linearNav){occ.addClass(d,"linearNav");var u=occ.createDiv("",["ocWizard-buttons"]),p=occ.createButton("Back",["ocWizard-prev","ocWizard-btn"]);occ.addClickEvent(p,this.previousStep.bind(this)),u.appendChild(p);var m=occ.createButton("Next",["ocWizard-next","ocWizard-btn"]);m.disabled=!0,occ.addClickEvent(m,this.nextStep.bind(this)),u.appendChild(m),d.appendChild(u)}d.appendChild(occ.createDiv("",["main"])),l.appendChild(d)}else{occ.addClass(t,"ocWizard-accordianMode");for(var h=occ.createDiv("",["ocWizard-stepParent","ocWizard-accordian"]),g=0;g<e.steps.length;g++){var f=occ.createDiv("",["ocWizard-step","ocWizard-accord"]);!0===e.steps[g].required&&occ.addClass(f,"required"),f.setAttribute("id",e.steps[g].id+"-accord");var y=occ.createDiv(e.steps[g].title,["ocWizard-accordTitle"]);y.appendChild(occ.createDiv('<div class="ocWizard-accordTitle-state"><span>'+(!0===e.steps[g].required?"required":"")+'</span><div class="icon s-arrow-down th sz2"></div><div class="icon s-arrow-down grtdm sz2"></div><div class="icon s-arrow-up rv sz2"></div></div>')),e.steps[g].onOpen&&"function"==typeof e.steps[g].onOpen&&occ.addClickEvent(y,e.steps[g].onOpen),occ.addClickEvent(y,this.changeStep.bind(this)),"ios"===occ.clientOs&&(y.addEventListener("touchstart",function(e){e.preventDefault(),e.stopPropagation()}),y.addEventListener("touchmove",function(e){e.preventDefault(),e.stopPropagation()})),f.appendChild(y),e.steps[g].obj=document.getElementById(e.steps[g].id),occ.addClass(e.steps[g].obj,"ocWizard-stepcontent"),occ.removeClass(e.steps[g].obj,"ocWizard-object"),f.appendChild(e.steps[g].obj),h.appendChild(f)}h.appendChild(occ.createDiv("",["ocWizard-accord"],null)),l.appendChild(h)}t.appendChild(l)}if(this.id=e.id,this.parentId=e.parentId,this.wizard=t,this.titlebar=this.wizard.querySelector(".ocWizard-titlebar"),this.steps=e.steps,this.buttons=new Array,this.linear=e.linear,this.onCancel=null,this.doSave=null,this.onClose=null,this.onLoad=null,this.doResize=e.doResize,this.linearNav=e.linearNav,null!==e){"string"==typeof e.class&&(e.class.indexOf(" ")>0?occ.addClasses(this.wizard,e.class.split(" ")):occ.addClass(this.wizard,e.class));var C=[];"function"==typeof e.doSave&&(this.doSave=e.doSave,C.push({id:this.id+"-complete",content:"Done",class:"ocWizard-complete",onClick:this.setComplete.bind(this),align:"R"})),"function"==typeof e.onCancel&&(this.onCancel=e.onCancel,C.push({id:this.id+"-cancel",content:"Cancel",onClick:this.cancel.bind(this),align:"R"})),"function"==typeof e.onClose&&(this.onClose=e.onClose),"function"==typeof e.onLoad&&(this.onLoad=e.onLoad),e.buttons&&null!==e.buttons||(e.buttons=C),Array.isArray(e.buttons)&&this.setButtons(e.buttons),this.setTitle(e.title)}activeWizards.push(this)}!0===e.linear&&this.setStepSiblings(null)}}ocWizard.prototype.setButtons=function(e){this.buttons=e;var t=this.wizard.querySelector(".ocWizard-btns");if(t&&(!0!==this.linear||(t=this.wizard.querySelector(".ocWizard-btns > div.main")))){if(t.innerHTML="",Array.isArray(e)&&e.length>0){t.style.display="",occ.removeClass(this.wizard,"nobtns");for(var o=0;o<this.buttons.length;o++){var l=this.buttons[o],c=occ.createButton(l.content,["ocWizard-btn"]);(!l.align||null===l.align||!1===this.linear||"string"==typeof l.align&&"L"!==l.align)&&occ.addClass(c,"ocWizard-btn-right"),"string"==typeof l.class&&(l.class.indexOf(" ")>0?occ.addClasses(c,l.class.split(" ")):occ.addClass(c,l.class)),"string"==typeof l.id&&(c.id=l.id),"object"==typeof l.attr&&occ.addAttributes(c,l.attr),"function"==typeof l.onClick&&occ.addClickEvent(c,l.onClick),"boolean"==typeof l.hidden&&!0===l.hidden&&occ.hideObj(c),"boolean"==typeof l.disabled&&!0===l.disabled&&(c.disabled=!0),"boolean"==typeof l.checkValid&&!0===l.checkValid&&
3(c.disabled=!0,occ.addClass(c,"checkvalid")),"ios"===occ.clientOs&&(c.addEventListener("touchstart",function(e){e.preventDefault(),e.stopPropagation()}),c.addEventListener("touchmove",function(e){e.preventDefault(),e.stopPropagation()})),t.appendChild(c)}occ.addClass(this.wizard,"hasbtns")}else occ.addClass(this.wizard,"nobtns");this.setSize()}},ocWizard.prototype.previousStep=function(e){var t=this.wizard.querySelector("div.ocWizard-step.active");if(t){var o=t.previousElementSibling;this.checkStepChange(t,o,!1)}},ocWizard.prototype.nextStep=function(e){var t=this.wizard.querySelector("div.ocWizard-step.active");if(t){var o=t.nextElementSibling;this.checkStepChange(t,o,!0)}},ocWizard.prototype.checkStepChange=function(e,t,o){for(var l,c,i=0;i<this.steps.length;i++)this.steps[i].id+"-step"===e.id&&(l=this.steps[i]),this.steps[i].id+"-step"===t.id&&(c=this.steps[i]);if(l&&c){var a=!0;"function"==typeof l.validate&&!1===(a=l.validate())&&this.setStepInvalid(e.id),a&&!0===o&&("function"==typeof l.onClose&&l.onClose(),"function"==typeof c.onOpen&&c.onOpen()),(a||!1===o)&&(this.setStepSiblings(t),this.checkSteps(),occ.checkMyTables(c.id))}},ocWizard.prototype.setStepSiblings=function(e){if(null===e?e=this.wizard.querySelector("div.ocWizard-linear"):(occ.removeClass(this.wizard.querySelectorAll("div.ocWizard-linear.active"),"active"),occ.removeClass(this.wizard.querySelectorAll("div.ocWizard-linear.next"),"next"),occ.removeClass(this.wizard.querySelectorAll("div.ocWizard-linear.previous"),"previous"),occ.removeClass(this.wizard.querySelectorAll("div.ocWizard-stepcontent.active"),"active")),e){var t=document.getElementById(e.id.replace("step","ct"));occ.addClass(t,"active"),occ.resizeFormFields(t),e.nextElementSibling?(occ.addClass(e.nextElementSibling,"next"),occ.showObj(this.wizard.querySelector(".ocWizard-next")),this.wizard.querySelector(".ocWizard-next").disabled=!1):(occ.hideObj(this.wizard.querySelector(".ocWizard-next")),this.wizard.querySelector(".ocWizard-next").disabled=!0),e.previousElementSibling?(occ.addClass(e.previousElementSibling,"previous"),occ.showObj(this.wizard.querySelector(".ocWizard-prev")),this.wizard.querySelector(".ocWizard-prev").disabled=!1):(occ.hideObj(this.wizard.querySelector(".ocWizard-prev")),this.wizard.querySelector(".ocWizard-prev").disabled=!0),occ.removeClass(e,"previous"),occ.removeClass(e,"next"),occ.addClass(e,"active")}},ocWizard.prototype.changeStep=function(e){var t=e.currentTarget;this.checkSteps(t),occ.hasClass(t.parentElement,"active")?occ.removeClass(t.parentElement,"active"):(occ.removeClass(document.querySelectorAll("#"+this.id+" div.ocWizard-accord.active"),"active"),occ.addClass(t.parentElement,"active")),this.setSize()},ocWizard.prototype.changeStepById=function(e){var t=document.getElementById(e);this.checkSteps(t),-1===e.indexOf("-accord")&&(e+="-accord",t=document.getElementById(e)),occ.hasClass(t,"active")?occ.removeClass(t,"active"):(occ.removeClass(document.querySelectorAll("#"+this.id+" div.ocWizard-accord.active"),"active"),occ.addClass(t,"active")),this.setSize()},ocWizard.prototype.hideStep=function(e){var t=document.getElementById(e+"-accord");t||(t=document.getElementById(e+"-step")),t&&occ.hideObj(t)},ocWizard.prototype.showStep=function(e){var t=document.getElementById(e+"-accord");t||(t=document.getElementById(e+"-step")),t&&occ.showObj(t)},ocWizard.prototype.hideAllSteps=function(){occ.hideObj(this.wizard.querySelectorAll("div.ocWizard-step"))},ocWizard.prototype.showAllSteps=function(){occ.showObj(this.wizard.querySelectorAll("div.ocWizard-step"))},ocWizard.prototype.setStepComplete=function(e){var t;if(e&&null!==e?(e.indexOf("-")>-1&&(t=document.getElementById(e)),t||(t=document.getElementById(e+"-accord")),t||(t=document.getElementById(e+"-step"))):t=this.wizard.querySelector("div.ocWizard-step.active"),t){occ.addClass(t,"complete"),occ.removeClass(t,"invalid");var o=t.querySelector("div.ocWizard-accordTitle-state > span");o&&(o.innerHTML=""),this.checkSteps()}},ocWizard.prototype.resetStep=function(e){if("string"==typeof e){var t=e;e=null,t.indexOf("-")>-1&&(e=document.getElementById(t)),e&&null!==e||(e=document.getElementById(t+"-accord")),e&&null!==e||(e=document.getElementById(t+"-step"))}if(e){occ.removeClasses(e,["active","hiddenObj","dirty","complete",".invalid","ignore"]);var o=e.querySelector("div.ocWizard-accordTitle-state > span");o&&(o.innerHTML="",occ.hasClass(e,"required")&&(o.innerHTML="required")),e=document.getElementById(e.id.replace("-step","-ct").replace("-accord","-ct")),occ.removeClasses(e,["active","hiddenObj","dirty","complete",".invalid","ignore"]),this.checkSteps()}},ocWizard.prototype.setStepInvalid=function(e){var t;if(e&&null!==e?(e.indexOf("-")>-1&&(t=document.getElementById(e)),t||(t=document.getElementById(e+"-accord")),t||(t=document.getElementById(e+"-step"))):t=this.wizard.querySelector("div.ocWizard-step.active"),t){occ.addClass(t,"invali
3d"),occ.removeClass(t,"complete");var o=t.querySelector("div.ocWizard-accordTitle-state > span");o&&(o.innerHTML="required"),this.checkSteps()}},ocWizard.prototype.setStepDirty=function(e){var t;e&&null!==e?(e.indexOf("-")>-1&&(t=document.getElementById(e)),t||(t=document.getElementById(e+"-accord")),t||(t=document.getElementById(e+"-step"))):t=this.wizard.querySelector("div.ocWizard-step.active"),t&&(occ.addClass(t,"dirty"),this.checkSteps())},ocWizard.prototype.setStepTitle=function(e,t){var o;if(o||(o=document.getElementById(e+"-accord")),o||(o=document.getElementById(e+"-step")),o){if(!0===occ.isNullOrEmpty(t))for(let o=0;o<this.steps.length;o=0)this.steps[o].id===e&&(t=this.steps[o].title);o.querySelector("div.stepText > span").innerHTML=t}},ocWizard.prototype.checkSteps=function(e){if(e&&null!==e&&!0===occ.hasClass(e,"required")){for(var t,o=0;o<this.buttons.length;o++)this.buttons[o].id===e.id&&(t=this.buttons[i]);if("function"==typeof t.validate&&!1===t.validate())return void this.setStepInvalid(e.id)}else e||(e=this.wizard.querySelector(".ocWizard-step.active"));!0===this.linear&&!1!==this.linearNav&&(!0===occ.hasClass(e,"invali
3d")?this.wizard.querySelector(".ocWizard-next").disabled=!0:!0===occ.hasClass(e,"complete")&&e.nextElementSibling?this.wizard.querySelector(".ocWizard-next").disabled=!1:this.wizard.querySelector(".ocWizard-next").disabled=!0);var l=this.wizard.querySelectorAll(".ocWizard-step");this.complete=!1,this.dirty=!1,this.invalid=!1;for(var c=0,i=0;i<l.length;i++)occ.hasClass(l[i],"dirty")&&(this.dirty=!0),(occ.hasClass(l[i],"required")&&occ.hasClass(l[i],"complete")||!1===occ.hasClass(l[i],"required")||occ.hasClass(l[i],"hiddenObj"))&&c++,occ.hasClass(l[i],"invalid")&&(this.invalid=!0);c===l.length&&!1===this.invalid&&(this.complete=!0);for(var a=this.wizard.querySelectorAll(".ocWizard-btn.checkvalid"),n=0;n<a.length;n++)a[n].disabled=!this.complete;!0===this.dirty?occ.addClass(this.wizard,"dirty"):occ.removeClass(this.wizard,"dirty");var r=this.wizard.querySelector("button.ocWizard-complete");!0===this.complete?(r&&(r.disabled=!1),occ.addClass(this.wizard,"complete")):(r&&(r.disabled=!0),occ.removeClass(this.wizard,"complete")),!0===this.invalid?occ.addClass(this.wizard,"invalid"):occ.removeClass(this.wizard,"invalid")},ocWizard.prototype.toggleButton=function(e,t){"cancel"===e&&(e=this.id+"-cancel");var o=document.getElementById(e);!0===t?occ.showObj(o):!1===t?occ.hideObj(o):occ.toggleClass(o,"hiddenObj",null)},ocWizard.prototype.enableButton=function(e,t){document.getElementById(e).disabled=!t},ocWizard.prototype.setTitle=function(e){null!==e&&"string"==typeof e?(this.titlebar.querySelector(".ocWizard-titlebar-title").textContent=e,occ.removeClass(this.wizard,"notitle")):occ.addClass(this.wizard,"notitle");this.setSize()};activeConfirm=!1;function ocWizardResize(){for(var e=0;e<activeWizards.length;e++)activeWizards[e].setSize()}function ocSteps(e){if(this.id=e.id,this.title=e.title,this.helpId=e.helpId,this.popUp=!0===e.popUp,this.onLoad="function"==typeof e.onLoad?e.onLoad:null,this.onCancel="function"==typeof e.onCancel?e.onCancel:null,this.isReady="function"==typeof e.isReady?e.isReady:null,this.onPrev="function"==typeof e.onPrev?e.onPrev:null,this.onNext="function"==typeof e.onNext?e.onNext:null,!e.steps||null===e.steps&&occ.isNothingOrEmpty(e.parentId)){e.steps=[];let t=document.querySelectorAll("#"+e.parentId+" > div.ocStep-Obj");for(let o=0;o<t.length;o++){let l={id:t[o].id,title:t[o].getAttribute("data-title")};""!==t[o].getAttribute("onvalidate")&&(l.validate="parent"),""!==t[o].getAttribute("oncomplete")&&(l.onComplete="parent"),e.steps.push(l)}}if(this.steps=Array.isArray(e.steps)?e.steps:[],this.steps.length>0){let t=occ.createDiv("",["ocStep-ctrl","first"],[{name:"id",value:this.id}]),o=occ.createDiv("",["ocStep-Title"]);if(!1===occ.isNothingOrEmpty(this.title)){let e=occ.getElementFromString(this.title);e&&null!=e||(e=occ.createDiv(this.title)),o.appendChild(e)}else occ.addClass(t,"noTitle");t.appendChild(o);let l=occ.createDiv("",["ocStep-Nav"]),c=occ.createDiv("",["ocStep-NavP"]),i=occ.ocButton("ocStep-NavPBtn","",this.pStep.bind(this),"arrow-left sz4 tr");c.appendChild(i),l.appendChild(c);let a=occ.createDiv("",["ocStep-NavTitle"]);l.appendChild(a),l.appendChild(occ.createDiv("",["ocStep-NavCount"])),occ.isNothingOrEmpty(this.helpId)&&occ.addClass(t,"noHelp");let n=occ.createDiv("",["ocStep-NavHelp"]),r=occ.ocButton("ocStep-NavHelpBtn","",this.helpClick.bind(this),"i sz5 tr");n.appendChild(r),l.appendChild(n);let s=occ.createDiv("",["ocStep-NavN"]),d=occ.ocButton("ocStep-NavNBtn","",this.nStep.bind(this),"arrow-right sz4 tr");s.appendChild(d),l.appendChild(s),t.appendChild(l),t.appendChild(occ.createDiv("",["ocStep-HGap"])),t.appendChild(occ.createDiv("",["ocStep-HTGap"])),t.appendChild(occ.createDiv("",["ocStep-VGap"]));let u=occ.createDiv("",["ocStep-Progress"]),p=occ.createDiv("",["ocStep-Content"]),m="";for(let e=0;e<this.steps.length;e++){"function"!=typeof this.steps[e].onComplete&&"parent"!==this.steps[e].onComplete&&(this.steps[e].onComplete=null),"function"!=typeof this.steps[e].validate&&"parent"!==this.steps[e].validate&&(this.steps[e].validate=null),m+="1fr ";let t=occ.createDiv("",["ocStep-Item"],[{name:"id",value:this.steps[e].id+"-step"},{name:"data-title",value:this.steps[e].title}]);0===e&&occ.addClass(t,"active");let o=occ.getElementFromString(this.steps[e].id);o&&t.appendChild(o),p.appendChild(t);let l=occ.createDiv('<span class="innerText">'+this.steps[e].title+"</span>",["ocStep-ProgressItem"],[{name:"id",value:this.steps[e].id+"-dot"}]);u.appendChild(l)}if(u.style.gridTemplateColumns=m,t.appendChild(u),t.appendChild(p),!1===occ.isNothingOrEmpty(this.helpId)){let e=this;
3new ocAjax({jsonRequest:!1,jsonResponse:!0,onSuccess:function(t){let o=t.posts[0],l=!1;var c=occ.createDiv("",["ocDialog-HelpCover"]);occ.addClickEvent(c,e.showDialogHelp.bind(e)),e.dialog.appendChild(c);var i=occ.createDiv("");i.appendChild(occ.createElement("h4",null,null,o.postTitle)),o.postDescription&&""!==o.postDescription&&i.appendChild(occ.createElement("div",null,null,o.postDescriptionHtml));let a=null;o.postUrl&&""!==o.postUrl&&(a=function(){openLink(o.postUrl,o.postTitle)});let n=occ.createDiv("",["postImage"]);if(Array.isArray(o.postImages)&&occ.loadImageCarousel(n,o.postImages,"300px"),o.postImages&&0!=o.postImages.length||occ.addClass(n,"empty"),i.appendChild(n),o.postVideo&&""!==o.postVideo&&0===o.postVideo.indexOf("http")){let e=occ.createDiv("",["postVideo"]);e.appendChild(occ.embedVideoCode(o.postVideo)),i.appendChild(e),l=!0}let r=occ.createDiv("",["postButtons"]);if(o.fileUrl&&!1===occ.isNullOrEmpty(o.fileUrl))if("jpg"===o.fileType||"png"==o.fileType||"svg"==o.fileType||"bmp"==o.fileType||"webp"==o.fileType)i.appendChild(occ.createElement("img",["postResourceImage"],[{name:"src",value:o.fileUrl+"&s=large"}]));else{let e=0===o.fileUrl.indexOf("http")?"link":"pdf";!0===occ.checkVideoCode(o.fileUrl)&&(e="play",o.fileUrl.indexOf("media.azure.net")>0&&(l=!0));let t=function(){openLink(o.fileUrl,o.fileTitle,null,o.fileToken,o.fileProtection)};r.appendChild(occ.ocButton("pfurl"+o.ePostId,o.fileTitle,t,e))}null!==a&&r.appendChild(occ.ocButton("purl"+o.ePostId,o.postUrlText,a)),i.appendChild(r);var s=occ.createDiv("",["ocDialog-Help"]);s.appendChild(i),e.control.appendChild(s),!0===l&&occ.loadResources("ams",null,null);var d=occ.createAnchor('<div class="icon s-info sz3 wh-t"></div>',["infoIcon"],null);occ.addClickEvent(d,e.showDialogHelp.bind(e)),e.titlebar.appendChild(d),occ.addClass(e.control,"hasHelp"),e=null}}).get("/api/post/GetPosts/H?id="+encodeURIComponent(e.helpId))}if(!0===this.popUp){let e=document.querySelector(".ocStep-overlay");e&&null!==e?e.appendChild(t):(e=occ.createDiv("",["ocStep-Overlay","hiddenObj"]),e.appendChild(t),document.body.appendChild(e))}else{let o=occ.getElementFromString(e.parentId);if(!o)return t;o.appendChild(t)}}}ocWizard.prototype.doConfirm=function(){var e=this.wizard.querySelector("div.ocWizard-confirm");if(!e){e=occ.createDiv('<div><div>There are unsaved changes<span id="invalidConfirmMsg" class="hiddenObj">,<br /> but there are errors</span>.</div><div class="ocWizard-confirm-btns"></div></div>',["ocWizard-confirm","hiddenObj"]),this.wizard.appendChild(e);var t=this.wizard.querySelector("div.ocWizard-confirm-btns"),o=occ.createDiv("Ignore Changes",["opoClient-btn"],[{name:"id",value:"wizardConfirmBtn1"}]);occ.addClickEvent(o,this.ignoreConfirm.bind(this)),t.appendChild(o);var l=occ.createDiv("Save Changes",["opoClient-btn"],[{name:"id",value:"wizardConfirmBtn2"}]);occ.addClickEvent(l,this.completeConfirm.bind(this)),t.appendChild(l);var c=occ.createDiv("Correct Changes",["opoClient-btn"],[{name:"id",value:"wizardConfirmBtn3"}]);occ.addClickEvent(c,this.cancelConfirm.bind(this)),t.appendChild(c)}occ.hideObj("invalidConfirmMsg");var i=occ.hasClass(this.wizard,"invalid");if(!i){var a=this.wizard.querySelector(".ocWizard-tabContent > div.ocWizard-Obj.active");i=occ.hasClass(a,"invalid")}i?(occ.hideObj("wizardConfirmBtn2"),occ.showObj("wizardConfirmBtn3"),occ.showObj("invalidConfirmMsg")):(occ.hideObj("wizardConfirmBtn3"),occ.showObj("wizardConfirmBtn2")),occ.showObj(e),activeConfirm=!0},ocWizard.prototype.cancelConfirm=function(e){var t=this.wizard.querySelector("div.ocWizard-confirm");occ.hideObj(t),activeConfirm=!1},ocWizard.prototype.ignoreConfirm=function(e){var t=this.wizard.querySelector(".ocWizard-step.active");this.resetSteps(),occ.addClass(t,"ignore");var o=this.wizard.querySelector("div.ocWizard-confirm");occ.hideObj(o),this.stop(!0)},ocWizard.prototype.completeConfirm=function(e){var t=this.wizard.querySelector("div.ocWizard-confirm");occ.hideObj(t),this.doSave?(this.doSave(),this.stop(!0)):this.finalConfirm(!0)},ocWizard.prototype.finalConfirm=function(e){if(!0===activeConfirm){if(!0===e){var t=this.wizard.querySelector("div.ocWizard-confirm");occ.hideObj(t),this.resetSteps(),"close"===this.confirmCallBackObj&&this.stop()}activeConfirm=!1}},ocWizard.prototype.cancel=function(e){null!==this.onCancel&&this.onCancel(),this.resetSteps(),occ.hideObj(this.parentId)},ocWizard.prototype.stop=function(e){if(!0===e){this.resetSteps(),occ.hideObj(this.parentId),null!==this.onClose&&this.onClose();var t=this.wizard.querySelector("div.ocWizard-confirm");occ.hideObj(t)}else this.checkSteps(),!0===this.dirty?(this.confirmCallBackObj="close",this.doConfirm()):(null!==this.onClose&&this.onClose(),occ.hideObj(this.parentId))},ocWizard.prototype.start=function(e){if(this.id&&null!==this.id){if(null!==this.onLoad&&this.onLoad(),occ.addClass(this.id,"active"),occ.showObj(this.parentId),!0===e&&(this.resetSteps(),!0===this.linear)){this.wizard.querySelector(".ocWizard-prev").disabled=!0,occ.hideObj(this.wizard.querySelector(".ocWizard-prev"));var t=this.wizard.querySelector(".ocWizard-step");occ.addClass(t,"active"),t=this.wizard.querySelector(".ocWizard-stepcontent"),occ.addClass(t,"active")}this.checkSteps(),this.setSize(),occ.checkOCFormContainer(this.wizard,!1,!0)}},ocWizard.prototype.setComplete=function(){null!==this.doSave&&this.doSave(),null!==this.onClose&&this.onClose(),this.resetSteps(),occ.hideObj(this.parentId)},ocWizard.prototype.resetSteps=function(){for(var e=this.wizard.querySelectorAll("div.ocWizard-step"),t=0;t<e.length;t++)this.resetStep(e[t]);occ.removeClasses(this.wizard,["dirty","complete",".invalid"]),!0===this.linear&&(occ.addClass(document.querySelector("#"+this.id+" >  div.ocWizard-linear"),"active"),!1!==this.linearNav&&(this.wizard.querySelector(".ocWizard-next").disabled=!0))},ocWizard.prototype.setSize=function(){var e=this.wizard.querySelector("div.ocWizard-info"),t=this.wizard.querySelector("div.ocWizard-titlebar"),o=this.wizard.querySelector("div.ocWizard-stepParent"),l=this.wizard.querySelector("div.ocWizard-container");if(!0===this.doResize||"first"===this.doResize){var c=this.wizard.clientHeight;this.wizard.style.height="calc(100% - 26px)",c=this.wizard.clientHeight,this.wizard.style.height="",l.style.height=0===c?"calc(100% - 1px);":c+"px";var i=l.clientHeight-t.clientHeight-(e?e.clientHeight:0);if("first"===this.doResize&&i>0&&(this.doResize=!1),!0===this.linear){var a=this.wizard.querySelector("div.ocWizard-btns");a&&(i-=a.clientHeight);var n=this.wizard.querySelector("div.ocWizard-linearSteps");
3n&&(i-=n.clientHeight)}if(!1===occ.hasClass(o,"ocWizard-linearSteps")&&(o.style.height=i-17+"px"),!0!==this.linear){var r=t.querySelector("div.ocWizard-titlebar-title"),s=t.querySelector("div.ocWizard-btns");s&&r.setAttribute("style","width: calc(100% - "+(s.clientWidth+10)+"px);")}else{this.wizard.querySelector("div.ocWizard-content").style.height=i-5+"px"}var d=this.wizard.querySelector(".ocWizard-accord.ocWizard-stepScroll");if(d)d.querySelector("div.ocWizard-stepcontent").style.height="",occ.removeClass(d,"ocWizard-stepScroll");var u=this.wizard.querySelector(".ocWizard-accord.active");if(u){for(var p=0,m=0,h=this.wizard.querySelectorAll(".ocWizard-accord"),g=0;g<h.length;g++)!1===occ.hasClass(h[g],"active")?p+=h[g].clientHeight:m=h[g].querySelector("div.ocWizard-accordTitle").clientHeight;var f=o.clientHeight-p-m-66;if(f>175){var y=this.wizard.querySelector(".ocWizard-accord.active > div.ocWizard-stepcontent");y.clientHeight>f&&(y.style.height=f+"px",occ.addClass(u,"ocWizard-stepScroll"))}for(var C=u.querySelectorAll("div.ocTable"),v=0;v<C.length;v++)C[v].id&&occ.setUpTable(C[v].id)}}},window.onorientationchange=function(){ocWizardResize()},window.addEventListener("resize",function(){ocWizardResize()}),ocSteps.prototype.start=function(){this.control&&null!==this.control||(this.control=document.getElementById(this.id)),!0===this.popUp&&occ.showObj(this.control.parentElement),occ.bindVirtualKeyboard(this.control),this.checkStepForm(),this.setControl()},ocSteps.prototype.helpClick=function(e){if(occ.toggleClass(this.control,"helpActive"),!0===occ.hasClass(this.control,"helpActive")){let e=this.control.querySelectorAll("div.postVideo");for(let t=0;t<e.length;t++)occ.setVideosSize(e[t])}},ocSteps.prototype.pStep=function(e){let t=this.control.querySelector(".ocStep-Item.active");t.previousElementSibling&&(occ.removeClass(t,"active"),t=t.previousElementSibling,t&&occ.addClass(t,"active"),this.setControl(t),this.checkStepForm(t),null!==this.onPrev&&this.onPrev(t))},ocSteps.prototype.nStep=function(e){let t=this.control.querySelector(".ocStep-Item.active");!0===this.checkStepForm(t,!0)&&t.nextElementSibling&&(occ.removeClass(t,"active"),t=t.nextElementSibling,t&&occ.addClass(t,"active"),this.setControl(t),this.checkStepForm(t),null!==this.onNext&&this.onNext(t))},ocSteps.prototype.finish=function(e){return!0===this.checkStepForm(curStep,!0)},ocSteps.prototype.checkStepForm=function(e,t){let o=!1;(e=occ.getElementFromString(e))&&null!==e||(e=this.control.querySelector(".ocStep-Item.active")),occ.removeClass(this.control,"ready");let l=null;for(let t=0;t<this.steps.length;t++)this.steps[t].id===e.id.replace("-step","")&&(l=this.steps[t]);let c=null;if(null!==l.validate&&("parent"===l.validate||(c=l.validate(l.id))),null===c){let t=occ.checkOCFormContainer(e.querySelector(".ocFormContainer"),!1,!0);(null===t||!0===t.complete)&&(o=!0)}else o=c;return!0===o&&(occ.addClass(this.control,"ready"),!0===t?null!==l.onComplete&&("parent"===l.onComplete||l.onComplete(l.id)):occ.hasClass(this.control,"last")&&null!==this.isReady&&(null!==l.onComplete&&("parent"===l.onComplete||l.onComplete(l.id)),this.isReady())),o},ocSteps.prototype.setControl=function(e){if(e&&null!==e||(e=this.control.querySelector(".ocStep-Item.active")),occ.removeClasses(this.control,["last","first"]),e.previousElementSibling||occ.addClass(this.control,"first"),e.nextElementSibling||occ.addClass(this.control,"last"),e&&null!==e){this.control.querySelector("div.ocStep-NavTitle").innerHTML=e.getAttribute("data-title");let t=this.control.querySelectorAll("div.ocStep-ProgressItem");occ.removeClasses(t,["done","active"]);let o=!1,l=0;for(let c=0;c<t.length;c++)o||(occ.addClass(t[c],"done"),(t[c].id===e.id.replace("-step","-dot")||0===c&&occ.hasClass(this.control,"first"))&&(l=c,o=!0,occ.addClass(t[c],"active")));let c=this.control.querySelector("div.ocStep-NavCount");occ.isVisible(c)&&(c.innerHTML=l+1+"/"+t.length),occ.resizeFormFields(e)}};var activeMaps=[];function ocMap(e){this.smallMap=null,this.smallMarkerObj=null,this.lightBase=null,this.dotRadius=10,this.tryCtMB=0,this.boundsAdust=.002,this.id=e.id,this.container=occ.getElementFromString(e.container),!0===occ.isNothingOrEmpty(this.container.id)&&this.container.setAttribute("id","ocMap"+occ.eid()),!0===occ.isNothingOrEmpty(this.id)&&!0===occ.isNothingOrEmpty(this.container.id)&&(this.id=this.container.id),this.mode=e.mode,this.lastLatLng=[0,0],this.lat=e.lat,this.lng=e.lng,this.ready=!1,null!==e.dotRadius&&e.dotRadius>0&&(this.dotRadius=e.dotRadius),occ.addClass(this.container,"ocMap"),!1===occ.hasClass(this.container,"loading")&&occ.loadResources("leaflet",null,this.loaded()),occ.addClass(this.container,"loading")}ocMap.prototype.loaded=function(e){this.ready=!0,"function"==typeof this.cb&&(occ.removeClass(this.container,"loading"),this.cb())},ocMap.prototype.initLightBase=function(){try{void 0!==this.lightBase&&null!==this.lightBase||(this.lightBase=new L.TileLayer("https://api.mapbox.com/styles/v1/
3alanopo/cl3tmqn6y001c14pnikwq682k/tiles/{z}/{x}/{y}?access_token=pk.eyJ1IjoiYWxhbm9wbyIsImEiOiJja210bnc4cGMwdGdwMnBvNXZkNXJteWJjIn0.qMY-yRwMytHgcvGwlrBfRQ",{attribution:'Map data &copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, Imagery &copy <a href="https://www.mapbox.com/">Mapbox</a>',tileSize:512,zoomOffset:-1}),this.tryCtMB=0)}catch(e){if(this.tryCtMB++,this.tryCtMB>5)return;return!1}},ocMap.prototype.load=function(e){1==this.ready?(this.cb=null,this.initMap()):this.cb=this.load},ocMap.prototype.updateOCMap=function(e){1==Array.isArray(e)||(this.lat=e.lat,this.lng=e.lng,this.initMap())},ocMap.prototype.reInitOCMap=function(e,t,o){this.container=occ.getElementFromString(e),this.lat=t,this.lng=o,occ.loadResources("leaflet",null,this.initMap)},ocMap.prototype.initMap=function(){if(!0===occ.isNothingOrEmpty(this.mode)||"small"===this.mode){if(!this.container||null===this.container)return;if(!1===this.initLightBase()){return void setTimeout(function(){this.initMap()},1e3)}if(this.lastLatLng[0]==this.lat&&this.lastLatLng[1]==this.lng)return;occ.addClass(this.container,"active"),this.lastLatLng=[this.lat,this.lng],null!==this.smallMap&&void 0!==this.smallMap&&(this.smallMap.remove(),this.smallMap=null);let t=.005,o=new L.LatLngBounds([this.lastLatLng[0]-t,this.lastLatLng[1]-t],[this.lastLatLng[0]+t,this.lastLatLng[1]+t]);if(this.smallMap=new L.Map(this.container,{layers:[this.lightBase],center:this.lastLatLng,zoom:19,maxBounds:o,tap:!1,zoomSnap:0,zoomDelta:.25}),this.smallMap.zoomControl.setPosition("bottomright"),!0===occ.isMobile?occ.hideObj("div.leaflet-control-zoom"):occ.showObj("div.leaflet-control-zoom"),void 0!==this.lat&&null!==typeof this.lat&&void 0!==this.lng&&null!==typeof this.lng){var e=2*this.dotRadius;let t=new L.Icon({iconUrl:"/ic?i=mappin2&c1=transparent&c2=transparent&c3=%234285f4",iconSize:[2*e,2*e],iconAnchor:[e,e]});new L.Marker(this.lastLatLng,{icon:t,bubblingPointerEvents:!1}).addTo(this.smallMap)}}};

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.