(function(exports){"use strict";if(typeof window.BX==="function"){return}var commonjsGlobal=typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:typeof global!=="undefined"?global:typeof self!=="undefined"?self:{};var babelExternalHelpers={};var hasRequiredBabelExternalHelpers;function requireBabelExternalHelpers(){if(hasRequiredBabelExternalHelpers)return babelExternalHelpers;hasRequiredBabelExternalHelpers=1;(function(e){var t=e.babelHelpers={};function n(e){if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){t.typeof=n=function(e){return typeof e}}else{t.typeof=n=function(e){return e&&typeof Symbol==="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e}}return n(e)}t.typeof=n;var r;function s(e,t,n,s){if(!r){r=typeof Symbol==="function"&&Symbol.for&&Symbol.for("react.element")||60103}var i=e&&e.defaultProps;var o=arguments.length-3;if(!t&&o!==0){t={children:void 0}}if(t&&i){for(var a in i){if(t[a]===void 0){t[a]=i[a]}}}else if(!t){t=i||{}}if(o===1){t.children=s}else if(o>1){var l=new Array(o);for(var c=0;c=0)continue;n[s]=e[s]}return n}t.objectWithoutPropertiesLoose=L;function _(e,n){if(e==null)return{};var r=t.objectWithoutPropertiesLoose(e,n);var s,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i=0)continue;if(!Object.prototype.propertyIsEnumerable.call(e,s))continue;r[s]=e[s]}}return r}t.objectWithoutProperties=_;function I(e){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}t.assertThisInitialized=I;function D(e,n){if(n&&(typeof n==="object"||typeof n==="function")){return n}return t.assertThisInitialized(e)}t.possibleConstructorReturn=D;function k(e,n){while(!Object.prototype.hasOwnProperty.call(e,n)){e=t.getPrototypeOf(e);if(e===null)break}return e}t.superPropBase=k;function M(e,n,r){if(typeof Reflect!=="undefined"&&Reflect.get){t.get=M=Reflect.get}else{t.get=M=function e(n,r,s){var i=t.superPropBase(n,r);if(!i)return;var o=Object.getOwnPropertyDescriptor(i,r);if(o.get){return o.get.call(s)}return o.value}}return M(e,n,r||e)}t.get=M;function R(e,n,r,s){if(typeof Reflect!=="undefined"&&Reflect.set){R=Reflect.set}else{R=function e(n,r,s,i){var o=t.superPropBase(n,r);var a;if(o){a=Object.getOwnPropertyDescriptor(o,r);if(a.set){a.set.call(i,s);return true}else if(!a.writable){return false}}a=Object.getOwnPropertyDescriptor(i,r);if(a){if(!a.writable){return false}a.value=s;Object.defineProperty(i,r,a)}else{t.defineProperty(i,r,s)}return true}}return R(e,n,r,s)}function F(e,t,n,r,s){var i=R(e,t,n,r||e);if(!i&&s){throw new Error("failed to set property")}return n}t.set=F;function H(e,t){if(!t){t=e.slice(0)}return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}t.taggedTemplateLiteral=H;function U(e,t){if(!t){t=e.slice(0)}e.raw=t;return e}t.taggedTemplateLiteralLoose=U;function W(e,n){if(e===t.temporalUndefined){throw new ReferenceError(n+" is not defined - temporal dead zone")}else{return e}}t.temporalRef=W;function G(e){throw new Error('"'+e+'" is read-only')}t.readOnlyError=G;function z(e){throw new Error('Class "'+e+'" cannot be referenced in computed property keys.')}t.classNameTDZError=z;t.temporalUndefined={};function V(e,n){return t.arrayWithHoles(e)||t.iterableToArrayLimit(e,n)||t.nonIterableRest()}t.slicedToArray=V;function q(e,n){return t.arrayWithHoles(e)||t.iterableToArrayLimitLoose(e,n)||t.nonIterableRest()}t.slicedToArrayLoose=q;function Y(e){return t.arrayWithHoles(e)||t.iterableToArray(e)||t.nonIterableRest()}t.toArray=Y;function J(e){return t.arrayWithoutHoles(e)||t.iterableToArray(e)||t.nonIterableSpread()}t.toConsumableArray=J;function K(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t=0;--i){var o=this.tryEntries[i];var a=o.completion;if(o.tryLoc==="root"){return s("end")}if(o.tryLoc<=this.prev){var l=n.call(o,"catchLoc");var c=n.call(o,"finallyLoc");if(l&&c){if(this.prev=0;--r){var s=this.tryEntries[r];if(s.tryLoc<=this.prev&&n.call(s,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e){this.complete(n.completion,n.afterLoc);C(n);return m}}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if(r.type==="throw"){var s=r.arg;C(n)}return s}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){this.delegate={iterator:O(e),resultName:t,nextLoc:n};if(this.method==="next"){this.arg=r}return m}}}(typeof window==="undefined"?function(){return this}()||Function("return this")():window);return babelRegeneratorRuntime}requireBabelRegeneratorRuntime();if(window._main_polyfill_core){console.warn("main.polyfill.core is loaded more than once on this page")}window._main_polyfill_core=true;let BX$2=window.BX;let resolve=BX$2;function rebindGlobal(){BX$2=window.BX;resolve=BX$2}const bxTmp=window.BX;window.BX=function(e){if(window.BX.type.isNotEmptyString(e)){return document.getElementById(e)}if(window.BX.type.isDomNode(e)){return e}if(window.BX.type.isFunction(e)){return window.BX.ready(e)}return null};if(bxTmp){Object.keys(bxTmp).forEach((e=>{window.BX[e]=bxTmp[e]}))}rebindGlobal();exports=window.BX;const win=window;win.BX=win.BX||{};const BX$1=win.BX;function BxPromise(e,t){this.state=null;this.value=null;this.reason=null;this.next=null;this.ctx=t||this;this.onFulfilled=[];this.onRejected=[]}BxPromise.prototype.fulfill=function(e){this.checkState();this.value=e;this.state=true;this.execute()};BxPromise.prototype.reject=function(e){this.checkState();this.reason=e;this.state=false;this.execute()};BxPromise.prototype.then=function(e,t){if(typeof e==="function"||e instanceof Function){this.onFulfilled.push(e)}if(typeof t==="function"||t instanceof Function){this.onRejected.push(t)}if(this.next===null){this.next=new BX$1.Promise(null,this.ctx)}if(this.state!==null){this.execute()}return this.next};BxPromise.prototype.catch=function(e){if(typeof e==="function"||e instanceof Function){this.onRejected.push(e)}if(this.next===null){this.next=new BX$1.Promise(null,this.ctx)}if(this.state!==null){this.execute()}return this.next};BxPromise.prototype.setAutoResolve=function(e,t){this.timer=setTimeout((()=>{if(this.state===null){this[e?"fulfill":"reject"]()}}),t||15)};BxPromise.prototype.cancelAutoResolve=function(){clearTimeout(this.timer)};BxPromise.prototype.resolve=function(e){if(this===e){this.reject(new TypeError("Promise cannot fulfill or reject itself"))}else if(e&&e.toString()==="[object BX.Promise]"){e.then((e=>{this.fulfill(e)}),(e=>{this.reject(e)}))}else{this.fulfill(e)}};BxPromise.prototype.toString=function(){return"[object BX.Promise]"};BxPromise.prototype.execute=function(){if(this.state===null){return}let e;let t;let n;if(this.state===true){if(this.onFulfilled.length>0){try{for(let t=0;t0){try{for(let t=0;t0}static isArrayLike(e){if(Type.isNil(e)||Type.isFunction(e)||!("length"in e)){return false}const{length:t}=e;return Type.isNumber(t)&&t>-1&&t<=Number.MAX_SAFE_INTEGER}static isDate(e){return Type.isObjectLike(e)&&getTag(e)==="[object Date]"}static isDomNode(e){return Type.isObjectLike(e)&&!Type.isPlainObject(e)&&"nodeType"in e}static isElementNode(e){return Type.isDomNode(e)&&e.nodeType===Node.ELEMENT_NODE}static isEventTargetLike(e){return Type.isObjectLike(e)&&Type.isFunction(e.addEventListener)&&Type.isFunction(e.removeEventListener)&&Type.isFunction(e.dispatchEvent)}static isTextNode(e){return Type.isDomNode(e)&&e.nodeType===Node.TEXT_NODE}static isMap(e){return Type.isObjectLike(e)&&getTag(e)==="[object Map]"}static isSet(e){return Type.isObjectLike(e)&&getTag(e)==="[object Set]"}static isWeakMap(e){return Type.isObjectLike(e)&&getTag(e)==="[object WeakMap]"}static isWeakSet(e){return Type.isObjectLike(e)&&getTag(e)==="[object WeakSet]"}static isPrototype(e){if(!Type.isObjectLike(e)){return false}const t=e.constructor;const n=Type.isFunction(t)?t.prototype:Object.prototype;return n===e}static isRegExp(e){return Type.isObjectLike(e)&&getTag(e)==="[object RegExp]"}static isNull(e){return e===null}static isUndefined(e){return typeof e==="undefined"}static isArrayBuffer(e){return Type.isObjectLike(e)&&getTag(e)==="[object ArrayBuffer]"}static isTypedArray(e){const t=/^\[object (?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)]$/;return Type.isObjectLike(e)&&t.test(getTag(e))}static isBlob(e){return Type.isObjectLike(e)&&Type.isNumber(e.size)&&Type.isString(e.type)&&Type.isFunction(e.slice)}static isFile(e){if(!Type.isBlob(e)||!("name"in e)||!Type.isString(e.name)){return false}if("lastModified"in e&&Type.isNumber(e.lastModified)){return true}return"lastModifiedDate"in e&&Type.isObjectLike(e.lastModifiedDate)}static isFormData(e){return e instanceof FormData}static isJsonValue(e){return Type.isPlainObject(e)||Type.isString(e)||Type.isNumber(e)||Type.isBoolean(e)||Type.isNull(e)||Type.isArray(e)}}class Reflection{static getClass(e){if(Type.isString(e)&&Boolean(e)){let t=null;let n=window;const r=e.split(".");for(const e of r){if(!n[e]){return null}n=n[e];t=n}return t}if(Type.isFunction(e)){return e}return null}static namespace(e){let t=e.split(".");let n=window.BX;if(t[0]==="BX"){t=t.slice(1)}for(const e of t){if(Type.isUndefined(n[e])){n[e]={}}n=n[e]}return n}}const reEscape=/["&'<>]/g;const reUnescape=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34);/g;const escapeEntities={"&":"&","<":"<",">":">","'":"'",'"':"""};const unescapeEntities={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'};class Text{static encode(e){if(Type.isString(e)){return e.replaceAll(reEscape,(e=>escapeEntities[e]))}return e}static decode(e){if(Type.isString(e)){return e.replaceAll(reUnescape,(e=>unescapeEntities[e]))}return e}static getRandom(e=8){return Array.from({length:e},(()=>Math.trunc(Math.random()*36).toString(36))).join("")}static toNumber(e){const t=Number.parseFloat(String(e));if(Type.isNumber(t)){return t}return 0}static toInteger(e){return Text.toNumber(Number.parseInt(String(e),10))}static toBoolean(e,t=[]){const n=Type.isString(e)?e.toLowerCase():e;const r=["true","y","1",1,true,...t];return r.includes(n)}static toCamelCase(e){if(!Type.isStringFilled(e)){return e}const t=/[\s_-]+(.)?/g;if(!t.test(e)){return/^[A-Z]+$/.test(e)?e.toLowerCase():e[0].toLowerCase()+e.slice(1)}const n=e.toLowerCase().replaceAll(t,((e,t)=>t?t.toUpperCase():""));return n[0].toLowerCase()+n.slice(1)}static toPascalCase(e){if(!Type.isStringFilled(e)){return e}return this.capitalize(this.toCamelCase(e))}static toKebabCase(e){if(!Type.isStringFilled(e)){return e}const t=e.match(/[A-Z]{2,}(?=[A-Z][a-z]+\d*|\b)|[A-Z]?[a-z]+\d*|[A-Z]|\d+/g);if(!t){return e}return t.map((e=>e.toLowerCase())).join("-")}static capitalize(e){if(!Type.isStringFilled(e)){return e}return e[0].toUpperCase()+e.slice(1)}}const aliases={mousewheel:["DOMMouseScroll"],bxchange:["change","cut","paste","drop","keyup"],animationend:["animationend","oAnimationEnd","webkitAnimationEnd","MSAnimationEnd"],transitionend:["webkitTransitionEnd","otransitionend","oTransitionEnd","msTransitionEnd","transitionend"],fullscreenchange:["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],fullscreenerror:["fullscreenerror","webkitfullscreenerror","mozfullscreenerror","MSFullscreenError"]};class Registry{registry=new WeakMap;set(e,t,n){if(!Type.isEventTargetLike(e)){return}const r=this.get(e);if(!Type.isSet(r[t])){r[t]=new Set}r[t].add(n);this.registry.set(e,r)}get(e){return this.registry.get(e)||{}}has(e,t,n){if(t&&n){const r=this.registry.get(e);return this.registry.has(e)&&Boolean(r&&r[t]?.has(n))}return this.registry.has(e)}delete(e,t,n){if(!Type.isEventTargetLike(e)){return}if(Type.isString(t)&&Type.isFunction(n)){const r=this.registry.get(e);if(Type.isPlainObject(r)&&Type.isSet(r[t])){r[t].delete(n)}return}if(Type.isString(t)){const n=this.registry.get(e);if(Type.isPlainObject(n)&&Type.isSet(n[t])){n[t]=new Set}return}this.registry.delete(e)}}const registry=new Registry;function bind$1(e,t,n,r){if(!Type.isEventTargetLike(e)||n===null){return}if(t in aliases){aliases[t].forEach((s=>{e.addEventListener(s,n,r);registry.set(e,t,n)}));return}e.addEventListener(t,n,r);registry.set(e,t,n)}function unbind$1(e,t,n,r){if(!Type.isEventTargetLike(e)||n===null){return}if(t in aliases){aliases[t].forEach((t=>{e.removeEventListener(t,n,r);registry.delete(e,t,n)}));return}e.removeEventListener(t,n,r);registry.delete(e,t,n)}function unbindAll$1(e,t){const n=registry.get(e);Object.keys(n).forEach((r=>{n[r].forEach((n=>{if(!Type.isString(t)||t===r){unbind$1(e,r,n)}}))}))}function bindOnce$1(e,t,n,r){if(n===null){return}const s=function s(i){unbind$1(e,t,s,r);if(Type.isFunction(n)){n(i)}else if(Type.isObject(n)&&Type.isFunction(n.handleEvent)){n.handleEvent(i)}};bind$1(e,t,s,r)}const MSLEFT=1;const MSMIDDLE=2;const MSRIGHT=4;const AM_PM_UPPER=1;const AM_PM_LOWER=2;const AM_PM_NONE=false;const eventTypes={click:"MouseEvent",dblclick:"MouseEvent",mousedown:"MouseEvent",mousemove:"MouseEvent",mouseout:"MouseEvent",mouseover:"MouseEvent",mouseup:"MouseEvent",focus:"MouseEvent",blur:"MouseEvent"};const CHECK_FORM_ELEMENTS={tagName:/^INPUT|SELECT|TEXTAREA|BUTTON$/i};const util={array_values(e){if(!BX$2.type.isArray(e)){return util._array_values_ob(e)}const t=[];for(let n=0,r=e.length;n|:\\${t||""}-]`,"g"),"\\$&")},jsencode(e){if(!e||!e.replace){return e}const t=[{c:"\\\\",r:"\\\\"},{c:"\\t",r:"\\t"},{c:"\\n",r:"\\n"},{c:"\\r",r:"\\r"},{c:'"',r:'\\"'},{c:"'",r:"\\'"},{c:"<",r:"\\x3C"},{c:">",r:"\\x3E"},{c:"\\u2028",r:"\\u2028"},{c:"\\u2029",r:"\\u2029"}];for(const n of t){e=e.replace(new RegExp(n.c,"g"),n.r)}return e},getCssName(e){if(!BX$2.type.isNotEmptyString(e)){return""}return e.replaceAll(/[A-Z]/g,(e=>`-${e.toLowerCase()}`))},getJsName(e){const t=/-([a-z])/g;if(t.test(e)){return e.replaceAll(t,((e,t)=>t.toUpperCase()))}return e},nl2br(e){if(!e||!e.replace){return e}return e.replace(/([^>])\n/g,"$1
")},str_pad(e,t,n,r){n=n||" ";r=r||"right";e=e.toString();if(r==="left"){return util.str_pad_left(e,t,n)}return util.str_pad_right(e,t,n)},str_pad_left(e,t,n){return e.toString().padStart(t,n)},str_pad_right(e,t,n){return e.toString().padEnd(t,n)},strip_tags(e){return e.split(/<[^>]+>/g).join("")},strip_php_tags(e){return e.replaceAll(/<\?(.|[\n\r])*?\?>/g,"")},popup(e,t,n){const r=screen.width;const s=screen.height;return window.open(e,"",`status=no,scrollbars=yes,resizable=yes,width=${t},height=${n},top=${Math.floor((s-n)/2-14)},left=${Math.floor((r-t)/2-5)}`)},shuffle(e){let t=null;let n=0;let r=e.length;while(r!==0){n=Math.floor(Math.random()*r);r-=1;t=e[r];e[r]=e[n];e[n]=t}return e},objectSort(e,t,n){n=n=="asc"?"asc":"desc";const r=[];for(const n in e){if(Object.prototype.hasOwnProperty.call(e,n)&&e[n][t]){r.push([n,e[n][t]])}}const s=e=>{if(BX$2.type.isDate(e[1])){return e[1].getTime()}if(isNaN(e[1])){return e[1].toString().toLowerCase()}return parseInt(e[1])};if(n=="asc"){r.sort(((e,t)=>{const n=s(e);const r=s(t);if(n>r){return 1}if(n{const n=s(e);const r=s(t);if(nr){return-1}return 0}))}const i=[];for(const t of r){i.push(e[t[0]])}return i},objectMerge(){return BX$2.mergeEx.apply(window,arguments)},objectClone(e){return BX$2.clone(e,true)},hex2rgb(e){const t=e.replaceAll(/[ #]/g,"").replace(/^(.)(.)(.)$/,"$1$1$2$2$3$3").match(/.{2}/g);for(let e=0;e<3;e++){t[e]=parseInt(t[e],16)}return{r:t[0],g:t[1],b:t[2]}},remove_url_param(e,t){return BX$2.Uri.removeParam(e,t)},add_url_param(e,t){const n=Object.entries(t).reduce(((e,t)=>{e[t[0]]=BX$2.type.isArray(t[1])?t[1].join(","):t[1];return e}),{});return BX$2.Uri.addParam(e,n)},buildQueryString(e){let t="";for(const n in e){const r=e[n];if(BX$2.type.isArray(r)){r.forEach(((e,r)=>{const s=`${n}[${r}]`;t+=`${encodeURIComponent(s)}=${encodeURIComponent(e)}&`}))}else{t+=`${encodeURIComponent(n)}=${encodeURIComponent(r)}&`}}if(t.length>0){t=t.slice(0,-1)}return t},even(e){return parseInt(e)%2==0},hashCode(e){if(!BX$2.type.isNotEmptyString(e)){return 0}let t=0;for(let n=0;n3?i.length%3:0;const a=o?i.slice(0,o)+r:"";const l=i.slice(o).replaceAll(/(\d{3})(?=\d)/g,`$1${r}`);const c=t?n+Math.abs(e-i).toFixed(t).replace(/-/,"0").slice(2):"";return s+a+l+c},getExtension(e){e=e||"";const t=e.split("?")[0].split(".");return t[t.length-1].toLowerCase()},addObjectToForm(e,t,n){if(!BX$2.type.isString(n)){n=""}for(const r in e){if(!Object.prototype.hasOwnProperty.call(e,r)){continue}let s=e[r];const i=n===""?r:`${n}[${r}]`;if(BX$2.type.isArray(s)){const e={};for(let t=0;t0){return i}return null}function findParent(e,t,n){if(!e){return null}let r=e;while(r.parentNode){const e=r.parentNode;if(checkNode(e,t)){return e}r=e;if(n&&(BX$2.type.isFunction(n)||typeof n=="object")){if(BX$2.type.isElementNode(n)){if(r==n){break}}else if(checkNode(r,n)){break}}}return null}function findNextSibling(e,t){if(!e){return null}let n=e;while(n.nextSibling){const e=n.nextSibling;if(checkNode(e,t)){return e}n=e}return null}function findPreviousSibling(e,t){if(!e){return null}let n=e;while(n.previousSibling){const e=n.previousSibling;if(checkNode(e,t)){return e}n=e}return null}function findFormElements(e){if(BX$2.type.isString(e)){e=document.forms[e]||resolve(e)}let t=[];if(BX$2.type.isElementNode(e)){if(e.tagName.toUpperCase()=="FORM"){t=e.elements}else{t=findChildren(e,CHECK_FORM_ELEMENTS,true)}}return t}function isParentForNode(e,t){if(BX$2.type.isDomNode(e)&&BX$2.type.isDomNode(t)){return e.contains(t)}return false}function clearNodeCache(){return false}function createFragment(e){const t=document.createDocumentFragment();if(!BX$2.type.isArray(e)){return t}for(let n=0;n[e,Type.isString(t)?t:"window"])))}const DEFAULT_TEMPLATE_TYPES=["text/html","text/template","extension/settings","importmap"];const RUN_FIRST_ATTRIBUTE="bxrunfirst";const EMPTY_RESULT=Object.freeze({html:"",scripts:Object.freeze([]),styles:Object.freeze([]),registrations:Object.freeze({})});function extractAssets(e,t={}){if(!Type.isStringFilled(e)){return EMPTY_RESULT}const n=/]*)>/gi;const r=/<\/script(?=[\s/>])[^>]*>/gi;const s=[];const i={};const o=[];let a=0;const l=t.runFirst===true;const c=t.templateTypes??DEFAULT_TEMPLATE_TYPES;let u=n.exec(e);for(;u!==null;u=n.exec(e)){const t=u[1]??"";r.lastIndex=n.lastIndex;const p=r.exec(e);if(p===null){break}const f=readAttributes(t);const d=f.get("type")??null;if(d!==null&&c.includes(d)){n.lastIndex=r.lastIndex;continue}o.push(e.slice(a,u.index));if(d===REGISTERED_EXTENSIONS_TYPE){Object.assign(i,parseRegisteredExtensions(e.slice(n.lastIndex,p.index)));a=r.lastIndex;n.lastIndex=r.lastIndex;continue}const h=f.get("src")??null;const m=l||f.has(RUN_FIRST_ATTRIBUTE);if(Type.isStringFilled(h)){s.push({isInternal:false,src:h,runFirst:m,type:d})}else{const t=e.slice(n.lastIndex,p.index);s.push({isInternal:true,text:t,runFirst:m,type:d})}a=r.lastIndex;n.lastIndex=r.lastIndex}o.push(e.slice(a));const{html:p,styles:f}=collectStyles(o.join(""));return{html:p,scripts:s,styles:f,registrations:i}}function collectStyles(e){const t=/]*)>/gi;const n=[];const r=[];let s=0;for(let i=t.exec(e);i!==null;i=t.exec(e)){const o=readAttributes(i[1]??"");const a=o.get("href")??null;if(!isStylesheetLink(o)||!Type.isStringFilled(a)){continue}n.push({href:a,media:o.get("media")??null});r.push(e.slice(s,i.index));s=t.lastIndex}r.push(e.slice(s));return{html:r.join(""),styles:n}}function readAttributes(e){const t=/([^\s/=>]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;const n=new Map;for(let r=t.exec(e);r!==null;r=t.exec(e)){const e=r[1].toLowerCase();if(!n.has(e)){n.set(e,r[2]??r[3]??r[4]??"")}}return n}const SCREEN_MEDIA_TYPES=new Set(["all","screen"]);function appliesToScreen(e){if(e.media===null){return true}const t=e.media.toLowerCase().split(",").map((e=>e.trim())).filter((e=>e!==""));return t.length===0||t.some((e=>queryAppliesToScreen(e)))}function queryAppliesToScreen(e){const t=e.split(/\s+/);const n=t[0]==="not";if(n||t[0]==="only"){t.shift()}const r=Boolean(t[0])&&!t[0].startsWith("(");const s=SCREEN_MEDIA_TYPES.has(r?t[0]:"all");if(!n){return s}return!s||t.length>(r?1:0)}function isStylesheetLink(e){const t=(e.get("rel")??"").toLowerCase().split(/\s+/);if(t.includes("alternate")){return false}return e.get("type")==="text/css"||t.includes("stylesheet")}function processHTML(e,t){if(e===null||e===undefined){throw new TypeError("BX.processHTML: data is null or undefined")}const n=extractAssets(e,{runFirst:Boolean(t)});return{HTML:n.html,SCRIPT:n.scripts.map((e=>({bRunFirst:e.runFirst,isInternal:e.isInternal,JS:e.isInternal?e.text:e.src}))),STYLE:n.styles.filter((e=>appliesToScreen(e))).map((e=>e.href)),REGISTRATIONS:n.registrations}}function parseJSON(data,context){let result=null;if(BX$2.type.isNotEmptyString(data)){try{if(data.indexOf("\n")>=0){eval(`result = ${data}`)}else{result=new Function(`return ${data}`)()}}catch(e){BX$2.onCustomEvent(context,"onParseJSONFailure",[data,context])}}else if(BX$2.type.isPlainObject(data)){return data}return result}function evalPack(e){while(e.length>0){const t=e.shift();if(t.TYPE=="SCRIPT_EXT"||t.TYPE=="SCRIPT_SRC"){BX$2.loadScript(t.DATA,(function(){evalPack(e)}));return}else if(t.TYPE=="SCRIPT"){evalGlobal(t.DATA)}}}function evalGlobal(e){if(e){const t=document.getElementsByTagName("head")[0]||document.documentElement;const n=document.createElement("script");n.type="text/javascript";n.appendChild(document.createTextNode(e));t.insertBefore(n,t.firstChild);t.removeChild(n)}}function template(e,t,n){BX$2.ready((function(){_processTpl(resolve(e),t,n)}))}function _processTpl(e,t,n){if(e){if(n){e.parentNode.removeChild(e)}const r={};const s=findChildren(e,{attribute:"data-role"},true);for(let e=0,t=s.length;e{message$1[t]=e[t]}))}return undefined};if(!Type.isNil(window.BX)&&Type.isFunction(window.BX.message)){Object.keys(window.BX.message).forEach((e=>{message$1({[e]:window.BX.message[e]})}))}class Loc{static getMessage(e,t=null){let n=message$1(e);if(Type.isString(n)&&Type.isPlainObject(t)){const e=e=>String(e).replaceAll(/[$()*+.?[\\\]^{|}]/g,"\\$&");Object.keys(t).forEach((r=>{const s=new RegExp(e(r),"gi");n=n.replaceAll(s,(()=>Type.isNil(t[r])?"":String(t[r])))}))}return n}static hasMessage(e){return Type.isString(e)&&!Type.isNil(message$1[e])}static setMessage(e,t){if(Type.isString(e)&&Type.isString(t)){message$1({[e]:t})}if(Type.isObject(e)){message$1(e)}}static getMessagePlural(e,t,n=null){let r="";if(Type.isNumber(t)){if(this.hasMessage(`${e}_PLURAL_${this.getPluralForm(t)}`)){r=this.getMessage(`${e}_PLURAL_${this.getPluralForm(t)}`,n)}else{r=this.getMessage(`${e}_PLURAL_1`,n)}}else{r=this.getMessage(e,n)}return r}static getPluralForm(e,t){let n=1;let r=t;if(!Type.isStringFilled(r)){r=message$1("LANGUAGE_ID")}const s=Math.abs(Math.trunc(e));switch(r){case"ar":if(s===0){n=0}else if(s===1||s%100===0){n=1}else if(s===2){n=2}else if(s%100>=3&&s%100<=10){n=3}else{n=4}break;case"br":case"fr":case"tr":n=s>1?1:0;break;case"de":case"en":case"hi":case"it":case"la":n=s===1?0:1;break;case"ru":case"ua":if(s%10===1&&s%100!==11){n=0}else if(s%10>=2&&s%10<=4&&(s%100<10||s%100>=20)){n=1}else{n=2}break;case"pl":if(s===1){n=0}else if(s%10>=2&&s%10<=4&&(s%100<10||s%100>=20)){n=1}else{n=2}break;case"id":case"ja":case"ms":case"sc":case"tc":case"th":case"vn":n=0;break;default:n=1;break}return n}}const ajaxController="main.bitrix.main.controller.loadext.resolveextensions";function loadAssets(e){return new Promise(((t,n)=>{const r=e?.extension||[];const s={extension:r,coreLoaded:e?.coreLoaded===true?"Y":"N",loadedExtension:e?.loadedExtension||[]};const i={e:r.join(",")};BX.ajax.runAction(ajaxController,{data:s,getParameters:i}).then((e=>{t(e?.data)})).catch((e=>{n(e)}))}))}const coreExtensionName="main.core";const registeredNames=new Set;const consumedScripts=new WeakSet;let documentParsed=false;function isCoreRegistered(){return registeredNames.has(coreExtensionName)}function getRegisteredNames(){return[...registeredNames]}function markRegistered(e){if(typeof e==="string"&&e!==""){registeredNames.add(e)}}function registerExtension(e){markRegistered(e?.name);if(!extensionsStorage.has(e.name)){const t=e?.namespace??"window";extensionsStorage.set(e.name,Promise.resolve(t))}}function registerInActiveRuntime(e){const t=window.BX?.Runtime;Object.entries(e).forEach((([e,n])=>{if(typeof t?.registerExtension==="function"){t.registerExtension({name:e,namespace:n})}else{registerExtension({name:e,namespace:n})}markRegistered(e)}))}function registerFromDocument(){if(documentParsed){return}documentParsed=document.readyState!=="loading";document.querySelectorAll(`script[type="${REGISTERED_EXTENSIONS_TYPE}"]`).forEach((e=>{if(!consumedScripts.has(e)){consumedScripts.add(e);Object.entries(parseRegisteredExtensions(e.textContent??"")).forEach((([e,t])=>{registerExtension({name:e,namespace:t})}))}}))}if(typeof document!=="undefined"&&document.readyState==="loading"){document.addEventListener("DOMContentLoaded",(()=>registerFromDocument()),{once:true})}function waitOnline(){return new Promise((e=>{Event.bindOnce(window,"online",(()=>e()))}))}const TIMEOUTS=[1e3,3e3,5e3];async function tryLoad(e,t){for(let n=0;n<=TIMEOUTS.length;n++){try{return await t()}catch{if(navigator.onLine===false){console.warn(`Wait online for load ${e.join(", ")}`);await waitOnline();n--;continue}if(n===TIMEOUTS.length){throw new Error(`${e.join(", ")} loading failed...`)}const t=TIMEOUTS[n];const r=n+1;console.warn(`Retry load #${r}: ${e.join(", ")}`);await new Promise((e=>{setTimeout(e,t)}))}}throw new Error("Unexpected end of retry loop")}function DataStorage(){this.keyOffset=1;this.data={};this.uniqueTag=`BX-${Math.random()}`;this.resolve=function(e,t){if(typeof e[this.uniqueTag]=="undefined"){if(t){try{Object.defineProperty(e,this.uniqueTag,{value:this.keyOffset++})}catch(t){e[this.uniqueTag]=this.keyOffset++}}else{return undefined}}return e[this.uniqueTag]};this.get=function(e,t){if(e!=document&&!BX$2.type.isElementNode(e)||typeof t=="undefined"){return undefined}e=this.resolve(e,false);if(typeof e=="undefined"||typeof this.data[e]=="undefined"){return undefined}return this.data[e][t]};this.set=function(e,t,n){if(e!=document&&!BX$2.type.isElementNode(e)||typeof n=="undefined"){return}const r=this.resolve(e,true);if(typeof this.data[r]=="undefined"){this.data[r]={}}this.data[r][t]=n}}const dataStorage=new DataStorage;function data(e,t,n){if(typeof e=="undefined"){return undefined}if(typeof t=="undefined"){return undefined}if(typeof n!="undefined"){dataStorage.set(e,t,n)}else{let n;if((n=dataStorage.get(e,t))!=undefined){return n}if("getAttribute"in e){n=e.getAttribute(`data-${t.toString()}`);if(n===null){return undefined}return n}return undefined}return undefined}const deniedEvents=[];function getEventButton(e){e=e||window.event;let t=0;if(typeof e.which!="undefined"){switch(e.which){case 1:t|=BX$2.MSLEFT;break;case 2:t|=BX$2.MSMIDDLE;break;case 3:t|=BX$2.MSRIGHT;break}}else if(typeof e.button!="undefined"){t=window.event.button}return t||BX$2.MSLEFT}let captured_events=null;let _bind=null;function CaptureEvents(e,t){if(_bind){return}_bind=BX$2.bind;captured_events=[];BX$2.bind=function(n,r,s){if(n===e&&r===t){captured_events.push(s)}_bind.apply(this,arguments)}}function CaptureEventsGet(){if(_bind){BX$2.bind=_bind;const e=captured_events;_bind=null;captured_events=null;return e}return null}function fireEvent(e,t){let n=false;let r=null;if(BX$2.type.isDomNode(e)){switch(eventTypes[t]){case"MouseEvent":r=document.createEvent("MouseEvent");try{r.initMouseEvent(t,true,true,top,1,0,0,0,0,0,0,0,0,0,null)}catch(e){r.initMouseEvent(t,true,true,window,1,0,0,0,0,0,0,0,0,0,null)}break;default:r=document.createEvent("Event");r.initEvent(t,true,true)}n=e.dispatchEvent(r)}return n}function getWheelData(e){e=e||window.event;e.wheelData=e.detail?e.detail*-1:e.wheelDelta/40;return e.wheelData}function False(){return false}function DoNothing(){}function denyEvent(e,t){deniedEvents.push([e,t,e[`on${t}`]]);e[`on${t}`]=DoNothing}function allowEvent(e,t){for(let n=0,r=deniedEvents.length;n{};return loadAsync(e,t,n,r)}function loadAsync(e,t,n,r){if(!BX$2.type.isArray(e)){t();return}function s(e){if(e){delete a[e.name]}const l=o.shift();if(l){loadSingleAsset(l,s,n,r)}else if(i()){t()}}function i(){for(const e in a){if(a[e].state!==LOADED){return false}}return true}const o=[];const a={};e.forEach((e=>{const t=getAsset(e);if(t&&t.state!==LOADED&&!o.includes(t)){o.push(t);a[t.name]=t}}));if(o.length>0){const e=6;const t=Math.min(o.length,e);const i=o.splice(0,t);i.forEach((e=>{loadSingleAsset(e,s,n,r)}))}else{t()}}function loadSingleAsset(e,t,n,r){t=t||DoNothing;if(e.state===LOADED){t();return}if(e.state===FAILED){if(BX$2.Type.isFunction(r)){r()}else{t(e)}return}if(e.state===LOADING){if(!BX$2.Type.isArray(loadingAssetCallbacks[e.name])){loadingAssetCallbacks[e.name]=[]}loadingAssetCallbacks[e.name].push({callback:t,reject:r});return}e.state=LOADING;const s=()=>{const t=loadingAssetCallbacks[e.name]||[];e.state=FAILED;delete assets[e.name];delete loadingAssetCallbacks[e.name];r();for(const n of t){if(!BX$2.Type.isFunction(n.reject)){n.callback(e)}else{n.reject()}}};loadAsset(e,(function(){e.state=LOADED;t();if(BX$2.Type.isArrayFilled(loadingAssetCallbacks[e.name])){for(const t of loadingAssetCallbacks[e.name]){t.callback()}}delete loadingAssetCallbacks[e.name]}),n,BX$2.Type.isFunction(r)?s:null)}function loadAsset(e,t,n,r){t=t||DoNothing;function s(n){window.clearTimeout(e.errorTimeout);window.clearTimeout(e.cssTimeout);a.onload=a.onerror=null;if(BX$2.Type.isFunction(r)){r()}else{t()}}function i(n){if(l==="css"){cssList.push(normalizeMinUrl(normalizeUrl(e.url)))}else{jsList.push(normalizeMinUrl(normalizeUrl(e.url)))}n=n||window.event;if(n.type==="load"){window.clearTimeout(e.errorTimeout);window.clearTimeout(e.cssTimeout);a.onload=a.onerror=null;t()}}function o(){if(e.state!==LOADED&&e.cssRetries<=20){for(let e=0,t=n.styleSheets.length;e=0?e.substr(0,t)+e.substr(t+4):e}function isCssLoaded(e){initCssList();e=normalizeUrl(e);const t=normalizeMinUrl(e);return e!==t&&util.in_array(t,cssList)||util.in_array(e,cssList)}function initCssList(){if(!cssInit){const e=document.getElementsByTagName("link");if(!!e&&e.length>0){for(let t=0;t0){for(let t=0;t{load(t,e,document,n)}))}function isNotEmptyObject(e){return Type.isPlainObject(e)&&Object.keys(e).length>0}function hasSettings(e){return Type.isArrayFilled(e)||isNotEmptyObject(e)}function appendSettingsTag(e){const t=document.createElement("script");t.type="extension/settings";t.dataset.extension=e.extension;t.textContent=JSON.stringify(e.settings).replaceAll("<","\\u003C");document.head.append(t)}function collect(e,t){return e.flatMap((e=>e[t]??[]))}function collectCoreIncludes(e,t){return e.flatMap((e=>e.coreIncludes?.[t]??[]))}function findNamespace(e,t){const n=e.find((e=>e.extension===t));return n?n.namespace:null}async function applyExtensions(e,t,n=loadAll,r=tryLoad){e.forEach((e=>{if(isNotEmptyObject(e.messages)){Loc.setMessage(e.messages)}if(hasSettings(e.settings)){appendSettingsTag(e)}}));const s=collect(e,"js");const i=collect(e,"css");const o=collectCoreIncludes(e,"js");const a=collectCoreIncludes(e,"css");const l=[...t.keys()];try{await Promise.all([r(l,(()=>n(s))),r(l,(()=>n(i)))])}catch(e){t.forEach((t=>t.reject(e)));return}registerAssetsAsLoaded(o,a);registerInActiveRuntime(Object.fromEntries(e.map((e=>[e.extension,e.namespace??"window"]))));t.forEach(((t,n)=>{t.resolve(findNamespace(e,n)??"window")}))}async function processExtensions(e,t=loadAssets,n=tryLoad){const r=[...e.keys()];registerFromDocument();const s=isCoreRegistered();const i=getRegisteredNames();let o=[];try{o=await n(r,(()=>t({extension:r,coreLoaded:s,loadedExtension:i})))??[]}catch(t){e.forEach((e=>e.reject(t)));return}try{await applyExtensions(o,e,loadAll,n)}catch(t){e.forEach((e=>e.reject(t)))}}const queue=new Map;let timerId=null;async function loadExtension(...e){if(Type.isNumber(timerId)){clearTimeout(timerId)}registerFromDocument();const t=e.flat();const n=t.filter((e=>!extensionsStorage.has(e)));n.forEach((e=>{let t=null;let n=null;const r=new Promise(((e,r)=>{t=e;n=r}));const s=t=>{if(extensionsStorage.get(e)===r){extensionsStorage.delete(e)}n(t)};const i={promise:r,resolve:t,reject:s};extensionsStorage.set(e,i.promise);queue.set(e,i)}));timerId=setTimeout((()=>{if(queue.size>0){void processExtensions(new Map(queue.entries()));queue.clear()}}));const r=await Promise.all(t.map((e=>extensionsStorage.get(e))));return r.reduce(((e,t)=>({...e,...Reflection.getClass(t)})),{})}const cloneableTags=new Set(["[object Object]","[object Array]","[object RegExp]","[object Arguments]","[object Date]","[object Error]","[object Map]","[object Set]","[object ArrayBuffer]","[object DataView]","[object Float32Array]","[object Float64Array]","[object Int8Array]","[object Int16Array]","[object Int32Array]","[object Uint8Array]","[object Uint16Array]","[object Uint32Array]","[object Uint8ClampedArray]"]);function isCloneable(e){const t=Type.isObjectLike(e)&&cloneableTags.has(getTag(e));return t||Type.isDomNode(e)}function internalClone(e,t){if(t.has(e)){return t.get(e)}if(isCloneable(e)){if(Type.isArray(e)){return cloneArray(e,t)}if(Type.isDomNode(e)){return e.cloneNode(true)}if(Type.isMap(e)){return cloneMap(e,t)}if(Type.isSet(e)){return cloneSet(e,t)}if(Type.isDate(e)){return new Date(e)}if(Type.isRegExp(e)){return cloneRegExp(e)}const n=Object.getPrototypeOf(e);const r=Object.assign(Object.create(n),e);t.set(e,r);Object.keys(e).forEach((n=>{r[n]=internalClone(e[n],t)}));return r}return e}function cloneArray(e,t){const n=[...e];t.set(e,n);e.forEach(((e,r)=>{n[r]=internalClone(e,t)}));return t.get(e)}function cloneMap(e,t){const n=new Map;t.set(e,n);e.forEach(((e,r)=>{n.set(internalClone(r,t),internalClone(e,t))}));return n}function cloneSet(e,t){const n=new Set;t.set(e,n);e.forEach((e=>{n.add(internalClone(e,t))}));return n}function cloneRegExp(e){const t=/\w*$/;const n=t.exec(e);let r=new RegExp(e.source);if(n&&Type.isArray(n)){r=new RegExp(e.source,n[0])}r.lastIndex=e.lastIndex;return r}function clone$1(e){return internalClone(e,new WeakMap)}function merge$1(e,t){return Object.entries(t).reduce(((e,[t,n])=>{if(!Type.isDomNode(e[t])&&Type.isObjectLike(e[t])&&Type.isObjectLike(n)){e[t]=merge$1(e[t],n);return e}e[t]=n;return e}),e)}function createComparator(e,t=[]){return(n,r)=>{const s=e[0];const i=t[0]||"asc";if(Type.isUndefined(s)){return 0}let o=n[s];let a=r[s];if(Type.isString(o)&&Type.isString(a)){o=o.toLowerCase();a=a.toLowerCase()}if(oa){return i==="asc"?1:-1}return createComparator(e.slice(1),t.slice(1))(n,r)}}class Runtime{static debug=debug$1;static extractAssets=extractAssets;static loadExtension=loadExtension;static registerExtension=registerExtension;static clone=clone$1;static debounce(e,t=0,n=null){let r=null;return function s(...i){if(Type.isNumber(r)){clearTimeout(r)}r=setTimeout((()=>{e.apply(n||this,i)}),t)}}static throttle(e,t=0,n=null){let r=null;let s=false;return function i(...o){s=true;if(!r){const i=function i(){if(s){e.apply(n||this,o);s=false;r=setTimeout(i,t)}else{r=null}};i()}}}static html(e,t,n={}){if(Type.isNil(t)&&Type.isDomNode(e)){return e.innerHTML}const r=extractAssets(t);const s=r.styles.filter((e=>appliesToScreen(e))).map((e=>({url:e.href,ext:"css"})));const i=r.scripts.filter((e=>!e.isInternal)).map((e=>e.src));const o=r.scripts.filter((e=>e.isInternal)).map((e=>e.text));if(Type.isDomNode(e)&&(n.htmlFirst||i.length===0&&s.length===0)){if(n.useAdjacentHTML){e.insertAdjacentHTML("beforeend",r.html)}else{e.innerHTML=r.html}}return Promise.all([loadAll(i),loadAll(s)]).then((()=>{if(Type.isDomNode(e)&&(i.length>0||s.length>0)){if(n.useAdjacentHTML){e.insertAdjacentHTML("beforeend",r.html)}else{e.innerHTML=r.html}}registerInActiveRuntime(r.registrations);o.forEach((e=>evalGlobal(e)));if(Type.isFunction(n.callback)){n.callback()}}))}static merge(...e){if(Type.isArray(e[0])){e.unshift([])}else if(Type.isObject(e[0])){e.unshift({})}return e.reduce(((e,t)=>merge$1(e,t)),e[0])}static orderBy(e,t=[],n=[]){const r=createComparator(t,n);return Object.values(e).sort(r)}static destroy(e,t="Object is destroyed"){if(Type.isObject(e)){const n=()=>{throw new Error(t)};const r=Object.keys(e);const s=(()=>{const t=Object.getPrototypeOf(e);if(Type.isObject(t)){return Object.getOwnPropertyNames(t)}return[]})();const i=[...new Set([...r,...s])];i.filter((t=>{const n=Object.getOwnPropertyDescriptor(e,t);return!/__(.+)__/.test(t)&&(!Type.isObject(n)||n.configurable===true)})).forEach((t=>{Object.defineProperty(e,t,{get:n,set:n,configurable:false})}));Object.setPrototypeOf(e,null)}}}class EventStore{defaultMaxListeners;eventStore=new WeakMap;constructor(e={}){this.defaultMaxListeners=Type.isNumber(e.defaultMaxListeners)?e.defaultMaxListeners:10}add(e,t={}){const n=this.getRecordScheme();if(Type.isNumber(t.maxListeners)){n.maxListeners=t.maxListeners}this.eventStore.set(e,n);return n}get(e){return this.eventStore.get(e)}getOrAdd(e,t={}){return this.get(e)||this.add(e,t)}delete(e){this.eventStore.delete(e)}getRecordScheme(){return{eventsMap:new Map,onceMap:new Map,maxListeners:this.getDefaultMaxListeners(),eventsMaxListeners:new Map}}getDefaultMaxListeners(){return this.defaultMaxListeners}}class WarningStore{warnings=new Map;printDelayed;constructor(){this.printDelayed=Runtime.debounce(this.print.bind(this),500)}add(e,t,n){let r=this.warnings.get(e);if(!r){r=Object.create(null);this.warnings.set(e,r)}if(!r[t]){r[t]={}}r[t].size=n.size;if(!Type.isArray(r[t].errors)){r[t].errors=[]}r[t].errors.push(new Error("EventEmitter warning"))}print(){this.warnings.forEach((e=>{for(const t of Object.keys(e)){console.groupCollapsed("Possible BX.Event.EventEmitter memory leak detected. "+`${e[t].size} "${t}" listeners added. `+"Use emitter.setMaxListeners() to increase limit.");console.dir(e[t].errors);console.groupEnd()}}));this.clear()}clear(){this.warnings.clear()}}const eventStore=new EventStore({defaultMaxListeners:10});const warningStore=new WarningStore;const aliasStore=new Map;const globalTarget={GLOBAL_TARGET:"GLOBAL_TARGET"};eventStore.add(globalTarget,{maxListeners:25});const isEmitterProperty=Symbol.for("BX.Event.EventEmitter.isEmitter");const namespaceProperty=Symbol("namespaceProperty");const targetProperty=Symbol("targetProperty");let EventEmitter=function(){function e(...t){babelHelpers.classCallCheck(this,e);this[targetProperty]=null;this[namespaceProperty]=null;this[isEmitterProperty]=true;let n=this;if(Object.getPrototypeOf(this)===e.prototype&&t.length>0){if(!Type.isObject(t[0])){throw new TypeError('The "target" argument must be an object.')}n=t[0];this.setEventNamespace(t[1])}this[targetProperty]=n}return babelHelpers.createClass(e,[{key:"setEventNamespace",value:function e(t){if(Type.isStringFilled(t)){this[namespaceProperty]=t}}},{key:"getEventNamespace",value:function e(){return this[namespaceProperty]}},{key:"subscribe",value:function t(n,r){e.subscribe(this,n,r);return this}},{key:"subscribeFromOptions",value:function t(n,r,s){if(Type.isArrayFilled(n)){n.forEach((e=>{this.subscribeFromOptions(e,r,s)}));return}if(!Type.isPlainObject(n)){return}const i=Type.isPlainObject(r)?e.normalizeAliases(r):{};const o=n;Object.keys(o).forEach((t=>{const n=e.normalizeListener(o[t]);t=e.normalizeEventName(t);if(i[t]){const{eventName:r}=i[t];e.subscribe(this,r,n,{compatMode:s!==false})}else{e.subscribe(this,t,n,{compatMode:s===true})}}))}},{key:"subscribeOnce",value:function t(n,r){e.subscribeOnce(this,n,r);return this}},{key:"unsubscribe",value:function t(n,r){e.unsubscribe(this,n,r);return this}},{key:"unsubscribeAll",value:function t(n){e.unsubscribeAll(this,n)}},{key:"emit",value:function t(n,r){if(this.getEventNamespace()===null){console.warn("The instance of BX.Event.EventEmitter is supposed to have an event namespace. "+"Use emitter.setEventNamespace() to make events more unique.")}e.emit(this,n,r);return this}},{key:"emitAsync",value:function t(n,r){if(this.getEventNamespace()===null){console.warn("The instance of BX.Event.EventEmitter is supposed to have an event namespace. "+"Use emitter.setEventNamespace() to make events more unique.")}return e.emitAsync(this,n,r)}},{key:"setMaxListeners",value:function t(...n){e.setMaxListeners(this,...n);return this}},{key:"getMaxListeners",value:function t(n){return e.getMaxListeners(this,n)}},{key:"incrementMaxListeners",value:function t(...n){return e.incrementMaxListeners(this,...n)}},{key:"decrementMaxListeners",value:function t(...n){return e.decrementMaxListeners(this,...n)}},{key:"getListeners",value:function t(n){return e.getListeners(this,n)}},{key:"getFullEventName",value:function t(n){if(!Type.isStringFilled(n)){throw new TypeError('The "eventName" argument must be a string.')}return e.makeFullEventName(this.getEventNamespace(),n)}}],[{key:"makeObservable",value:function t(n,r){if(!Type.isObject(n)){throw new TypeError('The "target" argument must be an object.')}if(!Type.isStringFilled(r)){throw new TypeError('The "namespace" must be an non-empty string.')}if(e.isEventEmitter(n)){throw new TypeError('The "target" is an event emitter already.')}const s=Object.getPrototypeOf(n);const i=new e;i.setEventNamespace(r);Object.setPrototypeOf(i,s);Object.setPrototypeOf(n,i);Object.getOwnPropertyNames(e.prototype).forEach((t=>{if(["constructor"].includes(t)){return}i[t]=function(...r){return e.prototype[t].apply(n,r)}}))}},{key:"subscribe",value:function e(t,n,r,s){if(Type.isString(t)){s=r;r=n;n=t;t=this.GLOBAL_TARGET}if(!Type.isObject(t)){throw new TypeError('The "target" argument must be an object.')}n=this.normalizeEventName(n);if(!Type.isStringFilled(n)){throw new TypeError('The "eventName" argument must be a string.')}r=this.normalizeListener(r);s=Type.isPlainObject(s)?s:{};const i=this.resolveEventName(n,t,s.useGlobalNaming===true);const{eventsMap:o,onceMap:a}=eventStore.getOrAdd(t);const l=a.get(i);let c=o.get(i);if(c&&c.has(r)||l&&l.has(r)){console.error(`You cannot subscribe the same "${i}" event listener twice.`)}else if(c){c.set(r,{listener:r,options:s,sort:this.getNextSequenceValue()})}else{c=new Map([[r,{listener:r,options:s,sort:this.getNextSequenceValue()}]]);o.set(i,c)}const u=this.getMaxListeners(t,n);if(c.size>u){warningStore.add(t,i,c);warningStore.printDelayed()}}},{key:"subscribeOnce",value:function e(t,n,r){if(Type.isString(t)){r=n;n=t;t=this.GLOBAL_TARGET}if(!Type.isObject(t)){throw new TypeError('The "target" argument must be an object.')}n=this.normalizeEventName(n);if(!Type.isStringFilled(n)){throw new TypeError('The "eventName" argument must be a string.')}r=this.normalizeListener(r);const s=this.resolveEventName(n,t);const{eventsMap:i,onceMap:o}=eventStore.getOrAdd(t);const a=i.get(s);let l=o.get(s);if(a&&a.has(r)||l&&l.has(r)){console.error(`You cannot subscribe the same "${s}" event listener twice.`)}else{const e=(...s)=>{this.unsubscribe(t,n,e);l.delete(r);r(...s)};if(l){l.set(r,e)}else{l=new Map([[r,e]]);o.set(s,l)}this.subscribe(t,n,e)}}},{key:"unsubscribe",value:function e(t,n,r,s){if(Type.isString(t)){r=n;n=t;t=this.GLOBAL_TARGET}n=this.normalizeEventName(n);if(!Type.isStringFilled(n)){throw new TypeError('The "eventName" argument must be a string.')}r=this.normalizeListener(r);s=Type.isPlainObject(s)?s:{};const i=this.resolveEventName(n,t,s.useGlobalNaming===true);const o=eventStore.get(t);const a=o&&o.eventsMap.get(i);const l=o&&o.onceMap.get(i);if(a){a.delete(r)}if(l){const e=l.get(r);if(e){l.delete(r);a.delete(e)}}}},{key:"unsubscribeAll",value:function e(t,n,r){if(Type.isString(t)){n=t;t=this.GLOBAL_TARGET}if(Type.isStringFilled(n)){const e=eventStore.get(t);if(e){r=Type.isPlainObject(r)?r:{};const s=this.resolveEventName(n,t,r.useGlobalNaming===true);e.eventsMap.delete(s);e.onceMap.delete(s)}}else if(Type.isNil(n)){if(t===this.GLOBAL_TARGET){console.error("You cannot unsubscribe all global listeners.")}else{eventStore.delete(t)}}}},{key:"emit",value:function e(t,n,r,s){if(Type.isString(t)){s=r;r=n;n=t;t=this.GLOBAL_TARGET}if(!Type.isObject(t)){throw new TypeError('The "target" argument must be an object.')}n=this.normalizeEventName(n);if(!Type.isStringFilled(n)){throw new TypeError('The "eventName" argument must be a string.')}s=Type.isPlainObject(s)?s:{};const i=this.resolveEventName(n,t,s.useGlobalNaming===true);const o=eventStore.get(this.GLOBAL_TARGET);const a=o&&o.eventsMap.get(i)||new Map;let l=new Set;if(t!==this.GLOBAL_TARGET){const e=eventStore.get(t);l=e&&e.eventsMap.get(i)||new Map}const c=[...a.values(),...l.values()];c.sort(((e,t)=>e.sort-t.sort));const u=this.prepareEvent(t,i,r);const p=[];for(const{listener:e,options:n}of c){if(u.isImmediatePropagationStopped()){break}if(a.has(e)||l.has(e)){let r=null;if(n.compatMode){const n=u.getCompatData();const i=n===null?[u]:s.cloneData===true?Runtime.clone(n):n;const o=Type.isUndefined(s.thisArg)?t:s.thisArg;r=e.apply(o,i)}else{r=Type.isUndefined(s.thisArg)?e(u):e.call(s.thisArg,u)}p.push(r)}}return p}},{key:"emitAsync",value:function e(t,n,r){if(Type.isString(t)){r=n;n=t;t=this.GLOBAL_TARGET}return Promise.all(this.emit(t,n,r))}},{key:"prepareEvent",value:function e(t,n,r){const s=r instanceof BaseEvent?r:new BaseEvent;if(!(r instanceof BaseEvent)){s.setData(r)}s.setTarget(this.isEventEmitter(t)?t[targetProperty]:t);s.setType(n);return s}},{key:"getNextSequenceValue",value:function e(){return this.sequenceValue++}},{key:"setMaxListeners",value:function e(...t){let n=this.GLOBAL_TARGET;let r=null;let s=null;if(t.length===1){s=t[0]}else if(t.length===2){if(Type.isString(t[0])){[r,s]=t}else{[n,s]=t}}else if(t.length>=3){[n,r,s]=t}if(!Type.isObject(n)){throw new TypeError('The "target" argument must be an object.')}if(r!==null&&!Type.isStringFilled(r)){throw new TypeError('The "eventName" argument must be a string.')}if(!Type.isNumber(s)||s<0){throw new TypeError(`The value of "count" is out of range. It must be a non-negative number. Received ${s}.`)}const i=eventStore.getOrAdd(n);if(Type.isStringFilled(r)){const e=this.resolveEventName(r,n);i.eventsMaxListeners.set(e,s)}else{i.maxListeners=s}}},{key:"getMaxListeners",value:function e(t,n){if(Type.isString(t)){n=t;t=this.GLOBAL_TARGET}else if(Type.isNil(t)){t=this.GLOBAL_TARGET}if(!Type.isObject(t)){throw new TypeError('The "target" argument must be an object.')}const r=eventStore.get(t);if(r){let e=r.maxListeners;if(Type.isStringFilled(n)){const s=this.resolveEventName(n,t);e=r.eventsMaxListeners.get(s)||e}return e}return this.DEFAULT_MAX_LISTENERS}},{key:"addMaxListeners",value:function t(...n){const[r,s,i]=this.destructMaxListenersArgs(...n);const o=Math.max(this.getMaxListeners(r,s)+i,0);if(Type.isStringFilled(s)){e.setMaxListeners(r,s,o)}else{e.setMaxListeners(r,o)}return o}},{key:"incrementMaxListeners",value:function e(...t){const[n,r,s]=this.destructMaxListenersArgs(...t);return this.addMaxListeners(n,r,Math.abs(s))}},{key:"decrementMaxListeners",value:function e(...t){const[n,r,s]=this.destructMaxListenersArgs(...t);return this.addMaxListeners(n,r,-Math.abs(s))}},{key:"destructMaxListenersArgs",value:function e(...t){let n=null;let r=1;let s=this.GLOBAL_TARGET;if(t.length===1){if(Type.isNumber(t[0])){r=t[0]}else if(Type.isString(t[0])){n=t[0]}else{s=t[0]}}else if(t.length===2){if(Type.isString(t[0])){[n,r]=t}else if(Type.isString(t[1])){[s,n]=t}else{[s,r]=t}}else if(t.length>=3){[s,n,r]=t}if(!Type.isObject(s)){throw new TypeError('The "target" argument must be an object.')}if(n!==null&&!Type.isStringFilled(n)){throw new TypeError('The "eventName" argument must be a string.')}if(!Type.isNumber(r)){throw new TypeError('The value of "increment" must be a number.')}return[s,n,r]}},{key:"getListeners",value:function e(t,n){if(Type.isString(t)){n=t;t=this.GLOBAL_TARGET}if(!Type.isObject(t)){throw new TypeError('The "target" argument must be an object.')}n=this.normalizeEventName(n);if(!Type.isStringFilled(n)){throw new TypeError('The "eventName" argument must be a string.')}const r=eventStore.get(t);if(!r){return new Map}const s=this.resolveEventName(n,t);return r.eventsMap.get(s)||new Map}},{key:"registerAliases",value:function t(n){const r=this.normalizeAliases(n);Object.keys(r).forEach((e=>{aliasStore.set(e,{eventName:r[e].eventName,namespace:r[e].namespace})}));e.mergeEventAliases(r)}},{key:"normalizeAliases",value:function e(t){if(!Type.isPlainObject(t)){throw new TypeError('The "aliases" argument must be an object.')}const n=t;const r=Object.create(null);for(const e of Object.keys(n)){if(!Type.isStringFilled(e)){throw new TypeError("The alias must be an non-empty string.")}const t=n[e];if(!t||!Type.isStringFilled(t.eventName)||!Type.isStringFilled(t.namespace)){throw new TypeError('The alias options must set the "eventName" and the "namespace".')}const s=this.normalizeEventName(e);r[s]={eventName:t.eventName,namespace:t.namespace}}return r}},{key:"mergeEventAliases",value:function e(t){const n=eventStore.get(this.GLOBAL_TARGET);if(!n){return}Object.keys(t).forEach((e=>{const r=t[e];e=this.normalizeEventName(e);const s=this.makeFullEventName(r.namespace,r.eventName);const i=n.eventsMap.get(e);if(i){const t=n.eventsMap.get(s)||new Map;n.eventsMap.set(s,new Map([...t,...i]));n.eventsMap.delete(e)}const o=n.onceMap.get(e);if(o){const t=n.onceMap.get(s)||new Map;n.onceMap.set(s,new Map([...t,...o]));n.onceMap.delete(e)}const a=n.eventsMaxListeners.get(e);if(a){const t=n.eventsMaxListeners.get(s)||0;n.eventsMaxListeners.set(s,Math.max(t,a));n.eventsMaxListeners.delete(e)}}))}},{key:"isEventEmitter",value:function e(t){return Type.isObject(t)&&t[isEmitterProperty]===true}},{key:"normalizeEventName",value:function e(t){if(!Type.isStringFilled(t)){return""}return t.toLowerCase()}},{key:"normalizeListener",value:function e(t){if(Type.isString(t)){t=Reflection.getClass(t)}if(!Type.isFunction(t)){throw new TypeError(`The "listener" argument must be of type Function. Received type ${typeof t}.`)}return t}},{key:"resolveEventName",value:function e(t,n,r=false){t=this.normalizeEventName(t);if(!Type.isStringFilled(t)){return""}if(this.isEventEmitter(n)&&r!==true){if(n.getEventNamespace()!==null&&t.includes(".")){console.warn(`Possible the wrong event name "${t}".`)}t=n.getFullEventName(t)}else if(aliasStore.has(t)){const{namespace:e,eventName:n}=aliasStore.get(t);t=this.makeFullEventName(e,n)}return t}},{key:"makeFullEventName",value:function e(t,n){const r=Type.isStringFilled(t)?`${t}:${n}`:n;return Type.isStringFilled(r)?r.toLowerCase():""}}])}();babelHelpers.defineProperty(EventEmitter,"GLOBAL_TARGET",globalTarget);babelHelpers.defineProperty(EventEmitter,"DEFAULT_MAX_LISTENERS",eventStore.getDefaultMaxListeners());babelHelpers.defineProperty(EventEmitter,"sequenceValue",1);let stack=[];exports.isReady=false;function ready$1(e){if(!Type.isFunction(e)){return}if(exports.isReady){e()}else{stack.push(e)}}bindOnce$1(document,"DOMContentLoaded",(()=>{exports.isReady=true;stack.forEach((e=>{e()}));stack=[]}));function getEventListeners(e,t){const n=[];if(Type.isEventTargetLike(e)){const r=registry.get(e);if(r[t]){r[t].forEach((e=>{n.push({type:t,listener:e})}))}}return n}class Event{static bind=bind$1;static bindOnce=bindOnce$1;static unbind=unbind$1;static unbindAll=unbindAll$1;static ready=ready$1;static getEventListeners=getEventListeners;static EventEmitter=EventEmitter;static BaseEvent=BaseEvent}function encodeAttributeValue(e){if(Type.isPlainObject(e)||Type.isArray(e)){return JSON.stringify(e)}return Text.encode(Text.decode(e))}function decodeAttributeValue(e){if(Type.isString(e)){const t=Text.decode(e);let n=null;try{n=JSON.parse(t)}catch{n=t}if(n===t&&/^[\d.]+\.?\d+$/.test(n)){return Number(n)}if(n==="true"||n==="false"){return Boolean(n)}return n}return e}function getPageScroll(){const{documentElement:e,body:t}=document;const n=Math.max(window.pageYOffset||0,e?e.scrollTop:0,t?t.scrollTop:0);const r=Math.max(window.pageXOffset||0,e?e.scrollLeft:0,t?t.scrollLeft:0);return{scrollTop:n,scrollLeft:r}}class Dom{static replace(e,t){if(Type.isDomNode(e)&&Type.isDomNode(t)&&Type.isDomNode(e.parentNode)){e.parentNode.replaceChild(t,e)}}static remove(e){if(Type.isDomNode(e)&&Type.isDomNode(e.parentNode)){e.parentNode.removeChild(e)}}static clean(e){if(Type.isDomNode(e)){while(e.firstChild){e.removeChild(e.firstChild)}return}if(Type.isString(e)){Dom.clean(document.getElementById(e))}}static insertBefore(e,t){if(Type.isDomNode(e)&&Type.isDomNode(t)&&Type.isDomNode(t.parentNode)){t.parentNode.insertBefore(e,t)}}static insertAfter(e,t){if(Type.isDomNode(e)&&Type.isDomNode(t)&&Type.isDomNode(t.parentNode)){const n=t.parentNode;if(Type.isDomNode(t.nextSibling)){n.insertBefore(e,t.nextSibling);return}n.appendChild(e)}}static append(e,t){if(Type.isDomNode(e)&&Type.isDomNode(t)){t.appendChild(e)}}static prepend(e,t){if(Type.isDomNode(e)&&Type.isDomNode(t)){if(Type.isDomNode(t.firstChild)){t.insertBefore(e,t.firstChild);return}Dom.append(e,t)}}static hasClass(e,t){if(Type.isElementNode(e)){if(Type.isString(t)){const n=t.trim();if(n.length>0){if(n.includes(" ")){return n.split(" ").every((t=>Dom.hasClass(e,t)))}return e.classList.contains(n)}}if(Type.isArray(t)&&t.length>0){return t.every((t=>Dom.hasClass(e,t)))}}return false}static addClass(e,t){if(Type.isElementNode(e)){if(Type.isString(t)){const n=t.trim();if(n.length>0){if(n.includes(" ")){Dom.addClass(e,n.split(" "));return}e.classList.add(n);return}}if(Type.isArray(t)){t.forEach((t=>Dom.addClass(e,t)))}}}static removeClass(e,t){if(Type.isElementNode(e)){if(Type.isString(t)){const n=t.trim();if(n.length>0){if(n.includes(" ")){Dom.removeClass(e,n.split(" "));return}e.classList.remove(n);return}}if(Type.isArray(t)){t.forEach((t=>Dom.removeClass(e,t)))}}}static toggleClass(e,t,n){if(!Type.isElementNode(e)||!Type.isStringFilled(t)&&!Type.isArrayFilled(t)){return}[t].flat().flatMap((e=>e?.trim?.().split(" "))).forEach((t=>{if(Type.isStringFilled(t)){e.classList.toggle(t,Type.isBoolean(n)?n:undefined)}}))}static style(e,t,n){if(Type.isElementNode(e)){if(Type.isNull(t)){e.removeAttribute("style");return e}if(Type.isPlainObject(t)){Object.entries(t).forEach((([t,n])=>{Dom.style(e,t,n)}));return e}if(Type.isString(t)){return styleProperty(e,t,n)}}return null}static adjust(e,t={}){if(!e.nodeType){return null}let n=e;if(e.nodeType===Node.DOCUMENT_NODE){n=e.body}if(Type.isPlainObject(t)){if(Type.isPlainObject(t.attrs)){adjustAttrs(n,t.attrs)}if(Type.isPlainObject(t.style)){Dom.style(n,t.style)}if(Type.isPlainObject(t.props)){adjustProps(n,t.props)}if(Type.isPlainObject(t.events)){adjustEvents(n,t.events)}if(Type.isPlainObject(t.dataset)){adjustDataset(n,t.dataset)}adjustContent(n,t)}return n}static create(e,t={},n=document){let r=e;let s=t;if(Type.isObjectLike(e)){const t=e;s=t;r=t.tag}return Dom.adjust(n.createElement(r),s)}static show(e){if(Type.isDomNode(e)){e.hidden=false}}static hide(e){if(Type.isDomNode(e)){e.hidden=true}}static isShown(e){return Type.isDomNode(e)&&!e.hidden&&e.style.getPropertyValue("display")!=="none"}static isShownRecursive(e){if(!Type.isDomNode(e)){return false}if(e===document.body){return Dom.isShown(e)}return Dom.isShown(e)&&Dom.isShownRecursive(e.parentElement)}static toggle(e){if(Type.isDomNode(e)){if(Dom.isShown(e)){Dom.hide(e)}else{Dom.show(e)}}}static getPosition(e){if(Type.isDomNode(e)){const t=e.getBoundingClientRect();const{scrollLeft:n,scrollTop:r}=getPageScroll();return new DOMRect(t.left+n,t.top+r,t.width,t.height)}return new DOMRect}static getRelativePosition(e,t){if(Type.isDomNode(e)&&Type.isDomNode(t)){const n=Dom.getPosition(e);const r=Dom.getPosition(t);return new DOMRect(n.left-r.left,n.top-r.top,n.width,n.height)}return new DOMRect}static attr(e,t,n){if(Type.isElementNode(e)){if(Type.isString(t)){if(!Type.isNil(n)){if(Type.isObjectLike(n)){e.setAttribute(t,encodeAttributeValue(n))}else{e.setAttribute(t,String(n))}}else if(Type.isNull(n)){e.removeAttribute(t)}else{return decodeAttributeValue(e.getAttribute(t))}}if(Type.isPlainObject(t)){Object.entries(t).forEach((([t,n])=>{Dom.attr(e,t,n)}))}}return null}}function styleProperty(e,t,n){if(Type.isUndefined(n)&&e.nodeType!==Node.DOCUMENT_NODE){const n=getComputedStyle(e);if(t in n){return n[t]}return n.getPropertyValue(t)}if(Type.isNull(n)||n===""||n==="null"){if(String(t).startsWith("--")){e.style.removeProperty(t);return e}e.style[t]="";return e}if(Type.isString(n)||Type.isNumber(n)){if(String(t).startsWith("--")){e.style.setProperty(t,String(n));return e}e.style[t]=n;return e}return null}function adjustAttrs(e,t){Object.keys(t).forEach((n=>{if(n==="class"||n.toLowerCase()==="classname"){e.className=t[n];return}if(t[n]==""){e.removeAttribute(n);return}e.setAttribute(n,t[n])}))}function adjustProps(e,t){Object.keys(t).forEach((n=>{e[n]=t[n]}))}function adjustEvents(e,t){Object.keys(t).forEach((n=>{Event.bind(e,n,t[n])}))}function adjustDataset(e,t){Object.keys(t).forEach((n=>{e.dataset[n]=t[n]}))}function adjustContent(e,t){const n=Type.isString(t.children)?[t.children]:t.children;if(Type.isArray(n)&&n.length>0){appendChildren(e,n);return}if("text"in t&&!Type.isNil(t.text)){e.textContent=t.text;return}if("html"in t&&!Type.isNil(t.html)){e.innerHTML=t.html}}function appendChildren(e,t){t.forEach((t=>{if(Type.isDomNode(t)){Dom.append(t,e)}if(Type.isString(t)){e.insertAdjacentHTML("beforeend",t)}}))}const UA=navigator.userAgent.toLowerCase();class Browser{static isOpera(){return UA.includes("opera")}static isIE(){return false}static isIE6(){return false}static isIE7(){return false}static isIE8(){return false}static isIE9(){return false}static isIE10(){return false}static isSafari(){return UA.includes("safari")&&!UA.includes("chrome")}static isFirefox(){return UA.includes("firefox")}static isChrome(){return UA.includes("chrome")}static detectIEVersion(){return-1}static isIE11(){return false}static isMac(){return UA.includes("macintosh")}static isWin(){return UA.includes("windows")}static isLinux(){return UA.includes("linux")&&!Browser.isAndroid()}static isAndroid(){return UA.includes("android")}static isIPad(){return UA.includes("ipad;")||this.isMac()&&this.isTouchDevice()}static isIPhone(){return UA.includes("iphone;")}static isIOS(){return Browser.isIPad()||Browser.isIPhone()}static isMobile(){return Browser.isIPhone()||Browser.isIPad()||Browser.isAndroid()||UA.includes("mobile")||UA.includes("touch")}static isRetina(){return window.devicePixelRatio>=2}static isTouchDevice(){return"ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0}static isDoctype(e){const t=e||document;if(t.compatMode){return t.compatMode==="CSS1Compat"}return Boolean(t.documentElement&&t.documentElement.clientHeight)}static isLocalStorageSupported(){return true}static addGlobalClass(e){const t=Type.isElementNode(e)?e:document.documentElement;let n="bx-core";if(Dom.hasClass(t,n)){return}if(Browser.isIOS()){n+=" bx-ios"}else if(Browser.isWin()){n+=" bx-win"}else if(Browser.isMac()){n+=" bx-mac"}else if(Browser.isLinux()){n+=" bx-linux"}else if(Browser.isAndroid()){n+=" bx-android"}n+=Browser.isMobile()?" bx-touch":" bx-no-touch";n+=Browser.isRetina()?" bx-retina":" bx-no-retina";if(Browser.isSafari()){n+=" bx-safari"}else if(/AppleWebKit/.test(navigator.userAgent)){n+=" bx-chrome"}else if(/Opera/.test(navigator.userAgent)){n+=" bx-opera"}else if(Browser.isFirefox()){n+=" bx-firefox"}Dom.addClass(t,n)}static detectAndroidVersion(){const e=/Android ([\d.]+)/;if(e.exec(navigator.userAgent)!==null){const t=navigator.userAgent.match(e);if(Type.isArrayLike(t)&&t.length>0){return parseFloat(t[1])}}return 0}static isPropertySupported(e,t){if(e===""){return false}function n(e){return e.replaceAll(/[A-Z]/g,(e=>`-${e.toLowerCase()}`))}function r(e){const t=/(\\-([a-z]))/g;if(t.test(e)){return e.replaceAll(t,((...e)=>e[2].toUpperCase()))}return e}const s=e.includes("-")?r(e):e;const i=Boolean(t);const o=s.charAt(0).toUpperCase()+s.slice(1);const a=["Webkit","Moz","O","ms"].join(`${o} `);const l=`${s} ${a} ${o}`.split(" ");const c=document.body||document.documentElement;for(const e of l){if(c&&"style"in c&&e in c.style){const t=e.slice(0,e.length-s.length).toLowerCase();const r=e===s?"":`-${t}-`;return i?r+n(s):e}}return false}static addGlobalFeatures(e){if(!Type.isArray(e)){return}const t=[];for(const n of e){const e=Boolean(Browser.isPropertySupported(n));t.push(`bx-${e?"":"no-"}${n.toLowerCase()}`)}Dom.addClass(document.documentElement,t.join(" "))}}function decodeSafely(e){try{return decodeURIComponent(e)}catch{return e}}class Cookie{static getList(){return document.cookie.split(";").filter((e=>e.trim()!=="")).reduce(((e,t)=>{const n=t.indexOf("=");const r=n===-1?t:t.slice(0,n);const s=n===-1?"":t.slice(n+1);e[decodeSafely(r.trim())]=decodeSafely(s.trim());return e}),{})}static get(e){const t=Cookie.getList();if(e in t){return t[e]}return undefined}static set(e,t,n={}){const r={expires:"",...n};if(Type.isNumber(r.expires)){const e=Date.now();const t=r.expires;const n=864e5;r.expires=new Date(e+t*n)}if(Type.isDate(r.expires)){r.expires=r.expires.toUTCString()}const s=decodeSafely(String(e)).replaceAll(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replaceAll(/[()]/g,escape);const i=encodeURIComponent(String(t)).replaceAll(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent);const o=Object.keys(r).reduce(((e,t)=>{const n=r[t];if(!n){return e}if(n===true){return`${e}; ${t}`}return`${e}; ${t}=${n.split(";")[0]}`}),"");document.cookie=`${s}=${i}${o}`}static remove(e,t={}){Cookie.set(e,"",{...t,expires:-1})}}function objectToFormData(e,t=new FormData,n=null){if(Type.isUndefined(e)){return t}if(Type.isNull(e)){t.append(n,"")}else if(Type.isArray(e)){if(e.length>0){e.forEach(((e,r)=>{const s=`${n}[${r}]`;objectToFormData(e,t,s)}))}else{const e=`${n}[]`;t.append(e,"")}}else if(Type.isDate(e)){t.append(n,e.toISOString())}else if(Type.isObject(e)&&!Type.isFile(e)&&!Type.isBlob(e)){Object.keys(e).forEach((r=>{const s=e[r];let i=r;if(Type.isArray(s)){while(i.length>2&&i.lastIndexOf("[]")===i.length-2){i=i.slice(0,-2)}}const o=n?`${n}[${i}]`:i;objectToFormData(s,t,o)}))}else{t.append(n,e)}return t}class Data{static convertObjectToFormData(e){return objectToFormData(e)}}class Http{static Cookie=Cookie;static Data=Data}const voidElements=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function isVoidElement(e){return voidElements.has(e)}const matchers={tag:/<[\d!/A-Za-z-](?:"[^"]*"|'[^']*'|[^"'>])*>|{{uid\d+}}/g,comment://g,tagName:/<\/?(\S+?)[\s/>]/,attributes:/\s([\w.:-]+)\s?\n?=\s?\n?"([^"]+)?"|\s([\w.:-]+)\s?\n?=\s?\n?'([^']+)?'|\s([\w.:-]+)/gs,placeholder:/{{uid\d+}}/g};function parseTag(e){const t={type:"tag",name:"",svg:false,attrs:{},children:[],voidElement:false};if(e.startsWith("\x3c!--")){const t=e.indexOf("--\x3e");const n="\x3c!--".length;return{type:"comment",content:t===-1?"":e.slice(n,t)}}const n=e.match(matchers.tagName);if(Type.isArrayFilled(n)){const[,r]=n;t.name=r;t.svg=r==="svg";t.voidElement=isVoidElement(r)||e.trim().endsWith("/>")}const r=new RegExp(matchers.attributes);for(;;){const n=r.exec(e);if(Type.isNil(n)){break}const[,s,i]=n;if(Type.isNil(s)){const e=n[3];const r=n[4];if(Type.isNil(e)){const e=n[5];t.attrs[e]=""}else{t.attrs[e]=Type.isStringFilled(r)?r:""}}else{t.attrs[s]=Type.isStringFilled(i)?i:""}}return t}function parseText(e){const t=e.replace(/[\t\n\r]$/,"");const n=t.match(matchers.placeholder);return t.split(matchers.placeholder).reduce(((e,t,r)=>{if(Type.isStringFilled(t)){e.push(...t.split(/\n/).reduce(((e,t)=>{const n=t.replaceAll(/[\t\r]/g,"");if(Type.isStringFilled(n)){e.push({type:"text",content:n})}return e}),[]))}if(n&&n[r]){e.push({type:"placeholder",uid:parseInt(n[r].replace(/{{uid|}}/,""),10)})}return e}),[])}function parse(e,t){const n=[];if(e.indexOf("<")!==0&&!e.startsWith("{{")){const t=e.indexOf("<");n.push(...parseText(t===-1?e:e.slice(0,t)))}const r=[];let s=-1;e=e.replace(matchers.comment,(e=>{s+=1;r.push(e.replaceAll(/^$/g,""));return`\x3c!--{{cUid${s}}}--\x3e`}));const i=[];let o=-1;let a=null;e.replace(matchers.tag,((t,s)=>{const l=s+t.length;const c=e.charAt(l);let u=null;if(t.startsWith("\x3c!--")){const e=parseTag(t);e.content=r[t.replaceAll(//g,"")];if(o<0){n.push(e);return n}u=i[o];u.children.push(e);return n}if(t.startsWith("{{")){const[e]=parseText(t);if(o<0){n.push(e);return n}u=i[o];u.children.push(e);return n}if(!t.startsWith("-1&&(a.voidElement||a.name===t.slice(2,-1))){o--;a=o===-1?n:i[o]}if(c&&c!=="<"){u=o===-1?n:i[o].children;const t=e.indexOf("<",l);const r=e.slice(l,t===-1?undefined:t);if(t>-1&&o+u.length>=0||r!==" "){u.push(...parseText(r))}}}return n}));return n}const appendElement=(e,t)=>{if(Type.isDomNode(e)&&Type.isDomNode(t)){if(t.nodeName==="TEMPLATE"){t.content.append(e)}else{Dom.append(e,t)}}};function renderNode(e){const{node:t,parentElement:n,substitutions:r,refs:s=[]}=e;if(t.type==="tag"){const e=(()=>{if(t.svg){return document.createElementNS("http://www.w3.org/2000/svg",t.name)}return document.createElement(t.name)})();if(Object.hasOwn(t.attrs,"ref")){s.push([t.attrs.ref,e]);delete t.attrs.ref}Object.entries(t.attrs).forEach((([t,n])=>{if(t.startsWith("on")&&new RegExp(`^${matchers.placeholder.source}$`).test(String(n).trim())){const s=r[parseInt(String(n).trim().replace("{{uid",""),10)-1];if(Type.isFunction(s)){const n=t.endsWith("once")?"bindOnce":"bind";Event[n](e,t.replaceAll(/^on|once$/g,""),s)}else{e.setAttribute(t,s)}}else if(new RegExp(matchers.placeholder).test(n)){const s=n.split(/{{|}}/).reduce(((e,t)=>{if(t.startsWith("uid")){const n=r[parseInt(t.replace("uid",""),10)-1];return`${e}${Text.decode(String(n))}`}return`${e}${Text.decode(t)}`}),"");e.setAttribute(t,s)}else{e.setAttribute(t,Text.decode(n))}}));t.children.forEach((t=>{const n=renderNode({node:t,parentElement:e,substitutions:r,refs:s});if(Type.isArray(n)){n.forEach((t=>{appendElement(t,e)}))}else{appendElement(n,e)}}));return e}if(t.type==="comment"){return document.createComment(t.content)}if(t.type==="text"){if(n){if(n.nodeName==="TEMPLATE"){n.content.append(t.content)}else{n.insertAdjacentHTML("beforeend",t.content)}return undefined}return document.createTextNode(t.content)}if(t.type==="placeholder"){return r[t.uid-1]}return undefined}const SECTION_STATE_OUTSIDE_TAG=0;const SECTION_STATE_IN_TAG=1;const SECTION_STATE_IN_ATTR_VALUE_DOUBLE=2;const SECTION_STATE_IN_ATTR_VALUE_SINGLE=3;const tagNameStart=/[A-Za-z]/;function transitionFromOutsideTag(e,t){if(e.charAt(t)==="<"){const n=e.charAt(t+1);if(n==="!"||n==="/"||tagNameStart.test(n)){return SECTION_STATE_IN_TAG}}return SECTION_STATE_OUTSIDE_TAG}function transitionFromInTag(e){if(e==='"'){return SECTION_STATE_IN_ATTR_VALUE_DOUBLE}if(e==="'"){return SECTION_STATE_IN_ATTR_VALUE_SINGLE}if(e===">"){return SECTION_STATE_OUTSIDE_TAG}return SECTION_STATE_IN_TAG}function advanceState(e,t,n){const r=t.charAt(n);switch(e){case SECTION_STATE_OUTSIDE_TAG:return transitionFromOutsideTag(t,n);case SECTION_STATE_IN_TAG:return transitionFromInTag(r);case SECTION_STATE_IN_ATTR_VALUE_DOUBLE:return r==='"'?SECTION_STATE_IN_TAG:e;case SECTION_STATE_IN_ATTR_VALUE_SINGLE:return r==="'"?SECTION_STATE_IN_TAG:e;default:return e}}function computeSectionStates(e){const t=[];let n=SECTION_STATE_OUTSIDE_TAG;for(const r of e){for(let e=0;e{if(s>0){const i=t[s-1];const o=n[s-1];const a=o===SECTION_STATE_IN_ATTR_VALUE_DOUBLE||o===SECTION_STATE_IN_ATTR_VALUE_SINGLE;if(!a&&(Type.isString(i)||Type.isNumber(i))){return`${e}${i}${r}`}return`${e}{{uid${s}}}${r}`}return e}),e[0]).replaceAll(/^\s+/gm,"").replaceAll(/>\n+/g,">").replaceAll(/}\n+/g,"}");const s=parse(r);if(s.length===1){const e=[];const n=renderNode({node:s[0],substitutions:t,refs:e});if(Type.isArrayFilled(e)){return Object.fromEntries([["root",n],...e])}return n}if(s.length>1){const e=[];const n=s.map((n=>renderNode({node:n,substitutions:t,refs:e})));if(Type.isArrayFilled(e)){return Object.fromEntries([["root",n],...e])}return n}return false}function parseProps(...e){const[t,...n]=e;return n.reduce(((e,n,r)=>{const s=r+1;if(!Type.isPlainObject(n)&&!Type.isArray(n)){return e+n+t[s]}return`${e}__s${r}${t[s]}`}),t[0]).replaceAll(/[\t\r]/gm,"").split(";\n").map((e=>e.replace(/\n/,""))).reduce(((e,t)=>{if(t!==""){const r=t.match(/^[\w-. ]+:/);const s=t.split(/^[\w-. ]+:/);const i=r[0].replace(":","").trim();const o=s[1].trim();const a=/^__s\d+/;if(a.test(o)){e[i]=n[o.replace("__s","")];return e}e[i]=o}return e}),{})}class Tag{static safe(e,...t){return t.reduce(((t,n,r)=>t+Text.encode(""+n)+e[r+1]),e[0])}static unsafe(e,...t){return t.reduce(((t,n,r)=>t+Text.decode(n)+e[r+1]),e[0])}static style(e){if(!Type.isDomNode(e)){throw new Error("element is not HTMLElement")}return function t(...n){Dom.style(e,parseProps(...n))}}static message(e,...t){return t.reduce(((t,n,r)=>t+Loc.getMessage(n)+e[r+1]),e[0])}static render=render;static attrs(e){if(!Type.isDomNode(e)){throw new Error("element is not HTMLElement")}return function t(...n){Dom.attr(e,parseProps(...n))}}static attr=Tag.attrs}function getParser(e){switch(e){case"index":return(e,t,n)=>{const r=/\[(\w*)]$/.exec(e);const s=e.replace(/\[\w*]$/,"");if(Type.isNil(r)){n[s]=t;return}if(Type.isUndefined(n[s])){n[s]={}}n[s][r[1]]=t};case"bracket":return(e,t,n)=>{const r=/(\[])$/.exec(e);const s=e.replace(/\[]$/,"");if(Type.isNil(r)){n[s]=t;return}if(Type.isUndefined(n[s])){n[s]=Type.isNil(t)?[]:[t];return}n[s]=[].concat(n[s],t)};default:return(e,t,n)=>{const r=e.replace(/\[]$/,"");n[r]=t}}}function getKeyFormat(e){if(/^\w+\[(\w+)]$/.test(e)){return"index"}if(/^\w+\[]$/.test(e)){return"bracket"}return"default"}function isAllowedKey(e){return!String(e).startsWith("__proto__")}function parseQuery(e){if(!Type.isString(e)){return{}}const t=e.trim().replace(/^[#&?]/,"");if(!t){return{}}const n=t.split("&").reduce(((e,t)=>{const[n,r]=t.replaceAll("+"," ").split("=");if(isAllowedKey(n)){const t=getKeyFormat(n);const s=getParser(t);s(n,r,e)}return e}),Object.create(null));return{...n}}const urlExp=/^((\w+):)?(\/\/((\w+)?(:(\w+))?@)?([^/:?]+)(:(\d+))?)?(\/?([^#/?][^#?]*)?)?(\?([^#]+))?(#((?:[\w-?/:@.~!$&'()*+,;=]|%\w{2})*))?/;function prepareParams(e){const t=Object.entries(e);return t.reduce(((e,[t,n])=>{if(Type.isNil(n)){e[t]=""}else if(Type.isPlainObject(n)){e[t]=prepareParams(n)}else{e[t]=n}return e}),{})}function parseUrl(e){const t=e.match(urlExp);if(Type.isArray(t)){const n=parseQuery(t[14]);const r=prepareParams(n);return{useShort:String(e).startsWith("//"),href:t[0]||"",schema:t[2]||"",host:t[8]||"",port:t[10]||"",path:t[11]||"",query:t[14]||"",sourceQueryParams:n,queryParams:r,hash:t[16]||"",username:t[5]||"",password:t[7]||"",origin:t[8]||""}}return{}}function renderParam(e,t){if(Type.isNil(t)){return e}return`${e}=${t}`}function buildQueryString(e={}){const t=Object.keys(e).reduce(((t,n)=>{if(Type.isArray(e[n])){if(Type.isArrayFilled(e[n])){e[n].forEach((e=>{t.push(renderParam(`${n}[]`,e))}))}else{t.push(renderParam(`${n}[]`,null))}}if(Type.isPlainObject(e[n])){Object.keys(e[n]).forEach((r=>{t.push(renderParam(`${n}[${r}]`,e[n][r]))}))}if(!Type.isObject(e[n])&&!Type.isArray(e[n])){t.push(renderParam(n,e[n]))}return t}),[]).join("&");if(t.length>0){return`?${t}`}return t}function prepareParamValue(e){if(Type.isArray(e)){return e.map((e=>String(e)))}if(Type.isPlainObject(e)){return{...e}}return String(e)}const map=new WeakMap;class Uri{static addParam(e,t={}){return new Uri(e).setQueryParams(t).toString()}static removeParam(e,t){const n=Type.isArray(t)?t:[t];return new Uri(e).removeQueryParam(...n).toString()}constructor(e=""){map.set(this,parseUrl(e))}getSchema(){return map.get(this).schema}setSchema(e){map.get(this).schema=String(e);return this}getHost(){return map.get(this).host}setHost(e){map.get(this).host=String(e);return this}getPort(){return map.get(this).port}setPort(e){map.get(this).port=String(e);return this}getPath(){return map.get(this).path}setPath(e){if(!String(e).startsWith("/")){map.get(this).path=`/${String(e)}`;return this}map.get(this).path=String(e);return this}getQuery(){return buildQueryString(map.get(this).queryParams)}getQueryParam(e){const t=this.getQueryParams();if(Object.hasOwn(t,e)){return t[e]}return null}setQueryParam(e,t=""){map.get(this).queryParams[e]=prepareParamValue(t);map.get(this).sourceQueryParams[e]=prepareParamValue(t);return this}getQueryParams(){return{...map.get(this).queryParams}}setQueryParams(e={}){if(Type.isPlainObject(e)){const{queryParams:t,sourceQueryParams:n}=map.get(this);Object.entries(e).forEach((([e,r])=>{const s=prepareParamValue(r);t[e]=s;n[e]=s}))}return this}removeQueryParam(...e){const{queryParams:t,sourceQueryParams:n}=map.get(this);e.forEach((e=>{delete t[e];delete n[e]}));return this}getFragment(){return map.get(this).hash}setFragment(e){map.get(this).hash=String(e);return this}serialize(){const e={...map.get(this)};delete e.sourceQueryParams;e.href=this.toString();return e}toString(){const e={...map.get(this)};let t=e.schema?`${e.schema}://`:"";if(e.useShort){t="//"}const n=(()=>{if(Type.isString(e.port)&&!["","80"].includes(e.port)){return`:${e.port}`}return""})();const r=this.getHost();const s=this.getPath();const i=buildQueryString(e.sourceQueryParams);const o=e.hash?`#${e.hash}`:"";return`${r?t:""}${r}${r?n:""}${s}${i}${o}`}}class Validation{static MAX_EMAIL_LENGTH=254;static MAX_LOCAL_LENGTH=64;static LOCAL_ALLOWED_CHARS=/^[\w%+.\u0401\u0410-\u044f\u0451-]+$/;static DOMAIN_LABEL_CHARS=/^[\w.\u0401\u0410-\u044f\u0451-]+$/;static isEmail(e){if(!Type.isStringFilled(e)){return false}if(e.length>Validation.MAX_EMAIL_LENGTH){return false}const t=e.indexOf("@");if(t<=0||t===e.length-1||e.includes("@",t+1)){return false}const n=e.slice(0,t);const r=e.slice(t+1);return isValidLocalPart(n)&&isValidDomain(r)}}function isValidLocalPart(e){if(!Validation.LOCAL_ALLOWED_CHARS.test(e)){return false}return!(e.startsWith(".")||e.endsWith(".")||e.startsWith("-")||e.endsWith("-")||e.includes("..")||e.length>Validation.MAX_LOCAL_LENGTH)}function isValidDomain(e){if(!Validation.DOMAIN_LABEL_CHARS.test(e)){return false}if(e.startsWith(".")||e.endsWith(".")||e.includes("..")){return false}const t=e.split(".");if(t.length<2){return false}const n=t[t.length-1];if(n.length<2||n.length>24){return false}for(const e of t){if(e.startsWith("-")||e.endsWith("-")){return false}const t=/^[\dA-Za-z\u0401\u0410-\u044f\u0451]/.test(e);const n=/[\dA-Za-z\u0401\u0410-\u044f\u0451]$/.test(e);if(!t||!n){return false}}return true}class MemoryStorage{#e=new Map;get(e){return this.#e.get(e)}set(e,t){this.#e.set(e,t)}has(e){return this.#e.has(e)}delete(e){this.#e.delete(e)}get size(){return this.#e.size}keys(){return[...this.#e.keys()]}values(){return[...this.#e.values()]}}class BaseCache{storage=new MemoryStorage;get(e,t){if(!this.storage.has(e)){if(Type.isFunction(t)){return t()}if(!Type.isUndefined(t)){return t}}return this.storage.get(e)}set(e,t){this.storage.set(e,t)}delete(e){this.storage.delete(e)}has(e){return this.storage.has(e)}remember(e,t){if(!this.storage.has(e)){if(Type.isFunction(t)){this.storage.set(e,t())}else if(!Type.isUndefined(t)){this.storage.set(e,t)}}return this.storage.get(e)}size(){return this.storage.size}keys(){return this.storage.keys()}values(){return this.storage.values()}}class MemoryCache extends BaseCache{}class LsStorage{stackKey="BX.Cache.Storage.LsStorage.stack";stack=null;getStack(){if(Type.isPlainObject(this.stack)){return this.stack}const e=localStorage.getItem(this.stackKey);if(Type.isString(e)&&e!==""){const t=JSON.parse(e);if(Type.isPlainObject(t)){this.stack=t;return this.stack}}this.stack={};return this.stack}saveStack(){if(Type.isPlainObject(this.stack)){const e=JSON.stringify(this.stack);localStorage.setItem(this.stackKey,e)}}get(e){const t=this.getStack();return t[e]}set(e,t){const n=this.getStack();n[e]=t;this.saveStack()}delete(e){const t=this.getStack();if(e in t){delete t[e]}}has(e){const t=this.getStack();return e in t}get size(){const e=this.getStack();return Object.keys(e).length}keys(){const e=this.getStack();return Object.keys(e)}values(){const e=this.getStack();return Object.values(e)}}class LocalStorageCache extends BaseCache{storage=new LsStorage}class Cache{static BaseCache=BaseCache;static MemoryCache=MemoryCache;static LocalStorageCache=LocalStorageCache}function convertPath(e){if(Type.isStringFilled(e)){return e.split(".").reduce(((e,t)=>{t.split(/\[["']?(.+?)["']?]/g).forEach((t=>{if(Type.isStringFilled(t)){e.push(t)}}));return e}),[])}return[]}class SettingsCollection{constructor(e={}){if(Type.isPlainObject(e)){Object.assign(this,e)}}get(e,t=null){const n=convertPath(e);return n.reduce(((e,n)=>{if(!Type.isNil(e)&&e!==t){if(!Type.isUndefined(e[n])){return e[n]}return t}return e}),this)}}function deepFreeze(e){if(Type.isObject(e)){Object.values(e).forEach((e=>{deepFreeze(e)}));return Object.freeze(e)}return e}const settingsStorage=new Map;class Extension{static getSettings(e){if(Type.isStringFilled(e)){if(settingsStorage.has(e)){return settingsStorage.get(e)}const t=document.querySelector(`script[data-extension="${e}"]`);if(Type.isDomNode(t)){const n=(()=>{try{return new SettingsCollection(JSON.parse(t.innerHTML))}catch{return new SettingsCollection}})();const r=deepFreeze(n);settingsStorage.set(e,r);return r}}return deepFreeze(new SettingsCollection)}}function _classPrivateMethodInitSpec(e,t){_checkPrivateRedeclaration(e,t),t.add(e)}function _checkPrivateRedeclaration(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _assertClassBrand(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}var _OrderedArray_brand=new WeakSet;let OrderedArray=function(){function e(t=null){babelHelpers.classCallCheck(this,e);_classPrivateMethodInitSpec(this,_OrderedArray_brand);babelHelpers.defineProperty(this,"comparator",null);babelHelpers.defineProperty(this,"items",[]);this.comparator=Type.isFunction(t)?t:null}return babelHelpers.createClass(e,[{key:"add",value:function e(t){let n=-1;if(this.comparator){n=_assertClassBrand(_OrderedArray_brand,this,_searchIndexToInsert).call(this,t);this.items.splice(n,0,t)}else{this.items.push(t)}return n}},{key:"has",value:function e(t){return this.items.includes(t)}},{key:"getIndex",value:function e(t){return this.items.indexOf(t)}},{key:"getByIndex",value:function e(t){if(Type.isNumber(t)&&t>=0){const e=this.items[t];return Type.isUndefined(e)?null:e}return null}},{key:"getFirst",value:function e(){const t=this.items[0];return Type.isUndefined(t)?null:t}},{key:"getLast",value:function e(){const t=this.items[this.count()-1];return Type.isUndefined(t)?null:t}},{key:"count",value:function e(){return this.items.length}},{key:"delete",value:function e(t){const n=this.getIndex(t);if(n!==-1){this.items.splice(n,1);return true}return false}},{key:"clear",value:function e(){this.items=[]}},{key:Symbol.iterator,value:function(){return this.items[Symbol.iterator]()}},{key:"forEach",value:function e(t,n){const r=n?t.bind(n):t;this.items.forEach(((e,t,n)=>{r(e,t,n)}))}},{key:"getAll",value:function e(){return this.items}},{key:"getComparator",value:function e(){return this.comparator}},{key:"sort",value:function e(){const t=this.getComparator();if(t===null){return}const n=this.items.length;const r=Array.from({length:n},((e,t)=>t));r.sort(((e,n)=>t(this.items[e],this.items[n])||e-n));for(let e=0;e=0){n=r}else{t=r+1}}return t}class ZIndexComponent extends EventEmitter{sort=0;alwaysOnTop=false;zIndex=0;element=null;overlay=null;overlayGap=-5;stack=null;constructor(e,t={}){super();this.setEventNamespace("BX.Main.ZIndexManager.Component");if(!Type.isElementNode(e)){throw new Error("ZIndexManager.Component: The argument 'element' must be a DOM element.")}this.element=e;const n=Type.isPlainObject(t)?t:{};this.setAlwaysOnTop(n.alwaysOnTop);this.setOverlay(n.overlay);this.setOverlayGap(n.overlayGap);this.subscribeFromOptions(n.events)}getSort(){return this.sort}setSort(e){if(Type.isNumber(e)){this.sort=e}}setStack(e){this.stack=e}getStack(){return this.stack}getZIndex(){return this.zIndex}setZIndex(e){const t=this.getZIndex()!==e;this.getElement().style.setProperty("z-index",String(e),"important");this.zIndex=e;if(this.getOverlay()!==null){this.getOverlay().style.setProperty("z-index",String(e+this.getOverlayGap()),"important")}if(t){this.emit("onZIndexChange",{component:this})}}getAlwaysOnTop(){return this.alwaysOnTop}setAlwaysOnTop(e){if(Type.isNumber(e)||Type.isBoolean(e)){this.alwaysOnTop=e}}getElement(){return this.element}setOverlay(e,t){if(Type.isElementNode(e)||e===null){this.overlay=e;this.setOverlayGap(t);if(this.getStack()){this.getStack().sort()}}}getOverlay(){return this.overlay}setOverlayGap(e){if(Type.isNumber(e)){this.overlayGap=e}}getOverlayGap(){return this.overlayGap}}class ZIndexStack{container;components;elements=new WeakMap;baseIndex=1e3;baseStep=50;sortCount=0;constructor(e){if(!Type.isDomNode(e)){throw new Error("ZIndexManager.Stack: The 'container' argument must be a DOM element.")}this.container=e;const t=(e,t)=>{let n=(Number(e.getAlwaysOnTop())||0)-(Number(t.getAlwaysOnTop())||0);if(!n){n=e.getSort()-t.getSort()}return n};this.components=new OrderedArray(t)}getBaseIndex(){return this.baseIndex}setBaseIndex(e){if(Type.isNumber(e)&&e>=0){this.baseIndex=e;this.sort()}}setBaseStep(e){if(Type.isNumber(e)&&e>0){this.baseStep=e;this.sort()}}getBaseStep(){return this.baseStep}register(e,t={}){if(this.getComponent(e)){console.warn("ZIndexManager: You cannot register the element twice.",e);return this.getComponent(e)}const n=new ZIndexComponent(e,t);n.setStack(this);n.setSort(++this.sortCount);this.elements.set(e,n);this.components.add(n);this.sort();return n}unregister(e){const t=this.elements.get(e);this.components.delete(t);this.elements.delete(e);this.sort()}getComponent(e){return this.elements.get(e)||null}getComponents(){return this.components.getAll()}getMaxZIndex(){const e=this.components.getLast();return e?e.getZIndex():this.baseIndex}sort(){this.components.sort();let e=this.baseIndex;this.components.forEach((t=>{t.setZIndex(e);e+=this.baseStep}))}bringToFront(e){const t=this.getComponent(e);if(!t){console.error("ZIndexManager: element was not found in the stack.",e);return null}t.setSort(++this.sortCount);this.sort();return t}}class ZIndexManager{static stacks=new WeakMap;static register(e,t={}){const n=this.#t(e);if(!n){return null}const r=this.getOrAddStack(n);return r.register(e,t)}static unregister(e){const t=this.#t(e);const n=this.getStack(t);if(n){n.unregister(e)}}static addStack(e){const t=new ZIndexStack(e);this.stacks.set(e,t);return t}static getStack(e){return this.stacks.get(e)||null}static getOrAddStack(e){return this.getStack(e)||this.addStack(e)}static getComponent(e){const t=this.#t(e,true);if(!t){return null}const n=this.getStack(t);return n?n.getComponent(e):null}static bringToFront(e){const t=this.#t(e);const n=this.getStack(t);if(n){return n.bringToFront(e)}return null}static#t(e,t=false){if(!Type.isElementNode(e)){if(!t){console.error("ZIndexManager: The argument 'element' must be a DOM element.",e)}return null}if(!Type.isElementNode(e.parentNode)){if(!t){console.error("ZIndexManager: The 'element' doesn't have a parent node.",e)}return null}return e.parentNode}}class WeakRefMap{#n=new Map;#r;constructor(){this.#r=new FinalizationRegistry(this.#s.bind(this))}clear(){this.#n.forEach((e=>{const t=e.deref();if(!Type.isUndefined(t)){this.#r.unregister(t)}}));this.#n.clear()}delete(e){const t=this.get(e);if(!Type.isUndefined(t)){this.#r.unregister(t)}return this.#n.delete(e)}get(e){return this.#n.get(e)?.deref()}has(e){return!Type.isUndefined(this.#n.get(e)?.deref())}set(e,t){this.#n.set(e,new WeakRef(t));this.#r.register(t,e,t);return this}#s(e){const t=this.#n.get(e);if(t&&!t.deref()){this.#n.delete(e)}}}const collections={OrderedArray:OrderedArray,SettingsCollection:SettingsCollection,WeakRefMap:WeakRefMap};function isCssAnimation(e){return"animationName"in e}function isCssTransition(e){return"transitionProperty"in e}function isScriptAnimation(e){return!isCssAnimation(e)&&!isCssTransition(e)}class Animation{static waitTransitionEnd(e,t=null){return this.#i(e,t,isCssTransition,(e=>isCssTransition(e)?e.transitionProperty:null))}static waitAnimationEnd(e,t=null){return this.#i(e,t,(e=>isCssAnimation(e)||isScriptAnimation(e)),(e=>isCssAnimation(e)?e.animationName:null))}static async#i(e,t,n,r){if(!Type.isElementNode(e)){return}const s=e.getAnimations().filter((e=>n(e))).filter((e=>this.#o(r(e),t))).filter((e=>this.#a(e)));await Promise.allSettled(s.map((e=>e.finished)))}static#o(e,t){if(Type.isNil(t)){return true}if(Type.isNil(e)){return false}if(Type.isArray(t)){return t.includes(e)}return e===t}static#a(e){const t=e.effect?.getComputedTiming().endTime;return Type.isNumber(t)&&Number.isFinite(t)}}class Transition{static linear(e){return e}static quad(e){return e**2}static cubic(e){return e**3}static quart(e){return e**4}static quint(e){return e**5}static circ(e){return 1-Math.sin(Math.acos(e))}static back(e){return e**2*((1.5+1)*e-1.5)}static elasti(e){return 2**(10*(e-1))*Math.cos(20*Math.PI*1.5/3*e)}static bounce(e){for(let t=0,n=1;;t+=n,n/=2){if(e>=(7-4*t)/11){return-(((11-6*t-11*e)/4)**2)+n**2}}}}class Easing{#l=1e3;#c=Transition.linear;#u=null;#p=null;#f=null;#d={};#h={};#m={};#y=null;#g=null;#b=null;constructor(e){this.setOptions(e)}setOptions(e){const t=Type.isPlainObject(e)?e:{};this.#l=Type.isNumber(t.duration)&&t.duration>0?t.duration:this.#l;this.#u=Type.isFunction(t.begin)||t.begin===null?t.begin:this.#u;this.#p=Type.isFunction(t.step)||t.step===null?t.step:this.#p;this.#f=Type.isFunction(t.complete)||t.complete===null?t.complete:this.#f;this.#y=Type.isFunction(t.progress)||t.progress===null?t.progress:this.#y;this.#d=Type.isPlainObject(t.start)?{...t.start}:this.#d;this.#h=Type.isPlainObject(t.finish)?{...t.finish}:this.#h}setTransition(e){if(Type.isFunction(e)){this.#c=e}else if(Type.isStringFilled(e)){let t=e;let n=null;if(e.startsWith("ease-out-")){t=t.replace("ease-out-","");n=Easing.makeEaseOut}else if(e.startsWith("ease-in-out-")){t=t.replace("ease-in-out-","");n=Easing.makeEaseInOut}if(Type.isFunction(Transition[t])){this.#c=n===null?Transition[t]:n(Transition[t])}}}animateProgress(){this.#T()}animate(){this.#y=e=>{this.#m={};for(const t of Object.keys(this.#d)){this.#m[t]=Math.round(this.#d[t]+(this.#h[t]-this.#d[t])*e)}if(this.#p!==null){this.#p(this.#m)}};this.#T()}#T(){for(const e of Object.keys(this.#d)){if(Type.isUndefined(this.#h[e])){delete this.#d[e]}}let e=null;const t=n=>{if(e===null){e=n}let r=(n-e)/this.#l;if(r>1){r=1}const s=this.#c(r);this.#y(s);if(r===1){this.stop(true)}else{this.#g=requestAnimationFrame(t)}};if(this.#u!==null){this.#u(this.#m)}this.#g=requestAnimationFrame(t)}get options(){if(this.#b===null){this.#b=new Proxy(this,{get(e,t,n){switch(t){case"transition":return e.#c;case"start":return e.#d;case"finish":return e.#h;case"duration":return e.#l;default:return null}},set(e,t,n,r){e.setOptions({[t]:n});return true}})}return this.#b}stop(e=false){if(this.#g!==null){cancelAnimationFrame(this.#g);this.#g=null;if(e&&this.#f!==null){this.#f(this.#m)}}}static makeEaseInOut(e){return t=>{if(t<.5){return e(2*t)/2}return(2-e(2*(1-t)))/2}}static makeEaseOut(e){return t=>1-e(1-t)}static get transitions(){return Transition}}class LocalStorage{#x=null;constructor(e={}){const t=Type.isPlainObject(e)?e:{};this.#w(t.prefix);Event.bind(window,"storage",this.#E.bind(this));setInterval(this.#S.bind(this),5e3)}set(e,t,n=60){if(!Type.isStringFilled(e)||Type.isNil(t)){return false}try{window.localStorage.setItem(this.getPrefix()+e,`${Math.round(Date.now()/1e3)+n}:${this.#v(t)}`)}catch{console.error("LocalStorage error",e,n);return false}return true}get(e){const t=window.localStorage.getItem(this.getPrefix()+e);if(t){const n=this.#B(t);if(n===null){return null}const[r,s]=n;if(Date.now()<=r){return this.#A(s)}this.remove(e)}return null}remove(e){window.localStorage.removeItem(this.getPrefix()+e)}getPrefix(){if(this.#x===null){const e=Loc.hasMessage("USER_ID")?Loc.getMessage("USER_ID"):"";const t=Loc.hasMessage("SITE_ID")?Loc.getMessage("SITE_ID"):"admin";this.#x=`${this.getBasePrefix()}${e}-${t}-`}return this.#x}getBasePrefix(){return"bx"}#w(e){if(Type.isString(e)){this.#x=`${this.getBasePrefix()}-${e}`}}#E(e){if(!Type.isStringFilled(e.key)||!e.key.startsWith(this.getPrefix())){return}const t=e.key.slice(this.getPrefix().length);const n=this.#j(e.newValue);const r=this.#j(e.oldValue);const s={key:t,value:n,oldValue:r};if(t==="BXGCE"){if(n){const e=s.value;EventEmitter.emit(e.e,new BaseEvent({data:e.p,compatData:e.p}))}}else{if(e.newValue){EventEmitter.emit("onLocalStorageSet",new BaseEvent({data:[s],compatData:[s]}))}if(e.oldValue&&!e.newValue){EventEmitter.emit("onLocalStorageRemove",new BaseEvent({data:[s],compatData:[s]}))}EventEmitter.emit("onLocalStorageChange",new BaseEvent({data:[s],compatData:[s]}))}}#S(){const e=Date.now();for(let t=0;t=s){window.localStorage.removeItem(n)}}}}#v(e){if(Type.isJsonValue(e)){return JSON.stringify(e)}return e.toString()}#A(e){let t=null;if(Type.isStringFilled(e)){try{t=JSON.parse(e)}catch{t=e}}return t}#j(e){const t=this.#B(e);if(t===null){return null}return this.#A(t[1])}#B(e){if(!this.#C(e)){return null}const[t]=e.split(":",1);const n=e.slice(t.length+1);return[parseInt(t,10)*1e3,n]}#C(e){return Type.isStringFilled(e)&&/^\d{10}:/.test(e)}}const localStorage$1=new LocalStorage;class Page{static getRootWindow(){return this.getTopWindowOfCurrentHost(window)}static isCrossOriginObject(e){try{void e.location.host}catch{return true}return false}static getTopWindowOfCurrentHost(e){if(!this.isCrossOriginObject(e.parent)&&e.parent!==e&&e.parent.location.host===e.location.host){return this.getTopWindowOfCurrentHost(e.parent)}return e}static getParentWindowOfCurrentHost(e){if(this.isCrossOriginObject(e.parent)){return e}return e.parent}static redirect(e,t={}){if(!Type.isStringFilled(e)){throw new Error('Redirect: "url" must be a non-empty string.')}const n=this.getRootWindow();let r=null;try{r=new URL(e,n.location.origin)}catch{throw new Error(`Redirect: invalid URL: ${e}`)}const s=Type.isPlainObject(t)?t:{};if(!this.#$(r,s.allowedOrigins)){console.error(`Redirect: blocked potentially unsafe URL: ${r}`);return}const i=r.toString();if(s.newTab===true){const e=n.open(i,"_blank","noopener,noreferrer");if(e){e.opener=null}return}if(s.replaceHistory===true){n.location.replace(i)}else{n.location.assign(i)}}static reload(){const e=this.getRootWindow();e.location.reload()}static#$(e,t=[]){if(!(e instanceof URL)){return false}const n=["http:","https:"];if(!n.includes(e.protocol)){return false}const r=this.getRootWindow();if(e.origin===r.location.origin){return true}if(Type.isArray(t)&&t.length>0){return t.includes(e.origin)}return false}}const sensitiveParams=["sessid","sessionid","access_token","refresh_token","token","tokens","auth","authtoken","bearer","jwt","sid","password","pwd","secret","signature","api_key","apikey","csrf"];const nameSeparator="(?:[_.\\-[\\]]|%5B|%5D)";const queryPairPattern=/([&?])([^#&=]*)=([^#&]*)/g;const sensitiveNamePattern=new RegExp(`(?:^|${nameSeparator})(?:${sensitiveParams.join("|")})(?:$|${nameSeparator})`,"i");function maskUrl(e){let t=e;try{const n=new URL(e);if(n.username!==""||n.password!==""){n.username="***";n.password="***";t=n.toString()}}catch{}return t.replaceAll(queryPairPattern,((e,t,n)=>sensitiveNamePattern.test(n)?`${t}${n}=***`:e))}function withUrl(e,t){return t===""?e:`${e}: ${t}`}class HttpClientError extends Error{cause;retryCount=0;constructor(e,t={}){super(e);this.name="HttpClientError";if(!Type.isUndefined(t.cause)){this.cause=t.cause}}}class HttpError extends HttpClientError{status;response;constructor(e,t=null,n={}){super(withUrl(`Request failed with status ${e}`,maskUrl(t?.raw?.url??"")),n);this.name="HttpError";this.status=e;this.response=t}}class NetworkError extends HttpClientError{url;constructor(e={}){const t=maskUrl(e.url??"");super(withUrl("Network request failed",t),e);this.name="NetworkError";this.url=t}}class TimeoutError extends HttpClientError{url;timeout;constructor(e={}){const t=maskUrl(e.url??"");const n=e.timeout??0;super(withUrl(`Request timed out after ${n}ms`,t),e);this.name="TimeoutError";this.url=t;this.timeout=n}}class ParseError extends HttpClientError{url;responseType;constructor(e={}){const t=maskUrl(e.url??"");const n=e.responseType??"json";super(withUrl(`Failed to parse response as "${n}"`,t),e);this.name="ParseError";this.url=t;this.responseType=n}}class AssetLoadError extends HttpClientError{url;assetType;constructor(e){const t=maskUrl(e.url??"");super(withUrl("Failed to load asset",t),e);this.name="AssetLoadError";this.url=t;this.assetType=e.assetType}}function hasCsrfCustomData(e){return Type.isPlainObject(e?.customData)&&"csrf"in e.customData}function withoutCsrfCustomData(e){if(!e.some((e=>hasCsrfCustomData(e)))){return e}return e.map((e=>{if(!hasCsrfCustomData(e)){return e}const{csrf:t,...n}=e.customData;return{...e,customData:n}}))}class ControllerError extends HttpClientError{errors;envelope;httpStatus;constructor(e={}){const t=e.envelope??null;const n=withoutCsrfCustomData(e.errors??t?.errors??[]);super(n[0]?.message??"Controller action failed",e);this.name="ControllerError";this.errors=n;this.envelope=ControllerError.#O(t);this.httpStatus=e.httpStatus??200}static#O(e){if(e===null){return null}const t=withoutCsrfCustomData(e.errors??[]);return t===e.errors?e:{...e,errors:t}}}function getAbortReason(e){return e.reason??new DOMException("The operation was aborted.","AbortError")}const confirmationTimeout=1e3;const transferableResponseTypes=new Set(["json","text","blob"]);const transferableHeaderNames=["content-type","content-language","content-length","etag","last-modified","x-bitrix-composite","x-process-assets"];const relayedResponses=new WeakSet;function isLocksApiAvailable(){return!Type.isUndefined(globalThis.navigator?.locks)&&Type.isFunction(globalThis.navigator.locks.request)}function isChannelApiAvailable(){return Type.isFunction(globalThis.BroadcastChannel)}function isApplicable(e){return Type.isStringFilled(e.key)&&transferableResponseTypes.has(e.responseType??"json")&&isLocksApiAvailable()&&isChannelApiAvailable()}function snapshotHeaders(e){if(Type.isNil(e)){return[]}return transferableHeaderNames.reduce(((t,n)=>{const r=e.get(n);if(!Type.isNull(r)){t.push([n,r])}return t}),[])}function toSnapshot(e){return{status:e.status,ok:e.ok,headers:snapshotHeaders(e.headers),data:e.data}}function fromSnapshot(e){const t=new Headers(e.headers);const n=new Response(null,{status:e.status,headers:t});relayedResponses.add(n);return{status:e.status,ok:e.ok,headers:t,data:e.data,raw:n,retryCount:0}}function isRelayedResponse(e){return!Type.isNil(e.raw)&&relayedResponses.has(e.raw)}function toMessage(e){if(e instanceof HttpError){return{outcome:"error",errorKind:"http",message:e.message,response:toSnapshot(e.response)}}if(e instanceof TimeoutError){return{outcome:"error",errorKind:"timeout",message:e.message}}if(e instanceof NetworkError){return{outcome:"error",errorKind:"network",message:e.message}}if(e instanceof ParseError){return{outcome:"error",errorKind:"parse",message:e.message}}return{outcome:"leaderGone"}}function parseMessage(e){if(!Type.isPlainObject(e)){return null}const t=e;if(t.outcome==="leaderGone"){return{outcome:"leaderGone"}}if(t.outcome==="response"){const e=parseSnapshot(t);return e===null?null:{outcome:"response",...e}}if(t.outcome!=="error"||!Type.isString(t.message)){return null}if(t.errorKind==="http"){const e=parseSnapshot(t.response);return e===null?null:{outcome:"error",errorKind:"http",message:t.message,response:e}}if(t.errorKind==="network"||t.errorKind==="timeout"||t.errorKind==="parse"){return{outcome:"error",errorKind:t.errorKind,message:t.message}}return null}function parseSnapshot(e){if(!Type.isPlainObject(e)){return null}const t=e;if(!Type.isNumber(t.status)||t.status<200||t.status>599){return null}if(!Type.isBoolean(t.ok)||!Type.isArray(t.headers)){return null}const n=[];for(const e of t.headers){if(!Type.isArray(e)||e.length!==2||!Type.isString(e[0])||!Type.isString(e[1])){return null}if(transferableHeaderNames.includes(e[0].toLowerCase())){n.push([e[0],e[1]])}}return{status:t.status,ok:t.ok,headers:n,data:t.data}}function rebuildError(e){if(e.errorKind==="http"){const t=fromSnapshot(e.response);return new HttpError(t.status,t)}if(e.errorKind==="timeout"){return new TimeoutError({cause:e.message})}if(e.errorKind==="network"){return new NetworkError({cause:e.message})}return new ParseError({cause:e.message})}function createSettled(){let e=false;return{get value(){return e},mark:()=>{e=true}}}function withCrossTabLock(e,t,n=null){if(!isApplicable(e)){return t()}return runCoordinated(e.key,e.guardTimeout??0,t,n)}async function runCoordinated(e,t,n,r){const s=new BroadcastChannel(e);const i=new Delivery;const o=new AbortController;const a=createSettled();s.onmessage=({data:e})=>{if(i.accept(e)){a.mark();confirm(s,e)}};const l=createGuard(e,t,a);const c=createAbortWatch(r,a);try{const t=await Promise.race([lead(e,s,n,o.signal,a,l.cancel),i.promise,l.promise,c.promise]);return await t()}finally{o.abort();l.cancel();c.cancel();s.close()}}function lead(e,t,n,r,s,i){return new Promise((o=>{globalThis.navigator.locks.request(e,{signal:r},(async()=>{if(r.aborted||s.value){return}i();await runAsLeader(e,t,n,o)})).catch((()=>{}))}))}async function runAsLeader(e,t,n,r){let s;try{s=await n()}catch(n){const s=await broadcast(e,t,toMessage(n));r((()=>Promise.reject(n)));await s();return}const i=await broadcast(e,t,{outcome:"response",...toSnapshot(s)});r((()=>Promise.resolve(s)));await i()}async function broadcast(e,t,n){if(n.outcome==="leaderGone"){t.postMessage(n);return()=>Promise.resolve()}const r=await countWaiting(e);if(Type.isNull(r)){t.postMessage(n);return nextTask}const s=createWindowId();const i=waitForConfirmations(e,s,r);t.postMessage({...n,windowId:s});return()=>i}async function countWaiting(e){const t=globalThis.navigator.locks;if(!Type.isFunction(t.query)){return null}try{const{pending:n=[]}=await t.query();return n.filter((t=>t.name===e)).length}catch{return null}}function waitForConfirmations(e,t,n){if(n===0){return Promise.resolve()}return new Promise((r=>{const s=new BroadcastChannel(e);let i=0;let o=0;const a=()=>{globalThis.clearTimeout(o);s.close();r()};s.onmessage=({data:e})=>{if(isConfirmationOf(e,t)){i+=1;if(i>=n){a()}}};o=globalThis.setTimeout(a,confirmationTimeout)}))}function isConfirmationOf(e,t){return Type.isPlainObject(e)&&e.confirms===t}function confirm(e,t){const n=t.windowId;if(Type.isStringFilled(n)){const t={confirms:n};e.postMessage(t)}}function createWindowId(){return`${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`}function nextTask(){return new Promise((e=>{globalThis.setTimeout(e,0)}))}class Delivery{promise;#N=()=>{};#P=false;constructor(){this.promise=new Promise((e=>{this.#N=e}))}accept(e){const t=this.#P?null:parseMessage(e);if(t===null){return false}if(t.outcome==="response"){this.#P=true;this.#N((()=>Promise.resolve(fromSnapshot(t))));return true}if(t.outcome==="error"){const e=rebuildError(t);this.#P=true;this.#N((()=>Promise.reject(e)));return true}return false}}function createGuard(e,t,n){if(!(t>0)){return{promise:new Promise((()=>{})),cancel:()=>{}}}let r=0;const s=new Promise((s=>{r=globalThis.setTimeout((()=>{const r=new TimeoutError({timeout:t,cause:`Waiting for the cross-tab lock "${e}" timed out`});n.mark();s((()=>Promise.reject(r)))}),t)}));return{promise:s,cancel:()=>globalThis.clearTimeout(r)}}function createAbortWatch(e,t){if(Type.isNull(e)){return{promise:new Promise((()=>{})),cancel:()=>{}}}if(e.aborted){const n=getAbortReason(e);t.mark();return{promise:Promise.resolve((()=>Promise.reject(n))),cancel:()=>{}}}let n=()=>{};const r=new Promise((r=>{n=()=>{const n=getAbortReason(e);t.mark();r((()=>Promise.reject(n)))};e.addEventListener("abort",n,{once:true})}));return{promise:r,cancel:()=>e.removeEventListener("abort",n)}}const retryableStatuses=new Set([408,425,429,500,502,503,504]);const defaultPolicy={retries:0,idempotent:false,delay:300,maxDelay:1e4,respectRetryAfter:true,totalTimeout:0};const maxRetries=100;function pickNumber(e,t,n=Number.MAX_SAFE_INTEGER){if(!Type.isNumber(e)||!Number.isFinite(e)){return t}return Math.min(Math.max(0,e),n)}function pickPositiveNumber(e,t){if(!Type.isNumber(e)||!Number.isFinite(e)||e<=0){return t}return e}function pickBoolean(e,t){return Type.isBoolean(e)?e:t}function normalizeRetryPolicy(e){if(!Type.isPlainObject(e)){return{...defaultPolicy}}return{retries:pickNumber(e.retries,defaultPolicy.retries,maxRetries),idempotent:pickBoolean(e.idempotent,defaultPolicy.idempotent),delay:pickNumber(e.delay,defaultPolicy.delay),maxDelay:pickPositiveNumber(e.maxDelay,defaultPolicy.maxDelay),respectRetryAfter:pickBoolean(e.respectRetryAfter,defaultPolicy.respectRetryAfter),totalTimeout:pickNumber(e.totalTimeout,defaultPolicy.totalTimeout)}}function isRetryableError(e){const{error:t}=e;if(t instanceof NetworkError){return true}if(t instanceof TimeoutError){return true}if(t instanceof HttpError){return retryableStatuses.has(t.status)}return false}const secondsPattern=/^\d+$/;function parseRetryAfter(e,t){const n=e.trim();if(n===""){return null}if(secondsPattern.test(n)){return Number(n)*1e3}const r=Date.parse(n);if(Number.isNaN(r)){return null}return Math.max(0,r-t)}function getRetryAfter(e){if(!(e instanceof HttpError)){return null}const t=e.response?.headers?.get("Retry-After")??null;return Type.isString(t)?parseRetryAfter(t,Date.now()):null}function calculateDelay(e){const{error:t,policy:n,retryCount:r}=e;if(n.respectRetryAfter){const e=getRetryAfter(t);if(!Type.isNull(e)){return Math.min(e,n.maxDelay)}}const s=n.delay*2**r;return Math.round(Math.random()*Math.min(s,n.maxDelay))}function sleep(e,t=null){if(!Type.isNil(t)&&t.aborted){return Promise.reject(getAbortReason(t))}return new Promise(((n,r)=>{let s=0;const i=()=>{window.clearTimeout(s);r(getAbortReason(t))};s=window.setTimeout((()=>{t?.removeEventListener("abort",i);n()}),e);t?.addEventListener("abort",i,{once:true})}))}const safeMethods=new Set(["GET","HEAD","OPTIONS"]);function isRetryableMethod(e,t){return t.idempotent||safeMethods.has(e)}function isNonReusableBody(e){return!Type.isUndefined(globalThis.ReadableStream)&&e instanceof ReadableStream}function isAbortError(e){return e instanceof DOMException&&e.name==="AbortError"}function withRetryCount(e,t){if(e instanceof HttpClientError){e.retryCount=t}return e}function publishRetryCount(e,t,n){e.publishRetryCount?.(t,n);return t}function notifyRetry(e,t){try{e.onRetry?.(t)}catch(e){console.error("main.core HttpClient: the {retry.onRetry} callback has thrown, the retry goes on.",e)}}function spentBefore(e){return Type.isNumber(e.spentRetries)?e.spentRetries:0}function isRetryAllowed(e,t){const{policy:n,strategies:r,method:s,config:i,userSignal:o}=t;if(o?.aborted){return false}if(isAbortError(e.error)){return false}if(e.attempt>n.retries){return false}if(!isRetryableMethod(s,n)){return false}if(isNonReusableBody(i.body)){return false}const a=Type.isFunction(r.shouldRetry)?r.shouldRetry:isRetryableError;return a(e)}async function runAttempts(e,t){const{policy:n,strategies:r,method:s,config:i,userSignal:o}=e;const a=Type.isNumber(e.startedAt)?e.startedAt:Date.now();let l=spentBefore(e);for(;;){l+=1;try{return publishRetryCount(e,await t(),l-1)}catch(t){const c={error:t,attempt:l,retryCount:l-1,method:s,config:i,policy:n};if(!isRetryAllowed(c,e)){throw withRetryCount(t,c.retryCount)}const u=Type.isFunction(r.calculateDelay)?r.calculateDelay:calculateDelay;const p=u(c);if(n.totalTimeout>0&&Date.now()-a+p>=n.totalTimeout){throw withRetryCount(t,c.retryCount)}notifyRetry(r,{...c,delay:p});await sleep(p,o)}}}function runWithRetry(e,t){const n=spentBefore(e);if(e.policy.retries<=0){if(n===0){return t()}return t().then((t=>publishRetryCount(e,t,n)),(e=>{throw withRetryCount(e,n)}))}return runAttempts(e,t)}function isSameOrigin(e,t){if(typeof e!=="string"||e.trim()===""){return false}try{const n=new URL(t??"",window.location.href);const r=new URL(e,n);return r.origin===window.location.origin}catch{return false}}const settingsScriptType="extension/settings";const inFlightAssets=new Map;const loadedAssets=new Set;const scriptOutcomes=new WeakMap;const preparedScriptUrls=new WeakMap;function recordPreparedScriptUrls(e){e.forEach((e=>{const t=e.target;if(t instanceof HTMLScriptElement&&Type.isStringFilled(e.oldValue)&&!preparedScriptUrls.has(t)){preparedScriptUrls.set(t,toAbsoluteUrl(e.oldValue))}}))}function toAbsoluteUrl(e){try{return new URL(e,document.baseURI).toString()}catch{return e}}function getPreparedScriptUrl(e){return preparedScriptUrls.get(e)??e.src}function recordScriptOutcome(e){if(e.isTrusted&&e.target instanceof HTMLScriptElement){scriptOutcomes.set(e.target,{state:e.type==="load"?"loaded":"failed",url:getPreparedScriptUrl(e.target)})}}if(typeof document!=="undefined"){document.addEventListener("load",recordScriptOutcome,true);document.addEventListener("error",recordScriptOutcome,true);new MutationObserver(recordPreparedScriptUrls).observe(document,{subtree:true,attributeFilter:["src"],attributeOldValue:true})}function loadOnce(e,t){const n=inFlightAssets.get(e);if(!Type.isUndefined(n)){return n}const r=t(e).finally((()=>inFlightAssets.delete(e)));inFlightAssets.set(e,r);return r}function resolveAssetUrl(e){if(!Type.isStringFilled(e)){return null}if(!isSameOrigin(e)){console.error(`main.core HttpClient: a cross-origin asset is skipped: ${maskUrl(e)}`);return null}return new URL(e,window.location.href).toString()}function collectAssetUrls(e){if(!Type.isArray(e)){return[]}const t=new Set;e.forEach((e=>{const n=resolveAssetUrl(e);if(!Type.isNull(n)){t.add(n)}}));return[...t]}function findAssetElement(e,t,n,r=()=>true){const s=[...document.querySelectorAll(e)].find((e=>e[t]===n&&r(e)));return s??null}function toLegacyRegistryUrl(e){return e.replace(/^(?:https?:)?\/\/[^/]+/i,"").replace(/\?\d*$/,"")}function dropMinMarker(e){const t=e.indexOf(".min");return t>=0?e.slice(0,t)+e.slice(t+4):e}const legacyRegistryGetters={css:"getCSSList",js:"getJSList"};const legacyRegistrySetters={css:"setCSSList",js:"setJSList"};function isInLegacyRegistry(e,t){const n=window.BX;const r=n?.[legacyRegistryGetters[t]];if(!Type.isFunction(r)){return false}const s=r.call(n);if(!Type.isArray(s)){return false}const i=toLegacyRegistryUrl(e);const o=dropMinMarker(i);return s.includes(i)||i!==o&&s.includes(o)}function registerLoadedAsset(e,t){loadedAssets.add(e);const n=window.BX;const r=n?.[legacyRegistrySetters[t]];if(Type.isFunction(r)){r.call(n,[dropMinMarker(toLegacyRegistryUrl(e))])}}function assetLoadingFailure(e,t){return new AssetLoadError({url:e,assetType:t})}const assetLoadTimeout=7e3;function watchAssetElement(e,t,n,r){return new Promise(((s,i)=>{let o=()=>{};const a=()=>{o();registerLoadedAsset(t,n);s()};const l=()=>{o();if(r){e.remove()}i(assetLoadingFailure(t,n))};const c=window.setTimeout(l,assetLoadTimeout);o=()=>{window.clearTimeout(c);e.removeEventListener("load",a);e.removeEventListener("error",l)};e.addEventListener("load",a);e.addEventListener("error",l)}))}function awaitAssetElement(e,t,n){const r=watchAssetElement(e,t,n,true);document.head.append(e);return r}function awaitForeignAssetElement(e,t,n){const r=n==="css"?e.sheet!==null:scriptOutcomes.get(e)?.state==="loaded";if(r){registerLoadedAsset(t,n);return Promise.resolve()}return watchAssetElement(e,t,n,false)}function isUsableScriptElement(e){const t=e;if(getPreparedScriptUrl(t)!==t.src){return false}const n=scriptOutcomes.get(t);return Type.isUndefined(n)||n.state==="loaded"}function loadStyle(e){if(loadedAssets.has(e)||isInLegacyRegistry(e,"css")){return Promise.resolve()}const t=findAssetElement('link[rel="stylesheet"]',"href",e);if(t!==null){return awaitForeignAssetElement(t,e,"css")}const n=document.createElement("link");n.rel="stylesheet";n.href=e;return awaitAssetElement(n,e,"css")}function loadScript(e){if(loadedAssets.has(e)||isInLegacyRegistry(e,"js")){return Promise.resolve()}const t=findAssetElement("script[src]","src",e,isUsableScriptElement);if(t!==null){return awaitForeignAssetElement(t,e,"js")}const n=document.createElement("script");n.src=e;n.async=false;return awaitAssetElement(n,e,"js")}const assetListCallPattern=/^BX\.set(JS|CSS)List\((\[[\S\s]*])\);?$/;function rebuildSettingsScript(e){const t=document.createElement("script");t.type=settingsScriptType;t.textContent=e.textContent;[...e.attributes].forEach((e=>{if(e.name.startsWith("data-")){t.setAttribute(e.name,e.value)}}));return t}function parseAssetListCall(e){const t=assetListCallPattern.exec(e.textContent?.trim()??"");if(t===null){return null}let n;try{n=JSON.parse(t[2])}catch{return null}if(!Type.isArray(n)||n.some((e=>!Type.isString(e)))){return null}return{registry:t[1]==="JS"?"setJSList":"setCSSList",files:n}}function toSettingsOperation(e){if(e.nodeType===Node.TEXT_NODE&&(e.textContent??"").trim()===""){return undefined}if(!(e instanceof HTMLScriptElement)){return null}if(e.getAttribute("type")===settingsScriptType){if([...e.childNodes].some((e=>e.nodeType!==Node.TEXT_NODE))){return null}return{insert:rebuildSettingsScript(e)}}if(e.getAttribute("type")===REGISTERED_EXTENSIONS_TYPE){if([...e.childNodes].some((e=>e.nodeType!==Node.TEXT_NODE))){return null}return{registrations:parseRegisteredExtensions(e.textContent??"")}}if(e.hasAttribute("type")){return null}return parseAssetListCall(e)}function parseSettingsString(e){const t=document.createElement("template");t.innerHTML=e;const n=[];for(const e of t.content.childNodes){const t=toSettingsOperation(e);if(t===undefined){continue}if(t===null){return null}n.push(t)}return n}function applyAssetListCall(e,t){const n=window.BX;const r=n?.[e];if(Type.isFunction(r)){r.call(n,t)}}const settingsStringStates=new Map;function insertSettingsStrings(e){if(!Type.isArray(e)){return[]}const t=[];const n=new Set(e.filter((e=>Type.isStringFilled(e))));n.forEach((e=>{if(settingsStringStates.get(e)==="applied"){return}const n=parseSettingsString(e);if(n===null){console.error("main.core HttpClient: an inline script asset is skipped, response code is never executed.");return}if(!settingsStringStates.has(e)){n.forEach((e=>{if("insert"in e){document.head.append(e.insert)}}));settingsStringStates.set(e,"inserted")}t.push({item:e,registryCalls:n.filter((e=>"registry"in e)),registrations:n.filter((e=>"registrations"in e)).map((e=>e.registrations))})}));return t}function applySettingsRegistryCalls(e){e.forEach((({item:e,registryCalls:t,registrations:n})=>{if(settingsStringStates.get(e)==="applied"){return}t.forEach((({registry:e,files:t})=>applyAssetListCall(e,t)));n.forEach((e=>registerInActiveRuntime(e)));settingsStringStates.set(e,"applied")}))}async function processAssets(e){if(!Type.isPlainObject(e)){return}const t=insertSettingsStrings(e.string);await Promise.all(collectAssetUrls(e.css).map((e=>loadOnce(e,loadStyle))));await Promise.all(collectAssetUrls(e.js).map((e=>loadOnce(e,loadScript))));applySettingsRegistryCalls(t)}const csrfTokenMessageId="bitrix_sessid";const siteIdMessageId="SITE_ID";function getMessageValue(e){if(!Loc.hasMessage(e)){return null}const t=Loc.getMessage(e);return Type.isStringFilled(t)?t:null}function getCsrfToken(){return getMessageValue(csrfTokenMessageId)}function setCsrfToken(e){Loc.setMessage(csrfTokenMessageId,e)}function getSiteId(){return getMessageValue(siteIdMessageId)}const envelopeStatuses=new Set(["success","denied","error"]);function isAjaxEnvelope(e){return Type.isPlainObject(e)&&envelopeStatuses.has(e.status)&&Object.hasOwn(e,"data")}function parseEnvelope(e){const t=e.data;if(!isAjaxEnvelope(t)){return null}return{status:t.status,data:t.data,errors:Type.isArray(t.errors)?t.errors:[]}}const csrfHeaderName="X-Bitrix-Csrf-Token";const bxAjaxHeaderName="Bx-ajax";const siteIdHeaderName="X-Bitrix-Site-Id";const portalHeaderNames=[csrfHeaderName,bxAjaxHeaderName,siteIdHeaderName];const defaultControllerEndpoint="/bitrix/services/main/ajax.php";const actionNamePattern=/^(?:[\w.-]+:)?[\w-]+(?:\.[\w-]+)+$/;function isValidAnalytics(e){const t=["event","tool","category"];const n=t.find((t=>!Type.isStringFilled(e[t])));if(!Type.isUndefined(n)){console.error(`main.core HttpClient: the "${n}" property in the {analytics} object must be a non-empty string.`);return false}const r=["p1","p2","p3","p4","p5"];const s=r.find((t=>{const n=e[t];return!Type.isUndefined(n)&&(!Type.isString(n)||n.split("_").length>2)}));if(!Type.isUndefined(s)){console.error(`main.core HttpClient: the "${s}" property in the {analytics} object`+" must be a string containing at most one underscore.");return false}return true}function buildAnalyticsParams(e){const t={};const n=e.analyticsLabel;if(Type.isStringFilled(n)||Type.isPlainObject(n)){t.analyticsLabel=n}if(Type.isUndefined(e.analytics)){return t}if(!Type.isPlainObject(e.analytics)){console.error("main.core HttpClient: {analytics} must be an object and is skipped.");return t}if(!Type.isUndefined(t.analyticsLabel)){delete t.analyticsLabel;console.error("main.core HttpClient: only {analytics} or {analyticsLabel} should be used."+" If both are present, {analyticsLabel} will be ignored.")}if(isValidAnalytics(e.analytics)){t.st=e.analytics}else{console.error("main.core HttpClient: {analytics} is invalid and is skipped.")}return t}function buildNavigationValue(e){if(!Type.isPlainObject(e)){return null}const t=[];if(e.page){t.push(`page-${e.page}`)}if(e.size){t.push(`size-${e.size}`)}return t.length>0?t.join("-"):null}function spentRetriesOf(e){return e instanceof HttpClientError?e.retryCount:0}function carryOverSpentBudget(e,t){if(t===null){return}const n=e;n.startedAt=t.startedAt;if(t.spentRetries>0){n.spentRetries=t.spentRetries}}function leaveCrossTabLock(e,t){if(t?.ownRequest){e.crossTabLockKey="";e.skipCrossTabLock=true}}function extractCsrfRetryToken(e){const t=e.errors.find((e=>e?.code==="invalid_csrf"));if(Type.isUndefined(t)){return null}const{customData:n}=t;if(!Type.isPlainObject(n)||!Type.isStringFilled(n.csrf)){return null}return n.csrf}async function loadResponseAssets(e){if(!isSameOrigin(e.raw?.url)||!e.headers.get("X-Process-Assets")){return}const t=parseEnvelope(e)?.data;if(Type.isPlainObject(t)){await processAssets(t.assets)}}class ActionRunner{#X;#L;#_;constructor(e,t){this.#X=e;this.#L=new URL(t.controllerEndpoint??defaultControllerEndpoint,window.location.href).toString();this.#_=isSameOrigin(this.#L)}run(e,t={}){return this.#I(e,t,null)}async#I(e,t,n){if(!Type.isString(e)||!actionNamePattern.test(e)){throw new TypeError(`main.core HttpClient: invalid action name: "${String(e)}".`)}const r=n===null?Date.now():n.startedAt;const s=n?.spentRetries??0;const i=this.#D(e,t,n);let o;try{o=await this.#X.request(i)}catch(i){const o=i instanceof HttpError?i.response:null;const a=o===null?null:parseEnvelope(o);if(o===null||a===null){throw i}return this.#k(a,o,e,t,n,{spentRetries:Math.max(spentRetriesOf(i),s),startedAt:r})}const a=parseEnvelope(o);if(a===null){throw withRetryCount(new ParseError({url:o.raw?.url,responseType:"json"}),o.retryCount)}return this.#k(a,o,e,t,n,{spentRetries:Math.max(o.retryCount,s),startedAt:r})}async#k(e,t,n,r,s,i){const o=s?.csrfToken??null;const a=s?.ownRequest??false;const l=o!==null;if(!l&&isSameOrigin(t.raw?.url)){const t=extractCsrfRetryToken(e);if(t!==null){setCsrfToken(t);return this.#I(n,r,{...i,csrfToken:t,ownRequest:a})}}if(!a&&this.#M(e,t)){return this.#I(n,r,{...i,csrfToken:o,ownRequest:true})}if(e.status!=="success"||!t.ok){throw withRetryCount(new ControllerError({envelope:e,httpStatus:t.status}),i.spentRetries)}try{await loadResponseAssets(t)}catch(e){throw withRetryCount(e,i.spentRetries)}return e}#M(e,t){if(!this.#_||!isRelayedResponse(t)){return false}if(extractCsrfRetryToken(e)!==null){return true}return e.status==="success"&&t.ok&&Boolean(t.headers.get("X-Process-Assets"))}#D(e,t,n){const r={...t.query,...buildAnalyticsParams(t)};const s=buildNavigationValue(t.navigation);if(s!==null){r.nav=s}r.action=e;const i=new Headers(t.headers);if(this.#_){const e=getSiteId();if(e!==null){i.set(siteIdHeaderName,e)}i.set(bxAjaxHeaderName,"true");const t=n?.csrfToken??getCsrfToken();if(t!==null){i.set(csrfHeaderName,t)}}const o={url:this.#L,method:t.method??"POST",query:r,headers:i,redirect:"error"};if(!Type.isUndefined(t.data)){o.body=t.data}if(!Type.isUndefined(t.json)){o.json=t.json}if(!Type.isUndefined(t.timeout)){o.timeout=t.timeout}if(!Type.isUndefined(t.signal)){o.signal=t.signal}if(!Type.isUndefined(t.retry)){o.retry=t.retry}if(!Type.isUndefined(t.crossTabLockKey)){o.crossTabLockKey=t.crossTabLockKey}if(!Type.isUndefined(t.crossTabLockTimeout)){o.crossTabLockTimeout=t.crossTabLockTimeout}leaveCrossTabLock(o,n);carryOverSpentBudget(o,n);return o}}class InterceptorChain{#R=[];#F=0;use(e,t){this.#F+=1;this.#R.push({id:this.#F,onFulfilled:e,onRejected:t??null});return this.#F}eject(e){this.#R=this.#R.filter((t=>t.id!==e))}run(e){return this.#R.reduce(((e,t)=>e.then(t.onFulfilled,t.onRejected??undefined)),Promise.resolve(e))}}const blockedKeys=new Set(["__proto__","constructor","prototype"]);function cloneValue(e){if(Type.isPlainObject(e)){return mergeInto(Object.create(null),e)}if(Type.isArray(e)){return e.map((e=>cloneValue(e)))}return e}function mergeInto(e,t){Object.keys(t).forEach((n=>{if(blockedKeys.has(n)){return}const r=t[n];if(Type.isUndefined(r)){return}const s=e[n];if(Type.isPlainObject(r)&&Type.isPlainObject(s)){mergeInto(s,r);return}e[n]=cloneValue(r)}));return e}function mergeConfig(...e){return e.reduce(((e,t)=>{if(Type.isPlainObject(t)){mergeInto(e,t)}return e}),Object.create(null))}function serializeEntry(e,t,n){if(Type.isUndefined(t)){return}if(Type.isNull(t)){n.push(`${e}=`);return}if(Type.isArray(t)){t.forEach(((t,r)=>serializeEntry(`${e}[${r}]`,t,n)));return}if(Type.isDate(t)){n.push(`${e}=${encodeURIComponent(t.toISOString())}`);return}if(Type.isPlainObject(t)){Object.keys(t).forEach((r=>{serializeEntry(`${e}[${encodeURIComponent(r)}]`,t[r],n)}));return}n.push(`${e}=${encodeURIComponent(String(t))}`)}function serializeQuery(e){if(!Type.isPlainObject(e)){return""}const t=[];Object.keys(e).forEach((n=>{serializeEntry(encodeURIComponent(n),e[n],t)}));return t.join("&")}function getBodyContentType(e,t){if(!Type.isUndefined(t)){return"application/json"}if(Type.isPlainObject(e)){return"application/x-www-form-urlencoded"}return null}function prepareBody(e,t){const n=getBodyContentType(e,t);if(!Type.isUndefined(t)){return{body:JSON.stringify(t),contentType:n}}if(Type.isNil(e)){return{body:null,contentType:n}}if(Type.isPlainObject(e)){return{body:serializeQuery(e),contentType:n}}return{body:e,contentType:n}}const maxTimerDelay=2**31-1;function createTimeoutSignal(e){if(Type.isFunction(AbortSignal.timeout)){return{signal:AbortSignal.timeout(e),cancel:()=>{}}}const t=new AbortController;const n=window.setTimeout((()=>{t.abort(new DOMException(`The operation timed out after ${e}ms`,"TimeoutError"))}),e);return{signal:t.signal,cancel:()=>window.clearTimeout(n)}}function combineSignals(e){if(e.length===0){return{signal:null,cleanup:()=>{}}}if(e.length===1){return{signal:e[0],cleanup:()=>{}}}if(Type.isFunction(AbortSignal.any)){return{signal:AbortSignal.any(e),cleanup:()=>{}}}const t=new AbortController;const n=[];e.forEach((e=>{if(t.signal.aborted){return}if(e.aborted){t.abort(e.reason);return}const r=()=>t.abort(e.reason);e.addEventListener("abort",r,{once:true});n.push((()=>e.removeEventListener("abort",r)))}));return{signal:t.signal,cleanup:()=>n.forEach((e=>e()))}}function buildUrl(e,t,n){const r=new URL(t??"",window.location.href);const s=new URL(e,r);const i=serializeQuery(n);if(i!==""){s.search=s.search===""?i:`${s.search.slice(1)}&${i}`}return s.toString()}function mergeHeaders(...e){const t=new Headers;e.forEach((e=>{if(Type.isNil(e)){return}new Headers(e).forEach(((e,n)=>{t.set(n,e)}))}));return t}function getCrossTabGuardTimeout(e){if(!Type.isNil(e.crossTabLockTimeout)){return e.crossTabLockTimeout}const t=e.timeout??0;if(t<=0||Type.isNil(e.retry)){return t}const n=normalizeRetryPolicy(e.retry);const r=(e.method??"GET").toUpperCase();if(n.retries<=0||!isRetryableMethod(r,n)){return t}const s=(n.retries+1)*t+n.retries*n.maxDelay;const i=n.totalTimeout>0?Math.min(s,n.totalTimeout+t):s;return Math.min(i,maxTimerDelay)}function dropInstanceIdempotent(e){const t=e.retry;if(!Type.isPlainObject(t)||Type.isUndefined(t.idempotent)){return}delete t.idempotent;console.error("main.core HttpClient: {retry.idempotent} of the instance config is ignored \u2014 "+"the statement that a call is safe to repeat belongs to that call, "+"declare it in the request config or the action options.")}class HttpClient{static#H=null;static HttpClientError=HttpClientError;static HttpError=HttpError;static NetworkError=NetworkError;static TimeoutError=TimeoutError;static ParseError=ParseError;static ControllerError=ControllerError;static AssetLoadError=AssetLoadError;static isAjaxEnvelope=isAjaxEnvelope;static parseEnvelope=parseEnvelope;#U;#W;#G;#z=null;interceptors;constructor(e={}){this.#U=mergeConfig(e);dropInstanceIdempotent(this.#U);this.#W=new InterceptorChain;this.#G=new InterceptorChain;this.interceptors={request:this.#W,response:this.#G}}request(e){const t=this.#W.run(this.#V(e)).then((e=>withCrossTabLock({key:e.skipCrossTabLock?"":e.crossTabLockKey,guardTimeout:getCrossTabGuardTimeout(e),responseType:e.responseType},(()=>this.#q(e)),e.signal??null)));return this.#G.run(t)}get(e,t={}){return this.request({...t,url:e,method:"GET"})}delete(e,t={}){return this.request({...t,url:e,method:"DELETE"})}head(e,t={}){return this.request({...t,url:e,method:"HEAD"})}post(e,t=null,n={}){return this.request({...n,url:e,body:t,method:"POST"})}put(e,t=null,n={}){return this.request({...n,url:e,body:t,method:"PUT"})}patch(e,t=null,n={}){return this.request({...n,url:e,body:t,method:"PATCH"})}async action(e,t={}){const n=await this.#Y().run(e,t);return n.data}async actionRaw(e,t={}){return this.#Y().run(e,t)}static get interceptors(){return HttpClient.#J().interceptors}static request(e){return HttpClient.#J().request(e)}static get(e,t){return HttpClient.#J().get(e,t)}static delete(e,t){return HttpClient.#J().delete(e,t)}static head(e,t){return HttpClient.#J().head(e,t)}static post(e,t,n){return HttpClient.#J().post(e,t,n)}static put(e,t,n){return HttpClient.#J().put(e,t,n)}static patch(e,t,n){return HttpClient.#J().patch(e,t,n)}static action(e,t){return HttpClient.#J().action(e,t)}static actionRaw(e,t){return HttpClient.#J().actionRaw(e,t)}static#J(){HttpClient.#H??=new HttpClient;return HttpClient.#H}#Y(){this.#z??=new ActionRunner(this,this.#U);return this.#z}#V(e){const t=mergeConfig(this.#U,{...e,headers:undefined,body:undefined,json:undefined});t.headers=mergeHeaders(this.#U.headers,e.headers);if(!Type.isUndefined(e.body)){t.body=e.body}if(!Type.isUndefined(e.json)){t.json=e.json}const n=getBodyContentType(t.body,t.json);if(!Type.isNull(n)&&!t.headers.has("Content-Type")){t.headers.set("Content-Type",n)}return t}#q(e){const t=e.retry;if(Type.isNil(t)){return this.#K(e)}const n=(e.method??"GET").toUpperCase();return runWithRetry({policy:normalizeRetryPolicy(t),strategies:{shouldRetry:t.shouldRetry,calculateDelay:t.calculateDelay,onRetry:t.onRetry},method:n,config:e,userSignal:e.signal??null,spentRetries:e.spentRetries,startedAt:e.startedAt,publishRetryCount:(e,t)=>{e.retryCount=t}},(()=>this.#K(e)))}async#K(e){const t=this.#Z(e);try{const e=await fetch(t.url,t.init);return await this.#Q(e,t.responseType)}catch(e){throw this.#ee(e,t)}finally{t.timeoutController?.cancel();t.cleanupSignals()}}#Z(e){const t=e.method??"GET";if(["GET","HEAD"].includes(t.toUpperCase())&&(!Type.isNil(e.body)||!Type.isUndefined(e.json))){throw new TypeError(`main.core HttpClient: a ${t.toUpperCase()} request cannot have a body.`)}const n=buildUrl(e.url,e.baseUrl,e.query);const r=mergeHeaders(e.headers);if(!isSameOrigin(n)){portalHeaderNames.forEach((e=>r.delete(e)))}const s=prepareBody(e.body,e.json);const i=e.signal??null;const o=e.timeout??0;const a=[];if(!Type.isNull(i)){a.push(i)}let l=null;if(o>0){l=createTimeoutSignal(o);a.push(l.signal)}const c=portalHeaderNames.some((e=>r.has(e)));const u=combineSignals(a);const p={method:t,headers:r,body:s.body,signal:u.signal,credentials:"same-origin",redirect:c?"error":e.redirect??"follow"};return{url:n,init:p,responseType:e.responseType??"json",timeout:o,timeoutController:l,userSignal:i,cleanupSignals:u.cleanup}}#ee(e,t){if(t.userSignal?.aborted){return e}if(t.timeoutController?.signal.aborted){return new TimeoutError({url:t.url,timeout:t.timeout,cause:e})}if(e instanceof TypeError){return new NetworkError({url:t.url,cause:e})}return e}async#Q(e,t){const n=await this.#te(e,t);const r={status:e.status,ok:e.ok,headers:e.headers,data:n,raw:e,retryCount:0};if(!e.ok){throw new HttpError(e.status,r)}return r}async#te(e,t){try{if(t==="text"){return await e.text()}if(t==="blob"){return await e.blob()}if(t==="formData"){return await e.formData()}const n=await e.text();return n===""?null:JSON.parse(n)}catch(n){if(n instanceof DOMException&&["AbortError","TimeoutError"].includes(n.name)){throw n}if(e.ok){throw new ParseError({url:e.url,responseType:t,cause:n})}return null}}}function getElement(e){if(Type.isString(e)){return document.getElementById(e)}return e}function getWindow(e){if(Type.isElementNode(e)){return e.ownerDocument.parentWindow||e.ownerDocument.defaultView||window}if(Type.isDomNode(e)){return e.parentWindow||e.defaultView||window}return window}class FX{#ne=null;constructor(e){const t=Type.isPlainObject(e)?e:{};const n=Type.isFunction(t.callback)?t.callback:null;const r=Type.isFunction(t.callback_start)?t.callback_start:null;const s=Type.isFunction(t.callback_complete)?t.callback_complete:null;const i={transition:"linear",duration:Type.isNumber(t.time)&&t.time>0?t.time*1e3:1e3,begin:e=>{if(r!==null){r(Type.isUndefined(e._param)?e:e._param)}},step:e=>{if(n!==null){n(Type.isUndefined(e._param)?e:e._param)}},complete:e=>{if(s!==null){s(Type.isUndefined(e._param)?e:e._param)}}};if(Type.isPlainObject(t.start)){i.start=t.start;i.finish=t.finish}else{i.start={_param:t.start};i.finish={_param:t.finish}}if(t.type==="accelerated"){i.transition="quint"}else if(t.type==="decelerated"){t.transition="ease-out-quint"}this.#ne=new Easing(i)}start(){this.#ne.animate();return this}stop(e=false){this.#ne.stop(e)}pause(){}static hide(e,t,n){return this.#re("hide",e,t,n)}static show(e,t,n){return this.#re("show",e,t,n)}static#re(e,t,n,r){let s={};let i=null;const o=Type.isStringFilled(t)?document.getElementById(t):t;if(Type.isPlainObject(n)&&Type.isNil(r)){s=n;i=s.type}else if(Type.isPlainObject(r)){s=r;i=n}if(!Type.isStringFilled(i)){Dom.style(o,"display",e==="show"?"block":"none");return undefined}const a=i==="scroll"?this.#se(o,s,e):this.#ie(o,s,e);a.callback_complete=()=>{if(s.show!==false&&s.hide!==false){Dom.style(o,"display",e==="show"?"block":"none")}if(s.callback_complete){s.callback_complete()}};return new FX(a).start()}static#se(e,t,n){const r=t.direction==="horizontal"?"width":"height";let s=parseInt(String(Dom.style(e,r)),10);if(Number.isNaN(s)){s=Dom.getPosition(e)[r]}const i=s;const o=t.min_height?parseInt(t.min_height,10):0;return{start:i,finish:o,time:t.time||1,type:"linear",callback_start:()=>{if(Dom.style(e,"position")==="static"){Dom.style(e,"position","relative")}Dom.style(e,"overflow","hidden");Dom.style(e,r,`${i}px`);Dom.style(e,"display","block")},callback:t=>{Dom.style(e,r,`${t}px`)}}}static#ie(e,t,n){return{time:t.time||1,type:n==="show"?"linear":"decelerated",start:n==="show"?0:100,finish:n==="show"?100:0,callback_start:()=>{Dom.style(e,"display","block")},callback:t=>{Dom.style(e,"opacity",t/100)}}}}const getClass=Reflection.getClass;const namespace=Reflection.namespace;const message=message$1;const easing=Easing;const fx=FX;const PageObject=Page;const replace=Dom.replace;const remove=Dom.remove;const clean=Dom.clean;const insertBefore=Dom.insertBefore;const insertAfter=Dom.insertAfter;const append=Dom.append;const prepend=Dom.prepend;const style=Dom.style;const adjust=Dom.adjust;const create=Dom.create;const isShown=Dom.isShown;const addClass=function e(){Dom.addClass(...Runtime.merge([],[...arguments],[getElement(arguments[0])]))};const removeClass=function e(){Dom.removeClass(...Runtime.merge([...arguments],[getElement(arguments[0])]))};const hasClass=function e(){return Dom.hasClass(...Runtime.merge([...arguments],[getElement(arguments[0])]))};const toggleClass=function e(){Dom.toggleClass(...Runtime.merge([...arguments],[getElement(arguments[0])]))};const cleanNode=(e,t=false)=>{const n=getElement(e);if(Type.isDomNode(n)){Dom.clean(n);if(t){Dom.remove(n);return n}}return n};const getCookie=Http.Cookie.get;const setCookie=(e,t,n={})=>{const r={...n};if(Type.isNumber(r.expires)){r.expires/=3600*24}Http.Cookie.set(e,t,r)};const bind=Event.bind;const unbind=Event.unbind;const unbindAll=Event.unbindAll;const bindOnce=Event.bindOnce;const ready=Event.ready;const debugEnableFlag=debugState;const debugStatus=isDebugEnabled;const debug=debug$1;const debugEnable=e=>{if(e){enableDebug()}else{disableDebug()}};const clone=Runtime.clone;const loadExt=Runtime.loadExtension;const debounce=Runtime.debounce;const throttle=Runtime.throttle;const html=Runtime.html;const type={...Object.getOwnPropertyNames(Type).filter((e=>!["name","length","prototype","caller","arguments"].includes(e))).reduce(((e,t)=>{e[t]=Type[t];return e}),{}),isNotEmptyString:e=>Type.isString(e)&&e!=="",isNotEmptyObject:e=>Type.isObjectLike(e)&&Object.keys(e).length>0,isMapKey:Type.isObject,stringToInt:e=>{const t=parseInt(e);return Number.isNaN(t)?0:t}};const browser={IsOpera:Browser.isOpera,IsIE:Browser.isIE,IsIE6:Browser.isIE6,IsIE7:Browser.isIE7,IsIE8:Browser.isIE8,IsIE9:Browser.isIE9,IsIE10:Browser.isIE10,IsIE11:Browser.isIE11,IsSafari:Browser.isSafari,IsFirefox:Browser.isFirefox,IsChrome:Browser.isChrome,DetectIeVersion:Browser.detectIEVersion,IsMac:Browser.isMac,IsAndroid:Browser.isAndroid,isIPad:Browser.isIPad,isIPhone:Browser.isIPhone,IsIOS:Browser.isIOS,IsMobile:Browser.isMobile,isRetina:Browser.isRetina,IsDoctype:Browser.isDoctype,SupportLocalStorage:Browser.isLocalStorageSupported,addGlobalClass:Browser.addGlobalClass,DetectAndroidVersion:Browser.detectAndroidVersion,isPropertySupported:Browser.isPropertySupported,addGlobalFeatures:Browser.addGlobalFeatures};function GetWindowScrollSize(e=document){return{scrollWidth:e.documentElement.scrollWidth,scrollHeight:e.documentElement.scrollHeight}}function GetWindowScrollPos(e=document){const t=getWindow(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function GetWindowInnerSize(e=document){const t=getWindow(e);return{innerWidth:t.innerWidth,innerHeight:t.innerHeight}}function GetWindowSize(e=document){return{...GetWindowInnerSize(e),...GetWindowScrollPos(e),...GetWindowScrollSize(e)}}function GetContext(e){return getWindow(e)}function pos(e,t=false){if(!e){return(new DOMRect).toJSON()}if(e.ownerDocument===document&&!t){const t=e.getBoundingClientRect();const n=document.documentElement;const{body:r}=document;return{top:Math.round(t.top+(n.scrollTop||r.scrollTop)),left:Math.round(t.left+(n.scrollLeft||r.scrollLeft)),width:Math.round(t.right-t.left),height:Math.round(t.bottom-t.top),right:Math.round(t.right+(n.scrollLeft||r.scrollLeft)),bottom:Math.round(t.bottom+(n.scrollTop||r.scrollTop))}}let n=0;let r=0;const s=e.offsetWidth;const i=e.offsetHeight;let o=true;for(;e!==null&&e!==undefined;e=e.offsetParent){if(!o&&t&&window.BX.is_relative(e)){break}n+=e.offsetLeft;r+=e.offsetTop;if(o){o=false;continue}n+=Text.toNumber(Dom.style(e,"border-left-width"));r+=Text.toNumber(Dom.style(e,"border-top-width"))}return new DOMRect(n,r,s,i).toJSON()}function addCustomEvent(e,t,n){if(Type.isString(e)){n=t;t=e;e=EventEmitter.GLOBAL_TARGET}if(e===window){e=EventEmitter.GLOBAL_TARGET}if(!Type.isObject(e)){console.error(`The "eventObject" argument must be an object. Received type ${typeof e}.`);return}if(!Type.isStringFilled(t)){console.error('The "eventName" argument must be a string.');return}if(!Type.isFunction(n)){console.error(`The "eventHandler" argument must be a function. Received type ${typeof n}.`);return}t=t.toLowerCase();EventEmitter.subscribe(e,t,n,{compatMode:true,useGlobalNaming:true})}function onCustomEvent(e,t,n,r){if(Type.isString(e)){r=n;n=t;t=e;e=EventEmitter.GLOBAL_TARGET}if(!Type.isObject(e)||e===window){e=EventEmitter.GLOBAL_TARGET}if(!n){n=[]}t=t.toLowerCase();const s=new BaseEvent;s.setData(n);s.setCompatData(n);EventEmitter.emit(e,t,s,{cloneData:r===true,useGlobalNaming:true})}function removeCustomEvent(e,t,n){if(Type.isString(e)){n=t;t=e;e=EventEmitter.GLOBAL_TARGET}if(!Type.isFunction(n)){console.error(`The "eventHandler" argument must be a function. Received type ${typeof n}.`);return}if(e===window){e=EventEmitter.GLOBAL_TARGET}t=t.toLowerCase();EventEmitter.unsubscribe(e,t,n,{useGlobalNaming:true})}function removeAllCustomEvents(e,t){if(Type.isString(e)){t=e;e=EventEmitter.GLOBAL_TARGET}if(e===window){e=EventEmitter.GLOBAL_TARGET}t=t.toLowerCase();EventEmitter.unsubscribeAll(e,t,{useGlobalNaming:true})}function onGlobalCustomEvent(e,t,n){localStorage$1.set("BXGCE",{e:e,p:t},1);if(!n){onCustomEvent(e,t)}}function ext(e){for(const t in e){if(Object.prototype.hasOwnProperty.call(e,t)){this[t]=e[t]}}}function extend(e,t){const n=function(){};n.prototype=t.prototype;e.prototype=new n;e.prototype.constructor=e;e.superclass=t.prototype;e.prototype.superclass=t.prototype;if(t.prototype.constructor==Object.prototype.constructor){t.prototype.constructor=t}}function is_subclass_of(e,t){if(e instanceof t){return true}if(t.superclass){return is_subclass_of(e,t.superclass)}return false}function merge(...e){if(e.length<2){return{}}const t=e.shift();for(const n of e){for(const e in n){if(typeof n==="undefined"||n==null){continue}if(Object.prototype.hasOwnProperty.call(n,e)){if(typeof n[e]==="undefined"||n[e]==null){continue}if(typeof n[e]==="object"&&!BX$2.type.isDomNode(n[e])&&typeof n[e].isUIWidget==="undefined"){const r="length"in n[e];if(typeof t[e]!=="object"){t[e]=r?[]:{}}if(r){BX$2.util.array_merge(t[e],n[e])}else{merge(t[e],n[e])}}else{t[e]=n[e]}}}}return t}function mergeEx(...e){if(e.length<2){return{}}const t=e.shift();for(const n of e){for(const e in n){if(typeof n==="undefined"||n==null||!Object.prototype.hasOwnProperty.call(n,e)){continue}if(BX$2.type.isPlainObject(n[e])&&BX$2.type.isPlainObject(t[e])){mergeEx(t[e],n[e])}else{t[e]=BX$2.type.isPlainObject(n[e])?BX$2.clone(n[e]):n[e]}}}return t}const prop={get(e,t,n){return e&&Object.prototype.hasOwnProperty.call(e,t)?e[t]:n},getObject(e,t,n){return e&&BX$2.type.isPlainObject(e[t])?e[t]:n},getElementNode(e,t,n){return e&&BX$2.type.isElementNode(e[t])?e[t]:n},getArray(e,t,n){return e&&BX$2.type.isArray(e[t])?e[t]:n},getFunction(e,t,n){return e&&BX$2.type.isFunction(e[t])?e[t]:n},getNumber(e,t,n){if(!(e&&Object.prototype.hasOwnProperty.call(e,t))){return n}let r=e[t];if(BX$2.type.isNumber(r)){return r}r=parseFloat(r);return isNaN(r)?n:r},getInteger(e,t,n){if(!(e&&Object.prototype.hasOwnProperty.call(e,t))){return n}let r=e[t];if(BX$2.type.isNumber(r)){return r}r=parseInt(r);return isNaN(r)?n:r},getBoolean(e,t,n){if(!(e&&Object.prototype.hasOwnProperty.call(e,t))){return n}const r=e[t];return BX$2.type.isBoolean(r)?r:BX$2.type.isString(r)?r.toLowerCase()==="true":Boolean(r)},getString(e,t,n){if(!(e&&Object.prototype.hasOwnProperty.call(e,t))){return n}const r=e[t];return BX$2.type.isString(r)?r:r?r.toString():""},extractDate(e){if(!BX$2.type.isDate(e)){e=new Date}e.setHours(0);e.setMinutes(0);e.setSeconds(0);e.setMilliseconds(0);return e}};const proxyList=new WeakMap;const deferList=new WeakMap;const garbageCollectors=[];BX$2.proxy_context=null;function delegate(e,t){if(!e||!t){return e}return function(){const n=BX$2.proxy_context;BX$2.proxy_context=this;const r=e.apply(t,arguments);BX$2.proxy_context=n;return r}}function delegateLater(e,t,n){return function(){if(t[e]){const r=BX$2.proxy_context;BX$2.proxy_context=this;const s=t[e].apply(n||t,arguments);BX$2.proxy_context=r;return s}return null}}function proxy(e,t){return getObjectDelegate(e,t,proxyList)}function defer(e,t){if(t){return defer_proxy(e,t)}return function(){const t=arguments;setTimeout((function(){e.apply(this,t)}),10)}}function defer_proxy(e,t){return getObjectDelegate(e,t,deferList,defer)}function getObjectDelegate(e,t,n,r){if(!BX$2.type.isFunction(e)||!BX$2.type.isMapKey(t)){return e}let s=n.get(t);if(!s){s=new WeakMap;n.set(t,s)}let i=s.get(e);if(!i){i=r?r(delegate(e,t)):delegate(e,t);s.set(e,i)}return i}function once(e,t,n){const r=function(){BX$2.unbind(e,t,r);n.apply(this,arguments)};return r}function bindDelegate(e,t,n,r){const s=delegateEvent(n,r);BX$2.bind(e,t,s);return s}function delegateEvent(e,t){return function(n){n=n||window.event;let r=n.target||n.srcElement;while(r!=this){if(checkNode(r,e)){return t.call(r,n)}if(r&&r.parentNode){r=r.parentNode}else{break}}return null}}function garbage(e,t){garbageCollectors.push({callback:e,context:t})}window.addEventListener("pagehide",(()=>{garbageCollectors.forEach((({callback:e,context:t=window})=>{try{e.apply(t)}catch(e){}}))}));function setOpacity(e,t){let n=Number.parseFloat(t);if(!isNaN(n)&&BX$2.type.isDomNode(e)){n=n<1?n:n/100;BX$2.style(e,"opacity",n)}}function show(e,t){if(e.BXDISPLAY||!_checkDisplay(e,t)){e.style.display=e.BXDISPLAY}}function hide(e,t){if(!e.BXDISPLAY){_checkDisplay(e,t)}e.style.display="none"}function toggle(e,t){if(!t&&BX$2.type.isElementNode(e)){let t=true;if(e.BXDISPLAY){t=!_checkDisplay(e)}else{t=e.style.display=="none"}if(t){BX$2.show(e)}else{BX$2.hide(e)}}else if(BX$2.type.isArray(t)){let n;let r;for(n=0,r=t.length;n=0){i=e.right-t}else{i=a.scrollLeft}}if(l.innerHeight+a.scrollTop-(e.bottom+n)<0||~r.indexOf("top")){if(e.top-n>=0||~r.indexOf("top")){o=e.top-n}else{o=a.scrollTop}}return{left:i,top:o}}function scrollToNode(e){const t=resolve(e);if(t.scrollIntoView){t.scrollIntoView(true)}else{const e=BX$2.pos(t);window.scrollTo(e.left,e.top)}}function styleIEPropertyName(e){if(e=="float"){e="cssFloat"}else{const t=BX$2.browser.isPropertySupported(e);if(t){e=t}else{const t=/(-([a-z]){1})/g;if(t.test(e)){e=e.replace(t,(function(){return arguments[2].toUpperCase()}))}}}return e}function focus(e){try{e.focus();return true}catch(e){return false}}function hoverEvents(e){if(e){return BX$2.adjust(e,{events:hoverEvents()})}return{mouseover:hoverEventsHover,mouseout:hoverEventsHout}}function hoverEventsHover(){BX$2.addClass(this,"bx-hover");this.BXHOVER=true}function hoverEventsHout(){BX$2.removeClass(this,"bx-hover");this.BXHOVER=false}function focusEvents(e){if(e){return BX$2.adjust(e,{events:focusEvents()})}return{mouseover:focusEventsFocus,mouseout:focusEventsBlur}}function focusEventsFocus(){BX$2.addClass(this,"bx-focus");this.BXFOCUS=true}function focusEventsBlur(){BX$2.removeClass(this,"bx-focus");this.BXFOCUS=false}function setUnselectable(e){BX$2.style(e,{userSelect:"none",MozUserSelect:"none",WebkitUserSelect:"none",KhtmlUserSelect:"none"});e.setAttribute("unSelectable","on")}function setSelectable(e){BX$2.style(e,{userSelect:null,MozUserSelect:null,WebkitUserSelect:null,KhtmlUserSelect:null});e.removeAttribute("unSelectable")}function getCaretPosition(e){let t=0;if(e.selectionStart||e.selectionStart==0){t=e.selectionStart}else if(document.selection){e.focus();const n=document.selection.createRange();n.moveStart("character",-e.value.length);t=n.text.length}return t}function setCaretPosition(e,t){if(!isNodeInDom(e)||isNodeHidden(e)||e.disabled){return}if(e.setSelectionRange){e.focus();e.setSelectionRange(t,t)}else if(e.createTextRange){const n=e.createTextRange();n.collapse(true);n.moveEnd("character",t);n.moveStart("character",t);n.select()}}let lastWait=[];function showWait(e,t){e=resolve(e)||document.body||document.documentElement;t=t||BX$2.message("JS_CORE_LOADING");const n=e.id||Math.random();const r=e.bxmsg=document.body.appendChild(BX$2.create("DIV",{props:{id:`wait_${n}`},style:{background:'url("/bitrix/js/main/core/images/wait.gif") no-repeat scroll 10px center #fcf7d1',border:"1px solid #E1B52D",color:"black",fontFamily:"Verdana,Arial,sans-serif",fontSize:"11px",padding:"10px 30px 10px 37px",position:"absolute",textAlign:"center"},text:t}));BX$2.ZIndexManager.register(r);BX$2.ZIndexManager.bringToFront(r);setTimeout(delegate(_adjustWait,e),10);lastWait[lastWait.length]=r;return r}function closeWait(e,t){if(e&&!t){t=e.bxmsg}if(e&&!t&&BX$2.hasClass(e,"bx-core-waitwindow")){t=e}if(e&&!t){t=resolve(`wait_${e.id}`)}if(!t){t=lastWait.pop()}if(t&&t.parentNode){for(let e=0,n=lastWait.length;ec.length){c=r.match(/(DD|MI|MMMM|MM|M|YYYY|HH|H|SS|TT|T|GG|G)/gi)}for(s=0,i=l.length;s0){u[d]=getNumMonth(u[d]);p[d]="MM"}else{d=util.array_search("M",p);if(d>0){u[d]=getNumMonth(u[d]);p[d]="MM"}}for(s=0,i=p.length;s0&&f.MM>0&&f.YYYY>0){const e=new Date;if(t){e.setUTCDate(1);e.setUTCFullYear(f.YYYY);e.setUTCMonth(f.MM-1);e.setUTCDate(f.DD);e.setUTCHours(0,0,0,0)}else{e.setDate(1);e.setFullYear(f.YYYY);e.setMonth(f.MM-1);e.setDate(f.DD);e.setHours(0,0,0,0)}if((!isNaN(f.HH)||!isNaN(f.GG)||!isNaN(f.H)||!isNaN(f.G))&&!isNaN(f.MI)){if(!isNaN(f.H)||!isNaN(f.G)){const e=(f.T||f.TT||"am").toUpperCase()=="PM";const t=parseInt(f.H||f.G||0,10);if(e){f.HH=t+(t==12?0:12)}else{f.HH=t<12?t:0}}else{f.HH=parseInt(f.HH||f.GG||0,10)}if(isNaN(f.SS)){f.SS=0}if(t){e.setUTCHours(f.HH,f.MI,f.SS)}else{e.setHours(f.HH,f.MI,f.SS)}}return e}}return null}BX$2.CHint=function(e){if(BX$2.CHint.cssLoaded===false){load(["/bitrix/js/main/core/css/core_hint.css"]);BX$2.CHint.cssLoaded=true}this.PARENT=resolve(e.parent);this.HINT=e.hint;this.HINT_TITLE=e.title;this.PARAMS={};for(const t in this.defaultSettings){if(e[t]==null){this.PARAMS[t]=this.defaultSettings[t]}else{this.PARAMS[t]=e[t]}}if(e.id!=null){this.ID=e.id}this.timer=null;this.bInited=false;this.msover=true;if(this.PARAMS.showOnce){this.__show();this.msover=false;this.timer=setTimeout(proxy(this.__hide,this),this.PARAMS.hide_timeout)}else if(this.PARENT){BX$2.bind(this.PARENT,"mouseover",proxy(this.Show,this));BX$2.bind(this.PARENT,"mouseout",proxy(this.Hide,this))}};BX$2.CHint.cssLoaded=false;BX$2.CHint.openHints=new Set;BX$2.CHint.globalDisabled=false;BX$2.CHint.handleMenuOpen=function(){BX$2.CHint.globalDisabled=true;BX$2.CHint.openHints.forEach((function(e){e.__hide_immediately()}))};BX$2.CHint.handleMenuClose=function(){BX$2.CHint.globalDisabled=false};BX$2.CHint.prototype.defaultSettings={show_timeout:1e3,hide_timeout:500,dx:2,showOnce:false,preventHide:true,min_width:250};BX$2.CHint.prototype.CreateParent=function(e,t){if(this.PARENT){BX$2.unbind(this.PARENT,"mouseover",proxy(this.Show,this));BX$2.unbind(this.PARENT,"mouseout",proxy(this.Hide,this))}if(!t){t={}}let n="icon";if(t.type&&(t.type=="link"||t.type=="icon")){n=t.type}if(e){n="element"}if(n=="icon"){e=BX$2.create("IMG",{props:{src:t.iconSrc?t.iconSrc:"/bitrix/js/main/core/images/hint.gif"}})}else if(n=="link"){e=BX$2.create("A",{props:{href:"javascript:void(0)"},html:"[?]"})}this.PARENT=e;BX$2.bind(this.PARENT,"mouseover",proxy(this.Show,this));BX$2.bind(this.PARENT,"mouseout",proxy(this.Hide,this));return this.PARENT};BX$2.CHint.prototype.Show=function(){this.msover=true;if(this.timer!=null){clearTimeout(this.timer)}this.timer=setTimeout(proxy(this.__show,this),this.PARAMS.show_timeout)};BX$2.CHint.prototype.Hide=function(){this.msover=false;if(this.timer!=null){clearTimeout(this.timer)}this.timer=setTimeout(proxy(this.__hide,this),this.PARAMS.hide_timeout)};BX$2.CHint.prototype.__show=function(){if(!this.msover||this.disabled||BX$2.CHint.globalDisabled){return}if(!this.bInited){this.Init()}if(this.prepareAdjustPos()){this.DIV.style.display="block";BX$2.ZIndexManager.bringToFront(this.DIV);this.adjustPos();BX$2.CHint.openHints.add(this);BX$2.bind(window,"scroll",proxy(this.__onscroll,this));if(this.PARAMS.showOnce){this.timer=setTimeout(proxy(this.__hide,this),this.PARAMS.hide_timeout)}}};BX$2.CHint.prototype.__onscroll=function(){if(!BX$2.admin||!BX$2.admin.panel||!BX$2.admin.panel.isFixed()){return}if(this.scrollTimer){clearTimeout(this.scrollTimer)}this.DIV.style.display="none";this.scrollTimer=setTimeout(proxy(this.Reopen,this),this.PARAMS.show_timeout)};BX$2.CHint.prototype.Reopen=function(){if(this.timer!=null){clearTimeout(this.timer)}this.timer=setTimeout(proxy(this.__show,this),50)};BX$2.CHint.prototype.__hide=function(){if(this.msover){return}if(!this.bInited){return}BX$2.unbind(window,"scroll",proxy(this.Reopen,this));BX$2.CHint.openHints.delete(this);if(this.PARAMS.showOnce){this.Destroy()}else{this.DIV.style.display="none"}};BX$2.CHint.prototype.__hide_immediately=function(){this.msover=false;this.__hide()};BX$2.CHint.prototype.Init=function(){this.DIV=document.body.appendChild(BX$2.create("DIV",{props:{className:"bx-panel-tooltip"},style:{display:"none",position:"absolute",visibility:"hidden"},children:[this.CONTENT=BX$2.create("DIV",{props:{className:"bx-panel-tooltip-content"},children:[BX$2.create("DIV",{props:{className:"bx-panel-tooltip-underlay"},children:[BX$2.create("DIV",{props:{className:"bx-panel-tooltip-underlay-bg"}})]})]})]}));BX$2.ZIndexManager.register(this.DIV);if(this.ID){this.CONTENT.insertBefore(BX$2.create("A",{attrs:{href:"javascript:void(0)"},props:{className:"bx-panel-tooltip-close"},events:{click:delegate(this.Close,this)}}),this.CONTENT.firstChild)}if(this.HINT_TITLE){this.CONTENT.appendChild(BX$2.create("DIV",{props:{className:"bx-panel-tooltip-title"},text:this.HINT_TITLE}))}if(this.HINT){this.CONTENT_TEXT=this.CONTENT.appendChild(BX$2.create("DIV",{props:{className:"bx-panel-tooltip-text"}})).appendChild(BX$2.create("SPAN",{html:this.HINT}))}if(this.PARAMS.preventHide){BX$2.bind(this.DIV,"mouseout",proxy(this.Hide,this));BX$2.bind(this.DIV,"mouseover",proxy(this.Show,this))}this.bInited=true};BX$2.CHint.prototype.setContent=function(e){this.HINT=e;if(this.CONTENT_TEXT){this.CONTENT_TEXT.innerHTML=this.HINT}else{this.CONTENT_TEXT=this.CONTENT.appendChild(BX$2.create("DIV",{props:{className:"bx-panel-tooltip-text"}})).appendChild(BX$2.create("SPAN",{html:this.HINT}))}};BX$2.CHint.prototype.prepareAdjustPos=function(){this._wnd={scrollPos:BX$2.GetWindowScrollPos(),scrollSize:BX$2.GetWindowScrollSize()};return BX$2.style(this.PARENT,"display")!="none"};BX$2.CHint.prototype.getAdjustPos=function(){const e={};const t=BX$2.pos(this.PARENT);let n=0;e.top=t.bottom+this.PARAMS.dx;if(BX$2.admin&&BX$2.admin.panel.DIV){n=BX$2.admin.panel.DIV.offsetHeight+this.PARAMS.dx;if(BX$2.admin.panel.isFixed()){n+=this._wnd.scrollPos.scrollTop}}if(e.topthis._wnd.scrollSize.scrollHeight){e.top=t.top-this.PARAMS.dx-this.DIV.offsetHeight}e.left=t.left;if(t.left>=this.PARAMS.dx){const t=this.DIV.offsetWidth;const n=this._wnd.scrollSize.scrollWidth-t-this.PARAMS.dx;if(e.left>n){e.left=n}}return e};BX$2.CHint.prototype.adjustWidth=function(){if(this.bWidthAdjusted){return}let e=this.DIV.offsetWidth;const t=this.DIV.offsetHeight;if(e>this.PARAMS.min_width){e=Math.round(Math.sqrt(1.618*e*t))}if(e0&&r>0&&n-r=0;t--){e.remove(t)}}},optionCompare(e,t){const n=e.optText.toLowerCase();const r=t.optText.toLowerCase();if(n>r){return 1}if(n0&&e[n-1].selected==false){const t=new Option(e[n].text,e[n].value);e[n]=new Option(e[n-1].text,e[n-1].value);e[n].selected=false;e[n-1]=t;e[n-1].selected=true}}},moveOptionsDown(e){e=resolve(e);if(!e){return}const t=e.length;for(let n=t-1;n>=0;n--){if(e[n].selected&&ne.name==="Content-Type")).pop();return t?t.value:null};const ajax=function(e){let t;if(!e||!e.url||!BX$2.type.isString(e.url)){return false}for(const t in tempDefaultConfig){if(typeof e[t]==="undefined"){e[t]=tempDefaultConfig[t]}}tempDefaultConfig={};for(const t in defaultConfig){if(typeof e[t]==="undefined"){e[t]=defaultConfig[t]}}e.method=e.method.toUpperCase();if(!BX$2.localStorage){e.lsId=null}if(BX$2.browser.IsIE()){let t=r.url_utf.exec(e.url);if(t){do{e.url=e.url.replace(t,BX$2.util.urlencode(t));t=r.url_utf.exec(e.url)}while(t)}}if(e.dataType=="json"){e.emulateOnload=false}if(!e.cache&&e.method=="GET"){e.url=BX$2.ajax._uncache(e.url)}if(e.method=="POST"){if(e.preparePost){e.data=BX$2.ajax.prepareData(e.data)}else if(getLastContentTypeHeader(e.headers)==="application/json"){const t=BX$2.Type.isPlainObject(e.data)||BX$2.Type.isString(e.data)||BX$2.Type.isNumber(e.data)||BX$2.Type.isBoolean(e.data)||BX$2.Type.isArray(e.data);if(t){e.data=JSON.stringify(e.data)}}}let n=true;if(e.lsId&&!e.lsForce){const t=BX$2.localStorage.get("ajax-"+e.lsId);if(t!==null){n=false;const r=function(t){if(t.key=="ajax-"+e.lsId&&t.value!="BXAJAXWAIT"){const n=t.value;const s=!!t.oldValue&&n==null;if(!s){BX$2.ajax.__run(e,n)}else if(e.onfailure){e.onfailure("timeout")}BX$2.removeCustomEvent("onLocalStorageChange",r)}};if(t=="BXAJAXWAIT"){BX$2.addCustomEvent("onLocalStorageChange",r)}else{setTimeout((()=>{r({key:"ajax-"+e.lsId,value:t})}),10)}}}if(n){e.xhr=BX$2.ajax.xhr();if(!e.xhr){return undefined}if(e.lsId){BX$2.localStorage.set("ajax-"+e.lsId,"BXAJAXWAIT",e.lsTimeout)}if(BX$2.Type.isFunction(e.onprogress)){BX$2.bind(e.xhr,"progress",e.onprogress)}if(BX$2.Type.isFunction(e.onprogressupload)&&e.xhr.upload){BX$2.bind(e.xhr.upload,"progress",e.onprogressupload)}e.xhr.open(e.method,e.url,e.async);if(!e.skipBxHeader&&!BX$2.ajax.isCrossDomain(e.url)){e.xhr.setRequestHeader("Bx-ajax","true")}if(e.method=="POST"&&e.preparePost){e.xhr.setRequestHeader("Content-Type","application/x-www-form-urlencoded")}if(typeof e.headers==="object"){for(let t=0;t0){setTimeout((()=>{if(e.xhr&&!n){r("timeout")}}),e.timeout*1e3)}if(e.start){e.xhr.send(e.data);if(!e.async){r("run")}}return e.xhr}return undefined};ajax.xhr=function(){if(window.XMLHttpRequest){try{return new XMLHttpRequest}catch(e){}}else if(window.ActiveXObject){const e=window.ActiveXObject;try{return new e("Msxml2.XMLHTTP.6.0")}catch(e){}try{return new e("Msxml2.XMLHTTP.3.0")}catch(e){}try{return new e("Msxml2.XMLHTTP")}catch(e){}try{return new e("Microsoft.XMLHTTP")}catch(e){}throw new Error("This browser does not support XMLHttpRequest.")}return null};ajax.isCrossDomain=function(e,t){t=t||window.location;if(e.indexOf("//")===0){e=t.protocol+e}if(e.indexOf("http")!==0){return false}const n=window.document.createElement("a");n.href=e;return n.protocol!==t.protocol||n.hostname!==t.hostname||BX$2.ajax.getHostPort(n.protocol,n.host)!==BX$2.ajax.getHostPort(t.protocol,t.host)};ajax.getHostPort=function(e,t){const n=/:(\d+)$/.exec(t);if(n){return n[1]}if(e==="http:"){return"80"}else if(e==="https:"){return"443"}return""};ajax.__prepareOnload=function(e,t){if(e.length>0){BX$2.ajax["onload_"+t]=null;for(let n=0,s=e.length;n0){BX$2.loadCSS(s)}let o=null;if(t.emulateOnload){o=parseInt(String(Math.random()*1e6));BX$2.ajax.__prepareOnload(r,o)}const a=BX$2.defer((()=>{if(t.emulateOnload){BX$2.ajax.__runOnload(o)}BX$2.onCustomEvent(t.xhr,"onAjaxSuccessFinish",[t])}));try{if(t.jsonFailure){throw{type:"json_failure",data:t.jsonResponse,bProactive:t.jsonProactive}}t.scripts=r;BX$2.ajax.processScripts(t.scripts,true);if(t.onsuccess){t.onsuccess(n)}BX$2.onCustomEvent(t.xhr,"onAjaxSuccess",[n,t]);BX$2.ajax.processScripts(t.scripts,false,a,(()=>{Object.entries(i).forEach((([e,t])=>{BX$2.Runtime.registerExtension({name:e,namespace:t})}))}))}catch(e){if(t.onfailure){t.onfailure("processing",e)}BX$2.onCustomEvent(t.xhr,"onAjaxFailure",["processing",e,t])}};ajax.processScripts=function(e,t,n,r){let s=[];let i="";n=n||BX$2.DoNothing;for(let n=0,r=e.length;n0){BX$2.evalGlobal(i)}};if(s.length>0){BX$2.load(s,(()=>{o();n()}))}else{o();n()}};ajax.prepareData=function(e,t){let n="";if(BX$2.type.isString(e)){n=e}else if(e!=null){for(const r in e){if(e.hasOwnProperty(r)){if(n.length>0){n+="&"}let s=BX$2.util.urlencode(r);if(t){s=t+"["+s+"]"}if(typeof e[r]==="object"){n+=BX$2.ajax.prepareData(e[r],s)}else{n+=s+"="+BX$2.util.urlencode(e[r])}}}}return n};ajax.xhrSuccess=function(e){return e.status>=200&&e.status<300||e.status===304||e.status===1223||e.status===0};ajax.Setup=function(e,t){t=!!t;for(const n in e){if(t){tempDefaultConfig[n]=e[n]}else{defaultConfig[n]=e[n]}}};ajax.replaceLocalStorageValue=function(e,t,n){if(BX$2.localStorage){BX$2.localStorage.set("ajax-"+e,t,n)}};ajax._uncache=function(e){return e+((e.indexOf("?")!==-1?"&":"?")+"_="+Date.now())};ajax.get=function(e,t,n){if(BX$2.type.isFunction(t)){n=t;t=""}t=BX$2.ajax.prepareData(t);if(t){e+=(e.indexOf("?")!==-1?"&":"?")+t;t=""}return BX$2.ajax({method:"GET",dataType:"html",url:e,data:"",onsuccess:n})};ajax.getCaptcha=function(e){return BX$2.ajax.loadJSON("/bitrix/tools/ajax_captcha.php",e)};ajax.insertToNode=function(e,t){t=resolve(t);if(t){const n={cancel:false};BX$2.onCustomEvent("onAjaxInsertToNode",[{url:e,node:t,eventArgs:n}]);if(n.cancel===true){return undefined}let r=null;if(!tempDefaultConfig.denyShowWait){r=BX$2.showWait(t);delete tempDefaultConfig.denyShowWait}return BX$2.ajax.get(e,(e=>{t.innerHTML=e;BX$2.closeWait(t,r)}))}return undefined};ajax.post=function(e,t,n){t=BX$2.ajax.prepareData(t);return BX$2.ajax({method:"POST",dataType:"html",url:e,data:t,onsuccess:n})};ajax.promise=function(e){const t=new BX$2.Promise;e.onsuccess=function(e){t.fulfill(e)};e.onfailure=function(n,r,s){const i=s||e;t.reject({reason:n,data:r,ajaxConfig:i,xhr:i.xhr})};const n=BX$2.ajax(e);if(n){if(typeof e.onrequeststart==="function"){e.onrequeststart(n)}}else{t.reject({reason:"init",data:false})}return t};ajax.loadScriptAjax=function(e,t,n){if(BX$2.type.isArray(e)){for(let r=0,s=e.length;r2){console.error(`BX.ajax: The "${t}" property (${n}) in the "analytics" object must be a string containing a single underscore.`);return false}}return true};const processAnalyticsDataToGetParameters=function(e){const t={};if(BX$2.Type.isStringFilled(e.analyticsLabel)||BX$2.Type.isPlainObject(e.analyticsLabel)){t.analyticsLabel=e.analyticsLabel}if(BX$2.Type.isPlainObject(e.analytics)){if(e.analyticsLabel){delete t.analyticsLabel;console.error("BX.ajax: Only {analytics} or {analyticsLabel} should be used. If both are present, {analyticsLabel} will be ignored.")}if(isValidAnalyticsData(e.analytics)){t.st=e.analytics}else{console.error("BX.ajax: {analytics} is invalid and is skipped.")}}return t};const prepareAjaxGetParameters=function(e){let t=e.getParameters||{};t={...t,...processAnalyticsDataToGetParameters(e)};if(typeof e.mode!=="undefined"){t.mode=e.mode}if(e.navigation){if(e.navigation.page){t.nav="page-"+e.navigation.page}if(e.navigation.size){if(t.nav){t.nav+="-"}else{t.nav=""}t.nav+="size-"+e.navigation.size}}return t};const prepareAjaxConfig=function(e){e=BX$2.type.isPlainObject(e)?e:{};e.headers=e.headers||[];e.headers.push({name:"X-Bitrix-Csrf-Token",value:BX$2.bitrix_sessid()});if(BX$2.message.SITE_ID){e.headers.push({name:"X-Bitrix-Site-Id",value:BX$2.message.SITE_ID})}if(typeof e.json!=="undefined"){if(!BX$2.type.isPlainObject(e.json)){throw new Error("Wrong `config.json`, plain object expected.")}e.headers.push({name:"Content-Type",value:"application/json"});e.data=e.json;e.preparePost=false}else if(e.data instanceof FormData){e.preparePost=false;if(typeof e.signedParameters!=="undefined"){e.data.append("signedParameters",e.signedParameters)}}else if(BX$2.type.isPlainObject(e.data)||BX$2.Type.isNil(e.data)){e.data=BX$2.type.isPlainObject(e.data)?e.data:{};if(typeof e.signedParameters!=="undefined"){e.data.signedParameters=e.signedParameters}}if(!e.method){e.method="POST"}return e};const buildAjaxPromiseToRestoreCsrf=function(e,t){t=t||false;const n=BX$2.clone(e);let r=null;const s=e.onrequeststart;e.onrequeststart=function(e){r=e;if(BX$2.type.isFunction(s)){s(e)}};const i=n.onrequeststart;n.onrequeststart=function(e){r=e;if(BX$2.type.isFunction(i)){i(e)}};const o=BX$2.ajax.promise(e);return o.then((e=>{if(!t&&BX$2.type.isPlainObject(e)&&BX$2.type.isArray(e.errors)){let t=false;e.errors.forEach((e=>{if(e.code==="invalid_csrf"&&e.customData.csrf){BX$2.message({bitrix_sessid:e.customData.csrf});n.headers=n.headers||[];n.headers=n.headers.filter((e=>e&&e.name!=="X-Bitrix-Csrf-Token"));n.headers.push({name:"X-Bitrix-Csrf-Token",value:BX$2.bitrix_sessid()});t=true}}));if(t){return buildAjaxPromiseToRestoreCsrf(n,true)}}if(!BX$2.type.isPlainObject(e)||e.status!=="success"){const t=new BX$2.Promise;t.reject(e);return t}return e})).catch((e=>{const t=new BX$2.Promise;let n;if(BX$2.type.isPlainObject(e)&&e.xhr&&e.xhr.responseText){try{n=JSON.parse(e.xhr.responseText);e=n}catch(e){}}if(BX$2.type.isPlainObject(e)&&e.status&&e.hasOwnProperty("data")){t.reject(e)}else{t.reject({status:"error",data:{ajaxRejectData:e},errors:[{code:"NETWORK_ERROR",message:"Network error"}]})}return t})).then((e=>{const t=new BX$2.Promise;const n=r.getAllResponseHeaders().trim().split(/[\r\n]+/);const s={};n.forEach((e=>{const t=e.split(": ");const n=t.shift().toLowerCase();s[n]=t.join(": ")}));if(!s["x-process-assets"]){t.fulfill(e);return t}const i=BX$2.prop.getObject(BX$2.prop.getObject(e,"data",{}),"assets",{});const o=[];if(BX$2.Type.isArrayFilled(i.string)){i.string.reduce(((e,t)=>{if(String(t).length>0&&!e.includes(t)){e.push(t)}return e}),[]).forEach((e=>{if(String(e).startsWith('