| 1 |
(function(r,c){var l=Object.create,u=Object.defineProperty,__name=(r,c)=>u(r,`name`,{value:c,configurable:!0}),p=Object.getOwnPropertyDescriptor,m=Object.getOwnPropertyNames,h=Object.getPrototypeOf,g=Object.prototype.hasOwnProperty,__esmMin=(r,c,l)=>()=>{if(l)throw l[0];try{return r&&(c=r(r=0)),c}catch(r){throw l=[r],r}},__commonJSMin=(r,c)=>()=>(c||(r((c={exports:{}}).exports,c),r=null),c.exports),__exportAll=(r,c)=>{let l={};for(var p in r)u(l,p,{get:r[p],enumerable:!0});return c||u(l,Symbol.toStringTag,{value:`Module`}),l},__copyProps=(r,c,l,h)=>{if(c&&typeof c==`object`||typeof c==`function`)for(var v=m(c),y=0,b=v.length,x;y<b;y++)x=v[y],!g.call(r,x)&&x!==l&&u(r,x,{get:(r=>c[r]).bind(null,x),enumerable:!(h=p(c,x))||h.enumerable});return r},__toESM=(r,c,p)=>(p=r==null?{}:l(h(r)),__copyProps(c||!r||!r.__esModule?u(p,`default`,{value:r,enumerable:!0}):p,r));function _classCallCheck(r,c){if(!(r instanceof c))throw TypeError(`Cannot call a class as a function`)}function _typeof(r){"@babel/helpers - typeof";return _typeof=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(r){return typeof r}:function(r){return r&&typeof Symbol==`function`&&r.constructor===Symbol&&r!==Symbol.prototype?`symbol`:typeof r},_typeof(r)}var v=__esmMin((()=>{}));function toPrimitive(r,c){if(_typeof(r)!=`object`||!r)return r;var l=r[Symbol.toPrimitive];if(l!==void 0){var u=l.call(r,c||`default`);if(_typeof(u)!=`object`)return u;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(c===`string`?String:Number)(r)}var y=__esmMin((()=>{v()}));function toPropertyKey(r){var c=toPrimitive(r,`string`);return _typeof(c)==`symbol`?c:c+``}var b=__esmMin((()=>{v(),y()}));b();function _defineProperties$1(r,c){for(var l=0;l<c.length;l++){var u=c[l];u.enumerable=u.enumerable||!1,u.configurable=!0,`value`in u&&(u.writable=!0),Object.defineProperty(r,toPropertyKey(u.key),u)}}__name(_defineProperties$1,`_defineProperties`);function _createClass(r,c,l){return c&&_defineProperties$1(r.prototype,c),l&&_defineProperties$1(r,l),Object.defineProperty(r,"prototype",{writable:!1}),r}function _assertThisInitialized(r){if(r===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return r}v();function _possibleConstructorReturn(r,c){if(c&&(_typeof(c)==`object`||typeof c==`function`))return c;if(c!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return _assertThisInitialized(r)}function _getPrototypeOf(r){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},_getPrototypeOf(r)}function _superPropBase(r,c){for(;!{}.hasOwnProperty.call(r,c)&&(r=_getPrototypeOf(r))!==null;);return r}function _get(){return _get=typeof Reflect<`u`&&Reflect.get?Reflect.get.bind():function(r,c,l){var u=_superPropBase(r,c);if(u){var p=Object.getOwnPropertyDescriptor(u,c);return p.get?p.get.call(arguments.length<3?r:l):p.value}},_get.apply(null,arguments)}function _setPrototypeOf(r,c){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,c){return r.__proto__=c,r},_setPrototypeOf(r,c)}function _inherits$1(r,c){if(typeof c!=`function`&&c!==null)throw TypeError(`Super expression must either be null or a function`);r.prototype=Object.create(c&&c.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),c&&_setPrototypeOf(r,c)}__name(_inherits$1,`_inherits`);var x=function(){function Helpers(){_classCallCheck(this,Helpers)}return _createClass(Helpers,[{key:`consoleWarn`,value:function consoleWarn(){var r;(r=elementorDevTools).consoleWarn.apply(r,arguments),elementorDevTools.deprecation.deprecated(`elementorCommon.helpers.consoleWarn()`,`3.7.0`,`elementorDevTools.consoleWarn()`)}},{key:`consoleError`,value:function consoleError(r){console.error(r),elementorDevTools.deprecation.deprecated(`elementorCommon.helpers.consoleError()`,`3.7.0`,`console.error()`)}},{key:`cloneObject`,value:function cloneObject(r){return JSON.parse(JSON.stringify(r))}},{key:`upperCaseWords`,value:function upperCaseWords(r){return(r+``).replace(/^(.)|\s+(.)/g,function(r){return r.toUpperCase()})}},{key:`getUniqueId`,value:function getUniqueId(){return Math.random().toString(16).substr(2,7)}}])}();function _callSuper$34(r,c,l){return c=_getPrototypeOf(c),_possibleConstructorReturn(r,_isNativeReflectConstruct$35()?Reflect.construct(c,l||[],_getPrototypeOf(r).constructor):c.apply(r,l))}__name(_callSuper$34,`_callSuper`);function _isNativeReflectConstruct$35(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(r){}return(_isNativeReflectConstruct$35=function _isNativeReflectConstruct(){return!!r})()}__name(_isNativeReflectConstruct$35,`_isNativeReflectConstruct`);var S=function(r){function _default(){return _classCallCheck(this,_default),_callSuper$34(this,_default,arguments)}return _inherits$1(_default,r),_createClass(_default,[{key:`get`,value:function get(r,c){c=c||{};var l;try{l=c.session?sessionStorage:localStorage}catch(c){return r?void 0:{}}var u=l.getItem(`elementor`);u=u?JSON.parse(u):{},u.__expiration||(u.__expiration={});var p=u.__expiration,m=[];r?p[r]&&(m=[r]):m=Object.keys(p);var h=!1;return m.forEach(function(r){new Date(p[r])<new Date&&(delete u[r],delete p[r],h=!0)}),h&&this.save(u,c.session),r?u[r]:u}},{key:`set`,value:function set(r,c,l){l=l||{};var u=this.get(null,l);if(u[r]=c,l.lifetimeInSeconds){var p=new Date;p.setTime(p.getTime()+l.lifetimeInSeconds*1e3),u.__expiration[r]=p.getTime()}this.save(u,l.session)}},{key:`save`,value:function save(r,c){var l;try{l=c?sessionStorage:localStorage}catch(r){return}l.setItem(`elementor`,JSON.stringify(r))}}])}(elementorModules.Module),C=__toESM(__commonJSMin(((r,c)=>{c.exports=function Debug(){var r=this,c=[],l={},u={},p=function initSettings(){l={debounceDelay:500,urlsToWatch:[`elementor/assets`]}},m=function initElements(){u.$window=jQuery(window)},h=function onError(c){var u,p=(u=c.originalEvent)==null?void 0:u.error;if(p){var m=!1,h=l.urlsToWatch;jQuery.each(h,function(){if(p.stack.indexOf(this)!==-1)return m=!0,!1}),m&&r.addError({type:p.name,message:p.message,url:c.originalEvent.filename,line:c.originalEvent.lineno,column:c.originalEvent.colno})}},g=function bindEvents(){u.$window.on(`error`,h)},v=function init(){p(),m(),g(),r.sendErrors=_.debounce(r.sendErrors,l.debounceDelay)};this.addURLToWatch=function(r){l.urlsToWatch.push(r)},this.addCustomError=function(r,c,l){var u={type:r.name,message:r.message,url:r.fileName||r.sourceURL,line:r.lineNumber||r.line,column:r.columnNumber||r.column,customFields:{category:c||`general`,tag:l}};if(!u.url){var p=r.stack.match(/\n {4}at (.*?(?=:(\d+):(\d+)))/);p&&(u.url=p[1],u.line=p[2],u.column=p[3])}this.addError(u)},this.addError=function(l){var u={type:`Error`,timestamp:Math.floor(new Date().getTime()/1e3),message:null,url:null,line:null,column:null,customFields:{}};c.push(jQuery.extend(!0,u,l)),r.sendErrors()},this.sendErrors=function(){u.$window.off(`error`,h),jQuery.ajax({url:elementorCommon.config.ajax.url,method:`POST`,data:{action:`elementor_js_log`,_nonce:elementorCommon.ajax.getSettings(`nonce`),data:c},success:function success(){c=[],u.$window.on(`error`,h)}})},v()}}))());function _arrayWithHoles(r){if(Array.isArray(r))return r}function _iterableToArrayLimit(r,c){var l=r==null?null:typeof Symbol<`u`&&r[Symbol.iterator]||r[`@@iterator`];if(l!=null){var u,p,m,h,g=[],v=!0,y=!1;try{if(m=(l=l.call(r)).next,c===0){if(Object(l)!==l)return;v=!1}else for(;!(v=(u=m.call(l)).done)&&(g.push(u.value),g.length!==c);v=!0);}catch(r){y=!0,p=r}finally{try{if(!v&&l.return!=null&&(h=l.return(),Object(h)!==h))return}finally{if(y)throw p}}return g}}function _arrayLikeToArray$1(r,c){(c==null||c>r.length)&&(c=r.length);for(var l=0,u=Array(c);l<c;l++)u[l]=r[l];return u}__name(_arrayLikeToArray$1,`_arrayLikeToArray`);function _unsupportedIterableToArray$1(r,c){if(r){if(typeof r==`string`)return _arrayLikeToArray$1(r,c);var l={}.toString.call(r).slice(8,-1);return l===`Object`&&r.constructor&&(l=r.constructor.name),l===`Map`||l===`Set`?Array.from(r):l===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l)?_arrayLikeToArray$1(r,c):void 0}}__name(_unsupportedIterableToArray$1,`_unsupportedIterableToArray`);function _nonIterableRest(){throw TypeError(`Invalid attempt to destructure non-iterable instance. |
| 2 |
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _slicedToArray(r,c){return _arrayWithHoles(r)||_iterableToArrayLimit(r,c)||_unsupportedIterableToArray$1(r,c)||_nonIterableRest()}function _callSuper$33(r,c,l){return c=_getPrototypeOf(c),_possibleConstructorReturn(r,_isNativeReflectConstruct$34()?Reflect.construct(c,l||[],_getPrototypeOf(r).constructor):c.apply(r,l))}__name(_callSuper$33,`_callSuper`);function _isNativeReflectConstruct$34(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(r){}return(_isNativeReflectConstruct$34=function _isNativeReflectConstruct(){return!!r})()}__name(_isNativeReflectConstruct$34,`_isNativeReflectConstruct`);var w=function(r){function _default(){var r;_classCallCheck(this,_default);for(var c=arguments.length,l=Array(c),u=0;u<c;u++)l[u]=arguments[u];return r=_callSuper$33(this,_default,[].concat(l)),r.requests={},r.cache={},r.initRequestConstants(),r.debounceSendBatch=_.debounce(r.sendBatch.bind(r),500),r}return _inherits$1(_default,r),_createClass(_default,[{key:`getDefaultSettings`,value:function getDefaultSettings(){return{ajaxParams:{type:`POST`,url:elementorCommon.config.ajax.url,data:{},dataType:`json`},actionPrefix:`elementor_`}}},{key:`initRequestConstants`,value:function initRequestConstants(){this.requestConstants={_nonce:this.getSettings(`nonce`)}}},{key:`addRequestConstant`,value:function addRequestConstant(r,c){this.requestConstants[r]=c}},{key:`getCacheKey`,value:function getCacheKey(r){return JSON.stringify({unique_id:r.unique_id,data:r.data})}},{key:`loadObjects`,value:function loadObjects(r){var c=this,l={},u=[];r.before&&r.before(),r.ids.forEach(function(p){u.push(c.load({action:r.action,unique_id:r.data.unique_id+p,data:jQuery.extend({id:p},r.data)}).done(function(r){return l=jQuery.extend(l,r)}))}),jQuery.when.apply(jQuery,u).done(function(){return r.success(l)})}},{key:`load`,value:function load(r,c){var l=this;r.unique_id||(r.unique_id=r.action),r.before&&r.before();var u,p=this.getCacheKey(r);if(_.has(this.cache,p))u=jQuery.Deferred().done(r.success).resolve(this.cache[p]);else{var m;u=this.addRequest(r.action,{data:r.data,unique_id:r.unique_id,success:function success(r){return l.cache[p]=r},error:(m=r.error)==null?function(){}:m},c).done(r.success)}return u}},{key:`cancelRequest`,value:function cancelRequest(r){var c=this.requests[r];if(!c)return null;if(c.options.deferred.jqXhr)return c.options.deferred.jqXhr.abort(`Request canceled`);if(c.options.deferred)return c.options.deferred.reject(`Request canceled`)}},{key:`addRequest`,value:function addRequest(r,c,l){c=c||{},c.unique_id||(c.unique_id=r),c.deferred=jQuery.Deferred().done(c.success).fail(c.error).always(c.complete);var u={action:r,options:c};if(l){var p={};p[c.unique_id]=u,c.deferred.jqXhr=this.sendBatch(p)}else{var m=this.requests[c.unique_id];if(m){if(this.getCacheKey(m.options)===this.getCacheKey(c))return m.options.deferred.done(function(r){return c.deferred.resolve(r)}).fail(function(r){return c.deferred.reject(r)}),c.deferred;m.options.deferred.reject(`Request replaced`)}this.requests[c.unique_id]=u,this.debounceSendBatch()}return c.deferred}},{key:`sendBatch`,value:function sendBatch(r){var c={};return r||(r=this.requests,this.requests={}),Object.entries(r).forEach(function(r){var l=_slicedToArray(r,2),u=l[0],p=l[1];return c[u]={action:p.action,data:p.options.data}}),this.send(`ajax`,{data:{actions:JSON.stringify(c)},success:function success(c){Object.entries(c.responses).forEach(function(c){var l=_slicedToArray(c,2),u=l[0],p=l[1],m=r[u].options;m&&(p.success?m.deferred.resolve(p.data):p.success||m.deferred.reject(p.data))})},error:function error(c){return Object.values(r).forEach(function(r){r.options&&r.options.deferred.reject(c)})}})}},{key:`prepareSend`,value:function prepareSend(r,c){var l=this,u=this.getSettings(),p=elementorCommon.helpers.cloneObject(u.ajaxParams);c=c||{},r=u.actionPrefix+r,jQuery.extend(p,c);var m=elementorCommon.helpers.cloneObject(this.requestConstants);m.action=r;var h=p.data instanceof FormData;Object.entries(m).forEach(function(r){var c=_slicedToArray(r,2),l=c[0],u=c[1];h?p.data.append(l,u):p.data[l]=u});var g=p.success,v=p.error;return(g||v)&&(p.success=function(r){r.success&&g&&g(r.data),!r.success&&v&&v(r.data)},v?p.error=function(r){return v(r)}:p.error=function(r){(r.readyState||r.statusText!==`abort`)&&l.trigger(`request:unhandledError`,r)}),p}},{key:`send`,value:function send(r,c){return jQuery.ajax(this.prepareSend(r,c))}},{key:`addRequestCache`,value:function addRequestCache(r,c){var l=this.getCacheKey(r);this.cache[l]=c}},{key:`invalidateCache`,value:function invalidateCache(r){var c=this.getCacheKey(r);delete this.cache[c]}}])}(elementorModules.Module);function _defineProperty(r,c,l){return(c=toPropertyKey(c))in r?Object.defineProperty(r,c,{value:l,enumerable:!0,configurable:!0,writable:!0}):r[c]=l,r}var T=__esmMin((()=>{b()}));T();function _superPropGet$7(r,c,l,u){var p=_get(_getPrototypeOf(1&u?r.prototype:r),c,l);return 2&u&&typeof p==`function`?function(r){return p.apply(l,r)}:p}__name(_superPropGet$7,`_superPropGet`);var E=function(){function InstanceType(){var r=this;_classCallCheck(this,InstanceType);for(var c=this instanceof InstanceType?this.constructor:void 0,l=[];c.__proto__&&c.__proto__.name;)l.push(c.__proto__),c=c.__proto__;l.reverse().forEach(function(c){return r instanceof c})}return _createClass(InstanceType,null,[{key:Symbol.hasInstance,value:function value(r){var c=_superPropGet$7(InstanceType,Symbol.hasInstance,this,2)([r]);if(r&&!r.constructor.getInstanceType)return c;if(r&&(r.instanceTypes||(r.instanceTypes=[]),c||this.getInstanceType()===r.constructor.getInstanceType()&&(c=!0),c)){var l=this.getInstanceType===InstanceType.getInstanceType?`BaseInstanceType`:this.getInstanceType();r.instanceTypes.indexOf(l)===-1&&r.instanceTypes.push(l)}return!c&&r&&(c=r.instanceTypes&&Array.isArray(r.instanceTypes)&&r.instanceTypes.indexOf(this.getInstanceType())!==-1),c}},{key:`getInstanceType`,value:function getInstanceType(){elementorModules.ForceMethodImplementation()}}])}();function _createForOfIteratorHelper(r,c){var l=typeof Symbol<`u`&&r[Symbol.iterator]||r[`@@iterator`];if(!l){if(Array.isArray(r)||(l=_unsupportedIterableToArray(r))||c&&r&&typeof r.length==`number`){l&&(r=l);var u=0,p=function F(){};return{s:p,n:function n(){return u>=r.length?{done:!0}:{done:!1,value:r[u++]}},e:function e(r){throw r},f:p}}throw TypeError(`Invalid attempt to iterate non-iterable instance. |
| 3 |
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var m,h=!0,g=!1;return{s:function s(){l=l.call(r)},n:function n(){var r=l.next();return h=r.done,r},e:function e(r){g=!0,m=r},f:function f(){try{h||l.return==null||l.return()}finally{if(g)throw m}}}}function _unsupportedIterableToArray(r,c){if(r){if(typeof r==`string`)return _arrayLikeToArray(r,c);var l={}.toString.call(r).slice(8,-1);return l===`Object`&&r.constructor&&(l=r.constructor.name),l===`Map`||l===`Set`?Array.from(r):l===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l)?_arrayLikeToArray(r,c):void 0}}function _arrayLikeToArray(r,c){(c==null||c>r.length)&&(c=r.length);for(var l=0,u=Array(c);l<c;l++)u[l]=r[l];return u}var D=__name((function(r,c){c=Array.isArray(c)?c:[c];var l=_createForOfIteratorHelper(c),u;try{for(l.s();!(u=l.n()).done;){var p=u.value;if(r.constructor.name===p.prototype[Symbol.toStringTag])return!0}}catch(r){l.e(r)}finally{l.f()}return!1}),`default`);v();function _callSuper$32(r,c,l){return c=_getPrototypeOf(c),_possibleConstructorReturn(r,_isNativeReflectConstruct$33()?Reflect.construct(c,l||[],_getPrototypeOf(r).constructor):c.apply(r,l))}__name(_callSuper$32,`_callSuper`);function _isNativeReflectConstruct$33(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(r){}return(_isNativeReflectConstruct$33=function _isNativeReflectConstruct(){return!!r})()}__name(_isNativeReflectConstruct$33,`_isNativeReflectConstruct`);var O=function(r){function ArgsObject(r){var c;return _classCallCheck(this,ArgsObject),c=_callSuper$32(this,ArgsObject),c.args=r,c}return _inherits$1(ArgsObject,r),_createClass(ArgsObject,[{key:`requireArgument`,value:function requireArgument(r){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.args;if(!Object.prototype.hasOwnProperty.call(c,r))throw Error(`${r} is required.`)}},{key:`requireArgumentType`,value:function requireArgumentType(r,c){var l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.args;if(this.requireArgument(r,l),_typeof(l[r])!==c)throw Error(`${r} invalid type: ${c}.`)}},{key:`requireArgumentInstance`,value:function requireArgumentInstance(r,c){var l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.args;if(this.requireArgument(r,l),!(l[r]instanceof c)&&!D(l[r],c))throw Error(`${r} invalid instance.`)}},{key:`requireArgumentConstructor`,value:function requireArgumentConstructor(r,c){var l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.args;if(this.requireArgument(r,l),l[r].constructor.toString()!==c.prototype.constructor.toString())throw Error(`${r} invalid constructor type.`)}}],[{key:`getInstanceType`,value:function getInstanceType(){return`ArgsObject`}}])}(E),k=function(){function Console(){_classCallCheck(this,Console)}return _createClass(Console,null,[{key:`error`,value:function error(r){$e.devTools&&$e.devTools.log.error(r),r instanceof $e.modules.HookBreak||console.error(r)}},{key:`warn`,value:function warn(){for(var r,c=`font-size: 12px; background-image: url("${elementorWebCliConfig.urls.assets}images/logo-icon.png"); background-repeat: no-repeat; background-size: contain;`,l=arguments.length,u=Array(l),p=0;p<l;p++)u[p]=arguments[p];u.unshift(`%c %c`,c,``),(r=console).warn.apply(r,u)}}])}(),A=function softDeprecated(r,c,l){elementorWebCliConfig.isDebug&&te(`soft`,r,c,l)},ee=function hardDeprecated(r,c,l){te(`hard`,r,c,l)},te=function deprecatedMessage(r,c,l,u){var p=`\`${c}\` is ${r} deprecated since ${l}`;u&&(p+=` - Use \`${u}\` instead`),k.warn(p)},ne=function(){function Deprecation(){_classCallCheck(this,Deprecation)}return _createClass(Deprecation,null,[{key:`deprecated`,value:function deprecated(r,c,l){this.isHardDeprecated(c)?ee(r,c,l):A(r,c,l)}},{key:`parseVersion`,value:function parseVersion(r){var c=r.split(`.`);if(c.length<3||c.length>4)throw RangeError(`Invalid Semantic Version string provided`);var l=_slicedToArray(c,4),u=l[0],p=l[1],m=l[2],h=l[3];return{major1:parseInt(u),major2:parseInt(p),minor:parseInt(m),build:h===void 0?``:h}}},{key:`getTotalMajor`,value:function getTotalMajor(r){var c=parseInt(`${r.major1}${r.major2}0`);return c=Number((c/10).toFixed(0)),r.major2>9&&(c=r.major2-9),c}},{key:`compareVersion`,value:function compareVersion(r,c){var l=this;return[this.parseVersion(r),this.parseVersion(c)].map(function(r){return l.getTotalMajor(r)}).reduce(function(r,c){return r-c})}},{key:`isSoftDeprecated`,value:function isSoftDeprecated(r){return this.compareVersion(r,elementorWebCliConfig.version)<=4}},{key:`isHardDeprecated`,value:function isHardDeprecated(r){var c=this.compareVersion(r,elementorWebCliConfig.version);return c<0||c>=8}}])}();function _callSuper$31(r,c,l){return c=_getPrototypeOf(c),_possibleConstructorReturn(r,_isNativeReflectConstruct$32()?Reflect.construct(c,l||[],_getPrototypeOf(r).constructor):c.apply(r,l))}__name(_callSuper$31,`_callSuper`);function _isNativeReflectConstruct$32(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(r){}return(_isNativeReflectConstruct$32=function _isNativeReflectConstruct(){return!!r})()}__name(_isNativeReflectConstruct$32,`_isNativeReflectConstruct`);var j=function(r){function CommandInfra(){var r,c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(_classCallCheck(this,CommandInfra),r=_callSuper$31(this,CommandInfra,[c]),!r.constructor.registerConfig)throw RangeError("Doing it wrong: Each command type should have `registerConfig`.");return r.command=r.constructor.getCommand(),r.component=r.constructor.getComponent(),r.initialize(c),c=r.args,r.validateArgs(c),r}return _inherits$1(CommandInfra,r),_createClass(CommandInfra,[{key:`currentCommand`,get:function get(){return ne.deprecated(`this.currentCommand`,`3.7.0`,`this.command`),this.command}},{key:`initialize`,value:function initialize(){arguments.length>0&&arguments[0]!==void 0&&arguments[0]}},{key:`validateArgs`,value:function validateArgs(){arguments.length>0&&arguments[0]!==void 0&&arguments[0]}},{key:`apply`,value:function apply(){arguments.length>0&&arguments[0]!==void 0&&arguments[0],elementorModules.ForceMethodImplementation()}},{key:`run`,value:function run(){return this.apply(this.args)}},{key:`onBeforeRun`,value:function onBeforeRun(){arguments.length>0&&arguments[0]!==void 0&&arguments[0]}},{key:`onAfterRun`,value:function onAfterRun(){arguments.length>0&&arguments[0]!==void 0&&arguments[0],arguments.length>1&&arguments[1]}},{key:`onBeforeApply`,value:function onBeforeApply(){arguments.length>0&&arguments[0]!==void 0&&arguments[0]}},{key:`onAfterApply`,value:function onAfterApply(){arguments.length>0&&arguments[0]!==void 0&&arguments[0],arguments.length>1&&arguments[1]}},{key:`onCatchApply`,value:function onCatchApply(r){}}],[{key:`getInstanceType`,value:function getInstanceType(){return`CommandInfra`}},{key:`getInfo`,value:function getInfo(){return{}}},{key:`getCommand`,value:function getCommand(){return this.registerConfig.command}},{key:`getComponent`,value:function getComponent(){return this.registerConfig.component}},{key:`setRegisterConfig`,value:function setRegisterConfig(r){this.registerConfig=Object.freeze(r)}}])}(O);_defineProperty(j,`registerConfig`,null);function _callSuper$30(r,c,l){return c=_getPrototypeOf(c),_possibleConstructorReturn(r,_isNativeReflectConstruct$31()?Reflect.construct(c,l||[],_getPrototypeOf(r).constructor):c.apply(r,l))}__name(_callSuper$30,`_callSuper`);function _isNativeReflectConstruct$31(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(r){}return(_isNativeReflectConstruct$31=function _isNativeReflectConstruct(){return!!r})()}__name(_isNativeReflectConstruct$31,`_isNativeReflectConstruct`);var re=function(r){function CommandBase(){return _classCallCheck(this,CommandBase),_callSuper$30(this,CommandBase,arguments)}return _inherits$1(CommandBase,r),_createClass(CommandBase,[{key:`onBeforeRun`,value:function onBeforeRun(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};$e.hooks.runUIBefore(this.command,r)}},{key:`onAfterRun`,value:function onAfterRun(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},c=arguments.length>1?arguments[1]:void 0;$e.hooks.runUIAfter(this.command,r,c)}},{key:`onBeforeApply`,value:function onBeforeApply(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};$e.hooks.runDataDependency(this.command,r)}},{key:`onAfterApply`,value:function onAfterApply(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},c=arguments.length>1?arguments[1]:void 0;return $e.hooks.runDataAfter(this.command,r,c)}},{key:`onCatchApply`,value:function onCatchApply(r){this.runCatchHooks(r)}},{key:`runCatchHooks`,value:function runCatchHooks(r){$e.hooks.runDataCatch(this.command,this.args,r),$e.hooks.runUICatch(this.command,this.args,r)}},{key:`requireContainer`,value:function requireContainer(){var r=this,c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.args;if(ne.deprecated(`requireContainer()`,`3.7.0`,"Extend `$e.modules.editor.CommandContainerBase` or `$e.modules.editor.CommandContainerInternalBase`"),!c.container&&!c.containers)throw Error(`container or containers are required.`);if(c.container&&c.containers)throw Error(`container and containers cannot go together please select one of them.`);(c.containers||[c.container]).forEach(function(c){r.requireArgumentInstance(`container`,elementorModules.editor.Container,{container:c})})}}],[{key:`getInstanceType`,value:function getInstanceType(){return`CommandBase`}}])}(j);function _callSuper$29(r,c,l){return c=_getPrototypeOf(c),_possibleConstructorReturn(r,_isNativeReflectConstruct$30()?Reflect.construct(c,l||[],_getPrototypeOf(r).constructor):c.apply(r,l))}__name(_callSuper$29,`_callSuper`);function _isNativeReflectConstruct$30(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(r){}return(_isNativeReflectConstruct$30=function _isNativeReflectConstruct(){return!!r})()}__name(_isNativeReflectConstruct$30,`_isNativeReflectConstruct`);var ie=function(r){function CommandCallbackBase(){return _classCallCheck(this,CommandCallbackBase),_callSuper$29(this,CommandCallbackBase,arguments)}return _inherits$1(CommandCallbackBase,r),_createClass(CommandCallbackBase,[{key:`apply`,value:function apply(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return this.constructor.getCallback()(r)}}],[{key:`getInstanceType`,value:function getInstanceType(){return`CommandCallbackBase`}},{key:`getCallback`,value:function getCallback(){return this.registerConfig.callback}}])}(re),ae=__toESM(__commonJSMin(((r,c)=>{v();var l=function Module(){var r=jQuery,c=arguments,l=this,u={},p,m=function ensureClosureMethods(){r.each(l,function(r){var c=l[r];typeof c==`function`&&(l[r]=function(){return c.apply(l,arguments)})})},h=function initSettings(){p=l.getDefaultSettings();var u=c[0];u&&r.extend(!0,p,u)},g=function init(){l.__construct.apply(l,c),m(),h(),l.trigger(`init`)};this.getItems=function(r,c){if(c){var l=c.split(`.`),u=l.splice(0,1);return l.length?r[u]?this.getItems(r[u],l.join(`.`)):void 0:r[u]}return r},this.getSettings=function(r){return this.getItems(p,r)},this.setSettings=function(c,u,m){if(m||(m=p),_typeof(c)===`object`)return r.extend(m,c),l;var h=c.split(`.`),g=h.splice(0,1);return h.length?(m[g]||(m[g]={}),l.setSettings(h.join(`.`),u,m[g])):(m[g]=u,l)},this.getErrorMessage=function(r,c){var l;switch(r){case`forceMethodImplementation`:l=`The method '${c}' must to be implemented in the inheritor child.`;break;default:l=`An error occurs`}return l},this.forceMethodImplementation=function(r){throw Error(this.getErrorMessage(`forceMethodImplementation`,r))},this.on=function(c,p){return _typeof(c)===`object`?(r.each(c,function(r){l.on(r,this)}),l):(c.split(` `).forEach(function(r){u[r]||(u[r]=[]),u[r].push(p)}),l)},this.off=function(r,c){if(!u[r])return l;if(!c)return delete u[r],l;var p=u[r].indexOf(c);return p!==-1&&(delete u[r][p],u[r]=u[r].filter(function(r){return r})),l},this.trigger=function(c){var p=`on`+c[0].toUpperCase()+c.slice(1),m=Array.prototype.slice.call(arguments,1);l[p]&&l[p].apply(l,m);var h=u[c];return h&&r.each(h,function(r,c){c.apply(l,m)}),l},g()};l.prototype.__construct=function(){},l.prototype.getDefaultSettings=function(){return{}},l.prototype.getConstructorID=function(){return this.constructor.name},l.extend=function(r){var c=jQuery,l=this,u=function child(){return l.apply(this,arguments)};return c.extend(u,l),u.prototype=Object.create(c.extend({},l.prototype,r)),u.prototype.constructor=u,u.__super__=l.prototype,u},c.exports=l}))());function _isNativeFunction(r){try{return Function.toString.call(r).indexOf(`[native code]`)!==-1}catch(c){return typeof r==`function`}}function _isNativeReflectConstruct$29(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(r){}return(_isNativeReflectConstruct$29=function _isNativeReflectConstruct(){return!!r})()}__name(_isNativeReflectConstruct$29,`_isNativeReflectConstruct`);function _construct$1(r,c,l){if(_isNativeReflectConstruct$29())return Reflect.construct.apply(null,arguments);var u=[null];u.push.apply(u,c);var p=new(r.bind.apply(r,u));return l&&_setPrototypeOf(p,l.prototype),p}__name(_construct$1,`_construct`);function _wrapNativeSuper(r){var c=typeof Map==`function`?new Map:void 0;return _wrapNativeSuper=function _wrapNativeSuper(r){if(r===null||!_isNativeFunction(r))return r;if(typeof r!=`function`)throw TypeError(`Super expression must either be null or a function`);if(c!==void 0){if(c.has(r))return c.get(r);c.set(r,Wrapper)}function Wrapper(){return _construct$1(r,arguments,_getPrototypeOf(this).constructor)}return Wrapper.prototype=Object.create(r.prototype,{constructor:{value:Wrapper,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf(Wrapper,r)},_wrapNativeSuper(r)}function _callSuper$28(r,c,l){return c=_getPrototypeOf(c),_possibleConstructorReturn(r,_isNativeReflectConstruct$28()?Reflect.construct(c,l||[],_getPrototypeOf(r).constructor):c.apply(r,l))}__name(_callSuper$28,`_callSuper`);function _isNativeReflectConstruct$28(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(r){}return(_isNativeReflectConstruct$28=function _isNativeReflectConstruct(){return!!r})()}__name(_isNativeReflectConstruct$28,`_isNativeReflectConstruct`);var oe=function(r){function ForceMethodImplementation(){var r,c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return _classCallCheck(this,ForceMethodImplementation),r=_callSuper$28(this,ForceMethodImplementation,[`${c.isStatic?`static `:``}${c.fullName}() should be implemented, please provide '${c.functionName||c.fullName}' functionality.`]),Error.captureStackTrace(r,ForceMethodImplementation),r}return _inherits$1(ForceMethodImplementation,r),_createClass(ForceMethodImplementation)}(_wrapNativeSuper(Error)),se=__name((function(){var r=Error().stack.split(` |
| 4 |
`)[2].trim(),c=r.startsWith(`at new`)?`constructor`:r.split(` `)[1],l={};if(l.functionName=c,l.fullName=c,l.functionName.includes(`.`)){var u=l.functionName.split(`.`);l.className=u[0],l.functionName=u[1]}else l.isStatic=!0;throw new oe(l)}),`default`);T();function ownKeys$4(r,c){var l=Object.keys(r);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(r);c&&(u=u.filter(function(c){return Object.getOwnPropertyDescriptor(r,c).enumerable})),l.push.apply(l,u)}return l}__name(ownKeys$4,`ownKeys`);function _objectSpread$4(r){for(var c=1;c<arguments.length;c++){var l=arguments[c]==null?{}:arguments[c];c%2?ownKeys$4(Object(l),!0).forEach(function(c){_defineProperty(r,c,l[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(l)):ownKeys$4(Object(l)).forEach(function(c){Object.defineProperty(r,c,Object.getOwnPropertyDescriptor(l,c))})}return r}__name(_objectSpread$4,`_objectSpread`);function _callSuper$27(r,c,l){return c=_getPrototypeOf(c),_possibleConstructorReturn(r,_isNativeReflectConstruct$27()?Reflect.construct(c,l||[],_getPrototypeOf(r).constructor):c.apply(r,l))}__name(_callSuper$27,`_callSuper`);function _isNativeReflectConstruct$27(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(r){}return(_isNativeReflectConstruct$27=function _isNativeReflectConstruct(){return!!r})()}__name(_isNativeReflectConstruct$27,`_isNativeReflectConstruct`);var M=function(c){function ComponentBase(){return _classCallCheck(this,ComponentBase),_callSuper$27(this,ComponentBase,arguments)}return _inherits$1(ComponentBase,c),_createClass(ComponentBase,[{key:`__construct`,value:function __construct(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};r.manager&&(this.manager=r.manager),this.commands=this.defaultCommands(),this.commandsInternal=this.defaultCommandsInternal(),this.hooks=this.defaultHooks(),this.routes=this.defaultRoutes(),this.tabs=this.defaultTabs(),this.shortcuts=this.defaultShortcuts(),this.utils=this.defaultUtils(),this.data=this.defaultData(),this.uiStates=this.defaultUiStates(),this.states=this.defaultStates(),this.defaultRoute=``,this.currentTab=``}},{key:`registerAPI`,value:function registerAPI(){var r=this;Object.entries(this.getTabs()).forEach(function(c){return r.registerTabRoute(c[0])}),Object.entries(this.getRoutes()).forEach(function(c){var l=_slicedToArray(c,2),u=l[0],p=l[1];return r.registerRoute(u,p)}),Object.entries(this.getCommands()).forEach(function(c){var l=_slicedToArray(c,2),u=l[0],p=l[1];return r.registerCommand(u,p)}),Object.entries(this.getCommandsInternal()).forEach(function(c){var l=_slicedToArray(c,2),u=l[0],p=l[1];return r.registerCommandInternal(u,p)}),Object.values(this.getHooks()).forEach(function(c){return r.registerHook(c)}),Object.entries(this.getData()).forEach(function(c){var l=_slicedToArray(c,2),u=l[0],p=l[1];return r.registerData(u,p)}),Object.values(this.getUiStates()).forEach(function(c){return r.registerUiState(c)}),Object.entries(this.getStates()).forEach(function(c){var l=_slicedToArray(c,2),u=l[0],p=l[1];return r.registerState(u,p)})}},{key:`getNamespace`,value:function getNamespace(){se()}},{key:`getRootContainer`,value:function getRootContainer(){return ne.deprecated(`getRootContainer()`,`3.7.0`,`getServiceName()`),this.getServiceName()}},{key:`getServiceName`,value:function getServiceName(){return this.getNamespace().split(`/`)[0]}},{key:`store`,get:function get(){return $e.store.get(this.getNamespace())}},{key:`defaultTabs`,value:function defaultTabs(){return{}}},{key:`defaultRoutes`,value:function defaultRoutes(){return{}}},{key:`defaultCommands`,value:function defaultCommands(){return{}}},{key:`defaultCommandsInternal`,value:function defaultCommandsInternal(){return{}}},{key:`defaultHooks`,value:function defaultHooks(){return{}}},{key:`defaultUiStates`,value:function defaultUiStates(){return{}}},{key:`defaultStates`,value:function defaultStates(){return{}}},{key:`defaultShortcuts`,value:function defaultShortcuts(){return{}}},{key:`defaultUtils`,value:function defaultUtils(){return{}}},{key:`defaultData`,value:function defaultData(){return{}}},{key:`getCommands`,value:function getCommands(){return this.commands}},{key:`getCommandsInternal`,value:function getCommandsInternal(){return this.commandsInternal}},{key:`getHooks`,value:function getHooks(){return this.hooks}},{key:`getUiStates`,value:function getUiStates(){return this.uiStates}},{key:`getStates`,value:function getStates(){return this.states}},{key:`getRoutes`,value:function getRoutes(){return this.routes}},{key:`getTabs`,value:function getTabs(){return this.tabs}},{key:`getShortcuts`,value:function getShortcuts(){return this.shortcuts}},{key:`getData`,value:function getData(){return this.data}},{key:`registerCommand`,value:function registerCommand(r,c){var l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:`default`,u;switch(l){case`default`:u=$e.commands;break;case`internal`:u=$e.commandsInternal;break;case`data`:u=$e.data;break;default:throw Error(`Invalid commands type: '${r}'`)}var p=this.getNamespace()+`/`+r,m=c.getInstanceType?c.getInstanceType():!1,h={command:p,component:this};m||($e.devTools&&$e.devTools.log.warn(`Attach command-callback-base, on command: '${p}', context is unknown type.`),h.callback=c,c=function(r){function context(){return _classCallCheck(this,context),_callSuper$27(this,context,arguments)}return _inherits$1(context,r),_createClass(context)}(ie)),c.setRegisterConfig(h),u.register(this,r,c)}},{key:`registerHook`,value:function registerHook(r){return r.register()}},{key:`registerCommandInternal`,value:function registerCommandInternal(r,c){this.registerCommand(r,c,`internal`)}},{key:`registerUiState`,value:function registerUiState(r){$e.uiStates.register(r)}},{key:`registerState`,value:function registerState(c,l){c=this.getNamespace()+(c?`/${c}`:``);var u=(0,r.createSlice)(_objectSpread$4(_objectSpread$4({},l),{},{name:c}));$e.store.register(c,u)}},{key:`registerRoute`,value:function registerRoute(r,c){$e.routes.register(this,r,c)}},{key:`registerData`,value:function registerData(r,c){this.registerCommand(r,c,`data`)}},{key:`unregisterRoute`,value:function unregisterRoute(r){$e.routes.unregister(this,r)}},{key:`registerTabRoute`,value:function registerTabRoute(r){var c=this;this.registerRoute(r,function(l){return c.activateTab(r,l)})}},{key:`dependency`,value:function dependency(){return!0}},{key:`open`,value:function open(){return!0}},{key:`close`,value:function close(){return this.isOpen?(this.isOpen=!1,this.inactivate(),$e.routes.clearCurrent(this.getNamespace()),$e.routes.clearHistory(this.getServiceName()),!0):!1}},{key:`activate`,value:function activate(){$e.components.activate(this.getNamespace())}},{key:`inactivate`,value:function inactivate(){$e.components.inactivate(this.getNamespace())}},{key:`isActive`,value:function isActive(){return $e.components.isActive(this.getNamespace())}},{key:`onRoute`,value:function onRoute(r){this.toggleRouteClass(r,!0),this.toggleHistoryClass(),this.activate(),this.trigger(`route/open`,r)}},{key:`onCloseRoute`,value:function onCloseRoute(r){this.toggleRouteClass(r,!1),this.inactivate(),this.trigger(`route/close`,r)}},{key:`setDefaultRoute`,value:function setDefaultRoute(r){this.defaultRoute=this.getNamespace()+`/`+r}},{key:`getDefaultRoute`,value:function getDefaultRoute(){return this.defaultRoute}},{key:`removeTab`,value:function removeTab(r){delete this.tabs[r],this.unregisterRoute(r)}},{key:`hasTab`,value:function hasTab(r){return!!this.tabs[r]}},{key:`addTab`,value:function addTab(r,c,l){var u=this;if(this.tabs[r]=c,l!==void 0){var p={},m=Object.keys(this.tabs);m.pop(),m.splice(l,0,r),m.forEach(function(r){p[r]=u.tabs[r]}),this.tabs=p}this.registerTabRoute(r)}},{key:`getTabsWrapperSelector`,value:function getTabsWrapperSelector(){return``}},{key:`getTabRoute`,value:function getTabRoute(r){return this.getNamespace()+`/`+r}},{key:`renderTab`,value:function renderTab(r){}},{key:`activateTab`,value:function activateTab(r,c){var l=this;this.renderTab(r,c),jQuery(this.getTabsWrapperSelector()+` .elementor-component-tab`).off(`click`).on(`click`,function(r){$e.route(l.getTabRoute(r.currentTarget.dataset.tab),c)}).removeClass(`elementor-active`).filter(`[data-tab="`+r+`"]`).addClass(`elementor-active`)}},{key:`getActiveTabConfig`,value:function getActiveTabConfig(){return this.tabs[this.currentTab]||{}}},{key:`getBodyClass`,value:function getBodyClass(r){return`e-route-`+r.replace(/\//g,`-`)}},{key:`normalizeCommandName`,value:function normalizeCommandName(r){return r.replace(/[A-Z]/g,function(r,c){return(c>0?`-`:``)+r.toLowerCase()})}},{key:`importCommands`,value:function importCommands(r){var c=this,l={};return Object.entries(r).forEach(function(r){var u=_slicedToArray(r,2),p=u[0],m=u[1],h=c.normalizeCommandName(p);l[h]=m}),l}},{key:`importHooks`,value:function importHooks(r){var c={};for(var l in r){var u=new r[l];c[u.getId()]=u}return c}},{key:`importUiStates`,value:function importUiStates(r){var c=this,l={};return Object.values(r).forEach(function(r){var u=new r(c);l[u.getId()]=u}),l}},{key:`setUiState`,value:function setUiState(r,c){$e.uiStates.set(`${this.getNamespace()}/${r}`,c)}},{key:`toggleRouteClass`,value:function toggleRouteClass(r,c){document.body.classList.toggle(this.getBodyClass(r),c)}},{key:`toggleHistoryClass`,value:function toggleHistoryClass(){document.body.classList.toggle(`e-routes-has-history`,!!$e.routes.getHistory(this.getServiceName()).length)}}])}(ae.default);function _callSuper$26(r,c,l){return c=_getPrototypeOf(c),_possibleConstructorReturn(r,_isNativeReflectConstruct$26()?Reflect.construct(c,l||[],_getPrototypeOf(r).constructor):c.apply(r,l))}__name(_callSuper$26,`_callSuper`);function _isNativeReflectConstruct$26(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(r){}return(_isNativeReflectConstruct$26=function _isNativeReflectConstruct(){return!!r})()}__name(_isNativeReflectConstruct$26,`_isNativeReflectConstruct`);var ce=function(r){function Close(){return _classCallCheck(this,Close),_callSuper$26(this,Close,arguments)}return _inherits$1(Close,r),_createClass(Close,[{key:`apply`,value:function apply(){this.component.close()}}])}(re);function _callSuper$25(r,c,l){return c=_getPrototypeOf(c),_possibleConstructorReturn(r,_isNativeReflectConstruct$25()?Reflect.construct(c,l||[],_getPrototypeOf(r).constructor):c.apply(r,l))}__name(_callSuper$25,`_callSuper`);function _isNativeReflectConstruct$25(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(r){}return(_isNativeReflectConstruct$25=function _isNativeReflectConstruct(){return!!r})()}__name(_isNativeReflectConstruct$25,`_isNativeReflectConstruct`);var le=function(r){function Open(){return _classCallCheck(this,Open),_callSuper$25(this,Open,arguments)}return _inherits$1(Open,r),_createClass(Open,[{key:`apply`,value:function apply(){$e.route(this.component.getNamespace())}}])}(re);function _callSuper$24(r,c,l){return c=_getPrototypeOf(c),_possibleConstructorReturn(r,_isNativeReflectConstruct$24()?Reflect.construct(c,l||[],_getPrototypeOf(r).constructor):c.apply(r,l))}__name(_callSuper$24,`_callSuper`);function _isNativeReflectConstruct$24(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(r){}return(_isNativeReflectConstruct$24=function _isNativeReflectConstruct(){return!!r})()}__name(_isNativeReflectConstruct$24,`_isNativeReflectConstruct`);var ue=function(r){function Toggle(){return _classCallCheck(this,Toggle),_callSuper$24(this,Toggle,arguments)}return _inherits$1(Toggle,r),_createClass(Toggle,[{key:`apply`,value:function apply(){this.component.isOpen?this.component.close():$e.route(this.component.getNamespace())}}])}(re),de=__exportAll({Close:()=>ce,Open:()=>le,Toggle:()=>ue});function _callSuper$23(r,c,l){return c=_getPrototypeOf(c),_possibleConstructorReturn(r,_isNativeReflectConstruct$23()?Reflect.construct(c,l||[],_getPrototypeOf(r).constructor):c.apply(r,l))}__name(_callSuper$23,`_callSuper`);function _isNativeReflectConstruct$23(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(r){}return(_isNativeReflectConstruct$23=function _isNativeReflectConstruct(){return!!r})()}__name(_isNativeReflectConstruct$23,`_isNativeReflectConstruct`);function _superPropGet$6(r,c,l,u){var p=_get(_getPrototypeOf(1&u?r.prototype:r),c,l);return 2&u&&typeof p==`function`?function(r){return p.apply(l,r)}:p}__name(_superPropGet$6,`_superPropGet`);var fe=function(r){function ComponentModalBase(){return _classCallCheck(this,ComponentModalBase),_callSuper$23(this,ComponentModalBase,arguments)}return _inherits$1(ComponentModalBase,r),_createClass(ComponentModalBase,[{key:`registerAPI`,value:function registerAPI(){var r=this;_superPropGet$6(ComponentModalBase,`registerAPI`,this,3)([]),$e.shortcuts.register(`esc`,{scopes:[this.getNamespace()],callback:function callback(){return r.close()}})}},{key:`defaultCommands`,value:function defaultCommands(){return this.importCommands(de)}},{key:`defaultRoutes`,value:function defaultRoutes(){return{"":function _(){}}}},{key:`open`,value:function open(){var r=this;if(!this.layout){var c=this.getModalLayout();this.layout=new c({component:this}),this.layout.getModal().on(`hide`,function(){return r.close()})}return this.layout.showModal(),!0}},{key:`close`,value:function close(){return _superPropGet$6(ComponentModalBase,`close`,this,3)([])?(elementor.hooks.applyFilters(`component/modal/close`,this.layout.getModal().hide.bind(this.layout.getModal()),this)(),!0):!1}},{key:`getModalLayout`,value:function getModalLayout(){se()}}])}(M);T();function ownKeys$3(r,c){var l=Object.keys(r);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(r);c&&(u=u.filter(function(c){return Object.getOwnPropertyDescriptor(r,c).enumerable})),l.push.apply(l,u)}return l}__name(ownKeys$3,`ownKeys`);function _objectSpread$3(r){for(var c=1;c<arguments.length;c++){var l=arguments[c]==null?{}:arguments[c];c%2?ownKeys$3(Object(l),!0).forEach(function(c){_defineProperty(r,c,l[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(l)):ownKeys$3(Object(l)).forEach(function(c){Object.defineProperty(r,c,Object.getOwnPropertyDescriptor(l,c))})}return r}__name(_objectSpread$3,`_objectSpread`);var pe=function(){function EditorOneEventManager(){_classCallCheck(this,EditorOneEventManager)}return _createClass(EditorOneEventManager,null,[{key:`getEventsManager`,value:function getEventsManager(){var r;return(r=elementorCommon)==null?void 0:r.eventsManager}},{key:`getConfig`,value:function getConfig(){var r;return(r=this.getEventsManager())==null?void 0:r.config}},{key:`canSendEvents`,value:function canSendEvents(){var r;return((r=elementorCommon)==null||(r=r.config)==null||(r=r.editor_events)==null?void 0:r.can_send_events)||!1}},{key:`isEventsManagerAvailable`,value:function isEventsManagerAvailable(){var r=this.getEventsManager();return r&&typeof r.dispatchEvent==`function`}},{key:`dispatchEvent`,value:function dispatchEvent(r,c){try{return!this.isEventsManagerAvailable()||!this.canSendEvents()?!1:(this.getEventsManager().dispatchEvent(r,c),!0)}catch(r){return!1}}},{key:`toLowerSnake`,value:function toLowerSnake(r){return!r||typeof r!=`string`?r:r.replace(/\s+/g,`_`).toLowerCase()}},{key:`decodeHtmlEntities`,value:function decodeHtmlEntities(r){return!r||typeof r!=`string`?r:new DOMParser().parseFromString(r,`text/html`).body.textContent||r}},{key:`isInEditorContext`,value:function isInEditorContext(){var r;return window.elementor!==void 0&&!!((r=window.elementor)!=null&&r.documents)}},{key:`getFinderContext`,value:function getFinderContext(){var r,c,l,u,p=this.getConfig(),m=this.isInEditorContext();return{windowName:m?p==null||(r=p.appTypes)==null?void 0:r.editor:p==null||(c=p.appTypes)==null?void 0:c.wpAdmin,targetLocation:this.toLowerSnake(m?p==null||(l=p.locations)==null?void 0:l.topBar:p==null||(u=p.locations)==null?void 0:u.sidebar)}}},{key:`createBasePayload`,value:function createBasePayload(){var r,c,l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},u=this.getConfig();return _objectSpread$3({window_name:(r=u==null||(c=u.appTypes)==null?void 0:c.editor)==null?`editor`:r},l)}},{key:`sendTopBarPublishDropdown`,value:function sendTopBarPublishDropdown(r){var c,l,u,p,m,h,g,v=this.getConfig();return this.dispatchEvent(v==null||(c=v.names)==null||(c=c.editorOne)==null?void 0:c.topBarPublishDropdown,this.createBasePayload({interaction_type:this.toLowerSnake(v==null||(l=v.triggers)==null?void 0:l.click),target_type:v==null||(u=v.targetTypes)==null?void 0:u.dropdownItem,target_name:r,interaction_result:v==null||(p=v.interactionResults)==null?void 0:p.actionSelected,target_location:this.toLowerSnake(v==null||(m=v.locations)==null?void 0:m.topBar),location_l1:this.toLowerSnake(v==null||(h=v.secondaryLocations)==null?void 0:h.publishDropdown),location_l2:v==null||(g=v.targetTypes)==null?void 0:g.dropdownItem,interaction_description:`User selected an action from the publish dropdown`}))}},{key:`sendTopBarPageList`,value:function sendTopBarPageList(r){var c,l,u,p,m,h,g,v,y=arguments.length>1&&arguments[1]!==void 0&&arguments[1],b=this.getConfig();return this.dispatchEvent(b==null||(c=b.names)==null||(c=c.editorOne)==null?void 0:c.topBarPageList,this.createBasePayload({interaction_type:this.toLowerSnake(b==null||(l=b.triggers)==null?void 0:l.click),target_type:b==null||(u=b.targetTypes)==null?void 0:u.dropdownItem,target_name:r,interaction_result:y?b==null||(p=b.interactionResults)==null?void 0:p.create:b==null||(m=b.interactionResults)==null?void 0:m.navigate,target_location:this.toLowerSnake(b==null||(h=b.locations)==null?void 0:h.topBar),location_l1:this.toLowerSnake(b==null||(g=b.secondaryLocations)==null?void 0:g.pageListDropdown),location_l2:b==null||(v=b.targetTypes)==null?void 0:v.dropdownItem,interaction_description:`User selected an action from the page list dropdown`}))}},{key:`sendSiteSettingsSession`,value:function sendSiteSettingsSession(r){var c,l,u,p,m,h=r.targetType,g=r.visitedItems,v=g===void 0?[]:g,y=r.savedItems,b=y===void 0?[]:y,x=r.state,S=this.getConfig();return this.dispatchEvent(S==null||(c=S.names)==null||(c=c.editorOne)==null?void 0:c.siteSettingsSession,this.createBasePayload({interaction_type:this.toLowerSnake(S==null||(l=S.triggers)==null?void 0:l.click),target_type:h,target_name:`site_settings`,interaction_result:S==null||(u=S.interactionResults)==null?void 0:u.sessionEnd,target_location:this.toLowerSnake(S==null||(p=S.locations)==null?void 0:p.leftPanel),location_l1:this.toLowerSnake(S==null||(m=S.secondaryLocations)==null?void 0:m.siteSettings),interaction_description:`Records areas visited as part of the site setting session`,metadata:{visited_items:v,saved_items:b},state:x}))}},{key:`sendELibraryNav`,value:function sendELibraryNav(r){var c,l,u,p,m,h,g=this.getConfig();return this.dispatchEvent(g==null||(c=g.names)==null||(c=c.editorOne)==null?void 0:c.eLibraryNav,this.createBasePayload({interaction_type:this.toLowerSnake(g==null||(l=g.triggers)==null?void 0:l.tabSelect),target_type:g==null||(u=g.targetTypes)==null?void 0:u.tab,target_name:this.toLowerSnake(r),interaction_result:g==null||(p=g.interactionResults)==null?void 0:p.tabChanged,target_location:this.toLowerSnake(g==null||(m=g.locations)==null?void 0:m.elementorLibrary),location_l1:this.toLowerSnake(g==null||(h=g.secondaryLocations)==null?void 0:h.libraryTabs),interaction_description:`User navigates within elementor library`}))}},{key:`sendELibraryInsert`,value:function sendELibraryInsert(r){var c,l,u,p,m,h,g=r.assetId,v=r.assetName,y=r.libraryType,b=r.proRequired,x=b!==void 0&&b,S=this.getConfig(),C=this.createBasePayload({interaction_type:this.toLowerSnake(S==null||(c=S.triggers)==null?void 0:c.insert),target_type:S==null||(l=S.targetTypes)==null?void 0:l.button,target_name:String(g),interaction_result:S==null||(u=S.interactionResults)==null?void 0:u.assetInserted,target_location:this.toLowerSnake(S==null||(p=S.locations)==null?void 0:p.elementorLibrary),location_l1:this.toLowerSnake(y),location_l2:this.toLowerSnake(S==null||(m=S.secondaryLocations)==null?void 0:m.assetCard),interaction_description:`User inserts block/pages from elementor library`,metadata:{template_id:String(g),template_name:this.decodeHtmlEntities(v)||``}});return x&&(C.state=`pro_plan_required`),this.dispatchEvent(S==null||(h=S.names)==null||(h=h.editorOne)==null?void 0:h.eLibraryInsert,C)}},{key:`sendELibraryFavorite`,value:function sendELibraryFavorite(r){var c,l,u,p,m,h,g=r.assetId,v=r.assetName,y=r.libraryType,b=r.isFavorite,x=r.proRequired,S=x!==void 0&&x,C=this.getConfig(),w=this.createBasePayload({interaction_type:this.toLowerSnake(C==null||(c=C.triggers)==null?void 0:c.click),target_type:C==null||(l=C.targetTypes)==null?void 0:l.toggle,target_name:String(g),interaction_result:C==null||(u=C.interactionResults)==null?void 0:u.assetFavorite,target_value:!!b,target_location:this.toLowerSnake(C==null||(p=C.locations)==null?void 0:p.elementorLibrary),location_l1:this.toLowerSnake(y),location_l2:this.toLowerSnake(C==null||(m=C.secondaryLocations)==null?void 0:m.assetCard),interaction_description:`User favorite block/pages from elementor library`,metadata:{template_id:String(g),template_name:this.decodeHtmlEntities(v)||``}});return S&&(w.state=`pro_plan_required`),this.dispatchEvent(C==null||(h=C.names)==null||(h=h.editorOne)==null?void 0:h.eLibraryFavorite,w)}},{key:`sendELibraryGenerateAi`,value:function sendELibraryGenerateAi(r){var c,l,u,p,m,h,g=r.assetId,v=r.assetName,y=r.libraryType,b=this.getConfig();return this.dispatchEvent(b==null||(c=b.names)==null||(c=c.editorOne)==null?void 0:c.eLibraryGenerateAi,this.createBasePayload({interaction_type:this.toLowerSnake(b==null||(l=b.triggers)==null?void 0:l.click),target_type:b==null||(u=b.targetTypes)==null?void 0:u.button,target_name:String(g),interaction_result:b==null||(p=b.interactionResults)==null?void 0:p.aiGenerate,target_location:this.toLowerSnake(b==null||(m=b.locations)==null?void 0:m.elementorLibrary),location_l1:this.toLowerSnake(y),location_l2:this.toLowerSnake(b==null||(h=b.secondaryLocations)==null?void 0:h.assetCard),interaction_description:`User generated block/page based on a library asset`,metadata:{template_id:String(g),template_name:this.decodeHtmlEntities(v)||``}}))}},{key:`sendFinderSearchInput`,value:function sendFinderSearchInput(r){var c,l,u,p,m,h,g=r.resultsCount,v=r.searchTerm,y=v===void 0?null:v,b=this.getConfig(),x=g>0,S=this.getFinderContext(),C=this.createBasePayload({window_name:S.windowName,interaction_type:this.toLowerSnake(b==null||(c=b.triggers)==null?void 0:c.typing),target_type:b==null||(l=b.targetTypes)==null?void 0:l.searchInput,target_name:`finder`,interaction_result:x?b==null||(u=b.interactionResults)==null?void 0:u.resultsUpdated:b==null||(p=b.interactionResults)==null?void 0:p.noResults,target_location:S.targetLocation,location_l1:this.toLowerSnake(b==null||(m=b.secondaryLocations)==null?void 0:m.finder),interaction_description:`Finder search input, follows debounce behavior`,metadata:{results_count:g}});return!x&&y&&(C.metadata.search_term=y),this.dispatchEvent(b==null||(h=b.names)==null||(h=h.editorOne)==null?void 0:h.finderSearchInput,C)}},{key:`sendFinderResultSelect`,value:function sendFinderResultSelect(r){var c,l,u,p,m,h,g=this.getConfig(),v=this.getFinderContext();return this.dispatchEvent(g==null||(c=g.names)==null||(c=c.editorOne)==null?void 0:c.finderResultSelect,this.createBasePayload({window_name:v.windowName,interaction_type:this.toLowerSnake(g==null||(l=g.triggers)==null?void 0:l.click),target_type:g==null||(u=g.targetTypes)==null?void 0:u.searchResult,target_name:r,interaction_result:g==null||(p=g.interactionResults)==null?void 0:p.selected,target_location:v.targetLocation,location_l1:this.toLowerSnake(g==null||(m=g.secondaryLocations)==null?void 0:m.finder),location_l2:this.toLowerSnake(g==null||(h=g.secondaryLocations)==null?void 0:h.finderResults),interaction_description:`Finder search results was selected`}))}},{key:`sendCanvasEmptyBoxAction`,value:function sendCanvasEmptyBoxAction(r){var c,l,u,p,m,h,g=r.targetName,v=r.metadata,y=v===void 0?{}:v,b=r.containerCreated,x=b===void 0?null:b,S=this.getConfig(),C=this.createBasePayload({interaction_type:this.toLowerSnake(S==null||(c=S.triggers)==null?void 0:c.click),target_type:S==null||(l=S.targetTypes)==null?void 0:l.buttons,target_name:g,interaction_result:S==null||(u=S.interactionResults)==null?void 0:u.selected,target_location:this.toLowerSnake(S==null||(p=S.locations)==null?void 0:p.canvas),location_l1:this.toLowerSnake(S==null||(m=S.secondaryLocations)==null?void 0:m.emptyBox),interaction_description:`Empty box on canvas actions`});return Object.keys(y).length>0&&(C.metadata=y),x!==null&&(C.state=x),this.dispatchEvent(S==null||(h=S.names)==null||(h=h.editorOne)==null?void 0:h.canvasEmptyBoxAction,C)}},{key:`sendWidgetPanelSearch`,value:function sendWidgetPanelSearch(r){var c,l,u,p,m,h,g,v,y=r.resultsCount,b=r.userInput,x=b===void 0?null:b,S=this.getConfig(),C=y>0,w=this.createBasePayload({interaction_type:this.toLowerSnake(S==null||(c=S.triggers)==null?void 0:c.typing),target_type:S==null||(l=S.targetTypes)==null?void 0:l.searchWidget,target_name:`search_widget`,interaction_result:C?S==null||(u=S.interactionResults)==null?void 0:u.resultsUpdated:S==null||(p=S.interactionResults)==null?void 0:p.noResults,target_location:this.toLowerSnake(S==null||(m=S.locations)==null?void 0:m.leftPanel),location_l1:this.toLowerSnake(S==null||(h=S.locations)==null?void 0:h.widgetPanel),location_l2:this.toLowerSnake(S==null||(g=S.secondaryLocations)==null?void 0:g.searchBar),interaction_description:`Widget search input, follows debounce behavior`});return!C&&x&&(w.metadata={user_input:x}),this.dispatchEvent(S==null||(v=S.names)==null||(v=v.editorOne)==null?void 0:v.widgetPanelSearch,w)}},{key:`createWpDashPayload`,value:function createWpDashPayload(){var r,c,l,u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},p=this.getConfig();return this.createBasePayload(_objectSpread$3({window_name:(r=p==null||(c=p.appTypes)==null?void 0:c.wpDash)==null?`wpdash`:r,target_location:this.toLowerSnake(p==null||(l=p.locations)==null?void 0:l.wpDashAdmin),location_l2:``},u))}},{key:`sendWpDashElementorMenuClick`,value:function sendWpDashElementorMenuClick(){var r,c,l,u,p,m=this.getConfig();return this.dispatchEvent(m==null||(r=m.names)==null||(r=r.editorOne)==null?void 0:r.wpDashElementorMenuClick,this.createWpDashPayload({interaction_type:this.toLowerSnake(m==null||(c=m.triggers)==null?void 0:c.click),target_type:m==null||(l=m.targetTypes)==null?void 0:l.wpDashAdminMenuItem,target_name:`elementor_menu_item`,interaction_result:m==null||(u=m.interactionResults)==null?void 0:u.elementorSideMenuOpened,location_l1:this.toLowerSnake(m==null||(p=m.secondaryLocations)==null?void 0:p.wpDashElementorCoreMenu),interaction_description:`core_user_clicked_elementor_menu_item`}))}},{key:`sendWpDashEditorSubMenuHover`,value:function sendWpDashEditorSubMenuHover(){var r,c,l,u,p,m=this.getConfig();return this.dispatchEvent(m==null||(r=m.names)==null||(r=r.editorOne)==null?void 0:r.wpDashEditorSubMenuHover,this.createWpDashPayload({interaction_type:this.toLowerSnake(m==null||(c=m.triggers)==null?void 0:c.hover),target_type:m==null||(l=m.targetTypes)==null?void 0:l.wpDashEditorMenu,target_name:`wpdash_editor_sub_menu`,interaction_result:m==null||(u=m.interactionResults)==null?void 0:u.editorSubMenuOpened,location_l1:this.toLowerSnake(m==null||(p=m.secondaryLocations)==null?void 0:p.wpDashElementorCoreSubMenu),interaction_description:`core_user_hovered_sub_menu`}))}},{key:`sendWpDashThemeBuilderClick`,value:function sendWpDashThemeBuilderClick(){var r,c,l,u,p,m=this.getConfig();return this.dispatchEvent(m==null||(r=m.names)==null||(r=r.editorOne)==null?void 0:r.wpDashThemeBuilderClick,this.createWpDashPayload({interaction_type:this.toLowerSnake(m==null||(c=m.triggers)==null?void 0:c.click),target_type:m==null||(l=m.targetTypes)==null?void 0:l.wpDashSubMenuItem,target_name:`theme_builder_menu_item`,interaction_result:m==null||(u=m.interactionResults)==null?void 0:u.themeBuilderPromotionWindow,location_l1:this.toLowerSnake(m==null||(p=m.secondaryLocations)==null?void 0:p.wpDashThemeBuilder),interaction_description:`core_user_clicked_theme_builder_menu_item`}))}},{key:`sendSidebarMenuItemClicked`,value:function sendSidebarMenuItemClicked(r){var c=r.eventId,l=r.groupEventId;try{var u,p,m,h,g,v,y=this.getConfig(),b=this.createBasePayload({window_name:y==null||(u=y.windowNames)==null?void 0:u.sidebarMenu,interaction_type:this.toLowerSnake(y==null||(p=y.triggers)==null?void 0:p.click),target_type:y==null||(m=y.targetTypes)==null?void 0:m.link,target_name:c,interaction_result:y==null||(h=y.interactionResults)==null?void 0:h.pageOpened,target_location:this.toLowerSnake(y==null||(g=y.locations)==null?void 0:g.sidebar)});return l&&(b.location_l1=l),this.dispatchEvent(y==null||(v=y.names)==null||(v=v.editorOne)==null?void 0:v.sidebarMenuItemClicked,b)}catch(r){return!1}}},{key:`sendSidebarMenuGroupToggled`,value:function sendSidebarMenuGroupToggled(r){var c=r.eventId,l=r.isExpanded;try{var u,p,m,h,g,v,y,b=this.getConfig(),x=l?b==null||(u=b.interactionResults)==null?void 0:u.expanded:b==null||(p=b.interactionResults)==null?void 0:p.collapsed;return this.dispatchEvent(b==null||(m=b.names)==null||(m=m.editorOne)==null?void 0:m.sidebarMenuGroupToggled,this.createBasePayload({window_name:b==null||(h=b.windowNames)==null?void 0:h.sidebarMenu,interaction_type:this.toLowerSnake(b==null||(g=b.triggers)==null?void 0:g.click),target_type:b==null||(v=b.targetTypes)==null?void 0:v.toggle,target_name:c,interaction_result:x,target_location:this.toLowerSnake(b==null||(y=b.locations)==null?void 0:y.sidebar)}))}catch(r){return!1}}}])}(),me=function createDebouncedFinderSearch(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:300;return _.debounce(function(r,c){pe.sendFinderSearchInput({resultsCount:r,searchTerm:c})},r)};function _callSuper$22(r,c,l){return c=_getPrototypeOf(c),_possibleConstructorReturn(r,_isNativeReflectConstruct$22()?Reflect.construct(c,l||[],_getPrototypeOf(r).constructor):c.apply(r,l))}__name(_callSuper$22,`_callSuper`);function _isNativeReflectConstruct$22(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(r){}return(_isNativeReflectConstruct$22=function _isNativeReflectConstruct(){return!!r})()}__name(_isNativeReflectConstruct$22,`_isNativeReflectConstruct`);var he=function(r){function _default(){return _classCallCheck(this,_default),_callSuper$22(this,_default,arguments)}return _inherits$1(_default,r),_createClass(_default,[{key:`className`,value:function className(){return`elementor-finder__results__item`}},{key:`getTemplate`,value:function getTemplate(){return`#tmpl-elementor-finder__results__item`}},{key:`events`,value:function events(){this.$el[0].addEventListener(`click`,this.onClick.bind(this),!0)}},{key:`trackResultSelect`,value:function trackResultSelect(){var r=this.model.get(`title`);pe.sendFinderResultSelect(r)}},{key:`onClick`,value:function onClick(r){var l=this,u=this.model.get(`lock`);if(!(u!=null&&u.is_locked)){this.trackResultSelect();var p=this.model.get(`url`)||``;p.includes(`page=elementor-app`)&&window.$e&&(r.preventDefault(),r.stopImmediatePropagation(),$e.run(`finder/close`),$e.run(`app/open`,{url:p}));return}r.preventDefault(),r.stopImmediatePropagation(),elementorCommon.dialogsManager.createWidget(`confirm`,{id:`elementor-finder__lock-dialog`,headerMessage:u.content.heading,message:u.content.description,position:{my:`center center`,at:`center center`},strings:{confirm:u.button.text,cancel:(0,c.__)(`Cancel`,`elementor`)},onConfirm:function onConfirm(){l.trackResultSelect();var r=l.replaceLockLinkPlaceholders(u.button.url);window.open(r,`_blank`)}}).show()}},{key:`replaceLockLinkPlaceholders`,value:function replaceLockLinkPlaceholders(r){return r.replace(/%%utm_source%%/g,`finder`).replace(/%%utm_medium%%/g,`wp-dash`)}}])}(Marionette.ItemView);function _callSuper$21(r,c,l){return c=_getPrototypeOf(c),_possibleConstructorReturn(r,_isNativeReflectConstruct$21()?Reflect.construct(c,l||[],_getPrototypeOf(r).constructor):c.apply(r,l))}__name(_callSuper$21,`_callSuper`);function _isNativeReflectConstruct$21(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(r){}return(_isNativeReflectConstruct$21=function _isNativeReflectConstruct(){return!!r})()}__name(_isNativeReflectConstruct$21,`_isNativeReflectConstruct`);var ge=function(r){function _default(){return _classCallCheck(this,_default),_callSuper$21(this,_default,arguments)}return _inherits$1(_default,r),_createClass(_default,[{key:`defaults`,value:function defaults(){return{description:``,icon:`settings`,url:``,keywords:[],actions:[],lock:null}}}])}(Backbone.Model);function _callSuper$20(r,c,l){return c=_getPrototypeOf(c),_possibleConstructorReturn(r,_isNativeReflectConstruct$20()?Reflect.construct(c,l||[],_getPrototypeOf(r).constructor):c.apply(r,l))}__name(_callSuper$20,`_callSuper`);function _isNativeReflectConstruct$20(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(r){}return(_isNativeReflectConstruct$20=function _isNativeReflectConstruct(){return!!r})()}__name(_isNativeReflectConstruct$20,`_isNativeReflectConstruct`);var _e=function(r){function _default(){return _classCallCheck(this,_default),_callSuper$20(this,_default,arguments)}return _inherits$1(_default,r),_createClass(_default,[{key:`className`,value:function className(){return`elementor-finder__results__category`}},{key:`getTemplate`,value:function getTemplate(){return`#tmpl-elementor-finder__results__category`}},{key:`getChildView`,value:function getChildView(){return he}},{key:`initialize`,value:function initialize(){this.childViewContainer=`.elementor-finder__results__category__items`,this.isVisible=!0;var r=this.model.get(`items`);r&&(r=Object.values(r)),this.collection=new Backbone.Collection(r,{model:ge})}},{key:`filter`,value:function filter(r){var c=this.getTextFilter();return r.get(`title`).toLowerCase().indexOf(c)>=0||r.get(`keywords`).some(function(r){return r.indexOf(c)>=0})}},{key:`getTextFilter`,value:function getTextFilter(){return elementorCommon.finder.channel.request(`filter:text`).trim().toLowerCase()}},{key:`toggleElement`,value:function toggleElement(){var r=!!this.children.length;r!==this.isVisible&&(this.isVisible=r,this.$el.toggle(r),this.triggerMethod(`toggle:visibility`))}},{key:`onRender`,value:function onRender(){this.listenTo(elementorCommon.finder.channel,`filter:change`,this.onFilterChange.bind(this))}},{key:`onFilterChange`,value:function onFilterChange(){this._renderChildren()}},{key:`onRenderCollection`,value:function onRenderCollection(){this.toggleElement()}}])}(Marionette.CompositeView);function _callSuper$19(r,c,l){return c=_getPrototypeOf(c),_possibleConstructorReturn(r,_isNativeReflectConstruct$19()?Reflect.construct(c,l||[],_getPrototypeOf(r).constructor):c.apply(r,l))}__name(_callSuper$19,`_callSuper`);function _isNativeReflectConstruct$19(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(r){}return(_isNativeReflectConstruct$19=function _isNativeReflectConstruct(){return!!r})()}__name(_isNativeReflectConstruct$19,`_isNativeReflectConstruct`);function _superPropGet$5(r,c,l,u){var p=_get(_getPrototypeOf(1&u?r.prototype:r),c,l);return 2&u&&typeof p==`function`?function(r){return p.apply(l,r)}:p}__name(_superPropGet$5,`_superPropGet`);var N=function(r){function _default(){return _classCallCheck(this,_default),_callSuper$19(this,_default,arguments)}return _inherits$1(_default,r),_createClass(_default,[{key:`className`,value:function className(){return _superPropGet$5(_default,`className`,this,3)([])+` elementor-finder__results__category--dynamic`}},{key:`ui`,value:function ui(){return{title:`.elementor-finder__results__category__title`}}},{key:`fetchData`,value:function fetchData(){var r=this;this.ui.loadingIcon.show(),elementorCommon.ajax.addRequest(`finder_get_category_items`,{data:{category:this.model.get(`name`),filter:this.getTextFilter()},success:function success(c){r.isDestroyed||(r.collection.set(c),r.toggleElement(),r.ui.loadingIcon.hide())}})}},{key:`filter`,value:function filter(){return!0}},{key:`onFilterChange`,value:function onFilterChange(){this.fetchData()}},{key:`onRender`,value:function onRender(){_superPropGet$5(_default,`onRender`,this,3)([]),this.ui.loadingIcon=jQuery(`<i>`,{class:`eicon-loading eicon-animation-spin`}),this.ui.title.after(this.ui.loadingIcon),this.fetchData()}}])}(_e);function _callSuper$18(r,c,l){return c=_getPrototypeOf(c),_possibleConstructorReturn(r,_isNativeReflectConstruct$18()?Reflect.construct(c,l||[],_getPrototypeOf(r).constructor):c.apply(r,l))}__name(_callSuper$18,`_callSuper`);function _isNativeReflectConstruct$18(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(r){}return(_isNativeReflectConstruct$18=function _isNativeReflectConstruct(){return!!r})()}__name(_isNativeReflectConstruct$18,`_isNativeReflectConstruct`);var ve=function(r){function _default(){return _classCallCheck(this,_default),_callSuper$18(this,_default,arguments)}return _inherits$1(_default,r),_createClass(_default,[{key:`id`,value:function id(){return`elementor-finder__results-container`}},{key:`ui`,value:function ui(){return this.selectors={noResults:`#elementor-finder__no-results`,categoryItem:`.elementor-finder__results__item`},this.selectors}},{key:`events`,value:function events(){return{"mouseenter @ui.categoryItem":`onCategoryItemMouseEnter`}}},{key:`getTemplate`,value:function getTemplate(){return`#tmpl-elementor-finder-results-container`}},{key:`getChildView`,value:function getChildView(r){return r.get(`dynamic`)?N:_e}},{key:`initialize`,value:function initialize(){this.$activeItem=null,this.childViewContainer=`#elementor-finder__results`,this.collection=new Backbone.Collection(Object.values(elementorCommon.finder.getSettings(`data`)))}},{key:`activateItem`,value:function activateItem(r){this.$activeItem&&this.$activeItem.removeClass(`elementor-active`),r.addClass(`elementor-active`),this.$activeItem=r}},{key:`activateNextItem`,value:function activateNextItem(r){var c=jQuery(this.selectors.categoryItem),l=0;this.$activeItem&&(l=c.index(this.$activeItem)+(r?-1:1),l>=c.length?l=0:l<0&&(l=c.length-1));var u=c.eq(l);this.activateItem(u),u[0].scrollIntoView({block:`nearest`})}},{key:`goToActiveItem`,value:function goToActiveItem(r){var c=this.$activeItem.children(`a`),l=$e.shortcuts.isControlEvent(r);l&&c.attr(`target`,`_blank`),c[0].click(),l&&c.removeAttr(`target`)}},{key:`onCategoryItemMouseEnter`,value:function onCategoryItemMouseEnter(r){this.activateItem(jQuery(r.currentTarget))}},{key:`onChildviewToggleVisibility`,value:function onChildviewToggleVisibility(){var r=this.children.every(function(r){return!r.isVisible});this.ui.noResults.toggle(r)}}])}(Marionette.CompositeView);function _callSuper$17(r,c,l){return c=_getPrototypeOf(c),_possibleConstructorReturn(r,_isNativeReflectConstruct$17()?Reflect.construct(c,l||[],_getPrototypeOf(r).constructor):c.apply(r,l))}__name(_callSuper$17,`_callSuper`);function _isNativeReflectConstruct$17(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(r){}return(_isNativeReflectConstruct$17=function _isNativeReflectConstruct(){return!!r})()}__name(_isNativeReflectConstruct$17,`_isNativeReflectConstruct`);var ye=300,be=function(r){function _default(){return _classCallCheck(this,_default),_callSuper$17(this,_default,arguments)}return _inherits$1(_default,r),_createClass(_default,[{key:`id`,value:function id(){return`elementor-finder`}},{key:`getTemplate`,value:function getTemplate(){return`#tmpl-elementor-finder`}},{key:`ui`,value:function ui(){return{searchInput:`#elementor-finder__search__input`}}},{key:`events`,value:function events(){return{"input @ui.searchInput":`onSearchInputInput`}}},{key:`regions`,value:function regions(){return{content:`#elementor-finder__content`}}},{key:`initialize`,value:function initialize(){this.debouncedTrackSearch=me(ye)}},{key:`showCategoriesView`,value:function showCategoriesView(){this.content.show(new ve)}},{key:`getResultsCount`,value:function getResultsCount(){return this.content.currentView?this.content.currentView.$el.find(`.elementor-finder__results__item:visible`).length:0}},{key:`onSearchInputInput`,value:function onSearchInputInput(){var r=this,c=this.ui.searchInput.val();c&&(elementorCommon.finder.channel.reply(`filter:text`,c).trigger(`filter:change`),this.content.currentView instanceof ve||this.showCategoriesView(),setTimeout(function(){var l=r.getResultsCount();r.debouncedTrackSearch(l,c)},50)),this.content.currentView.$el.toggle(!!c)}},{key:`onDestroy`,value:function onDestroy(){var r;(r=this.debouncedTrackSearch)!=null&&r.cancel&&this.debouncedTrackSearch.cancel()}}])}(Marionette.LayoutView);function _callSuper$16(r,c,l){return c=_getPrototypeOf(c),_possibleConstructorReturn(r,_isNativeReflectConstruct$16()?Reflect.construct(c,l||[],_getPrototypeOf(r).constructor):c.apply(r,l))}__name(_callSuper$16,`_callSuper`);function _isNativeReflectConstruct$16(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(r){}return(_isNativeReflectConstruct$16=function _isNativeReflectConstruct(){return!!r})()}__name(_isNativeReflectConstruct$16,`_isNativeReflectConstruct`);function _superPropGet$4(r,c,l,u){var p=_get(_getPrototypeOf(1&u?r.prototype:r),c,l);return 2&u&&typeof p==`function`?function(r){return p.apply(l,r)}:p}__name(_superPropGet$4,`_superPropGet`);var xe=function(r){function _default(){return _classCallCheck(this,_default),_callSuper$16(this,_default,arguments)}return _inherits$1(_default,r),_createClass(_default,[{key:`getModalOptions`,value:function getModalOptions(){return{id:`elementor-finder__modal`,draggable:!0,effects:{show:`show`,hide:`hide`},position:{enable:!1}}}},{key:`getLogoOptions`,value:function getLogoOptions(){return{title:(0,c.__)(`Finder`,`elementor`)}}},{key:`initialize`,value:function initialize(){for(var r=arguments.length,c=Array(r),l=0;l<r;l++)c[l]=arguments[l];_superPropGet$4(_default,`initialize`,this,3)(c),this.showLogo(),this.showContentView()}},{key:`showContentView`,value:function showContentView(){this.modalContent.show(new be)}},{key:`showModal`,value:function showModal(){for(var r=arguments.length,c=Array(r),l=0;l<r;l++)c[l]=arguments[l];_superPropGet$4(_default,`showModal`,this,3)(c),this.modalContent.currentView.ui.searchInput.focus()}}])}(elementorModules.common.views.modal.Layout);function _callSuper$15(r,c,l){return c=_getPrototypeOf(c),_possibleConstructorReturn(r,_isNativeReflectConstruct$15()?Reflect.construct(c,l||[],_getPrototypeOf(r).constructor):c.apply(r,l))}__name(_callSuper$15,`_callSuper`);function _isNativeReflectConstruct$15(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(r){}return(_isNativeReflectConstruct$15=function _isNativeReflectConstruct(){return!!r})()}__name(_isNativeReflectConstruct$15,`_isNativeReflectConstruct`);var Se=function(r){function NavigateDown(){return _classCallCheck(this,NavigateDown),_callSuper$15(this,NavigateDown,arguments)}return _inherits$1(NavigateDown,r),_createClass(NavigateDown,[{key:`apply`,value:function apply(){this.component.getItemsView().activateNextItem()}}])}(re);function _callSuper$14(r,c,l){return c=_getPrototypeOf(c),_possibleConstructorReturn(r,_isNativeReflectConstruct$14()?Reflect.construct(c,l||[],_getPrototypeOf(r).constructor):c.apply(r,l))}__name(_callSuper$14,`_callSuper`);function _isNativeReflectConstruct$14(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(r){}return(_isNativeReflectConstruct$14=function _isNativeReflectConstruct(){return!!r})()}__name(_isNativeReflectConstruct$14,`_isNativeReflectConstruct`);var Ce=function(r){function NavigateSelect(){return _classCallCheck(this,NavigateSelect),_callSuper$14(this,NavigateSelect,arguments)}return _inherits$1(NavigateSelect,r),_createClass(NavigateSelect,[{key:`apply`,value:function apply(r){this.component.getItemsView().goToActiveItem(r)}}])}(re);function _callSuper$13(r,c,l){return c=_getPrototypeOf(c),_possibleConstructorReturn(r,_isNativeReflectConstruct$13()?Reflect.construct(c,l||[],_getPrototypeOf(r).constructor):c.apply(r,l))}__name(_callSuper$13,`_callSuper`);function _isNativeReflectConstruct$13(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(r){}return(_isNativeReflectConstruct$13=function _isNativeReflectConstruct(){return!!r})()}__name(_isNativeReflectConstruct$13,`_isNativeReflectConstruct`);var we=function(r){function NavigateUp(){return _classCallCheck(this,NavigateUp),_callSuper$13(this,NavigateUp,arguments)}return _inherits$1(NavigateUp,r),_createClass(NavigateUp,[{key:`apply`,value:function apply(){this.component.getItemsView().activateNextItem(!0)}}])}(re),Te=__exportAll({NavigateDown:()=>Se,NavigateSelect:()=>Ce,NavigateUp:()=>we});T();function ownKeys$2(r,c){var l=Object.keys(r);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(r);c&&(u=u.filter(function(c){return Object.getOwnPropertyDescriptor(r,c).enumerable})),l.push.apply(l,u)}return l}__name(ownKeys$2,`ownKeys`);function _objectSpread$2(r){for(var c=1;c<arguments.length;c++){var l=arguments[c]==null?{}:arguments[c];c%2?ownKeys$2(Object(l),!0).forEach(function(c){_defineProperty(r,c,l[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(l)):ownKeys$2(Object(l)).forEach(function(c){Object.defineProperty(r,c,Object.getOwnPropertyDescriptor(l,c))})}return r}__name(_objectSpread$2,`_objectSpread`);function _callSuper$12(r,c,l){return c=_getPrototypeOf(c),_possibleConstructorReturn(r,_isNativeReflectConstruct$12()?Reflect.construct(c,l||[],_getPrototypeOf(r).constructor):c.apply(r,l))}__name(_callSuper$12,`_callSuper`);function _isNativeReflectConstruct$12(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(r){}return(_isNativeReflectConstruct$12=function _isNativeReflectConstruct(){return!!r})()}__name(_isNativeReflectConstruct$12,`_isNativeReflectConstruct`);function _superPropGet$3(r,c,l,u){var p=_get(_getPrototypeOf(1&u?r.prototype:r),c,l);return 2&u&&typeof p==`function`?function(r){return p.apply(l,r)}:p}__name(_superPropGet$3,`_superPropGet`);var Ee=function(r){function Component(){return _classCallCheck(this,Component),_callSuper$12(this,Component,arguments)}return _inherits$1(Component,r),_createClass(Component,[{key:`getNamespace`,value:function getNamespace(){return`finder`}},{key:`defaultShortcuts`,value:function defaultShortcuts(){var r=this;return{"":{keys:`ctrl+e`},"navigate-down":{keys:`down`,scopes:[this.getNamespace()],dependency:function dependency(){return r.getItemsView()}},"navigate-up":{keys:`up`,scopes:[this.getNamespace()],dependency:function dependency(){return r.getItemsView()}},"navigate-select":{keys:`enter`,scopes:[this.getNamespace()],dependency:function dependency(){return r.getItemsView().$activeItem}}}}},{key:`defaultCommands`,value:function defaultCommands(){return _objectSpread$2(_objectSpread$2({"navigate/down":function navigate_down(){elementorDevTools.deprecation.deprecated(`$e.run( 'finder/navigate/down' )`,`3.0.0`,`$e.run( 'finder/navigate-down' )`),$e.run(`finder/navigate-down`)},"navigate/up":function navigate_up(){elementorDevTools.deprecation.deprecated(`$e.run( 'finder/navigate/up' )`,`3.0.0`,`$e.run( 'finder/navigate-up' )`),$e.run(`finder/navigate-up`)},"navigate/select":function navigate_select(r){elementorDevTools.deprecation.deprecated(`$e.run( 'finder/navigate/select', event )`,`3.0.0`,`$e.run( 'finder/navigate-select', event )`),$e.run(`finder/navigate-select`,r)}},_superPropGet$3(Component,`defaultCommands`,this,3)([])),this.importCommands(Te))}},{key:`getModalLayout`,value:function getModalLayout(){return xe}},{key:`getItemsView`,value:function getItemsView(){return this.layout.modalContent.currentView.content.currentView}}])}(fe);function _callSuper$11(r,c,l){return c=_getPrototypeOf(c),_possibleConstructorReturn(r,_isNativeReflectConstruct$11()?Reflect.construct(c,l||[],_getPrototypeOf(r).constructor):c.apply(r,l))}__name(_callSuper$11,`_callSuper`);function _isNativeReflectConstruct$11(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(r){}return(_isNativeReflectConstruct$11=function _isNativeReflectConstruct(){return!!r})()}__name(_isNativeReflectConstruct$11,`_isNativeReflectConstruct`);var De=function(r){function _default(){return _classCallCheck(this,_default),_callSuper$11(this,_default,arguments)}return _inherits$1(_default,r),_createClass(_default,[{key:`onInit`,value:function onInit(){window.top===window&&(this.channel=Backbone.Radio.channel(`ELEMENTOR:finder`),$e.components.register(new Ee({manager:this})))}}])}(elementorModules.Module);function _callSuper$10(r,c,l){return c=_getPrototypeOf(c),_possibleConstructorReturn(r,_isNativeReflectConstruct$10()?Reflect.construct(c,l||[],_getPrototypeOf(r).constructor):c.apply(r,l))}__name(_callSuper$10,`_callSuper`);function _isNativeReflectConstruct$10(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(r){}return(_isNativeReflectConstruct$10=function _isNativeReflectConstruct(){return!!r})()}__name(_isNativeReflectConstruct$10,`_isNativeReflectConstruct`);function _superPropGet$2(r,c,l,u){var p=_get(_getPrototypeOf(1&u?r.prototype:r),c,l);return 2&u&&typeof p==`function`?function(r){return p.apply(l,r)}:p}__name(_superPropGet$2,`_superPropGet`);var Oe=function(r){function _default(){return _classCallCheck(this,_default),_callSuper$10(this,_default,arguments)}return _inherits$1(_default,r),_createClass(_default,[{key:`addPopupPlugin`,value:function addPopupPlugin(){var r=0;jQuery.fn.elementorConnect=function(l){var u=this;l!=null&&l.popup&&(jQuery(this).on(`click`,function(r){var c,p;r.preventDefault();var m=((c=l.popup)==null?void 0:c.width)||600,h=((p=l.popup)==null?void 0:p.height)||700;window.open(jQuery(u).attr(`href`)+`&mode=popup`,`elementorConnect`,`toolbar=no, menubar=no, width=${m}, height=${h}, top=200, left=0`)}),delete l.popup);var p=jQuery.extend({success:function success(){return location.reload()},error:function error(){elementor.notifications.showToast({message:(0,c.__)(`Unable to connect`,`elementor`)})},parseUrl:function parseUrl(r){return r}},l);return this.each(function(){r++;var c=jQuery(this),l=`cb`+r;c.attr({target:`_blank`,rel:`opener`,href:p.parseUrl(c.attr(`href`)+`&mode=popup&callback_id=`+l)}),elementorCommon.elements.$window.on(`elementor/connect/success/`+l,p.success).on(`elementor/connect/error/`+l,p.error)}),this}}},{key:`getDefaultSettings`,value:function getDefaultSettings(){return{selectors:{connectButton:`#elementor-template-library-connect__button`}}}},{key:`getDefaultElements`,value:function getDefaultElements(){return{$connectButton:jQuery(this.getSettings(`selectors.connectButton`))}}},{key:`applyPopup`,value:function applyPopup(){this.elements.$connectButton.elementorConnect()}},{key:`onInit`,value:function onInit(){_superPropGet$2(_default,`onInit`,this,3)([]),this.addPopupPlugin(),this.applyPopup()}}])}(elementorModules.ViewModule);function asyncGeneratorStep$1(r,c,l,u,p,m,h){try{var g=r[m](h),v=g.value}catch(r){l(r);return}g.done?c(v):Promise.resolve(v).then(u,p)}__name(asyncGeneratorStep$1,`asyncGeneratorStep`);function _asyncToGenerator(r){return function(){var c=this,l=arguments;return new Promise(function(u,p){var m=r.apply(c,l);function _next(r){asyncGeneratorStep$1(m,u,p,_next,_throw,`next`,r)}function _throw(r){asyncGeneratorStep$1(m,u,p,_next,_throw,`throw`,r)}_next(void 0)})}}var ke=__commonJSMin(((r,c)=>{function _OverloadYield(r,c){this.v=r,this.k=c}c.exports=_OverloadYield,c.exports.__esModule=!0,c.exports.default=c.exports})),Ae=__commonJSMin(((r,c)=>{function _regeneratorDefine(r,l,u,p){var m=Object.defineProperty;try{m({},``,{})}catch(r){m=0}c.exports=_regeneratorDefine=function regeneratorDefine(r,c,l,u){function o(c,l){_regeneratorDefine(r,c,function(r){return this._invoke(c,l,r)})}c?m?m(r,c,{value:l,enumerable:!u,configurable:!u,writable:!u}):r[c]=l:(o(`next`,0),o(`throw`,1),o(`return`,2))},c.exports.__esModule=!0,c.exports.default=c.exports,_regeneratorDefine(r,l,u,p)}c.exports=_regeneratorDefine,c.exports.__esModule=!0,c.exports.default=c.exports})),je=__commonJSMin(((r,c)=>{var l=Ae();function _regenerator(){ |
| 5 |
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ |
| 6 |
var r,u,p=typeof Symbol==`function`?Symbol:{},m=p.iterator||`@@iterator`,h=p.toStringTag||`@@toStringTag`;function i(c,p,m,h){var v=p&&p.prototype instanceof Generator?p:Generator,y=Object.create(v.prototype);return l(y,`_invoke`,function(c,l,p){var m,h,v,y=0,b=p||[],x=!1,S={p:0,n:0,v:r,a:d,f:d.bind(r,4),d:function d(c,l){return m=c,h=0,v=r,S.n=l,g}};function d(c,l){for(h=c,v=l,u=0;!x&&y&&!p&&u<b.length;u++){var p,m=b[u],C=S.p,w=m[2];c>3?(p=w===l)&&(v=m[(h=m[4])?5:(h=3,3)],m[4]=m[5]=r):m[0]<=C&&((p=c<2&&C<m[1])?(h=0,S.v=l,S.n=m[1]):C<w&&(p=c<3||m[0]>l||l>w)&&(m[4]=c,m[5]=l,S.n=w,h=0))}if(p||c>1)return g;throw x=!0,l}return function(p,b,C){if(y>1)throw TypeError(`Generator is already running`);for(x&&b===1&&d(b,C),h=b,v=C;(u=h<2?r:v)||!x;){m||(h?h<3?(h>1&&(S.n=-1),d(h,v)):S.n=v:S.v=v);try{if(y=2,m){if(h||(p=`next`),u=m[p]){if(!(u=u.call(m,v)))throw TypeError(`iterator result is not an object`);if(!u.done)return u;v=u.value,h<2&&(h=0)}else h===1&&(u=m.return)&&u.call(m),h<2&&(v=TypeError(`The iterator does not provide a '`+p+`' method`),h=1);m=r}else if((u=(x=S.n<0)?v:c.call(l,S))!==g)break}catch(c){m=r,h=1,v=c}finally{y=1}}return{value:u,done:x}}}(c,m,h),!0),y}var g={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}u=Object.getPrototypeOf;var v=[][m]?u(u([][m]())):(l(u={},m,function(){return this}),u),y=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(v);function f(r){return Object.setPrototypeOf?Object.setPrototypeOf(r,GeneratorFunctionPrototype):(r.__proto__=GeneratorFunctionPrototype,l(r,h,`GeneratorFunction`)),r.prototype=Object.create(y),r}return GeneratorFunction.prototype=GeneratorFunctionPrototype,l(y,`constructor`,GeneratorFunctionPrototype),l(GeneratorFunctionPrototype,`constructor`,GeneratorFunction),GeneratorFunction.displayName=`GeneratorFunction`,l(GeneratorFunctionPrototype,h,`GeneratorFunction`),l(y),l(y,h,`Generator`),l(y,m,function(){return this}),l(y,`toString`,function(){return`[object Generator]`}),(c.exports=_regenerator=function _regenerator(){return{w:i,m:f}},c.exports.__esModule=!0,c.exports.default=c.exports)()}c.exports=_regenerator,c.exports.__esModule=!0,c.exports.default=c.exports})),Me=__commonJSMin(((r,c)=>{var l=ke(),u=Ae();function AsyncIterator(r,c){function n(u,p,m,h){try{var g=r[u](p),v=g.value;return v instanceof l?c.resolve(v.v).then(function(r){n(`next`,r,m,h)},function(r){n(`throw`,r,m,h)}):c.resolve(v).then(function(r){g.value=r,m(g)},function(r){return n(`throw`,r,m,h)})}catch(r){h(r)}}var p;this.next||(u(AsyncIterator.prototype),u(AsyncIterator.prototype,typeof Symbol==`function`&&Symbol.asyncIterator||`@asyncIterator`,function(){return this})),u(this,`_invoke`,function(r,l,u){function f(){return new c(function(c,l){n(r,u,c,l)})}return p=p?p.then(f,f):f()},!0)}c.exports=AsyncIterator,c.exports.__esModule=!0,c.exports.default=c.exports})),Ne=__commonJSMin(((r,c)=>{var l=je(),u=Me();function _regeneratorAsyncGen(r,c,p,m,h){return new u(l().w(r,c,p,m),h||Promise)}c.exports=_regeneratorAsyncGen,c.exports.__esModule=!0,c.exports.default=c.exports})),Pe=__commonJSMin(((r,c)=>{var l=Ne();function _regeneratorAsync(r,c,u,p,m){var h=l(r,c,u,p,m);return h.next().then(function(r){return r.done?r.value:h.next()})}c.exports=_regeneratorAsync,c.exports.__esModule=!0,c.exports.default=c.exports})),Fe=__commonJSMin(((r,c)=>{function _regeneratorKeys(r){var c=Object(r),l=[];for(var u in c)l.unshift(u);return function e(){for(;l.length;)if((u=l.pop())in c)return e.value=u,e.done=!1,e;return e.done=!0,e}}c.exports=_regeneratorKeys,c.exports.__esModule=!0,c.exports.default=c.exports})),Ie=__commonJSMin(((r,c)=>{function _typeof(r){"@babel/helpers - typeof";return c.exports=_typeof=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(r){return typeof r}:function(r){return r&&typeof Symbol==`function`&&r.constructor===Symbol&&r!==Symbol.prototype?`symbol`:typeof r},c.exports.__esModule=!0,c.exports.default=c.exports,_typeof(r)}c.exports=_typeof,c.exports.__esModule=!0,c.exports.default=c.exports})),Le=__commonJSMin(((r,c)=>{var l=Ie().default;function _regeneratorValues(r){if(r!=null){var c=r[typeof Symbol==`function`&&Symbol.iterator||`@@iterator`],u=0;if(c)return c.call(r);if(typeof r.next==`function`)return r;if(!isNaN(r.length))return{next:function next(){return r&&u>=r.length&&(r=void 0),{value:r&&r[u++],done:!r}}}}throw TypeError(l(r)+` is not iterable`)}c.exports=_regeneratorValues,c.exports.__esModule=!0,c.exports.default=c.exports})),Re=__commonJSMin(((r,c)=>{var l=ke(),u=je(),p=Pe(),m=Ne(),h=Me(),g=Fe(),v=Le();function _regeneratorRuntime(){"use strict";var r=u(),y=r.m(_regeneratorRuntime),b=(Object.getPrototypeOf?Object.getPrototypeOf(y):y.__proto__).constructor;function n(r){var c=typeof r==`function`&&r.constructor;return!!c&&(c===b||(c.displayName||c.name)===`GeneratorFunction`)}var x={throw:1,return:2,break:3,continue:3};function a(r){var c,l;return function(u){c||(c={stop:function stop(){return l(u.a,2)},catch:function _catch(){return u.v},abrupt:function abrupt(r,c){return l(u.a,x[r],c)},delegateYield:function delegateYield(r,p,m){return c.resultName=p,l(u.d,v(r),m)},finish:function finish(r){return l(u.f,r)}},l=function t(r,l,p){u.p=c.prev,u.n=c.next;try{return r(l,p)}finally{c.next=u.n}}),c.resultName&&(c[c.resultName]=u.v,c.resultName=void 0),c.sent=u.v,c.next=u.n;try{return r.call(this,c)}finally{u.p=c.prev,u.n=c.next}}}return(c.exports=_regeneratorRuntime=function _regeneratorRuntime(){return{wrap:function wrap(c,l,u,p){return r.w(a(c),l,u,p&&p.reverse())},isGeneratorFunction:n,mark:r.m,awrap:function awrap(r,c){return new l(r,c)},AsyncIterator:h,async:function async(r,c,l,u,h){return(n(c)?m:p)(a(r),c,l,u,h)},keys:g,values:v}},c.exports.__esModule=!0,c.exports.default=c.exports)()}c.exports=_regeneratorRuntime,c.exports.__esModule=!0,c.exports.default=c.exports})),ze=__toESM(__commonJSMin(((r,c)=>{var l=Re()();c.exports=l;try{regeneratorRuntime=l}catch(r){typeof globalThis==`object`?globalThis.regeneratorRuntime=l:Function(`r`,`regeneratorRuntime = r`)(l)}}))());T();function ownKeys$1(r,c){var l=Object.keys(r);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(r);c&&(u=u.filter(function(c){return Object.getOwnPropertyDescriptor(r,c).enumerable})),l.push.apply(l,u)}return l}__name(ownKeys$1,`ownKeys`);function _objectSpread$1(r){for(var c=1;c<arguments.length;c++){var l=arguments[c]==null?{}:arguments[c];c%2?ownKeys$1(Object(l),!0).forEach(function(c){_defineProperty(r,c,l[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(l)):ownKeys$1(Object(l)).forEach(function(c){Object.defineProperty(r,c,Object.getOwnPropertyDescriptor(l,c))})}return r}__name(_objectSpread$1,`_objectSpread`);function _callSuper$9(r,c,l){return c=_getPrototypeOf(c),_possibleConstructorReturn(r,_isNativeReflectConstruct$9()?Reflect.construct(c,l||[],_getPrototypeOf(r).constructor):c.apply(r,l))}__name(_callSuper$9,`_callSuper`);function _isNativeReflectConstruct$9(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(r){}return(_isNativeReflectConstruct$9=function _isNativeReflectConstruct(){return!!r})()}__name(_isNativeReflectConstruct$9,`_isNativeReflectConstruct`);var Be=function(r){function BaseError(){var r,c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:``,l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:``,u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return _classCallCheck(this,BaseError),r=_callSuper$9(this,BaseError,[c]),_defineProperty(r,`code`,``),_defineProperty(r,`data`,[]),r.code=l,r.data=u,r}return _inherits$1(BaseError,r),_createClass(BaseError,[{key:`notify`,value:function notify(){k.error(_objectSpread$1({message:this.message},this))}}],[{key:`create`,value:function create(r){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:``,l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return new this(r,c,l)}},{key:`getHTTPErrorCode`,value:function getHTTPErrorCode(){se()}}])}(_wrapNativeSuper(Error));function _callSuper$8(r,c,l){return c=_getPrototypeOf(c),_possibleConstructorReturn(r,_isNativeReflectConstruct$8()?Reflect.construct(c,l||[],_getPrototypeOf(r).constructor):c.apply(r,l))}__name(_callSuper$8,`_callSuper`);function _isNativeReflectConstruct$8(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(r){}return(_isNativeReflectConstruct$8=function _isNativeReflectConstruct(){return!!r})()}__name(_isNativeReflectConstruct$8,`_isNativeReflectConstruct`);var Ve=function(r){function DefaultError(){return _classCallCheck(this,DefaultError),_callSuper$8(this,DefaultError,arguments)}return _inherits$1(DefaultError,r),_createClass(DefaultError,null,[{key:`getHTTPErrorCode`,value:function getHTTPErrorCode(){return 501}}])}(Be);function _callSuper$7(r,c,l){return c=_getPrototypeOf(c),_possibleConstructorReturn(r,_isNativeReflectConstruct$7()?Reflect.construct(c,l||[],_getPrototypeOf(r).constructor):c.apply(r,l))}__name(_callSuper$7,`_callSuper`);function _isNativeReflectConstruct$7(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(r){}return(_isNativeReflectConstruct$7=function _isNativeReflectConstruct(){return!!r})()}__name(_isNativeReflectConstruct$7,`_isNativeReflectConstruct`);var He=function(r){function Error404(){return _classCallCheck(this,Error404),_callSuper$7(this,Error404,arguments)}return _inherits$1(Error404,r),_createClass(Error404,[{key:`notify`,value:function notify(){k.warn(this.message)}}],[{key:`getHTTPErrorCode`,value:function getHTTPErrorCode(){return 404}}])}(Be),Ue=__exportAll({DefaultError:()=>Ve,Error404:()=>He});T();function _callSuper$6(r,c,l){return c=_getPrototypeOf(c),_possibleConstructorReturn(r,_isNativeReflectConstruct$6()?Reflect.construct(c,l||[],_getPrototypeOf(r).constructor):c.apply(r,l))}__name(_callSuper$6,`_callSuper`);function _isNativeReflectConstruct$6(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(r){}return(_isNativeReflectConstruct$6=function _isNativeReflectConstruct(){return!!r})()}__name(_isNativeReflectConstruct$6,`_isNativeReflectConstruct`);var We=function(r){function CommandData(r){var c,l,u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:$e.data;return _classCallCheck(this,CommandData),l=_callSuper$6(this,CommandData,[r,u]),_defineProperty(l,`data`,void 0),_defineProperty(l,`type`,void 0),(c=l.args.options)!=null&&c.type&&(l.type=l.args.options.type),l}return _inherits$1(CommandData,r),_createClass(CommandData,[{key:`getApplyMethods`,value:function getApplyMethods(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.type,c,l;switch(r){case`create`:c=this.applyBeforeCreate,l=this.applyAfterCreate;break;case`delete`:c=this.applyBeforeDelete,l=this.applyAfterDelete;break;case`get`:c=this.applyBeforeGet,l=this.applyAfterGet;break;case`update`:c=this.applyBeforeUpdate,l=this.applyAfterUpdate;break;case`options`:c=this.applyBeforeOptions,l=this.applyAfterOptions;break;default:return!1}return{before:c.bind(this),after:l.bind(this)}}},{key:`getRequestData`,value:function getRequestData(){return{type:this.type,args:this.args,timestamp:new Date().getTime(),component:this.component,command:this.command,endpoint:$e.data.commandToEndpoint(this.command,JSON.parse(JSON.stringify(this.args)),this.constructor.getEndpointFormat())}}},{key:`apply`,value:function apply(){var r=this,c=this.getApplyMethods();this.args=c.before(this.args);var l=this.getRequestData();return $e.data.fetch(l).then(function(u){return r.data=u,r.data=c.after(u,r.args),r.data={data:r.data},r.data=Object.assign({__requestData__:l},r.data),r.data})}},{key:`applyBeforeCreate`,value:function applyBeforeCreate(){return arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}}},{key:`applyAfterCreate`,value:function applyAfterCreate(r){return arguments.length>1&&arguments[1]!==void 0&&arguments[1],r}},{key:`applyBeforeDelete`,value:function applyBeforeDelete(){return arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}}},{key:`applyAfterDelete`,value:function applyAfterDelete(r){return arguments.length>1&&arguments[1]!==void 0&&arguments[1],r}},{key:`applyBeforeGet`,value:function applyBeforeGet(){return arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}}},{key:`applyAfterGet`,value:function applyAfterGet(r){return arguments.length>1&&arguments[1]!==void 0&&arguments[1],r}},{key:`applyBeforeUpdate`,value:function applyBeforeUpdate(){return arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}}},{key:`applyAfterUpdate`,value:function applyAfterUpdate(r){return arguments.length>1&&arguments[1]!==void 0&&arguments[1],r}},{key:`applyBeforeOptions`,value:function applyBeforeOptions(){return arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}}},{key:`applyAfterOptions`,value:function applyAfterOptions(r){return arguments.length>1&&arguments[1]!==void 0&&arguments[1],r}},{key:`applyAfterCatch`,value:function applyAfterCatch(r){r.notify()}},{key:`onCatchApply`,value:function onCatchApply(r){var c,l=((c=r)==null||(c=c.data)==null?void 0:c.status)||501,u=Object.values(Ue).find(function(r){return r.getHTTPErrorCode()===l});u||(u=Ve),r=u.create(r.message,r.code,r.data||[]),this.runCatchHooks(r),this.applyAfterCatch(r)}}],[{key:`getInstanceType`,value:function getInstanceType(){return`CommandData`}},{key:`getEndpointFormat`,value:function getEndpointFormat(){return null}}])}(re),Ge=function(){function FilesUploadHandler(){_classCallCheck(this,FilesUploadHandler)}return _createClass(FilesUploadHandler,null,[{key:`isUploadEnabled`,value:function isUploadEnabled(r){return![`svg`,`application/json`].includes(r)||elementorCommon.config.filesUpload.unfilteredFiles}},{key:`setUploadTypeCaller`,value:function setUploadTypeCaller(r){r.uploader.uploader.param(`uploadTypeCaller`,`elementor-wp-media-upload`)}},{key:`getUnfilteredFilesNonAdminDialog`,value:function getUnfilteredFilesNonAdminDialog(){return elementorCommon.dialogsManager.createWidget(`alert`,{id:`e-unfiltered-files-disabled-dialog`,headerMessage:(0,c.__)(`Sorry, you can't upload that file yet`,`elementor`),message:(0,c.__)(`This is because JSON files may pose a security risk.`,`elementor`)+`<br><br>`+(0,c.__)(`To upload them anyway, ask the site administrator to enable unfiltered file uploads.`,`elementor`),strings:{confirm:(0,c.__)(`Got it`,`elementor`)}})}},{key:`getUnfilteredFilesNotEnabledDialog`,value:function getUnfilteredFilesNotEnabledDialog(r){var l=window.elementorAdmin||window.elementor;return l.config.user.is_administrator?l.helpers.getSimpleDialog(`e-enable-unfiltered-files-dialog`,(0,c.__)(`Enable Unfiltered File Uploads`,`elementor`),(0,c.__)(`Before you enable unfiltered files upload, note that such files include a security risk. Elementor does run a process to remove possible malicious code, but there is still risk involved when using such files.`,`elementor`),(0,c.__)(`Enable`,`elementor`),function onConfirm(){elementorCommon.ajax.addRequest(`enable_unfiltered_files_upload`,{},!0),elementorCommon.config.filesUpload.unfilteredFiles=!0,r()}):this.getUnfilteredFilesNonAdminDialog()}},{key:`getUnfilteredFilesNotEnabledImportTemplateDialog`,value:function getUnfilteredFilesNotEnabledImportTemplateDialog(r){return(window.elementorAdmin||window.elementor).config.user.is_administrator?elementorCommon.dialogsManager.createWidget(`confirm`,{id:`e-enable-unfiltered-files-dialog-import-template`,headerMessage:(0,c.__)(`Enable Unfiltered File Uploads`,`elementor`),message:(0,c.__)(`Before you enable unfiltered files upload, note that such files include a security risk. Elementor does run a process to remove possible malicious code, but there is still risk involved when using such files.`,`elementor`)+`<br /><br />`+(0,c.__)(`If you do not enable uploading unfiltered files, any SVG or JSON (including lottie) files used in the uploaded template will not be imported.`,`elementor`),position:{my:`center center`,at:`center center`},strings:{confirm:(0,c.__)(`Enable and Import`,`elementor`),cancel:(0,c.__)(`Import Without Enabling`,`elementor`)},onConfirm:function onConfirm(){elementorCommon.ajax.addRequest(`enable_unfiltered_files_upload`,{success:function success(){elementorCommon.config.filesUpload.unfilteredFiles=!0,r()}},!0)},onCancel:function onCancel(){return r()}}):this.getUnfilteredFilesNonAdminDialog()}}])}();function _callSuper$5(r,c,l){return c=_getPrototypeOf(c),_possibleConstructorReturn(r,_isNativeReflectConstruct$5()?Reflect.construct(c,l||[],_getPrototypeOf(r).constructor):c.apply(r,l))}__name(_callSuper$5,`_callSuper`);function _isNativeReflectConstruct$5(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(r){}return(_isNativeReflectConstruct$5=function _isNativeReflectConstruct(){return!!r})()}__name(_isNativeReflectConstruct$5,`_isNativeReflectConstruct`);function _superPropGet$1(r,c,l,u){var p=_get(_getPrototypeOf(1&u?r.prototype:r),c,l);return 2&u&&typeof p==`function`?function(r){return p.apply(l,r)}:p}__name(_superPropGet$1,`_superPropGet`);var Ke=function(r){function Media(){return _classCallCheck(this,Media),_callSuper$5(this,Media,arguments)}return _inherits$1(Media,r),_createClass(Media,[{key:`validateArgs`,value:function validateArgs(){this.requireArgumentInstance(`file`,File)}},{key:`getRequestData`,value:function getRequestData(){var r=_superPropGet$1(Media,`getRequestData`,this,3)([]);return r.namespace=`wp`,r.version=`2`,r}},{key:`applyBeforeCreate`,value:function applyBeforeCreate(r){var l;return r.headers={"Content-Disposition":`attachment; filename=${this.file.name}`,"Content-Type":this.file.type},r.query={uploadTypeCaller:`elementor-wp-media-upload`},r.data=this.file,(l=r.options)!=null&&l.progress&&(this.toast=elementor.notifications.showToast({message:(0,c.__)(`Uploading...`),sticky:!0})),r}},{key:`applyAfterCreate`,value:function applyAfterCreate(r,c){var l;return(l=c.options)!=null&&l.progress&&this.toast.hide(),r}},{key:`run`,value:function(){var r=_asyncToGenerator(ze.default.mark(function _callee(){return ze.default.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(this.file=this.args.file,!(this.file.size>parseInt(window._wpPluploadSettings.defaults.filters.max_file_size,10))){r.next=1;break}throw Error((0,c.__)(`The file exceeds the maximum upload size for this site.`,`elementor`));case 1:if(!(!window._wpPluploadSettings.defaults.filters.mime_types[0].extensions.split(`,`).includes(this.file.name.split(`.`).pop())&&!elementor.config.filesUpload.unfilteredFiles)){r.next=2;break}return Ge.getUnfilteredFilesNotEnabledDialog(function(){}).show(),r.abrupt(`return`);case 2:return r.next=3,_superPropGet$1(Media,`run`,this,3)([]);case 3:return r.abrupt(`return`,r.sent);case 4:case`end`:return r.stop()}},_callee,this)}));function run(){return r.apply(this,arguments)}return run}()}],[{key:`getEndpointFormat`,value:function getEndpointFormat(){return`media`}}])}(We),qe=__exportAll({Media:()=>Ke});function _callSuper$4(r,c,l){return c=_getPrototypeOf(c),_possibleConstructorReturn(r,_isNativeReflectConstruct$4()?Reflect.construct(c,l||[],_getPrototypeOf(r).constructor):c.apply(r,l))}__name(_callSuper$4,`_callSuper`);function _isNativeReflectConstruct$4(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(r){}return(_isNativeReflectConstruct$4=function _isNativeReflectConstruct(){return!!r})()}__name(_isNativeReflectConstruct$4,`_isNativeReflectConstruct`);var Je=function(r){function Component(){return _classCallCheck(this,Component),_callSuper$4(this,Component,arguments)}return _inherits$1(Component,r),_createClass(Component,[{key:`getNamespace`,value:function getNamespace(){return`wp`}},{key:`defaultData`,value:function defaultData(){return this.importCommands(qe)}}])}(M),Ye=__exportAll({Index:()=>Xe});function _callSuper$3(r,c,l){return c=_getPrototypeOf(c),_possibleConstructorReturn(r,_isNativeReflectConstruct$3()?Reflect.construct(c,l||[],_getPrototypeOf(r).constructor):c.apply(r,l))}__name(_callSuper$3,`_callSuper`);function _isNativeReflectConstruct$3(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(r){}return(_isNativeReflectConstruct$3=function _isNativeReflectConstruct(){return!!r})()}__name(_isNativeReflectConstruct$3,`_isNativeReflectConstruct`);var Xe=function(r){function Index(){return _classCallCheck(this,Index),_callSuper$3(this,Index,arguments)}return _inherits$1(Index,r),_createClass(Index,null,[{key:`getEndpointFormat`,value:function getEndpointFormat(){return`send-event`}}])}(We);function _callSuper$2(r,c,l){return c=_getPrototypeOf(c),_possibleConstructorReturn(r,_isNativeReflectConstruct$2()?Reflect.construct(c,l||[],_getPrototypeOf(r).constructor):c.apply(r,l))}__name(_callSuper$2,`_callSuper`);function _isNativeReflectConstruct$2(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(r){}return(_isNativeReflectConstruct$2=function _isNativeReflectConstruct(){return!!r})()}__name(_isNativeReflectConstruct$2,`_isNativeReflectConstruct`);var Ze=function(r){function Component(){return _classCallCheck(this,Component),_callSuper$2(this,Component,arguments)}return _inherits$1(Component,r),_createClass(Component,[{key:`getNamespace`,value:function getNamespace(){return`event-tracker`}},{key:`defaultData`,value:function defaultData(){return this.importCommands(Ye)}}])}(M);function getUserTimestamp(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new Date,c=r.getTimezoneOffset(),l=new Date(r.getTime()-c*6e4).toISOString();l=l.slice(0,-1);var u=c/60,p=0<=u?`+`:`-`,m=Math.abs(Math.floor(u)),h=Math.abs(u%1)*60,g=10>m?`0`:``,v=10>h?`0`:``,y=p+g+m+`:`+v+h;return l+y}var Qe=function(){function Events(){_classCallCheck(this,Events)}return _createClass(Events,[{key:`dispatchEvent`,value:function dispatchEvent(r){r&&(r.ts=getUserTimestamp(),$e.data.create(`event-tracker/index`,{event_data:r}))}}])}(),et={appTypes:{editor:`editor`,wpAdmin:`wpadmin`,wpDash:`wpdash`},windowNames:{sidebarMenu:`sidebar_menu`},targetTypes:{dropdownItem:`dropdown_item`,button:`button`,tab:`tab`,toggle:`toggle`,searchInput:`search_input`,searchResult:`search_result`,buttons:`buttons`,searchWidget:`search_widget`,wpDashAdminMenuItem:`wpdash_admin_menu_item`,wpDashEditorMenu:`wpdash_editor_menu`,wpDashSubMenuItem:`wpdash_sub_menu_item`,link:`link`},interactionResults:{actionSelected:`action_selected`,navigate:`navigate`,create:`create`,sessionEnd:`session_end`,tabChanged:`tab_changed`,assetInserted:`asset_inserted`,assetFavorite:`asset_favorite`,aiGenerate:`ai_generate`,resultsUpdated:`results_updated`,noResults:`no_results`,selected:`selected`,promotionViewed:`promotion_viewed`,upgradeNow:`upgrade_now`,elementorSideMenuOpened:`elementor_side_menu_opened`,editorSubMenuOpened:`wpdash_editor_sub_menu_opened`,themeBuilderPromotionWindow:`theme_builder_promotion_window`,pageOpened:`page_opened`,expanded:`expanded`,collapsed:`collapsed`},targetNames:{publishDropdown:{saveDraft:`save_draft`,saveAsTemplate:`save_as_template`,viewPage:`view_page`,copyAndShare:`copy_and_share`},pageList:{addNewPage:`add_new_page`}},triggers:{click:`Click`,rightClick:`Right Click`,doubleClick:`Double Click`,accordionClick:`Accordion Click`,toggleClick:`Toggle Click`,dropdownClick:`Click Dropdown`,editorLoaded:`Editor Loaded`,visible:`Visible`,pageLoaded:`Page Loaded`,typing:`Typing`,tabSelect:`Tab Select`,insert:`Insert`,hover:`Hover`},locations:{widgetPanel:`Widget Panel`,topBar:`Top Bar`,sidebar:`Sidebar`,elementorEditor:`Elementor Editor`,templatesLibrary:{library:`Templates Library`},app:{import:`Import Kit`,export:`Export Kit`,kitLibrary:`Kit Library`,cloudKitLibrary:`Cloud Kit Library`},variables:`Variables Panel`,variablesManager:`Variables Manager`,admin:`WP admin`,wpDashAdmin:`wpdash_admin`,structurePanel:`Structure Panel`,canvas:`Canvas`,leftPanel:`Left Panel`,elementorLibrary:`Elementor Library`,components:{instanceEditingPanel:`Instance Editing Panel`}},secondaryLocations:{layout:`Layout Section`,basic:`Basic Section`,"pro-elements":`Pro Section`,general:`General Section`,"theme-elements":`Site Section`,"theme-elements-single":`Single Section`,"woocommerce-elements":`WooCommerce Section`,wordpress:`WordPress Section`,categories:`Widgets Tab`,global:`Globals Tab`,"whats-new":`What's New`,"document-settings":`Document Settings icon`,"preview-page":`Preview Page`,"publish-button":`Publish Button`,"widget-panel":`Widget Panel Icon`,finder:`Finder`,help:`Help`,elementorLogoDropdown:`top_bar_elementor_logo_dropdown`,elementorLogo:`Elementor Logo`,eLogoMenu:`E-logo Menu`,notes:`Notes`,siteSettings:`Site Settings`,structure:`Structure`,documentNameDropdown:`Document Name dropdown`,responsiveControls:`Responsive controls`,launchpad:`launchpad`,checklistHeader:`Checklist Header`,checklistSteps:`Checklist Steps`,userPreferences:`User Preferences`,contextMenu:`Context Menu`,templateLibrary:{saveModal:`Save to Modal`,moveModal:`Move to Modal`,bulkMoveModal:`Bulk Move to Modal`,copyModal:`Copy to Modal`,bulkCopyModal:`Bulk Copy to Modal`,saveModalSelectFolder:`Save to Modal - select folder`,saveModalSelectConnect:`Save to Modal - connect`,saveModalSelectUpgrade:`Save to Modal - upgrade`,importModal:`Import Modal`,newFolderModal:`New Folder Modal`,deleteDialog:`Delete Dialog`,deleteFolderDialog:`Delete Folder Dialog`,renameDialog:`Rename Dialog`,createFolderDialog:`Create Folder Dialog`,applySettingsDialog:`Apply Settings Dialog`,cloudTab:`Cloud Tab`,siteTab:`Site Tab`,cloudTabFolder:`Cloud Tab - Folder`,cloudTabConnect:`Cloud Tab - Connect`,cloudTabUpgrade:`Cloud Tab - Upgrade`,morePopup:`Context Menu`,quotaBar:`Quota Bar`},kitLibrary:{cloudKitLibrary:`kits_cloud_library`,cloudKitLibraryConnect:`kits_cloud_library_connect`,cloudKitLibraryUpgrade:`kits_cloud_library_upgrade`,kitExportCustomization:`kit_export_customization`,kitExport:`kit_export`,kitExportCustomizationEdit:`kit_export_customization_edit`,kitExportSummary:`kit_export_summary`,kitImportUploadBox:`kit_import_upload_box`,kitImportCustomization:`kit_import_customization`,kitImportSummary:`kit_import_summary`},variablesPopover:`Variables Popover`,admin:{pluginToolsTab:`plugin_tools_tab`,pluginWebsiteTemplatesTab:`plugin_website_templates_tab`},componentsTab:`Components Tab`,canvasElement:`Canvas Element`,publishDropdown:`Publish Dropdown`,pageListDropdown:`Page List Dropdown`,emptyBox:`Empty Box`,searchBar:`Search Bar`,finderResults:`Finder Results`,libraryTabs:`Library Tabs`,assetCard:`Asset Card`,wpDashElementorCoreMenu:`elementor_editor_core_menu`,wpDashElementorCoreSubMenu:`elementor_editor_core_sub_menu`,wpDashThemeBuilder:`wpdash_core_sub_menu_theme_builder`},elements:{accordionSection:`Accordion section`,buttonIcon:`Button Icon`,mainCta:`Main CTA`,button:`Button`,link:`Link`,dropdown:`Dropdown`,toggle:`Toggle`,launchpadChecklist:`Checklist popup`},names:{v1:{layout:`v1_widgets_tab_layout_section`,basic:`v1_widgets_tab_basic_section`,"pro-elements":`v1_widgets_tab_pro_section`,general:`v1_widgets_tab_general_section`,"theme-elements":`v1_widgets_tab_site_section`,"theme-elements-single":`v1_widgets_tab_single_section`,"woocommerce-elements":`v1_widgets_tab_woocommerce_section`,wordpress:`v1_widgets_tab_wordpress_section`,categories:`v1_widgets_tab`,global:`v1_globals_tab`},topBar:{whatsNew:`top_bar_whats_new`,documentSettings:`top_bar_document_settings_icon`,previewPage:`top_bar_preview_page`,publishButton:`top_bar_publish_button`,widgetPanel:`top_bar_widget_panel_icon`,finder:`top_bar_finder`,help:`top_bar_help`,history:`top_bar_elementor_logo_dropdown_history`,userPreferences:`top_bar_elementor_logo_dropdown_user_preferences`,keyboardShortcuts:`top_bar_elementor_logo_dropdown_keyboard_shortcuts`,exitToWordpress:`top_bar_elementor_logo_dropdown_exit_to_wordpress`,themeBuilder:`top_bar_elementor_logo_dropdown_theme_builder`,notes:`top_bar_notes`,siteSettings:`top_bar_site_setting`,structure:`top_bar_structure`,documentNameDropdown:`top_bar_document_name_dropdown`,responsiveControls:`top_bar_responsive_controls`,launchpadOn:`top_bar_checklist_icon_show`,launchpadOff:`top_bar_checklist_icon_hide`,elementorLogoDropdown:`open_e_menu`,connectAccount:`connect_account`,accountConnected:`account_connected`},elementorEditor:{editorLoaded:`editor_loaded`,checklist:{checklistHeaderClose:`checklist_header_close_icon`,checklistFirstPopup:`checklist popup triggered`},userPreferences:{checklistShow:`checklist_userpreferences_toggle_show`,checklistHide:`checklist_userpreferences_toggle_hide`}},variables:{open:`open_variables_popover`,add:`add_new_variable`,connect:`connect_variable`,save:`save_new_variable`,update:`update_variable`,openManager:`open_variables_manager`,saveChanges:`save_variables_changes`,delete:`delete_variable`,variableSyncToV3:`variable_sync_to_v3`},design_system:{importOpened:`design_system_import_opened`,fileSelected:`design_system_file_selected`,validationFailed:`design_system_validation_failed`,conflictChoice:`design_system_conflict_choice`,confirmed:`design_system_import_confirmed`,imported:`design_system_imported`,importFailed:`design_system_import_failed`,export:`design_system_export`,opened:`design_system_opened`},components:{createClicked:`component_create_clicked`,createCancelled:`component_creation_cancelled`,created:`component_created`,instanceAdded:`component_instance_added`,edited:`component_edited`,propertiesPanelOpened:`component_properties_panel_opened`,propertiesGroupCreated:`component_properties_group_created`,propertyExposed:`component_property_exposed`,propertyRemoved:`component_property_removed`,detached:`component_detached`},global_classes:{classApplied:`class_applied`,classRemoved:`class_removed`,classManagerFilterCleared:`class_manager_filter_cleared`,classDeleted:`class_deleted`,classPublishConflict:`class_publish_conflict`,classRenamed:`class_renamed`,classCreated:`class_created`,classManagerSearched:`class_manager_searched`,classManagerFiltersOpened:`class_manager_filters_opened`,classManagerOpened:`class_manager_opened`,classManagerReorder:`class_manager_reorder`,classManagerFilterUsed:`class_manager_filter_used`,classUsageLocate:`class_usage_locate`,classUsageHovered:`class_usage_hovered`,classStyled:`class_styled`,classStateClicked:`class_state_clicked`,classUsageClicked:`class_usage_clicked`,classDuplicate:`class_duplicate`,classSyncToV3PopupShown:`class_sync_to_v3_popup_shown`,classSyncToV3:`class_sync_to_v3`,classSyncToV3PopupClick:`class_sync_to_v3_popup_click`},editorOne:{topBarPublishDropdown:`top_bar_publish_dropdown`,topBarPageList:`top_bar_page_list`,siteSettingsSession:`site_settings_session`,eLibraryNav:`e_library_nav`,eLibraryInsert:`e_library_insert`,eLibraryFavorite:`e_library_favorite`,eLibraryGenerateAi:`e_library_generate_ai`,finderSearchInput:`finder_search_input`,finderResultSelect:`finder_result_select`,canvasEmptyBoxAction:`canvas_empty_box_action`,widgetPanelSearch:`widget_panel_search`,wpDashElementorMenuClick:`wpdash_elementor_menu_click`,wpDashEditorSubMenuHover:`wpdash_editor_sub_menu_hover`,wpDashThemeBuilderClick:`wpdash_theme_builder_click`,sidebarMenuItemClicked:`sidebar_menu_item_clicked`,sidebarMenuGroupToggled:`sidebar_menu_group_toggled`},interactions:{created:`interactions_created`},promotions:{viewPromotion:`view_promotion`,upgradePromotionClick:`upgrade_promotion_click`}}},P;if(typeof window>`u`){var tt={hostname:``};P={crypto:{randomUUID:function(){throw Error(`unsupported`)}},navigator:{userAgent:``,onLine:!0},document:{createElement:function(){return{}},location:tt,referrer:``},screen:{width:0,height:0},location:tt,addEventListener:function(){},removeEventListener:function(){}}}else P=window;function _array_like_to_array(r,c){(c==null||c>r.length)&&(c=r.length);for(var l=0,u=Array(c);l<c;l++)u[l]=r[l];return u}function asyncGeneratorStep(r,c,l,u,p,m,h){try{var g=r[m](h),v=g.value}catch(r){l(r);return}g.done?c(v):Promise.resolve(v).then(u,p)}function _async_to_generator(r){return function(){var c=this,l=arguments;return new Promise(function(u,p){var m=r.apply(c,l);function _next(r){asyncGeneratorStep(m,u,p,_next,_throw,`next`,r)}function _throw(r){asyncGeneratorStep(m,u,p,_next,_throw,`throw`,r)}_next(void 0)})}}function _construct(r,c,l){return _construct=_is_native_reflect_construct()?Reflect.construct:function construct(r,c,l){var u=[null];u.push.apply(u,c);var p=new(Function.bind.apply(r,u));return l&&_set_prototype_of(p,l.prototype),p},_construct.apply(null,arguments)}function _defineProperties(r,c){for(var l=0;l<c.length;l++){var u=c[l];u.enumerable=u.enumerable||!1,u.configurable=!0,`value`in u&&(u.writable=!0),Object.defineProperty(r,u.key,u)}}function _create_class(r,c,l){return c&&_defineProperties(r.prototype,c),r}function _extends(){return _extends=Object.assign||function(r){for(var c=1;c<arguments.length;c++){var l=arguments[c];for(var u in l)Object.prototype.hasOwnProperty.call(l,u)&&(r[u]=l[u])}return r},_extends.apply(this,arguments)}function _get_prototype_of(r){return _get_prototype_of=Object.setPrototypeOf?Object.getPrototypeOf:function getPrototypeOf(r){return r.__proto__||Object.getPrototypeOf(r)},_get_prototype_of(r)}function _inherits(r,c){if(typeof c!=`function`&&c!==null)throw TypeError(`Super expression must either be null or a function`);r.prototype=Object.create(c&&c.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),c&&_set_prototype_of(r,c)}function _instanceof(r,c){return c!=null&&typeof Symbol<`u`&&c[Symbol.hasInstance]?!!c[Symbol.hasInstance](r):r instanceof c}function _is_native_function(r){return Function.toString.call(r).indexOf(`[native code]`)!==-1}function _object_without_properties_loose(r,c){if(r==null)return{};var l={},u=Object.keys(r),p,m;for(m=0;m<u.length;m++)p=u[m],!(c.indexOf(p)>=0)&&(l[p]=r[p]);return l}function _set_prototype_of(r,c){return _set_prototype_of=Object.setPrototypeOf||function setPrototypeOf(r,c){return r.__proto__=c,r},_set_prototype_of(r,c)}function _type_of(r){"@swc/helpers - typeof";return r&&typeof Symbol<`u`&&r.constructor===Symbol?`symbol`:typeof r}function _unsupported_iterable_to_array(r,c){if(r){if(typeof r==`string`)return _array_like_to_array(r,c);var l=Object.prototype.toString.call(r).slice(8,-1);if(l===`Object`&&r.constructor&&(l=r.constructor.name),l===`Map`||l===`Set`)return Array.from(l);if(l===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l))return _array_like_to_array(r,c)}}function _wrap_native_super(r){var c=typeof Map==`function`?new Map:void 0;return _wrap_native_super=function wrapNativeSuper(r){if(r===null||!_is_native_function(r))return r;if(typeof r!=`function`)throw TypeError(`Super expression must either be null or a function`);if(c!==void 0){if(c.has(r))return c.get(r);c.set(r,Wrapper)}function Wrapper(){return _construct(r,arguments,_get_prototype_of(this).constructor)}return Wrapper.prototype=Object.create(r.prototype,{constructor:{value:Wrapper,enumerable:!1,writable:!0,configurable:!0}}),_set_prototype_of(Wrapper,r)},_wrap_native_super(r)}function _is_native_reflect_construct(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(r){}return(_is_native_reflect_construct=function(){return!!r})()}function _create_for_of_iterator_helper_loose(r,c){var l=typeof Symbol<`u`&&r[Symbol.iterator]||r[`@@iterator`];if(l)return(l=l.call(r)).next.bind(l);if(Array.isArray(r)||(l=_unsupported_iterable_to_array(r))||c){l&&(r=l);var u=0;return function(){return u>=r.length?{done:!0}:{done:!1,value:r[u++]}}}throw TypeError(`Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _ts_generator(r,c){var l,u,p,m,h={label:0,sent:function(){if(p[0]&1)throw p[1];return p[1]},trys:[],ops:[]};return m={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol==`function`&&(m[Symbol.iterator]=function(){return this}),m;function verb(r){return function(c){return step([r,c])}}function step(m){if(l)throw TypeError(`Generator is already executing.`);for(;h;)try{if(l=1,u&&(p=m[0]&2?u.return:m[0]?u.throw||((p=u.return)&&p.call(u),0):u.next)&&!(p=p.call(u,m[1])).done)return p;switch(u=0,p&&(m=[m[0]&2,p.value]),m[0]){case 0:case 1:p=m;break;case 4:return h.label++,{value:m[1],done:!1};case 5:h.label++,u=m[1],m=[0];continue;case 7:m=h.ops.pop(),h.trys.pop();continue;default:if(p=h.trys,!(p=p.length>0&&p[p.length-1])&&(m[0]===6||m[0]===2)){h=0;continue}if(m[0]===3&&(!p||m[1]>p[0]&&m[1]<p[3])){h.label=m[1];break}if(m[0]===6&&h.label<p[1]){h.label=p[1],p=m;break}if(p&&h.label<p[2]){h.label=p[2],h.ops.push(m);break}p[2]&&h.ops.pop(),h.trys.pop();continue}m=c.call(r,h)}catch(r){m=[6,r],u=0}finally{l=p=0}if(m[0]&5)throw m[1];return{value:m[0]?m[1]:void 0,done:!0}}}function _ts_values(r){var c=typeof Symbol==`function`&&Symbol.iterator,l=c&&r[c],u=0;if(l)return l.call(r);if(r&&typeof r.length==`number`)return{next:function(){return r&&u>=r.length&&(r=void 0),{value:r&&r[u++],done:!r}}};throw TypeError(c?`Object is not iterable.`:`Symbol.iterator is not defined.`)}var nt=Object.defineProperty,__defNormalProp=function(r,c,l){return c in r?nt(r,c,{enumerable:!0,configurable:!0,writable:!0,value:l}):r[c]=l},__publicField=function(r,c,l){return __defNormalProp(r,(c===void 0?`undefined`:_type_of(c))===`symbol`?c:c+``,l)},rt,it=Object.defineProperty,__defNormalProp$1=function(r,c,l){return c in r?it(r,c,{enumerable:!0,configurable:!0,writable:!0,value:l}):r[c]=l},__publicField$1=function(r,c,l){return __defNormalProp$1(r,(c===void 0?`undefined`:_type_of(c))===`symbol`?c:c+``,l)},I=function(r){return r[r.Document=0]=`Document`,r[r.DocumentType=1]=`DocumentType`,r[r.Element=2]=`Element`,r[r.Text=3]=`Text`,r[r.CDATA=4]=`CDATA`,r[r.Comment=5]=`Comment`,r}(I||{}),at={Node:[`childNodes`,`parentNode`,`parentElement`,`textContent`],ShadowRoot:[`host`,`styleSheets`],Element:[`shadowRoot`,`querySelector`,`querySelectorAll`],MutationObserver:[]},ot={Node:[`contains`,`getRootNode`],ShadowRoot:[`getSelection`],Element:[],MutationObserver:[`constructor`]},st={},isAngularZonePresent$1=function(){return!!globalThis.Zone};function getUntaintedPrototype$1(r){if(st[r])return st[r];var c=globalThis[r],l=c.prototype,u=r in at?at[r]:void 0,p=!!(u&&u.every(function(r){var c,u;return!!((u=(c=Object.getOwnPropertyDescriptor(l,r))==null?void 0:c.get)!=null&&u.toString().includes(`[native code]`))})),m=r in ot?ot[r]:void 0,h=!!(m&&m.every(function(r){var c;return typeof l[r]==`function`&&((c=l[r])==null?void 0:c.toString().includes(`[native code]`))}));if(p&&h&&!isAngularZonePresent$1())return st[r]=c.prototype,c.prototype;try{var g=document.createElement(`iframe`);document.body.appendChild(g);var v=g.contentWindow;if(!v)return c.prototype;var y=v[r].prototype;return document.body.removeChild(g),y?st[r]=y:l}catch(r){return l}}var ct={};function getUntaintedAccessor$1(r,c,l){var u,p=r+`.`+String(l);if(ct[p])return ct[p].call(c);var m=getUntaintedPrototype$1(r),h=(u=Object.getOwnPropertyDescriptor(m,l))==null?void 0:u.get;return h?(ct[p]=h,h.call(c)):c[l]}var lt={};function getUntaintedMethod$1(r,c,l){var u=r+`.`+String(l);if(lt[u])return lt[u].bind(c);var p=getUntaintedPrototype$1(r)[l];return typeof p==`function`?(lt[u]=p,p.bind(c)):c[l]}function childNodes$1(r){return getUntaintedAccessor$1(`Node`,r,`childNodes`)}function parentNode$1(r){return getUntaintedAccessor$1(`Node`,r,`parentNode`)}function parentElement$1(r){return getUntaintedAccessor$1(`Node`,r,`parentElement`)}function textContent$1(r){return getUntaintedAccessor$1(`Node`,r,`textContent`)}function contains$1(r,c){return getUntaintedMethod$1(`Node`,r,`contains`)(c)}function getRootNode$1(r){return getUntaintedMethod$1(`Node`,r,`getRootNode`)()}function host$1(r){return!r||!(`host`in r)?null:getUntaintedAccessor$1(`ShadowRoot`,r,`host`)}function styleSheets$1(r){return r.styleSheets}function shadowRoot$1(r){return!r||!(`shadowRoot`in r)?null:getUntaintedAccessor$1(`Element`,r,`shadowRoot`)}function querySelector$1(r,c){return getUntaintedAccessor$1(`Element`,r,`querySelector`)(c)}function querySelectorAll$1(r,c){return getUntaintedAccessor$1(`Element`,r,`querySelectorAll`)(c)}function mutationObserverCtor$1(){return getUntaintedPrototype$1(`MutationObserver`).constructor}function patch$1(r,c,l){try{if(!(c in r))return function(){};var u=r[c],p=l(u);return typeof p==`function`&&(p.prototype=p.prototype||{},Object.defineProperties(p,{__rrweb_original__:{enumerable:!1,value:u}})),r[c]=p,function(){r[c]=u}}catch(r){return function(){}}}var ut={childNodes:childNodes$1,parentNode:parentNode$1,parentElement:parentElement$1,textContent:textContent$1,contains:contains$1,getRootNode:getRootNode$1,host:host$1,styleSheets:styleSheets$1,shadowRoot:shadowRoot$1,querySelector:querySelector$1,querySelectorAll:querySelectorAll$1,mutationObserver:mutationObserverCtor$1,patch:patch$1};function isElement(r){return r.nodeType===r.ELEMENT_NODE}function isShadowRoot(r){var c=r&&`host`in r&&`mode`in r&&ut.host(r)||null;return!!(c&&`shadowRoot`in c&&ut.shadowRoot(c)===r)}function isNativeShadowDom(r){return Object.prototype.toString.call(r)===`[object ShadowRoot]`}function fixBrowserCompatibilityIssuesInCSS(r){return r.includes(` background-clip: text;`)&&!r.includes(` -webkit-background-clip: text;`)&&(r=r.replace(/\sbackground-clip:\s*text;/g,` -webkit-background-clip: text; background-clip: text;`)),r}function escapeImportStatement(r){var c=r.cssText;if(c.split(`"`).length<3)return c;var l=[`@import`,`url(`+JSON.stringify(r.href)+`)`];return r.layerName===``?l.push(`layer`):r.layerName&&l.push(`layer(`+r.layerName+`)`),r.supportsText&&l.push(`supports(`+r.supportsText+`)`),r.media.length&&l.push(r.media.mediaText),l.join(` `)+`;`}function stringifyStylesheet(r){try{var c=r.rules||r.cssRules;if(!c)return null;var l=r.href;return!l&&r.ownerNode&&r.ownerNode.ownerDocument&&(l=r.ownerNode.ownerDocument.location.href),fixBrowserCompatibilityIssuesInCSS(Array.from(c,function(r){return stringifyRule(r,l)}).join(``))}catch(r){return null}}function stringifyRule(r,c){if(isCSSImportRule(r)){var l;try{l=stringifyStylesheet(r.styleSheet)||escapeImportStatement(r)}catch(c){l=r.cssText}return r.styleSheet.href?absolutifyURLs(l,r.styleSheet.href):l}else{var u=r.cssText;return isCSSStyleRule(r)&&r.selectorText.includes(`:`)&&(u=fixSafariColons(u)),c?absolutifyURLs(u,c):u}}function fixSafariColons(r){return r.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,`$1\\$2`)}function isCSSImportRule(r){return`styleSheet`in r}function isCSSStyleRule(r){return`selectorText`in r}var dt=function(){function Mirror(){__publicField$1(this,`idNodeMap`,new Map),__publicField$1(this,`nodeMetaMap`,new WeakMap)}var r=Mirror.prototype;return r.getId=function getId(r){var c;if(!r)return-1;var l=(c=this.getMeta(r))==null?void 0:c.id;return l==null?-1:l},r.getNode=function getNode(r){return this.idNodeMap.get(r)||null},r.getIds=function getIds(){return Array.from(this.idNodeMap.keys())},r.getMeta=function getMeta(r){return this.nodeMetaMap.get(r)||null},r.removeNodeFromMap=function removeNodeFromMap(r){var c=this,l=this.getId(r);this.idNodeMap.delete(l),r.childNodes&&r.childNodes.forEach(function(r){return c.removeNodeFromMap(r)})},r.has=function has(r){return this.idNodeMap.has(r)},r.hasNode=function hasNode(r){return this.nodeMetaMap.has(r)},r.add=function add(r,c){var l=c.id;this.idNodeMap.set(l,r),this.nodeMetaMap.set(r,c)},r.replace=function replace(r,c){var l=this.getNode(r);if(l){var u=this.nodeMetaMap.get(l);u&&this.nodeMetaMap.set(c,u)}this.idNodeMap.set(r,c)},r.reset=function reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},Mirror}();function createMirror$2(){return new dt}function maskInputValue(r){var c=r.element,l=r.maskInputOptions,u=r.tagName,p=r.type,m=r.value,h=r.maskInputFn,g=m||``,v=p&&toLowerCase(p);return(l[u.toLowerCase()]||v&&l[v])&&(g=h?h(g,c):`*`.repeat(g.length)),g}function toLowerCase(r){return r.toLowerCase()}var ft=`__rrweb_original__`;function is2DCanvasBlank(r){var c=r.getContext(`2d`);if(!c)return!0;for(var l=50,u=0;u<r.width;u+=l)for(var p=0;p<r.height;p+=l){var m=c.getImageData,h=ft in m?m[ft]:m;if(new Uint32Array(h.call(c,u,p,Math.min(l,r.width-u),Math.min(l,r.height-p)).data.buffer).some(function(r){return r!==0}))return!1}return!0}function getInputType(r){var c=r.type;return r.hasAttribute(`data-rr-is-password`)?`password`:c?toLowerCase(c):null}function extractFileExtension(r,c){var l;try{l=new URL(r,c==null?window.location.href:c)}catch(r){return null}var u=l.pathname.match(/\.([0-9a-z]+)(?:$)/i),p;return(p=u==null?void 0:u[1])==null?null:p}function extractOrigin(r){var c=``;return c=r.indexOf(`//`)>-1?r.split(`/`).slice(0,3).join(`/`):r.split(`/`)[0],c=c.split(`?`)[0],c}var pt=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,mt=/^(?:[a-z+]+:)?\/\//i,ht=/^www\..*/i,gt=/^(data:)([^,]*),(.*)/i;function absolutifyURLs(r,c){return(r||``).replace(pt,function(r,l,u,p,m,h){var g=u||m||h,v=l||p||``;if(!g)return r;if(mt.test(g)||ht.test(g)||gt.test(g))return`url(`+v+g+v+`)`;if(g[0]===`/`)return`url(`+v+(extractOrigin(c)+g)+v+`)`;var y=c.split(`/`),b=g.split(`/`);y.pop();for(var x=_create_for_of_iterator_helper_loose(b),S;!(S=x()).done;){var C=S.value;C!==`.`&&(C===`..`?y.pop():y.push(C))}return`url(`+v+y.join(`/`)+v+`)`})}function normalizeCssString(r,c){return c===void 0&&(c=!1),c?r.replace(/(\/\*[^*]*\*\/)|[\s;]/g,``):r.replace(/(\/\*[^*]*\*\/)|[\s;]/g,``).replace(/0px/g,`0`)}function splitCssText(r,c,l){l===void 0&&(l=!1);var u=Array.from(c.childNodes),p=[],m=0;if(u.length>1&&r&&typeof r==`string`){for(var h=normalizeCssString(r,l),g=h.length/r.length,v=1;v<u.length;v++)if(u[v].textContent&&typeof u[v].textContent==`string`){for(var y=normalizeCssString(u[v].textContent,l),b=100,x=3;x<y.length&&(y[x].match(/[a-zA-Z0-9]/)||y.indexOf(y.substring(0,x),1)!==-1);x++);for(;x<y.length;x++){var S=y.substring(0,x),C=h.split(S),w=-1;if(C.length===2)w=C[0].length;else if(C.length>2&&C[0]===``&&u[v-1].textContent!==``)w=h.indexOf(S,1);else if(C.length===1){if(S=S.substring(0,S.length-1),C=h.split(S),C.length<=1)return p.push(r),p;x=b+1}else x===y.length-1&&(w=h.indexOf(S));if(C.length>=2&&x>b){var T=u[v-1].textContent;if(T&&typeof T==`string`){var E=normalizeCssString(T).length;w=h.indexOf(S,E)}w===-1&&(w=C[0].length)}if(w!==-1){for(var D=Math.floor(w/g);D>0&&D<r.length;){if(m+=1,m>50*u.length)return p.push(r),p;var O=normalizeCssString(r.substring(0,D),l);if(O.length===w){p.push(r.substring(0,D)),r=r.substring(D),h=h.substring(w);break}else O.length<w?D+=Math.max(1,Math.floor((w-O.length)/g)):D-=Math.max(1,Math.floor((O.length-w)*g))}break}}}}return p.push(r),p}function markCssSplits(r,c){return splitCssText(r,c).join(`/* rr_split */`)}var _t=1,vt=RegExp(`[^a-z0-9-_:]`),yt=-2;function genId(){return _t++}function getValidTagName$1(r){if(_instanceof(r,HTMLFormElement))return`form`;var c=toLowerCase(r.tagName);return vt.test(c)?`div`:c}var bt,xt,St=/^[^ \t\n\r\u000c]+/,Ct=/^[, \t\n\r\u000c]+/;function getAbsoluteSrcsetString(r,c){if(c.trim()===``)return c;var l=0;function collectCharacters(r){var u,p=r.exec(c.substring(l));return p?(u=p[0],l+=u.length,u):``}for(var u=[];collectCharacters(Ct),!(l>=c.length);){var p=collectCharacters(St);if(p.slice(-1)===`,`)p=absoluteToDoc(r,p.substring(0,p.length-1)),u.push(p);else{var m=``;p=absoluteToDoc(r,p);for(var h=!1;;){var g=c.charAt(l);if(g===``){u.push((p+m).trim());break}else if(h)g===`)`&&(h=!1);else if(g===`,`){l+=1,u.push((p+m).trim());break}else g===`(`&&(h=!0);m+=g,l+=1}}}return u.join(`, `)}var wt=new WeakMap;function absoluteToDoc(r,c){return!c||c.trim()===``?c:getHref(r,c)}function isSVGElement(r){return!!(r.tagName===`svg`||r.ownerSVGElement)}function getHref(r,c){var l=wt.get(r);if(l||(l=r.createElement(`a`),wt.set(r,l)),!c)c=``;else if(c.startsWith(`blob:`)||c.startsWith(`data:`))return c;return l.setAttribute(`href`,c),l.href}function transformAttribute(r,c,l,u){return u&&(l===`src`||l===`href`&&(c!==`use`||u[0]!==`#`)||l===`xlink:href`&&u[0]!==`#`||l===`background`&&(c===`table`||c===`td`||c===`th`)?absoluteToDoc(r,u):l===`srcset`?getAbsoluteSrcsetString(r,u):l===`style`?absolutifyURLs(u,getHref(r)):c===`object`&&l===`data`?absoluteToDoc(r,u):u)}function ignoreAttribute(r,c,l){return(r===`video`||r===`audio`)&&c===`autoplay`}function _isBlockedElement(r,c,l){try{if(typeof c==`string`){if(r.classList.contains(c))return!0}else for(var u=r.classList.length;u--;){var p=r.classList[u];if(c.test(p))return!0}if(l)return r.matches(l)}catch(r){}return!1}function classMatchesRegex(r,c,l){if(!r)return!1;if(r.nodeType!==r.ELEMENT_NODE)return l?classMatchesRegex(ut.parentNode(r),c,l):!1;for(var u=r.classList.length;u--;){var p=r.classList[u];if(c.test(p))return!0}return l?classMatchesRegex(ut.parentNode(r),c,l):!1}function needMaskingText(r,c,l,u){var p;if(isElement(r)){if(p=r,!ut.childNodes(p).length)return!1}else if(ut.parentElement(r)===null)return!1;else p=ut.parentElement(r);try{if(typeof c==`string`){if(u){if(p.closest(`.`+c))return!0}else if(p.classList.contains(c))return!0}else if(classMatchesRegex(p,c,u))return!0;if(l){if(u){if(p.closest(l))return!0}else if(p.matches(l))return!0}}catch(r){}return!1}function onceIframeLoaded(r,c,l){var u=r.contentWindow;if(u){var p=!1,m;try{m=u.document.readyState}catch(r){return}if(m!==`complete`){var h=setTimeout(function(){p||(c(),p=!0)},l);r.addEventListener(`load`,function(){clearTimeout(h),p=!0,c()});return}var g=`about:blank`;if(u.location.href!==g||r.src===g||r.src===``)return setTimeout(c,0),r.addEventListener(`load`,c);r.addEventListener(`load`,c)}}function onceStylesheetLoaded(r,c,l){var u=!1,p;try{p=r.sheet}catch(r){return}if(!p){var m=setTimeout(function(){u||(c(),u=!0)},l);r.addEventListener(`load`,function(){clearTimeout(m),u=!0,c()})}}function serializeNode(r,c){var l=c.doc,u=c.mirror,p=c.blockClass,m=c.blockSelector,h=c.needsMask,g=c.inlineStylesheet,v=c.maskInputOptions,y=v===void 0?{}:v,b=c.maskTextFn,x=c.maskInputFn,S=c.dataURLOptions,C=S===void 0?{}:S,w=c.inlineImages,T=c.recordCanvas,E=c.keepIframeSrcFn,D=c.newlyAddedElement,O=D!==void 0&&D,k=c.cssCaptured,A=k!==void 0&&k,ee=getRootId(l,u);switch(r.nodeType){case r.DOCUMENT_NODE:return r.compatMode===`CSS1Compat`?{type:I.Document,childNodes:[]}:{type:I.Document,childNodes:[],compatMode:r.compatMode};case r.DOCUMENT_TYPE_NODE:return{type:I.DocumentType,name:r.name,publicId:r.publicId,systemId:r.systemId,rootId:ee};case r.ELEMENT_NODE:return serializeElementNode(r,{doc:l,blockClass:p,blockSelector:m,inlineStylesheet:g,maskInputOptions:y,maskInputFn:x,dataURLOptions:C,inlineImages:w,recordCanvas:T,keepIframeSrcFn:E,newlyAddedElement:O,rootId:ee});case r.TEXT_NODE:return serializeTextNode(r,{doc:l,needsMask:h,maskTextFn:b,rootId:ee,cssCaptured:A});case r.CDATA_SECTION_NODE:return{type:I.CDATA,textContent:``,rootId:ee};case r.COMMENT_NODE:return{type:I.Comment,textContent:ut.textContent(r)||``,rootId:ee};default:return!1}}function getRootId(r,c){if(c.hasNode(r)){var l=c.getId(r);return l===1?void 0:l}}function serializeTextNode(r,c){var l=c.needsMask,u=c.maskTextFn,p=c.rootId,m=c.cssCaptured,h=ut.parentNode(r),g=h&&h.tagName,v=``,y=g===`STYLE`||void 0,b=g===`SCRIPT`||void 0;return b?v=`SCRIPT_PLACEHOLDER`:m||(v=ut.textContent(r),y&&v&&(v=absolutifyURLs(v,getHref(c.doc)))),!y&&!b&&v&&l&&(v=u?u(v,ut.parentElement(r)):v.replace(/[\S]/g,`*`)),{type:I.Text,textContent:v||``,rootId:p}}function serializeElementNode(r,c){for(var l=c.doc,u=c.blockClass,p=c.blockSelector,m=c.inlineStylesheet,h=c.maskInputOptions,g=h===void 0?{}:h,v=c.maskInputFn,y=c.dataURLOptions,b=y===void 0?{}:y,x=c.inlineImages,S=c.recordCanvas,C=c.keepIframeSrcFn,w=c.newlyAddedElement,T=w!==void 0&&w,E=c.rootId,D=_isBlockedElement(r,u,p),O=getValidTagName$1(r),k={},A=r.attributes.length,ee=0;ee<A;ee++){var te=r.attributes[ee];ignoreAttribute(O,te.name,te.value)||(k[te.name]=transformAttribute(l,O,toLowerCase(te.name),te.value))}if(O===`link`&&m){var ne=Array.from(l.styleSheets).find(function(c){return c.href===r.href}),j=null;ne&&(j=stringifyStylesheet(ne)),j&&(delete k.rel,delete k.href,k._cssText=j)}if(O===`style`&&r.sheet){var re=stringifyStylesheet(r.sheet);re&&(r.childNodes.length>1&&(re=markCssSplits(re,r)),k._cssText=re)}if(O===`input`||O===`textarea`||O===`select`){var ie=r.value,ae=r.checked;k.type!==`radio`&&k.type!==`checkbox`&&k.type!==`submit`&&k.type!==`button`&&ie?k.value=maskInputValue({element:r,type:getInputType(r),tagName:O,value:ie,maskInputOptions:g,maskInputFn:v}):ae&&(k.checked=ae)}if(O===`option`&&(r.selected&&!g.select?k.selected=!0:delete k.selected),O===`dialog`&&r.open&&(k.rr_open_mode=r.matches(`dialog:modal`)?`modal`:`non-modal`),O===`canvas`&&S){if(r.__context===`2d`)is2DCanvasBlank(r)||(k.rr_dataURL=r.toDataURL(b.type,b.quality));else if(!(`__context`in r)){var oe=r.toDataURL(b.type,b.quality),se=l.createElement(`canvas`);se.width=r.width,se.height=r.height,oe!==se.toDataURL(b.type,b.quality)&&(k.rr_dataURL=oe)}}if(O===`img`&&x){bt||(bt=l.createElement(`canvas`),xt=bt.getContext(`2d`));var M=r,ce=M.currentSrc||M.getAttribute(`src`)||`<unknown-src>`,le=M.crossOrigin,recordInlineImage=function(){M.removeEventListener(`load`,recordInlineImage);try{bt.width=M.naturalWidth,bt.height=M.naturalHeight,xt.drawImage(M,0,0),k.rr_dataURL=bt.toDataURL(b.type,b.quality)}catch(r){if(M.crossOrigin!==`anonymous`){M.crossOrigin=`anonymous`,M.complete&&M.naturalWidth!==0?recordInlineImage():M.addEventListener(`load`,recordInlineImage);return}else console.warn(`Cannot inline img src=`+ce+`! Error: `+r)}M.crossOrigin===`anonymous`&&(le?k.crossOrigin=le:M.removeAttribute(`crossorigin`))};M.complete&&M.naturalWidth!==0?recordInlineImage():M.addEventListener(`load`,recordInlineImage)}if(O===`audio`||O===`video`){var ue=k;ue.rr_mediaState=r.paused?`paused`:`played`,ue.rr_mediaCurrentTime=r.currentTime,ue.rr_mediaPlaybackRate=r.playbackRate,ue.rr_mediaMuted=r.muted,ue.rr_mediaLoop=r.loop,ue.rr_mediaVolume=r.volume}if(T||(r.scrollLeft&&(k.rr_scrollLeft=r.scrollLeft),r.scrollTop&&(k.rr_scrollTop=r.scrollTop)),D){var de=r.getBoundingClientRect(),fe=de.width,pe=de.height;k={class:k.class,rr_width:``+fe+`px`,rr_height:``+pe+`px`}}O===`iframe`&&!C(k.src)&&(r.contentDocument||(k.rr_src=k.src),delete k.src);var me;try{customElements.get(O)&&(me=!0)}catch(r){}return{type:I.Element,tagName:O,attributes:k,childNodes:[],isSVG:isSVGElement(r)||void 0,needBlock:D,rootId:E,isCustom:me}}function lowerIfExists(r){return r==null?``:r.toLowerCase()}function slimDOMExcluded(r,c){return!!(c.comment&&r.type===I.Comment||r.type===I.Element&&(c.script&&(r.tagName===`script`||r.tagName===`link`&&(r.attributes.rel===`preload`&&r.attributes.as===`script`||r.attributes.rel===`modulepreload`)||r.tagName===`link`&&r.attributes.rel===`prefetch`&&typeof r.attributes.href==`string`&&extractFileExtension(r.attributes.href)===`js`)||c.headFavicon&&(r.tagName===`link`&&r.attributes.rel===`shortcut icon`||r.tagName===`meta`&&(lowerIfExists(r.attributes.name).match(/^msapplication-tile(image|color)$/)||lowerIfExists(r.attributes.name)===`application-name`||lowerIfExists(r.attributes.rel)===`icon`||lowerIfExists(r.attributes.rel)===`apple-touch-icon`||lowerIfExists(r.attributes.rel)===`shortcut icon`))||r.tagName===`meta`&&(c.headMetaDescKeywords&&lowerIfExists(r.attributes.name).match(/^description|keywords$/)||c.headMetaSocial&&(lowerIfExists(r.attributes.property).match(/^(og|twitter|fb):/)||lowerIfExists(r.attributes.name).match(/^(og|twitter):/)||lowerIfExists(r.attributes.name)===`pinterest`)||c.headMetaRobots&&(lowerIfExists(r.attributes.name)===`robots`||lowerIfExists(r.attributes.name)===`googlebot`||lowerIfExists(r.attributes.name)===`bingbot`)||c.headMetaHttpEquiv&&r.attributes[`http-equiv`]!==void 0||c.headMetaAuthorship&&(lowerIfExists(r.attributes.name)===`author`||lowerIfExists(r.attributes.name)===`generator`||lowerIfExists(r.attributes.name)===`framework`||lowerIfExists(r.attributes.name)===`publisher`||lowerIfExists(r.attributes.name)===`progid`||lowerIfExists(r.attributes.property).match(/^article:/)||lowerIfExists(r.attributes.property).match(/^product:/))||c.headMetaVerification&&(lowerIfExists(r.attributes.name)===`google-site-verification`||lowerIfExists(r.attributes.name)===`yandex-verification`||lowerIfExists(r.attributes.name)===`csrf-token`||lowerIfExists(r.attributes.name)===`p:domain_verify`||lowerIfExists(r.attributes.name)===`verify-v1`||lowerIfExists(r.attributes.name)===`verification`||lowerIfExists(r.attributes.name)===`shopify-checkout-api-token`))))}function serializeNodeWithId(r,c){var l=c.doc,u=c.mirror,p=c.blockClass,m=c.blockSelector,h=c.maskTextClass,g=c.maskTextSelector,v=c.skipChild,y=v!==void 0&&v,b=c.inlineStylesheet,x=b===void 0||b,S=c.maskInputOptions,C=S===void 0?{}:S,w=c.maskTextFn,T=c.maskInputFn,E=c.slimDOMOptions,D=c.dataURLOptions,O=D===void 0?{}:D,k=c.inlineImages,A=k!==void 0&&k,ee=c.recordCanvas,te=ee!==void 0&&ee,ne=c.onSerialize,j=c.onIframeLoad,re=c.iframeLoadTimeout,ie=re===void 0?5e3:re,ae=c.onStylesheetLoad,oe=c.stylesheetLoadTimeout,se=oe===void 0?5e3:oe,M=c.keepIframeSrcFn,ce=M===void 0?function(){return!1}:M,le=c.newlyAddedElement,ue=le!==void 0&&le,de=c.cssCaptured,fe=de!==void 0&&de,pe=c.needsMask,me=c.preserveWhiteSpace,he=me===void 0||me;pe||(pe=needMaskingText(r,h,g,pe===void 0));var ge=serializeNode(r,{doc:l,mirror:u,blockClass:p,blockSelector:m,needsMask:pe,inlineStylesheet:x,maskInputOptions:C,maskTextFn:w,maskInputFn:T,dataURLOptions:O,inlineImages:A,recordCanvas:te,keepIframeSrcFn:ce,newlyAddedElement:ue,cssCaptured:fe});if(!ge)return console.warn(r,`not serialized`),null;var _e=u.hasNode(r)?u.getId(r):slimDOMExcluded(ge,E)||!he&&ge.type===I.Text&&!ge.textContent.replace(/^\s+|\s+$/gm,``).length?yt:genId(),N=Object.assign(ge,{id:_e});if(u.add(r,N),_e===yt)return null;ne&&ne(r);var ve=!y;if(N.type===I.Element){ve=ve&&!N.needBlock,delete N.needBlock;var ye=ut.shadowRoot(r);ye&&isNativeShadowDom(ye)&&(N.isShadowHost=!0)}if((N.type===I.Document||N.type===I.Element)&&ve){E.headWhitespace&&N.type===I.Element&&N.tagName===`head`&&(he=!1);var be={doc:l,mirror:u,blockClass:p,blockSelector:m,needsMask:pe,maskTextClass:h,maskTextSelector:g,skipChild:y,inlineStylesheet:x,maskInputOptions:C,maskTextFn:w,maskInputFn:T,slimDOMOptions:E,dataURLOptions:O,inlineImages:A,recordCanvas:te,preserveWhiteSpace:he,onSerialize:ne,onIframeLoad:j,iframeLoadTimeout:ie,onStylesheetLoad:ae,stylesheetLoadTimeout:se,keepIframeSrcFn:ce,cssCaptured:!1};if(N.type!==I.Element||N.tagName!==`textarea`||N.attributes.value===void 0){N.type===I.Element&&N.attributes._cssText!==void 0&&typeof N.attributes._cssText==`string`&&(be.cssCaptured=!0);for(var xe=_create_for_of_iterator_helper_loose(Array.from(ut.childNodes(r))),Se;!(Se=xe()).done;){var Ce=Se.value,we=serializeNodeWithId(Ce,be);we&&N.childNodes.push(we)}}var Te=null;if(isElement(r)&&(Te=ut.shadowRoot(r)))for(var Ee=_create_for_of_iterator_helper_loose(Array.from(ut.childNodes(Te))),De;!(De=Ee()).done;){var Oe=De.value,ke=serializeNodeWithId(Oe,be);ke&&(isNativeShadowDom(Te)&&(ke.isShadow=!0),N.childNodes.push(ke))}}var Ae=ut.parentNode(r);return Ae&&isShadowRoot(Ae)&&isNativeShadowDom(Ae)&&(N.isShadow=!0),N.type===I.Element&&N.tagName===`iframe`&&onceIframeLoaded(r,function(){var c=r.contentDocument;if(c&&j){var l=serializeNodeWithId(c,{doc:c,mirror:u,blockClass:p,blockSelector:m,needsMask:pe,maskTextClass:h,maskTextSelector:g,skipChild:!1,inlineStylesheet:x,maskInputOptions:C,maskTextFn:w,maskInputFn:T,slimDOMOptions:E,dataURLOptions:O,inlineImages:A,recordCanvas:te,preserveWhiteSpace:he,onSerialize:ne,onIframeLoad:j,iframeLoadTimeout:ie,onStylesheetLoad:ae,stylesheetLoadTimeout:se,keepIframeSrcFn:ce});l&&j(r,l)}},ie),N.type===I.Element&&N.tagName===`link`&&typeof N.attributes.rel==`string`&&(N.attributes.rel===`stylesheet`||N.attributes.rel===`preload`&&typeof N.attributes.href==`string`&&extractFileExtension(N.attributes.href)===`css`)&&onceStylesheetLoaded(r,function(){if(ae){var c=serializeNodeWithId(r,{doc:l,mirror:u,blockClass:p,blockSelector:m,needsMask:pe,maskTextClass:h,maskTextSelector:g,skipChild:!1,inlineStylesheet:x,maskInputOptions:C,maskTextFn:w,maskInputFn:T,slimDOMOptions:E,dataURLOptions:O,inlineImages:A,recordCanvas:te,preserveWhiteSpace:he,onSerialize:ne,onIframeLoad:j,iframeLoadTimeout:ie,onStylesheetLoad:ae,stylesheetLoadTimeout:se,keepIframeSrcFn:ce});c&&ae(r,c)}},se),N}function snapshot(r,c){var l=c||{},u=l.mirror,p=u===void 0?new dt:u,m=l.blockClass,h=m===void 0?`rr-block`:m,g=l.blockSelector,v=g===void 0?null:g,y=l.maskTextClass,b=y===void 0?`rr-mask`:y,x=l.maskTextSelector,S=x===void 0?null:x,C=l.inlineStylesheet,w=C===void 0||C,T=l.inlineImages,E=T!==void 0&&T,D=l.recordCanvas,O=D!==void 0&&D,k=l.maskAllInputs,A=k!==void 0&&k,ee=l.maskTextFn,te=l.maskInputFn,ne=l.slimDOM,j=ne!==void 0&&ne,re=l.dataURLOptions,ie=l.preserveWhiteSpace,ae=l.onSerialize,oe=l.onIframeLoad,se=l.iframeLoadTimeout,M=l.onStylesheetLoad,ce=l.stylesheetLoadTimeout,le=l.keepIframeSrcFn;return serializeNodeWithId(r,{doc:r,mirror:p,blockClass:h,blockSelector:v,maskTextClass:b,maskTextSelector:S,skipChild:!1,inlineStylesheet:w,maskInputOptions:A===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0,hidden:!0}:A===!1?{password:!0}:A,maskTextFn:ee,maskInputFn:te,slimDOMOptions:j===!0||j===`all`?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:j===`all`,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:j===!1?{}:j,dataURLOptions:re,inlineImages:E,recordCanvas:O,preserveWhiteSpace:ie,onSerialize:ae,onIframeLoad:oe,iframeLoadTimeout:se,onStylesheetLoad:M,stylesheetLoadTimeout:ce,keepIframeSrcFn:le===void 0?function(){return!1}:le,newlyAddedElement:!1})}function getDefaultExportFromCjs$1(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,`default`)?r.default:r}function getAugmentedNamespace$1(r){if(r.__esModule)return r;var c=r.default;if(typeof c==`function`){var l=function a22(){return _instanceof(this,a22)?Reflect.construct(c,arguments,this.constructor):c.apply(this,arguments)};l.prototype=c.prototype}else l={};return Object.defineProperty(l,"__esModule",{value:!0}),Object.keys(r).forEach(function(c){var u=Object.getOwnPropertyDescriptor(r,c);Object.defineProperty(l,c,u.get?u:{enumerable:!0,get:function get(){return r[c]}})}),l}var Tt={exports:{}},L=String,Et=function create$1(){return{isColorSupported:!1,reset:L,bold:L,dim:L,italic:L,underline:L,inverse:L,hidden:L,strikethrough:L,black:L,red:L,green:L,yellow:L,blue:L,magenta:L,cyan:L,white:L,gray:L,bgBlack:L,bgRed:L,bgGreen:L,bgYellow:L,bgBlue:L,bgMagenta:L,bgCyan:L,bgWhite:L}};Tt.exports=Et(),Tt.exports.createColors=Et;var Dt=Tt.exports,R=getAugmentedNamespace$1(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:`Module`}))),Ot=Dt,kt=R,At=function(r){_inherits(CssSyntaxError,r);function CssSyntaxError(c,l,u,p,m,h){var g=r.call(this,c)||this;return g.name=`CssSyntaxError`,g.reason=c,m&&(g.file=m),p&&(g.source=p),h&&(g.plugin=h),l!==void 0&&u!==void 0&&(typeof l==`number`?(g.line=l,g.column=u):(g.line=l.line,g.column=l.column,g.endLine=u.line,g.endColumn=u.column)),g.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(g,CssSyntaxError),g}var c=CssSyntaxError.prototype;return c.setMessage=function setMessage(){this.message=this.plugin?this.plugin+`: `:``,this.message+=this.file?this.file:`<css input>`,this.line!==void 0&&(this.message+=`:`+this.line+`:`+this.column),this.message+=`: `+this.reason},c.showSourceCode=function showSourceCode(r){var c=this;if(!this.source)return``;var l=this.source;r==null&&(r=Ot.isColorSupported),kt&&r&&(l=kt(l));var u=l.split(/\r?\n/),p=Math.max(this.line-3,0),m=Math.min(this.line+2,u.length),h=String(m).length,mark,aside;if(r){var g=Ot.createColors(!0),v=g.bold,y=g.gray,b=g.red;mark=function(r){return v(b(r))},aside=function(r){return y(r)}}else mark=aside=function(r){return r};return u.slice(p,m).map(function(r,l){var u=p+1+l,m=` `+(` `+u).slice(-h)+` | `;if(u===c.line){var g=aside(m.replace(/\d/g,` `))+r.slice(0,c.column-1).replace(/[^\t]/g,` `);return mark(`>`)+aside(m)+r+` |
| 7 |
`+g+mark(`^`)}return` `+aside(m)+r}).join(` |
| 8 |
`)},c.toString=function toString(){var r=this.showSourceCode();return r&&(r=` |
| 9 |
|
| 10 |
`+r+` |
| 11 |
`),this.name+`: `+this.message+r},CssSyntaxError}(_wrap_native_super(Error)),jt=At;At.default=At;var Mt={};Mt.isClean=Symbol(`isClean`),Mt.my=Symbol(`my`);var Nt={after:` |
| 12 |
`,beforeClose:` |
| 13 |
`,beforeComment:` |
| 14 |
`,beforeDecl:` |
| 15 |
`,beforeOpen:` `,beforeRule:` |
| 16 |
`,colon:`: `,commentLeft:` `,commentRight:` `,emptyBody:``,indent:` `,semicolon:!1};function capitalize$1(r){return r[0].toUpperCase()+r.slice(1)}var Pt=function(){function Stringifier(r){this.builder=r}var r=Stringifier.prototype;return r.atrule=function atrule(r,c){var l=`@`+r.name,u=r.params?this.rawValue(r,`params`):``;if(r.raws.afterName===void 0?u&&(l+=` `):l+=r.raws.afterName,r.nodes)this.block(r,l+u);else{var p=(r.raws.between||``)+(c?`;`:``);this.builder(l+u+p,r)}},r.beforeAfter=function beforeAfter(r,c){for(var l=r.type===`decl`?this.raw(r,null,`beforeDecl`):r.type===`comment`?this.raw(r,null,`beforeComment`):c===`before`?this.raw(r,null,`beforeRule`):this.raw(r,null,`beforeClose`),u=r.parent,p=0;u&&u.type!==`root`;)p+=1,u=u.parent;if(l.includes(` |
| 17 |
`)){var m=this.raw(r,null,`indent`);if(m.length)for(var h=0;h<p;h++)l+=m}return l},r.block=function block(r,c){var l=this.raw(r,`between`,`beforeOpen`);this.builder(c+l+`{`,r,`start`);var u;r.nodes&&r.nodes.length?(this.body(r),u=this.raw(r,`after`)):u=this.raw(r,`after`,`emptyBody`),u&&this.builder(u),this.builder(`}`,r,`end`)},r.body=function body(r){for(var c=r.nodes.length-1;c>0&&r.nodes[c].type===`comment`;)--c;for(var l=this.raw(r,`semicolon`),u=0;u<r.nodes.length;u++){var p=r.nodes[u],m=this.raw(p,`before`);m&&this.builder(m),this.stringify(p,c!==u||l)}},r.comment=function comment(r){var c=this.raw(r,`left`,`commentLeft`),l=this.raw(r,`right`,`commentRight`);this.builder(`/*`+c+r.text+l+`*/`,r)},r.decl=function decl(r,c){var l=this.raw(r,`between`,`colon`),u=r.prop+l+this.rawValue(r,`value`);r.important&&(u+=r.raws.important||` !important`),c&&(u+=`;`),this.builder(u,r)},r.document=function document1(r){this.body(r)},r.raw=function raw(r,c,l){var u;if(l||(l=c),c&&(u=r.raws[c],u!==void 0))return u;var p=r.parent;if(l===`before`&&(!p||p.type===`root`&&p.first===r||p&&p.type===`document`))return``;if(!p)return Nt[l];var m=r.root();if(m.rawCache||(m.rawCache={}),m.rawCache[l]!==void 0)return m.rawCache[l];if(l===`before`||l===`after`)return this.beforeAfter(r,l);var h=`raw`+capitalize$1(l);return this[h]?u=this[h](m,r):m.walk(function(r){if(u=r.raws[c],u!==void 0)return!1}),u===void 0&&(u=Nt[l]),m.rawCache[l]=u,u},r.rawBeforeClose=function rawBeforeClose(r){var c;return r.walk(function(r){if(r.nodes&&r.nodes.length>0&&r.raws.after!==void 0)return c=r.raws.after,c.includes(` |
| 18 |
`)&&(c=c.replace(/[^\n]+$/,``)),!1}),c&&(c=c.replace(/\S/g,``)),c},r.rawBeforeComment=function rawBeforeComment(r,c){var l;return r.walkComments(function(r){if(r.raws.before!==void 0)return l=r.raws.before,l.includes(` |
| 19 |
`)&&(l=l.replace(/[^\n]+$/,``)),!1}),l===void 0?l=this.raw(c,null,`beforeDecl`):l&&(l=l.replace(/\S/g,``)),l},r.rawBeforeDecl=function rawBeforeDecl(r,c){var l;return r.walkDecls(function(r){if(r.raws.before!==void 0)return l=r.raws.before,l.includes(` |
| 20 |
`)&&(l=l.replace(/[^\n]+$/,``)),!1}),l===void 0?l=this.raw(c,null,`beforeRule`):l&&(l=l.replace(/\S/g,``)),l},r.rawBeforeOpen=function rawBeforeOpen(r){var c;return r.walk(function(r){if(r.type!==`decl`&&(c=r.raws.between,c!==void 0))return!1}),c},r.rawBeforeRule=function rawBeforeRule(r){var c;return r.walk(function(l){if(l.nodes&&(l.parent!==r||r.first!==l)&&l.raws.before!==void 0)return c=l.raws.before,c.includes(` |
| 21 |
`)&&(c=c.replace(/[^\n]+$/,``)),!1}),c&&(c=c.replace(/\S/g,``)),c},r.rawColon=function rawColon(r){var c;return r.walkDecls(function(r){if(r.raws.between!==void 0)return c=r.raws.between.replace(/[^\s:]/g,``),!1}),c},r.rawEmptyBody=function rawEmptyBody(r){var c;return r.walk(function(r){if(r.nodes&&r.nodes.length===0&&(c=r.raws.after,c!==void 0))return!1}),c},r.rawIndent=function rawIndent(r){if(r.raws.indent)return r.raws.indent;var c;return r.walk(function(l){var u=l.parent;if(u&&u!==r&&u.parent&&u.parent===r&&l.raws.before!==void 0){var p=l.raws.before.split(` |
| 22 |
`);return c=p[p.length-1],c=c.replace(/\S/g,``),!1}}),c},r.rawSemicolon=function rawSemicolon(r){var c;return r.walk(function(r){if(r.nodes&&r.nodes.length&&r.last.type===`decl`&&(c=r.raws.semicolon,c!==void 0))return!1}),c},r.rawValue=function rawValue(r,c){var l=r[c],u=r.raws[c];return u&&u.value===l?u.raw:l},r.root=function root(r){this.body(r),r.raws.after&&this.builder(r.raws.after)},r.rule=function rule(r){this.block(r,this.rawValue(r,`selector`)),r.raws.ownSemicolon&&this.builder(r.raws.ownSemicolon,r,`end`)},r.stringify=function stringify(r,c){if(!this[r.type])throw Error(`Unknown AST node type `+r.type+`. Maybe you need to change PostCSS stringifier.`);this[r.type](r,c)},Stringifier}(),Ft=Pt;Pt.default=Pt;var It=Ft;function stringify$4$1(r,c){new It(c).stringify(r)}var Lt=stringify$4$1;stringify$4$1.default=stringify$4$1;var Rt=Mt.isClean,zt=Mt.my,Bt=jt,Vt=Ft,Ht=Lt;function cloneNode$1(r,c){var l=new r.constructor;for(var u in r)if(Object.prototype.hasOwnProperty.call(r,u)&&u!==`proxyCache`){var p=r[u],m=p===void 0?`undefined`:_type_of(p);u===`parent`&&m===`object`?c&&(l[u]=c):u===`source`?l[u]=p:Array.isArray(p)?l[u]=p.map(function(r){return cloneNode$1(r,l)}):(m===`object`&&p!==null&&(p=cloneNode$1(p)),l[u]=p)}return l}var Ut=function(){function Node2(r){for(var c in r===void 0&&(r={}),this.raws={},this[Rt]=!1,this[zt]=!0,r)if(c===`nodes`){this.nodes=[];for(var l=_create_for_of_iterator_helper_loose(r[c]),u;!(u=l()).done;){var p=u.value;typeof p.clone==`function`?this.append(p.clone()):this.append(p)}}else this[c]=r[c]}var r=Node2.prototype;return r.addToError=function addToError(r){if(r.postcssNode=this,r.stack&&this.source&&/\n\s{4}at /.test(r.stack)){var c=this.source;r.stack=r.stack.replace(/\n\s{4}at /,`$&`+c.input.from+`:`+c.start.line+`:`+c.start.column+`$&`)}return r},r.after=function after(r){return this.parent.insertAfter(this,r),this},r.assign=function assign(r){for(var c in r===void 0&&(r={}),r)this[c]=r[c];return this},r.before=function before(r){return this.parent.insertBefore(this,r),this},r.cleanRaws=function cleanRaws(r){delete this.raws.before,delete this.raws.after,r||delete this.raws.between},r.clone=function clone(r){r===void 0&&(r={});var c=cloneNode$1(this);for(var l in r)c[l]=r[l];return c},r.cloneAfter=function cloneAfter(r){r===void 0&&(r={});var c=this.clone(r);return this.parent.insertAfter(this,c),c},r.cloneBefore=function cloneBefore(r){r===void 0&&(r={});var c=this.clone(r);return this.parent.insertBefore(this,c),c},r.error=function error(r,c){if(c===void 0&&(c={}),this.source){var l=this.rangeBy(c),u=l.end,p=l.start;return this.source.input.error(r,{column:p.column,line:p.line},{column:u.column,line:u.line},c)}return new Bt(r)},r.getProxyProcessor=function getProxyProcessor(){return{get:function get(r,c){return c===`proxyOf`?r:c===`root`?function(){return r.root().toProxy()}:r[c]},set:function set(r,c,l){return r[c]===l?!0:(r[c]=l,(c===`prop`||c===`value`||c===`name`||c===`params`||c===`important`||c===`text`)&&r.markDirty(),!0)}}},r.markDirty=function markDirty(){if(this[Rt]){this[Rt]=!1;for(var r=this;r=r.parent;)r[Rt]=!1}},r.next=function next(){if(this.parent){var r=this.parent.index(this);return this.parent.nodes[r+1]}},r.positionBy=function positionBy(r,c){var l=this.source.start;if(r.index)l=this.positionInside(r.index,c);else if(r.word){c=this.toString();var u=c.indexOf(r.word);u!==-1&&(l=this.positionInside(u,c))}return l},r.positionInside=function positionInside(r,c){for(var l=c||this.toString(),u=this.source.start.column,p=this.source.start.line,m=0;m<r;m++)l[m]===` |
| 23 |
`?(u=1,p+=1):u+=1;return{column:u,line:p}},r.prev=function prev(){if(this.parent){var r=this.parent.index(this);return this.parent.nodes[r-1]}},r.rangeBy=function rangeBy(r){var c={column:this.source.start.column,line:this.source.start.line},l=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:c.column+1,line:c.line};if(r.word){var u=this.toString(),p=u.indexOf(r.word);p!==-1&&(c=this.positionInside(p,u),l=this.positionInside(p+r.word.length,u))}else r.start?c={column:r.start.column,line:r.start.line}:r.index&&(c=this.positionInside(r.index)),r.end?l={column:r.end.column,line:r.end.line}:typeof r.endIndex==`number`?l=this.positionInside(r.endIndex):r.index&&(l=this.positionInside(r.index+1));return(l.line<c.line||l.line===c.line&&l.column<=c.column)&&(l={column:c.column+1,line:c.line}),{end:l,start:c}},r.raw=function raw(r,c){return new Vt().raw(this,r,c)},r.remove=function remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this},r.replaceWith=function replaceWith(){for(var r=arguments.length,c=Array(r),l=0;l<r;l++)c[l]=arguments[l];if(this.parent){for(var u=this,p=!1,m=_create_for_of_iterator_helper_loose(c),h;!(h=m()).done;){var g=h.value;g===this?p=!0:p?(this.parent.insertAfter(u,g),u=g):this.parent.insertBefore(u,g)}p||this.remove()}return this},r.root=function root(){for(var r=this;r.parent&&r.parent.type!==`document`;)r=r.parent;return r},r.toJSON=function toJSON(r,c){var l={},u=c==null;c=c||new Map;var p=0;for(var m in this)if(Object.prototype.hasOwnProperty.call(this,m)&&m!==`parent`&&m!==`proxyCache`){var h=this[m];if(Array.isArray(h))l[m]=h.map(function(r){return(r===void 0?`undefined`:_type_of(r))===`object`&&r.toJSON?r.toJSON(null,c):r});else if((h===void 0?`undefined`:_type_of(h))===`object`&&h.toJSON)l[m]=h.toJSON(null,c);else if(m===`source`){var g=c.get(h.input);g==null&&(g=p,c.set(h.input,p),p++),l[m]={end:h.end,inputId:g,start:h.start}}else l[m]=h}return u&&(l.inputs=[].concat(c.keys()).map(function(r){return r.toJSON()})),l},r.toProxy=function toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache},r.toString=function toString(r){r===void 0&&(r=Ht),r.stringify&&(r=r.stringify);var c=``;return r(this,function(r){c+=r}),c},r.warn=function warn(r,c,l){var u={node:this};for(var p in l)u[p]=l[p];return r.warn(c,u)},_create_class(Node2,[{key:`proxyOf`,get:function get(){return this}}]),Node2}(),Wt=Ut;Ut.default=Ut;var Gt=function(r){_inherits(Declaration,r);function Declaration(c){var l;return c&&c.value!==void 0&&typeof c.value!=`string`&&(c=_extends({},c,{value:String(c.value)})),l=r.call(this,c)||this,l.type=`decl`,l}return _create_class(Declaration,[{key:`variable`,get:function get(){return this.prop.startsWith(`--`)||this.prop[0]===`$`}}]),Declaration}(Wt),Kt=Gt;Gt.default=Gt;var qt=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`,nanoid$1$1=function(r){r===void 0&&(r=21);for(var c=``,l=r;l--;)c+=qt[Math.random()*64|0];return c},Jt={nanoid:nanoid$1$1},Yt=R.SourceMapConsumer,Xt=R.SourceMapGenerator,Zt=R.existsSync,Qt=R.readFileSync,$t=R.dirname,en=R.join;function fromBase64$1(r){return Buffer?Buffer.from(r,`base64`).toString():window.atob(r)}var tn=function(){function PreviousMap(r,c){if(c.map!==!1){this.loadAnnotation(r),this.inline=this.startWith(this.annotation,`data:`);var l=c.map?c.map.prev:void 0,u=this.loadMap(c.from,l);!this.mapFile&&c.from&&(this.mapFile=c.from),this.mapFile&&(this.root=$t(this.mapFile)),u&&(this.text=u)}}var r=PreviousMap.prototype;return r.consumer=function consumer(){return this.consumerCache||(this.consumerCache=new Yt(this.text)),this.consumerCache},r.decodeInline=function decodeInline(r){var c=/^data:application\/json;charset=utf-?8;base64,/,l=/^data:application\/json;base64,/;if(/^data:application\/json;charset=utf-?8,/.test(r)||/^data:application\/json,/.test(r))return decodeURIComponent(r.substr(RegExp.lastMatch.length));if(c.test(r)||l.test(r))return fromBase64$1(r.substr(RegExp.lastMatch.length));var u=r.match(/data:application\/json;([^,]+),/)[1];throw Error(`Unsupported source map encoding `+u)},r.getAnnotationURL=function getAnnotationURL(r){return r.replace(/^\/\*\s*# sourceMappingURL=/,``).trim()},r.isMap=function isMap(r){return(r===void 0?`undefined`:_type_of(r))===`object`?typeof r.mappings==`string`||typeof r._mappings==`string`||Array.isArray(r.sections):!1},r.loadAnnotation=function loadAnnotation(r){var c=r.match(/\/\*\s*# sourceMappingURL=/gm);if(c){var l=r.lastIndexOf(c.pop()),u=r.indexOf(`*/`,l);l>-1&&u>-1&&(this.annotation=this.getAnnotationURL(r.substring(l,u)))}},r.loadFile=function loadFile(r){if(this.root=$t(r),Zt(r))return this.mapFile=r,Qt(r,`utf-8`).toString().trim()},r.loadMap=function loadMap(r,c){if(c===!1)return!1;if(c){if(typeof c==`string`)return c;if(typeof c==`function`){var l=c(r);if(l){var u=this.loadFile(l);if(!u)throw Error(`Unable to load previous source map: `+l.toString());return u}}else if(_instanceof(c,Yt))return Xt.fromSourceMap(c).toString();else if(_instanceof(c,Xt))return c.toString();else if(this.isMap(c))return JSON.stringify(c);else throw Error(`Unsupported previous source map format: `+c.toString())}else if(this.inline)return this.decodeInline(this.annotation);else if(this.annotation){var p=this.annotation;return r&&(p=en($t(r),p)),this.loadFile(p)}},r.startWith=function startWith(r,c){return r?r.substr(0,c.length)===c:!1},r.withContent=function withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)},PreviousMap}(),nn=tn;tn.default=tn;var rn=R.SourceMapConsumer,an=R.SourceMapGenerator,sn=R.fileURLToPath,cn=R.pathToFileURL,ln=R.isAbsolute,un=R.resolve,dn=Jt.nanoid,fn=R,pn=jt,mn=nn,hn=Symbol(`fromOffsetCache`),gn=!!(rn&&an),_n=!!(un&&ln),vn=function(){function Input(r,c){if(c===void 0&&(c={}),r==null||(r===void 0?`undefined`:_type_of(r))===`object`&&!r.toString)throw Error(`PostCSS received `+r+` instead of CSS string`);if(this.css=r.toString(),this.css[0]===``||this.css[0]===``?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,c.from&&(!_n||/^\w+:\/\//.test(c.from)||ln(c.from)?this.file=c.from:this.file=un(c.from)),_n&&gn){var l=new mn(this.css,c);if(l.text){this.map=l;var u=l.consumer().file;!this.file&&u&&(this.file=this.mapResolve(u))}}this.file||(this.id=`<input css `+dn(6)+`>`),this.map&&(this.map.file=this.from)}var r=Input.prototype;return r.error=function error(r,c,l,u){u===void 0&&(u={});var p,m,h;if(c&&(c===void 0?`undefined`:_type_of(c))===`object`){var g=c,v=l;if(typeof g.offset==`number`){var y=this.fromOffset(g.offset);c=y.line,l=y.col}else c=g.line,l=g.column;if(typeof v.offset==`number`){var b=this.fromOffset(v.offset);m=b.line,h=b.col}else m=v.line,h=v.column}else if(!l){var x=this.fromOffset(c);c=x.line,l=x.col}var S=this.origin(c,l,m,h);return p=S?new pn(r,S.endLine===void 0?S.line:{column:S.column,line:S.line},S.endLine===void 0?S.column:{column:S.endColumn,line:S.endLine},S.source,S.file,u.plugin):new pn(r,m===void 0?c:{column:l,line:c},m===void 0?l:{column:h,line:m},this.css,this.file,u.plugin),p.input={column:l,endColumn:h,endLine:m,line:c,source:this.css},this.file&&(cn&&(p.input.url=cn(this.file).toString()),p.input.file=this.file),p},r.fromOffset=function fromOffset(r){var c,l;if(this[hn])l=this[hn];else{var u=this.css.split(` |
| 24 |
`);l=Array(u.length);for(var p=0,m=0,h=u.length;m<h;m++)l[m]=p,p+=u[m].length+1;this[hn]=l}c=l[l.length-1];var g=0;if(r>=c)g=l.length-1;else for(var v=l.length-2,y;g<v;)if(y=g+(v-g>>1),r<l[y])v=y-1;else if(r>=l[y+1])g=y+1;else{g=y;break}return{col:r-l[g]+1,line:g+1}},r.mapResolve=function mapResolve(r){return/^\w+:\/\//.test(r)?r:un(this.map.consumer().sourceRoot||this.map.root||`.`,r)},r.origin=function origin(r,c,l,u){if(!this.map)return!1;var p=this.map.consumer(),m=p.originalPositionFor({column:c,line:r});if(!m.source)return!1;var h;typeof l==`number`&&(h=p.originalPositionFor({column:u,line:l}));var g=ln(m.source)?cn(m.source):new URL(m.source,this.map.consumer().sourceRoot||cn(this.map.mapFile)),v={column:m.column,endColumn:h&&h.column,endLine:h&&h.line,line:m.line,url:g.toString()};if(g.protocol===`file:`)if(sn)v.file=sn(g);else throw Error(`file: protocol is not available in this PostCSS build`);var y=p.sourceContentFor(m.source);return y&&(v.source=y),v},r.toJSON=function toJSON(){for(var r={},c=0,l=[`hasBOM`,`css`,`file`,`id`];c<l.length;c++){var u=l[c];this[u]!=null&&(r[u]=this[u])}return this.map&&(r.map=_extends({},this.map),r.map.consumerCache&&(r.map.consumerCache=void 0)),r},_create_class(Input,[{key:`from`,get:function get(){return this.file||this.id}}]),Input}(),yn=vn;vn.default=vn,fn&&fn.registerInput&&fn.registerInput(vn);var bn=R.SourceMapConsumer,xn=R.SourceMapGenerator,Sn=R.dirname,Cn=R.relative,wn=R.resolve,Tn=R.sep,En=R.pathToFileURL,Dn=yn,On=!!(bn&&xn),kn=!!(Sn&&wn&&Cn&&Tn),An=function(){function MapGenerator(r,c,l,u){this.stringify=r,this.mapOpts=l.map||{},this.root=c,this.opts=l,this.css=u,this.originalCSS=u,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}var r=MapGenerator.prototype;return r.addAnnotation=function addAnnotation(){var r=this.isInline()?`data:application/json;base64,`+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation==`string`?this.mapOpts.annotation:typeof this.mapOpts.annotation==`function`?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+`.map`,c=` |
| 25 |
`;this.css.includes(`\r |
| 26 |
`)&&(c=`\r |
| 27 |
`),this.css+=c+`/*# sourceMappingURL=`+r+` */`},r.applyPrevMaps=function applyPrevMaps(){for(var r=_create_for_of_iterator_helper_loose(this.previous()),c;!(c=r()).done;){var l=c.value,u=this.toUrl(this.path(l.file)),p=l.root||Sn(l.file),m=void 0;this.mapOpts.sourcesContent===!1?(m=new bn(l.text),m.sourcesContent&&(m.sourcesContent=null)):m=l.consumer(),this.map.applySourceMap(m,u,this.toUrl(this.path(p)))}},r.clearAnnotation=function clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root)for(var r,c=this.root.nodes.length-1;c>=0;c--)r=this.root.nodes[c],r.type===`comment`&&r.text.indexOf(`# sourceMappingURL=`)===0&&this.root.removeChild(c);else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,``))},r.generate=function generate(){if(this.clearAnnotation(),kn&&On&&this.isMap())return this.generateMap();var r=``;return this.stringify(this.root,function(c){r+=c}),[r]},r.generateMap=function generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){var r=this.previous()[0].consumer();r.file=this.outputFile(),this.map=xn.fromSourceMap(r,{ignoreInvalidMapping:!0})}else this.map=new xn({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):`<no source>`});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]},r.generateString=function generateString(){var r=this;this.css=``,this.map=new xn({file:this.outputFile(),ignoreInvalidMapping:!0});var c=1,l=1,u=`<no source>`,p={generated:{column:0,line:0},original:{column:0,line:0},source:``},m,h;this.stringify(this.root,function(g,v,y){if(r.css+=g,v&&y!==`end`&&(p.generated.line=c,p.generated.column=l-1,v.source&&v.source.start?(p.source=r.sourcePath(v),p.original.line=v.source.start.line,p.original.column=v.source.start.column-1,r.map.addMapping(p)):(p.source=u,p.original.line=1,p.original.column=0,r.map.addMapping(p))),m=g.match(/\n/g),m?(c+=m.length,h=g.lastIndexOf(` |
| 28 |
`),l=g.length-h):l+=g.length,v&&y!==`start`){var b=v.parent||{raws:{}};(!(v.type===`decl`||v.type===`atrule`&&!v.nodes)||v!==b.last||b.raws.semicolon)&&(v.source&&v.source.end?(p.source=r.sourcePath(v),p.original.line=v.source.end.line,p.original.column=v.source.end.column-1,p.generated.line=c,p.generated.column=l-2,r.map.addMapping(p)):(p.source=u,p.original.line=1,p.original.column=0,p.generated.line=c,p.generated.column=l-1,r.map.addMapping(p)))}})},r.isAnnotation=function isAnnotation(){return this.isInline()?!0:this.mapOpts.annotation===void 0?!this.previous().length||this.previous().some(function(r){return r.annotation}):this.mapOpts.annotation},r.isInline=function isInline(){if(this.mapOpts.inline!==void 0)return this.mapOpts.inline;var r=this.mapOpts.annotation;return r!==void 0&&r!==!0?!1:!this.previous().length||this.previous().some(function(r){return r.inline})},r.isMap=function isMap(){return this.opts.map===void 0?this.previous().length>0:!!this.opts.map},r.isSourcesContent=function isSourcesContent(){return this.mapOpts.sourcesContent===void 0?!this.previous().length||this.previous().some(function(r){return r.withContent()}):this.mapOpts.sourcesContent},r.outputFile=function outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):`to.css`},r.path=function path(r){if(this.mapOpts.absolute||r.charCodeAt(0)===60||/^\w+:\/\//.test(r))return r;var c=this.memoizedPaths.get(r);if(c)return c;var l=this.opts.to?Sn(this.opts.to):`.`;typeof this.mapOpts.annotation==`string`&&(l=Sn(wn(l,this.mapOpts.annotation)));var u=Cn(l,r);return this.memoizedPaths.set(r,u),u},r.previous=function previous(){var r=this;if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(function(c){if(c.source&&c.source.input.map){var l=c.source.input.map;r.previousMaps.includes(l)||r.previousMaps.push(l)}});else{var c=new Dn(this.originalCSS,this.opts);c.map&&this.previousMaps.push(c.map)}return this.previousMaps},r.setSourcesContent=function setSourcesContent(){var r=this,c={};if(this.root)this.root.walk(function(l){if(l.source){var u=l.source.input.from;if(u&&!c[u]){c[u]=!0;var p=r.usesFileUrls?r.toFileUrl(u):r.toUrl(r.path(u));r.map.setSourceContent(p,l.source.input.css)}}});else if(this.css){var l=this.opts.from?this.toUrl(this.path(this.opts.from)):`<no source>`;this.map.setSourceContent(l,this.css)}},r.sourcePath=function sourcePath(r){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(r.source.input.from):this.toUrl(this.path(r.source.input.from))},r.toBase64=function toBase64(r){return Buffer?Buffer.from(r).toString(`base64`):window.btoa(unescape(encodeURIComponent(r)))},r.toFileUrl=function toFileUrl(r){var c=this.memoizedFileURLs.get(r);if(c)return c;if(En){var l=En(r).toString();return this.memoizedFileURLs.set(r,l),l}else throw Error("`map.absolute` option is not available in this PostCSS build")},r.toUrl=function toUrl(r){var c=this.memoizedURLs.get(r);if(c)return c;Tn===`\\`&&(r=r.replace(/\\/g,`/`));var l=encodeURI(r).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(r,l),l},MapGenerator}(),jn=function(r){_inherits(Comment,r);function Comment(c){var l=r.call(this,c)||this;return l.type=`comment`,l}return Comment}(Wt),Mn=jn;jn.default=jn;var Nn=Mt.isClean,Pn=Mt.my,Fn=Kt,In=Mn,Ln=Wt,Rn,zn,Bn,Vn;function cleanSource$1(r){return r.map(function(r){return r.nodes&&(r.nodes=cleanSource$1(r.nodes)),delete r.source,r})}function markDirtyUp$1(r){if(r[Nn]=!1,r.proxyOf.nodes)for(var c=_create_for_of_iterator_helper_loose(r.proxyOf.nodes),l;!(l=c()).done;){var u=l.value;markDirtyUp$1(u)}}var Hn=function(r){_inherits(Container,r);function Container(){return r.apply(this,arguments)||this}var c=Container.prototype;return c.append=function append(){for(var r=arguments.length,c=Array(r),l=0;l<r;l++)c[l]=arguments[l];for(var u=_create_for_of_iterator_helper_loose(c),p;!(p=u()).done;)for(var m=p.value,h=_create_for_of_iterator_helper_loose(this.normalize(m,this.last)),g;!(g=h()).done;){var v=g.value;this.proxyOf.nodes.push(v)}return this.markDirty(),this},c.cleanRaws=function cleanRaws(c){if(r.prototype.cleanRaws.call(this,c),this.nodes)for(var l=_create_for_of_iterator_helper_loose(this.nodes),u;!(u=l()).done;)u.value.cleanRaws(c)},c.each=function each(r){if(this.proxyOf.nodes){for(var c=this.getIterator(),l,u;this.indexes[c]<this.proxyOf.nodes.length&&(l=this.indexes[c],u=r(this.proxyOf.nodes[l],l),u!==!1);)this.indexes[c]+=1;return delete this.indexes[c],u}},c.every=function every(r){return this.nodes.every(r)},c.getIterator=function getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;var r=this.lastEach;return this.indexes[r]=0,r},c.getProxyProcessor=function getProxyProcessor(){return{get:function get(r,c){return c===`proxyOf`?r:r[c]?c===`each`||typeof c==`string`&&c.startsWith(`walk`)?function(){for(var l=arguments.length,u=Array(l),p=0;p<l;p++)u[p]=arguments[p];var m;return(m=r)[c].apply(m,[].concat(u.map(function(r){return typeof r==`function`?function(c,l){return r(c.toProxy(),l)}:r})))}:c===`every`||c===`some`?function(l){return r[c](function(r){for(var c=arguments.length,u=Array(c>1?c-1:0),p=1;p<c;p++)u[p-1]=arguments[p];return l.apply(void 0,[r.toProxy()].concat(u))})}:c===`root`?function(){return r.root().toProxy()}:c===`nodes`?r.nodes.map(function(r){return r.toProxy()}):c===`first`||c===`last`?r[c].toProxy():r[c]:r[c]},set:function set(r,c,l){return r[c]===l?!0:(r[c]=l,(c===`name`||c===`params`||c===`selector`)&&r.markDirty(),!0)}}},c.index=function index(r){return typeof r==`number`?r:(r.proxyOf&&(r=r.proxyOf),this.proxyOf.nodes.indexOf(r))},c.insertAfter=function insertAfter(r,c){var l=this.index(r),u=this.normalize(c,this.proxyOf.nodes[l]).reverse();l=this.index(r);for(var p=_create_for_of_iterator_helper_loose(u),m;!(m=p()).done;){var h=m.value;this.proxyOf.nodes.splice(l+1,0,h)}var g;for(var v in this.indexes)g=this.indexes[v],l<g&&(this.indexes[v]=g+u.length);return this.markDirty(),this},c.insertBefore=function insertBefore(r,c){var l=this.index(r),u=l===0&&`prepend`,p=this.normalize(c,this.proxyOf.nodes[l],u).reverse();l=this.index(r);for(var m=_create_for_of_iterator_helper_loose(p),h;!(h=m()).done;){var g=h.value;this.proxyOf.nodes.splice(l,0,g)}var v;for(var y in this.indexes)v=this.indexes[y],l<=v&&(this.indexes[y]=v+p.length);return this.markDirty(),this},c.normalize=function normalize(r,c){var l=this;if(typeof r==`string`)r=cleanSource$1(Rn(r).nodes);else if(r===void 0)r=[];else if(Array.isArray(r)){r=r.slice(0);for(var u=_create_for_of_iterator_helper_loose(r),p;!(p=u()).done;){var m=p.value;m.parent&&m.parent.removeChild(m,`ignore`)}}else if(r.type===`root`&&this.type!==`document`){r=r.nodes.slice(0);for(var h=_create_for_of_iterator_helper_loose(r),g;!(g=h()).done;){var v=g.value;v.parent&&v.parent.removeChild(v,`ignore`)}}else if(r.type)r=[r];else if(r.prop){if(r.value===void 0)throw Error(`Value field is missed in node creation`);typeof r.value!=`string`&&(r.value=String(r.value)),r=[new Fn(r)]}else if(r.selector)r=[new zn(r)];else if(r.name)r=[new Bn(r)];else if(r.text)r=[new In(r)];else throw Error(`Unknown node type in node creation`);return r.map(function(r){return r[Pn]||Container.rebuild(r),r=r.proxyOf,r.parent&&r.parent.removeChild(r),r[Nn]&&markDirtyUp$1(r),r.raws.before===void 0&&c&&c.raws.before!==void 0&&(r.raws.before=c.raws.before.replace(/\S/g,``)),r.parent=l.proxyOf,r})},c.prepend=function prepend(){for(var r=arguments.length,c=Array(r),l=0;l<r;l++)c[l]=arguments[l];c=c.reverse();for(var u=_create_for_of_iterator_helper_loose(c),p;!(p=u()).done;){for(var m=p.value,h=this.normalize(m,this.first,`prepend`).reverse(),g=_create_for_of_iterator_helper_loose(h),v;!(v=g()).done;){var y=v.value;this.proxyOf.nodes.unshift(y)}for(var b in this.indexes)this.indexes[b]=this.indexes[b]+h.length}return this.markDirty(),this},c.push=function push(r){return r.parent=this,this.proxyOf.nodes.push(r),this},c.removeAll=function removeAll(){for(var r=_create_for_of_iterator_helper_loose(this.proxyOf.nodes),c;!(c=r()).done;){var l=c.value;l.parent=void 0}return this.proxyOf.nodes=[],this.markDirty(),this},c.removeChild=function removeChild(r){r=this.index(r),this.proxyOf.nodes[r].parent=void 0,this.proxyOf.nodes.splice(r,1);var c;for(var l in this.indexes)c=this.indexes[l],c>=r&&(this.indexes[l]=c-1);return this.markDirty(),this},c.replaceValues=function replaceValues(r,c,l){return l||(l=c,c={}),this.walkDecls(function(u){c.props&&!c.props.includes(u.prop)||c.fast&&!u.value.includes(c.fast)||(u.value=u.value.replace(r,l))}),this.markDirty(),this},c.some=function some(r){return this.nodes.some(r)},c.walk=function walk(r){return this.each(function(c,l){var u;try{u=r(c,l)}catch(r){throw c.addToError(r)}return u!==!1&&c.walk&&(u=c.walk(r)),u})},c.walkAtRules=function walkAtRules(r,c){return c?_instanceof(r,RegExp)?this.walk(function(l,u){if(l.type===`atrule`&&r.test(l.name))return c(l,u)}):this.walk(function(l,u){if(l.type===`atrule`&&l.name===r)return c(l,u)}):(c=r,this.walk(function(r,l){if(r.type===`atrule`)return c(r,l)}))},c.walkComments=function walkComments(r){return this.walk(function(c,l){if(c.type===`comment`)return r(c,l)})},c.walkDecls=function walkDecls(r,c){return c?_instanceof(r,RegExp)?this.walk(function(l,u){if(l.type===`decl`&&r.test(l.prop))return c(l,u)}):this.walk(function(l,u){if(l.type===`decl`&&l.prop===r)return c(l,u)}):(c=r,this.walk(function(r,l){if(r.type===`decl`)return c(r,l)}))},c.walkRules=function walkRules(r,c){return c?_instanceof(r,RegExp)?this.walk(function(l,u){if(l.type===`rule`&&r.test(l.selector))return c(l,u)}):this.walk(function(l,u){if(l.type===`rule`&&l.selector===r)return c(l,u)}):(c=r,this.walk(function(r,l){if(r.type===`rule`)return c(r,l)}))},_create_class(Container,[{key:`first`,get:function get(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}},{key:`last`,get:function get(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}]),Container}(Ln);Hn.registerParse=function(r){Rn=r},Hn.registerRule=function(r){zn=r},Hn.registerAtRule=function(r){Bn=r},Hn.registerRoot=function(r){Vn=r};var Un=Hn;Hn.default=Hn,Hn.rebuild=function(r){r.type===`atrule`?Object.setPrototypeOf(r,Bn.prototype):r.type===`rule`?Object.setPrototypeOf(r,zn.prototype):r.type===`decl`?Object.setPrototypeOf(r,Fn.prototype):r.type===`comment`?Object.setPrototypeOf(r,In.prototype):r.type===`root`&&Object.setPrototypeOf(r,Vn.prototype),r[Pn]=!0,r.nodes&&r.nodes.forEach(function(r){Hn.rebuild(r)})};var Wn=Un,Gn,Kn,qn=function(r){_inherits(Document2,r);function Document2(c){var l=r.call(this,_extends({type:`document`},c))||this;return l.nodes||(l.nodes=[]),l}var c=Document2.prototype;return c.toResult=function toResult(r){return r===void 0&&(r={}),new Gn(new Kn,this,r).stringify()},Document2}(Wn);qn.registerLazyResult=function(r){Gn=r},qn.registerProcessor=function(r){Kn=r};var Jn=qn;qn.default=qn;var Yn=function(){function Warning(r,c){if(c===void 0&&(c={}),this.type=`warning`,this.text=r,c.node&&c.node.source){var l=c.node.rangeBy(c);this.line=l.start.line,this.column=l.start.column,this.endLine=l.end.line,this.endColumn=l.end.column}for(var u in c)this[u]=c[u]}var r=Warning.prototype;return r.toString=function toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+`: `+this.text:this.text},Warning}(),Xn=Yn;Yn.default=Yn;var Zn=Xn,Qn=function(){function Result(r,c,l){this.processor=r,this.messages=[],this.root=c,this.opts=l,this.css=void 0,this.map=void 0}var r=Result.prototype;return r.toString=function toString(){return this.css},r.warn=function warn(r,c){c===void 0&&(c={}),c.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(c.plugin=this.lastPlugin.postcssPlugin);var l=new Zn(r,c);return this.messages.push(l),l},r.warnings=function warnings(){return this.messages.filter(function(r){return r.type===`warning`})},_create_class(Result,[{key:`content`,get:function get(){return this.css}}]),Result}(),$n=Qn;Qn.default=Qn;var er=39,tr=34,nr=92,rr=47,ir=10,ar=32,or=12,sr=9,cr=13,lr=91,ur=93,dr=40,fr=41,pr=123,mr=125,hr=59,gr=42,_r=58,vr=64,yr=/[\t\n\f\r "#'()/;[\\\]{}]/g,br=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,xr=/.[\r\n"'(/\\]/,Sr=/[\da-f]/i,Cr=function tokenizer(r,c){c===void 0&&(c={});var l=r.css.valueOf(),u=c.ignoreErrors,p,m,h,g,v,y,b,x,S,C,w=l.length,T=0,E=[],D=[];function position(){return T}function unclosed(c){throw r.error(`Unclosed `+c,T)}function endOfFile(){return D.length===0&&T>=w}function nextToken(r){if(D.length)return D.pop();if(!(T>=w)){var c=r?r.ignoreUnclosed:!1;switch(p=l.charCodeAt(T),p){case ir:case ar:case sr:case cr:case or:m=T;do m+=1,p=l.charCodeAt(m);while(p===ar||p===ir||p===sr||p===cr||p===or);C=[`space`,l.slice(T,m)],T=m-1;break;case lr:case ur:case pr:case mr:case _r:case hr:case fr:var O=String.fromCharCode(p);C=[O,O,T];break;case dr:if(x=E.length?E.pop()[1]:``,S=l.charCodeAt(T+1),x===`url`&&S!==er&&S!==tr&&S!==ar&&S!==ir&&S!==sr&&S!==or&&S!==cr){m=T;do{if(y=!1,m=l.indexOf(`)`,m+1),m===-1)if(u||c){m=T;break}else unclosed(`bracket`);for(b=m;l.charCodeAt(b-1)===nr;)--b,y=!y}while(y);C=[`brackets`,l.slice(T,m+1),T,m],T=m}else m=l.indexOf(`)`,T+1),g=l.slice(T,m+1),m===-1||xr.test(g)?C=[`(`,`(`,T]:(C=[`brackets`,g,T,m],T=m);break;case er:case tr:h=p===er?`'`:`"`,m=T;do{if(y=!1,m=l.indexOf(h,m+1),m===-1)if(u||c){m=T+1;break}else unclosed(`string`);for(b=m;l.charCodeAt(b-1)===nr;)--b,y=!y}while(y);C=[`string`,l.slice(T,m+1),T,m],T=m;break;case vr:yr.lastIndex=T+1,yr.test(l),m=yr.lastIndex===0?l.length-1:yr.lastIndex-2,C=[`at-word`,l.slice(T,m+1),T,m],T=m;break;case nr:for(m=T,v=!0;l.charCodeAt(m+1)===nr;)m+=1,v=!v;if(p=l.charCodeAt(m+1),v&&p!==rr&&p!==ar&&p!==ir&&p!==sr&&p!==cr&&p!==or&&(m+=1,Sr.test(l.charAt(m)))){for(;Sr.test(l.charAt(m+1));)m+=1;l.charCodeAt(m+1)===ar&&(m+=1)}C=[`word`,l.slice(T,m+1),T,m],T=m;break;default:p===rr&&l.charCodeAt(T+1)===gr?(m=l.indexOf(`*/`,T+2)+1,m===0&&(u||c?m=l.length:unclosed(`comment`)),C=[`comment`,l.slice(T,m+1),T,m],T=m):(br.lastIndex=T+1,br.test(l),m=br.lastIndex===0?l.length-1:br.lastIndex-2,C=[`word`,l.slice(T,m+1),T,m],E.push(C),T=m);break}return T++,C}}function back(r){D.push(r)}return{back,endOfFile,nextToken,position}},wr=Un,Tr=function(r){_inherits(AtRule,r);function AtRule(c){var l=r.call(this,c)||this;return l.type=`atrule`,l}var c=AtRule.prototype;return c.append=function append(){for(var c=arguments.length,l=Array(c),u=0;u<c;u++)l[u]=arguments[u];var p;return this.proxyOf.nodes||(this.nodes=[]),(p=r.prototype.append).call.apply(p,[this].concat(l))},c.prepend=function prepend(){for(var c=arguments.length,l=Array(c),u=0;u<c;u++)l[u]=arguments[u];var p;return this.proxyOf.nodes||(this.nodes=[]),(p=r.prototype.prepend).call.apply(p,[this].concat(l))},AtRule}(wr),Er=Tr;Tr.default=Tr,wr.registerAtRule(Tr);var Dr=Un,Or,kr,Ar=function(r){_inherits(Root,r);function Root(c){var l=r.call(this,c)||this;return l.type=`root`,l.nodes||(l.nodes=[]),l}var c=Root.prototype;return c.normalize=function normalize(c,l,u){var p=r.prototype.normalize.call(this,c);if(l){if(u===`prepend`)this.nodes.length>1?l.raws.before=this.nodes[1].raws.before:delete l.raws.before;else if(this.first!==l)for(var m=_create_for_of_iterator_helper_loose(p),h;!(h=m()).done;){var g=h.value;g.raws.before=l.raws.before}}return p},c.removeChild=function removeChild(c,l){var u=this.index(c);return!l&&u===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[u].raws.before),r.prototype.removeChild.call(this,c)},c.toResult=function toResult(r){return r===void 0&&(r={}),new Or(new kr,this,r).stringify()},Root}(Dr);Ar.registerLazyResult=function(r){Or=r},Ar.registerProcessor=function(r){kr=r};var jr=Ar;Ar.default=Ar,Dr.registerRoot(Ar);var Mr={comma:function comma(r){return Mr.split(r,[`,`],!0)},space:function space(r){return Mr.split(r,[` `,` |
| 29 |
`,` `])},split:function split(r,c,l){for(var u=[],p=``,m=!1,h=0,g=!1,v=``,y=!1,b=_create_for_of_iterator_helper_loose(r),x;!(x=b()).done;){var S=x.value;y?y=!1:S===`\\`?y=!0:g?S===v&&(g=!1):S===`"`||S===`'`?(g=!0,v=S):S===`(`?h+=1:S===`)`?h>0&&--h:h===0&&c.includes(S)&&(m=!0),m?(p!==``&&u.push(p.trim()),p=``,m=!1):p+=S}return(l||p!==``)&&u.push(p.trim()),u}},Nr=Mr;Mr.default=Mr;var Pr=Un,Fr=Nr,Ir=function(r){_inherits(Rule,r);function Rule(c){var l=r.call(this,c)||this;return l.type=`rule`,l.nodes||(l.nodes=[]),l}return _create_class(Rule,[{key:`selectors`,get:function get(){return Fr.comma(this.selector)},set:function set(r){var c=this.selector?this.selector.match(/,\s*/):null,l=c?c[0]:`,`+this.raw(`between`,`beforeOpen`);this.selector=r.join(l)}}]),Rule}(Pr),Lr=Ir;Ir.default=Ir,Pr.registerRule(Ir);var Rr=Kt,zr=Cr,Br=Mn,Vr=Er,Hr=jr,Ur=Lr,Wr={empty:!0,space:!0};function findLastWithPosition$1(r){for(var c=r.length-1;c>=0;c--){var l=r[c],u=l[3]||l[2];if(u)return u}}var Gr=function(){function Parser(r){this.input=r,this.root=new Hr,this.current=this.root,this.spaces=``,this.semicolon=!1,this.createTokenizer(),this.root.source={input:r,start:{column:1,line:1,offset:0}}}var r=Parser.prototype;return r.atrule=function atrule(r){var c=new Vr;c.name=r[1].slice(1),c.name===``&&this.unnamedAtrule(c,r),this.init(c,r[2]);for(var l,u,p,m=!1,h=!1,g=[],v=[];!this.tokenizer.endOfFile();){if(r=this.tokenizer.nextToken(),l=r[0],l===`(`||l===`[`?v.push(l===`(`?`)`:`]`):l===`{`&&v.length>0?v.push(`}`):l===v[v.length-1]&&v.pop(),v.length===0)if(l===`;`){c.source.end=this.getPosition(r[2]),c.source.end.offset++,this.semicolon=!0;break}else if(l===`{`){h=!0;break}else if(l===`}`){if(g.length>0){for(p=g.length-1,u=g[p];u&&u[0]===`space`;)u=g[--p];u&&(c.source.end=this.getPosition(u[3]||u[2]),c.source.end.offset++)}this.end(r);break}else g.push(r);else g.push(r);if(this.tokenizer.endOfFile()){m=!0;break}}c.raws.between=this.spacesAndCommentsFromEnd(g),g.length?(c.raws.afterName=this.spacesAndCommentsFromStart(g),this.raw(c,`params`,g),m&&(r=g[g.length-1],c.source.end=this.getPosition(r[3]||r[2]),c.source.end.offset++,this.spaces=c.raws.between,c.raws.between=``)):(c.raws.afterName=``,c.params=``),h&&(c.nodes=[],this.current=c)},r.checkMissedSemicolon=function checkMissedSemicolon(r){var c=this.colon(r);if(c!==!1){for(var l=0,u,p=c-1;p>=0&&(u=r[p],!(u[0]!==`space`&&(l+=1,l===2)));p--);throw this.input.error(`Missed semicolon`,u[0]===`word`?u[3]+1:u[2])}},r.colon=function colon(r){for(var c=0,l,u,p,m=_create_for_of_iterator_helper_loose(r.entries()),h;!(h=m()).done;){var g=h.value,v=g[0];if(l=g[1],u=l[0],u===`(`&&(c+=1),u===`)`&&--c,c===0&&u===`:`)if(!p)this.doubleColon(l);else if(p[0]===`word`&&p[1]===`progid`)continue;else return v;p=l}return!1},r.comment=function comment(r){var c=new Br;this.init(c,r[2]),c.source.end=this.getPosition(r[3]||r[2]),c.source.end.offset++;var l=r[1].slice(2,-2);if(/^\s*$/.test(l))c.text=``,c.raws.left=l,c.raws.right=``;else{var u=l.match(/^(\s*)([^]*\S)(\s*)$/);c.text=u[2],c.raws.left=u[1],c.raws.right=u[3]}},r.createTokenizer=function createTokenizer(){this.tokenizer=zr(this.input)},r.decl=function decl(r,c){var l=new Rr;this.init(l,r[0][2]);var u=r[r.length-1];for(u[0]===`;`&&(this.semicolon=!0,r.pop()),l.source.end=this.getPosition(u[3]||u[2]||findLastWithPosition$1(r)),l.source.end.offset++;r[0][0]!==`word`;)r.length===1&&this.unknownWord(r),l.raws.before+=r.shift()[1];for(l.source.start=this.getPosition(r[0][2]),l.prop=``;r.length;){var p=r[0][0];if(p===`:`||p===`space`||p===`comment`)break;l.prop+=r.shift()[1]}l.raws.between=``;for(var m;r.length;)if(m=r.shift(),m[0]===`:`){l.raws.between+=m[1];break}else m[0]===`word`&&/\w/.test(m[1])&&this.unknownWord([m]),l.raws.between+=m[1];(l.prop[0]===`_`||l.prop[0]===`*`)&&(l.raws.before+=l.prop[0],l.prop=l.prop.slice(1));for(var h=[],g;r.length&&(g=r[0][0],g===`space`||g===`comment`);)h.push(r.shift());this.precheckMissedSemicolon(r);for(var v=r.length-1;v>=0;v--){if(m=r[v],m[1].toLowerCase()===`!important`){l.important=!0;var y=this.stringFrom(r,v);y=this.spacesFromEnd(r)+y,y!==` !important`&&(l.raws.important=y);break}else if(m[1].toLowerCase()===`important`){for(var b=r.slice(0),x=``,S=v;S>0;S--){var C=b[S][0];if(x.trim().indexOf(`!`)===0&&C!==`space`)break;x=b.pop()[1]+x}x.trim().indexOf(`!`)===0&&(l.important=!0,l.raws.important=x,r=b)}if(m[0]!==`space`&&m[0]!==`comment`)break}r.some(function(r){return r[0]!==`space`&&r[0]!==`comment`})&&(l.raws.between+=h.map(function(r){return r[1]}).join(``),h=[]),this.raw(l,`value`,h.concat(r),c),l.value.includes(`:`)&&!c&&this.checkMissedSemicolon(r)},r.doubleColon=function doubleColon(r){throw this.input.error(`Double colon`,{offset:r[2]},{offset:r[2]+r[1].length})},r.emptyRule=function emptyRule(r){var c=new Ur;this.init(c,r[2]),c.selector=``,c.raws.between=``,this.current=c},r.end=function end(r){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||``)+this.spaces,this.spaces=``,this.current.parent?(this.current.source.end=this.getPosition(r[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(r)},r.endFile=function endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||``)+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())},r.freeSemicolon=function freeSemicolon(r){if(this.spaces+=r[1],this.current.nodes){var c=this.current.nodes[this.current.nodes.length-1];c&&c.type===`rule`&&!c.raws.ownSemicolon&&(c.raws.ownSemicolon=this.spaces,this.spaces=``)}},r.getPosition=function getPosition(r){var c=this.input.fromOffset(r);return{column:c.col,line:c.line,offset:r}},r.init=function init(r,c){this.current.push(r),r.source={input:this.input,start:this.getPosition(c)},r.raws.before=this.spaces,this.spaces=``,r.type!==`comment`&&(this.semicolon=!1)},r.other=function other(r){for(var c=!1,l=null,u=!1,p=null,m=[],h=r[1].startsWith(`--`),g=[],v=r;v;){if(l=v[0],g.push(v),l===`(`||l===`[`)p||(p=v),m.push(l===`(`?`)`:`]`);else if(h&&u&&l===`{`)p||(p=v),m.push(`}`);else if(m.length===0)if(l===`;`)if(u){this.decl(g,h);return}else break;else if(l===`{`){this.rule(g);return}else if(l===`}`){this.tokenizer.back(g.pop()),c=!0;break}else l===`:`&&(u=!0);else l===m[m.length-1]&&(m.pop(),m.length===0&&(p=null));v=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(c=!0),m.length>0&&this.unclosedBracket(p),c&&u){if(!h)for(;g.length&&(v=g[g.length-1][0],v===`space`||v===`comment`);)this.tokenizer.back(g.pop());this.decl(g,h)}else this.unknownWord(g)},r.parse=function parse(){for(var r;!this.tokenizer.endOfFile();)switch(r=this.tokenizer.nextToken(),r[0]){case`space`:this.spaces+=r[1];break;case`;`:this.freeSemicolon(r);break;case`}`:this.end(r);break;case`comment`:this.comment(r);break;case`at-word`:this.atrule(r);break;case`{`:this.emptyRule(r);break;default:this.other(r);break}this.endFile()},r.precheckMissedSemicolon=function precheckMissedSemicolon(){},r.raw=function raw(r,c,l,u){for(var p,m,h=l.length,g=``,v=!0,y,b,x=0;x<h;x+=1)p=l[x],m=p[0],m===`space`&&x===h-1&&!u?v=!1:m===`comment`?(b=l[x-1]?l[x-1][0]:`empty`,y=l[x+1]?l[x+1][0]:`empty`,!Wr[b]&&!Wr[y]?g.slice(-1)===`,`?v=!1:g+=p[1]:v=!1):g+=p[1];if(!v){var S=l.reduce(function(r,c){return r+c[1]},``);r.raws[c]={raw:S,value:g}}r[c]=g},r.rule=function rule(r){r.pop();var c=new Ur;this.init(c,r[0][2]),c.raws.between=this.spacesAndCommentsFromEnd(r),this.raw(c,`selector`,r),this.current=c},r.spacesAndCommentsFromEnd=function spacesAndCommentsFromEnd(r){for(var c,l=``;r.length&&(c=r[r.length-1][0],c===`space`||c===`comment`);)l=r.pop()[1]+l;return l},r.spacesAndCommentsFromStart=function spacesAndCommentsFromStart(r){for(var c,l=``;r.length&&(c=r[0][0],c===`space`||c===`comment`);)l+=r.shift()[1];return l},r.spacesFromEnd=function spacesFromEnd(r){for(var c,l=``;r.length&&(c=r[r.length-1][0],c===`space`);)l=r.pop()[1]+l;return l},r.stringFrom=function stringFrom(r,c){for(var l=``,u=c;u<r.length;u++)l+=r[u][1];return r.splice(c,r.length-c),l},r.unclosedBlock=function unclosedBlock(){var r=this.current.source.start;throw this.input.error(`Unclosed block`,r.line,r.column)},r.unclosedBracket=function unclosedBracket(r){throw this.input.error(`Unclosed bracket`,{offset:r[2]},{offset:r[2]+1})},r.unexpectedClose=function unexpectedClose(r){throw this.input.error(`Unexpected }`,{offset:r[2]},{offset:r[2]+1})},r.unknownWord=function unknownWord(r){throw this.input.error(`Unknown word`,{offset:r[0][2]},{offset:r[0][2]+r[0][1].length})},r.unnamedAtrule=function unnamedAtrule(r,c){throw this.input.error(`At-rule without name`,{offset:c[2]},{offset:c[2]+c[1].length})},Parser}(),Kr=Un,qr=Gr,Jr=yn;function parse$3$1(r,c){var l=new qr(new Jr(r,c));try{l.parse()}catch(r){throw r}return l.root}var Yr=parse$3$1;parse$3$1.default=parse$3$1,Kr.registerParse(parse$3$1);var Xr=Mt.isClean,Zr=Mt.my,Qr=An,$r=Lt,ei=Un,ti=Jn,ni=$n,ri=Yr,ii=jr,ai={atrule:`AtRule`,comment:`Comment`,decl:`Declaration`,document:`Document`,root:`Root`,rule:`Rule`},oi={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},si={Once:!0,postcssPlugin:!0,prepare:!0},ci=0;function isPromise$1(r){return(r===void 0?`undefined`:_type_of(r))===`object`&&typeof r.then==`function`}function getEvents$1(r){var c=!1,l=ai[r.type];return r.type===`decl`?c=r.prop.toLowerCase():r.type===`atrule`&&(c=r.name.toLowerCase()),c&&r.append?[l,l+`-`+c,ci,l+`Exit`,l+`Exit-`+c]:c?[l,l+`-`+c,l+`Exit`,l+`Exit-`+c]:r.append?[l,ci,l+`Exit`]:[l,l+`Exit`]}function toStack$1(r){return{eventIndex:0,events:r.type===`document`?[`Document`,ci,`DocumentExit`]:r.type===`root`?[`Root`,ci,`RootExit`]:getEvents$1(r),iterator:0,node:r,visitorIndex:0,visitors:[]}}function cleanMarks$1(r){return r[Xr]=!1,r.nodes&&r.nodes.forEach(function(r){return cleanMarks$1(r)}),r}var li={},di=function(){function LazyResult(r,c,l){var u=this;this.stringified=!1,this.processed=!1;var p;if((c===void 0?`undefined`:_type_of(c))===`object`&&c!==null&&(c.type===`root`||c.type===`document`))p=cleanMarks$1(c);else if(_instanceof(c,LazyResult)||_instanceof(c,ni))p=cleanMarks$1(c.root),c.map&&(l.map===void 0&&(l.map={}),l.map.inline||(l.map.inline=!1),l.map.prev=c.map);else{var m=ri;l.syntax&&(m=l.syntax.parse),l.parser&&(m=l.parser),m.parse&&(m=m.parse);try{p=m(c,l)}catch(r){this.processed=!0,this.error=r}p&&!p[Zr]&&ei.rebuild(p)}this.result=new ni(r,p,l),this.helpers=_extends({},li,{postcss:li,result:this.result}),this.plugins=this.processor.plugins.map(function(r){return(r===void 0?`undefined`:_type_of(r))===`object`&&r.prepare?_extends({},r,r.prepare(u.result)):r})}var r=LazyResult.prototype;return r.async=function async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)},r.catch=function _catch(r){return this.async().catch(r)},r.finally=function _finally(r){return this.async().then(r,r)},r.getAsyncError=function getAsyncError(){throw Error(`Use process(css).then(cb) to work with async plugins`)},r.handleError=function handleError(r,c){var l=this.result.lastPlugin;try{c&&c.addToError(r),this.error=r,r.name===`CssSyntaxError`&&!r.plugin?(r.plugin=l.postcssPlugin,r.setMessage()):l.postcssVersion}catch(r){console&&console.error&&console.error(r)}return r},r.prepareVisitors=function prepareVisitors(){var r=this;this.listeners={};for(var add=function(c,l,u){r.listeners[l]||(r.listeners[l]=[]),r.listeners[l].push([c,u])},c=_create_for_of_iterator_helper_loose(this.plugins),l;!(l=c()).done;){var u=l.value;if((u===void 0?`undefined`:_type_of(u))===`object`)for(var p in u){if(!oi[p]&&/^[A-Z]/.test(p))throw Error(`Unknown event `+p+` in `+u.postcssPlugin+`. Try to update PostCSS (`+this.processor.version+` now).`);if(!si[p])if(_type_of(u[p])===`object`)for(var m in u[p])m===`*`?add(u,p,u[p][m]):add(u,p+`-`+m.toLowerCase(),u[p][m]);else typeof u[p]==`function`&&add(u,p,u[p])}}this.hasListener=Object.keys(this.listeners).length>0},r.runAsync=function runAsync(){var r=this;return _async_to_generator(function(){var c,l,u,p,m,h,g,v,y,_loop,b,x;return _ts_generator(this,function(S){switch(S.label){case 0:r.plugin=0,c=0,S.label=1;case 1:if(!(c<r.plugins.length))return[3,6];if(l=r.plugins[c],u=r.runOnRoot(l),!isPromise$1(u))return[3,5];S.label=2;case 2:return S.trys.push([2,4,,5]),[4,u];case 3:return S.sent(),[3,5];case 4:throw p=S.sent(),r.handleError(p);case 5:return c++,[3,1];case 6:if(r.prepareVisitors(),!r.hasListener)return[3,18];m=r.result.root,S.label=7;case 7:if(m[Xr])return[3,14];m[Xr]=!0,h=[toStack$1(m)],S.label=8;case 8:if(!(h.length>0))return[3,13];if(g=r.visitTick(h),!isPromise$1(g))return[3,12];S.label=9;case 9:return S.trys.push([9,11,,12]),[4,g];case 10:return S.sent(),[3,12];case 11:throw v=S.sent(),y=h[h.length-1].node,r.handleError(v,y);case 12:return[3,8];case 13:return[3,7];case 14:if(!r.listeners.OnceExit)return[3,18];_loop=function(){var c,l,u,p,h;return _ts_generator(this,function(g){switch(g.label){case 0:c=x.value,l=c[0],u=c[1],r.result.lastPlugin=l,g.label=1;case 1:return g.trys.push([1,6,,7]),m.type===`document`?(p=m.nodes.map(function(c){return u(c,r.helpers)}),[4,Promise.all(p)]):[3,3];case 2:return g.sent(),[3,5];case 3:return[4,u(m,r.helpers)];case 4:g.sent(),g.label=5;case 5:return[3,7];case 6:throw h=g.sent(),r.handleError(h);case 7:return[2]}})},b=_create_for_of_iterator_helper_loose(r.listeners.OnceExit),S.label=15;case 15:return(x=b()).done?[3,18]:[5,_ts_values(_loop())];case 16:S.sent(),S.label=17;case 17:return[3,15];case 18:return r.processed=!0,[2,r.stringify()]}})})()},r.runOnRoot=function runOnRoot(r){var c=this;this.result.lastPlugin=r;try{if((r===void 0?`undefined`:_type_of(r))===`object`&&r.Once){if(this.result.root.type===`document`){var l=this.result.root.nodes.map(function(l){return r.Once(l,c.helpers)});return isPromise$1(l[0])?Promise.all(l):l}return r.Once(this.result.root,this.helpers)}else if(typeof r==`function`)return r(this.result.root,this.result)}catch(r){throw this.handleError(r)}},r.stringify=function stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();var r=this.result.opts,c=$r;r.syntax&&(c=r.syntax.stringify),r.stringifier&&(c=r.stringifier),c.stringify&&(c=c.stringify);var l=new Qr(c,this.result.root,this.result.opts).generate();return this.result.css=l[0],this.result.map=l[1],this.result},r.sync=function sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(var r=_create_for_of_iterator_helper_loose(this.plugins),c;!(c=r()).done;){var l=c.value;if(isPromise$1(this.runOnRoot(l)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){for(var u=this.result.root;!u[Xr];)u[Xr]=!0,this.walkSync(u);if(this.listeners.OnceExit)if(u.type===`document`)for(var p=_create_for_of_iterator_helper_loose(u.nodes),m;!(m=p()).done;){var h=m.value;this.visitSync(this.listeners.OnceExit,h)}else this.visitSync(this.listeners.OnceExit,u)}return this.result},r.then=function then(r,c){return this.async().then(r,c)},r.toString=function toString(){return this.css},r.visitSync=function visitSync(r,c){for(var l=_create_for_of_iterator_helper_loose(r),u;!(u=l()).done;){var p=u.value,m=p[0],h=p[1];this.result.lastPlugin=m;var g=void 0;try{g=h(c,this.helpers)}catch(r){throw this.handleError(r,c.proxyOf)}if(c.type!==`root`&&c.type!==`document`&&!c.parent)return!0;if(isPromise$1(g))throw this.getAsyncError()}},r.visitTick=function visitTick(r){var c=r[r.length-1],l=c.node,u=c.visitors;if(l.type!==`root`&&l.type!==`document`&&!l.parent){r.pop();return}if(u.length>0&&c.visitorIndex<u.length){var p=u[c.visitorIndex],m=p[0],h=p[1];c.visitorIndex+=1,c.visitorIndex===u.length&&(c.visitors=[],c.visitorIndex=0),this.result.lastPlugin=m;try{return h(l.toProxy(),this.helpers)}catch(r){throw this.handleError(r,l)}}if(c.iterator!==0){for(var g=c.iterator,v;v=l.nodes[l.indexes[g]];)if(l.indexes[g]+=1,!v[Xr]){v[Xr]=!0,r.push(toStack$1(v));return}c.iterator=0,delete l.indexes[g]}for(var y=c.events;c.eventIndex<y.length;){var b=y[c.eventIndex];if(c.eventIndex+=1,b===ci){l.nodes&&l.nodes.length&&(l[Xr]=!0,c.iterator=l.getIterator());return}else if(this.listeners[b]){c.visitors=this.listeners[b];return}}r.pop()},r.walkSync=function walkSync(r){var c=this;r[Xr]=!0;for(var l=_create_for_of_iterator_helper_loose(getEvents$1(r)),u;!(u=l()).done;){var p=u.value;if(p===ci)r.nodes&&r.each(function(r){r[Xr]||c.walkSync(r)});else{var m=this.listeners[p];if(m&&this.visitSync(m,r.toProxy()))return}}},r.warnings=function warnings(){return this.sync().warnings()},_create_class(LazyResult,[{key:`content`,get:function get(){return this.stringify().content}},{key:`css`,get:function get(){return this.stringify().css}},{key:`map`,get:function get(){return this.stringify().map}},{key:`messages`,get:function get(){return this.sync().messages}},{key:`opts`,get:function get(){return this.result.opts}},{key:`processor`,get:function get(){return this.result.processor}},{key:`root`,get:function get(){return this.sync().root}},{key:Symbol.toStringTag,get:function get(){return`LazyResult`}}]),LazyResult}();di.registerPostcss=function(r){li=r};var fi=di;di.default=di,ii.registerLazyResult(di),ti.registerLazyResult(di);var pi=An,mi=Lt,hi=Yr,gi=$n,_i=function(){function NoWorkResult(r,c,l){c=c.toString(),this.stringified=!1,this._processor=r,this._css=c,this._opts=l,this._map=void 0;var u,p=mi;this.result=new gi(this._processor,u,this._opts),this.result.css=c;var m=this;Object.defineProperty(this.result,"root",{get:function get(){return m.root}});var h=new pi(p,u,this._opts,c);if(h.isMap()){var g=h.generate(),v=g[0],y=g[1];v&&(this.result.css=v),y&&(this.result.map=y)}else h.clearAnnotation(),this.result.css=h.css}var r=NoWorkResult.prototype;return r.async=function async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)},r.catch=function _catch(r){return this.async().catch(r)},r.finally=function _finally(r){return this.async().then(r,r)},r.sync=function sync(){if(this.error)throw this.error;return this.result},r.then=function then(r,c){return this.async().then(r,c)},r.toString=function toString(){return this._css},r.warnings=function warnings(){return[]},_create_class(NoWorkResult,[{key:`content`,get:function get(){return this.result.css}},{key:`css`,get:function get(){return this.result.css}},{key:`map`,get:function get(){return this.result.map}},{key:`messages`,get:function get(){return[]}},{key:`opts`,get:function get(){return this.result.opts}},{key:`processor`,get:function get(){return this.result.processor}},{key:`root`,get:function get(){if(this._root)return this._root;var r,c=hi;try{r=c(this._css,this._opts)}catch(r){this.error=r}if(this.error)throw this.error;return this._root=r,r}},{key:Symbol.toStringTag,get:function get(){return`NoWorkResult`}}]),NoWorkResult}(),vi=_i;_i.default=_i;var yi=vi,bi=fi,xi=Jn,Si=jr,Ci=function(){function Processor(r){r===void 0&&(r=[]),this.version=`8.4.38`,this.plugins=this.normalize(r)}var r=Processor.prototype;return r.normalize=function normalize(r){for(var c=[],l=_create_for_of_iterator_helper_loose(r),u;!(u=l()).done;){var p=u.value;if(p.postcss===!0?p=p():p.postcss&&(p=p.postcss),(p===void 0?`undefined`:_type_of(p))===`object`&&Array.isArray(p.plugins))c=c.concat(p.plugins);else if((p===void 0?`undefined`:_type_of(p))===`object`&&p.postcssPlugin)c.push(p);else if(typeof p==`function`)c.push(p);else if(!((p===void 0?`undefined`:_type_of(p))===`object`&&(p.parse||p.stringify)))throw Error(p+` is not a PostCSS plugin`)}return c},r.process=function process1(r,c){return c===void 0&&(c={}),!this.plugins.length&&!c.parser&&!c.stringifier&&!c.syntax?new yi(this,r,c):new bi(this,r,c)},r.use=function use(r){return this.plugins=this.plugins.concat(this.normalize([r])),this},Processor}(),wi=Ci;Ci.default=Ci,Si.registerProcessor(Ci),xi.registerProcessor(Ci);var Ti=Kt,Ei=nn,Di=Mn,Oi=Er,ki=yn,Ai=jr,ji=Lr;function fromJSON$1$1(r,c){if(Array.isArray(r))return r.map(function(r){return fromJSON$1$1(r)});var l=r.inputs,u=_object_without_properties_loose(r,[`inputs`]);if(l){c=[];for(var p=_create_for_of_iterator_helper_loose(l),m;!(m=p()).done;){var h=m.value,g=_extends({},h,{__proto__:ki.prototype});g.map&&(g.map=_extends({},g.map,{__proto__:Ei.prototype})),c.push(g)}}if(u.nodes&&(u.nodes=r.nodes.map(function(r){return fromJSON$1$1(r,c)})),u.source){var v=u.source,y=v.inputId;u.source=_object_without_properties_loose(v,[`inputId`]),y!=null&&(u.source.input=c[y])}if(u.type===`root`)return new Ai(u);if(u.type===`decl`)return new Ti(u);if(u.type===`rule`)return new ji(u);if(u.type===`comment`)return new Di(u);if(u.type===`atrule`)return new Oi(u);throw Error(`Unknown node type: `+r.type)}var Mi=fromJSON$1$1;fromJSON$1$1.default=fromJSON$1$1;var Ni=jt,Pi=Kt,Fi=fi,Ii=Un,Li=wi,Ri=Lt,zi=Mi,Bi=Jn,Vi=Xn,Hi=Mn,Ui=Er,Wi=$n,Gi=yn,Ki=Yr,qi=Nr,Ji=Lr,Yi=jr,Xi=Wt;function postcss$3(){for(var r=arguments.length,c=Array(r),l=0;l<r;l++)c[l]=arguments[l];return c.length===1&&Array.isArray(c[0])&&(c=c[0]),new Li(c)}postcss$3.plugin=function plugin(r,c){var l=!1;function creator(){for(var u=arguments.length,p=Array(u),m=0;m<u;m++)p[m]=arguments[m];console&&console.warn&&!l&&(l=!0,console.warn(r+`: postcss.plugin was deprecated. Migration guide: |
| 30 |
https://evilmartians.com/chronicles/postcss-8-plugin-migration`),{}.LANG&&{}.LANG.startsWith(`cn`)&&console.warn(r+`: 里面 postcss.plugin 被弃用. 迁移指南: |
| 31 |
https://www.w3ctech.com/topic/2226`));var h=c.apply(void 0,[].concat(p));return h.postcssPlugin=r,h.postcssVersion=new Li().version,h}var u;return Object.defineProperty(creator,"postcss",{get:function get(){return u||(u=creator()),u}}),creator.process=function(r,c,l){return postcss$3([creator(l)]).process(r,c)},creator},postcss$3.stringify=Ri,postcss$3.parse=Ki,postcss$3.fromJSON=zi,postcss$3.list=qi,postcss$3.comment=function(r){return new Hi(r)},postcss$3.atRule=function(r){return new Ui(r)},postcss$3.decl=function(r){return new Pi(r)},postcss$3.rule=function(r){return new Ji(r)},postcss$3.root=function(r){return new Yi(r)},postcss$3.document=function(r){return new Bi(r)},postcss$3.CssSyntaxError=Ni,postcss$3.Declaration=Pi,postcss$3.Container=Ii,postcss$3.Processor=Li,postcss$3.Document=Bi,postcss$3.Comment=Hi,postcss$3.Warning=Vi,postcss$3.AtRule=Ui,postcss$3.Result=Wi,postcss$3.Input=Gi,postcss$3.Rule=Ji,postcss$3.Root=Yi,postcss$3.Node=Xi,Fi.registerPostcss(postcss$3);var Zi=postcss$3;postcss$3.default=postcss$3;var z=getDefaultExportFromCjs$1(Zi);z.stringify,z.fromJSON,z.plugin,z.parse,z.list,z.document,z.comment,z.atRule,z.rule,z.decl,z.root,z.CssSyntaxError,z.Declaration,z.Container,z.Processor,z.Document,z.Comment,z.Warning,z.AtRule,z.Result,z.Input,z.Rule,z.Root,z.Node;var Qi=Object.defineProperty,__defNormalProp2=function(r,c,l){return c in r?Qi(r,c,{enumerable:!0,configurable:!0,writable:!0,value:l}):r[c]=l},__publicField2=function(r,c,l){return __defNormalProp2(r,(c===void 0?`undefined`:_type_of(c))===`symbol`?c:c+``,l)};function getDefaultExportFromCjs(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,`default`)?r.default:r}function getAugmentedNamespace(r){if(r.__esModule)return r;var c=r.default;if(typeof c==`function`){var l=function a22(){return _instanceof(this,a22)?Reflect.construct(c,arguments,this.constructor):c.apply(this,arguments)};l.prototype=c.prototype}else l={};return Object.defineProperty(l,"__esModule",{value:!0}),Object.keys(r).forEach(function(c){var u=Object.getOwnPropertyDescriptor(r,c);Object.defineProperty(l,c,u.get?u:{enumerable:!0,get:function get(){return r[c]}})}),l}var $i={exports:{}},B=String,ea=function create(){return{isColorSupported:!1,reset:B,bold:B,dim:B,italic:B,underline:B,inverse:B,hidden:B,strikethrough:B,black:B,red:B,green:B,yellow:B,blue:B,magenta:B,cyan:B,white:B,gray:B,bgBlack:B,bgRed:B,bgGreen:B,bgYellow:B,bgBlue:B,bgMagenta:B,bgCyan:B,bgWhite:B}};$i.exports=ea(),$i.exports.createColors=ea;var ta=$i.exports,V=getAugmentedNamespace(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:`Module`}))),na=ta,ra=V,ia=function(r){_inherits(CssSyntaxError2,r);function CssSyntaxError2(c,l,u,p,m,h){var g=r.call(this,c)||this;return g.name=`CssSyntaxError`,g.reason=c,m&&(g.file=m),p&&(g.source=p),h&&(g.plugin=h),l!==void 0&&u!==void 0&&(typeof l==`number`?(g.line=l,g.column=u):(g.line=l.line,g.column=l.column,g.endLine=u.line,g.endColumn=u.column)),g.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(g,CssSyntaxError2),g}var c=CssSyntaxError2.prototype;return c.setMessage=function setMessage(){this.message=this.plugin?this.plugin+`: `:``,this.message+=this.file?this.file:`<css input>`,this.line!==void 0&&(this.message+=`:`+this.line+`:`+this.column),this.message+=`: `+this.reason},c.showSourceCode=function showSourceCode(r){var c=this;if(!this.source)return``;var l=this.source;r==null&&(r=na.isColorSupported),ra&&r&&(l=ra(l));var u=l.split(/\r?\n/),p=Math.max(this.line-3,0),m=Math.min(this.line+2,u.length),h=String(m).length,mark,aside;if(r){var g=na.createColors(!0),v=g.bold,y=g.gray,b=g.red;mark=function(r){return v(b(r))},aside=function(r){return y(r)}}else mark=aside=function(r){return r};return u.slice(p,m).map(function(r,l){var u=p+1+l,m=` `+(` `+u).slice(-h)+` | `;if(u===c.line){var g=aside(m.replace(/\d/g,` `))+r.slice(0,c.column-1).replace(/[^\t]/g,` `);return mark(`>`)+aside(m)+r+` |
| 32 |
`+g+mark(`^`)}return` `+aside(m)+r}).join(` |
| 33 |
`)},c.toString=function toString(){var r=this.showSourceCode();return r&&(r=` |
| 34 |
|
| 35 |
`+r+` |
| 36 |
`),this.name+`: `+this.message+r},CssSyntaxError2}(_wrap_native_super(Error)),aa=ia;ia.default=ia;var oa={};oa.isClean=Symbol(`isClean`),oa.my=Symbol(`my`);var sa={after:` |
| 37 |
`,beforeClose:` |
| 38 |
`,beforeComment:` |
| 39 |
`,beforeDecl:` |
| 40 |
`,beforeOpen:` `,beforeRule:` |
| 41 |
`,colon:`: `,commentLeft:` `,commentRight:` `,emptyBody:``,indent:` `,semicolon:!1};function capitalize(r){return r[0].toUpperCase()+r.slice(1)}var ca=function(){function Stringifier2(r){this.builder=r}var r=Stringifier2.prototype;return r.atrule=function atrule(r,c){var l=`@`+r.name,u=r.params?this.rawValue(r,`params`):``;if(r.raws.afterName===void 0?u&&(l+=` `):l+=r.raws.afterName,r.nodes)this.block(r,l+u);else{var p=(r.raws.between||``)+(c?`;`:``);this.builder(l+u+p,r)}},r.beforeAfter=function beforeAfter(r,c){for(var l=r.type===`decl`?this.raw(r,null,`beforeDecl`):r.type===`comment`?this.raw(r,null,`beforeComment`):c===`before`?this.raw(r,null,`beforeRule`):this.raw(r,null,`beforeClose`),u=r.parent,p=0;u&&u.type!==`root`;)p+=1,u=u.parent;if(l.includes(` |
| 42 |
`)){var m=this.raw(r,null,`indent`);if(m.length)for(var h=0;h<p;h++)l+=m}return l},r.block=function block(r,c){var l=this.raw(r,`between`,`beforeOpen`);this.builder(c+l+`{`,r,`start`);var u;r.nodes&&r.nodes.length?(this.body(r),u=this.raw(r,`after`)):u=this.raw(r,`after`,`emptyBody`),u&&this.builder(u),this.builder(`}`,r,`end`)},r.body=function body(r){for(var c=r.nodes.length-1;c>0&&r.nodes[c].type===`comment`;)--c;for(var l=this.raw(r,`semicolon`),u=0;u<r.nodes.length;u++){var p=r.nodes[u],m=this.raw(p,`before`);m&&this.builder(m),this.stringify(p,c!==u||l)}},r.comment=function comment(r){var c=this.raw(r,`left`,`commentLeft`),l=this.raw(r,`right`,`commentRight`);this.builder(`/*`+c+r.text+l+`*/`,r)},r.decl=function decl(r,c){var l=this.raw(r,`between`,`colon`),u=r.prop+l+this.rawValue(r,`value`);r.important&&(u+=r.raws.important||` !important`),c&&(u+=`;`),this.builder(u,r)},r.document=function document1(r){this.body(r)},r.raw=function raw(r,c,l){var u;if(l||(l=c),c&&(u=r.raws[c],u!==void 0))return u;var p=r.parent;if(l===`before`&&(!p||p.type===`root`&&p.first===r||p&&p.type===`document`))return``;if(!p)return sa[l];var m=r.root();if(m.rawCache||(m.rawCache={}),m.rawCache[l]!==void 0)return m.rawCache[l];if(l===`before`||l===`after`)return this.beforeAfter(r,l);var h=`raw`+capitalize(l);return this[h]?u=this[h](m,r):m.walk(function(r){if(u=r.raws[c],u!==void 0)return!1}),u===void 0&&(u=sa[l]),m.rawCache[l]=u,u},r.rawBeforeClose=function rawBeforeClose(r){var c;return r.walk(function(r){if(r.nodes&&r.nodes.length>0&&r.raws.after!==void 0)return c=r.raws.after,c.includes(` |
| 43 |
`)&&(c=c.replace(/[^\n]+$/,``)),!1}),c&&(c=c.replace(/\S/g,``)),c},r.rawBeforeComment=function rawBeforeComment(r,c){var l;return r.walkComments(function(r){if(r.raws.before!==void 0)return l=r.raws.before,l.includes(` |
| 44 |
`)&&(l=l.replace(/[^\n]+$/,``)),!1}),l===void 0?l=this.raw(c,null,`beforeDecl`):l&&(l=l.replace(/\S/g,``)),l},r.rawBeforeDecl=function rawBeforeDecl(r,c){var l;return r.walkDecls(function(r){if(r.raws.before!==void 0)return l=r.raws.before,l.includes(` |
| 45 |
`)&&(l=l.replace(/[^\n]+$/,``)),!1}),l===void 0?l=this.raw(c,null,`beforeRule`):l&&(l=l.replace(/\S/g,``)),l},r.rawBeforeOpen=function rawBeforeOpen(r){var c;return r.walk(function(r){if(r.type!==`decl`&&(c=r.raws.between,c!==void 0))return!1}),c},r.rawBeforeRule=function rawBeforeRule(r){var c;return r.walk(function(l){if(l.nodes&&(l.parent!==r||r.first!==l)&&l.raws.before!==void 0)return c=l.raws.before,c.includes(` |
| 46 |
`)&&(c=c.replace(/[^\n]+$/,``)),!1}),c&&(c=c.replace(/\S/g,``)),c},r.rawColon=function rawColon(r){var c;return r.walkDecls(function(r){if(r.raws.between!==void 0)return c=r.raws.between.replace(/[^\s:]/g,``),!1}),c},r.rawEmptyBody=function rawEmptyBody(r){var c;return r.walk(function(r){if(r.nodes&&r.nodes.length===0&&(c=r.raws.after,c!==void 0))return!1}),c},r.rawIndent=function rawIndent(r){if(r.raws.indent)return r.raws.indent;var c;return r.walk(function(l){var u=l.parent;if(u&&u!==r&&u.parent&&u.parent===r&&l.raws.before!==void 0){var p=l.raws.before.split(` |
| 47 |
`);return c=p[p.length-1],c=c.replace(/\S/g,``),!1}}),c},r.rawSemicolon=function rawSemicolon(r){var c;return r.walk(function(r){if(r.nodes&&r.nodes.length&&r.last.type===`decl`&&(c=r.raws.semicolon,c!==void 0))return!1}),c},r.rawValue=function rawValue(r,c){var l=r[c],u=r.raws[c];return u&&u.value===l?u.raw:l},r.root=function root(r){this.body(r),r.raws.after&&this.builder(r.raws.after)},r.rule=function rule(r){this.block(r,this.rawValue(r,`selector`)),r.raws.ownSemicolon&&this.builder(r.raws.ownSemicolon,r,`end`)},r.stringify=function stringify(r,c){if(!this[r.type])throw Error(`Unknown AST node type `+r.type+`. Maybe you need to change PostCSS stringifier.`);this[r.type](r,c)},Stringifier2}(),la=ca;ca.default=ca;var ua=la;function stringify$4(r,c){new ua(c).stringify(r)}var da=stringify$4;stringify$4.default=stringify$4;var fa=oa.isClean,pa=oa.my,ma=aa,ha=la,ga=da;function cloneNode(r,c){var l=new r.constructor;for(var u in r)if(Object.prototype.hasOwnProperty.call(r,u)&&u!==`proxyCache`){var p=r[u],m=p===void 0?`undefined`:_type_of(p);u===`parent`&&m===`object`?c&&(l[u]=c):u===`source`?l[u]=p:Array.isArray(p)?l[u]=p.map(function(r){return cloneNode(r,l)}):(m===`object`&&p!==null&&(p=cloneNode(p)),l[u]=p)}return l}var _a=function(){function Node3(r){for(var c in r===void 0&&(r={}),this.raws={},this[fa]=!1,this[pa]=!0,r)if(c===`nodes`){this.nodes=[];for(var l=_create_for_of_iterator_helper_loose(r[c]),u;!(u=l()).done;){var p=u.value;typeof p.clone==`function`?this.append(p.clone()):this.append(p)}}else this[c]=r[c]}var r=Node3.prototype;return r.addToError=function addToError(r){if(r.postcssNode=this,r.stack&&this.source&&/\n\s{4}at /.test(r.stack)){var c=this.source;r.stack=r.stack.replace(/\n\s{4}at /,`$&`+c.input.from+`:`+c.start.line+`:`+c.start.column+`$&`)}return r},r.after=function after(r){return this.parent.insertAfter(this,r),this},r.assign=function assign(r){for(var c in r===void 0&&(r={}),r)this[c]=r[c];return this},r.before=function before(r){return this.parent.insertBefore(this,r),this},r.cleanRaws=function cleanRaws(r){delete this.raws.before,delete this.raws.after,r||delete this.raws.between},r.clone=function clone(r){r===void 0&&(r={});var c=cloneNode(this);for(var l in r)c[l]=r[l];return c},r.cloneAfter=function cloneAfter(r){r===void 0&&(r={});var c=this.clone(r);return this.parent.insertAfter(this,c),c},r.cloneBefore=function cloneBefore(r){r===void 0&&(r={});var c=this.clone(r);return this.parent.insertBefore(this,c),c},r.error=function error(r,c){if(c===void 0&&(c={}),this.source){var l=this.rangeBy(c),u=l.end,p=l.start;return this.source.input.error(r,{column:p.column,line:p.line},{column:u.column,line:u.line},c)}return new ma(r)},r.getProxyProcessor=function getProxyProcessor(){return{get:function get(r,c){return c===`proxyOf`?r:c===`root`?function(){return r.root().toProxy()}:r[c]},set:function set(r,c,l){return r[c]===l?!0:(r[c]=l,(c===`prop`||c===`value`||c===`name`||c===`params`||c===`important`||c===`text`)&&r.markDirty(),!0)}}},r.markDirty=function markDirty(){if(this[fa]){this[fa]=!1;for(var r=this;r=r.parent;)r[fa]=!1}},r.next=function next(){if(this.parent){var r=this.parent.index(this);return this.parent.nodes[r+1]}},r.positionBy=function positionBy(r,c){var l=this.source.start;if(r.index)l=this.positionInside(r.index,c);else if(r.word){c=this.toString();var u=c.indexOf(r.word);u!==-1&&(l=this.positionInside(u,c))}return l},r.positionInside=function positionInside(r,c){for(var l=c||this.toString(),u=this.source.start.column,p=this.source.start.line,m=0;m<r;m++)l[m]===` |
| 48 |
`?(u=1,p+=1):u+=1;return{column:u,line:p}},r.prev=function prev(){if(this.parent){var r=this.parent.index(this);return this.parent.nodes[r-1]}},r.rangeBy=function rangeBy(r){var c={column:this.source.start.column,line:this.source.start.line},l=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:c.column+1,line:c.line};if(r.word){var u=this.toString(),p=u.indexOf(r.word);p!==-1&&(c=this.positionInside(p,u),l=this.positionInside(p+r.word.length,u))}else r.start?c={column:r.start.column,line:r.start.line}:r.index&&(c=this.positionInside(r.index)),r.end?l={column:r.end.column,line:r.end.line}:typeof r.endIndex==`number`?l=this.positionInside(r.endIndex):r.index&&(l=this.positionInside(r.index+1));return(l.line<c.line||l.line===c.line&&l.column<=c.column)&&(l={column:c.column+1,line:c.line}),{end:l,start:c}},r.raw=function raw(r,c){return new ha().raw(this,r,c)},r.remove=function remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this},r.replaceWith=function replaceWith(){for(var r=arguments.length,c=Array(r),l=0;l<r;l++)c[l]=arguments[l];if(this.parent){for(var u=this,p=!1,m=_create_for_of_iterator_helper_loose(c),h;!(h=m()).done;){var g=h.value;g===this?p=!0:p?(this.parent.insertAfter(u,g),u=g):this.parent.insertBefore(u,g)}p||this.remove()}return this},r.root=function root(){for(var r=this;r.parent&&r.parent.type!==`document`;)r=r.parent;return r},r.toJSON=function toJSON(r,c){var l={},u=c==null;c=c||new Map;var p=0;for(var m in this)if(Object.prototype.hasOwnProperty.call(this,m)&&m!==`parent`&&m!==`proxyCache`){var h=this[m];if(Array.isArray(h))l[m]=h.map(function(r){return(r===void 0?`undefined`:_type_of(r))===`object`&&r.toJSON?r.toJSON(null,c):r});else if((h===void 0?`undefined`:_type_of(h))===`object`&&h.toJSON)l[m]=h.toJSON(null,c);else if(m===`source`){var g=c.get(h.input);g==null&&(g=p,c.set(h.input,p),p++),l[m]={end:h.end,inputId:g,start:h.start}}else l[m]=h}return u&&(l.inputs=[].concat(c.keys()).map(function(r){return r.toJSON()})),l},r.toProxy=function toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache},r.toString=function toString(r){r===void 0&&(r=ga),r.stringify&&(r=r.stringify);var c=``;return r(this,function(r){c+=r}),c},r.warn=function warn(r,c,l){var u={node:this};for(var p in l)u[p]=l[p];return r.warn(c,u)},_create_class(Node3,[{key:`proxyOf`,get:function get(){return this}}]),Node3}(),va=_a;_a.default=_a;var ya=function(r){_inherits(Declaration2,r);function Declaration2(c){var l;return c&&c.value!==void 0&&typeof c.value!=`string`&&(c=_extends({},c,{value:String(c.value)})),l=r.call(this,c)||this,l.type=`decl`,l}return _create_class(Declaration2,[{key:`variable`,get:function get(){return this.prop.startsWith(`--`)||this.prop[0]===`$`}}]),Declaration2}(va),ba=ya;ya.default=ya;var xa=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`,nanoid$1=function(r){r===void 0&&(r=21);for(var c=``,l=r;l--;)c+=xa[Math.random()*64|0];return c},Sa={nanoid:nanoid$1},Ca=V.SourceMapConsumer,wa=V.SourceMapGenerator,Ta=V.existsSync,Ea=V.readFileSync,Da=V.dirname,Oa=V.join;function fromBase64(r){return Buffer?Buffer.from(r,`base64`).toString():window.atob(r)}var ka=function(){function PreviousMap2(r,c){if(c.map!==!1){this.loadAnnotation(r),this.inline=this.startWith(this.annotation,`data:`);var l=c.map?c.map.prev:void 0,u=this.loadMap(c.from,l);!this.mapFile&&c.from&&(this.mapFile=c.from),this.mapFile&&(this.root=Da(this.mapFile)),u&&(this.text=u)}}var r=PreviousMap2.prototype;return r.consumer=function consumer(){return this.consumerCache||(this.consumerCache=new Ca(this.text)),this.consumerCache},r.decodeInline=function decodeInline(r){var c=/^data:application\/json;charset=utf-?8;base64,/,l=/^data:application\/json;base64,/;if(/^data:application\/json;charset=utf-?8,/.test(r)||/^data:application\/json,/.test(r))return decodeURIComponent(r.substr(RegExp.lastMatch.length));if(c.test(r)||l.test(r))return fromBase64(r.substr(RegExp.lastMatch.length));var u=r.match(/data:application\/json;([^,]+),/)[1];throw Error(`Unsupported source map encoding `+u)},r.getAnnotationURL=function getAnnotationURL(r){return r.replace(/^\/\*\s*# sourceMappingURL=/,``).trim()},r.isMap=function isMap(r){return(r===void 0?`undefined`:_type_of(r))===`object`?typeof r.mappings==`string`||typeof r._mappings==`string`||Array.isArray(r.sections):!1},r.loadAnnotation=function loadAnnotation(r){var c=r.match(/\/\*\s*# sourceMappingURL=/gm);if(c){var l=r.lastIndexOf(c.pop()),u=r.indexOf(`*/`,l);l>-1&&u>-1&&(this.annotation=this.getAnnotationURL(r.substring(l,u)))}},r.loadFile=function loadFile(r){if(this.root=Da(r),Ta(r))return this.mapFile=r,Ea(r,`utf-8`).toString().trim()},r.loadMap=function loadMap(r,c){if(c===!1)return!1;if(c){if(typeof c==`string`)return c;if(typeof c==`function`){var l=c(r);if(l){var u=this.loadFile(l);if(!u)throw Error(`Unable to load previous source map: `+l.toString());return u}}else if(_instanceof(c,Ca))return wa.fromSourceMap(c).toString();else if(_instanceof(c,wa))return c.toString();else if(this.isMap(c))return JSON.stringify(c);else throw Error(`Unsupported previous source map format: `+c.toString())}else if(this.inline)return this.decodeInline(this.annotation);else if(this.annotation){var p=this.annotation;return r&&(p=Oa(Da(r),p)),this.loadFile(p)}},r.startWith=function startWith(r,c){return r?r.substr(0,c.length)===c:!1},r.withContent=function withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)},PreviousMap2}(),Aa=ka;ka.default=ka;var ja=V.SourceMapConsumer,Ma=V.SourceMapGenerator,Na=V.fileURLToPath,Pa=V.pathToFileURL,Fa=V.isAbsolute,Ia=V.resolve,La=Sa.nanoid,Ra=V,za=aa,Ba=Aa,Va=Symbol(`fromOffsetCache`),Ha=!!(ja&&Ma),Ua=!!(Ia&&Fa),Wa=function(){function Input2(r,c){if(c===void 0&&(c={}),r==null||(r===void 0?`undefined`:_type_of(r))===`object`&&!r.toString)throw Error(`PostCSS received `+r+` instead of CSS string`);if(this.css=r.toString(),this.css[0]===``||this.css[0]===``?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,c.from&&(!Ua||/^\w+:\/\//.test(c.from)||Fa(c.from)?this.file=c.from:this.file=Ia(c.from)),Ua&&Ha){var l=new Ba(this.css,c);if(l.text){this.map=l;var u=l.consumer().file;!this.file&&u&&(this.file=this.mapResolve(u))}}this.file||(this.id=`<input css `+La(6)+`>`),this.map&&(this.map.file=this.from)}var r=Input2.prototype;return r.error=function error(r,c,l,u){u===void 0&&(u={});var p,m,h;if(c&&(c===void 0?`undefined`:_type_of(c))===`object`){var g=c,v=l;if(typeof g.offset==`number`){var y=this.fromOffset(g.offset);c=y.line,l=y.col}else c=g.line,l=g.column;if(typeof v.offset==`number`){var b=this.fromOffset(v.offset);m=b.line,h=b.col}else m=v.line,h=v.column}else if(!l){var x=this.fromOffset(c);c=x.line,l=x.col}var S=this.origin(c,l,m,h);return p=S?new za(r,S.endLine===void 0?S.line:{column:S.column,line:S.line},S.endLine===void 0?S.column:{column:S.endColumn,line:S.endLine},S.source,S.file,u.plugin):new za(r,m===void 0?c:{column:l,line:c},m===void 0?l:{column:h,line:m},this.css,this.file,u.plugin),p.input={column:l,endColumn:h,endLine:m,line:c,source:this.css},this.file&&(Pa&&(p.input.url=Pa(this.file).toString()),p.input.file=this.file),p},r.fromOffset=function fromOffset(r){var c,l;if(this[Va])l=this[Va];else{var u=this.css.split(` |
| 49 |
`);l=Array(u.length);for(var p=0,m=0,h=u.length;m<h;m++)l[m]=p,p+=u[m].length+1;this[Va]=l}c=l[l.length-1];var g=0;if(r>=c)g=l.length-1;else for(var v=l.length-2,y;g<v;)if(y=g+(v-g>>1),r<l[y])v=y-1;else if(r>=l[y+1])g=y+1;else{g=y;break}return{col:r-l[g]+1,line:g+1}},r.mapResolve=function mapResolve(r){return/^\w+:\/\//.test(r)?r:Ia(this.map.consumer().sourceRoot||this.map.root||`.`,r)},r.origin=function origin(r,c,l,u){if(!this.map)return!1;var p=this.map.consumer(),m=p.originalPositionFor({column:c,line:r});if(!m.source)return!1;var h;typeof l==`number`&&(h=p.originalPositionFor({column:u,line:l}));var g=Fa(m.source)?Pa(m.source):new URL(m.source,this.map.consumer().sourceRoot||Pa(this.map.mapFile)),v={column:m.column,endColumn:h&&h.column,endLine:h&&h.line,line:m.line,url:g.toString()};if(g.protocol===`file:`)if(Na)v.file=Na(g);else throw Error(`file: protocol is not available in this PostCSS build`);var y=p.sourceContentFor(m.source);return y&&(v.source=y),v},r.toJSON=function toJSON(){for(var r={},c=0,l=[`hasBOM`,`css`,`file`,`id`];c<l.length;c++){var u=l[c];this[u]!=null&&(r[u]=this[u])}return this.map&&(r.map=_extends({},this.map),r.map.consumerCache&&(r.map.consumerCache=void 0)),r},_create_class(Input2,[{key:`from`,get:function get(){return this.file||this.id}}]),Input2}(),Ga=Wa;Wa.default=Wa,Ra&&Ra.registerInput&&Ra.registerInput(Wa);var Ka=V.SourceMapConsumer,qa=V.SourceMapGenerator,Ja=V.dirname,Ya=V.relative,Xa=V.resolve,Za=V.sep,Qa=V.pathToFileURL,$a=Ga,eo=!!(Ka&&qa),to=!!(Ja&&Xa&&Ya&&Za),no=function(){function MapGenerator2(r,c,l,u){this.stringify=r,this.mapOpts=l.map||{},this.root=c,this.opts=l,this.css=u,this.originalCSS=u,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}var r=MapGenerator2.prototype;return r.addAnnotation=function addAnnotation(){var r=this.isInline()?`data:application/json;base64,`+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation==`string`?this.mapOpts.annotation:typeof this.mapOpts.annotation==`function`?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+`.map`,c=` |
| 50 |
`;this.css.includes(`\r |
| 51 |
`)&&(c=`\r |
| 52 |
`),this.css+=c+`/*# sourceMappingURL=`+r+` */`},r.applyPrevMaps=function applyPrevMaps(){for(var r=_create_for_of_iterator_helper_loose(this.previous()),c;!(c=r()).done;){var l=c.value,u=this.toUrl(this.path(l.file)),p=l.root||Ja(l.file),m=void 0;this.mapOpts.sourcesContent===!1?(m=new Ka(l.text),m.sourcesContent&&(m.sourcesContent=null)):m=l.consumer(),this.map.applySourceMap(m,u,this.toUrl(this.path(p)))}},r.clearAnnotation=function clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root)for(var r,c=this.root.nodes.length-1;c>=0;c--)r=this.root.nodes[c],r.type===`comment`&&r.text.indexOf(`# sourceMappingURL=`)===0&&this.root.removeChild(c);else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,``))},r.generate=function generate(){if(this.clearAnnotation(),to&&eo&&this.isMap())return this.generateMap();var r=``;return this.stringify(this.root,function(c){r+=c}),[r]},r.generateMap=function generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){var r=this.previous()[0].consumer();r.file=this.outputFile(),this.map=qa.fromSourceMap(r,{ignoreInvalidMapping:!0})}else this.map=new qa({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):`<no source>`});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]},r.generateString=function generateString(){var r=this;this.css=``,this.map=new qa({file:this.outputFile(),ignoreInvalidMapping:!0});var c=1,l=1,u=`<no source>`,p={generated:{column:0,line:0},original:{column:0,line:0},source:``},m,h;this.stringify(this.root,function(g,v,y){if(r.css+=g,v&&y!==`end`&&(p.generated.line=c,p.generated.column=l-1,v.source&&v.source.start?(p.source=r.sourcePath(v),p.original.line=v.source.start.line,p.original.column=v.source.start.column-1,r.map.addMapping(p)):(p.source=u,p.original.line=1,p.original.column=0,r.map.addMapping(p))),m=g.match(/\n/g),m?(c+=m.length,h=g.lastIndexOf(` |
| 53 |
`),l=g.length-h):l+=g.length,v&&y!==`start`){var b=v.parent||{raws:{}};(!(v.type===`decl`||v.type===`atrule`&&!v.nodes)||v!==b.last||b.raws.semicolon)&&(v.source&&v.source.end?(p.source=r.sourcePath(v),p.original.line=v.source.end.line,p.original.column=v.source.end.column-1,p.generated.line=c,p.generated.column=l-2,r.map.addMapping(p)):(p.source=u,p.original.line=1,p.original.column=0,p.generated.line=c,p.generated.column=l-1,r.map.addMapping(p)))}})},r.isAnnotation=function isAnnotation(){return this.isInline()?!0:this.mapOpts.annotation===void 0?!this.previous().length||this.previous().some(function(r){return r.annotation}):this.mapOpts.annotation},r.isInline=function isInline(){if(this.mapOpts.inline!==void 0)return this.mapOpts.inline;var r=this.mapOpts.annotation;return r!==void 0&&r!==!0?!1:!this.previous().length||this.previous().some(function(r){return r.inline})},r.isMap=function isMap(){return this.opts.map===void 0?this.previous().length>0:!!this.opts.map},r.isSourcesContent=function isSourcesContent(){return this.mapOpts.sourcesContent===void 0?!this.previous().length||this.previous().some(function(r){return r.withContent()}):this.mapOpts.sourcesContent},r.outputFile=function outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):`to.css`},r.path=function path(r){if(this.mapOpts.absolute||r.charCodeAt(0)===60||/^\w+:\/\//.test(r))return r;var c=this.memoizedPaths.get(r);if(c)return c;var l=this.opts.to?Ja(this.opts.to):`.`;typeof this.mapOpts.annotation==`string`&&(l=Ja(Xa(l,this.mapOpts.annotation)));var u=Ya(l,r);return this.memoizedPaths.set(r,u),u},r.previous=function previous(){var r=this;if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(function(c){if(c.source&&c.source.input.map){var l=c.source.input.map;r.previousMaps.includes(l)||r.previousMaps.push(l)}});else{var c=new $a(this.originalCSS,this.opts);c.map&&this.previousMaps.push(c.map)}return this.previousMaps},r.setSourcesContent=function setSourcesContent(){var r=this,c={};if(this.root)this.root.walk(function(l){if(l.source){var u=l.source.input.from;if(u&&!c[u]){c[u]=!0;var p=r.usesFileUrls?r.toFileUrl(u):r.toUrl(r.path(u));r.map.setSourceContent(p,l.source.input.css)}}});else if(this.css){var l=this.opts.from?this.toUrl(this.path(this.opts.from)):`<no source>`;this.map.setSourceContent(l,this.css)}},r.sourcePath=function sourcePath(r){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(r.source.input.from):this.toUrl(this.path(r.source.input.from))},r.toBase64=function toBase64(r){return Buffer?Buffer.from(r).toString(`base64`):window.btoa(unescape(encodeURIComponent(r)))},r.toFileUrl=function toFileUrl(r){var c=this.memoizedFileURLs.get(r);if(c)return c;if(Qa){var l=Qa(r).toString();return this.memoizedFileURLs.set(r,l),l}else throw Error("`map.absolute` option is not available in this PostCSS build")},r.toUrl=function toUrl(r){var c=this.memoizedURLs.get(r);if(c)return c;Za===`\\`&&(r=r.replace(/\\/g,`/`));var l=encodeURI(r).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(r,l),l},MapGenerator2}(),ro=function(r){_inherits(Comment2,r);function Comment2(c){var l=r.call(this,c)||this;return l.type=`comment`,l}return Comment2}(va),io=ro;ro.default=ro;var ao=oa.isClean,oo=oa.my,so=ba,co=io,lo=va,uo,fo,po,mo;function cleanSource(r){return r.map(function(r){return r.nodes&&(r.nodes=cleanSource(r.nodes)),delete r.source,r})}function markDirtyUp(r){if(r[ao]=!1,r.proxyOf.nodes)for(var c=_create_for_of_iterator_helper_loose(r.proxyOf.nodes),l;!(l=c()).done;){var u=l.value;markDirtyUp(u)}}var ho=function(r){_inherits(Container2,r);function Container2(){return r.apply(this,arguments)||this}var c=Container2.prototype;return c.append=function append(){for(var r=arguments.length,c=Array(r),l=0;l<r;l++)c[l]=arguments[l];for(var u=_create_for_of_iterator_helper_loose(c),p;!(p=u()).done;)for(var m=p.value,h=_create_for_of_iterator_helper_loose(this.normalize(m,this.last)),g;!(g=h()).done;){var v=g.value;this.proxyOf.nodes.push(v)}return this.markDirty(),this},c.cleanRaws=function cleanRaws(c){if(r.prototype.cleanRaws.call(this,c),this.nodes)for(var l=_create_for_of_iterator_helper_loose(this.nodes),u;!(u=l()).done;)u.value.cleanRaws(c)},c.each=function each(r){if(this.proxyOf.nodes){for(var c=this.getIterator(),l,u;this.indexes[c]<this.proxyOf.nodes.length&&(l=this.indexes[c],u=r(this.proxyOf.nodes[l],l),u!==!1);)this.indexes[c]+=1;return delete this.indexes[c],u}},c.every=function every(r){return this.nodes.every(r)},c.getIterator=function getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;var r=this.lastEach;return this.indexes[r]=0,r},c.getProxyProcessor=function getProxyProcessor(){return{get:function get(r,c){return c===`proxyOf`?r:r[c]?c===`each`||typeof c==`string`&&c.startsWith(`walk`)?function(){for(var l=arguments.length,u=Array(l),p=0;p<l;p++)u[p]=arguments[p];var m;return(m=r)[c].apply(m,[].concat(u.map(function(r){return typeof r==`function`?function(c,l){return r(c.toProxy(),l)}:r})))}:c===`every`||c===`some`?function(l){return r[c](function(r){for(var c=arguments.length,u=Array(c>1?c-1:0),p=1;p<c;p++)u[p-1]=arguments[p];return l.apply(void 0,[r.toProxy()].concat(u))})}:c===`root`?function(){return r.root().toProxy()}:c===`nodes`?r.nodes.map(function(r){return r.toProxy()}):c===`first`||c===`last`?r[c].toProxy():r[c]:r[c]},set:function set(r,c,l){return r[c]===l?!0:(r[c]=l,(c===`name`||c===`params`||c===`selector`)&&r.markDirty(),!0)}}},c.index=function index(r){return typeof r==`number`?r:(r.proxyOf&&(r=r.proxyOf),this.proxyOf.nodes.indexOf(r))},c.insertAfter=function insertAfter(r,c){var l=this.index(r),u=this.normalize(c,this.proxyOf.nodes[l]).reverse();l=this.index(r);for(var p=_create_for_of_iterator_helper_loose(u),m;!(m=p()).done;){var h=m.value;this.proxyOf.nodes.splice(l+1,0,h)}var g;for(var v in this.indexes)g=this.indexes[v],l<g&&(this.indexes[v]=g+u.length);return this.markDirty(),this},c.insertBefore=function insertBefore(r,c){var l=this.index(r),u=l===0&&`prepend`,p=this.normalize(c,this.proxyOf.nodes[l],u).reverse();l=this.index(r);for(var m=_create_for_of_iterator_helper_loose(p),h;!(h=m()).done;){var g=h.value;this.proxyOf.nodes.splice(l,0,g)}var v;for(var y in this.indexes)v=this.indexes[y],l<=v&&(this.indexes[y]=v+p.length);return this.markDirty(),this},c.normalize=function normalize(r,c){var l=this;if(typeof r==`string`)r=cleanSource(uo(r).nodes);else if(r===void 0)r=[];else if(Array.isArray(r)){r=r.slice(0);for(var u=_create_for_of_iterator_helper_loose(r),p;!(p=u()).done;){var m=p.value;m.parent&&m.parent.removeChild(m,`ignore`)}}else if(r.type===`root`&&this.type!==`document`){r=r.nodes.slice(0);for(var h=_create_for_of_iterator_helper_loose(r),g;!(g=h()).done;){var v=g.value;v.parent&&v.parent.removeChild(v,`ignore`)}}else if(r.type)r=[r];else if(r.prop){if(r.value===void 0)throw Error(`Value field is missed in node creation`);typeof r.value!=`string`&&(r.value=String(r.value)),r=[new so(r)]}else if(r.selector)r=[new fo(r)];else if(r.name)r=[new po(r)];else if(r.text)r=[new co(r)];else throw Error(`Unknown node type in node creation`);return r.map(function(r){return r[oo]||Container2.rebuild(r),r=r.proxyOf,r.parent&&r.parent.removeChild(r),r[ao]&&markDirtyUp(r),r.raws.before===void 0&&c&&c.raws.before!==void 0&&(r.raws.before=c.raws.before.replace(/\S/g,``)),r.parent=l.proxyOf,r})},c.prepend=function prepend(){for(var r=arguments.length,c=Array(r),l=0;l<r;l++)c[l]=arguments[l];c=c.reverse();for(var u=_create_for_of_iterator_helper_loose(c),p;!(p=u()).done;){for(var m=p.value,h=this.normalize(m,this.first,`prepend`).reverse(),g=_create_for_of_iterator_helper_loose(h),v;!(v=g()).done;){var y=v.value;this.proxyOf.nodes.unshift(y)}for(var b in this.indexes)this.indexes[b]=this.indexes[b]+h.length}return this.markDirty(),this},c.push=function push(r){return r.parent=this,this.proxyOf.nodes.push(r),this},c.removeAll=function removeAll(){for(var r=_create_for_of_iterator_helper_loose(this.proxyOf.nodes),c;!(c=r()).done;){var l=c.value;l.parent=void 0}return this.proxyOf.nodes=[],this.markDirty(),this},c.removeChild=function removeChild(r){r=this.index(r),this.proxyOf.nodes[r].parent=void 0,this.proxyOf.nodes.splice(r,1);var c;for(var l in this.indexes)c=this.indexes[l],c>=r&&(this.indexes[l]=c-1);return this.markDirty(),this},c.replaceValues=function replaceValues(r,c,l){return l||(l=c,c={}),this.walkDecls(function(u){c.props&&!c.props.includes(u.prop)||c.fast&&!u.value.includes(c.fast)||(u.value=u.value.replace(r,l))}),this.markDirty(),this},c.some=function some(r){return this.nodes.some(r)},c.walk=function walk(r){return this.each(function(c,l){var u;try{u=r(c,l)}catch(r){throw c.addToError(r)}return u!==!1&&c.walk&&(u=c.walk(r)),u})},c.walkAtRules=function walkAtRules(r,c){return c?_instanceof(r,RegExp)?this.walk(function(l,u){if(l.type===`atrule`&&r.test(l.name))return c(l,u)}):this.walk(function(l,u){if(l.type===`atrule`&&l.name===r)return c(l,u)}):(c=r,this.walk(function(r,l){if(r.type===`atrule`)return c(r,l)}))},c.walkComments=function walkComments(r){return this.walk(function(c,l){if(c.type===`comment`)return r(c,l)})},c.walkDecls=function walkDecls(r,c){return c?_instanceof(r,RegExp)?this.walk(function(l,u){if(l.type===`decl`&&r.test(l.prop))return c(l,u)}):this.walk(function(l,u){if(l.type===`decl`&&l.prop===r)return c(l,u)}):(c=r,this.walk(function(r,l){if(r.type===`decl`)return c(r,l)}))},c.walkRules=function walkRules(r,c){return c?_instanceof(r,RegExp)?this.walk(function(l,u){if(l.type===`rule`&&r.test(l.selector))return c(l,u)}):this.walk(function(l,u){if(l.type===`rule`&&l.selector===r)return c(l,u)}):(c=r,this.walk(function(r,l){if(r.type===`rule`)return c(r,l)}))},_create_class(Container2,[{key:`first`,get:function get(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}},{key:`last`,get:function get(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}]),Container2}(lo);ho.registerParse=function(r){uo=r},ho.registerRule=function(r){fo=r},ho.registerAtRule=function(r){po=r},ho.registerRoot=function(r){mo=r};var go=ho;ho.default=ho,ho.rebuild=function(r){r.type===`atrule`?Object.setPrototypeOf(r,po.prototype):r.type===`rule`?Object.setPrototypeOf(r,fo.prototype):r.type===`decl`?Object.setPrototypeOf(r,so.prototype):r.type===`comment`?Object.setPrototypeOf(r,co.prototype):r.type===`root`&&Object.setPrototypeOf(r,mo.prototype),r[oo]=!0,r.nodes&&r.nodes.forEach(function(r){ho.rebuild(r)})};var _o=go,vo,yo,bo=function(r){_inherits(Document23,r);function Document23(c){var l=r.call(this,_extends({type:`document`},c))||this;return l.nodes||(l.nodes=[]),l}var c=Document23.prototype;return c.toResult=function toResult(r){return r===void 0&&(r={}),new vo(new yo,this,r).stringify()},Document23}(_o);bo.registerLazyResult=function(r){vo=r},bo.registerProcessor=function(r){yo=r};var xo=bo;bo.default=bo;var So=function(){function Warning2(r,c){if(c===void 0&&(c={}),this.type=`warning`,this.text=r,c.node&&c.node.source){var l=c.node.rangeBy(c);this.line=l.start.line,this.column=l.start.column,this.endLine=l.end.line,this.endColumn=l.end.column}for(var u in c)this[u]=c[u]}var r=Warning2.prototype;return r.toString=function toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+`: `+this.text:this.text},Warning2}(),Co=So;So.default=So;var wo=Co,To=function(){function Result2(r,c,l){this.processor=r,this.messages=[],this.root=c,this.opts=l,this.css=void 0,this.map=void 0}var r=Result2.prototype;return r.toString=function toString(){return this.css},r.warn=function warn(r,c){c===void 0&&(c={}),c.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(c.plugin=this.lastPlugin.postcssPlugin);var l=new wo(r,c);return this.messages.push(l),l},r.warnings=function warnings(){return this.messages.filter(function(r){return r.type===`warning`})},_create_class(Result2,[{key:`content`,get:function get(){return this.css}}]),Result2}(),Eo=To;To.default=To;var Do=39,Oo=34,ko=92,Ao=47,jo=10,Mo=32,No=12,Po=9,Fo=13,Io=91,Lo=93,Ro=40,zo=41,Bo=123,Vo=125,Ho=59,Uo=42,Wo=58,Go=64,Ko=/[\t\n\f\r "#'()/;[\\\]{}]/g,qo=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Jo=/.[\r\n"'(/\\]/,Yo=/[\da-f]/i,Xo=function tokenizer2(r,c){c===void 0&&(c={});var l=r.css.valueOf(),u=c.ignoreErrors,p,m,h,g,v,y,b,x,S,C,w=l.length,T=0,E=[],D=[];function position(){return T}function unclosed(c){throw r.error(`Unclosed `+c,T)}function endOfFile(){return D.length===0&&T>=w}function nextToken(r){if(D.length)return D.pop();if(!(T>=w)){var c=r?r.ignoreUnclosed:!1;switch(p=l.charCodeAt(T),p){case jo:case Mo:case Po:case Fo:case No:m=T;do m+=1,p=l.charCodeAt(m);while(p===Mo||p===jo||p===Po||p===Fo||p===No);C=[`space`,l.slice(T,m)],T=m-1;break;case Io:case Lo:case Bo:case Vo:case Wo:case Ho:case zo:var O=String.fromCharCode(p);C=[O,O,T];break;case Ro:if(x=E.length?E.pop()[1]:``,S=l.charCodeAt(T+1),x===`url`&&S!==Do&&S!==Oo&&S!==Mo&&S!==jo&&S!==Po&&S!==No&&S!==Fo){m=T;do{if(y=!1,m=l.indexOf(`)`,m+1),m===-1)if(u||c){m=T;break}else unclosed(`bracket`);for(b=m;l.charCodeAt(b-1)===ko;)--b,y=!y}while(y);C=[`brackets`,l.slice(T,m+1),T,m],T=m}else m=l.indexOf(`)`,T+1),g=l.slice(T,m+1),m===-1||Jo.test(g)?C=[`(`,`(`,T]:(C=[`brackets`,g,T,m],T=m);break;case Do:case Oo:h=p===Do?`'`:`"`,m=T;do{if(y=!1,m=l.indexOf(h,m+1),m===-1)if(u||c){m=T+1;break}else unclosed(`string`);for(b=m;l.charCodeAt(b-1)===ko;)--b,y=!y}while(y);C=[`string`,l.slice(T,m+1),T,m],T=m;break;case Go:Ko.lastIndex=T+1,Ko.test(l),m=Ko.lastIndex===0?l.length-1:Ko.lastIndex-2,C=[`at-word`,l.slice(T,m+1),T,m],T=m;break;case ko:for(m=T,v=!0;l.charCodeAt(m+1)===ko;)m+=1,v=!v;if(p=l.charCodeAt(m+1),v&&p!==Ao&&p!==Mo&&p!==jo&&p!==Po&&p!==Fo&&p!==No&&(m+=1,Yo.test(l.charAt(m)))){for(;Yo.test(l.charAt(m+1));)m+=1;l.charCodeAt(m+1)===Mo&&(m+=1)}C=[`word`,l.slice(T,m+1),T,m],T=m;break;default:p===Ao&&l.charCodeAt(T+1)===Uo?(m=l.indexOf(`*/`,T+2)+1,m===0&&(u||c?m=l.length:unclosed(`comment`)),C=[`comment`,l.slice(T,m+1),T,m],T=m):(qo.lastIndex=T+1,qo.test(l),m=qo.lastIndex===0?l.length-1:qo.lastIndex-2,C=[`word`,l.slice(T,m+1),T,m],E.push(C),T=m);break}return T++,C}}function back(r){D.push(r)}return{back,endOfFile,nextToken,position}},Zo=go,Qo=function(r){_inherits(AtRule2,r);function AtRule2(c){var l=r.call(this,c)||this;return l.type=`atrule`,l}var c=AtRule2.prototype;return c.append=function append(){for(var c=arguments.length,l=Array(c),u=0;u<c;u++)l[u]=arguments[u];var p;return this.proxyOf.nodes||(this.nodes=[]),(p=r.prototype.append).call.apply(p,[this].concat(l))},c.prepend=function prepend(){for(var c=arguments.length,l=Array(c),u=0;u<c;u++)l[u]=arguments[u];var p;return this.proxyOf.nodes||(this.nodes=[]),(p=r.prototype.prepend).call.apply(p,[this].concat(l))},AtRule2}(Zo),$o=Qo;Qo.default=Qo,Zo.registerAtRule(Qo);var es=go,ts,ns,rs=function(r){_inherits(Root2,r);function Root2(c){var l=r.call(this,c)||this;return l.type=`root`,l.nodes||(l.nodes=[]),l}var c=Root2.prototype;return c.normalize=function normalize(c,l,u){var p=r.prototype.normalize.call(this,c);if(l){if(u===`prepend`)this.nodes.length>1?l.raws.before=this.nodes[1].raws.before:delete l.raws.before;else if(this.first!==l)for(var m=_create_for_of_iterator_helper_loose(p),h;!(h=m()).done;){var g=h.value;g.raws.before=l.raws.before}}return p},c.removeChild=function removeChild(c,l){var u=this.index(c);return!l&&u===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[u].raws.before),r.prototype.removeChild.call(this,c)},c.toResult=function toResult(r){return r===void 0&&(r={}),new ts(new ns,this,r).stringify()},Root2}(es);rs.registerLazyResult=function(r){ts=r},rs.registerProcessor=function(r){ns=r};var is=rs;rs.default=rs,es.registerRoot(rs);var as={comma:function comma(r){return as.split(r,[`,`],!0)},space:function space(r){return as.split(r,[` `,` |
| 54 |
`,` `])},split:function split(r,c,l){for(var u=[],p=``,m=!1,h=0,g=!1,v=``,y=!1,b=_create_for_of_iterator_helper_loose(r),x;!(x=b()).done;){var S=x.value;y?y=!1:S===`\\`?y=!0:g?S===v&&(g=!1):S===`"`||S===`'`?(g=!0,v=S):S===`(`?h+=1:S===`)`?h>0&&--h:h===0&&c.includes(S)&&(m=!0),m?(p!==``&&u.push(p.trim()),p=``,m=!1):p+=S}return(l||p!==``)&&u.push(p.trim()),u}},os=as;as.default=as;var ss=go,cs=os,ls=function(r){_inherits(Rule2,r);function Rule2(c){var l=r.call(this,c)||this;return l.type=`rule`,l.nodes||(l.nodes=[]),l}return _create_class(Rule2,[{key:`selectors`,get:function get(){return cs.comma(this.selector)},set:function set(r){var c=this.selector?this.selector.match(/,\s*/):null,l=c?c[0]:`,`+this.raw(`between`,`beforeOpen`);this.selector=r.join(l)}}]),Rule2}(ss),us=ls;ls.default=ls,ss.registerRule(ls);var ds=ba,fs=Xo,ps=io,ms=$o,hs=is,gs=us,_s={empty:!0,space:!0};function findLastWithPosition(r){for(var c=r.length-1;c>=0;c--){var l=r[c],u=l[3]||l[2];if(u)return u}}var vs=function(){function Parser2(r){this.input=r,this.root=new hs,this.current=this.root,this.spaces=``,this.semicolon=!1,this.createTokenizer(),this.root.source={input:r,start:{column:1,line:1,offset:0}}}var r=Parser2.prototype;return r.atrule=function atrule(r){var c=new ms;c.name=r[1].slice(1),c.name===``&&this.unnamedAtrule(c,r),this.init(c,r[2]);for(var l,u,p,m=!1,h=!1,g=[],v=[];!this.tokenizer.endOfFile();){if(r=this.tokenizer.nextToken(),l=r[0],l===`(`||l===`[`?v.push(l===`(`?`)`:`]`):l===`{`&&v.length>0?v.push(`}`):l===v[v.length-1]&&v.pop(),v.length===0)if(l===`;`){c.source.end=this.getPosition(r[2]),c.source.end.offset++,this.semicolon=!0;break}else if(l===`{`){h=!0;break}else if(l===`}`){if(g.length>0){for(p=g.length-1,u=g[p];u&&u[0]===`space`;)u=g[--p];u&&(c.source.end=this.getPosition(u[3]||u[2]),c.source.end.offset++)}this.end(r);break}else g.push(r);else g.push(r);if(this.tokenizer.endOfFile()){m=!0;break}}c.raws.between=this.spacesAndCommentsFromEnd(g),g.length?(c.raws.afterName=this.spacesAndCommentsFromStart(g),this.raw(c,`params`,g),m&&(r=g[g.length-1],c.source.end=this.getPosition(r[3]||r[2]),c.source.end.offset++,this.spaces=c.raws.between,c.raws.between=``)):(c.raws.afterName=``,c.params=``),h&&(c.nodes=[],this.current=c)},r.checkMissedSemicolon=function checkMissedSemicolon(r){var c=this.colon(r);if(c!==!1){for(var l=0,u,p=c-1;p>=0&&(u=r[p],!(u[0]!==`space`&&(l+=1,l===2)));p--);throw this.input.error(`Missed semicolon`,u[0]===`word`?u[3]+1:u[2])}},r.colon=function colon(r){for(var c=0,l,u,p,m=_create_for_of_iterator_helper_loose(r.entries()),h;!(h=m()).done;){var g=h.value,v=g[0];if(l=g[1],u=l[0],u===`(`&&(c+=1),u===`)`&&--c,c===0&&u===`:`)if(!p)this.doubleColon(l);else if(p[0]===`word`&&p[1]===`progid`)continue;else return v;p=l}return!1},r.comment=function comment(r){var c=new ps;this.init(c,r[2]),c.source.end=this.getPosition(r[3]||r[2]),c.source.end.offset++;var l=r[1].slice(2,-2);if(/^\s*$/.test(l))c.text=``,c.raws.left=l,c.raws.right=``;else{var u=l.match(/^(\s*)([^]*\S)(\s*)$/);c.text=u[2],c.raws.left=u[1],c.raws.right=u[3]}},r.createTokenizer=function createTokenizer(){this.tokenizer=fs(this.input)},r.decl=function decl(r,c){var l=new ds;this.init(l,r[0][2]);var u=r[r.length-1];for(u[0]===`;`&&(this.semicolon=!0,r.pop()),l.source.end=this.getPosition(u[3]||u[2]||findLastWithPosition(r)),l.source.end.offset++;r[0][0]!==`word`;)r.length===1&&this.unknownWord(r),l.raws.before+=r.shift()[1];for(l.source.start=this.getPosition(r[0][2]),l.prop=``;r.length;){var p=r[0][0];if(p===`:`||p===`space`||p===`comment`)break;l.prop+=r.shift()[1]}l.raws.between=``;for(var m;r.length;)if(m=r.shift(),m[0]===`:`){l.raws.between+=m[1];break}else m[0]===`word`&&/\w/.test(m[1])&&this.unknownWord([m]),l.raws.between+=m[1];(l.prop[0]===`_`||l.prop[0]===`*`)&&(l.raws.before+=l.prop[0],l.prop=l.prop.slice(1));for(var h=[],g;r.length&&(g=r[0][0],g===`space`||g===`comment`);)h.push(r.shift());this.precheckMissedSemicolon(r);for(var v=r.length-1;v>=0;v--){if(m=r[v],m[1].toLowerCase()===`!important`){l.important=!0;var y=this.stringFrom(r,v);y=this.spacesFromEnd(r)+y,y!==` !important`&&(l.raws.important=y);break}else if(m[1].toLowerCase()===`important`){for(var b=r.slice(0),x=``,S=v;S>0;S--){var C=b[S][0];if(x.trim().indexOf(`!`)===0&&C!==`space`)break;x=b.pop()[1]+x}x.trim().indexOf(`!`)===0&&(l.important=!0,l.raws.important=x,r=b)}if(m[0]!==`space`&&m[0]!==`comment`)break}r.some(function(r){return r[0]!==`space`&&r[0]!==`comment`})&&(l.raws.between+=h.map(function(r){return r[1]}).join(``),h=[]),this.raw(l,`value`,h.concat(r),c),l.value.includes(`:`)&&!c&&this.checkMissedSemicolon(r)},r.doubleColon=function doubleColon(r){throw this.input.error(`Double colon`,{offset:r[2]},{offset:r[2]+r[1].length})},r.emptyRule=function emptyRule(r){var c=new gs;this.init(c,r[2]),c.selector=``,c.raws.between=``,this.current=c},r.end=function end(r){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||``)+this.spaces,this.spaces=``,this.current.parent?(this.current.source.end=this.getPosition(r[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(r)},r.endFile=function endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||``)+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())},r.freeSemicolon=function freeSemicolon(r){if(this.spaces+=r[1],this.current.nodes){var c=this.current.nodes[this.current.nodes.length-1];c&&c.type===`rule`&&!c.raws.ownSemicolon&&(c.raws.ownSemicolon=this.spaces,this.spaces=``)}},r.getPosition=function getPosition(r){var c=this.input.fromOffset(r);return{column:c.col,line:c.line,offset:r}},r.init=function init(r,c){this.current.push(r),r.source={input:this.input,start:this.getPosition(c)},r.raws.before=this.spaces,this.spaces=``,r.type!==`comment`&&(this.semicolon=!1)},r.other=function other(r){for(var c=!1,l=null,u=!1,p=null,m=[],h=r[1].startsWith(`--`),g=[],v=r;v;){if(l=v[0],g.push(v),l===`(`||l===`[`)p||(p=v),m.push(l===`(`?`)`:`]`);else if(h&&u&&l===`{`)p||(p=v),m.push(`}`);else if(m.length===0)if(l===`;`)if(u){this.decl(g,h);return}else break;else if(l===`{`){this.rule(g);return}else if(l===`}`){this.tokenizer.back(g.pop()),c=!0;break}else l===`:`&&(u=!0);else l===m[m.length-1]&&(m.pop(),m.length===0&&(p=null));v=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(c=!0),m.length>0&&this.unclosedBracket(p),c&&u){if(!h)for(;g.length&&(v=g[g.length-1][0],v===`space`||v===`comment`);)this.tokenizer.back(g.pop());this.decl(g,h)}else this.unknownWord(g)},r.parse=function parse(){for(var r;!this.tokenizer.endOfFile();)switch(r=this.tokenizer.nextToken(),r[0]){case`space`:this.spaces+=r[1];break;case`;`:this.freeSemicolon(r);break;case`}`:this.end(r);break;case`comment`:this.comment(r);break;case`at-word`:this.atrule(r);break;case`{`:this.emptyRule(r);break;default:this.other(r);break}this.endFile()},r.precheckMissedSemicolon=function precheckMissedSemicolon(){},r.raw=function raw(r,c,l,u){for(var p,m,h=l.length,g=``,v=!0,y,b,x=0;x<h;x+=1)p=l[x],m=p[0],m===`space`&&x===h-1&&!u?v=!1:m===`comment`?(b=l[x-1]?l[x-1][0]:`empty`,y=l[x+1]?l[x+1][0]:`empty`,!_s[b]&&!_s[y]?g.slice(-1)===`,`?v=!1:g+=p[1]:v=!1):g+=p[1];if(!v){var S=l.reduce(function(r,c){return r+c[1]},``);r.raws[c]={raw:S,value:g}}r[c]=g},r.rule=function rule(r){r.pop();var c=new gs;this.init(c,r[0][2]),c.raws.between=this.spacesAndCommentsFromEnd(r),this.raw(c,`selector`,r),this.current=c},r.spacesAndCommentsFromEnd=function spacesAndCommentsFromEnd(r){for(var c,l=``;r.length&&(c=r[r.length-1][0],c===`space`||c===`comment`);)l=r.pop()[1]+l;return l},r.spacesAndCommentsFromStart=function spacesAndCommentsFromStart(r){for(var c,l=``;r.length&&(c=r[0][0],c===`space`||c===`comment`);)l+=r.shift()[1];return l},r.spacesFromEnd=function spacesFromEnd(r){for(var c,l=``;r.length&&(c=r[r.length-1][0],c===`space`);)l=r.pop()[1]+l;return l},r.stringFrom=function stringFrom(r,c){for(var l=``,u=c;u<r.length;u++)l+=r[u][1];return r.splice(c,r.length-c),l},r.unclosedBlock=function unclosedBlock(){var r=this.current.source.start;throw this.input.error(`Unclosed block`,r.line,r.column)},r.unclosedBracket=function unclosedBracket(r){throw this.input.error(`Unclosed bracket`,{offset:r[2]},{offset:r[2]+1})},r.unexpectedClose=function unexpectedClose(r){throw this.input.error(`Unexpected }`,{offset:r[2]},{offset:r[2]+1})},r.unknownWord=function unknownWord(r){throw this.input.error(`Unknown word`,{offset:r[0][2]},{offset:r[0][2]+r[0][1].length})},r.unnamedAtrule=function unnamedAtrule(r,c){throw this.input.error(`At-rule without name`,{offset:c[2]},{offset:c[2]+c[1].length})},Parser2}(),ys=go,bs=vs,xs=Ga;function parse$3(r,c){var l=new bs(new xs(r,c));try{l.parse()}catch(r){throw r}return l.root}var Ss=parse$3;parse$3.default=parse$3,ys.registerParse(parse$3);var Cs=oa.isClean,ws=oa.my,Ts=no,Es=da,Ds=go,Os=xo,ks=Eo,As=Ss,js=is,Ms={atrule:`AtRule`,comment:`Comment`,decl:`Declaration`,document:`Document`,root:`Root`,rule:`Rule`},Ns={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},Ps={Once:!0,postcssPlugin:!0,prepare:!0},Fs=0;function isPromise(r){return(r===void 0?`undefined`:_type_of(r))===`object`&&typeof r.then==`function`}function getEvents(r){var c=!1,l=Ms[r.type];return r.type===`decl`?c=r.prop.toLowerCase():r.type===`atrule`&&(c=r.name.toLowerCase()),c&&r.append?[l,l+`-`+c,Fs,l+`Exit`,l+`Exit-`+c]:c?[l,l+`-`+c,l+`Exit`,l+`Exit-`+c]:r.append?[l,Fs,l+`Exit`]:[l,l+`Exit`]}function toStack(r){return{eventIndex:0,events:r.type===`document`?[`Document`,Fs,`DocumentExit`]:r.type===`root`?[`Root`,Fs,`RootExit`]:getEvents(r),iterator:0,node:r,visitorIndex:0,visitors:[]}}function cleanMarks(r){return r[Cs]=!1,r.nodes&&r.nodes.forEach(function(r){return cleanMarks(r)}),r}var Is={},Ls=function(){function LazyResult2(r,c,l){var u=this;this.stringified=!1,this.processed=!1;var p;if((c===void 0?`undefined`:_type_of(c))===`object`&&c!==null&&(c.type===`root`||c.type===`document`))p=cleanMarks(c);else if(_instanceof(c,LazyResult2)||_instanceof(c,ks))p=cleanMarks(c.root),c.map&&(l.map===void 0&&(l.map={}),l.map.inline||(l.map.inline=!1),l.map.prev=c.map);else{var m=As;l.syntax&&(m=l.syntax.parse),l.parser&&(m=l.parser),m.parse&&(m=m.parse);try{p=m(c,l)}catch(r){this.processed=!0,this.error=r}p&&!p[ws]&&Ds.rebuild(p)}this.result=new ks(r,p,l),this.helpers=_extends({},Is,{postcss:Is,result:this.result}),this.plugins=this.processor.plugins.map(function(r){return(r===void 0?`undefined`:_type_of(r))===`object`&&r.prepare?_extends({},r,r.prepare(u.result)):r})}var r=LazyResult2.prototype;return r.async=function async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)},r.catch=function _catch(r){return this.async().catch(r)},r.finally=function _finally(r){return this.async().then(r,r)},r.getAsyncError=function getAsyncError(){throw Error(`Use process(css).then(cb) to work with async plugins`)},r.handleError=function handleError(r,c){var l=this.result.lastPlugin;try{c&&c.addToError(r),this.error=r,r.name===`CssSyntaxError`&&!r.plugin?(r.plugin=l.postcssPlugin,r.setMessage()):l.postcssVersion}catch(r){console&&console.error&&console.error(r)}return r},r.prepareVisitors=function prepareVisitors(){var r=this;this.listeners={};for(var add=function(c,l,u){r.listeners[l]||(r.listeners[l]=[]),r.listeners[l].push([c,u])},c=_create_for_of_iterator_helper_loose(this.plugins),l;!(l=c()).done;){var u=l.value;if((u===void 0?`undefined`:_type_of(u))===`object`)for(var p in u){if(!Ns[p]&&/^[A-Z]/.test(p))throw Error(`Unknown event `+p+` in `+u.postcssPlugin+`. Try to update PostCSS (`+this.processor.version+` now).`);if(!Ps[p])if(_type_of(u[p])===`object`)for(var m in u[p])m===`*`?add(u,p,u[p][m]):add(u,p+`-`+m.toLowerCase(),u[p][m]);else typeof u[p]==`function`&&add(u,p,u[p])}}this.hasListener=Object.keys(this.listeners).length>0},r.runAsync=function runAsync(){var r=this;return _async_to_generator(function(){var c,l,u,p,m,h,g,v,y,_loop,b,x;return _ts_generator(this,function(S){switch(S.label){case 0:r.plugin=0,c=0,S.label=1;case 1:if(!(c<r.plugins.length))return[3,6];if(l=r.plugins[c],u=r.runOnRoot(l),!isPromise(u))return[3,5];S.label=2;case 2:return S.trys.push([2,4,,5]),[4,u];case 3:return S.sent(),[3,5];case 4:throw p=S.sent(),r.handleError(p);case 5:return c++,[3,1];case 6:if(r.prepareVisitors(),!r.hasListener)return[3,18];m=r.result.root,S.label=7;case 7:if(m[Cs])return[3,14];m[Cs]=!0,h=[toStack(m)],S.label=8;case 8:if(!(h.length>0))return[3,13];if(g=r.visitTick(h),!isPromise(g))return[3,12];S.label=9;case 9:return S.trys.push([9,11,,12]),[4,g];case 10:return S.sent(),[3,12];case 11:throw v=S.sent(),y=h[h.length-1].node,r.handleError(v,y);case 12:return[3,8];case 13:return[3,7];case 14:if(!r.listeners.OnceExit)return[3,18];_loop=function(){var c,l,u,p,h;return _ts_generator(this,function(g){switch(g.label){case 0:c=x.value,l=c[0],u=c[1],r.result.lastPlugin=l,g.label=1;case 1:return g.trys.push([1,6,,7]),m.type===`document`?(p=m.nodes.map(function(c){return u(c,r.helpers)}),[4,Promise.all(p)]):[3,3];case 2:return g.sent(),[3,5];case 3:return[4,u(m,r.helpers)];case 4:g.sent(),g.label=5;case 5:return[3,7];case 6:throw h=g.sent(),r.handleError(h);case 7:return[2]}})},b=_create_for_of_iterator_helper_loose(r.listeners.OnceExit),S.label=15;case 15:return(x=b()).done?[3,18]:[5,_ts_values(_loop())];case 16:S.sent(),S.label=17;case 17:return[3,15];case 18:return r.processed=!0,[2,r.stringify()]}})})()},r.runOnRoot=function runOnRoot(r){var c=this;this.result.lastPlugin=r;try{if((r===void 0?`undefined`:_type_of(r))===`object`&&r.Once){if(this.result.root.type===`document`){var l=this.result.root.nodes.map(function(l){return r.Once(l,c.helpers)});return isPromise(l[0])?Promise.all(l):l}return r.Once(this.result.root,this.helpers)}else if(typeof r==`function`)return r(this.result.root,this.result)}catch(r){throw this.handleError(r)}},r.stringify=function stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();var r=this.result.opts,c=Es;r.syntax&&(c=r.syntax.stringify),r.stringifier&&(c=r.stringifier),c.stringify&&(c=c.stringify);var l=new Ts(c,this.result.root,this.result.opts).generate();return this.result.css=l[0],this.result.map=l[1],this.result},r.sync=function sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(var r=_create_for_of_iterator_helper_loose(this.plugins),c;!(c=r()).done;){var l=c.value;if(isPromise(this.runOnRoot(l)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){for(var u=this.result.root;!u[Cs];)u[Cs]=!0,this.walkSync(u);if(this.listeners.OnceExit)if(u.type===`document`)for(var p=_create_for_of_iterator_helper_loose(u.nodes),m;!(m=p()).done;){var h=m.value;this.visitSync(this.listeners.OnceExit,h)}else this.visitSync(this.listeners.OnceExit,u)}return this.result},r.then=function then(r,c){return this.async().then(r,c)},r.toString=function toString(){return this.css},r.visitSync=function visitSync(r,c){for(var l=_create_for_of_iterator_helper_loose(r),u;!(u=l()).done;){var p=u.value,m=p[0],h=p[1];this.result.lastPlugin=m;var g=void 0;try{g=h(c,this.helpers)}catch(r){throw this.handleError(r,c.proxyOf)}if(c.type!==`root`&&c.type!==`document`&&!c.parent)return!0;if(isPromise(g))throw this.getAsyncError()}},r.visitTick=function visitTick(r){var c=r[r.length-1],l=c.node,u=c.visitors;if(l.type!==`root`&&l.type!==`document`&&!l.parent){r.pop();return}if(u.length>0&&c.visitorIndex<u.length){var p=u[c.visitorIndex],m=p[0],h=p[1];c.visitorIndex+=1,c.visitorIndex===u.length&&(c.visitors=[],c.visitorIndex=0),this.result.lastPlugin=m;try{return h(l.toProxy(),this.helpers)}catch(r){throw this.handleError(r,l)}}if(c.iterator!==0){for(var g=c.iterator,v;v=l.nodes[l.indexes[g]];)if(l.indexes[g]+=1,!v[Cs]){v[Cs]=!0,r.push(toStack(v));return}c.iterator=0,delete l.indexes[g]}for(var y=c.events;c.eventIndex<y.length;){var b=y[c.eventIndex];if(c.eventIndex+=1,b===Fs){l.nodes&&l.nodes.length&&(l[Cs]=!0,c.iterator=l.getIterator());return}else if(this.listeners[b]){c.visitors=this.listeners[b];return}}r.pop()},r.walkSync=function walkSync(r){var c=this;r[Cs]=!0;for(var l=_create_for_of_iterator_helper_loose(getEvents(r)),u;!(u=l()).done;){var p=u.value;if(p===Fs)r.nodes&&r.each(function(r){r[Cs]||c.walkSync(r)});else{var m=this.listeners[p];if(m&&this.visitSync(m,r.toProxy()))return}}},r.warnings=function warnings(){return this.sync().warnings()},_create_class(LazyResult2,[{key:`content`,get:function get(){return this.stringify().content}},{key:`css`,get:function get(){return this.stringify().css}},{key:`map`,get:function get(){return this.stringify().map}},{key:`messages`,get:function get(){return this.sync().messages}},{key:`opts`,get:function get(){return this.result.opts}},{key:`processor`,get:function get(){return this.result.processor}},{key:`root`,get:function get(){return this.sync().root}},{key:Symbol.toStringTag,get:function get(){return`LazyResult`}}]),LazyResult2}();Ls.registerPostcss=function(r){Is=r};var Rs=Ls;Ls.default=Ls,js.registerLazyResult(Ls),Os.registerLazyResult(Ls);var zs=no,Bs=da,Vs=Ss,Hs=Eo,Us=function(){function NoWorkResult2(r,c,l){c=c.toString(),this.stringified=!1,this._processor=r,this._css=c,this._opts=l,this._map=void 0;var u,p=Bs;this.result=new Hs(this._processor,u,this._opts),this.result.css=c;var m=this;Object.defineProperty(this.result,"root",{get:function get(){return m.root}});var h=new zs(p,u,this._opts,c);if(h.isMap()){var g=h.generate(),v=g[0],y=g[1];v&&(this.result.css=v),y&&(this.result.map=y)}else h.clearAnnotation(),this.result.css=h.css}var r=NoWorkResult2.prototype;return r.async=function async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)},r.catch=function _catch(r){return this.async().catch(r)},r.finally=function _finally(r){return this.async().then(r,r)},r.sync=function sync(){if(this.error)throw this.error;return this.result},r.then=function then(r,c){return this.async().then(r,c)},r.toString=function toString(){return this._css},r.warnings=function warnings(){return[]},_create_class(NoWorkResult2,[{key:`content`,get:function get(){return this.result.css}},{key:`css`,get:function get(){return this.result.css}},{key:`map`,get:function get(){return this.result.map}},{key:`messages`,get:function get(){return[]}},{key:`opts`,get:function get(){return this.result.opts}},{key:`processor`,get:function get(){return this.result.processor}},{key:`root`,get:function get(){if(this._root)return this._root;var r,c=Vs;try{r=c(this._css,this._opts)}catch(r){this.error=r}if(this.error)throw this.error;return this._root=r,r}},{key:Symbol.toStringTag,get:function get(){return`NoWorkResult`}}]),NoWorkResult2}(),Ws=Us;Us.default=Us;var Gs=Ws,Ks=Rs,qs=xo,Js=is,Ys=function(){function Processor2(r){r===void 0&&(r=[]),this.version=`8.4.38`,this.plugins=this.normalize(r)}var r=Processor2.prototype;return r.normalize=function normalize(r){for(var c=[],l=_create_for_of_iterator_helper_loose(r),u;!(u=l()).done;){var p=u.value;if(p.postcss===!0?p=p():p.postcss&&(p=p.postcss),(p===void 0?`undefined`:_type_of(p))===`object`&&Array.isArray(p.plugins))c=c.concat(p.plugins);else if((p===void 0?`undefined`:_type_of(p))===`object`&&p.postcssPlugin)c.push(p);else if(typeof p==`function`)c.push(p);else if(!((p===void 0?`undefined`:_type_of(p))===`object`&&(p.parse||p.stringify)))throw Error(p+` is not a PostCSS plugin`)}return c},r.process=function process1(r,c){return c===void 0&&(c={}),!this.plugins.length&&!c.parser&&!c.stringifier&&!c.syntax?new Gs(this,r,c):new Ks(this,r,c)},r.use=function use(r){return this.plugins=this.plugins.concat(this.normalize([r])),this},Processor2}(),Xs=Ys;Ys.default=Ys,Js.registerProcessor(Ys),qs.registerProcessor(Ys);var Zs=ba,Qs=Aa,$s=io,ec=$o,tc=Ga,nc=is,rc=us;function fromJSON$1(r,c){if(Array.isArray(r))return r.map(function(r){return fromJSON$1(r)});var l=r.inputs,u=_object_without_properties_loose(r,[`inputs`]);if(l){c=[];for(var p=_create_for_of_iterator_helper_loose(l),m;!(m=p()).done;){var h=m.value,g=_extends({},h,{__proto__:tc.prototype});g.map&&(g.map=_extends({},g.map,{__proto__:Qs.prototype})),c.push(g)}}if(u.nodes&&(u.nodes=r.nodes.map(function(r){return fromJSON$1(r,c)})),u.source){var v=u.source,y=v.inputId;u.source=_object_without_properties_loose(v,[`inputId`]),y!=null&&(u.source.input=c[y])}if(u.type===`root`)return new nc(u);if(u.type===`decl`)return new Zs(u);if(u.type===`rule`)return new rc(u);if(u.type===`comment`)return new $s(u);if(u.type===`atrule`)return new ec(u);throw Error(`Unknown node type: `+r.type)}var ic=fromJSON$1;fromJSON$1.default=fromJSON$1;var ac=aa,oc=ba,sc=Rs,cc=go,lc=Xs,uc=da,dc=ic,fc=xo,pc=Co,mc=io,hc=$o,gc=Eo,_c=Ga,vc=Ss,yc=os,bc=us,xc=is,Sc=va;function postcss(){for(var r=arguments.length,c=Array(r),l=0;l<r;l++)c[l]=arguments[l];return c.length===1&&Array.isArray(c[0])&&(c=c[0]),new lc(c)}postcss.plugin=function plugin2(r,c){var l=!1;function creator(){for(var u=arguments.length,p=Array(u),m=0;m<u;m++)p[m]=arguments[m];console&&console.warn&&!l&&(l=!0,console.warn(r+`: postcss.plugin was deprecated. Migration guide: |
| 55 |
https://evilmartians.com/chronicles/postcss-8-plugin-migration`),{}.LANG&&{}.LANG.startsWith(`cn`)&&console.warn(r+`: 里面 postcss.plugin 被弃用. 迁移指南: |
| 56 |
https://www.w3ctech.com/topic/2226`));var h=c.apply(void 0,[].concat(p));return h.postcssPlugin=r,h.postcssVersion=new lc().version,h}var u;return Object.defineProperty(creator,"postcss",{get:function get(){return u||(u=creator()),u}}),creator.process=function(r,c,l){return postcss([creator(l)]).process(r,c)},creator},postcss.stringify=uc,postcss.parse=vc,postcss.fromJSON=dc,postcss.list=yc,postcss.comment=function(r){return new mc(r)},postcss.atRule=function(r){return new hc(r)},postcss.decl=function(r){return new oc(r)},postcss.rule=function(r){return new bc(r)},postcss.root=function(r){return new xc(r)},postcss.document=function(r){return new fc(r)},postcss.CssSyntaxError=ac,postcss.Declaration=oc,postcss.Container=cc,postcss.Processor=lc,postcss.Document=fc,postcss.Comment=mc,postcss.Warning=pc,postcss.AtRule=hc,postcss.Result=gc,postcss.Input=_c,postcss.Rule=bc,postcss.Root=xc,postcss.Node=Sc,sc.registerPostcss(postcss);var Cc=postcss;postcss.default=postcss;var H=getDefaultExportFromCjs(Cc);H.stringify,H.fromJSON,H.plugin,H.parse,H.list,H.document,H.comment,H.atRule,H.rule,H.decl,H.root,H.CssSyntaxError,H.Declaration,H.Container,H.Processor,H.Document,H.Comment,H.Warning,H.AtRule,H.Result,H.Input,H.Rule,H.Root,H.Node;var wc=function(){function BaseRRNode(){for(var r=arguments.length,c=Array(r),l=0;l<r;l++)c[l]=arguments[l];__publicField2(this,`parentElement`,null),__publicField2(this,`parentNode`,null),__publicField2(this,`ownerDocument`),__publicField2(this,`firstChild`,null),__publicField2(this,`lastChild`,null),__publicField2(this,`previousSibling`,null),__publicField2(this,`nextSibling`,null),__publicField2(this,`ELEMENT_NODE`,1),__publicField2(this,`TEXT_NODE`,3),__publicField2(this,`nodeType`),__publicField2(this,`nodeName`),__publicField2(this,`RRNodeType`)}var r=BaseRRNode.prototype;return r.contains=function contains(r){if(!_instanceof(r,BaseRRNode)||r.ownerDocument!==this.ownerDocument)return!1;if(r===this)return!0;for(;r.parentNode;){if(r.parentNode===this)return!0;r=r.parentNode}return!1},r.appendChild=function appendChild(r){throw Error(`RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.`)},r.insertBefore=function insertBefore(r,c){throw Error(`RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.`)},r.removeChild=function removeChild(r){throw Error(`RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.`)},r.toString=function toString(){return`RRNode`},_create_class(BaseRRNode,[{key:`childNodes`,get:function get(){for(var r=[],c=this.firstChild;c;)r.push(c),c=c.nextSibling;return r}}]),BaseRRNode}(),Tc={Node:[`childNodes`,`parentNode`,`parentElement`,`textContent`],ShadowRoot:[`host`,`styleSheets`],Element:[`shadowRoot`,`querySelector`,`querySelectorAll`],MutationObserver:[]},Ec={Node:[`contains`,`getRootNode`],ShadowRoot:[`getSelection`],Element:[],MutationObserver:[`constructor`]},Dc={},isAngularZonePresent=function(){return!!globalThis.Zone};function getUntaintedPrototype(r){if(Dc[r])return Dc[r];var c=globalThis[r],l=c.prototype,u=r in Tc?Tc[r]:void 0,p=!!(u&&u.every(function(r){var c,u;return!!((u=(c=Object.getOwnPropertyDescriptor(l,r))==null?void 0:c.get)!=null&&u.toString().includes(`[native code]`))})),m=r in Ec?Ec[r]:void 0,h=!!(m&&m.every(function(r){var c;return typeof l[r]==`function`&&((c=l[r])==null?void 0:c.toString().includes(`[native code]`))}));if(p&&h&&!isAngularZonePresent())return Dc[r]=c.prototype,c.prototype;try{var g=document.createElement(`iframe`);document.body.appendChild(g);var v=g.contentWindow;if(!v)return c.prototype;var y=v[r].prototype;return document.body.removeChild(g),y?Dc[r]=y:l}catch(r){return l}}var Oc={};function getUntaintedAccessor(r,c,l){var u,p=r+`.`+String(l);if(Oc[p])return Oc[p].call(c);var m=getUntaintedPrototype(r),h=(u=Object.getOwnPropertyDescriptor(m,l))==null?void 0:u.get;return h?(Oc[p]=h,h.call(c)):c[l]}var kc={};function getUntaintedMethod(r,c,l){var u=r+`.`+String(l);if(kc[u])return kc[u].bind(c);var p=getUntaintedPrototype(r)[l];return typeof p==`function`?(kc[u]=p,p.bind(c)):c[l]}function childNodes(r){return getUntaintedAccessor(`Node`,r,`childNodes`)}function parentNode(r){return getUntaintedAccessor(`Node`,r,`parentNode`)}function parentElement(r){return getUntaintedAccessor(`Node`,r,`parentElement`)}function textContent(r){return getUntaintedAccessor(`Node`,r,`textContent`)}function contains(r,c){return getUntaintedMethod(`Node`,r,`contains`)(c)}function getRootNode(r){return getUntaintedMethod(`Node`,r,`getRootNode`)()}function host(r){return!r||!(`host`in r)?null:getUntaintedAccessor(`ShadowRoot`,r,`host`)}function styleSheets(r){return r.styleSheets}function shadowRoot(r){return!r||!(`shadowRoot`in r)?null:getUntaintedAccessor(`Element`,r,`shadowRoot`)}function querySelector(r,c){return getUntaintedAccessor(`Element`,r,`querySelector`)(c)}function querySelectorAll(r,c){return getUntaintedAccessor(`Element`,r,`querySelectorAll`)(c)}function mutationObserverCtor(){return getUntaintedPrototype(`MutationObserver`).constructor}function patch(r,c,l){try{if(!(c in r))return function(){};var u=r[c],p=l(u);return typeof p==`function`&&(p.prototype=p.prototype||{},Object.defineProperties(p,{__rrweb_original__:{enumerable:!1,value:u}})),r[c]=p,function(){r[c]=u}}catch(r){return function(){}}}var U={childNodes,parentNode,parentElement,textContent,contains,getRootNode,host,styleSheets,shadowRoot,querySelector,querySelectorAll,mutationObserver:mutationObserverCtor,patch};function on(r,c,l){l===void 0&&(l=document);var u={capture:!0,passive:!0};return l.addEventListener(r,c,u),function(){return l.removeEventListener(r,c,u)}}var Ac=`Please stop import mirror directly. Instead of that,\r |
| 57 |
now you can use replayer.getMirror() to access the mirror instance of a replayer,\r |
| 58 |
or you can use record.mirror to access the mirror instance during recording.`,jc={map:{},getId:function getId(){return console.error(Ac),-1},getNode:function getNode(){return console.error(Ac),null},removeNodeFromMap:function removeNodeFromMap(){console.error(Ac)},has:function has(){return console.error(Ac),!1},reset:function reset(){console.error(Ac)}};typeof window<`u`&&window.Proxy&&window.Reflect&&(jc=new Proxy(jc,{get:function get(r,c,l){return c===`map`&&console.error(Ac),Reflect.get(r,c,l)}}));function throttle(r,c,l){l===void 0&&(l={});var u=null,p=0;return function(){for(var m=arguments.length,h=Array(m),g=0;g<m;g++)h[g]=arguments[g];var v=Date.now();!p&&l.leading===!1&&(p=v);var y=c-(v-p),b=this;y<=0||y>c?(u&&(clearTimeout(u),u=null),p=v,r.apply(b,h)):!u&&l.trailing!==!1&&(u=setTimeout(function(){p=l.leading===!1?0:Date.now(),u=null,r.apply(b,h)},y))}}function hookSetter(r,c,l,u,p){p===void 0&&(p=window);var m=p.Object.getOwnPropertyDescriptor(r,c);return p.Object.defineProperty(r,c,u?l:{set:function set(r){var c=this;setTimeout(function(){l.set.call(c,r)},0),m&&m.set&&m.set.call(this,r)}}),function(){return hookSetter(r,c,m||{},!0)}}var nowTimestamp=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(nowTimestamp=function(){return new Date().getTime()});function getWindowScroll(r){var c,l,u,p,m=r.document;return{left:m.scrollingElement?m.scrollingElement.scrollLeft:r.pageXOffset===void 0?m.documentElement.scrollLeft||(m==null?void 0:m.body)&&((c=U.parentElement(m.body))==null?void 0:c.scrollLeft)||((l=m==null?void 0:m.body)==null?void 0:l.scrollLeft)||0:r.pageXOffset,top:m.scrollingElement?m.scrollingElement.scrollTop:r.pageYOffset===void 0?(m==null?void 0:m.documentElement.scrollTop)||(m==null?void 0:m.body)&&((u=U.parentElement(m.body))==null?void 0:u.scrollTop)||((p=m==null?void 0:m.body)==null?void 0:p.scrollTop)||0:r.pageYOffset}}function getWindowHeight(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function getWindowWidth(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function closestElementOfNode(r){return r?r.nodeType===r.ELEMENT_NODE?r:U.parentElement(r):null}function isBlocked(r,c,l,u){if(!r)return!1;var p=closestElementOfNode(r);if(!p)return!1;try{if(typeof c==`string`){if(p.classList.contains(c)||u&&p.closest(`.`+c)!==null)return!0}else if(classMatchesRegex(p,c,u))return!0}catch(r){}return!!(l&&(p.matches(l)||u&&p.closest(l)!==null))}function isSerialized(r,c){return c.getId(r)!==-1}function isIgnored(r,c,l){return r.tagName===`TITLE`&&l.headTitleMutations?!0:c.getId(r)===yt}function isAncestorRemoved(r,c){if(isShadowRoot(r))return!1;var l=c.getId(r);if(!c.has(l))return!0;var u=U.parentNode(r);return u&&u.nodeType===r.DOCUMENT_NODE?!1:!u||isAncestorRemoved(u,c)}function legacy_isTouchEvent(r){return!!r.changedTouches}function polyfill$1(r){r===void 0&&(r=window),`NodeList`in r&&!r.NodeList.prototype.forEach&&(r.NodeList.prototype.forEach=Array.prototype.forEach),`DOMTokenList`in r&&!r.DOMTokenList.prototype.forEach&&(r.DOMTokenList.prototype.forEach=Array.prototype.forEach)}function isSerializedIframe(r,c){return!!(r.nodeName===`IFRAME`&&c.getMeta(r))}function isSerializedStylesheet(r,c){return!!(r.nodeName===`LINK`&&r.nodeType===r.ELEMENT_NODE&&r.getAttribute&&r.getAttribute(`rel`)===`stylesheet`&&c.getMeta(r))}function hasShadowRoot(r){return r?_instanceof(r,wc)&&`shadowRoot`in r?!!r.shadowRoot:!!U.shadowRoot(r):!1}var Mc=function(){function StyleSheetMirror(){__publicField(this,`id`,1),__publicField(this,`styleIDMap`,new WeakMap),__publicField(this,`idStyleMap`,new Map)}var r=StyleSheetMirror.prototype;return r.getId=function getId(r){var c;return(c=this.styleIDMap.get(r))==null?-1:c},r.has=function has(r){return this.styleIDMap.has(r)},r.add=function add(r,c){if(this.has(r))return this.getId(r);var l=c===void 0?this.id++:c;return this.styleIDMap.set(r,l),this.idStyleMap.set(l,r),l},r.getStyle=function getStyle(r){return this.idStyleMap.get(r)||null},r.reset=function reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1},r.generateId=function generateId(){return this.id++},StyleSheetMirror}();function getShadowHost(r){var c,l=null;return`getRootNode`in r&&((c=U.getRootNode(r))==null?void 0:c.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&U.host(U.getRootNode(r))&&(l=U.host(U.getRootNode(r))),l}function getRootShadowHost(r){for(var c=r,l;l=getShadowHost(c);)c=l;return c}function shadowHostInDom(r){var c=r.ownerDocument;if(!c)return!1;var l=getRootShadowHost(r);return U.contains(c,l)}function inDom(r){var c=r.ownerDocument;return c?U.contains(c,r)||shadowHostInDom(r):!1}var W=function(r){return r[r.DomContentLoaded=0]=`DomContentLoaded`,r[r.Load=1]=`Load`,r[r.FullSnapshot=2]=`FullSnapshot`,r[r.IncrementalSnapshot=3]=`IncrementalSnapshot`,r[r.Meta=4]=`Meta`,r[r.Custom=5]=`Custom`,r[r.Plugin=6]=`Plugin`,r}(W||{}),G=function(r){return r[r.Mutation=0]=`Mutation`,r[r.MouseMove=1]=`MouseMove`,r[r.MouseInteraction=2]=`MouseInteraction`,r[r.Scroll=3]=`Scroll`,r[r.ViewportResize=4]=`ViewportResize`,r[r.Input=5]=`Input`,r[r.TouchMove=6]=`TouchMove`,r[r.MediaInteraction=7]=`MediaInteraction`,r[r.StyleSheetRule=8]=`StyleSheetRule`,r[r.CanvasMutation=9]=`CanvasMutation`,r[r.Font=10]=`Font`,r[r.Log=11]=`Log`,r[r.Drag=12]=`Drag`,r[r.StyleDeclaration=13]=`StyleDeclaration`,r[r.Selection=14]=`Selection`,r[r.AdoptedStyleSheet=15]=`AdoptedStyleSheet`,r[r.CustomElement=16]=`CustomElement`,r}(G||{}),Nc=function(r){return r[r.MouseUp=0]=`MouseUp`,r[r.MouseDown=1]=`MouseDown`,r[r.Click=2]=`Click`,r[r.ContextMenu=3]=`ContextMenu`,r[r.DblClick=4]=`DblClick`,r[r.Focus=5]=`Focus`,r[r.Blur=6]=`Blur`,r[r.TouchStart=7]=`TouchStart`,r[r.TouchMove_Departed=8]=`TouchMove_Departed`,r[r.TouchEnd=9]=`TouchEnd`,r[r.TouchCancel=10]=`TouchCancel`,r}(Nc||{}),Pc=function(r){return r[r.Mouse=0]=`Mouse`,r[r.Pen=1]=`Pen`,r[r.Touch=2]=`Touch`,r}(Pc||{}),Fc=function(r){return r[r[`2D`]=0]=`2D`,r[r.WebGL=1]=`WebGL`,r[r.WebGL2=2]=`WebGL2`,r}(Fc||{}),Ic=function(r){return r[r.Play=0]=`Play`,r[r.Pause=1]=`Pause`,r[r.Seeked=2]=`Seeked`,r[r.VolumeChange=3]=`VolumeChange`,r[r.RateChange=4]=`RateChange`,r}(Ic||{}),Lc=function(r){return r[r.Document=0]=`Document`,r[r.DocumentType=1]=`DocumentType`,r[r.Element=2]=`Element`,r[r.Text=3]=`Text`,r[r.CDATA=4]=`CDATA`,r[r.Comment=5]=`Comment`,r}(Lc||{});function isNodeInLinkedList(r){return`__ln`in r}var Rc=function(){function DoubleLinkedList(){__publicField(this,`length`,0),__publicField(this,`head`,null),__publicField(this,`tail`,null)}var r=DoubleLinkedList.prototype;return r.get=function get(r){if(r>=this.length)throw Error(`Position outside of list range`);for(var c=this.head,l=0;l<r;l++)c=(c==null?void 0:c.next)||null;return c},r.addNode=function addNode(r){var c={value:r,previous:null,next:null};if(r.__ln=c,r.previousSibling&&isNodeInLinkedList(r.previousSibling)){var l=r.previousSibling.__ln.next;c.next=l,c.previous=r.previousSibling.__ln,r.previousSibling.__ln.next=c,l&&(l.previous=c)}else if(r.nextSibling&&isNodeInLinkedList(r.nextSibling)&&r.nextSibling.__ln.previous){var u=r.nextSibling.__ln.previous;c.previous=u,c.next=r.nextSibling.__ln,r.nextSibling.__ln.previous=c,u&&(u.next=c)}else this.head&&(this.head.previous=c),c.next=this.head,this.head=c;c.next===null&&(this.tail=c),this.length++},r.removeNode=function removeNode(r){var c=r.__ln;this.head&&(c.previous?(c.previous.next=c.next,c.next?c.next.previous=c.previous:this.tail=c.previous):(this.head=c.next,this.head?this.head.previous=null:this.tail=null),r.__ln&&delete r.__ln,this.length--)},DoubleLinkedList}(),moveKey=function(r,c){return r+`@`+c},zc=function(){function MutationBuffer(){var r=this;__publicField(this,`frozen`,!1),__publicField(this,`locked`,!1),__publicField(this,`texts`,[]),__publicField(this,`attributes`,[]),__publicField(this,`attributeMap`,new WeakMap),__publicField(this,`removes`,[]),__publicField(this,`mapRemoves`,[]),__publicField(this,`movedMap`,{}),__publicField(this,`addedSet`,new Set),__publicField(this,`movedSet`,new Set),__publicField(this,`droppedSet`,new Set),__publicField(this,`removesSubTreeCache`,new Set),__publicField(this,`mutationCb`),__publicField(this,`blockClass`),__publicField(this,`blockSelector`),__publicField(this,`maskTextClass`),__publicField(this,`maskTextSelector`),__publicField(this,`inlineStylesheet`),__publicField(this,`maskInputOptions`),__publicField(this,`maskTextFn`),__publicField(this,`maskInputFn`),__publicField(this,`keepIframeSrcFn`),__publicField(this,`recordCanvas`),__publicField(this,`inlineImages`),__publicField(this,`slimDOMOptions`),__publicField(this,`dataURLOptions`),__publicField(this,`doc`),__publicField(this,`mirror`),__publicField(this,`iframeManager`),__publicField(this,`stylesheetManager`),__publicField(this,`shadowDomManager`),__publicField(this,`canvasManager`),__publicField(this,`processedNodeManager`),__publicField(this,`unattachedDoc`),__publicField(this,`processMutations`,function(c){c.forEach(r.processMutation),r.emit()}),__publicField(this,`emit`,function(){if(!(r.frozen||r.locked)){for(var c=[],l=new Set,u=new Rc,getNextId=function(c){for(var l=c,u=yt;u===yt;)l=l&&l.nextSibling,u=l&&r.mirror.getId(l);return u},pushAdd=function(p){var m=U.parentNode(p);if(!(!m||!inDom(p))){var h=!1;if(p.nodeType===Node.TEXT_NODE){var g=m.tagName;if(g===`TEXTAREA`)return;g===`STYLE`&&r.addedSet.has(m)&&(h=!0)}var v=isShadowRoot(m)?r.mirror.getId(getShadowHost(p)):r.mirror.getId(m),y=getNextId(p);if(v===-1||y===-1)return u.addNode(p);var b=serializeNodeWithId(p,{doc:r.doc,mirror:r.mirror,blockClass:r.blockClass,blockSelector:r.blockSelector,maskTextClass:r.maskTextClass,maskTextSelector:r.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:r.inlineStylesheet,maskInputOptions:r.maskInputOptions,maskTextFn:r.maskTextFn,maskInputFn:r.maskInputFn,slimDOMOptions:r.slimDOMOptions,dataURLOptions:r.dataURLOptions,recordCanvas:r.recordCanvas,inlineImages:r.inlineImages,onSerialize:function(c){isSerializedIframe(c,r.mirror)&&r.iframeManager.addIframe(c),isSerializedStylesheet(c,r.mirror)&&r.stylesheetManager.trackLinkElement(c),hasShadowRoot(p)&&r.shadowDomManager.addShadowRoot(U.shadowRoot(p),r.doc)},onIframeLoad:function(c,l){r.iframeManager.attachIframe(c,l),r.shadowDomManager.observeAttachShadow(c)},onStylesheetLoad:function(c,l){r.stylesheetManager.attachLinkElement(c,l)},cssCaptured:h});b&&(c.push({parentId:v,nextId:y,node:b}),l.add(b.id))}};r.mapRemoves.length;)r.mirror.removeNodeFromMap(r.mapRemoves.shift());for(var p=_create_for_of_iterator_helper_loose(r.movedSet),m;!(m=p()).done;){var h=m.value;isParentRemoved(r.removesSubTreeCache,h,r.mirror)&&!r.movedSet.has(U.parentNode(h))||pushAdd(h)}for(var g=_create_for_of_iterator_helper_loose(r.addedSet),v;!(v=g()).done;){var y=v.value;!isAncestorInSet(r.droppedSet,y)&&!isParentRemoved(r.removesSubTreeCache,y,r.mirror)||isAncestorInSet(r.movedSet,y)?pushAdd(y):r.droppedSet.add(y)}for(var b=null;u.length;){var x=null;if(b){var S=r.mirror.getId(U.parentNode(b.value)),C=getNextId(b.value);S!==-1&&C!==-1&&(x=b)}if(!x)for(var w=u.tail;w;){var T=w;if(w=w.previous,T){var E=r.mirror.getId(U.parentNode(T.value));if(getNextId(T.value)===-1)continue;if(E!==-1){x=T;break}else{var D=T.value,O=U.parentNode(D);if(O&&O.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var k=U.host(O);if(r.mirror.getId(k)!==-1){x=T;break}}}}}if(!x){for(;u.head;)u.removeNode(u.head.value);break}b=x.previous,u.removeNode(x.value),pushAdd(x.value)}var A={texts:r.texts.map(function(c){var l=c.node,u=U.parentNode(l);return u&&u.tagName===`TEXTAREA`&&r.genTextAreaValueMutation(u),{id:r.mirror.getId(l),value:c.value}}).filter(function(r){return!l.has(r.id)}).filter(function(c){return r.mirror.has(c.id)}),attributes:r.attributes.map(function(c){var l=c.attributes;if(typeof l.style==`string`){var u=JSON.stringify(c.styleDiff),p=JSON.stringify(c._unchangedStyles);u.length<l.style.length&&(u+p).split(`var(`).length===l.style.split(`var(`).length&&(l.style=c.styleDiff)}return{id:r.mirror.getId(c.node),attributes:l}}).filter(function(r){return!l.has(r.id)}).filter(function(c){return r.mirror.has(c.id)}),removes:r.removes,adds:c};!A.texts.length&&!A.attributes.length&&!A.removes.length&&!A.adds.length||(r.texts=[],r.attributes=[],r.attributeMap=new WeakMap,r.removes=[],r.addedSet=new Set,r.movedSet=new Set,r.droppedSet=new Set,r.removesSubTreeCache=new Set,r.movedMap={},r.mutationCb(A))}}),__publicField(this,`genTextAreaValueMutation`,function(c){var l=r.attributeMap.get(c);l||(l={node:c,attributes:{},styleDiff:{},_unchangedStyles:{}},r.attributes.push(l),r.attributeMap.set(c,l));var u=Array.from(U.childNodes(c),function(r){return U.textContent(r)||``}).join(``);l.attributes.value=maskInputValue({element:c,maskInputOptions:r.maskInputOptions,tagName:c.tagName,type:getInputType(c),value:u,maskInputFn:r.maskInputFn})}),__publicField(this,`processMutation`,function(c){if(!isIgnored(c.target,r.mirror,r.slimDOMOptions))switch(c.type){case`characterData`:var l=U.textContent(c.target);!isBlocked(c.target,r.blockClass,r.blockSelector,!1)&&l!==c.oldValue&&r.texts.push({value:needMaskingText(c.target,r.maskTextClass,r.maskTextSelector,!0)&&l?r.maskTextFn?r.maskTextFn(l,closestElementOfNode(c.target)):l.replace(/[\S]/g,`*`):l,node:c.target});break;case`attributes`:var u=c.target,p=c.attributeName,m=c.target.getAttribute(p);if(p===`value`){var h=getInputType(u);m=maskInputValue({element:u,maskInputOptions:r.maskInputOptions,tagName:u.tagName,type:h,value:m,maskInputFn:r.maskInputFn})}if(isBlocked(c.target,r.blockClass,r.blockSelector,!1)||m===c.oldValue)return;var g=r.attributeMap.get(c.target);if(u.tagName===`IFRAME`&&p===`src`&&!r.keepIframeSrcFn(m))if(!u.contentDocument)p=`rr_src`;else return;if(g||(g={node:c.target,attributes:{},styleDiff:{},_unchangedStyles:{}},r.attributes.push(g),r.attributeMap.set(c.target,g)),p===`type`&&u.tagName===`INPUT`&&(c.oldValue||``).toLowerCase()===`password`&&u.setAttribute(`data-rr-is-password`,`true`),!ignoreAttribute(u.tagName,p))if(g.attributes[p]=transformAttribute(r.doc,toLowerCase(u.tagName),toLowerCase(p),m),p===`style`){if(!r.unattachedDoc)try{r.unattachedDoc=document.implementation.createHTMLDocument()}catch(c){r.unattachedDoc=r.doc}var v=r.unattachedDoc.createElement(`span`);c.oldValue&&v.setAttribute(`style`,c.oldValue);for(var y=_create_for_of_iterator_helper_loose(Array.from(u.style)),b;!(b=y()).done;){var x=b.value,S=u.style.getPropertyValue(x),C=u.style.getPropertyPriority(x);S!==v.style.getPropertyValue(x)||C!==v.style.getPropertyPriority(x)?C===``?g.styleDiff[x]=S:g.styleDiff[x]=[S,C]:g._unchangedStyles[x]=[S,C]}for(var w=_create_for_of_iterator_helper_loose(Array.from(v.style)),T;!(T=w()).done;){var E=T.value;u.style.getPropertyValue(E)===``&&(g.styleDiff[E]=!1)}}else p===`open`&&u.tagName===`DIALOG`&&(u.matches(`dialog:modal`)?g.attributes.rr_open_mode=`modal`:g.attributes.rr_open_mode=`non-modal`);break;case`childList`:if(isBlocked(c.target,r.blockClass,r.blockSelector,!0))return;if(c.target.tagName===`TEXTAREA`){r.genTextAreaValueMutation(c.target);return}c.addedNodes.forEach(function(l){return r.genAdds(l,c.target)}),c.removedNodes.forEach(function(l){var u=r.mirror.getId(l),p=isShadowRoot(c.target)?r.mirror.getId(U.host(c.target)):r.mirror.getId(c.target);isBlocked(c.target,r.blockClass,r.blockSelector,!1)||isIgnored(l,r.mirror,r.slimDOMOptions)||!isSerialized(l,r.mirror)||(r.addedSet.has(l)?(deepDelete(r.addedSet,l),r.droppedSet.add(l)):r.addedSet.has(c.target)&&u===-1||isAncestorRemoved(c.target,r.mirror)||(r.movedSet.has(l)&&r.movedMap[moveKey(u,p)]?deepDelete(r.movedSet,l):(r.removes.push({parentId:p,id:u,isShadow:isShadowRoot(c.target)&&isNativeShadowDom(c.target)?!0:void 0}),processRemoves(l,r.removesSubTreeCache))),r.mapRemoves.push(l))});break}}),__publicField(this,`genAdds`,function(c,l){if(!r.processedNodeManager.inOtherBuffer(c,r)&&!(r.addedSet.has(c)||r.movedSet.has(c))){if(r.mirror.hasNode(c)){if(isIgnored(c,r.mirror,r.slimDOMOptions))return;r.movedSet.add(c);var u=null;l&&r.mirror.hasNode(l)&&(u=r.mirror.getId(l)),u&&u!==-1&&(r.movedMap[moveKey(r.mirror.getId(c),u)]=!0)}else r.addedSet.add(c),r.droppedSet.delete(c);isBlocked(c,r.blockClass,r.blockSelector,!1)||(U.childNodes(c).forEach(function(c){return r.genAdds(c)}),hasShadowRoot(c)&&U.childNodes(U.shadowRoot(c)).forEach(function(l){r.processedNodeManager.add(l,r),r.genAdds(l,c)}))}})}var r=MutationBuffer.prototype;return r.init=function init(r){var c=this;[`mutationCb`,`blockClass`,`blockSelector`,`maskTextClass`,`maskTextSelector`,`inlineStylesheet`,`maskInputOptions`,`maskTextFn`,`maskInputFn`,`keepIframeSrcFn`,`recordCanvas`,`inlineImages`,`slimDOMOptions`,`dataURLOptions`,`doc`,`mirror`,`iframeManager`,`stylesheetManager`,`shadowDomManager`,`canvasManager`,`processedNodeManager`].forEach(function(l){c[l]=r[l]})},r.freeze=function freeze(){this.frozen=!0,this.canvasManager.freeze()},r.unfreeze=function unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()},r.isFrozen=function isFrozen(){return this.frozen},r.lock=function lock(){this.locked=!0,this.canvasManager.lock()},r.unlock=function unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()},r.reset=function reset(){this.shadowDomManager.reset(),this.canvasManager.reset()},MutationBuffer}();function deepDelete(r,c){r.delete(c),U.childNodes(c).forEach(function(c){return deepDelete(r,c)})}function processRemoves(r,c){for(var l=[r];l.length;){var u=l.pop();c.has(u)||(c.add(u),U.childNodes(u).forEach(function(r){return l.push(r)}))}}function isParentRemoved(r,c,l){return r.size!==0&&_isParentRemoved(r,c)}function _isParentRemoved(r,c,l){var u=U.parentNode(c);return u?r.has(u):!1}function isAncestorInSet(r,c){return r.size!==0&&_isAncestorInSet(r,c)}function _isAncestorInSet(r,c){var l=U.parentNode(c);return l?r.has(l)?!0:_isAncestorInSet(r,l):!1}var Bc;function registerErrorHandler(r){Bc=r}function unregisterErrorHandler(){Bc=void 0}var callbackWrapper=function(r){if(!Bc)return r;var rrwebWrapped=function(){for(var c=arguments.length,l=Array(c),u=0;u<c;u++)l[u]=arguments[u];try{return r.apply(void 0,[].concat(l))}catch(r){if(Bc&&Bc(r)===!0)return;throw r}};return rrwebWrapped},Vc=[];function getEventTarget(r){try{if(`composedPath`in r){var c=r.composedPath();if(c.length)return c[0]}else if(`path`in r&&r.path.length)return r.path[0]}catch(r){}return r&&r.target}function initMutationObserver(r,c){var l=new zc;Vc.push(l),l.init(r);var u=new(mutationObserverCtor())(callbackWrapper(l.processMutations.bind(l)));return u.observe(c,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),u}function initMoveObserver(r){var c=r.mousemoveCb,l=r.sampling,u=r.doc,p=r.mirror;if(l.mousemove===!1)return function(){};var m=typeof l.mousemove==`number`?l.mousemove:50,h=typeof l.mousemoveCallback==`number`?l.mousemoveCallback:500,g=[],v,y=throttle(callbackWrapper(function(r){var l=Date.now()-v;c(g.map(function(r){return r.timeOffset-=l,r}),r),g=[],v=null}),h),b=callbackWrapper(throttle(callbackWrapper(function(r){var c=getEventTarget(r),l=legacy_isTouchEvent(r)?r.changedTouches[0]:r,u=l.clientX,m=l.clientY;v||(v=nowTimestamp()),g.push({x:u,y:m,id:p.getId(c),timeOffset:nowTimestamp()-v}),y(typeof DragEvent<`u`&&_instanceof(r,DragEvent)?G.Drag:_instanceof(r,MouseEvent)?G.MouseMove:G.TouchMove)}),m,{trailing:!1})),x=[on(`mousemove`,b,u),on(`touchmove`,b,u),on(`drag`,b,u)];return callbackWrapper(function(){x.forEach(function(r){return r()})})}function initMouseInteractionObserver(r){var c=r.mouseInteractionCb,l=r.doc,u=r.mirror,p=r.blockClass,m=r.blockSelector,h=r.sampling;if(h.mouseInteraction===!1)return function(){};var g=h.mouseInteraction===!0||h.mouseInteraction===void 0?{}:h.mouseInteraction,v=[],y=null,getHandler=function(r){return function(l){var h=getEventTarget(l);if(!isBlocked(h,p,m,!0)){var g=null,v=r;if(`pointerType`in l){switch(l.pointerType){case`mouse`:g=Pc.Mouse;break;case`touch`:g=Pc.Touch;break;case`pen`:g=Pc.Pen;break}g===Pc.Touch?Nc[r]===Nc.MouseDown?v=`TouchStart`:Nc[r]===Nc.MouseUp&&(v=`TouchEnd`):Pc.Pen}else legacy_isTouchEvent(l)&&(g=Pc.Touch);g===null?Nc[r]===Nc.Click&&(g=y,y=null):(y=g,(v.startsWith(`Touch`)&&g===Pc.Touch||v.startsWith(`Mouse`)&&g===Pc.Mouse)&&(g=null));var b=legacy_isTouchEvent(l)?l.changedTouches[0]:l;if(b){var x=u.getId(h),S=b.clientX,C=b.clientY;callbackWrapper(c)(_extends({type:Nc[v],id:x,x:S,y:C},g!==null&&{pointerType:g}))}}}};return Object.keys(Nc).filter(function(r){return Number.isNaN(Number(r))&&!r.endsWith(`_Departed`)&&g[r]!==!1}).forEach(function(r){var c=toLowerCase(r),u=getHandler(r);if(window.PointerEvent)switch(Nc[r]){case Nc.MouseDown:case Nc.MouseUp:c=c.replace(`mouse`,`pointer`);break;case Nc.TouchStart:case Nc.TouchEnd:return}v.push(on(c,u,l))}),callbackWrapper(function(){v.forEach(function(r){return r()})})}function initScrollObserver(r){var c=r.scrollCb,l=r.doc,u=r.mirror,p=r.blockClass,m=r.blockSelector,h=r.sampling;return on(`scroll`,callbackWrapper(throttle(callbackWrapper(function(r){var h=getEventTarget(r);if(!(!h||isBlocked(h,p,m,!0))){var g=u.getId(h);if(h===l&&l.defaultView){var v=getWindowScroll(l.defaultView);c({id:g,x:v.left,y:v.top})}else c({id:g,x:h.scrollLeft,y:h.scrollTop})}}),h.scroll||100)),l)}function initViewportResizeObserver(r,c){var l=r.viewportResizeCb,u=c.win,p=-1,m=-1;return on(`resize`,callbackWrapper(throttle(callbackWrapper(function(){var r=getWindowHeight(),c=getWindowWidth();(p!==r||m!==c)&&(l({width:Number(c),height:Number(r)}),p=r,m=c)}),200)),u)}var Hc=[`INPUT`,`TEXTAREA`,`SELECT`],Uc=new WeakMap;function initInputObserver(r){var c=r.inputCb,l=r.doc,u=r.mirror,p=r.blockClass,m=r.blockSelector,h=r.ignoreClass,g=r.ignoreSelector,v=r.maskInputOptions,y=r.maskInputFn,b=r.sampling,x=r.userTriggeredOnInput;function eventHandler(r){var c=getEventTarget(r),u=r.isTrusted,b=c&&c.tagName;if(c&&b===`OPTION`&&(c=U.parentElement(c)),!(!c||!b||Hc.indexOf(b)<0||isBlocked(c,p,m,!0))&&!(c.classList.contains(h)||g&&c.matches(g))){var S=c.value,C=!1,w=getInputType(c)||``;w===`radio`||w===`checkbox`?C=c.checked:(v[b.toLowerCase()]||v[w])&&(S=maskInputValue({element:c,maskInputOptions:v,tagName:b,type:w,value:S,maskInputFn:y})),cbWithDedup(c,x?{text:S,isChecked:C,userTriggered:u}:{text:S,isChecked:C});var T=c.name;w===`radio`&&T&&C&&l.querySelectorAll(`input[type="radio"][name="`+T+`"]`).forEach(function(r){if(r!==c){var l=r.value;cbWithDedup(r,x?{text:l,isChecked:!C,userTriggered:!1}:{text:l,isChecked:!C})}})}}function cbWithDedup(r,l){var p=Uc.get(r);if(!p||p.text!==l.text||p.isChecked!==l.isChecked){Uc.set(r,l);var m=u.getId(r);callbackWrapper(c)(_extends({},l,{id:m}))}}var S=(b.input===`last`?[`change`]:[`input`,`change`]).map(function(r){return on(r,callbackWrapper(eventHandler),l)}),C=l.defaultView;if(!C)return function(){S.forEach(function(r){return r()})};var w=C.Object.getOwnPropertyDescriptor(C.HTMLInputElement.prototype,`value`),T=[[C.HTMLInputElement.prototype,`value`],[C.HTMLInputElement.prototype,`checked`],[C.HTMLSelectElement.prototype,`value`],[C.HTMLTextAreaElement.prototype,`value`],[C.HTMLSelectElement.prototype,`selectedIndex`],[C.HTMLOptionElement.prototype,`selected`]];if(w&&w.set){var E;(E=S).push.apply(E,[].concat(T.map(function(r){return hookSetter(r[0],r[1],{set:function set(){callbackWrapper(eventHandler)({target:this,isTrusted:!1})}},!1,C)})))}return callbackWrapper(function(){S.forEach(function(r){return r()})})}function getNestedCSSRulePositions(r){var c=[];function recurse(r,c){if(hasNestedCSSRule(`CSSGroupingRule`)&&_instanceof(r.parentRule,CSSGroupingRule)||hasNestedCSSRule(`CSSMediaRule`)&&_instanceof(r.parentRule,CSSMediaRule)||hasNestedCSSRule(`CSSSupportsRule`)&&_instanceof(r.parentRule,CSSSupportsRule)||hasNestedCSSRule(`CSSConditionRule`)&&_instanceof(r.parentRule,CSSConditionRule)){var l=Array.from(r.parentRule.cssRules).indexOf(r);c.unshift(l)}else if(r.parentStyleSheet){var u=Array.from(r.parentStyleSheet.cssRules).indexOf(r);c.unshift(u)}return c}return recurse(r,c)}function getIdAndStyleId(r,c,l){var u,p;return r?(r.ownerNode?u=c.getId(r.ownerNode):p=l.getId(r),{styleId:p,id:u}):{}}function initStyleSheetObserver(r,c){var l=r.styleSheetRuleCb,u=r.mirror,p=r.stylesheetManager,m=c.win;if(!m.CSSStyleSheet||!m.CSSStyleSheet.prototype)return function(){};var h=m.CSSStyleSheet.prototype.insertRule;m.CSSStyleSheet.prototype.insertRule=new Proxy(h,{apply:callbackWrapper(function(r,c,m){var h=m[0],g=m[1],v=getIdAndStyleId(c,u,p.styleMirror),y=v.id,b=v.styleId;return(y&&y!==-1||b&&b!==-1)&&l({id:y,styleId:b,adds:[{rule:h,index:g}]}),r.apply(c,m)})}),m.CSSStyleSheet.prototype.addRule=function(r,c,l){l===void 0&&(l=this.cssRules.length);var u=r+` { `+c+` }`;return m.CSSStyleSheet.prototype.insertRule.apply(this,[u,l])};var g=m.CSSStyleSheet.prototype.deleteRule;m.CSSStyleSheet.prototype.deleteRule=new Proxy(g,{apply:callbackWrapper(function(r,c,m){var h=m[0],g=getIdAndStyleId(c,u,p.styleMirror),v=g.id,y=g.styleId;return(v&&v!==-1||y&&y!==-1)&&l({id:v,styleId:y,removes:[{index:h}]}),r.apply(c,m)})}),m.CSSStyleSheet.prototype.removeRule=function(r){return m.CSSStyleSheet.prototype.deleteRule.apply(this,[r])};var v;m.CSSStyleSheet.prototype.replace&&(v=m.CSSStyleSheet.prototype.replace,m.CSSStyleSheet.prototype.replace=new Proxy(v,{apply:callbackWrapper(function(r,c,m){var h=m[0],g=getIdAndStyleId(c,u,p.styleMirror),v=g.id,y=g.styleId;return(v&&v!==-1||y&&y!==-1)&&l({id:v,styleId:y,replace:h}),r.apply(c,m)})}));var y;m.CSSStyleSheet.prototype.replaceSync&&(y=m.CSSStyleSheet.prototype.replaceSync,m.CSSStyleSheet.prototype.replaceSync=new Proxy(y,{apply:callbackWrapper(function(r,c,m){var h=m[0],g=getIdAndStyleId(c,u,p.styleMirror),v=g.id,y=g.styleId;return(v&&v!==-1||y&&y!==-1)&&l({id:v,styleId:y,replaceSync:h}),r.apply(c,m)})}));var b={};canMonkeyPatchNestedCSSRule(`CSSGroupingRule`)?b.CSSGroupingRule=m.CSSGroupingRule:(canMonkeyPatchNestedCSSRule(`CSSMediaRule`)&&(b.CSSMediaRule=m.CSSMediaRule),canMonkeyPatchNestedCSSRule(`CSSConditionRule`)&&(b.CSSConditionRule=m.CSSConditionRule),canMonkeyPatchNestedCSSRule(`CSSSupportsRule`)&&(b.CSSSupportsRule=m.CSSSupportsRule));var x={};return Object.entries(b).forEach(function(r){var c=r[0],m=r[1];x[c]={insertRule:m.prototype.insertRule,deleteRule:m.prototype.deleteRule},m.prototype.insertRule=new Proxy(x[c].insertRule,{apply:callbackWrapper(function(r,c,m){var h=m[0],g=m[1],v=getIdAndStyleId(c.parentStyleSheet,u,p.styleMirror),y=v.id,b=v.styleId;return(y&&y!==-1||b&&b!==-1)&&l({id:y,styleId:b,adds:[{rule:h,index:[].concat(getNestedCSSRulePositions(c),[g||0])}]}),r.apply(c,m)})}),m.prototype.deleteRule=new Proxy(x[c].deleteRule,{apply:callbackWrapper(function(r,c,m){var h=m[0],g=getIdAndStyleId(c.parentStyleSheet,u,p.styleMirror),v=g.id,y=g.styleId;return(v&&v!==-1||y&&y!==-1)&&l({id:v,styleId:y,removes:[{index:[].concat(getNestedCSSRulePositions(c),[h])}]}),r.apply(c,m)})})}),callbackWrapper(function(){m.CSSStyleSheet.prototype.insertRule=h,m.CSSStyleSheet.prototype.deleteRule=g,v&&(m.CSSStyleSheet.prototype.replace=v),y&&(m.CSSStyleSheet.prototype.replaceSync=y),Object.entries(b).forEach(function(r){var c=r[0],l=r[1];l.prototype.insertRule=x[c].insertRule,l.prototype.deleteRule=x[c].deleteRule})})}function initAdoptedStyleSheetObserver(r,c){var l=r.mirror,u=r.stylesheetManager,p,m,h,g=null;g=c.nodeName===`#document`?l.getId(c):l.getId(U.host(c));var v=c.nodeName===`#document`?(p=c.defaultView)==null?void 0:p.Document:(h=(m=c.ownerDocument)==null?void 0:m.defaultView)==null?void 0:h.ShadowRoot,y=v!=null&&v.prototype?Object.getOwnPropertyDescriptor(v==null?void 0:v.prototype,`adoptedStyleSheets`):void 0;return g===null||g===-1||!v||!y?function(){}:(Object.defineProperty(c,"adoptedStyleSheets",{configurable:y.configurable,enumerable:y.enumerable,get:function get(){var r;return(r=y.get)==null?void 0:r.call(this)},set:function set(r){var c,l=(c=y.set)==null?void 0:c.call(this,r);if(g!==null&&g!==-1)try{u.adoptStyleSheets(r,g)}catch(r){}return l}}),callbackWrapper(function(){Object.defineProperty(c,"adoptedStyleSheets",{configurable:y.configurable,enumerable:y.enumerable,get:y.get,set:y.set})}))}function initStyleDeclarationObserver(r,c){var l=r.styleDeclarationCb,u=r.mirror,p=r.ignoreCSSAttributes,m=r.stylesheetManager,h=c.win,g=h.CSSStyleDeclaration.prototype.setProperty;h.CSSStyleDeclaration.prototype.setProperty=new Proxy(g,{apply:callbackWrapper(function(r,c,h){var v,y=h[0],b=h[1],x=h[2];if(p.has(y))return g.apply(c,[y,b,x]);var S=getIdAndStyleId((v=c.parentRule)==null?void 0:v.parentStyleSheet,u,m.styleMirror),C=S.id,w=S.styleId;return(C&&C!==-1||w&&w!==-1)&&l({id:C,styleId:w,set:{property:y,value:b,priority:x},index:getNestedCSSRulePositions(c.parentRule)}),r.apply(c,h)})});var v=h.CSSStyleDeclaration.prototype.removeProperty;return h.CSSStyleDeclaration.prototype.removeProperty=new Proxy(v,{apply:callbackWrapper(function(r,c,h){var g,y=h[0];if(p.has(y))return v.apply(c,[y]);var b=getIdAndStyleId((g=c.parentRule)==null?void 0:g.parentStyleSheet,u,m.styleMirror),x=b.id,S=b.styleId;return(x&&x!==-1||S&&S!==-1)&&l({id:x,styleId:S,remove:{property:y},index:getNestedCSSRulePositions(c.parentRule)}),r.apply(c,h)})}),callbackWrapper(function(){h.CSSStyleDeclaration.prototype.setProperty=g,h.CSSStyleDeclaration.prototype.removeProperty=v})}function initMediaInteractionObserver(r){var c=r.mediaInteractionCb,l=r.blockClass,u=r.blockSelector,p=r.mirror,m=r.sampling,h=r.doc,g=callbackWrapper(function(r){return throttle(callbackWrapper(function(m){var h=getEventTarget(m);if(!(!h||isBlocked(h,l,u,!0))){var g=h.currentTime,v=h.volume,y=h.muted,b=h.playbackRate,x=h.loop;c({type:r,id:p.getId(h),currentTime:g,volume:v,muted:y,playbackRate:b,loop:x})}}),m.media||500)}),v=[on(`play`,g(Ic.Play),h),on(`pause`,g(Ic.Pause),h),on(`seeked`,g(Ic.Seeked),h),on(`volumechange`,g(Ic.VolumeChange),h),on(`ratechange`,g(Ic.RateChange),h)];return callbackWrapper(function(){v.forEach(function(r){return r()})})}function initFontObserver(r){var c=r.fontCb,l=r.doc,u=l.defaultView;if(!u)return function(){};var p=[],m=new WeakMap,h=u.FontFace;u.FontFace=function FontFace2(r,c,l){var u=new h(r,c,l);return m.set(u,{family:r,buffer:typeof c!=`string`,descriptors:l,fontSource:typeof c==`string`?c:JSON.stringify(Array.from(new Uint8Array(c)))}),u};var g=patch(l.fonts,`add`,function(r){return function(l){return setTimeout(callbackWrapper(function(){var r=m.get(l);r&&(c(r),m.delete(l))}),0),r.apply(this,[l])}});return p.push(function(){u.FontFace=h}),p.push(g),callbackWrapper(function(){p.forEach(function(r){return r()})})}function initSelectionObserver(r){var c=r.doc,l=r.mirror,u=r.blockClass,p=r.blockSelector,m=r.selectionCb,h=!0,g=callbackWrapper(function(){var r=c.getSelection();if(!(!r||h&&r!=null&&r.isCollapsed)){h=r.isCollapsed||!1;for(var g=[],v=r.rangeCount||0,y=0;y<v;y++){var b=r.getRangeAt(y),x=b.startContainer,S=b.startOffset,C=b.endContainer,w=b.endOffset;isBlocked(x,u,p,!0)||isBlocked(C,u,p,!0)||g.push({start:l.getId(x),startOffset:S,end:l.getId(C),endOffset:w})}m({ranges:g})}});return g(),on(`selectionchange`,g)}function initCustomElementObserver(r){var c=r.doc,l=r.customElementCb,u=c.defaultView;return!u||!u.customElements?function(){}:patch(u.customElements,`define`,function(r){return function(c,u,p){try{l({define:{name:c}})}catch(r){console.warn(`Custom element callback failed for `+c)}return r.apply(this,[c,u,p])}})}function mergeHooks(r,c){var l=r.mutationCb,u=r.mousemoveCb,p=r.mouseInteractionCb,m=r.scrollCb,h=r.viewportResizeCb,g=r.inputCb,v=r.mediaInteractionCb,y=r.styleSheetRuleCb,b=r.styleDeclarationCb,x=r.canvasMutationCb,S=r.fontCb,C=r.selectionCb,w=r.customElementCb;r.mutationCb=function(){for(var r=arguments.length,u=Array(r),p=0;p<r;p++)u[p]=arguments[p];if(c.mutation){var m;(m=c).mutation.apply(m,[].concat(u))}l.apply(void 0,[].concat(u))},r.mousemoveCb=function(){for(var r=arguments.length,l=Array(r),p=0;p<r;p++)l[p]=arguments[p];if(c.mousemove){var m;(m=c).mousemove.apply(m,[].concat(l))}u.apply(void 0,[].concat(l))},r.mouseInteractionCb=function(){for(var r=arguments.length,l=Array(r),u=0;u<r;u++)l[u]=arguments[u];if(c.mouseInteraction){var m;(m=c).mouseInteraction.apply(m,[].concat(l))}p.apply(void 0,[].concat(l))},r.scrollCb=function(){for(var r=arguments.length,l=Array(r),u=0;u<r;u++)l[u]=arguments[u];if(c.scroll){var p;(p=c).scroll.apply(p,[].concat(l))}m.apply(void 0,[].concat(l))},r.viewportResizeCb=function(){for(var r=arguments.length,l=Array(r),u=0;u<r;u++)l[u]=arguments[u];if(c.viewportResize){var p;(p=c).viewportResize.apply(p,[].concat(l))}h.apply(void 0,[].concat(l))},r.inputCb=function(){for(var r=arguments.length,l=Array(r),u=0;u<r;u++)l[u]=arguments[u];if(c.input){var p;(p=c).input.apply(p,[].concat(l))}g.apply(void 0,[].concat(l))},r.mediaInteractionCb=function(){for(var r=arguments.length,l=Array(r),u=0;u<r;u++)l[u]=arguments[u];if(c.mediaInteaction){var p;(p=c).mediaInteaction.apply(p,[].concat(l))}v.apply(void 0,[].concat(l))},r.styleSheetRuleCb=function(){for(var r=arguments.length,l=Array(r),u=0;u<r;u++)l[u]=arguments[u];if(c.styleSheetRule){var p;(p=c).styleSheetRule.apply(p,[].concat(l))}y.apply(void 0,[].concat(l))},r.styleDeclarationCb=function(){for(var r=arguments.length,l=Array(r),u=0;u<r;u++)l[u]=arguments[u];if(c.styleDeclaration){var p;(p=c).styleDeclaration.apply(p,[].concat(l))}b.apply(void 0,[].concat(l))},r.canvasMutationCb=function(){for(var r=arguments.length,l=Array(r),u=0;u<r;u++)l[u]=arguments[u];if(c.canvasMutation){var p;(p=c).canvasMutation.apply(p,[].concat(l))}x.apply(void 0,[].concat(l))},r.fontCb=function(){for(var r=arguments.length,l=Array(r),u=0;u<r;u++)l[u]=arguments[u];if(c.font){var p;(p=c).font.apply(p,[].concat(l))}S.apply(void 0,[].concat(l))},r.selectionCb=function(){for(var r=arguments.length,l=Array(r),u=0;u<r;u++)l[u]=arguments[u];if(c.selection){var p;(p=c).selection.apply(p,[].concat(l))}C.apply(void 0,[].concat(l))},r.customElementCb=function(){for(var r=arguments.length,l=Array(r),u=0;u<r;u++)l[u]=arguments[u];if(c.customElement){var p;(p=c).customElement.apply(p,[].concat(l))}w.apply(void 0,[].concat(l))}}function initObservers(r,c){c===void 0&&(c={});var l=r.doc.defaultView;if(!l)return function(){};mergeHooks(r,c);var u;r.recordDOM&&(u=initMutationObserver(r,r.doc));var p=initMoveObserver(r),m=initMouseInteractionObserver(r),h=initScrollObserver(r),g=initViewportResizeObserver(r,{win:l}),v=initInputObserver(r),y=initMediaInteractionObserver(r),styleSheetObserver=function(){},adoptedStyleSheetObserver=function(){},styleDeclarationObserver=function(){},fontObserver=function(){};r.recordDOM&&(styleSheetObserver=initStyleSheetObserver(r,{win:l}),adoptedStyleSheetObserver=initAdoptedStyleSheetObserver(r,r.doc),styleDeclarationObserver=initStyleDeclarationObserver(r,{win:l}),r.collectFonts&&(fontObserver=initFontObserver(r)));for(var b=initSelectionObserver(r),x=initCustomElementObserver(r),S=[],C=_create_for_of_iterator_helper_loose(r.plugins),w;!(w=C()).done;){var T=w.value;S.push(T.observer(T.callback,l,T.options))}return callbackWrapper(function(){Vc.forEach(function(r){return r.reset()}),u==null||u.disconnect(),p(),m(),h(),g(),v(),y(),styleSheetObserver(),adoptedStyleSheetObserver(),styleDeclarationObserver(),fontObserver(),b(),x(),S.forEach(function(r){return r()})})}function hasNestedCSSRule(r){return window[r]!==void 0}function canMonkeyPatchNestedCSSRule(r){return!!(window[r]!==void 0&&window[r].prototype&&`insertRule`in window[r].prototype&&`deleteRule`in window[r].prototype)}for(var Wc=function(){function CrossOriginIframeMirror(r){__publicField(this,`iframeIdToRemoteIdMap`,new WeakMap),__publicField(this,`iframeRemoteIdToIdMap`,new WeakMap),this.generateIdFn=r}var r=CrossOriginIframeMirror.prototype;return r.getId=function getId(r,c,l,u){var p=l||this.getIdToRemoteIdMap(r),m=u||this.getRemoteIdToIdMap(r),h=p.get(c);return h||(h=this.generateIdFn(),p.set(c,h),m.set(h,c)),h},r.getIds=function getIds(r,c){var l=this,u=this.getIdToRemoteIdMap(r),p=this.getRemoteIdToIdMap(r);return c.map(function(c){return l.getId(r,c,u,p)})},r.getRemoteId=function getRemoteId(r,c,l){var u=l||this.getRemoteIdToIdMap(r);return typeof c==`number`?u.get(c)||-1:c},r.getRemoteIds=function getRemoteIds(r,c){var l=this,u=this.getRemoteIdToIdMap(r);return c.map(function(c){return l.getRemoteId(r,c,u)})},r.reset=function reset(r){if(!r){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(r),this.iframeRemoteIdToIdMap.delete(r)},r.getIdToRemoteIdMap=function getIdToRemoteIdMap(r){var c=this.iframeIdToRemoteIdMap.get(r);return c||(c=new Map,this.iframeIdToRemoteIdMap.set(r,c)),c},r.getRemoteIdToIdMap=function getRemoteIdToIdMap(r){var c=this.iframeRemoteIdToIdMap.get(r);return c||(c=new Map,this.iframeRemoteIdToIdMap.set(r,c)),c},CrossOriginIframeMirror}(),Gc=function(){function IframeManager(r){__publicField(this,`iframes`,new WeakMap),__publicField(this,`crossOriginIframeMap`,new WeakMap),__publicField(this,`crossOriginIframeMirror`,new Wc(genId)),__publicField(this,`crossOriginIframeStyleMirror`),__publicField(this,`crossOriginIframeRootIdMap`,new WeakMap),__publicField(this,`mirror`),__publicField(this,`mutationCb`),__publicField(this,`wrappedEmit`),__publicField(this,`loadListener`),__publicField(this,`stylesheetManager`),__publicField(this,`recordCrossOriginIframes`),this.mutationCb=r.mutationCb,this.wrappedEmit=r.wrappedEmit,this.stylesheetManager=r.stylesheetManager,this.recordCrossOriginIframes=r.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Wc(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=r.mirror,this.recordCrossOriginIframes&&window.addEventListener(`message`,this.handleMessage.bind(this))}var r=IframeManager.prototype;return r.addIframe=function addIframe(r){this.iframes.set(r,!0),r.contentWindow&&this.crossOriginIframeMap.set(r.contentWindow,r)},r.addLoadListener=function addLoadListener(r){this.loadListener=r},r.attachIframe=function attachIframe(r,c){var l,u;this.mutationCb({adds:[{parentId:this.mirror.getId(r),nextId:null,node:c}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&((l=r.contentWindow)==null||l.addEventListener(`message`,this.handleMessage.bind(this))),(u=this.loadListener)==null||u.call(this,r),r.contentDocument&&r.contentDocument.adoptedStyleSheets&&r.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(r.contentDocument.adoptedStyleSheets,this.mirror.getId(r.contentDocument))},r.handleMessage=function handleMessage(r){var c=r;if(c.data.type===`rrweb`&&c.origin===c.data.origin&&r.source){var l=this.crossOriginIframeMap.get(r.source);if(l){var u=this.transformCrossOriginEvent(l,c.data.event);u&&this.wrappedEmit(u,c.data.isCheckout)}}},r.transformCrossOriginEvent=function transformCrossOriginEvent(r,c){var l=this,u;switch(c.type){case W.FullSnapshot:this.crossOriginIframeMirror.reset(r),this.crossOriginIframeStyleMirror.reset(r),this.replaceIdOnNode(c.data.node,r);var p=c.data.node.id;return this.crossOriginIframeRootIdMap.set(r,p),this.patchRootIdOnNode(c.data.node,p),{timestamp:c.timestamp,type:W.IncrementalSnapshot,data:{source:G.Mutation,adds:[{parentId:this.mirror.getId(r),nextId:null,node:c.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case W.Meta:case W.Load:case W.DomContentLoaded:return!1;case W.Plugin:return c;case W.Custom:return this.replaceIds(c.data.payload,r,[`id`,`parentId`,`previousId`,`nextId`]),c;case W.IncrementalSnapshot:switch(c.data.source){case G.Mutation:return c.data.adds.forEach(function(c){l.replaceIds(c,r,[`parentId`,`nextId`,`previousId`]),l.replaceIdOnNode(c.node,r);var u=l.crossOriginIframeRootIdMap.get(r);u&&l.patchRootIdOnNode(c.node,u)}),c.data.removes.forEach(function(c){l.replaceIds(c,r,[`parentId`,`id`])}),c.data.attributes.forEach(function(c){l.replaceIds(c,r,[`id`])}),c.data.texts.forEach(function(c){l.replaceIds(c,r,[`id`])}),c;case G.Drag:case G.TouchMove:case G.MouseMove:return c.data.positions.forEach(function(c){l.replaceIds(c,r,[`id`])}),c;case G.ViewportResize:return!1;case G.MediaInteraction:case G.MouseInteraction:case G.Scroll:case G.CanvasMutation:case G.Input:return this.replaceIds(c.data,r,[`id`]),c;case G.StyleSheetRule:case G.StyleDeclaration:return this.replaceIds(c.data,r,[`id`]),this.replaceStyleIds(c.data,r,[`styleId`]),c;case G.Font:return c;case G.Selection:return c.data.ranges.forEach(function(c){l.replaceIds(c,r,[`start`,`end`])}),c;case G.AdoptedStyleSheet:return this.replaceIds(c.data,r,[`id`]),this.replaceStyleIds(c.data,r,[`styleIds`]),(u=c.data.styles)==null||u.forEach(function(c){l.replaceStyleIds(c,r,[`styleId`])}),c}}return!1},r.replace=function replace(r,c,l,u){for(var p=_create_for_of_iterator_helper_loose(u),m;!(m=p()).done;){var h=m.value;!Array.isArray(c[h])&&typeof c[h]!=`number`||(Array.isArray(c[h])?c[h]=r.getIds(l,c[h]):c[h]=r.getId(l,c[h]))}return c},r.replaceIds=function replaceIds(r,c,l){return this.replace(this.crossOriginIframeMirror,r,c,l)},r.replaceStyleIds=function replaceStyleIds(r,c,l){return this.replace(this.crossOriginIframeStyleMirror,r,c,l)},r.replaceIdOnNode=function replaceIdOnNode(r,c){var l=this;this.replaceIds(r,c,[`id`,`rootId`]),`childNodes`in r&&r.childNodes.forEach(function(r){l.replaceIdOnNode(r,c)})},r.patchRootIdOnNode=function patchRootIdOnNode(r,c){var l=this;r.type!==Lc.Document&&!r.rootId&&(r.rootId=c),`childNodes`in r&&r.childNodes.forEach(function(r){l.patchRootIdOnNode(r,c)})},IframeManager}(),Kc=function(){function ShadowDomManager(r){__publicField(this,`shadowDoms`,new WeakSet),__publicField(this,`mutationCb`),__publicField(this,`scrollCb`),__publicField(this,`bypassOptions`),__publicField(this,`mirror`),__publicField(this,`restoreHandlers`,[]),this.mutationCb=r.mutationCb,this.scrollCb=r.scrollCb,this.bypassOptions=r.bypassOptions,this.mirror=r.mirror,this.init()}var r=ShadowDomManager.prototype;return r.init=function init(){this.reset(),this.patchAttachShadow(Element,document)},r.addShadowRoot=function addShadowRoot(r,c){var l=this;if(isNativeShadowDom(r)&&!this.shadowDoms.has(r)){this.shadowDoms.add(r);var u=initMutationObserver(_extends({},this.bypassOptions,{doc:c,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),r);this.restoreHandlers.push(function(){return u.disconnect()}),this.restoreHandlers.push(initScrollObserver(_extends({},this.bypassOptions,{scrollCb:this.scrollCb,doc:r,mirror:this.mirror}))),setTimeout(function(){r.adoptedStyleSheets&&r.adoptedStyleSheets.length>0&&l.bypassOptions.stylesheetManager.adoptStyleSheets(r.adoptedStyleSheets,l.mirror.getId(U.host(r))),l.restoreHandlers.push(initAdoptedStyleSheetObserver({mirror:l.mirror,stylesheetManager:l.bypassOptions.stylesheetManager},r))},0)}},r.observeAttachShadow=function observeAttachShadow(r){!r.contentWindow||!r.contentDocument||this.patchAttachShadow(r.contentWindow.Element,r.contentDocument)},r.patchAttachShadow=function patchAttachShadow(r,c){var l=this;this.restoreHandlers.push(patch(r.prototype,`attachShadow`,function(r){return function(u){var p=r.call(this,u),m=U.shadowRoot(this);return m&&inDom(this)&&l.addShadowRoot(m,c),p}}))},r.reset=function reset(){this.restoreHandlers.forEach(function(r){try{r()}catch(r){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet},ShadowDomManager}(),qc=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,Jc=typeof Uint8Array>`u`?[]:new Uint8Array(256),Yc=0;Yc<qc.length;Yc++)Jc[qc.charCodeAt(Yc)]=Yc;var Xc=function encode(r){var c=new Uint8Array(r),l,u=c.length,p=``;for(l=0;l<u;l+=3)p+=qc[c[l]>>2],p+=qc[(c[l]&3)<<4|c[l+1]>>4],p+=qc[(c[l+1]&15)<<2|c[l+2]>>6],p+=qc[c[l+2]&63];return u%3==2?p=p.substring(0,p.length-1)+`=`:u%3==1&&(p=p.substring(0,p.length-2)+`==`),p},Zc=new Map;function variableListFor$1(r,c){var l=Zc.get(r);return l||(l=new Map,Zc.set(r,l)),l.has(c)||l.set(c,[]),l.get(c)}var saveWebGLVar=function(r,c,l){if(!(!r||!(isInstanceOfWebGLObject(r,c)||(r===void 0?`undefined`:_type_of(r))===`object`))){var u=r.constructor.name,p=variableListFor$1(l,u),m=p.indexOf(r);return m===-1&&(m=p.length,p.push(r)),m}};function serializeArg(r,c,l){return _instanceof(r,Array)?r.map(function(r){return serializeArg(r,c,l)}):r===null?r:_instanceof(r,Float32Array)||_instanceof(r,Float64Array)||_instanceof(r,Int32Array)||_instanceof(r,Uint32Array)||_instanceof(r,Uint8Array)||_instanceof(r,Uint16Array)||_instanceof(r,Int16Array)||_instanceof(r,Int8Array)||_instanceof(r,Uint8ClampedArray)?{rr_type:r.constructor.name,args:[Object.values(r)]}:_instanceof(r,ArrayBuffer)?{rr_type:r.constructor.name,base64:Xc(r)}:_instanceof(r,DataView)?{rr_type:r.constructor.name,args:[serializeArg(r.buffer,c,l),r.byteOffset,r.byteLength]}:_instanceof(r,HTMLImageElement)?{rr_type:r.constructor.name,src:r.src}:_instanceof(r,HTMLCanvasElement)?{rr_type:`HTMLImageElement`,src:r.toDataURL()}:_instanceof(r,ImageData)?{rr_type:r.constructor.name,args:[serializeArg(r.data,c,l),r.width,r.height]}:isInstanceOfWebGLObject(r,c)||(r===void 0?`undefined`:_type_of(r))===`object`?{rr_type:r.constructor.name,index:saveWebGLVar(r,c,l)}:r}var serializeArgs=function(r,c,l){return r.map(function(r){return serializeArg(r,c,l)})},isInstanceOfWebGLObject=function(r,c){return!![`WebGLActiveInfo`,`WebGLBuffer`,`WebGLFramebuffer`,`WebGLProgram`,`WebGLRenderbuffer`,`WebGLShader`,`WebGLShaderPrecisionFormat`,`WebGLTexture`,`WebGLUniformLocation`,`WebGLVertexArrayObject`,`WebGLVertexArrayObjectOES`].filter(function(r){return typeof c[r]==`function`}).find(function(l){return _instanceof(r,c[l])})};function initCanvas2DMutationObserver(r,c,l,u){for(var _loop=function(){var m=h.value;try{if(typeof c.CanvasRenderingContext2D.prototype[m]!=`function`)return`continue`;var g=patch(c.CanvasRenderingContext2D.prototype,m,function(p){return function(){for(var h=this,g=arguments.length,v=Array(g),y=0;y<g;y++)v[y]=arguments[y];return isBlocked(this.canvas,l,u,!0)||setTimeout(function(){var l=serializeArgs(v,c,h);r(h.canvas,{type:Fc[`2D`],property:m,args:l})},0),p.apply(this,v)}});p.push(g)}catch(l){var v=hookSetter(c.CanvasRenderingContext2D.prototype,m,{set:function set(c){r(this.canvas,{type:Fc[`2D`],property:m,args:[c],setter:!0})}});p.push(v)}},p=[],m=_create_for_of_iterator_helper_loose(Object.getOwnPropertyNames(c.CanvasRenderingContext2D.prototype)),h;!(h=m()).done;)_loop();return function(){p.forEach(function(r){return r()})}}function getNormalizedContextName(r){return r===`experimental-webgl`?`webgl`:r}function initCanvasContextObserver(r,c,l,u){var p=[];try{var m=patch(r.HTMLCanvasElement.prototype,`getContext`,function(r){return function(p){for(var m=arguments.length,h=Array(m>1?m-1:0),g=1;g<m;g++)h[g-1]=arguments[g];if(!isBlocked(this,c,l,!0)){var v=getNormalizedContextName(p);if(`__context`in this||(this.__context=v),u&&[`webgl`,`webgl2`].includes(v))if(h[0]&&_type_of(h[0])===`object`){var y=h[0];y.preserveDrawingBuffer||(y.preserveDrawingBuffer=!0)}else h.splice(0,1,{preserveDrawingBuffer:!0})}return r.apply(this,[p].concat(h))}});p.push(m)}catch(r){console.error(`failed to patch HTMLCanvasElement.prototype.getContext`)}return function(){p.forEach(function(r){return r()})}}function patchGLPrototype(r,c,l,u,p,m){for(var _loop=function(){var g=v.value;if([`isContextLost`,`canvas`,`drawingBufferWidth`,`drawingBufferHeight`].includes(g))return`continue`;try{if(typeof r[g]!=`function`)return`continue`;var y=patch(r,g,function(r){return function(){for(var h=arguments.length,v=Array(h),y=0;y<h;y++)v[y]=arguments[y];var b=r.apply(this,v);if(saveWebGLVar(b,m,this),`tagName`in this.canvas&&!isBlocked(this.canvas,u,p,!0)){var x={type:c,property:g,args:serializeArgs(v,m,this)};l(this.canvas,x)}return b}});h.push(y)}catch(u){var b=hookSetter(r,g,{set:function set(r){l(this.canvas,{type:c,property:g,args:[r],setter:!0})}});h.push(b)}},h=[],g=_create_for_of_iterator_helper_loose(Object.getOwnPropertyNames(r)),v;!(v=g()).done;)_loop();return h}function initCanvasWebGLMutationObserver(r,c,l,u){var p,m=[];if((p=m).push.apply(p,[].concat(patchGLPrototype(c.WebGLRenderingContext.prototype,Fc.WebGL,r,l,u,c))),c.WebGL2RenderingContext!==void 0){var h;(h=m).push.apply(h,[].concat(patchGLPrototype(c.WebGL2RenderingContext.prototype,Fc.WebGL2,r,l,u,c)))}return function(){m.forEach(function(r){return r()})}}var Qc=`KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=`,decodeBase64=function(r){return Uint8Array.from(atob(r),function(r){return r.charCodeAt(0)})},$c=typeof window<`u`&&window.Blob&&new Blob([decodeBase64(Qc)],{type:`text/javascript;charset=utf-8`});function WorkerWrapper(r){var c;try{if(c=$c&&(window.URL||window.webkitURL).createObjectURL($c),!c)throw``;var l=new Worker(c,{name:r==null?void 0:r.name});return l.addEventListener(`error`,function(){(window.URL||window.webkitURL).revokeObjectURL(c)}),l}catch(c){return new Worker(`data:text/javascript;base64,`+Qc,{name:r==null?void 0:r.name})}finally{c&&(window.URL||window.webkitURL).revokeObjectURL(c)}}var el=function(){function CanvasManager(r){var c=this;__publicField(this,`pendingCanvasMutations`,new Map),__publicField(this,`rafStamps`,{latestId:0,invokeId:null}),__publicField(this,`mirror`),__publicField(this,`mutationCb`),__publicField(this,`resetObservers`),__publicField(this,`frozen`,!1),__publicField(this,`locked`,!1),__publicField(this,`processMutation`,function(r,l){(c.rafStamps.invokeId&&c.rafStamps.latestId!==c.rafStamps.invokeId||!c.rafStamps.invokeId)&&(c.rafStamps.invokeId=c.rafStamps.latestId),c.pendingCanvasMutations.has(r)||c.pendingCanvasMutations.set(r,[]),c.pendingCanvasMutations.get(r).push(l)});var l=r.sampling,u=l===void 0?`all`:l,p=r.win,m=r.blockClass,h=r.blockSelector,g=r.recordCanvas,v=r.dataURLOptions;this.mutationCb=r.mutationCb,this.mirror=r.mirror,g&&u===`all`&&this.initCanvasMutationObserver(p,m,h),g&&typeof u==`number`&&this.initCanvasFPSObserver(u,p,m,h,{dataURLOptions:v})}var r=CanvasManager.prototype;return r.reset=function reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()},r.freeze=function freeze(){this.frozen=!0},r.unfreeze=function unfreeze(){this.frozen=!1},r.lock=function lock(){this.locked=!0},r.unlock=function unlock(){this.locked=!1},r.initCanvasFPSObserver=function initCanvasFPSObserver(r,c,l,u,p){var m=this,h=initCanvasContextObserver(c,l,u,!0),g=new Map,v=new WorkerWrapper;v.onmessage=function(r){var c=r.data.id;if(g.set(c,!1),`base64`in r.data){var l=r.data,u=l.base64,p=l.type,h=l.width,v=l.height;m.mutationCb({id:c,type:Fc[`2D`],commands:[{property:`clearRect`,args:[0,0,h,v]},{property:`drawImage`,args:[{rr_type:`ImageBitmap`,args:[{rr_type:`Blob`,data:[{rr_type:`ArrayBuffer`,base64:u}],type:p}]},0,0]}]})}};var y=1e3/r,b=0,x,getCanvas=function(){var r=[];return c.document.querySelectorAll(`canvas`).forEach(function(c){isBlocked(c,l,u,!0)||r.push(c)}),r},takeCanvasSnapshots=function(r){if(b&&r-b<y){x=requestAnimationFrame(takeCanvasSnapshots);return}b=r;var c=m;getCanvas().forEach(_async_to_generator(function(r){var l,u,m,h;return _ts_generator(this,function(y){switch(y.label){case 0:return u=c.mirror.getId(r),g.get(u)||r.width===0||r.height===0?[2]:(g.set(u,!0),[`webgl`,`webgl2`].includes(r.__context)&&(m=r.getContext(r.__context),((l=m==null?void 0:m.getContextAttributes())==null?void 0:l.preserveDrawingBuffer)===!1&&m.clear(m.COLOR_BUFFER_BIT)),[4,createImageBitmap(r)]);case 1:return h=y.sent(),v.postMessage({id:u,bitmap:h,width:r.width,height:r.height,dataURLOptions:p.dataURLOptions},[h]),[2]}})})),x=requestAnimationFrame(takeCanvasSnapshots)};x=requestAnimationFrame(takeCanvasSnapshots),this.resetObservers=function(){h(),cancelAnimationFrame(x)}},r.initCanvasMutationObserver=function initCanvasMutationObserver(r,c,l){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var u=initCanvasContextObserver(r,c,l,!1),p=initCanvas2DMutationObserver(this.processMutation.bind(this),r,c,l),m=initCanvasWebGLMutationObserver(this.processMutation.bind(this),r,c,l);this.resetObservers=function(){u(),p(),m()}},r.startPendingCanvasMutationFlusher=function startPendingCanvasMutationFlusher(){var r=this;requestAnimationFrame(function(){return r.flushPendingCanvasMutations()})},r.startRAFTimestamping=function startRAFTimestamping(){var r=this,setLatestRAFTimestamp=function(c){r.rafStamps.latestId=c,requestAnimationFrame(setLatestRAFTimestamp)};requestAnimationFrame(setLatestRAFTimestamp)},r.flushPendingCanvasMutations=function flushPendingCanvasMutations(){var r=this;this.pendingCanvasMutations.forEach(function(c,l){var u=r.mirror.getId(l);r.flushPendingCanvasMutationFor(l,u)}),requestAnimationFrame(function(){return r.flushPendingCanvasMutations()})},r.flushPendingCanvasMutationFor=function flushPendingCanvasMutationFor(r,c){if(!(this.frozen||this.locked)){var l=this.pendingCanvasMutations.get(r);if(!(!l||c===-1)){var u=l.map(function(r){return r.type,_object_without_properties_loose(r,[`type`])}),p=l[0].type;this.mutationCb({id:c,type:p,commands:u}),this.pendingCanvasMutations.delete(r)}}},CanvasManager}(),tl=function(){function StylesheetManager(r){__publicField(this,`trackedLinkElements`,new WeakSet),__publicField(this,`mutationCb`),__publicField(this,`adoptedStyleSheetCb`),__publicField(this,`styleMirror`,new Mc),this.mutationCb=r.mutationCb,this.adoptedStyleSheetCb=r.adoptedStyleSheetCb}var r=StylesheetManager.prototype;return r.attachLinkElement=function attachLinkElement(r,c){`_cssText`in c.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:c.id,attributes:c.attributes}]}),this.trackLinkElement(r)},r.trackLinkElement=function trackLinkElement(r){this.trackedLinkElements.has(r)||(this.trackedLinkElements.add(r),this.trackStylesheetInLinkElement(r))},r.adoptStyleSheets=function adoptStyleSheets(r,c){var l,_loop=function(){var r=h.value,c=void 0;l.styleMirror.has(r)?c=l.styleMirror.getId(r):(c=l.styleMirror.add(r),p.push({styleId:c,rules:Array.from(r.rules||CSSRule,function(c,l){return{rule:stringifyRule(c,r.href),index:l}})})),u.styleIds.push(c)};if(r.length!==0){for(var u={id:c,styleIds:[]},p=[],m=_create_for_of_iterator_helper_loose(r),h;!(h=m()).done;)l=this,_loop();p.length>0&&(u.styles=p),this.adoptedStyleSheetCb(u)}},r.reset=function reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet},r.trackStylesheetInLinkElement=function trackStylesheetInLinkElement(r){},StylesheetManager}(),nl=function(){function ProcessedNodeManager(){__publicField(this,`nodeMap`,new WeakMap),__publicField(this,`active`,!1)}var r=ProcessedNodeManager.prototype;return r.inOtherBuffer=function inOtherBuffer(r,c){var l=this.nodeMap.get(r);return l&&Array.from(l).some(function(r){return r!==c})},r.add=function add(r,c){var l=this;this.active||(this.active=!0,requestAnimationFrame(function(){l.nodeMap=new WeakMap,l.active=!1})),this.nodeMap.set(r,(this.nodeMap.get(r)||new Set).add(c))},r.destroy=function destroy(){},ProcessedNodeManager}(),wrappedEmit,takeFullSnapshot$1,rl,il=!1;try{if(Array.from([1],function(r){return r*2})[0]!==2){var al=document.createElement(`iframe`);document.body.appendChild(al),Array.from=((rt=al.contentWindow)==null?void 0:rt.Array.from)||Array.from,document.body.removeChild(al)}}catch(r){console.debug(`Unable to override Array.from`,r)}var ol=createMirror$2();function record(r){r===void 0&&(r={});var c=r.emit,l=r.checkoutEveryNms,u=r.checkoutEveryNth,p=r.blockClass,m=p===void 0?`rr-block`:p,h=r.blockSelector,g=h===void 0?null:h,v=r.ignoreClass,y=v===void 0?`rr-ignore`:v,b=r.ignoreSelector,x=b===void 0?null:b,S=r.maskTextClass,C=S===void 0?`rr-mask`:S,w=r.maskTextSelector,T=w===void 0?null:w,E=r.inlineStylesheet,D=E===void 0||E,O=r.maskAllInputs,k=r.maskInputOptions,A=r.slimDOMOptions,ee=r.maskInputFn,te=r.maskTextFn,ne=r.hooks,j=r.packFn,re=r.sampling,ie=re===void 0?{}:re,ae=r.dataURLOptions,oe=ae===void 0?{}:ae,se=r.mousemoveWait,M=r.recordDOM,ce=M===void 0||M,le=r.recordCanvas,ue=le!==void 0&&le,de=r.recordCrossOriginIframes,fe=de!==void 0&&de,pe=r.recordAfter,me=pe===void 0?r.recordAfter===`DOMContentLoaded`?r.recordAfter:`load`:pe,he=r.userTriggeredOnInput,ge=he!==void 0&&he,_e=r.collectFonts,N=_e!==void 0&&_e,ve=r.inlineImages,ye=ve!==void 0&&ve,be=r.plugins,xe=r.keepIframeSrcFn,Se=xe===void 0?function(){return!1}:xe,Ce=r.ignoreCSSAttributes,we=Ce===void 0?new Set([]):Ce,Te=r.errorHandler;registerErrorHandler(Te);var Ee=!fe||window.parent===window,De=!1;if(!Ee)try{window.parent.document&&(De=!1)}catch(r){De=!0}if(Ee&&!c)throw Error(`emit function is required`);if(!Ee&&!De)return function(){};se!==void 0&&ie.mousemove===void 0&&(ie.mousemove=se),ol.reset();var Oe=O===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0,hidden:!0}:k===void 0?{password:!0}:k,ke=A===!0||A===`all`?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:A===`all`,headMetaDescKeywords:A===`all`,headTitleMutations:A===`all`}:A||{};polyfill$1();var Ae,je=0,eventProcessor=function(r){for(var c=_create_for_of_iterator_helper_loose(be||[]),l;!(l=c()).done;){var u=l.value;u.eventProcessor&&(r=u.eventProcessor(r))}return j&&!De&&(r=j(r)),r};wrappedEmit=function(r,p){var m,h=r;if(h.timestamp=nowTimestamp(),(m=Vc[0])!=null&&m.isFrozen()&&h.type!==W.FullSnapshot&&(h.type!==W.IncrementalSnapshot||h.data.source!==G.Mutation)&&Vc.forEach(function(r){return r.unfreeze()}),Ee)c==null||c(eventProcessor(h),p);else if(De){var g={type:`rrweb`,event:eventProcessor(h),origin:window.location.origin,isCheckout:p};window.parent.postMessage(g,`*`)}if(h.type===W.FullSnapshot)Ae=h,je=0;else if(h.type===W.IncrementalSnapshot){if(h.data.source===G.Mutation&&h.data.isAttachIframe)return;je++;var v=u&&je>=u,y=l&&h.timestamp-Ae.timestamp>l;(v||y)&&takeFullSnapshot$1(!0)}};for(var wrappedMutationEmit=function(r){wrappedEmit({type:W.IncrementalSnapshot,data:_extends({source:G.Mutation},r)})},wrappedScrollEmit=function(r){return wrappedEmit({type:W.IncrementalSnapshot,data:_extends({source:G.Scroll},r)})},wrappedCanvasMutationEmit=function(r){return wrappedEmit({type:W.IncrementalSnapshot,data:_extends({source:G.CanvasMutation},r)})},wrappedAdoptedStyleSheetEmit=function(r){return wrappedEmit({type:W.IncrementalSnapshot,data:_extends({source:G.AdoptedStyleSheet},r)})},Me=new tl({mutationCb:wrappedMutationEmit,adoptedStyleSheetCb:wrappedAdoptedStyleSheetEmit}),Ne=new Gc({mirror:ol,mutationCb:wrappedMutationEmit,stylesheetManager:Me,recordCrossOriginIframes:fe,wrappedEmit}),Pe=_create_for_of_iterator_helper_loose(be||[]),Fe;!(Fe=Pe()).done;){var Ie=Fe.value;Ie.getMirror&&Ie.getMirror({nodeMirror:ol,crossOriginIframeMirror:Ne.crossOriginIframeMirror,crossOriginIframeStyleMirror:Ne.crossOriginIframeStyleMirror})}var Le=new nl;rl=new el({recordCanvas:ue,mutationCb:wrappedCanvasMutationEmit,win:window,blockClass:m,blockSelector:g,mirror:ol,sampling:ie.canvas,dataURLOptions:oe});var Re=new Kc({mutationCb:wrappedMutationEmit,scrollCb:wrappedScrollEmit,bypassOptions:{blockClass:m,blockSelector:g,maskTextClass:C,maskTextSelector:T,inlineStylesheet:D,maskInputOptions:Oe,dataURLOptions:oe,maskTextFn:te,maskInputFn:ee,recordCanvas:ue,inlineImages:ye,sampling:ie,slimDOMOptions:ke,iframeManager:Ne,stylesheetManager:Me,canvasManager:rl,keepIframeSrcFn:Se,processedNodeManager:Le},mirror:ol});takeFullSnapshot$1=function(r){if(r===void 0&&(r=!1),ce){wrappedEmit({type:W.Meta,data:{href:window.location.href,width:getWindowWidth(),height:getWindowHeight()}},r),Me.reset(),Re.init(),Vc.forEach(function(r){return r.lock()});var c=snapshot(document,{mirror:ol,blockClass:m,blockSelector:g,maskTextClass:C,maskTextSelector:T,inlineStylesheet:D,maskAllInputs:Oe,maskTextFn:te,maskInputFn:ee,slimDOM:ke,dataURLOptions:oe,recordCanvas:ue,inlineImages:ye,onSerialize:function(r){isSerializedIframe(r,ol)&&Ne.addIframe(r),isSerializedStylesheet(r,ol)&&Me.trackLinkElement(r),hasShadowRoot(r)&&Re.addShadowRoot(U.shadowRoot(r),document)},onIframeLoad:function(r,c){Ne.attachIframe(r,c),Re.observeAttachShadow(r)},onStylesheetLoad:function(r,c){Me.attachLinkElement(r,c)},keepIframeSrcFn:Se});if(!c)return console.warn(`Failed to snapshot the document`);wrappedEmit({type:W.FullSnapshot,data:{node:c,initialOffset:getWindowScroll(window)}},r),Vc.forEach(function(r){return r.unlock()}),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Me.adoptStyleSheets(document.adoptedStyleSheets,ol.getId(document))}};try{var ze=[],observe=function(r){var c;return callbackWrapper(initObservers)({mutationCb:wrappedMutationEmit,mousemoveCb:function(r,c){return wrappedEmit({type:W.IncrementalSnapshot,data:{source:c,positions:r}})},mouseInteractionCb:function(r){return wrappedEmit({type:W.IncrementalSnapshot,data:_extends({source:G.MouseInteraction},r)})},scrollCb:wrappedScrollEmit,viewportResizeCb:function(r){return wrappedEmit({type:W.IncrementalSnapshot,data:_extends({source:G.ViewportResize},r)})},inputCb:function(r){return wrappedEmit({type:W.IncrementalSnapshot,data:_extends({source:G.Input},r)})},mediaInteractionCb:function(r){return wrappedEmit({type:W.IncrementalSnapshot,data:_extends({source:G.MediaInteraction},r)})},styleSheetRuleCb:function(r){return wrappedEmit({type:W.IncrementalSnapshot,data:_extends({source:G.StyleSheetRule},r)})},styleDeclarationCb:function(r){return wrappedEmit({type:W.IncrementalSnapshot,data:_extends({source:G.StyleDeclaration},r)})},canvasMutationCb:wrappedCanvasMutationEmit,fontCb:function(r){return wrappedEmit({type:W.IncrementalSnapshot,data:_extends({source:G.Font},r)})},selectionCb:function(r){wrappedEmit({type:W.IncrementalSnapshot,data:_extends({source:G.Selection},r)})},customElementCb:function(r){wrappedEmit({type:W.IncrementalSnapshot,data:_extends({source:G.CustomElement},r)})},blockClass:m,ignoreClass:y,ignoreSelector:x,maskTextClass:C,maskTextSelector:T,maskInputOptions:Oe,inlineStylesheet:D,sampling:ie,recordDOM:ce,recordCanvas:ue,inlineImages:ye,userTriggeredOnInput:ge,collectFonts:N,doc:r,maskInputFn:ee,maskTextFn:te,keepIframeSrcFn:Se,blockSelector:g,slimDOMOptions:ke,dataURLOptions:oe,mirror:ol,iframeManager:Ne,stylesheetManager:Me,shadowDomManager:Re,processedNodeManager:Le,canvasManager:rl,ignoreCSSAttributes:we,plugins:((c=be==null?void 0:be.filter(function(r){return r.observer}))==null?void 0:c.map(function(r){return{observer:r.observer,options:r.options,callback:function(c){return wrappedEmit({type:W.Plugin,data:{plugin:r.name,payload:c}})}}}))||[]},ne)};Ne.addLoadListener(function(r){try{ze.push(observe(r.contentDocument))}catch(r){console.warn(r)}});var init=function(){takeFullSnapshot$1(),ze.push(observe(document)),il=!0};return document.readyState===`interactive`||document.readyState===`complete`?init():(ze.push(on(`DOMContentLoaded`,function(){wrappedEmit({type:W.DomContentLoaded,data:{}}),me===`DOMContentLoaded`&&init()})),ze.push(on(`load`,function(){wrappedEmit({type:W.Load,data:{}}),me===`load`&&init()},window))),function(){ze.forEach(function(r){try{r()}catch(r){String(r).toLowerCase().includes(`cross-origin`)||console.warn(r)}}),Le.destroy(),il=!1,unregisterErrorHandler()}}catch(r){console.warn(r)}}record.addCustomEvent=function(r,c){if(!il)throw Error(`please add custom event after start recording`);wrappedEmit({type:W.Custom,data:{tag:r,payload:c}})},record.freezePage=function(){Vc.forEach(function(r){return r.freeze()})},record.takeFullSnapshot=function(r){if(!il)throw Error(`please take full snapshot after start recording`);takeFullSnapshot$1(r)},record.mirror=ol;var sl;(function(r){r[r.NotStarted=0]=`NotStarted`,r[r.Running=1]=`Running`,r[r.Stopped=2]=`Stopped`})(sl||(sl={})),record.addCustomEvent,record.freezePage,record.takeFullSnapshot;var cl=P.setImmediate,ll,ul,dl,fl=Object.prototype.toString,pl=cl===void 0?setTimeout:function timer(r){return cl(r)};try{Object.defineProperty({},"x",{}),ll=function builtInProp(r,c,l,u){return Object.defineProperty(r,c,{value:l,writable:!0,configurable:u!==!1})}}catch(r){ll=function builtInProp(r,c,l){return r[c]=l,r}}dl=(function Queue(){var r,c,l;function Item(r,c){this.fn=r,this.self=c,this.next=void 0}return{add:function add(u,p){l=new Item(u,p),c?c.next=l:r=l,c=l,l=void 0},drain:function drain(){var l=r;for(r=c=ul=void 0;l;)l.fn.call(l.self),l=l.next}}})();function schedule(r,c){dl.add(r,c),ul||(ul=pl(dl.drain))}function isThenable(r){var c,l=typeof r;return r!==null&&(l===`object`||l===`function`)&&(c=r.then),typeof c==`function`&&c}function notify(){for(var r=0;r<this.chain.length;r++)notifyIsolated(this,this.state===1?this.chain[r].success:this.chain[r].failure,this.chain[r]);this.chain.length=0}function notifyIsolated(r,c,l){var u,p;try{c===!1?l.reject(r.msg):(u=c===!0?r.msg:c.call(void 0,r.msg),u===l.promise?l.reject(TypeError(`Promise-chain cycle`)):(p=isThenable(u))?p.call(u,l.resolve,l.reject):l.resolve(u))}catch(r){l.reject(r)}}function resolve(r){var c,l=this;if(!l.triggered){l.triggered=!0,l.def&&(l=l.def);try{(c=isThenable(r))?schedule(function(){var u=new MakeDefWrapper(l);try{c.call(r,function $resolve$(){resolve.apply(u,arguments)},function $reject$(){reject.apply(u,arguments)})}catch(r){reject.call(u,r)}}):(l.msg=r,l.state=1,l.chain.length>0&&schedule(notify,l))}catch(r){reject.call(new MakeDefWrapper(l),r)}}}function reject(r){var c=this;c.triggered||(c.triggered=!0,c.def&&(c=c.def),c.msg=r,c.state=2,c.chain.length>0&&schedule(notify,c))}function iteratePromises(r,c,l,u){for(var p=0;p<c.length;p++)(function IIFE(p){r.resolve(c[p]).then(function $resolver$(r){l(p,r)},u)})(p)}function MakeDefWrapper(r){this.def=r,this.triggered=!1}function MakeDef(r){this.promise=r,this.state=0,this.triggered=!1,this.chain=[],this.msg=void 0}function NpoPromise(r){if(typeof r!=`function`)throw TypeError(`Not a function`);if(this.__NPO__!==0)throw TypeError(`Not a promise`);this.__NPO__=1;var c=new MakeDef(this);this.then=function then(r,l){var u={success:typeof r!=`function`||r,failure:typeof l==`function`&&l};return u.promise=new this.constructor(function extractChain(r,c){if(typeof r!=`function`||typeof c!=`function`)throw TypeError(`Not a function`);u.resolve=r,u.reject=c}),c.chain.push(u),c.state!==0&&schedule(notify,c),u.promise},this.catch=function $catch$(r){return this.then(void 0,r)};try{r.call(void 0,function publicResolve(r){resolve.call(c,r)},function publicReject(r){reject.call(c,r)})}catch(r){reject.call(c,r)}}var ml=ll({},`constructor`,NpoPromise,!1);NpoPromise.prototype=ml,ll(ml,`__NPO__`,0,!1),ll(NpoPromise,`resolve`,function Promise$resolve(r){var c=this;return r&&typeof r==`object`&&r.__NPO__===1?r:new c(function executor(c,l){if(typeof c!=`function`||typeof l!=`function`)throw TypeError(`Not a function`);c(r)})}),ll(NpoPromise,`reject`,function Promise$reject(r){return new this(function executor(c,l){if(typeof c!=`function`||typeof l!=`function`)throw TypeError(`Not a function`);l(r)})}),ll(NpoPromise,`all`,function Promise$all(r){var c=this;return fl.call(r)===`[object Array]`?r.length===0?c.resolve([]):new c(function executor(l,u){if(typeof l!=`function`||typeof u!=`function`)throw TypeError(`Not a function`);var p=r.length,m=Array(p),h=0;iteratePromises(c,r,function resolver(r,c){m[r]=c,++h===p&&l(m)},u)}):c.reject(TypeError(`Not an array`))}),ll(NpoPromise,`race`,function Promise$race(r){var c=this;return fl.call(r)===`[object Array]`?new c(function executor(l,u){if(typeof l!=`function`||typeof u!=`function`)throw TypeError(`Not a function`);iteratePromises(c,r,function resolver(r,c){l(c)},u)}):c.reject(TypeError(`Not an array`))});var K=typeof Promise<`u`&&Promise.toString().indexOf(`[native code]`)!==-1?Promise:NpoPromise,hl={DEBUG:!1,LIB_VERSION:`2.71.1`},gl=1440*60*1e3,_l=8*1e3,vl=Array.prototype,yl=Function.prototype,bl=Object.prototype,xl=vl.slice,Sl=bl.toString,Cl=bl.hasOwnProperty,q=P.console,wl=P.navigator,J=P.document,Tl=P.opera,El=P.screen,Dl=wl.userAgent,Ol=yl.bind,kl=vl.forEach,Al=vl.indexOf,jl=vl.map,Ml=Array.isArray,Nl={},Y={trim:function(r){return r.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,``)}},X={log:function(){if(hl.DEBUG&&!Y.isUndefined(q)&&q)try{q.log.apply(q,arguments)}catch(r){Y.each(arguments,function(r){q.log(r)})}},warn:function(){if(hl.DEBUG&&!Y.isUndefined(q)&&q){var r=[`Mixpanel warning:`].concat(Y.toArray(arguments));try{q.warn.apply(q,r)}catch(c){Y.each(r,function(r){q.warn(r)})}}},error:function(){if(hl.DEBUG&&!Y.isUndefined(q)&&q){var r=[`Mixpanel error:`].concat(Y.toArray(arguments));try{q.error.apply(q,r)}catch(c){Y.each(r,function(r){q.error(r)})}}},critical:function(){if(!Y.isUndefined(q)&&q){var r=[`Mixpanel error:`].concat(Y.toArray(arguments));try{q.error.apply(q,r)}catch(c){Y.each(r,function(r){q.error(r)})}}}},log_func_with_prefix=function(r,c){return function(){return arguments[0]=`[`+c+`] `+arguments[0],r.apply(X,arguments)}},console_with_prefix=function(r){return{log:log_func_with_prefix(X.log,r),error:log_func_with_prefix(X.error,r),critical:log_func_with_prefix(X.critical,r)}},safewrap=function(r){return function(){try{return r.apply(this,arguments)}catch(r){X.critical(`Implementation error. Please turn on debug and contact support@mixpanel.com.`),hl.DEBUG&&X.critical(r)}}},safewrapClass=function(r){var c=r.prototype;for(var l in c)typeof c[l]==`function`&&(c[l]=safewrap(c[l]))};Y.bind=function(r,c){var l,bound;if(Ol&&r.bind===Ol)return Ol.apply(r,xl.call(arguments,1));if(!Y.isFunction(r))throw TypeError();return l=xl.call(arguments,2),bound=function(){if(!(this instanceof bound))return r.apply(c,l.concat(xl.call(arguments)));var u={};u.prototype=r.prototype;var p=new u;u.prototype=null;var m=r.apply(p,l.concat(xl.call(arguments)));return Object(m)===m?m:p},bound},Y.each=function(r,c,l){if(r!=null){if(kl&&r.forEach===kl)r.forEach(c,l);else if(r.length===+r.length){for(var u=0,p=r.length;u<p;u++)if(u in r&&c.call(l,r[u],u,r)===Nl)return}else for(var m in r)if(Cl.call(r,m)&&c.call(l,r[m],m,r)===Nl)return}},Y.extend=function(r){return Y.each(xl.call(arguments,1),function(c){for(var l in c)c[l]!==void 0&&(r[l]=c[l])}),r},Y.isArray=Ml||function(r){return Sl.call(r)===`[object Array]`},Y.isFunction=function(r){try{return/^\s*\bfunction\b/.test(r)}catch(r){return!1}},Y.isArguments=function(r){return!!(r&&Cl.call(r,`callee`))},Y.toArray=function(r){return r?r.toArray?r.toArray():Y.isArray(r)||Y.isArguments(r)?xl.call(r):Y.values(r):[]},Y.map=function(r,c,l){if(jl&&r.map===jl)return r.map(c,l);var u=[];return Y.each(r,function(r){u.push(c.call(l,r))}),u},Y.keys=function(r){var c=[];return r===null||Y.each(r,function(r,l){c[c.length]=l}),c},Y.values=function(r){var c=[];return r===null||Y.each(r,function(r){c[c.length]=r}),c},Y.include=function(r,c){var l=!1;return r===null?l:Al&&r.indexOf===Al?r.indexOf(c)!=-1:(Y.each(r,function(r){if(l||(l=r===c))return Nl}),l)},Y.includes=function(r,c){return r.indexOf(c)!==-1},Y.inherit=function(r,c){return r.prototype=new c,r.prototype.constructor=r,r.superclass=c.prototype,r},Y.isObject=function(r){return r===Object(r)&&!Y.isArray(r)},Y.isEmptyObject=function(r){if(Y.isObject(r)){for(var c in r)if(Cl.call(r,c))return!1;return!0}return!1},Y.isUndefined=function(r){return r===void 0},Y.isString=function(r){return Sl.call(r)==`[object String]`},Y.isDate=function(r){return Sl.call(r)==`[object Date]`},Y.isNumber=function(r){return Sl.call(r)==`[object Number]`},Y.isElement=function(r){return!!(r&&r.nodeType===1)},Y.encodeDates=function(r){return Y.each(r,function(c,l){Y.isDate(c)?r[l]=Y.formatDate(c):Y.isObject(c)&&(r[l]=Y.encodeDates(c))}),r},Y.timestamp=function(){return Date.now=Date.now||function(){return+new Date},Date.now()},Y.formatDate=function(r){function pad(r){return r<10?`0`+r:r}return r.getUTCFullYear()+`-`+pad(r.getUTCMonth()+1)+`-`+pad(r.getUTCDate())+`T`+pad(r.getUTCHours())+`:`+pad(r.getUTCMinutes())+`:`+pad(r.getUTCSeconds())},Y.strip_empty_properties=function(r){var c={};return Y.each(r,function(r,l){Y.isString(r)&&r.length>0&&(c[l]=r)}),c},Y.truncate=function(r,c){var l;return typeof r==`string`?l=r.slice(0,c):Y.isArray(r)?(l=[],Y.each(r,function(r){l.push(Y.truncate(r,c))})):Y.isObject(r)?(l={},Y.each(r,function(r,u){l[u]=Y.truncate(r,c)})):l=r,l},Y.JSONEncode=(function(){return function(r){var c=r,quote=function(r){var c=/[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,l={"\b":`\\b`," ":`\\t`,"\n":`\\n`,"\f":`\\f`,"\r":`\\r`,'"':`\\"`,"\\":`\\\\`};return c.lastIndex=0,c.test(r)?`"`+r.replace(c,function(r){var c=l[r];return typeof c==`string`?c:`\\u`+(`0000`+r.charCodeAt(0).toString(16)).slice(-4)})+`"`:`"`+r+`"`},str=function(r,c){var l=``,u=` `,p=0,m=``,h=``,g=0,v=l,y=[],b=c[r];switch(b&&typeof b==`object`&&typeof b.toJSON==`function`&&(b=b.toJSON(r)),typeof b){case`string`:return quote(b);case`number`:return isFinite(b)?String(b):`null`;case`boolean`:case`null`:return String(b);case`object`:if(!b)return`null`;if(l+=u,y=[],Sl.apply(b)===`[object Array]`){for(g=b.length,p=0;p<g;p+=1)y[p]=str(p,b)||`null`;return h=y.length===0?`[]`:l?`[ |
| 59 |
`+l+y.join(`, |
| 60 |
`+l)+` |
| 61 |
`+v+`]`:`[`+y.join(`,`)+`]`,l=v,h}for(m in b)Cl.call(b,m)&&(h=str(m,b),h&&y.push(quote(m)+(l?`: `:`:`)+h));return h=y.length===0?`{}`:l?`{`+y.join(`,`)+v+`}`:`{`+y.join(`,`)+`}`,l=v,h}};return str(``,{"":c})}})(),Y.JSONDecode=(function(){var r,c,l={'"':`"`,"\\":`\\`,"/":`/`,b:`\b`,f:`\f`,n:` |
| 62 |
`,r:`\r`,t:` `},u,error=function(c){var l=SyntaxError(c);throw l.at=r,l.text=u,l},next=function(l){return l&&l!==c&&error(`Expected '`+l+`' instead of '`+c+`'`),c=u.charAt(r),r+=1,c},number=function(){var r,l=``;for(c===`-`&&(l=`-`,next(`-`));c>=`0`&&c<=`9`;)l+=c,next();if(c===`.`)for(l+=`.`;next()&&c>=`0`&&c<=`9`;)l+=c;if(c===`e`||c===`E`)for(l+=c,next(),(c===`-`||c===`+`)&&(l+=c,next());c>=`0`&&c<=`9`;)l+=c,next();if(r=+l,!isFinite(r))error(`Bad number`);else return r},string=function(){var r,u,p=``,m;if(c===`"`)for(;next();){if(c===`"`)return next(),p;if(c===`\\`)if(next(),c===`u`){for(m=0,u=0;u<4&&(r=parseInt(next(),16),isFinite(r));u+=1)m=m*16+r;p+=String.fromCharCode(m)}else if(typeof l[c]==`string`)p+=l[c];else break;else p+=c}error(`Bad string`)},white=function(){for(;c&&c<=` `;)next()},word=function(){switch(c){case`t`:return next(`t`),next(`r`),next(`u`),next(`e`),!0;case`f`:return next(`f`),next(`a`),next(`l`),next(`s`),next(`e`),!1;case`n`:return next(`n`),next(`u`),next(`l`),next(`l`),null}error(`Unexpected "`+c+`"`)},value,array=function(){var r=[];if(c===`[`){if(next(`[`),white(),c===`]`)return next(`]`),r;for(;c;){if(r.push(value()),white(),c===`]`)return next(`]`),r;next(`,`),white()}}error(`Bad array`)},object=function(){var r,l={};if(c===`{`){if(next(`{`),white(),c===`}`)return next(`}`),l;for(;c;){if(r=string(),white(),next(`:`),Object.hasOwnProperty.call(l,r)&&error(`Duplicate key "`+r+`"`),l[r]=value(),white(),c===`}`)return next(`}`),l;next(`,`),white()}}error(`Bad object`)};return value=function(){switch(white(),c){case`{`:return object();case`[`:return array();case`"`:return string();case`-`:return number();default:return c>=`0`&&c<=`9`?number():word()}},function(l){var p;return u=l,r=0,c=` `,p=value(),white(),c&&error(`Syntax error`),p}})(),Y.base64Encode=function(r){var c=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=`,l,u,p,m,h,g,v,y,b=0,x=0,S=``,C=[];if(!r)return r;r=Y.utf8Encode(r);do l=r.charCodeAt(b++),u=r.charCodeAt(b++),p=r.charCodeAt(b++),y=l<<16|u<<8|p,m=y>>18&63,h=y>>12&63,g=y>>6&63,v=y&63,C[x++]=c.charAt(m)+c.charAt(h)+c.charAt(g)+c.charAt(v);while(b<r.length);switch(S=C.join(``),r.length%3){case 1:S=S.slice(0,-2)+`==`;break;case 2:S=S.slice(0,-1)+`=`;break}return S},Y.utf8Encode=function(r){r=(r+``).replace(/\r\n/g,` |
| 63 |
`).replace(/\r/g,` |
| 64 |
`);var c=``,l,u,p=0,m;for(l=u=0,p=r.length,m=0;m<p;m++){var h=r.charCodeAt(m),g=null;h<128?u++:g=h>127&&h<2048?String.fromCharCode(h>>6|192,h&63|128):String.fromCharCode(h>>12|224,h>>6&63|128,h&63|128),g!==null&&(u>l&&(c+=r.substring(l,u)),c+=g,l=u=m+1)}return u>l&&(c+=r.substring(l,r.length)),c},Y.UUID=function(){try{return P.crypto.randomUUID()}catch(l){for(var r=Array(36),c=0;c<36;c++)r[c]=Math.floor(Math.random()*16);return r[14]=4,r[19]=r[19]&=-5,r[19]=r[19]|=8,r[8]=r[13]=r[18]=r[23]=`-`,Y.map(r,function(r){return r.toString(16)}).join(``)}};var Pl=[`ahrefsbot`,`ahrefssiteaudit`,`amazonbot`,`baiduspider`,`bingbot`,`bingpreview`,`chrome-lighthouse`,`facebookexternal`,`petalbot`,`pinterest`,`screaming frog`,`yahoo! slurp`,`yandex`,`adsbot-google`,`apis-google`,`duplexweb-google`,`feedfetcher-google`,`google favicon`,`google web preview`,`google-read-aloud`,`googlebot`,`googleweblight`,`mediapartners-google`,`storebot-google`];Y.isBlockedUA=function(r){var c;for(r=r.toLowerCase(),c=0;c<Pl.length;c++)if(r.indexOf(Pl[c])!==-1)return!0;return!1},Y.HTTPBuildQuery=function(r,c){var l,u,p=[];return Y.isUndefined(c)&&(c=`&`),Y.each(r,function(r,c){l=encodeURIComponent(r.toString()),u=encodeURIComponent(c),p[p.length]=u+`=`+l}),p.join(c)},Y.getQueryParam=function(r,c){c=c.replace(/[[]/g,`\\[`).replace(/[\]]/g,`\\]`);var l=`[\\?&]`+c+`=([^&#]*)`,u=new RegExp(l).exec(r);if(u===null||u&&typeof u[1]!=`string`&&u[1].length)return``;var p=u[1];try{p=decodeURIComponent(p)}catch(r){X.error(`Skipping decoding for malformed query param: `+p)}return p.replace(/\+/g,` `)},Y.cookie={get:function(r){for(var c=r+`=`,l=J.cookie.split(`;`),u=0;u<l.length;u++){for(var p=l[u];p.charAt(0)==` `;)p=p.substring(1,p.length);if(p.indexOf(c)===0)return decodeURIComponent(p.substring(c.length,p.length))}return null},parse:function(r){var c;try{c=Y.JSONDecode(Y.cookie.get(r))||{}}catch(r){}return c},set_seconds:function(r,c,l,u,p,m,h){var g=``,v=``,y=``;if(h)g=`; domain=`+h;else if(u){var b=extract_domain(J.location.hostname);g=b?`; domain=.`+b:``}if(l){var x=new Date;x.setTime(x.getTime()+l*1e3),v=`; expires=`+x.toGMTString()}m&&(p=!0,y=`; SameSite=None`),p&&(y+=`; secure`),J.cookie=r+`=`+encodeURIComponent(c)+v+`; path=/`+g+y},set:function(r,c,l,u,p,m,h){var g=``,v=``,y=``;if(h)g=`; domain=`+h;else if(u){var b=extract_domain(J.location.hostname);g=b?`; domain=.`+b:``}if(l){var x=new Date;x.setTime(x.getTime()+l*24*60*60*1e3),v=`; expires=`+x.toGMTString()}m&&(p=!0,y=`; SameSite=None`),p&&(y+=`; secure`);var S=r+`=`+encodeURIComponent(c)+v+`; path=/`+g+y;return J.cookie=S,S},remove:function(r,c,l){Y.cookie.set(r,``,-1,c,!1,!1,l)}};var _testStorageSupported=function(r){var c=!0;try{var l=`__mplss_`+cheap_guid(8),u=`xyz`;r.setItem(l,u),r.getItem(l)!==u&&(c=!1),r.removeItem(l)}catch(r){c=!1}return c},Fl=null,localStorageSupported=function(r,c){return Fl!==null&&!c?Fl:Fl=_testStorageSupported(r||P.localStorage)},Il=null,sessionStorageSupported=function(r,c){return Il!==null&&!c?Il:Il=_testStorageSupported(r||P.sessionStorage)};function _storageWrapper(r,c,l){var log_error=function(r){X.error(c+` error: `+r)};return{is_supported:function(u){var p=l(r,u);return p||X.error(c+` unsupported`),p},error:log_error,get:function(c){try{return r.getItem(c)}catch(r){log_error(r)}return null},parse:function(c){try{return Y.JSONDecode(r.getItem(c))||{}}catch(r){}return null},set:function(c,l){try{r.setItem(c,l)}catch(r){log_error(r)}},remove:function(c){try{r.removeItem(c)}catch(r){log_error(r)}}}}Y.localStorage=_storageWrapper(P.localStorage,`localStorage`,localStorageSupported),Y.sessionStorage=_storageWrapper(P.sessionStorage,`sessionStorage`,sessionStorageSupported),Y.register_event=(function(){var register_event=function(r,c,l,u,p){if(!r){X.error(`No valid element provided to register_event`);return}if(r.addEventListener&&!u)r.addEventListener(c,l,!!p);else{var m=`on`+c,h=r[m];r[m]=makeHandler(r,l,h)}};function makeHandler(r,c,l){var handler=function(u){if(u=u||fixEvent(P.event),u){var p=!0,m,h;return Y.isFunction(l)&&(m=l(u)),h=c.call(r,u),(!1===m||!1===h)&&(p=!1),p}};return handler}function fixEvent(r){return r&&(r.preventDefault=fixEvent.preventDefault,r.stopPropagation=fixEvent.stopPropagation),r}return fixEvent.preventDefault=function(){this.returnValue=!1},fixEvent.stopPropagation=function(){this.cancelBubble=!0},register_event})();var Ll=RegExp(`^(\\w*)\\[(\\w+)([=~\\|\\^\\$\\*]?)=?"?([^\\]"]*)"?\\]$`);Y.dom_query=(function(){function getAllChildren(r){return r.all?r.all:r.getElementsByTagName(`*`)}var r=/[\t\r\n]/g;function hasClass(c,l){var u=` `+l+` `;return(` `+c.className+` `).replace(r,` `).indexOf(u)>=0}function getElementsBySelector(r){if(!J.getElementsByTagName)return[];var c=r.split(` `),l,u,p,m,h,g,v,y,b,x,S=[J];for(g=0;g<c.length;g++){if(l=c[g].replace(/^\s+/,``).replace(/\s+$/,``),l.indexOf(`#`)>-1){u=l.split(`#`),p=u[0];var C=u[1],w=J.getElementById(C);if(!w||p&&w.nodeName.toLowerCase()!=p)return[];S=[w];continue}if(l.indexOf(`.`)>-1){u=l.split(`.`),p=u[0];var T=u[1];for(p||(p=`*`),m=[],h=0,v=0;v<S.length;v++)for(b=p==`*`?getAllChildren(S[v]):S[v].getElementsByTagName(p),y=0;y<b.length;y++)m[h++]=b[y];for(S=[],x=0,v=0;v<m.length;v++)m[v].className&&Y.isString(m[v].className)&&hasClass(m[v],T)&&(S[x++]=m[v]);continue}var E=l.match(Ll);if(E){p=E[1];var D=E[2],O=E[3],k=E[4];for(p||(p=`*`),m=[],h=0,v=0;v<S.length;v++)for(b=p==`*`?getAllChildren(S[v]):S[v].getElementsByTagName(p),y=0;y<b.length;y++)m[h++]=b[y];S=[],x=0;var checkFunction;switch(O){case`=`:checkFunction=function(r){return r.getAttribute(D)==k};break;case`~`:checkFunction=function(r){return r.getAttribute(D).match(RegExp(`\\b`+k+`\\b`))};break;case`|`:checkFunction=function(r){return r.getAttribute(D).match(RegExp(`^`+k+`-?`))};break;case`^`:checkFunction=function(r){return r.getAttribute(D).indexOf(k)===0};break;case`$`:checkFunction=function(r){return r.getAttribute(D).lastIndexOf(k)==r.getAttribute(D).length-k.length};break;case`*`:checkFunction=function(r){return r.getAttribute(D).indexOf(k)>-1};break;default:checkFunction=function(r){return r.getAttribute(D)}}for(S=[],x=0,v=0;v<m.length;v++)checkFunction(m[v])&&(S[x++]=m[v]);continue}for(p=l,m=[],h=0,v=0;v<S.length;v++)for(b=S[v].getElementsByTagName(p),y=0;y<b.length;y++)m[h++]=b[y];S=m}return S}return function(r){return Y.isElement(r)?[r]:Y.isObject(r)&&!Y.isUndefined(r.length)?r:getElementsBySelector.call(this,r)}})();var Rl=[`utm_source`,`utm_medium`,`utm_campaign`,`utm_content`,`utm_term`,`utm_id`,`utm_source_platform`,`utm_campaign_id`,`utm_creative_format`,`utm_marketing_tactic`],zl=[`dclid`,`fbclid`,`gclid`,`ko_click_id`,`li_fat_id`,`msclkid`,`sccid`,`ttclid`,`twclid`,`wbraid`];Y.info={campaignParams:function(r){var c=``,l={};return Y.each(Rl,function(u){c=Y.getQueryParam(J.URL,u),c.length?l[u]=c:r!==void 0&&(l[u]=r)}),l},clickParams:function(){var r=``,c={};return Y.each(zl,function(l){r=Y.getQueryParam(J.URL,l),r.length&&(c[l]=r)}),c},marketingParams:function(){return Y.extend(Y.info.campaignParams(),Y.info.clickParams())},searchEngine:function(r){return r.search(`https?://(.*)google.([^/?]*)`)===0?`google`:r.search(`https?://(.*)bing.com`)===0?`bing`:r.search(`https?://(.*)yahoo.com`)===0?`yahoo`:r.search(`https?://(.*)duckduckgo.com`)===0?`duckduckgo`:null},searchInfo:function(r){var c=Y.info.searchEngine(r),l=c==`yahoo`?`p`:`q`,u={};if(c!==null){u.$search_engine=c;var p=Y.getQueryParam(r,l);p.length&&(u.mp_keyword=p)}return u},browser:function(r,c,l){return c=c||``,l||Y.includes(r,` OPR/`)?Y.includes(r,`Mini`)?`Opera Mini`:`Opera`:/(BlackBerry|PlayBook|BB10)/i.test(r)?`BlackBerry`:Y.includes(r,`IEMobile`)||Y.includes(r,`WPDesktop`)?`Internet Explorer Mobile`:Y.includes(r,`SamsungBrowser/`)?`Samsung Internet`:Y.includes(r,`Edge`)||Y.includes(r,`Edg/`)?`Microsoft Edge`:Y.includes(r,`FBIOS`)?`Facebook Mobile`:Y.includes(r,`Whale/`)?`Whale Browser`:Y.includes(r,`Chrome`)?`Chrome`:Y.includes(r,`CriOS`)?`Chrome iOS`:Y.includes(r,`UCWEB`)||Y.includes(r,`UCBrowser`)?`UC Browser`:Y.includes(r,`FxiOS`)?`Firefox iOS`:Y.includes(c,`Apple`)?Y.includes(r,`Mobile`)?`Mobile Safari`:`Safari`:Y.includes(r,`Android`)?`Android Mobile`:Y.includes(r,`Konqueror`)?`Konqueror`:Y.includes(r,`Firefox`)?`Firefox`:Y.includes(r,`MSIE`)||Y.includes(r,`Trident/`)?`Internet Explorer`:Y.includes(r,`Gecko`)?`Mozilla`:``},browserVersion:function(r,c,l){var u={"Internet Explorer Mobile":/rv:(\d+(\.\d+)?)/,"Microsoft Edge":/Edge?\/(\d+(\.\d+)?)/,Chrome:/Chrome\/(\d+(\.\d+)?)/,"Chrome iOS":/CriOS\/(\d+(\.\d+)?)/,"UC Browser":/(UCBrowser|UCWEB)\/(\d+(\.\d+)?)/,Safari:/Version\/(\d+(\.\d+)?)/,"Mobile Safari":/Version\/(\d+(\.\d+)?)/,Opera:/(Opera|OPR)\/(\d+(\.\d+)?)/,Firefox:/Firefox\/(\d+(\.\d+)?)/,"Firefox iOS":/FxiOS\/(\d+(\.\d+)?)/,Konqueror:/Konqueror:(\d+(\.\d+)?)/,BlackBerry:/BlackBerry (\d+(\.\d+)?)/,"Android Mobile":/android\s(\d+(\.\d+)?)/,"Samsung Internet":/SamsungBrowser\/(\d+(\.\d+)?)/,"Internet Explorer":/(rv:|MSIE )(\d+(\.\d+)?)/,Mozilla:/rv:(\d+(\.\d+)?)/,"Whale Browser":/Whale\/(\d+(\.\d+)?)/}[Y.info.browser(r,c,l)];if(u===void 0)return null;var p=r.match(u);return p?parseFloat(p[p.length-2]):null},os:function(){var r=Dl;return/Windows/i.test(r)?/Phone/.test(r)||/WPDesktop/.test(r)?`Windows Phone`:`Windows`:/(iPhone|iPad|iPod)/.test(r)?`iOS`:/Android/.test(r)?`Android`:/(BlackBerry|PlayBook|BB10)/i.test(r)?`BlackBerry`:/Mac/i.test(r)?`Mac OS X`:/Linux/.test(r)?`Linux`:/CrOS/.test(r)?`Chrome OS`:``},device:function(r){return/Windows Phone/i.test(r)||/WPDesktop/.test(r)?`Windows Phone`:/iPad/.test(r)?`iPad`:/iPod/.test(r)?`iPod Touch`:/iPhone/.test(r)?`iPhone`:/(BlackBerry|PlayBook|BB10)/i.test(r)?`BlackBerry`:/Android/.test(r)?`Android`:``},referringDomain:function(r){var c=r.split(`/`);return c.length>=3?c[2]:``},currentUrl:function(){return P.location.href},properties:function(r){return typeof r!=`object`&&(r={}),Y.extend(Y.strip_empty_properties({$os:Y.info.os(),$browser:Y.info.browser(Dl,wl.vendor,Tl),$referrer:J.referrer,$referring_domain:Y.info.referringDomain(J.referrer),$device:Y.info.device(Dl)}),{$current_url:Y.info.currentUrl(),$browser_version:Y.info.browserVersion(Dl,wl.vendor,Tl),$screen_height:El.height,$screen_width:El.width,mp_lib:`web`,$lib_version:hl.LIB_VERSION,$insert_id:cheap_guid(),time:Y.timestamp()/1e3},Y.strip_empty_properties(r))},people_properties:function(){return Y.extend(Y.strip_empty_properties({$os:Y.info.os(),$browser:Y.info.browser(Dl,wl.vendor,Tl)}),{$browser_version:Y.info.browserVersion(Dl,wl.vendor,Tl)})},mpPageViewProperties:function(){return Y.strip_empty_properties({current_page_title:J.title,current_domain:P.location.hostname,current_url_path:P.location.pathname,current_url_protocol:P.location.protocol,current_url_search:P.location.search})}};var batchedThrottle=function(r,c){var l=null,u=[];return function(p){var m=this;return u.push(p),l||(l=new K(function(p){setTimeout(function(){var c=r.apply(m,[u]);l=null,u=[],p(c)},c)})),l}},cheap_guid=function(r){var c=Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10);return r?c.substring(0,r):c},generateTraceparent=function(){var r=Y.UUID().replace(/-/g,``),c=Y.UUID().replace(/-/g,``).substring(0,16);return`00-`+r+`-`+c+`-01`},Bl=/[a-z0-9][a-z0-9-]*\.[a-z]+$/i,Vl=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,extract_domain=function(r){var c=Vl,l=r.split(`.`),u=l[l.length-1];(u.length>4||u===`com`||u===`org`)&&(c=Bl);var p=r.match(c);return p?p[0]:``},isOnline=function(){var r=P.navigator.onLine;return Y.isUndefined(r)||r},NOOP_FUNC=function(){},Hl=null,Ul=null;typeof JSON<`u`&&(Hl=JSON.stringify,Ul=JSON.parse),Hl=Hl||Y.JSONEncode,Ul=Ul||Y.JSONDecode,Y.info=Y.info,Y.info.browser=Y.info.browser,Y.info.browserVersion=Y.info.browserVersion,Y.info.device=Y.info.device,Y.info.properties=Y.info.properties,Y.isBlockedUA=Y.isBlockedUA,Y.isEmptyObject=Y.isEmptyObject,Y.isObject=Y.isObject,Y.JSONDecode=Y.JSONDecode,Y.JSONEncode=Y.JSONEncode,Y.toArray=Y.toArray,Y.NPO=NpoPromise;var Wl=`mixpanelBrowserDb`,Gl=`mixpanelRecordingEvents`,Kl=`mixpanelRecordingRegistry`,ql=1,Jl=[Gl,Kl],IDBStorageWrapper=function(r){this.dbPromise=null,this.storeName=r};IDBStorageWrapper.prototype._openDb=function(){return new K(function(r,c){var l=P.indexedDB.open(Wl,ql);l.onerror=function(){c(l.error)},l.onsuccess=function(){r(l.result)},l.onupgradeneeded=function(r){var c=r.target.result;Jl.forEach(function(r){c.createObjectStore(r)})}})},IDBStorageWrapper.prototype.init=function(){return P.indexedDB?(this.dbPromise||(this.dbPromise=this._openDb()),this.dbPromise.then(function(r){return r instanceof P.IDBDatabase?K.resolve():K.reject(r)})):K.reject(`indexedDB is not supported in this browser`)},IDBStorageWrapper.prototype.isInitialized=function(){return!!this.dbPromise},IDBStorageWrapper.prototype.makeTransaction=function(r,c){var l=this.storeName,doTransaction=function(u){return new K(function(p,m){var h=u.transaction(l,r);h.oncomplete=function(){p(h)},h.onabort=h.onerror=function(){m(h.error)},c(h.objectStore(l))})};return this.dbPromise.then(doTransaction).catch(function(r){return r&&r.name===`InvalidStateError`?(this.dbPromise=this._openDb(),this.dbPromise.then(doTransaction)):K.reject(r)}.bind(this))},IDBStorageWrapper.prototype.setItem=function(r,c){return this.makeTransaction(`readwrite`,function(l){l.put(c,r)})},IDBStorageWrapper.prototype.getItem=function(r){var c;return this.makeTransaction(`readonly`,function(l){c=l.get(r)}).then(function(){return c.result})},IDBStorageWrapper.prototype.removeItem=function(r){return this.makeTransaction(`readwrite`,function(c){c.delete(r)})},IDBStorageWrapper.prototype.getAll=function(){var r;return this.makeTransaction(`readonly`,function(c){r=c.getAll()}).then(function(){return r.result})};var Yl=`__mp_opt_in_out_`;function optIn(r,c){_optInOut(!0,r,c)}function optOut(r,c){_optInOut(!1,r,c)}function hasOptedIn(r,c){return _getStorageValue(r,c)===`1`}function hasOptedOut(r,c){if(_hasDoNotTrackFlagOn(c))return X.warn(`This browser has "Do Not Track" enabled. This will prevent the Mixpanel SDK from sending any data. To ignore the "Do Not Track" browser setting, initialize the Mixpanel instance with the config "ignore_dnt: true"`),!0;var l=_getStorageValue(r,c)===`0`;return l&&X.warn(`You are opted out of Mixpanel tracking. This will prevent the Mixpanel SDK from sending any data.`),l}function addOptOutCheckMixpanelLib(r){return _addOptOutCheck(r,function(r){return this.get_config(r)})}function addOptOutCheckMixpanelPeople(r){return _addOptOutCheck(r,function(r){return this._get_config(r)})}function addOptOutCheckMixpanelGroup(r){return _addOptOutCheck(r,function(r){return this._get_config(r)})}function clearOptInOut(r,c){c=c||{},_getStorage(c).remove(_getStorageKey(r,c),!!c.crossSubdomainCookie,c.cookieDomain)}function _getStorage(r){return r=r||{},r.persistenceType===`localStorage`?Y.localStorage:Y.cookie}function _getStorageKey(r,c){return c=c||{},(c.persistencePrefix||Yl)+r}function _getStorageValue(r,c){return _getStorage(c).get(_getStorageKey(r,c))}function _hasDoNotTrackFlagOn(r){if(r&&r.ignoreDnt)return!1;var c=r&&r.window||P,l=c.navigator||{},u=!1;return Y.each([l.doNotTrack,l.msDoNotTrack,c.doNotTrack],function(r){Y.includes([!0,1,`1`,`yes`],r)&&(u=!0)}),u}function _optInOut(r,c,l){if(!Y.isString(c)||!c.length){X.error(`gdpr.`+(r?`optIn`:`optOut`)+` called with an invalid token`);return}l=l||{},_getStorage(l).set(_getStorageKey(c,l),+!!r,Y.isNumber(l.cookieExpiration)?l.cookieExpiration:null,!!l.crossSubdomainCookie,!!l.secureCookie,!!l.crossSiteCookie,l.cookieDomain),l.track&&r&&l.track(l.trackEventName||`$opt_in`,l.trackProperties,{send_immediately:!0})}function _addOptOutCheck(r,c){return function(){var l=!1;try{var u=c.call(this,`token`),p=c.call(this,`ignore_dnt`),m=c.call(this,`opt_out_tracking_persistence_type`),h=c.call(this,`opt_out_tracking_cookie_prefix`),g=c.call(this,`window`);u&&(l=hasOptedOut(u,{ignoreDnt:p,persistenceType:m,persistencePrefix:h,window:g}))}catch(r){X.error(`Unexpected error when checking tracking opt-out status: `+r)}if(!l)return r.apply(this,arguments);var v=arguments[arguments.length-1];typeof v==`function`&&v(0)}}var Xl=console_with_prefix(`lock`),SharedLock=function(r,c){c=c||{},this.storageKey=r,this.storage=c.storage||P.localStorage,this.pollIntervalMS=c.pollIntervalMS||100,this.timeoutMS=c.timeoutMS||2e3,this.promiseImpl=c.promiseImpl||K};SharedLock.prototype.withLock=function(r,c){var l=this.promiseImpl;return new l(Y.bind(function(l,u){var p=c||new Date().getTime()+`|`+Math.random(),m=new Date().getTime(),h=this.storageKey,g=this.pollIntervalMS,v=this.timeoutMS,y=this.storage,b=h+`:X`,x=h+`:Y`,S=h+`:Z`,delay=function(r){if(new Date().getTime()-m>v){Xl.error(`Timeout waiting for mutex on `+h+`; clearing lock. [`+p+`]`),y.removeItem(S),y.removeItem(x),loop();return}setTimeout(function(){try{r()}catch(r){u(r)}},g*(Math.random()+.1))},waitFor=function(r,c){r()?c():delay(function(){waitFor(r,c)})},getSetY=function(){var r=y.getItem(x);return r&&r!==p?!1:(y.setItem(x,p),y.getItem(x)===p?!0:(localStorageSupported(y,!0)||u(Error(`localStorage support dropped while acquiring lock`)),!1))},loop=function(){y.setItem(b,p),waitFor(getSetY,function(){if(y.getItem(b)===p){criticalSection();return}delay(function(){if(y.getItem(x)!==p){loop();return}waitFor(function(){return!y.getItem(S)},criticalSection)})})},criticalSection=function(){y.setItem(S,`1`);var removeLock=function(){y.removeItem(S),y.getItem(x)===p&&y.removeItem(x),y.getItem(b)===p&&y.removeItem(b)};r().then(function(r){removeLock(),l(r)}).catch(function(r){removeLock(),u(r)})};try{if(localStorageSupported(y,!0))loop();else throw Error(`localStorage support check failed`)}catch(r){u(r)}},this))};var LocalStorageWrapper=function(r){this.storage=r||P.localStorage};LocalStorageWrapper.prototype.init=function(){return K.resolve()},LocalStorageWrapper.prototype.isInitialized=function(){return!0},LocalStorageWrapper.prototype.setItem=function(r,c){return new K(Y.bind(function(l,u){try{this.storage.setItem(r,Hl(c))}catch(r){u(r)}l()},this))},LocalStorageWrapper.prototype.getItem=function(r){return new K(Y.bind(function(c,l){var u;try{u=Ul(this.storage.getItem(r))}catch(r){l(r)}c(u)},this))},LocalStorageWrapper.prototype.removeItem=function(r){return new K(Y.bind(function(c,l){try{this.storage.removeItem(r)}catch(r){l(r)}c()},this))};var Zl=console_with_prefix(`batch`),RequestQueue=function(r,c){c=c||{},this.storageKey=r,this.usePersistence=c.usePersistence,this.usePersistence&&(this.queueStorage=c.queueStorage||new LocalStorageWrapper,this.lock=new SharedLock(r,{storage:c.sharedLockStorage||P.localStorage,timeoutMS:c.sharedLockTimeoutMS})),this.reportError=c.errorReporter||Y.bind(Zl.error,Zl),this.pid=c.pid||null,this.memQueue=[],this.initialized=!1,c.enqueueThrottleMs?this.enqueuePersisted=batchedThrottle(Y.bind(this._enqueuePersisted,this),c.enqueueThrottleMs):this.enqueuePersisted=Y.bind(function(r){return this._enqueuePersisted([r])},this)};RequestQueue.prototype.ensureInit=function(){return this.initialized||!this.usePersistence?K.resolve():this.queueStorage.init().then(Y.bind(function(){this.initialized=!0},this)).catch(Y.bind(function(r){this.reportError(`Error initializing queue persistence. Disabling persistence`,r),this.initialized=!0,this.usePersistence=!1},this))},RequestQueue.prototype.enqueue=function(r,c){var l={id:cheap_guid(),flushAfter:new Date().getTime()+c*2,payload:r};return this.usePersistence?this.enqueuePersisted(l):(this.memQueue.push(l),K.resolve(!0))},RequestQueue.prototype._enqueuePersisted=function(r){var c=Y.bind(function(){return this.ensureInit().then(Y.bind(function(){return this.readFromStorage()},this)).then(Y.bind(function(c){return this.saveToStorage(c.concat(r))},this)).then(Y.bind(function(c){return c&&(this.memQueue=this.memQueue.concat(r)),c},this)).catch(Y.bind(function(c){return this.reportError(`Error enqueueing items`,c,r),!1},this))},this);return this.lock.withLock(c,this.pid).catch(Y.bind(function(r){return this.reportError(`Error acquiring storage lock`,r),!1},this))},RequestQueue.prototype.fillBatch=function(r){var c=this.memQueue.slice(0,r);return this.usePersistence&&c.length<r?this.ensureInit().then(Y.bind(function(){return this.readFromStorage()},this)).then(Y.bind(function(l){if(l.length){var u={};Y.each(c,function(r){u[r.id]=!0});for(var p=0;p<l.length;p++){var m=l[p];if(new Date().getTime()>m.flushAfter&&!u[m.id]&&(m.orphaned=!0,c.push(m),c.length>=r))break}}return c},this)):K.resolve(c)};var filterOutIDsAndInvalid=function(r,c){var l=[];return Y.each(r,function(r){r.id&&!c[r.id]&&l.push(r)}),l};RequestQueue.prototype.removeItemsByID=function(r){var c={};if(Y.each(r,function(r){c[r]=!0}),this.memQueue=filterOutIDsAndInvalid(this.memQueue,c),this.usePersistence){var l=Y.bind(function(){return this.ensureInit().then(Y.bind(function(){return this.readFromStorage()},this)).then(Y.bind(function(r){return r=filterOutIDsAndInvalid(r,c),this.saveToStorage(r)},this)).then(Y.bind(function(){return this.readFromStorage()},this)).then(Y.bind(function(r){for(var l=0;l<r.length;l++){var u=r[l];if(u.id&&c[u.id])throw Error(`Item not removed from storage`)}return!0},this)).catch(Y.bind(function(c){return this.reportError(`Error removing items`,c,r),!1},this))},this);return this.lock.withLock(l,this.pid).catch(Y.bind(function(r){return this.reportError(`Error acquiring storage lock`,r),!localStorageSupported(this.lock.storage,!0)&&l().then(Y.bind(function(r){return r||this.queueStorage.removeItem(this.storageKey).then(function(){return r})},this)).catch(Y.bind(function(r){return this.reportError(`Error clearing queue`,r),!1},this))},this))}else return K.resolve(!0)};var updatePayloads=function(r,c){var l=[];return Y.each(r,function(r){var u=r.id;if(u in c){var p=c[u];p!==null&&(r.payload=p,l.push(r))}else l.push(r)}),l};RequestQueue.prototype.updatePayloads=function(r){return this.memQueue=updatePayloads(this.memQueue,r),this.usePersistence?this.lock.withLock(Y.bind(function lockAcquired(){return this.ensureInit().then(Y.bind(function(){return this.readFromStorage()},this)).then(Y.bind(function(c){return c=updatePayloads(c,r),this.saveToStorage(c)},this)).catch(Y.bind(function(c){return this.reportError(`Error updating items`,r,c),!1},this))},this),this.pid).catch(Y.bind(function(r){return this.reportError(`Error acquiring storage lock`,r),!1},this)):K.resolve(!0)},RequestQueue.prototype.readFromStorage=function(){return this.ensureInit().then(Y.bind(function(){return this.queueStorage.getItem(this.storageKey)},this)).then(Y.bind(function(r){return r&&(Y.isArray(r)||(this.reportError(`Invalid storage entry:`,r),r=null)),r||[]},this)).catch(Y.bind(function(r){return this.reportError(`Error retrieving queue`,r),[]},this))},RequestQueue.prototype.saveToStorage=function(r){return this.ensureInit().then(Y.bind(function(){return this.queueStorage.setItem(this.storageKey,r)},this)).then(function(){return!0}).catch(Y.bind(function(r){return this.reportError(`Error saving queue`,r),!1},this))},RequestQueue.prototype.clear=function(){return this.memQueue=[],this.usePersistence?this.ensureInit().then(Y.bind(function(){return this.queueStorage.removeItem(this.storageKey)},this)):K.resolve()};var Ql=600*1e3,$l=console_with_prefix(`batch`),RequestBatcher=function(r,c){this.errorReporter=c.errorReporter,this.queue=new RequestQueue(r,{errorReporter:Y.bind(this.reportError,this),queueStorage:c.queueStorage,sharedLockStorage:c.sharedLockStorage,sharedLockTimeoutMS:c.sharedLockTimeoutMS,usePersistence:c.usePersistence,enqueueThrottleMs:c.enqueueThrottleMs}),this.libConfig=c.libConfig,this.sendRequest=c.sendRequestFunc,this.beforeSendHook=c.beforeSendHook,this.stopAllBatching=c.stopAllBatchingFunc,this.batchSize=this.libConfig.batch_size,this.flushInterval=this.libConfig.batch_flush_interval_ms,this.stopped=!this.libConfig.batch_autostart,this.consecutiveRemovalFailures=0,this.itemIdsSentSuccessfully={},this.flushOnlyOnInterval=c.flushOnlyOnInterval||!1,this._flushPromise=null};RequestBatcher.prototype.enqueue=function(r){return this.queue.enqueue(r,this.flushInterval)},RequestBatcher.prototype.start=function(){return this.stopped=!1,this.consecutiveRemovalFailures=0,this.flush()},RequestBatcher.prototype.stop=function(){this.stopped=!0,this.timeoutID&&(clearTimeout(this.timeoutID),this.timeoutID=null)},RequestBatcher.prototype.clear=function(){return this.queue.clear()},RequestBatcher.prototype.resetBatchSize=function(){this.batchSize=this.libConfig.batch_size},RequestBatcher.prototype.resetFlush=function(){this.scheduleFlush(this.libConfig.batch_flush_interval_ms)},RequestBatcher.prototype.scheduleFlush=function(r){this.flushInterval=r,this.stopped||(this.timeoutID=setTimeout(Y.bind(function(){this.stopped||(this._flushPromise=this.flush())},this),this.flushInterval))},RequestBatcher.prototype.sendRequestPromise=function(r,c){return new K(Y.bind(function(l){this.sendRequest(r,c,l)},this))},RequestBatcher.prototype.flush=function(r){if(this.requestInProgress)return $l.log(`Flush: Request already in progress`),K.resolve();this.requestInProgress=!0,r=r||{};var c=this.libConfig.batch_request_timeout_ms,l=new Date().getTime(),u=this.batchSize;return this.queue.fillBatch(u).then(Y.bind(function(p){var m=p.length===u,h=[],g={};if(Y.each(p,function(r){var c=r.payload;if(this.beforeSendHook&&!r.orphaned&&(c=this.beforeSendHook(c)),c){c.event&&c.properties&&(c.properties=Y.extend({},c.properties,{mp_sent_by_lib_version:hl.LIB_VERSION}));var l=!0,u=r.id;u?(this.itemIdsSentSuccessfully[u]||0)>5&&(this.reportError(`[dupe] item ID sent too many times, not sending`,{item:r,batchSize:p.length,timesSent:this.itemIdsSentSuccessfully[u]}),l=!1):this.reportError(`[dupe] found item with no ID`,{item:r}),l&&h.push(c)}g[r.id]=c},this),h.length<1)return this.requestInProgress=!1,this.resetFlush(),K.resolve();var v=Y.bind(function(){return this.queue.removeItemsByID(Y.map(p,function(r){return r.id})).then(Y.bind(function(r){return Y.each(p,Y.bind(function(r){var c=r.id;c?(this.itemIdsSentSuccessfully[c]=this.itemIdsSentSuccessfully[c]||0,this.itemIdsSentSuccessfully[c]++,this.itemIdsSentSuccessfully[c]>5&&this.reportError(`[dupe] item ID sent too many times`,{item:r,batchSize:p.length,timesSent:this.itemIdsSentSuccessfully[c]})):this.reportError(`[dupe] found item with no ID while removing`,{item:r})},this)),r?(this.consecutiveRemovalFailures=0,this.flushOnlyOnInterval&&!m?(this.resetFlush(),K.resolve()):this.flush()):(++this.consecutiveRemovalFailures>5?(this.reportError(`Too many queue failures; disabling batching system.`),this.stopAllBatching()):this.resetFlush(),K.resolve())},this))},this),y=Y.bind(function(m){this.requestInProgress=!1;try{if(r.unloading)return this.queue.updatePayloads(g);if(Y.isObject(m)&&m.error===`timeout`&&new Date().getTime()-l>=c)return this.reportError(`Network timeout; retrying`),this.flush();if(Y.isObject(m)&&(m.httpStatusCode>=500||m.httpStatusCode===429||m.httpStatusCode<=0&&!isOnline()||m.error===`timeout`)){var h=this.flushInterval*2;return m.retryAfter&&(h=parseInt(m.retryAfter,10)*1e3||h),h=Math.min(Ql,h),this.reportError(`Error; retry in `+h+` ms`),this.scheduleFlush(h),K.resolve()}else if(Y.isObject(m)&&m.httpStatusCode===413)if(p.length>1){var y=Math.max(1,Math.floor(u/2));return this.batchSize=Math.min(this.batchSize,y,p.length-1),this.reportError(`413 response; reducing batch size to `+this.batchSize),this.resetFlush(),K.resolve()}else return this.reportError(`Single-event request too large; dropping`,p),this.resetBatchSize(),v();else return v()}catch(r){this.reportError(`Error handling API response`,r),this.resetFlush()}},this),b={method:`POST`,verbose:!0,ignore_json_errors:!0,timeout_ms:c};return r.unloading&&(b.transport=`sendBeacon`),$l.log(`MIXPANEL REQUEST:`,h),this.sendRequestPromise(h,b).then(y)},this)).catch(Y.bind(function(r){this.reportError(`Error flushing request queue`,r),this.resetFlush()},this))},RequestBatcher.prototype.reportError=function(r,c){if($l.error.apply($l.error,arguments),this.errorReporter)try{c instanceof Error||(c=Error(r)),this.errorReporter(r,c)}catch(r){$l.error(r)}};var isRecordingExpired=function(r){var c=Date.now();return!r||c>r.maxExpires||c>r.idleExpires},eu=250,tu=console_with_prefix(`recorder`),nu=P.CompressionStream,ru={batch_size:1e3,batch_flush_interval_ms:10*1e3,batch_request_timeout_ms:90*1e3,batch_autostart:!0},iu=new Set([G.MouseMove,G.MouseInteraction,G.Scroll,G.ViewportResize,G.Input,G.TouchMove,G.MediaInteraction,G.Drag,G.Selection]);function isUserEvent(r){return r.type===W.IncrementalSnapshot&&iu.has(r.data.source)}var SessionRecording=function(r){this._mixpanel=r.mixpanelInstance,this._onIdleTimeout=r.onIdleTimeout||NOOP_FUNC,this._onMaxLengthReached=r.onMaxLengthReached||NOOP_FUNC,this._onBatchSent=r.onBatchSent||NOOP_FUNC,this._rrwebRecord=r.rrwebRecord||null,this._stopRecording=null,this.replayId=r.replayId,this.batchStartUrl=r.batchStartUrl||null,this.replayStartUrl=r.replayStartUrl||null,this.idleExpires=r.idleExpires||null,this.maxExpires=r.maxExpires||null,this.replayStartTime=r.replayStartTime||null,this.seqNo=r.seqNo||0,this.idleTimeoutId=null,this.maxTimeoutId=null,this.recordMaxMs=gl,this.recordMinMs=0;var c=localStorageSupported(r.sharedLockStorage,!0)&&!this.getConfig(`disable_persistence`);this.batcherKey=`__mprec_`+this.getConfig(`name`)+`_`+this.getConfig(`token`)+`_`+this.replayId,this.queueStorage=new IDBStorageWrapper(Gl),this.batcher=new RequestBatcher(this.batcherKey,{errorReporter:this.reportError.bind(this),flushOnlyOnInterval:!0,libConfig:ru,sendRequestFunc:this.flushEventsWithOptOut.bind(this),queueStorage:this.queueStorage,sharedLockStorage:r.sharedLockStorage,usePersistence:c,stopAllBatchingFunc:this.stopRecording.bind(this),enqueueThrottleMs:eu,sharedLockTimeoutMS:10*1e3})};SessionRecording.prototype.getUserIdInfo=function(){if(this.finalFlushUserIdInfo)return this.finalFlushUserIdInfo;var r={distinct_id:String(this._mixpanel.get_distinct_id())},c=this._mixpanel.get_property(`$device_id`);c&&(r.$device_id=c);var l=this._mixpanel.get_property(`$user_id`);return l&&(r.$user_id=l),r},SessionRecording.prototype.unloadPersistedData=function(){return this.batcher.stop(),this.batcher.flush().then(function(){return this.queueStorage.removeItem(this.batcherKey)}.bind(this))},SessionRecording.prototype.getConfig=function(r){return this._mixpanel.get_config(r)},SessionRecording.prototype.get_config=function(r){return this.getConfig(r)},SessionRecording.prototype.startRecording=function(r){if(this._rrwebRecord===null){this.reportError(`rrweb record function not provided. `);return}if(this._stopRecording!==null){tu.log(`Recording already in progress, skipping startRecording.`);return}this.recordMaxMs=this.getConfig(`record_max_ms`),this.recordMaxMs>gl&&(this.recordMaxMs=gl,tu.critical(`record_max_ms cannot be greater than `+gl+`ms. Capping value.`)),this.maxExpires||(this.maxExpires=new Date().getTime()+this.recordMaxMs),this.recordMinMs=this.getConfig(`record_min_ms`),this.recordMinMs>_l&&(this.recordMinMs=_l,tu.critical(`record_min_ms cannot be greater than `+_l+`ms. Capping value.`)),this.replayStartTime||(this.replayStartTime=new Date().getTime(),this.batchStartUrl=Y.info.currentUrl(),this.replayStartUrl=Y.info.currentUrl()),r||this.recordMinMs>0?this.batcher.stop():this.batcher.start();var c=function(){clearTimeout(this.idleTimeoutId);var r=this.getConfig(`record_idle_timeout_ms`);this.idleTimeoutId=setTimeout(this._onIdleTimeout,r),this.idleExpires=new Date().getTime()+r}.bind(this);c();var l=this.getConfig(`record_block_selector`);(l===``||l===null)&&(l=void 0);try{this._stopRecording=this._rrwebRecord({emit:function(r){if(this.idleExpires&&this.idleExpires<r.timestamp){this._onIdleTimeout();return}isUserEvent(r)&&(this.batcher.stopped&&new Date().getTime()-this.replayStartTime>=this.recordMinMs&&this.batcher.start(),c()),this.__enqueuePromise=this.batcher.enqueue(r)}.bind(this),blockClass:this.getConfig(`record_block_class`),blockSelector:l,collectFonts:this.getConfig(`record_collect_fonts`),dataURLOptions:{type:`image/webp`,quality:.6},maskAllInputs:!0,maskTextClass:this.getConfig(`record_mask_text_class`),maskTextSelector:this.getConfig(`record_mask_text_selector`),recordCanvas:this.getConfig(`record_canvas`),sampling:{canvas:15}})}catch(r){this.reportError(`Unexpected error when starting rrweb recording.`,r)}if(typeof this._stopRecording!=`function`){this.reportError(`rrweb failed to start, skipping this recording.`),this._stopRecording=null,this.stopRecording();return}var u=this.maxExpires-new Date().getTime();this.maxTimeoutId=setTimeout(this._onMaxLengthReached.bind(this),u)},SessionRecording.prototype.stopRecording=function(r){if(this.finalFlushUserIdInfo=this.getUserIdInfo(),!this.isRrwebStopped()){try{this._stopRecording()}catch(r){this.reportError(`Error with rrweb stopRecording`,r)}this._stopRecording=null}var c;return this.batcher.stopped?c=this.batcher.clear():r||(c=this.batcher.flush()),this.batcher.stop(),clearTimeout(this.idleTimeoutId),clearTimeout(this.maxTimeoutId),c},SessionRecording.prototype.isRrwebStopped=function(){return this._stopRecording===null},SessionRecording.prototype.flushEventsWithOptOut=function(r,c,l){var u=function(r){r===0&&(this.stopRecording(),l({error:`Tracking has been opted out, stopping recording.`}))}.bind(this);this._flushEvents(r,c,l,u)},SessionRecording.prototype.serialize=function(){var r;try{r=this._mixpanel.get_tab_id()}catch(c){this.reportError(`Error getting tab ID for serialization `,c),r=null}return{replayId:this.replayId,seqNo:this.seqNo,replayStartTime:this.replayStartTime,batchStartUrl:this.batchStartUrl,replayStartUrl:this.replayStartUrl,idleExpires:this.idleExpires,maxExpires:this.maxExpires,tabId:r}},SessionRecording.deserialize=function(r,c){return new SessionRecording(Y.extend({},c,{replayId:r.replayId,batchStartUrl:r.batchStartUrl,replayStartUrl:r.replayStartUrl,idleExpires:r.idleExpires,maxExpires:r.maxExpires,replayStartTime:r.replayStartTime,seqNo:r.seqNo,sharedLockStorage:c.sharedLockStorage}))},SessionRecording.prototype._sendRequest=function(r,c,l,u){var p=function(c,l){c.status===200&&this.replayId===r&&(this.seqNo++,this.batchStartUrl=Y.info.currentUrl()),this._onBatchSent(),u({status:0,httpStatusCode:c.status,responseBody:l,retryAfter:c.headers.get(`Retry-After`)})}.bind(this),m=this._mixpanel.get_api_host&&this._mixpanel.get_api_host(`record`)||this.getConfig(`api_host`);P.fetch(m+`/`+this.getConfig(`api_routes`).record+`?`+new URLSearchParams(c),{method:`POST`,headers:{Authorization:`Basic `+btoa(this.getConfig(`token`)+`:`),"Content-Type":`application/octet-stream`},body:l}).then(function(r){r.json().then(function(c){p(r,c)}).catch(function(r){u({error:r})})}).catch(function(r){u({error:r,httpStatusCode:0})})},SessionRecording.prototype._flushEvents=addOptOutCheckMixpanelLib(function(r,c,l){var u=r.length;if(u>0){for(var p=this.replayId,m=1/0,h=-1/0,g=!1,v=0;v<u;v++)m=Math.min(m,r[v].timestamp),h=Math.max(h,r[v].timestamp),r[v].type===W.FullSnapshot&&(g=!0);if(this.seqNo===0){if(!g){l({error:`First batch does not contain a full snapshot. Aborting recording.`}),this.stopRecording(!0);return}this.replayStartTime=m}else this.replayStartTime||(this.reportError(`Replay start time not set but seqNo is not 0. Using current batch start time as a fallback.`),this.replayStartTime=m);var y=h-this.replayStartTime,b={$current_url:this.batchStartUrl,$lib_version:hl.LIB_VERSION,batch_start_time:m/1e3,mp_lib:`web`,replay_id:p,replay_length_ms:y,replay_start_time:this.replayStartTime/1e3,replay_start_url:this.replayStartUrl,seq:this.seqNo},x=JSON.stringify(r);if(Object.assign(b,this.getUserIdInfo()),nu){var S=new Blob([x],{type:`application/json`}).stream().pipeThrough(new nu(`gzip`));new Response(S).blob().then(function(r){b.format=`gzip`,this._sendRequest(p,b,r,l)}.bind(this))}else b.format=`body`,this._sendRequest(p,b,x,l)}}),SessionRecording.prototype.reportError=function(r,c){tu.error.apply(tu.error,arguments);try{!c&&!(r instanceof Error)&&(r=Error(r)),this.getConfig(`error_reporter`)(r,c)}catch(r){tu.error(r)}};var RecordingRegistry=function(r){this.idb=new IDBStorageWrapper(Kl),this.errorReporter=r.errorReporter,this.mixpanelInstance=r.mixpanelInstance,this.sharedLockStorage=r.sharedLockStorage};RecordingRegistry.prototype.isPersistenceEnabled=function(){return!this.mixpanelInstance.get_config(`disable_persistence`)},RecordingRegistry.prototype.handleError=function(r){this.errorReporter(`IndexedDB error: `,r)},RecordingRegistry.prototype.setActiveRecording=function(r){if(!this.isPersistenceEnabled())return K.resolve();var c=r.tabId;return c?this.idb.init().then(function(){return this.idb.setItem(c,r)}.bind(this)).catch(this.handleError.bind(this)):(console.warn(`No tab ID is set, cannot persist recording metadata.`),K.resolve())},RecordingRegistry.prototype.getActiveRecording=function(){return this.isPersistenceEnabled()?this.idb.init().then(function(){return this.idb.getItem(this.mixpanelInstance.get_tab_id())}.bind(this)).then(function(r){return isRecordingExpired(r)?null:r}.bind(this)).catch(this.handleError.bind(this)):K.resolve(null)},RecordingRegistry.prototype.clearActiveRecording=function(){return this.isPersistenceEnabled()?this.markActiveRecordingExpired():this.deleteActiveRecording()},RecordingRegistry.prototype.markActiveRecordingExpired=function(){return this.getActiveRecording().then(function(r){if(r)return r.maxExpires=0,this.setActiveRecording(r)}.bind(this)).catch(this.handleError.bind(this))},RecordingRegistry.prototype.deleteActiveRecording=function(){return this.idb.isInitialized()?this.idb.removeItem(this.mixpanelInstance.get_tab_id()).catch(this.handleError.bind(this)):K.resolve()},RecordingRegistry.prototype.flushInactiveRecordings=function(){return this.isPersistenceEnabled()?this.idb.init().then(function(){return this.idb.getAll()}.bind(this)).then(function(r){var c=r.filter(function(r){return isRecordingExpired(r)}).map(function(r){return SessionRecording.deserialize(r,{mixpanelInstance:this.mixpanelInstance,sharedLockStorage:this.sharedLockStorage}).unloadPersistedData().then(function(){return this.idb.removeItem(r.tabId)}.bind(this)).catch(this.handleError.bind(this))}.bind(this));return K.all(c)}.bind(this)).catch(this.handleError.bind(this)):K.resolve([])};var au=console_with_prefix(`recorder`),MixpanelRecorder=function(r,c,l){this.mixpanelInstance=r,this.rrwebRecord=c||record,this.sharedLockStorage=l,this.recordingRegistry=new RecordingRegistry({mixpanelInstance:this.mixpanelInstance,errorReporter:au.error,sharedLockStorage:l}),this._flushInactivePromise=this.recordingRegistry.flushInactiveRecordings(),this.activeRecording=null,this.stopRecordingInProgress=!1};MixpanelRecorder.prototype.startRecording=function(r){if(r=r||{},this.activeRecording&&!this.activeRecording.isRrwebStopped()){au.log(`Recording already in progress, skipping startRecording.`);return}var c=function(){au.log(`Idle timeout reached, restarting recording.`),this.resetRecording()}.bind(this),l=function(){au.log(`Max recording length reached, stopping recording.`),this.resetRecording()}.bind(this),u=function(){this.recordingRegistry.setActiveRecording(this.activeRecording.serialize()),this.__flushPromise=this.activeRecording.batcher._flushPromise}.bind(this),p={mixpanelInstance:this.mixpanelInstance,onBatchSent:u,onIdleTimeout:c,onMaxLengthReached:l,replayId:Y.UUID(),rrwebRecord:this.rrwebRecord,sharedLockStorage:this.sharedLockStorage};return r.activeSerializedRecording?this.activeRecording=SessionRecording.deserialize(r.activeSerializedRecording,p):this.activeRecording=new SessionRecording(p),this.activeRecording.startRecording(r.shouldStopBatcher),this.recordingRegistry.setActiveRecording(this.activeRecording.serialize())},MixpanelRecorder.prototype.stopRecording=function(){return this.stopRecordingInProgress=!0,this._stopCurrentRecording(!1,!0).then(function(){return this.recordingRegistry.clearActiveRecording()}.bind(this)).then(function(){this.stopRecordingInProgress=!1}.bind(this))},MixpanelRecorder.prototype.pauseRecording=function(){return this._stopCurrentRecording(!1)},MixpanelRecorder.prototype._stopCurrentRecording=function(r,c){if(this.activeRecording){var l=this.activeRecording.stopRecording(r);return c&&(this.activeRecording=null),l}return K.resolve()},MixpanelRecorder.prototype.resumeRecording=function(r){return this.activeRecording&&this.activeRecording.isRrwebStopped()?(this.activeRecording.startRecording(!1),K.resolve(null)):this.recordingRegistry.getActiveRecording().then(function(c){return c&&!this.stopRecordingInProgress?this.startRecording({activeSerializedRecording:c}):r?this.startRecording({shouldStopBatcher:!1}):(au.log(`No resumable recording found.`),null)}.bind(this))},MixpanelRecorder.prototype.resetRecording=function(){this.stopRecording(),this.startRecording({shouldStopBatcher:!0})},MixpanelRecorder.prototype.getActiveReplayId=function(){return this.activeRecording&&!this.activeRecording.isRrwebStopped()?this.activeRecording.replayId:null},Object.defineProperty(MixpanelRecorder.prototype,"replayId",{get:function(){return this.getActiveReplayId()}}),P.__mp_recorder=MixpanelRecorder;var ou=`change`,su=`click`,cu=`hashchange`,lu=`input`,uu=`load`,du=`mp_locationchange`,fu=`popstate`,pu=`scrollend`,mu=`scroll`,hu=`select`,gu=`submit`,_u=`toggle`,vu=`visibilitychange`,yu=[`clientX`,`clientY`,`offsetX`,`offsetY`,`pageX`,`pageY`,`screenX`,`screenY`,`x`,`y`],bu=[`mp-include`],xu=[`mp-no-track`],Su=xu.concat([`mp-sensitive`]),Cu=[`aria-label`,`aria-labelledby`,`aria-describedby`,`href`,`name`,`role`,`title`,`type`],wu={button:!0,checkbox:!0,combobox:!0,grid:!0,link:!0,listbox:!0,menu:!0,menubar:!0,menuitem:!0,menuitemcheckbox:!0,menuitemradio:!0,navigation:!0,option:!0,radio:!0,radiogroup:!0,searchbox:!0,slider:!0,spinbutton:!0,switch:!0,tab:!0,tablist:!0,textbox:!0,tree:!0,treegrid:!0,treeitem:!0},Tu={base:!0,head:!0,html:!0,link:!0,meta:!0,script:!0,style:!0,title:!0,br:!0,hr:!0,wbr:!0,noscript:!0,picture:!0,source:!0,template:!0,track:!0},Eu={article:!0,div:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,p:!0,section:!0,span:!0},Du=[`onclick`,`onmousedown`,`onmouseup`,`onpointerdown`,`onpointerup`,`ontouchend`,`ontouchstart`],Ou=5,Z=console_with_prefix(`autocapture`);function getClasses(r){for(var c={},l=getClassName(r).split(` `),u=0;u<l.length;u++){var p=l[u];p&&(c[p]=!0)}return c}function getClassName(r){switch(typeof r.className){case`string`:return r.className;case`object`:return r.className.baseVal||r.getAttribute(`class`)||``;default:return``}}function getPreviousElementSibling(r){if(r.previousElementSibling)return r.previousElementSibling;do r=r.previousSibling;while(r&&!isElementNode(r));return r}function getPropertiesFromElement(r,c,l,u,p,m){var h={$classes:getClassName(r).split(` `),$tag_name:r.tagName.toLowerCase()},g=r.id;g&&(h.$id=g),shouldTrackElementDetails(r,c,p,m)&&Y.each(Cu.concat(u),function(c){if(r.hasAttribute(c)&&!l[c]){var u=r.getAttribute(c);shouldTrackValue(u)&&(h[`$attr-`+c]=u)}});for(var v=1,y=1,b=r;b=getPreviousElementSibling(b);)v++,b.tagName===r.tagName&&y++;return h.$nth_child=v,h.$nth_of_type=y,h}function getPropsForDOMEvent(r,c){var l=c.allowElementCallback,u=c.allowSelectors||[],p=c.blockAttrs||[],m=c.blockElementCallback,h=c.blockSelectors||[],g=c.captureTextContent||!1,v=c.captureExtraAttrs||[],y=c.capturedForHeatMap||!1,b={};Y.each(p,function(r){b[r]=!0});var x=null,S=r.target===void 0?r.srcElement:r.target;if(isTextNode(S)&&(S=S.parentNode),shouldTrackDomEvent(S,r)&&isElementAllowed(S,r,l,u)&&!isElementBlocked(S,r,m,h)){for(var C=[S],w=S;w.parentNode&&!isTag(w,`body`);)C.push(w.parentNode),w=w.parentNode;var T=[],E,D=!1;if(Y.each(C,function(c){var p=shouldTrackElementDetails(c,r,l,u);!b.href&&c.tagName.toLowerCase()===`a`&&(E=c.getAttribute(`href`),E=p&&shouldTrackValue(E)&&E),isElementBlocked(c,r,m,h)&&(D=!0),T.push(getPropertiesFromElement(c,r,b,v,l,u))},this),!D){var O=J.documentElement;if(x={$event_type:r.type,$host:P.location.host,$pathname:P.location.pathname,$elements:T,$el_attr__href:E,$viewportHeight:Math.max(O.clientHeight,P.innerHeight||0),$viewportWidth:Math.max(O.clientWidth,P.innerWidth||0),$pageHeight:J.body.offsetHeight||0,$pageWidth:J.body.offsetWidth||0},Y.each(v,function(r){if(!b[r]&&S.hasAttribute(r)){var c=S.getAttribute(r);shouldTrackValue(c)&&(x[`$el_attr__`+r]=c)}}),g&&(k=getSafeText(S,r,l,u),k&&k.length&&(x.$el_text=k)),r.type===su&&(Y.each(yu,function(c){c in r&&(x[`$`+c]=r[c])}),y&&(x.$captured_for_heatmap=!0),S=guessRealClickTarget(r)),g){var k=getSafeText(S,r,l,u);k&&k.length&&(x.$el_text=k)}if(S){if(!isElementAllowed(S,r,l,u)||isElementBlocked(S,r,m,h))return null;var A=getPropertiesFromElement(S,r,b,v,l,u);x.$target=A,x.$el_classes=A.$classes,Y.extend(x,Y.strip_empty_properties({$el_id:A.$id,$el_tag_name:A.$tag_name}))}}}return x}function getSafeText(r,c,l,u){var p=``;return shouldTrackElementDetails(r,c,l,u)&&r.childNodes&&r.childNodes.length&&Y.each(r.childNodes,function(r){isTextNode(r)&&r.textContent&&(p+=Y.trim(r.textContent).split(/(\s+)/).filter(shouldTrackValue).join(``).replace(/[\r\n]/g,` `).replace(/[ ]+/g,` `).substring(0,255))}),Y.trim(p)}function guessRealClickTarget(r){for(var c=r.target,l=r.composedPath(),u=0;u<l.length;u++){var p=l[u];if(isTag(p,`a`)||isTag(p,`button`)||isTag(p,`input`)||isTag(p,`select`)||p.getAttribute&&p.getAttribute(`role`)===`button`){c=p;break}if(p===c)break}return c}function isElementAllowed(r,c,l,u){if(l)try{if(!l(r,c))return!1}catch(r){return Z.critical(`Error while checking element in allowElementCallback`,r),!1}if(!u.length)return!0;for(var p=0;p<u.length;p++){var m=u[p];try{if(r.matches(m))return!0}catch(r){Z.critical(`Error while checking selector: `+m,r)}}return!1}function isElementBlocked(r,c,l,u){var p;if(l)try{if(l(r,c))return!0}catch(r){return Z.critical(`Error while checking element in blockElementCallback`,r),!0}if(u&&u.length)for(p=0;p<u.length;p++){var m=u[p];try{if(r.matches(m))return!0}catch(r){Z.critical(`Error while checking selector: `+m,r)}}var h=getClasses(r);for(p=0;p<xu.length;p++)if(h[xu[p]])return!0;return!1}function isElementNode(r){return r&&r.nodeType===1}function isTag(r,c){return r&&r.tagName&&r.tagName.toLowerCase()===c.toLowerCase()}function isTextNode(r){return r&&r.nodeType===3}function minDOMApisSupported(){try{return!!J.createElement(`div`).matches}catch(r){return!1}}function weakSetSupported(){return typeof WeakSet<`u`}function shouldTrackDomEvent(r,c){if(!r||isTag(r,`html`)||!isElementNode(r))return!1;switch(r.tagName.toLowerCase()){case`form`:return c.type===gu;case`input`:return[`button`,`submit`].indexOf(r.getAttribute(`type`))===-1?c.type===ou:c.type===su;case`select`:case`textarea`:return c.type===ou;default:return c.type===su}}function shouldTrackElementDetails(r,c,l,u){var p;if(!isElementAllowed(r,c,l,u))return!1;for(var m=r;m.parentNode&&!isTag(m,`body`);m=m.parentNode){var h=getClasses(m);for(p=0;p<Su.length;p++)if(h[Su[p]])return!1}var g=getClasses(r);for(p=0;p<bu.length;p++)if(g[bu[p]])return!0;if(isTag(r,`input`)||isTag(r,`select`)||isTag(r,`textarea`)||r.getAttribute(`contenteditable`)===`true`)return!1;var v=r.type||``;if(typeof v==`string`)switch(v.toLowerCase()){case`hidden`:return!1;case`password`:return!1}var y=r.name||r.id||``;return!(typeof y==`string`&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(y.replace(/[^a-zA-Z0-9]/g,``)))}function shouldTrackValue(r){return!(r===null||Y.isUndefined(r)||typeof r==`string`&&(r=Y.trim(r),/^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$/.test((r||``).replace(/[- ]/g,``))||/(^\d{3}-?\d{2}-?\d{4}$)/.test(r)))}function getPolyfillScrollEndFunction(r){var c=`onscrollend`in P,l=safewrap(r),u=pu;if(!c){var p=null,m=100;l=safewrap(function(){clearTimeout(p),p=setTimeout(r,m)}),u=mu}return{listener:l,eventType:u}}function hasInlineEventHandlers(r){for(var c=0;c<Du.length;c++)if(r.hasAttribute(Du[c]))return!0;return!1}function hasInteractiveAriaRole(r){var c=r.getAttribute(`role`);return c?wu[c.trim().split(/\s+/)[0].toLowerCase()]:!1}function hasAnyInteractivityIndicators(r){var c=r.tagName.toLowerCase();return!!(c===`button`||c===`input`||c===`select`||c===`textarea`||c===`details`||c===`dialog`||r.isContentEditable||r.onclick||r.onmousedown||r.onmouseup||r.ontouchstart||r.ontouchend||hasInlineEventHandlers(r)||hasInteractiveAriaRole(r)||c===`a`&&r.hasAttribute(`href`)||r.hasAttribute(`tabindex`))}function isDefinitelyNonInteractive(r){if(!r||!r.tagName)return!0;var c=r.tagName.toLowerCase();if(Tu[c])return!0;if(hasAnyInteractivityIndicators(r))return!1;for(var l=r.parentElement,u=0;l&&u<Ou;){if(hasAnyInteractivityIndicators(l))return!1;if(l.getRootNode&&l.getRootNode()!==J){var p=l.getRootNode();if(p.host&&hasAnyInteractivityIndicators(p.host))return!1}l=l.parentElement,u++}return!!Eu[c]}var ku=30,Au=1e3,ju=4;function RageClickTracker(){this.clicks=[]}RageClickTracker.prototype.isRageClick=function(r,c,l){l=l||{};var u=l.threshold_px||ku,p=l.timeout_ms||Au,m=l.click_count||ju,h=Date.now(),g=this.clicks[this.clicks.length-1];if(g&&h-g.timestamp<p&&Math.sqrt(Math.pow(r-g.x,2)+Math.pow(c-g.y,2))<u){if(this.clicks.push({x:r,y:c,timestamp:h}),this.clicks.length>=m)return this.clicks=[],!0}else this.clicks=[{x:r,y:c,timestamp:h}];return!1};function ShadowDOMObserver(r,c){this.changeCallback=r||function(){},this.observerConfig=c,this.observedShadowRoots=null,this.shadowObservers=[]}ShadowDOMObserver.prototype.getEventTarget=function(r){if(this.observedShadowRoots){var c=this.getComposedPath(r);return c&&c.length?c[0]:r.target||r.srcElement}},ShadowDOMObserver.prototype.getComposedPath=function(r){return`composedPath`in r?r.composedPath():[]},ShadowDOMObserver.prototype.observeFromEvent=function(r){if(this.observedShadowRoots)for(var c=this.getComposedPath(r),l=0;l<c.length;l++){var u=c[l];u&&u.shadowRoot&&this.observeShadowRoot(u.shadowRoot)}},ShadowDOMObserver.prototype.observeShadowRoot=function(r){if(!(!this.observedShadowRoots||this.observedShadowRoots.has(r))){var c=this;try{this.observedShadowRoots.add(r);var l=new window.MutationObserver(function(){c.changeCallback()});l.observe(r,this.observerConfig),this.shadowObservers.push(l)}catch(r){Z.critical(`Error while observing shadow root`,r)}}},ShadowDOMObserver.prototype.start=function(){if(!this.observedShadowRoots){if(!weakSetSupported()){Z.critical(`Shadow DOM observation unavailable: WeakSet not supported`);return}this.observedShadowRoots=new WeakSet}},ShadowDOMObserver.prototype.stop=function(){if(this.observedShadowRoots){for(var r=0;r<this.shadowObservers.length;r++)try{this.shadowObservers[r].disconnect()}catch(r){Z.critical(`Error while disconnecting shadow DOM observer`,r)}this.shadowObservers=[],this.observedShadowRoots=null}};var Mu=500,Nu=[ou,lu,gu,hu,_u],Pu=[pu],Fu=[cu],Iu={characterData:!0,childList:!0,subtree:!0,attributes:!0,attributeFilter:[`style`,`class`,`hidden`,`checked`,`selected`,`value`,`display`,`visibility`]};function DeadClickTracker(r){this.eventListeners=[],this.mutationObserver=null,this.shadowDOMObserver=null,this.isTracking=!1,this.lastChangeEventTimestamp=0,this.pendingClicks=[],this.onDeadClickCallback=r,this.processingActive=!1,this.processingTimeout=null}DeadClickTracker.prototype.addClick=function(r){var c=this.shadowDOMObserver&&this.shadowDOMObserver.getEventTarget(r);return c||(c=r.target||r.srcElement),!c||isDefinitelyNonInteractive(c)?!1:(this.shadowDOMObserver&&this.shadowDOMObserver.observeFromEvent(r),this.pendingClicks.push({element:c,event:r,timestamp:Date.now()}),!0)},DeadClickTracker.prototype.trackClick=function(r,c){if(!this.isTracking)return!1;var l=this.addClick(r);return l&&this.triggerProcessing(c),l},DeadClickTracker.prototype.getDeadClicks=function(r){if(this.pendingClicks.length===0)return[];var c=r.timeout_ms,l=Date.now(),u=this.pendingClicks.slice();this.pendingClicks=[];for(var p=[],m=0;m<u.length;m++){var h=u[m];l-h.timestamp>=c?this.hasChangesAfter(h.timestamp)||p.push(h):this.pendingClicks.push(h)}return p},DeadClickTracker.prototype.hasChangesAfter=function(r){return this.lastChangeEventTimestamp>=r-100},DeadClickTracker.prototype.recordChangeEvent=function(){this.lastChangeEventTimestamp=Date.now()},DeadClickTracker.prototype.triggerProcessing=function(r){this.processingActive||(this.processingActive=!0,this.processRecursively(r))},DeadClickTracker.prototype.processRecursively=function(r){if(!this.isTracking||!this.onDeadClickCallback){this.processingActive=!1;return}var c=r.timeout_ms,l=this;this.processingTimeout=setTimeout(function(){if(l.processingActive){for(var c=l.getDeadClicks(r),u=0;u<c.length;u++)l.onDeadClickCallback(c[u].event);l.pendingClicks.length>0?l.processRecursively(r):l.processingActive=!1}},c)},DeadClickTracker.prototype.startTracking=function(){if(!this.isTracking){this.isTracking=!0;var r=this;Nu.forEach(function(c){var handler=function(){r.recordChangeEvent()};document.addEventListener(c,handler,{capture:!0,passive:!0}),r.eventListeners.push({target:document,event:c,handler,options:{capture:!0,passive:!0}})}),Fu.forEach(function(c){var handler=function(){r.recordChangeEvent()};window.addEventListener(c,handler),r.eventListeners.push({target:window,event:c,handler})}),Pu.forEach(function(c){var handler=function(){r.recordChangeEvent()};window.addEventListener(c,handler,{passive:!0}),r.eventListeners.push({target:window,event:c,handler,options:{passive:!0}})});var selectionHandler=function(){r.recordChangeEvent()};if(document.addEventListener(`selectionchange`,selectionHandler),r.eventListeners.push({target:document,event:`selectionchange`,handler:selectionHandler}),window.MutationObserver)try{this.mutationObserver=new window.MutationObserver(function(){r.recordChangeEvent()}),this.mutationObserver.observe(document.body||document.documentElement,Iu)}catch(r){Z.critical(`Error while setting up mutation observer`,r)}if(window.customElements)try{this.shadowDOMObserver=new ShadowDOMObserver(function(){r.recordChangeEvent()},Iu),this.shadowDOMObserver.start()}catch(r){Z.critical(`Error while setting up shadow DOM observer`,r),this.shadowDOMObserver=null}}},DeadClickTracker.prototype.stopTracking=function(){if(this.isTracking){this.isTracking=!1,this.pendingClicks=[],this.lastChangeEventTimestamp=0,this.processingActive=!1,this.processingTimeout&&(clearTimeout(this.processingTimeout),this.processingTimeout=null);for(var r=0;r<this.eventListeners.length;r++){var c=this.eventListeners[r];try{c.target.removeEventListener(c.event,c.handler,c.options)}catch(r){Z.critical(`Error while removing event listener`,r)}}if(this.eventListeners=[],this.mutationObserver){try{this.mutationObserver.disconnect()}catch(r){Z.critical(`Error while disconnecting mutation observer`,r)}this.mutationObserver=null}if(this.shadowDOMObserver){try{this.shadowDOMObserver.stop()}catch(r){Z.critical(`Error while stopping shadow DOM observer`,r)}this.shadowDOMObserver=null}}};var Lu=`autocapture`,Ru=`track_pageview`,zu=`full-url`,Bu=`url-with-path-and-query-string`,Vu=`url-with-path`,Hu=`allow_element_callback`,Uu=`allow_selectors`,Wu=`allow_url_regexes`,Gu=`block_attrs`,Ku=`block_element_callback`,qu=`block_selectors`,Ju=`block_url_regexes`,Yu=`capture_extra_attrs`,Xu=`capture_text_content`,Zu=`scroll_capture_all`,Qu=`scroll_depth_percent_checkpoints`,$u=`click`,ed=`dead_click`,td=`input`,nd=`pageview`,rd=`rage_click`,ad=`scroll`,od=`page_leave`,sd=`submit`,Q={};Q[Uu]=[],Q[Wu]=[],Q[Gu]=[],Q[Ku]=null,Q[qu]=[],Q[Ju]=[],Q[Yu]=[],Q[Xu]=!1,Q[Zu]=!1,Q[Qu]=[25,50,75,100],Q[$u]=!0,Q[ed]=!0,Q[td]=!0,Q[nd]=zu,Q[rd]=!0,Q[ad]=!0,Q[od]=!1,Q[sd]=!0;var cd={$mp_autocapture:!0},ld=`$mp_click`,ud=`$mp_dead_click`,dd=`$mp_input_change`,fd=`$mp_rage_click`,pd=`$mp_scroll`,md=`$mp_submit`,hd=`$mp_page_leave`,Autocapture=function(r){this.mp=r,this.maxScrollViewDepth=0,this.hasTrackedScrollSession=!1,this.previousScrollHeight=0};Autocapture.prototype.init=function(){if(!minDOMApisSupported()){Z.critical(`Autocapture unavailable: missing required DOM APIs`);return}this.initPageListeners(),this.initPageviewTracking(),this.initClickTracking(),this.initDeadClickTracking(),this.initInputTracking(),this.initScrollTracking(),this.initSubmitTracking(),this.initRageClickTracking(),this.initPageLeaveTracking()},Autocapture.prototype.getFullConfig=function(){var r=this.mp.get_config(Lu);return r?Y.isObject(r)?Y.extend({},Q,r):Q:{}},Autocapture.prototype.getConfig=function(r){return this.getFullConfig()[r]},Autocapture.prototype.currentUrlBlocked=function(){var r,c=Y.info.currentUrl(),l=this.getConfig(Wu)||[];if(l.length){var u=!1;for(r=0;r<l.length;r++){var p=l[r];try{if(c.match(p)){u=!0;break}}catch(r){return Z.critical(`Error while checking block URL regex: `+p,r),!0}}if(!u)return!0}var m=this.getConfig(Ju)||[];if(!m||!m.length)return!1;for(r=0;r<m.length;r++)try{if(c.match(m[r]))return!0}catch(c){return Z.critical(`Error while checking block URL regex: `+m[r],c),!0}return!1},Autocapture.prototype.pageviewTrackingConfig=function(){return this.mp.get_config(Lu)?this.getConfig(nd):this.mp.get_config(Ru)},Autocapture.prototype.trackDomEvent=function(r,c){if(!this.currentUrlBlocked()){var l=this.mp.is_recording_heatmap_data()&&(c===ld&&!this.getConfig($u)||c===fd&&!this._getClickTrackingConfig(rd)||c===ud&&!this._getClickTrackingConfig(ed)),u=getPropsForDOMEvent(r,{allowElementCallback:this.getConfig(Hu),allowSelectors:this.getConfig(Uu),blockAttrs:this.getConfig(Gu),blockElementCallback:this.getConfig(Ku),blockSelectors:this.getConfig(qu),captureExtraAttrs:this.getConfig(Yu),captureTextContent:this.getConfig(Xu),capturedForHeatMap:l});u&&(Y.extend(u,cd),this.mp.track(c,u))}},Autocapture.prototype.initPageListeners=function(){if(P.removeEventListener(fu,this.listenerPopstate),P.removeEventListener(cu,this.listenerHashchange),!(!this.pageviewTrackingConfig()&&!this.getConfig(od)&&!this.mp.get_config(`record_heatmap_data`))){this.listenerPopstate=function(){P.dispatchEvent(new Event(du))},this.listenerHashchange=function(){P.dispatchEvent(new Event(du))},P.addEventListener(fu,this.listenerPopstate),P.addEventListener(cu,this.listenerHashchange);var r=P.history.pushState;typeof r==`function`&&(P.history.pushState=function(c,l,u){r.call(P.history,c,l,u),P.dispatchEvent(new Event(du))});var c=P.history.replaceState;typeof c==`function`&&(P.history.replaceState=function(r,l,u){c.call(P.history,r,l,u),P.dispatchEvent(new Event(du))})}},Autocapture.prototype._getClickTrackingConfig=function(r){var c=this.getConfig(r);return c?c===!0?{}:typeof c==`object`?c:{}:null},Autocapture.prototype._trackPageLeave=function(r,c,l){if(!this.hasTrackedScrollSession&&!(!this.getConfig(od)&&!this.mp.is_recording_heatmap_data())){this.hasTrackedScrollSession=!0;var u=Math.max(J.documentElement.clientHeight,P.innerHeight||0),p=Math.round(Math.max(this.maxScrollViewDepth-u,0)/(l-u)*100),m=Math.round(u/l*100);l<=u&&(p=100,m=100);var h=Y.extend({$max_scroll_view_depth:this.maxScrollViewDepth,$max_scroll_percentage:p,$fold_line_percentage:m,$scroll_height:l,$event_type:r.type,$current_url:c||Y.info.currentUrl(),$viewportHeight:u,$viewportWidth:Math.max(J.documentElement.clientWidth,P.innerWidth||0),$captured_for_heatmap:this.mp.is_recording_heatmap_data()},cd);this.mp.track(hd,h,{transport:`sendBeacon`})}},Autocapture.prototype._initScrollDepthTracking=function(){if(P.removeEventListener(mu,this.listenerScrollDepth),P.removeEventListener(pu,this.listenerScrollDepth),this.mp.get_config(`record_heatmap_data`)){Z.log(`Initializing scroll depth tracking`),this.maxScrollViewDepth=Math.max(J.documentElement.clientHeight,P.innerHeight||0);var r=getPolyfillScrollEndFunction(function(){if(!this.currentUrlBlocked()){var r=Math.max(J.documentElement.clientHeight,P.innerHeight||0)+P.scrollY;r>this.maxScrollViewDepth&&(this.maxScrollViewDepth=r),this.previousScrollHeight=J.body.scrollHeight}}.bind(this));this.listenerScrollDepth=r.listener,P.addEventListener(r.eventType,this.listenerScrollDepth)}},Autocapture.prototype.initClickTracking=function(){P.removeEventListener(su,this.listenerClick),!(!this.getConfig($u)&&!this.mp.get_config(`record_heatmap_data`))&&(Z.log(`Initializing click tracking`),this.listenerClick=function(r){!this.getConfig($u)&&!this.mp.is_recording_heatmap_data()||this.trackDomEvent(r,ld)}.bind(this),P.addEventListener(su,this.listenerClick))},Autocapture.prototype.initDeadClickTracking=function(){if(!this._getClickTrackingConfig(ed)&&!this.mp.get_config(`record_heatmap_data`)){this.stopDeadClickTracking();return}Z.log(`Initializing dead click tracking`),this._deadClickTracker||(this._deadClickTracker=new DeadClickTracker(function(r){this.trackDomEvent(r,ud)}.bind(this)),this._deadClickTracker.startTracking()),this.listenerDeadClick||(this.listenerDeadClick=function(r){var c=this._getClickTrackingConfig(ed);if(!(!c&&!this.mp.is_recording_heatmap_data())&&!this.currentUrlBlocked()){var l=c||{};l.timeout_ms||(l.timeout_ms=Mu),this._deadClickTracker.trackClick(r,l)}}.bind(this),P.addEventListener(su,this.listenerDeadClick))},Autocapture.prototype.initInputTracking=function(){P.removeEventListener(ou,this.listenerChange),this.getConfig(td)&&(Z.log(`Initializing input tracking`),this.listenerChange=function(r){this.getConfig(td)&&this.trackDomEvent(r,dd)}.bind(this),P.addEventListener(ou,this.listenerChange))},Autocapture.prototype.initPageviewTracking=function(){if(P.removeEventListener(du,this.listenerLocationchange),this.pageviewTrackingConfig()){Z.log(`Initializing pageview tracking`);var r=``,c=!1;this.currentUrlBlocked()||(c=this.mp.track_pageview(cd)),c&&(r=Y.info.currentUrl()),this.listenerLocationchange=safewrap(function(){if(!this.currentUrlBlocked()){var c=Y.info.currentUrl(),l=!1,u=c.split(`#`)[0].split(`?`)[0]!==r.split(`#`)[0].split(`?`)[0],p=this.pageviewTrackingConfig();p===zu?l=c!==r:p===Bu?l=c.split(`#`)[0]!==r.split(`#`)[0]:p===Vu&&(l=u),l&&(this.mp.track_pageview(cd)&&(r=c),u&&(this.lastScrollCheckpoint=0,Z.log(`Path change: re-initializing scroll depth checkpoints`)))}}.bind(this)),P.addEventListener(du,this.listenerLocationchange)}},Autocapture.prototype.initRageClickTracking=function(){P.removeEventListener(su,this.listenerRageClick),!(!this._getClickTrackingConfig(rd)&&!this.mp.get_config(`record_heatmap_data`))&&(Z.log(`Initializing rage click tracking`),this._rageClickTracker||(this._rageClickTracker=new RageClickTracker),this.listenerRageClick=function(r){var c=this._getClickTrackingConfig(rd);!c&&!this.mp.is_recording_heatmap_data()||this.currentUrlBlocked()||this._rageClickTracker.isRageClick(r.pageX,r.pageY,c)&&this.trackDomEvent(r,fd)}.bind(this),P.addEventListener(su,this.listenerRageClick))},Autocapture.prototype.initScrollTracking=function(){if(P.removeEventListener(pu,this.listenerScroll),P.removeEventListener(mu,this.listenerScroll),this.getConfig(ad)){Z.log(`Initializing scroll tracking`),this.lastScrollCheckpoint=0;var r=getPolyfillScrollEndFunction(function(){if(this.getConfig(ad)&&!this.currentUrlBlocked()){var r=this.getConfig(Zu),c=(this.getConfig(Qu)||[]).slice().sort(function(r,c){return r-c}),l=P.scrollY,u=Y.extend({$scroll_top:l},cd);try{var p=J.body.scrollHeight,m=Math.round(l/(p-P.innerHeight)*100);if(u.$scroll_height=p,u.$scroll_percentage=m,m>this.lastScrollCheckpoint)for(var h=0;h<c.length;h++){var g=c[h];m>=g&&this.lastScrollCheckpoint<g&&(u.$scroll_checkpoint=g,this.lastScrollCheckpoint=g,r=!0)}}catch(r){Z.critical(`Error while calculating scroll percentage`,r)}r&&this.mp.track(pd,u)}}.bind(this));this.listenerScroll=r.listener,P.addEventListener(r.eventType,this.listenerScroll)}},Autocapture.prototype.initSubmitTracking=function(){P.removeEventListener(gu,this.listenerSubmit),this.getConfig(sd)&&(Z.log(`Initializing submit tracking`),this.listenerSubmit=function(r){this.getConfig(sd)&&this.trackDomEvent(r,md)}.bind(this),P.addEventListener(gu,this.listenerSubmit))},Autocapture.prototype.initPageLeaveTracking=function(){if(J.removeEventListener(vu,this.listenerPageLeaveVisibilitychange),P.removeEventListener(du,this.listenerPageLeaveLocationchange),P.removeEventListener(uu,this.listenerPageLoad),!(!this.getConfig(od)&&!this.mp.get_config(`record_heatmap_data`))){Z.log(`Initializing page visibility tracking.`),this._initScrollDepthTracking();var r=Y.info.currentUrl();this.listenerPageLoad=function(){this.previousScrollHeight=J.body.scrollHeight}.bind(this),P.addEventListener(uu,this.listenerPageLoad),this.listenerPageLeaveLocationchange=safewrap(function(c){if(!this.currentUrlBlocked()){var l=Y.info.currentUrl();l!==r&&(this._trackPageLeave(c,r,this.previousScrollHeight),r=l,this.maxScrollViewDepth=Math.max(J.documentElement.clientHeight,P.innerHeight||0),this.previousScrollHeight=J.body.scrollHeight,this.hasTrackedScrollSession=!1)}}.bind(this)),P.addEventListener(du,this.listenerPageLeaveLocationchange),this.listenerPageLeaveVisibilitychange=function(c){J.hidden&&this._trackPageLeave(c,r,this.previousScrollHeight)}.bind(this),J.addEventListener(vu,this.listenerPageLeaveVisibilitychange)}},Autocapture.prototype.stopDeadClickTracking=function(){this.listenerDeadClick&&(P.removeEventListener(su,this.listenerDeadClick),this.listenerDeadClick=null),this._deadClickTracker&&(this._deadClickTracker.stopTracking(),this._deadClickTracker=null)},safewrapClass(Autocapture);var gd=console_with_prefix(`flags`),_d=`flags`,vd=`context`,yd={};yd[vd]={};var FeatureFlagManager=function(r){this.fetch=P.fetch,this.getFullApiRoute=r.getFullApiRoute,this.getMpConfig=r.getConfigFunc,this.setMpConfig=r.setConfigFunc,this.getMpProperty=r.getPropertyFunc,this.track=r.trackingFunc};FeatureFlagManager.prototype.init=function(){if(!this.minApisSupported()){gd.critical(`Feature Flags unavailable: missing minimum required APIs`);return}this.flags=null,this.fetchFlags(),this.trackedFeatures=new Set},FeatureFlagManager.prototype.getFullConfig=function(){var r=this.getMpConfig(_d);return r?Y.isObject(r)?Y.extend({},yd,r):yd:{}},FeatureFlagManager.prototype.getConfig=function(r){return this.getFullConfig()[r]},FeatureFlagManager.prototype.isSystemEnabled=function(){return!!this.getMpConfig(_d)},FeatureFlagManager.prototype.updateContext=function(r,c){if(!this.isSystemEnabled())return gd.critical(`Feature Flags not enabled, cannot update context`),Promise.resolve();var l=this.getMpConfig(_d);Y.isObject(l)||(l={});var u=c&&c.replace?{}:this.getConfig(vd);return l[vd]=Y.extend({},u,r),this.setMpConfig(_d,l),this.fetchFlags()},FeatureFlagManager.prototype.areFlagsReady=function(){return this.isSystemEnabled()||gd.error(`Feature Flags not enabled`),!!this.flags},FeatureFlagManager.prototype.fetchFlags=function(){if(!this.isSystemEnabled())return Promise.resolve();var r=this.getMpProperty(`distinct_id`),c=this.getMpProperty(`$device_id`),l=generateTraceparent();gd.log(`Fetching flags for distinct ID: `+r);var u=Y.extend({distinct_id:r,device_id:c},this.getConfig(vd)),p=new URLSearchParams;p.set(`context`,JSON.stringify(u)),p.set(`token`,this.getMpConfig(`token`)),p.set(`mp_lib`,`web`),p.set(`$lib_version`,hl.LIB_VERSION);var m=this.getFullApiRoute()+`?`+p.toString();return this._fetchInProgressStartTime=Date.now(),this.fetchPromise=this.fetch.call(P,m,{method:`GET`,headers:{Authorization:`Basic `+btoa(this.getMpConfig(`token`)+`:`),traceparent:l}}).then(function(r){return this.markFetchComplete(),r.json().then(function(r){var c=r.flags;if(!c)throw Error(`No flags in API response`);var u=new Map;Y.each(c,function(r,c){u.set(c,{key:r.variant_key,value:r.variant_value,experiment_id:r.experiment_id,is_experiment_active:r.is_experiment_active,is_qa_tester:r.is_qa_tester})}),this.flags=u,this._traceparent=l}.bind(this)).catch(function(r){this.markFetchComplete(),gd.error(r)}.bind(this))}.bind(this)).catch(function(r){this.markFetchComplete(),gd.error(r)}.bind(this)),this.fetchPromise},FeatureFlagManager.prototype.markFetchComplete=function(){if(!this._fetchInProgressStartTime){gd.error(`Fetch in progress started time not set, cannot mark fetch complete`);return}this._fetchStartTime=this._fetchInProgressStartTime,this._fetchCompleteTime=Date.now(),this._fetchLatency=this._fetchCompleteTime-this._fetchStartTime,this._fetchInProgressStartTime=null},FeatureFlagManager.prototype.getVariant=function(r,c){return this.fetchPromise?this.fetchPromise.then(function(){return this.getVariantSync(r,c)}.bind(this)).catch(function(r){return gd.error(r),c}):new Promise(function(r){gd.critical(`Feature Flags not initialized`),r(c)})},FeatureFlagManager.prototype.getVariantSync=function(r,c){if(!this.areFlagsReady())return gd.log(`Flags not loaded yet`),c;var l=this.flags.get(r);return l?(this.trackFeatureCheck(r,l),l):(gd.log(`No flag found: "`+r+`"`),c)},FeatureFlagManager.prototype.getVariantValue=function(r,c){return this.getVariant(r,{value:c}).then(function(r){return r.value}).catch(function(r){return gd.error(r),c})},FeatureFlagManager.prototype.getFeatureData=function(r,c){return gd.critical(`mixpanel.flags.get_feature_data() is deprecated and will be removed in a future release. Use mixpanel.flags.get_variant_value() instead.`),this.getVariantValue(r,c)},FeatureFlagManager.prototype.getVariantValueSync=function(r,c){return this.getVariantSync(r,{value:c}).value},FeatureFlagManager.prototype.isEnabled=function(r,c){return this.getVariantValue(r).then(function(){return this.isEnabledSync(r,c)}.bind(this)).catch(function(r){return gd.error(r),c})},FeatureFlagManager.prototype.isEnabledSync=function(r,c){c=c||!1;var l=this.getVariantValueSync(r,c);return l!==!0&&l!==!1&&(gd.error(`Feature flag "`+r+`" value: `+l+` is not a boolean; returning fallback value: `+c),l=c),l},FeatureFlagManager.prototype.trackFeatureCheck=function(r,c){if(!this.trackedFeatures.has(r)){this.trackedFeatures.add(r);var l={"Experiment name":r,"Variant name":c.key,$experiment_type:`feature_flag`,"Variant fetch start time":new Date(this._fetchStartTime).toISOString(),"Variant fetch complete time":new Date(this._fetchCompleteTime).toISOString(),"Variant fetch latency (ms)":this._fetchLatency,"Variant fetch traceparent":this._traceparent};c.experiment_id!==`undefined`&&(l.$experiment_id=c.experiment_id),c.is_experiment_active!==`undefined`&&(l.$is_experiment_active=c.is_experiment_active),c.is_qa_tester!==`undefined`&&(l.$is_qa_tester=c.is_qa_tester),this.track(`$experiment_started`,l)}},FeatureFlagManager.prototype.minApisSupported=function(){return!!this.fetch&&typeof Promise<`u`&&typeof Map<`u`&&typeof Set<`u`},safewrapClass(FeatureFlagManager),FeatureFlagManager.prototype.are_flags_ready=FeatureFlagManager.prototype.areFlagsReady,FeatureFlagManager.prototype.get_variant=FeatureFlagManager.prototype.getVariant,FeatureFlagManager.prototype.get_variant_sync=FeatureFlagManager.prototype.getVariantSync,FeatureFlagManager.prototype.get_variant_value=FeatureFlagManager.prototype.getVariantValue,FeatureFlagManager.prototype.get_variant_value_sync=FeatureFlagManager.prototype.getVariantValueSync,FeatureFlagManager.prototype.is_enabled=FeatureFlagManager.prototype.isEnabled,FeatureFlagManager.prototype.is_enabled_sync=FeatureFlagManager.prototype.isEnabledSync,FeatureFlagManager.prototype.update_context=FeatureFlagManager.prototype.updateContext,FeatureFlagManager.prototype.get_feature_data=FeatureFlagManager.prototype.getFeatureData;var DomTracker=function(){};DomTracker.prototype.create_properties=function(){},DomTracker.prototype.event_handler=function(){},DomTracker.prototype.after_track_handler=function(){},DomTracker.prototype.init=function(r){return this.mp=r,this},DomTracker.prototype.track=function(r,c,l,u){var p=this,m=Y.dom_query(r);if(m.length===0){X.error(`The DOM query (`+r+`) returned 0 elements`);return}return Y.each(m,function(r){Y.register_event(r,this.override_event,function(r){var m={},h=p.create_properties(l,this),g=p.mp.get_config(`track_links_timeout`);p.event_handler(r,this,m),window.setTimeout(p.track_callback(u,h,m,!0),g),p.mp.track(c,h,p.track_callback(u,h,m))})},this),!0},DomTracker.prototype.track_callback=function(r,c,l,u){u=u||!1;var p=this;return function(){l.callback_fired||(l.callback_fired=!0,!(r&&r(u,c)===!1)&&p.after_track_handler(c,l,u))}},DomTracker.prototype.create_properties=function(r,c){return typeof r==`function`?r(c):Y.extend({},r)};var LinkTracker=function(){this.override_event=`click`};Y.inherit(LinkTracker,DomTracker),LinkTracker.prototype.create_properties=function(r,c){var l=LinkTracker.superclass.create_properties.apply(this,arguments);return c.href&&(l.url=c.href),l},LinkTracker.prototype.event_handler=function(r,c,l){l.new_tab=r.which===2||r.metaKey||r.ctrlKey||c.target===`_blank`,l.href=c.href,l.new_tab||r.preventDefault()},LinkTracker.prototype.after_track_handler=function(r,c){c.new_tab||setTimeout(function(){window.location=c.href},0)};var FormTracker=function(){this.override_event=`submit`};Y.inherit(FormTracker,DomTracker),FormTracker.prototype.event_handler=function(r,c,l){l.element=c,r.preventDefault()},FormTracker.prototype.after_track_handler=function(r,c){setTimeout(function(){c.element.submit()},0)};var bd=`$set`,xd=`$set_once`,Sd=`$unset`,Cd=`$add`,wd=`$append`,Td=`$union`,Ed=`$remove`,Dd=`$delete`,Od={set_action:function(r,c){var l={},u={};return Y.isObject(r)?Y.each(r,function(r,c){this._is_reserved_property(c)||(u[c]=r)},this):u[r]=c,l[bd]=u,l},unset_action:function(r){var c={},l=[];return Y.isArray(r)||(r=[r]),Y.each(r,function(r){this._is_reserved_property(r)||l.push(r)},this),c[Sd]=l,c},set_once_action:function(r,c){var l={},u={};return Y.isObject(r)?Y.each(r,function(r,c){this._is_reserved_property(c)||(u[c]=r)},this):u[r]=c,l[xd]=u,l},union_action:function(r,c){var l={},u={};return Y.isObject(r)?Y.each(r,function(r,c){this._is_reserved_property(c)||(u[c]=Y.isArray(r)?r:[r])},this):u[r]=Y.isArray(c)?c:[c],l[Td]=u,l},append_action:function(r,c){var l={},u={};return Y.isObject(r)?Y.each(r,function(r,c){this._is_reserved_property(c)||(u[c]=r)},this):u[r]=c,l[wd]=u,l},remove_action:function(r,c){var l={},u={};return Y.isObject(r)?Y.each(r,function(r,c){this._is_reserved_property(c)||(u[c]=r)},this):u[r]=c,l[Ed]=u,l},delete_action:function(){var r={};return r[Dd]=``,r}},MixpanelGroup=function(){};Y.extend(MixpanelGroup.prototype,Od),MixpanelGroup.prototype._init=function(r,c,l){this._mixpanel=r,this._group_key=c,this._group_id=l},MixpanelGroup.prototype.set=addOptOutCheckMixpanelGroup(function(r,c,l){var u=this.set_action(r,c);return Y.isObject(r)&&(l=c),this._send_request(u,l)}),MixpanelGroup.prototype.set_once=addOptOutCheckMixpanelGroup(function(r,c,l){var u=this.set_once_action(r,c);return Y.isObject(r)&&(l=c),this._send_request(u,l)}),MixpanelGroup.prototype.unset=addOptOutCheckMixpanelGroup(function(r,c){var l=this.unset_action(r);return this._send_request(l,c)}),MixpanelGroup.prototype.union=addOptOutCheckMixpanelGroup(function(r,c,l){Y.isObject(r)&&(l=c);var u=this.union_action(r,c);return this._send_request(u,l)}),MixpanelGroup.prototype.delete=addOptOutCheckMixpanelGroup(function(r){var c=this.delete_action();return this._send_request(c,r)}),MixpanelGroup.prototype.remove=addOptOutCheckMixpanelGroup(function(r,c,l){var u=this.remove_action(r,c);return this._send_request(u,l)}),MixpanelGroup.prototype._send_request=function(r,c){r.$group_key=this._group_key,r.$group_id=this._group_id,r.$token=this._get_config(`token`);var l=Y.encodeDates(r);return this._mixpanel._track_or_batch({type:`groups`,data:l,endpoint:this._mixpanel.get_api_host(`groups`)+`/`+this._get_config(`api_routes`).groups,batcher:this._mixpanel.request_batchers.groups},c)},MixpanelGroup.prototype._is_reserved_property=function(r){return r===`$group_key`||r===`$group_id`},MixpanelGroup.prototype._get_config=function(r){return this._mixpanel.get_config(r)},MixpanelGroup.prototype.toString=function(){return this._mixpanel.toString()+`.group.`+this._group_key+`.`+this._group_id},MixpanelGroup.prototype.remove=MixpanelGroup.prototype.remove,MixpanelGroup.prototype.set=MixpanelGroup.prototype.set,MixpanelGroup.prototype.set_once=MixpanelGroup.prototype.set_once,MixpanelGroup.prototype.union=MixpanelGroup.prototype.union,MixpanelGroup.prototype.unset=MixpanelGroup.prototype.unset,MixpanelGroup.prototype.toString=MixpanelGroup.prototype.toString;var MixpanelPeople=function(){};Y.extend(MixpanelPeople.prototype,Od),MixpanelPeople.prototype._init=function(r){this._mixpanel=r},MixpanelPeople.prototype.set=addOptOutCheckMixpanelPeople(function(r,c,l){var u=this.set_action(r,c);return Y.isObject(r)&&(l=c),this._get_config(`save_referrer`)&&this._mixpanel.persistence.update_referrer_info(document.referrer),u[bd]=Y.extend({},Y.info.people_properties(),u[bd]),this._send_request(u,l)}),MixpanelPeople.prototype.set_once=addOptOutCheckMixpanelPeople(function(r,c,l){var u=this.set_once_action(r,c);return Y.isObject(r)&&(l=c),this._send_request(u,l)}),MixpanelPeople.prototype.unset=addOptOutCheckMixpanelPeople(function(r,c){var l=this.unset_action(r);return this._send_request(l,c)}),MixpanelPeople.prototype.increment=addOptOutCheckMixpanelPeople(function(r,c,l){var u={},p={};return Y.isObject(r)?(Y.each(r,function(r,c){if(!this._is_reserved_property(c))if(isNaN(parseFloat(r))){X.error(`Invalid increment value passed to mixpanel.people.increment - must be a number`);return}else p[c]=r},this),l=c):(Y.isUndefined(c)&&(c=1),p[r]=c),u[Cd]=p,this._send_request(u,l)}),MixpanelPeople.prototype.append=addOptOutCheckMixpanelPeople(function(r,c,l){Y.isObject(r)&&(l=c);var u=this.append_action(r,c);return this._send_request(u,l)}),MixpanelPeople.prototype.remove=addOptOutCheckMixpanelPeople(function(r,c,l){Y.isObject(r)&&(l=c);var u=this.remove_action(r,c);return this._send_request(u,l)}),MixpanelPeople.prototype.union=addOptOutCheckMixpanelPeople(function(r,c,l){Y.isObject(r)&&(l=c);var u=this.union_action(r,c);return this._send_request(u,l)}),MixpanelPeople.prototype.track_charge=addOptOutCheckMixpanelPeople(function(){X.error(`mixpanel.people.track_charge() is deprecated and no longer has any effect.`)}),MixpanelPeople.prototype.clear_charges=function(r){return this.set(`$transactions`,[],r)},MixpanelPeople.prototype.delete_user=function(){if(!this._identify_called()){X.error(`mixpanel.people.delete_user() requires you to call identify() first`);return}var r={$delete:this._mixpanel.get_distinct_id()};return this._send_request(r)},MixpanelPeople.prototype.toString=function(){return this._mixpanel.toString()+`.people`},MixpanelPeople.prototype._send_request=function(r,c){r.$token=this._get_config(`token`),r.$distinct_id=this._mixpanel.get_distinct_id();var l=this._mixpanel.get_property(`$device_id`),u=this._mixpanel.get_property(`$user_id`),p=this._mixpanel.get_property(`$had_persisted_distinct_id`);l&&(r.$device_id=l),u&&(r.$user_id=u),p&&(r.$had_persisted_distinct_id=p);var m=Y.encodeDates(r);return this._identify_called()?this._mixpanel._track_or_batch({type:`people`,data:m,endpoint:this._mixpanel.get_api_host(`people`)+`/`+this._get_config(`api_routes`).engage,batcher:this._mixpanel.request_batchers.people},c):(this._enqueue(r),Y.isUndefined(c)||(this._get_config(`verbose`)?c({status:-1,error:null}):c(-1)),Y.truncate(m,255))},MixpanelPeople.prototype._get_config=function(r){return this._mixpanel.get_config(r)},MixpanelPeople.prototype._identify_called=function(){return this._mixpanel._flags.identify_called===!0},MixpanelPeople.prototype._enqueue=function(r){bd in r?this._mixpanel.persistence._add_to_people_queue(bd,r):xd in r?this._mixpanel.persistence._add_to_people_queue(xd,r):Sd in r?this._mixpanel.persistence._add_to_people_queue(Sd,r):Cd in r?this._mixpanel.persistence._add_to_people_queue(Cd,r):wd in r?this._mixpanel.persistence._add_to_people_queue(wd,r):Ed in r?this._mixpanel.persistence._add_to_people_queue(Ed,r):Td in r?this._mixpanel.persistence._add_to_people_queue(Td,r):X.error(`Invalid call to _enqueue():`,r)},MixpanelPeople.prototype._flush_one_queue=function(r,c,l,u){var p=this,m=Y.extend({},this._mixpanel.persistence.load_queue(r)),h=m;!Y.isUndefined(m)&&Y.isObject(m)&&!Y.isEmptyObject(m)&&(p._mixpanel.persistence._pop_from_people_queue(r,m),p._mixpanel.persistence.save(),u&&(h=u(m)),c.call(p,h,function(c,u){c===0&&p._mixpanel.persistence._add_to_people_queue(r,m),Y.isUndefined(l)||l(c,u)}))},MixpanelPeople.prototype._flush=function(r,c,l,u,p,m,h){var g=this;this._flush_one_queue(bd,this.set,r),this._flush_one_queue(xd,this.set_once,u),this._flush_one_queue(Sd,this.unset,m,function(r){return Y.keys(r)}),this._flush_one_queue(Cd,this.increment,c),this._flush_one_queue(Td,this.union,p);var v=this._mixpanel.persistence.load_queue(wd);if(!Y.isUndefined(v)&&Y.isArray(v)&&v.length)for(var y,append_callback=function(r,c){r===0&&g._mixpanel.persistence._add_to_people_queue(wd,y),Y.isUndefined(l)||l(r,c)},b=v.length-1;b>=0;b--)v=this._mixpanel.persistence.load_queue(wd),y=v.pop(),g._mixpanel.persistence.save(),Y.isEmptyObject(y)||g.append(y,append_callback);var x=this._mixpanel.persistence.load_queue(Ed);if(!Y.isUndefined(x)&&Y.isArray(x)&&x.length)for(var S,remove_callback=function(r,c){r===0&&g._mixpanel.persistence._add_to_people_queue(Ed,S),Y.isUndefined(h)||h(r,c)},C=x.length-1;C>=0;C--)x=this._mixpanel.persistence.load_queue(Ed),S=x.pop(),g._mixpanel.persistence.save(),Y.isEmptyObject(S)||g.remove(S,remove_callback)},MixpanelPeople.prototype._is_reserved_property=function(r){return r===`$distinct_id`||r===`$token`||r===`$device_id`||r===`$user_id`||r===`$had_persisted_distinct_id`},MixpanelPeople.prototype.set=MixpanelPeople.prototype.set,MixpanelPeople.prototype.set_once=MixpanelPeople.prototype.set_once,MixpanelPeople.prototype.unset=MixpanelPeople.prototype.unset,MixpanelPeople.prototype.increment=MixpanelPeople.prototype.increment,MixpanelPeople.prototype.append=MixpanelPeople.prototype.append,MixpanelPeople.prototype.remove=MixpanelPeople.prototype.remove,MixpanelPeople.prototype.union=MixpanelPeople.prototype.union,MixpanelPeople.prototype.track_charge=MixpanelPeople.prototype.track_charge,MixpanelPeople.prototype.clear_charges=MixpanelPeople.prototype.clear_charges,MixpanelPeople.prototype.delete_user=MixpanelPeople.prototype.delete_user,MixpanelPeople.prototype.toString=MixpanelPeople.prototype.toString;var kd=`__mps`,Ad=`__mpso`,jd=`__mpus`,Md=`__mpa`,Nd=`__mpap`,Pd=`__mpr`,Fd=`__mpu`,Id=`$people_distinct_id`,Ld=`__alias`,Rd=`__timers`,zd=[kd,Ad,jd,Md,Nd,Pd,Fd,Id,Ld,Rd],MixpanelPersistence=function(r){this.props={},this.campaign_params_saved=!1,r.persistence_name?this.name=`mp_`+r.persistence_name:this.name=`mp_`+r.token+`_mixpanel`;var c=r.persistence;c!==`cookie`&&c!==`localStorage`&&(X.critical(`Unknown persistence type `+c+`; falling back to cookie`),c=r.persistence=`cookie`),c===`localStorage`&&Y.localStorage.is_supported()?this.storage=Y.localStorage:this.storage=Y.cookie,this.load(),this.update_config(r),this.upgrade(),this.save()};MixpanelPersistence.prototype.properties=function(){var r={};return this.load(),Y.each(this.props,function(c,l){Y.include(zd,l)||(r[l]=c)}),r},MixpanelPersistence.prototype.load=function(){if(!this.disabled){var r=this.storage.parse(this.name);r&&(this.props=Y.extend({},r))}},MixpanelPersistence.prototype.upgrade=function(){var r,c;this.storage===Y.localStorage?(r=Y.cookie.parse(this.name),Y.cookie.remove(this.name),Y.cookie.remove(this.name,!0),r&&this.register_once(r)):this.storage===Y.cookie&&(c=Y.localStorage.parse(this.name),Y.localStorage.remove(this.name),c&&this.register_once(c))},MixpanelPersistence.prototype.save=function(){this.disabled||this.storage.set(this.name,Hl(this.props),this.expire_days,this.cross_subdomain,this.secure,this.cross_site,this.cookie_domain)},MixpanelPersistence.prototype.load_prop=function(r){return this.load(),this.props[r]},MixpanelPersistence.prototype.remove=function(){this.storage.remove(this.name,!1,this.cookie_domain),this.storage.remove(this.name,!0,this.cookie_domain)},MixpanelPersistence.prototype.clear=function(){this.remove(),this.props={}},MixpanelPersistence.prototype.register_once=function(r,c,l){return Y.isObject(r)?(c===void 0&&(c=`None`),this.expire_days=l===void 0?this.default_expiry:l,this.load(),Y.each(r,function(r,l){(!this.props.hasOwnProperty(l)||this.props[l]===c)&&(this.props[l]=r)},this),this.save(),!0):!1},MixpanelPersistence.prototype.register=function(r,c){return Y.isObject(r)?(this.expire_days=c===void 0?this.default_expiry:c,this.load(),Y.extend(this.props,r),this.save(),!0):!1},MixpanelPersistence.prototype.unregister=function(r){this.load(),r in this.props&&(delete this.props[r],this.save())},MixpanelPersistence.prototype.update_search_keyword=function(r){this.register(Y.info.searchInfo(r))},MixpanelPersistence.prototype.update_referrer_info=function(r){this.register_once({$initial_referrer:r||`$direct`,$initial_referring_domain:Y.info.referringDomain(r)||`$direct`},``)},MixpanelPersistence.prototype.get_referrer_info=function(){return Y.strip_empty_properties({$initial_referrer:this.props.$initial_referrer,$initial_referring_domain:this.props.$initial_referring_domain})},MixpanelPersistence.prototype.update_config=function(r){this.default_expiry=this.expire_days=r.cookie_expiration,this.set_disabled(r.disable_persistence),this.set_cookie_domain(r.cookie_domain),this.set_cross_site(r.cross_site_cookie),this.set_cross_subdomain(r.cross_subdomain_cookie),this.set_secure(r.secure_cookie)},MixpanelPersistence.prototype.set_disabled=function(r){this.disabled=r,this.disabled?this.remove():this.save()},MixpanelPersistence.prototype.set_cookie_domain=function(r){r!==this.cookie_domain&&(this.remove(),this.cookie_domain=r,this.save())},MixpanelPersistence.prototype.set_cross_site=function(r){r!==this.cross_site&&(this.cross_site=r,this.remove(),this.save())},MixpanelPersistence.prototype.set_cross_subdomain=function(r){r!==this.cross_subdomain&&(this.cross_subdomain=r,this.remove(),this.save())},MixpanelPersistence.prototype.get_cross_subdomain=function(){return this.cross_subdomain},MixpanelPersistence.prototype.set_secure=function(r){r!==this.secure&&(this.secure=!!r,this.remove(),this.save())},MixpanelPersistence.prototype._add_to_people_queue=function(r,c){var l=this._get_queue_key(r),u=c[r],p=this._get_or_create_queue(bd),m=this._get_or_create_queue(xd),h=this._get_or_create_queue(Sd),g=this._get_or_create_queue(Cd),v=this._get_or_create_queue(Td),y=this._get_or_create_queue(Ed,[]),b=this._get_or_create_queue(wd,[]);l===kd?(Y.extend(p,u),this._pop_from_people_queue(Cd,u),this._pop_from_people_queue(Td,u),this._pop_from_people_queue(Sd,u)):l===Ad?(Y.each(u,function(r,c){c in m||(m[c]=r)}),this._pop_from_people_queue(Sd,u)):l===jd?Y.each(u,function(r){Y.each([p,m,g,v],function(c){r in c&&delete c[r]}),Y.each(b,function(c){r in c&&delete c[r]}),h[r]=!0}):l===Md?(Y.each(u,function(r,c){c in p?p[c]+=r:(c in g||(g[c]=0),g[c]+=r)},this),this._pop_from_people_queue(Sd,u)):l===Fd?(Y.each(u,function(r,c){Y.isArray(r)&&(c in v||(v[c]=[]),Y.each(r,function(r){Y.include(v[c],r)||v[c].push(r)}))}),this._pop_from_people_queue(Sd,u)):l===Pd?(y.push(u),this._pop_from_people_queue(wd,u)):l===Nd&&(b.push(u),this._pop_from_people_queue(Sd,u)),X.log(`MIXPANEL PEOPLE REQUEST (QUEUED, PENDING IDENTIFY):`),X.log(c),this.save()},MixpanelPersistence.prototype._pop_from_people_queue=function(r,c){var l=this.props[this._get_queue_key(r)];Y.isUndefined(l)||Y.each(c,function(c,u){r===wd||r===Ed?Y.each(l,function(r){r[u]===c&&delete r[u]}):delete l[u]},this)},MixpanelPersistence.prototype.load_queue=function(r){return this.load_prop(this._get_queue_key(r))},MixpanelPersistence.prototype._get_queue_key=function(r){if(r===bd)return kd;if(r===xd)return Ad;if(r===Sd)return jd;if(r===Cd)return Md;if(r===wd)return Nd;if(r===Ed)return Pd;if(r===Td)return Fd;X.error(`Invalid queue:`,r)},MixpanelPersistence.prototype._get_or_create_queue=function(r,c){var l=this._get_queue_key(r);return c=Y.isUndefined(c)?{}:c,this.props[l]||(this.props[l]=c)},MixpanelPersistence.prototype.set_event_timer=function(r,c){var l=this.load_prop(Rd)||{};l[r]=c,this.props[Rd]=l,this.save()},MixpanelPersistence.prototype.remove_event_timer=function(r){var c=(this.load_prop(Rd)||{})[r];return Y.isUndefined(c)||(delete this.props[Rd][r],this.save()),c};var Bd,load_extra_bundle=function(r,c){throw Error(r+` not available in this build.`)},Vd,Hd=0,Ud=1,IDENTITY_FUNC=function(r){return r},Wd=`mixpanel`,Gd=`base64`,Kd=`json`,qd=`$device:`,Jd=P.XMLHttpRequest&&`withCredentials`in new XMLHttpRequest,Yd=!Jd&&Dl.indexOf(`MSIE`)===-1&&Dl.indexOf(`Mozilla`)===-1,sendBeacon=null;wl.sendBeacon&&(sendBeacon=function(){return wl.sendBeacon.apply(wl,arguments)});var Xd={track:`track/`,engage:`engage/`,groups:`groups/`,record:`record/`,flags:`flags/`},Zd={api_host:`https://api-js.mixpanel.com`,api_hosts:{},api_routes:Xd,api_extra_query_params:{},api_method:`POST`,api_transport:`XHR`,api_payload_format:Gd,app_host:`https://mixpanel.com`,autocapture:!1,cdn:`https://cdn.mxpnl.com`,cross_site_cookie:!1,cross_subdomain_cookie:!0,error_reporter:NOOP_FUNC,flags:!1,persistence:`cookie`,persistence_name:``,cookie_domain:``,cookie_name:``,loaded:NOOP_FUNC,mp_loader:null,track_marketing:!0,track_pageview:!1,skip_first_touch_marketing:!1,store_google:!0,stop_utm_persistence:!1,save_referrer:!0,test:!1,verbose:!1,img:!1,debug:!1,track_links_timeout:300,cookie_expiration:365,upgrade:!1,disable_persistence:!1,disable_cookie:!1,secure_cookie:!1,ip:!0,opt_out_tracking_by_default:!1,opt_out_persistence_by_default:!1,opt_out_tracking_persistence_type:`localStorage`,opt_out_tracking_cookie_prefix:null,property_blacklist:[],xhr_headers:{},ignore_dnt:!1,batch_requests:!0,batch_size:50,batch_flush_interval_ms:5e3,batch_request_timeout_ms:9e4,batch_autostart:!0,hooks:{},record_block_class:RegExp(`^(mp-block|fs-exclude|amp-block|rr-block|ph-no-capture)$`),record_block_selector:`img, video, audio`,record_canvas:!1,record_collect_fonts:!1,record_heatmap_data:!1,record_idle_timeout_ms:1800*1e3,record_mask_text_class:RegExp(`^(mp-mask|fs-mask|amp-mask|rr-mask|ph-mask)$`),record_mask_text_selector:`*`,record_max_ms:gl,record_min_ms:0,record_sessions_percent:0,recorder_src:`https://cdn.mxpnl.com/libs/mixpanel-recorder.min.js`},Qd=!1,MixpanelLib=function(){},create_mplib=function(r,c,l){var u,p=l===Wd?Vd:Vd[l];if(p&&Bd===Hd)u=p;else{if(p&&!Y.isArray(p)){X.error(`You have already initialized `+l);return}u=new MixpanelLib}if(u._cached_groups={},u._init(r,c,l),u.people=new MixpanelPeople,u.people._init(u),!u.get_config(`skip_first_touch_marketing`)){var m=Y.info.campaignParams(null),h={},g=!1;Y.each(m,function(r,c){h[`initial_`+c]=r,r&&(g=!0)}),g&&u.people.set_once(h)}return hl.DEBUG=hl.DEBUG||u.get_config(`debug`),!Y.isUndefined(p)&&Y.isArray(p)&&(u._execute_array.call(u.people,p.people),u._execute_array(p)),u};MixpanelLib.prototype.init=function(r,c,l){if(Y.isUndefined(l)){this.report_error(`You must name your new library: init(token, config, name)`);return}if(l===Wd){this.report_error(`You must initialize the main mixpanel object right after you include the Mixpanel js snippet`);return}var u=create_mplib(r,c,l);return Vd[l]=u,u._loaded(),u},MixpanelLib.prototype._init=function(r,c,l){c=c||{},this.__loaded=!0,this.config={};var u={};if(`api_payload_format`in c||(c.api_host||Zd.api_host).match(/\.mixpanel\.com/)&&(u.api_payload_format=Kd),this.set_config(Y.extend({},Zd,u,c,{name:l,token:r,callback_fn:(l===Wd?l:Wd+`.`+l)+`._jsc`})),this._jsc=NOOP_FUNC,this.__dom_loaded_queue=[],this.__request_queue=[],this.__disabled_events=[],this._flags={disable_all_events:!1,identify_called:!1},this.request_batchers={},this._batch_requests=this.get_config(`batch_requests`),this._batch_requests){if(!Y.localStorage.is_supported(!0)||!Jd)this._batch_requests=!1,X.log(`Turning off Mixpanel request-queueing; needs XHR and localStorage support`),Y.each(this.get_batcher_configs(),function(r){X.log(`Clearing batch queue `+r.queue_key),Y.localStorage.remove(r.queue_key)});else if(this.init_batchers(),sendBeacon&&P.addEventListener){var p=Y.bind(function(){this.request_batchers.events.stopped||this.request_batchers.events.flush({unloading:!0})},this);P.addEventListener(`pagehide`,function(r){r.persisted&&p()}),P.addEventListener(`visibilitychange`,function(){J.visibilityState===`hidden`&&p()})}}this.persistence=this.cookie=new MixpanelPersistence(this.config),this.unpersisted_superprops={},this._gdpr_init();var m=Y.UUID();this.get_distinct_id()||this.register_once({distinct_id:qd+m,$device_id:m},``),this.flags=new FeatureFlagManager({getFullApiRoute:Y.bind(function(){return this.get_api_host(`flags`)+`/`+this.get_config(`api_routes`).flags},this),getConfigFunc:Y.bind(this.get_config,this),setConfigFunc:Y.bind(this.set_config,this),getPropertyFunc:Y.bind(this.get_property,this),trackingFunc:Y.bind(this.track,this)}),this.flags.init(),this.flags=this.flags,this.autocapture=new Autocapture(this),this.autocapture.init(),this._init_tab_id(),this._check_and_start_session_recording()},MixpanelLib.prototype._init_tab_id=function(){if(this.get_config(`disable_persistence`))X.log(`Tab ID initialization skipped due to disable_persistence config`);else if(Y.sessionStorage.is_supported())try{var r=this.get_config(`name`)+`_`+this.get_config(`token`),c=`mp_tab_id_`+r,l=`mp_gen_new_tab_id_`+r;(Y.sessionStorage.get(l)||!Y.sessionStorage.get(c))&&Y.sessionStorage.set(c,`$tab-`+Y.UUID()),Y.sessionStorage.set(l,`1`),this.tab_id=Y.sessionStorage.get(c),P.addEventListener(`beforeunload`,function(){Y.sessionStorage.remove(l)})}catch(r){this.report_error(`Error initializing tab id`,r)}else this.report_error(`Session storage is not supported, cannot keep track of unique tab ID.`)},MixpanelLib.prototype.get_tab_id=function(){return this.tab_id||null},MixpanelLib.prototype._should_load_recorder=function(){if(this.get_config(`disable_persistence`))return X.log(`Load recorder check skipped due to disable_persistence config`),Promise.resolve(!1);var r=new IDBStorageWrapper(Kl),c=this.get_tab_id();return r.init().then(function(){return r.getAll()}).then(function(r){for(var l=0;l<r.length;l++)if(isRecordingExpired(r[l])||r[l].tabId===c)return!0;return!1}).catch(Y.bind(function(r){this.report_error(`Error checking recording registry`,r)},this))},MixpanelLib.prototype._check_and_start_session_recording=addOptOutCheckMixpanelLib(function(r){if(!P.MutationObserver){X.critical(`Browser does not support MutationObserver; skipping session recording`);return}var c=Y.bind(function(r){var c=Y.bind(function(){this._recorder=this._recorder||new P.__mp_recorder(this),this._recorder.resumeRecording(r)},this);Y.isUndefined(P.__mp_recorder)?load_extra_bundle(this.get_config(`recorder_src`),c):c()},this),l=this.get_config(`record_sessions_percent`)>0&&Math.random()*100<=this.get_config(`record_sessions_percent`);r||l?c(!0):this._should_load_recorder().then(function(r){r&&c(!1)})}),MixpanelLib.prototype.start_session_recording=function(){this._check_and_start_session_recording(!0)},MixpanelLib.prototype.stop_session_recording=function(){return this._recorder?this._recorder.stopRecording():Promise.resolve()},MixpanelLib.prototype.pause_session_recording=function(){return this._recorder?this._recorder.pauseRecording():Promise.resolve()},MixpanelLib.prototype.resume_session_recording=function(){return this._recorder?this._recorder.resumeRecording():Promise.resolve()},MixpanelLib.prototype.is_recording_heatmap_data=function(){return this._get_session_replay_id()&&this.get_config(`record_heatmap_data`)},MixpanelLib.prototype.get_session_recording_properties=function(){var r={},c=this._get_session_replay_id();return c&&(r.$mp_replay_id=c),r},MixpanelLib.prototype.get_session_replay_url=function(){var r=null,c=this._get_session_replay_id();return c&&(r=`https://mixpanel.com/projects/replay-redirect?`+Y.HTTPBuildQuery({replay_id:c,distinct_id:this.get_distinct_id(),token:this.get_config(`token`)})),r},MixpanelLib.prototype._get_session_replay_id=function(){var r=null;return this._recorder&&(r=this._recorder.replayId),r||null},MixpanelLib.prototype.__get_recorder=function(){return this._recorder},MixpanelLib.prototype._loaded=function(){if(this.get_config(`loaded`)(this),this._set_default_superprops(),this.people.set_once(this.persistence.get_referrer_info()),this.get_config(`store_google`)&&this.get_config(`stop_utm_persistence`)){var r=Y.info.campaignParams(null);Y.each(r,function(r,c){this.unregister(c)}.bind(this))}},MixpanelLib.prototype._set_default_superprops=function(){this.persistence.update_search_keyword(J.referrer),this.get_config(`store_google`)&&!this.get_config(`stop_utm_persistence`)&&this.register(Y.info.campaignParams()),this.get_config(`save_referrer`)&&this.persistence.update_referrer_info(J.referrer)},MixpanelLib.prototype._dom_loaded=function(){Y.each(this.__dom_loaded_queue,function(r){this._track_dom.apply(this,r)},this),this.has_opted_out_tracking()||Y.each(this.__request_queue,function(r){this._send_request.apply(this,r)},this),delete this.__dom_loaded_queue,delete this.__request_queue},MixpanelLib.prototype._track_dom=function(r,c){if(this.get_config(`img`))return this.report_error(`You can't use DOM tracking functions with img = true.`),!1;if(!Qd)return this.__dom_loaded_queue.push([r,c]),!1;var l=new r().init(this);return l.track.apply(l,c)},MixpanelLib.prototype._prepare_callback=function(r,c){if(Y.isUndefined(r))return null;if(Jd){var callback_function=function(l){r(l,c)};return callback_function}else{var l=this._jsc,u=``+Math.floor(Math.random()*1e8),p=this.get_config(`callback_fn`)+`[`+u+`]`;return l[u]=function(p){delete l[u],r(p,c)},p}},MixpanelLib.prototype._send_request=function(r,c,l,u){var p=!0;if(Yd)return this.__request_queue.push(arguments),p;var m={method:this.get_config(`api_method`),transport:this.get_config(`api_transport`),verbose:this.get_config(`verbose`)},h=null;!u&&(Y.isFunction(l)||typeof l==`string`)&&(u=l,l=null),l=Y.extend(m,l||{}),Jd||(l.method=`GET`);var g=l.method===`POST`,v=sendBeacon&&g&&l.transport.toLowerCase()===`sendbeacon`,y=l.verbose;c.verbose&&(y=!0),this.get_config(`test`)&&(c.test=1),y&&(c.verbose=1),this.get_config(`img`)&&(c.img=1),Jd||(u?c.callback=u:(y||this.get_config(`test`))&&(c.callback=`(function(){})`)),c.ip=+!!this.get_config(`ip`),c._=new Date().getTime().toString(),g&&(h=`data=`+encodeURIComponent(c.data),delete c.data),Y.extend(c,this.get_config(`api_extra_query_params`)),r+=`?`+Y.HTTPBuildQuery(c);var b=this;if(`img`in c){var x=J.createElement(`img`);x.src=r,J.body.appendChild(x)}else if(v){try{p=sendBeacon(r,h)}catch(r){b.report_error(r),p=!1}try{u&&u(+!!p)}catch(r){b.report_error(r)}}else if(Jd)try{var S=new XMLHttpRequest;S.open(l.method,r,!0);var C=this.get_config(`xhr_headers`);if(g&&(C[`Content-Type`]=`application/x-www-form-urlencoded`),Y.each(C,function(r,c){S.setRequestHeader(c,r)}),l.timeout_ms&&S.timeout!==void 0){S.timeout=l.timeout_ms;var w=new Date().getTime()}S.withCredentials=!0,S.onreadystatechange=function(){if(S.readyState===4)if(S.status===200){if(u)if(y){var r;try{r=Y.JSONDecode(S.responseText)}catch(c){if(b.report_error(c),l.ignore_json_errors)r=S.responseText;else return}u(r)}else u(Number(S.responseText))}else{var c=S.timeout&&!S.status&&new Date().getTime()-w>=S.timeout?`timeout`:`Bad HTTP status: `+S.status+` `+S.statusText;if(b.report_error(c),u)if(y){var p=S.responseHeaders||{};u({status:0,httpStatusCode:S.status,error:c,retryAfter:p[`Retry-After`]})}else u(0)}},S.send(h)}catch(r){b.report_error(r),p=!1}else{var T=J.createElement(`script`);T.type=`text/javascript`,T.async=!0,T.defer=!0,T.src=r;var E=J.getElementsByTagName(`script`)[0];E.parentNode.insertBefore(T,E)}return p},MixpanelLib.prototype._execute_array=function(r){var c,l=[],u=[],p=[];Y.each(r,function(r){r&&(c=r[0],Y.isArray(c)?p.push(r):typeof r==`function`?r.call(this):Y.isArray(r)&&c===`alias`?l.push(r):Y.isArray(r)&&c.indexOf(`track`)!==-1&&typeof this[c]==`function`?p.push(r):u.push(r))},this);var execute=function(r,c){Y.each(r,function(r){if(Y.isArray(r[0])){var l=c;Y.each(r,function(r){l=l[r[0]].apply(l,r.slice(1))})}else this[r[0]].apply(this,r.slice(1))},c)};execute(l,this),execute(u,this),execute(p,this)},MixpanelLib.prototype.are_batchers_initialized=function(){return!!this.request_batchers.events},MixpanelLib.prototype.get_batcher_configs=function(){var r=`__mpq_`+this.get_config(`token`);return this._batcher_configs=this._batcher_configs||{events:{type:`events`,api_name:`track`,queue_key:r+`_ev`},people:{type:`people`,api_name:`engage`,queue_key:r+`_pp`},groups:{type:`groups`,api_name:`groups`,queue_key:r+`_gr`}},this._batcher_configs},MixpanelLib.prototype.init_batchers=function(){if(!this.are_batchers_initialized()){var r=Y.bind(function(r){return new RequestBatcher(r.queue_key,{libConfig:this.config,errorReporter:this.get_config(`error_reporter`),sendRequestFunc:Y.bind(function(c,l,u){var p=this.get_config(`api_routes`);this._send_request(this.get_api_host(r.api_name)+`/`+p[r.api_name],this._encode_data_for_request(c),l,this._prepare_callback(u,c))},this),beforeSendHook:Y.bind(function(c){return this._run_hook(`before_send_`+r.type,c)},this),stopAllBatchingFunc:Y.bind(this.stop_batch_senders,this),usePersistence:!0})},this),c=this.get_batcher_configs();this.request_batchers={events:r(c.events),people:r(c.people),groups:r(c.groups)}}this.get_config(`batch_autostart`)&&this.start_batch_senders()},MixpanelLib.prototype.start_batch_senders=function(){this._batchers_were_started=!0,this.are_batchers_initialized()&&(this._batch_requests=!0,Y.each(this.request_batchers,function(r){r.start()}))},MixpanelLib.prototype.stop_batch_senders=function(){this._batch_requests=!1,Y.each(this.request_batchers,function(r){r.stop(),r.clear()})},MixpanelLib.prototype.push=function(r){this._execute_array([r])},MixpanelLib.prototype.disable=function(r){r===void 0?this._flags.disable_all_events=!0:this.__disabled_events=this.__disabled_events.concat(r)},MixpanelLib.prototype._encode_data_for_request=function(r){var c=Hl(r);return this.get_config(`api_payload_format`)===Gd&&(c=Y.base64Encode(c)),{data:c}},MixpanelLib.prototype._track_or_batch=function(r,c){var l=Y.truncate(r.data,255),u=r.endpoint,p=r.batcher,m=r.should_send_immediately,h=r.send_request_options||{};c=c||NOOP_FUNC;var g=!0,v=Y.bind(function(){return h.skip_hooks||(l=this._run_hook(`before_send_`+r.type,l)),l?(X.log(`MIXPANEL REQUEST:`),X.log(l),this._send_request(u,this._encode_data_for_request(l),h,this._prepare_callback(c,l))):null},this);return this._batch_requests&&!m?p.enqueue(l).then(function(r){r?c(1,l):v()}):g=v(),g&&l},MixpanelLib.prototype.track=addOptOutCheckMixpanelLib(function(r,c,l,u){!u&&typeof l==`function`&&(u=l,l=null),l=l||{};var p=l.transport;p&&(l.transport=p);var m=l.send_immediately;if(typeof u!=`function`&&(u=NOOP_FUNC),Y.isUndefined(r)){this.report_error(`No event name provided to mixpanel.track`);return}if(this._event_is_disabled(r)){u(0);return}c=Y.extend({},c),c.token=this.get_config(`token`);var h=this.persistence.remove_event_timer(r);if(!Y.isUndefined(h)){var g=new Date().getTime()-h;c.$duration=parseFloat((g/1e3).toFixed(3))}this._set_default_superprops();var v=this.get_config(`track_marketing`)?Y.info.marketingParams():{};c=Y.extend({},Y.info.properties({mp_loader:this.get_config(`mp_loader`)}),v,this.persistence.properties(),this.unpersisted_superprops,this.get_session_recording_properties(),c);var y=this.get_config(`property_blacklist`);Y.isArray(y)?Y.each(y,function(r){delete c[r]}):this.report_error(`Invalid value for property_blacklist config: `+y);var b={event:r,properties:c};return this._track_or_batch({type:`events`,data:b,endpoint:this.get_api_host(`events`)+`/`+this.get_config(`api_routes`).track,batcher:this.request_batchers.events,should_send_immediately:m,send_request_options:l},u)}),MixpanelLib.prototype.set_group=addOptOutCheckMixpanelLib(function(r,c,l){Y.isArray(c)||(c=[c]);var u={};return u[r]=c,this.register(u),this.people.set(r,c,l)}),MixpanelLib.prototype.add_group=addOptOutCheckMixpanelLib(function(r,c,l){var u=this.get_property(r),p={};return u===void 0?(p[r]=[c],this.register(p)):u.indexOf(c)===-1&&(u.push(c),p[r]=u,this.register(p)),this.people.union(r,c,l)}),MixpanelLib.prototype.remove_group=addOptOutCheckMixpanelLib(function(r,c,l){var u=this.get_property(r);if(u!==void 0){var p=u.indexOf(c);p>-1&&(u.splice(p,1),this.register({group_key:u})),u.length===0&&this.unregister(r)}return this.people.remove(r,c,l)}),MixpanelLib.prototype.track_with_groups=addOptOutCheckMixpanelLib(function(r,c,l,u){var p=Y.extend({},c||{});return Y.each(l,function(r,c){r!=null&&(p[c]=r)}),this.track(r,p,u)}),MixpanelLib.prototype._create_map_key=function(r,c){return r+`_`+JSON.stringify(c)},MixpanelLib.prototype._remove_group_from_cache=function(r,c){delete this._cached_groups[this._create_map_key(r,c)]},MixpanelLib.prototype.get_group=function(r,c){var l=this._create_map_key(r,c),u=this._cached_groups[l];return(u===void 0||u._group_key!==r||u._group_id!==c)&&(u=new MixpanelGroup,u._init(this,r,c),this._cached_groups[l]=u),u},MixpanelLib.prototype.track_pageview=addOptOutCheckMixpanelLib(function(r,c){typeof r!=`object`&&(r={}),c=c||{};var l=c.event_name||`$mp_web_page_view`,u=Y.extend(Y.info.mpPageViewProperties(),Y.info.campaignParams(),Y.info.clickParams()),p=Y.extend({},u,r);return this.track(l,p)}),MixpanelLib.prototype.track_links=function(){return this._track_dom.call(this,LinkTracker,arguments)},MixpanelLib.prototype.track_forms=function(){return this._track_dom.call(this,FormTracker,arguments)},MixpanelLib.prototype.time_event=function(r){if(Y.isUndefined(r)){this.report_error(`No event name provided to mixpanel.time_event`);return}this._event_is_disabled(r)||this.persistence.set_event_timer(r,new Date().getTime())};var $d={persistent:!0},options_for_register=function(r){var c=Y.isObject(r)?r:Y.isUndefined(r)?{}:{days:r};return Y.extend({},$d,c)};MixpanelLib.prototype.register=function(r,c){var l=options_for_register(c);l.persistent?this.persistence.register(r,l.days):Y.extend(this.unpersisted_superprops,r)},MixpanelLib.prototype.register_once=function(r,c,l){var u=options_for_register(l);u.persistent?this.persistence.register_once(r,c,u.days):(c===void 0&&(c=`None`),Y.each(r,function(r,l){(!this.unpersisted_superprops.hasOwnProperty(l)||this.unpersisted_superprops[l]===c)&&(this.unpersisted_superprops[l]=r)},this))},MixpanelLib.prototype.unregister=function(r,c){c=options_for_register(c),c.persistent?this.persistence.unregister(r):delete this.unpersisted_superprops[r]},MixpanelLib.prototype._register_single=function(r,c){var l={};l[r]=c,this.register(l)},MixpanelLib.prototype.identify=function(r,c,l,u,p,m,h,g){var v=this.get_distinct_id();if(r&&v!==r){if(typeof r==`string`&&r.indexOf(qd)===0)return this.report_error(`distinct_id cannot have $device: prefix`),-1;this.register({$user_id:r})}if(!this.get_property(`$device_id`)){var y=v;this.register_once({$had_persisted_distinct_id:!0,$device_id:y},``)}r!==v&&r!==this.get_property(Ld)&&(this.unregister(Ld),this.register({distinct_id:r})),this._flags.identify_called=!0,this.people._flush(c,l,u,p,m,h,g),r!==v&&this.track(`$identify`,{distinct_id:r,$anon_distinct_id:v},{skip_hooks:!0}),r!==v&&this.flags.fetchFlags()},MixpanelLib.prototype.reset=function(){this.stop_session_recording(),this.persistence.clear(),this._flags.identify_called=!1;var r=Y.UUID();this.register_once({distinct_id:qd+r,$device_id:r},``),this._check_and_start_session_recording()},MixpanelLib.prototype.get_distinct_id=function(){return this.get_property(`distinct_id`)},MixpanelLib.prototype.alias=function(r,c){if(r===this.get_property(Id))return this.report_error(`Attempting to create alias for existing People user - aborting.`),-2;var l=this;return Y.isUndefined(c)&&(c=this.get_distinct_id()),r===c?(this.report_error(`alias matches current distinct_id - skipping api call.`),this.identify(r),-1):(this._register_single(Ld,r),this.track(`$create_alias`,{alias:r,distinct_id:c},{skip_hooks:!0},function(){l.identify(r)}))},MixpanelLib.prototype.name_tag=function(r){this._register_single(`mp_name_tag`,r)},MixpanelLib.prototype.set_config=function(r){Y.isObject(r)&&(Y.extend(this.config,r),r.batch_size&&Y.each(this.request_batchers,function(r){r.resetBatchSize()}),this.get_config(`persistence_name`)||(this.config.persistence_name=this.config.cookie_name),this.get_config(`disable_persistence`)||(this.config.disable_persistence=this.config.disable_cookie),this.persistence&&this.persistence.update_config(this.config),hl.DEBUG=hl.DEBUG||this.get_config(`debug`),(`autocapture`in r||`record_heatmap_data`in r)&&this.autocapture&&this.autocapture.init())},MixpanelLib.prototype.get_config=function(r){return this.config[r]},MixpanelLib.prototype._run_hook=function(r){var c=(this.config.hooks[r]||IDENTITY_FUNC).apply(this,xl.call(arguments,1));return c===void 0&&(this.report_error(r+` hook did not return a value`),c=null),c},MixpanelLib.prototype.get_property=function(r){return this.persistence.load_prop([r])},MixpanelLib.prototype.get_api_host=function(r){return this.get_config(`api_hosts`)[r]||this.get_config(`api_host`)},MixpanelLib.prototype.toString=function(){var r=this.get_config(`name`);return r!==Wd&&(r=Wd+`.`+r),r},MixpanelLib.prototype._event_is_disabled=function(r){return Y.isBlockedUA(Dl)||this._flags.disable_all_events||Y.include(this.__disabled_events,r)},MixpanelLib.prototype._gdpr_init=function(){this.get_config(`opt_out_tracking_persistence_type`)===`localStorage`&&Y.localStorage.is_supported()&&(!this.has_opted_in_tracking()&&this.has_opted_in_tracking({persistence_type:`cookie`})&&this.opt_in_tracking({enable_persistence:!1}),!this.has_opted_out_tracking()&&this.has_opted_out_tracking({persistence_type:`cookie`})&&this.opt_out_tracking({clear_persistence:!1}),this.clear_opt_in_out_tracking({persistence_type:`cookie`,enable_persistence:!1})),this.has_opted_out_tracking()?this._gdpr_update_persistence({clear_persistence:!0}):!this.has_opted_in_tracking()&&(this.get_config(`opt_out_tracking_by_default`)||Y.cookie.get(`mp_optout`))&&(Y.cookie.remove(`mp_optout`),this.opt_out_tracking({clear_persistence:this.get_config(`opt_out_persistence_by_default`)}))},MixpanelLib.prototype._gdpr_update_persistence=function(r){var c;if(r&&r.clear_persistence)c=!0;else if(r&&r.enable_persistence)c=!1;else return;!this.get_config(`disable_persistence`)&&this.persistence.disabled!==c&&this.persistence.set_disabled(c),c?(this.stop_batch_senders(),this.stop_session_recording()):this._batchers_were_started&&this.start_batch_senders()},MixpanelLib.prototype._gdpr_call_func=function(r,c){return c=Y.extend({track:Y.bind(this.track,this),persistence_type:this.get_config(`opt_out_tracking_persistence_type`),cookie_prefix:this.get_config(`opt_out_tracking_cookie_prefix`),cookie_expiration:this.get_config(`cookie_expiration`),cross_site_cookie:this.get_config(`cross_site_cookie`),cross_subdomain_cookie:this.get_config(`cross_subdomain_cookie`),cookie_domain:this.get_config(`cookie_domain`),secure_cookie:this.get_config(`secure_cookie`),ignore_dnt:this.get_config(`ignore_dnt`)},c),Y.localStorage.is_supported()||(c.persistence_type=`cookie`),r(this.get_config(`token`),{track:c.track,trackEventName:c.track_event_name,trackProperties:c.track_properties,persistenceType:c.persistence_type,persistencePrefix:c.cookie_prefix,cookieDomain:c.cookie_domain,cookieExpiration:c.cookie_expiration,crossSiteCookie:c.cross_site_cookie,crossSubdomainCookie:c.cross_subdomain_cookie,secureCookie:c.secure_cookie,ignoreDnt:c.ignore_dnt})},MixpanelLib.prototype.opt_in_tracking=function(r){r=Y.extend({enable_persistence:!0},r),this._gdpr_call_func(optIn,r),this._gdpr_update_persistence(r)},MixpanelLib.prototype.opt_out_tracking=function(r){r=Y.extend({clear_persistence:!0,delete_user:!0},r),r.delete_user&&this.people&&this.people._identify_called()&&(this.people.delete_user(),this.people.clear_charges()),this._gdpr_call_func(optOut,r),this._gdpr_update_persistence(r)},MixpanelLib.prototype.has_opted_in_tracking=function(r){return this._gdpr_call_func(hasOptedIn,r)},MixpanelLib.prototype.has_opted_out_tracking=function(r){return this._gdpr_call_func(hasOptedOut,r)},MixpanelLib.prototype.clear_opt_in_out_tracking=function(r){r=Y.extend({enable_persistence:!0},r),this._gdpr_call_func(clearOptInOut,r),this._gdpr_update_persistence(r)},MixpanelLib.prototype.report_error=function(r,c){X.error.apply(X.error,arguments);try{!c&&!(r instanceof Error)&&(r=Error(r)),this.get_config(`error_reporter`)(r,c)}catch(r){X.error(r)}},MixpanelLib.prototype.init=MixpanelLib.prototype.init,MixpanelLib.prototype.reset=MixpanelLib.prototype.reset,MixpanelLib.prototype.disable=MixpanelLib.prototype.disable,MixpanelLib.prototype.time_event=MixpanelLib.prototype.time_event,MixpanelLib.prototype.track=MixpanelLib.prototype.track,MixpanelLib.prototype.track_links=MixpanelLib.prototype.track_links,MixpanelLib.prototype.track_forms=MixpanelLib.prototype.track_forms,MixpanelLib.prototype.track_pageview=MixpanelLib.prototype.track_pageview,MixpanelLib.prototype.register=MixpanelLib.prototype.register,MixpanelLib.prototype.register_once=MixpanelLib.prototype.register_once,MixpanelLib.prototype.unregister=MixpanelLib.prototype.unregister,MixpanelLib.prototype.identify=MixpanelLib.prototype.identify,MixpanelLib.prototype.alias=MixpanelLib.prototype.alias,MixpanelLib.prototype.name_tag=MixpanelLib.prototype.name_tag,MixpanelLib.prototype.set_config=MixpanelLib.prototype.set_config,MixpanelLib.prototype.get_config=MixpanelLib.prototype.get_config,MixpanelLib.prototype.get_api_host=MixpanelLib.prototype.get_api_host,MixpanelLib.prototype.get_property=MixpanelLib.prototype.get_property,MixpanelLib.prototype.get_distinct_id=MixpanelLib.prototype.get_distinct_id,MixpanelLib.prototype.toString=MixpanelLib.prototype.toString,MixpanelLib.prototype.opt_out_tracking=MixpanelLib.prototype.opt_out_tracking,MixpanelLib.prototype.opt_in_tracking=MixpanelLib.prototype.opt_in_tracking,MixpanelLib.prototype.has_opted_out_tracking=MixpanelLib.prototype.has_opted_out_tracking,MixpanelLib.prototype.has_opted_in_tracking=MixpanelLib.prototype.has_opted_in_tracking,MixpanelLib.prototype.clear_opt_in_out_tracking=MixpanelLib.prototype.clear_opt_in_out_tracking,MixpanelLib.prototype.get_group=MixpanelLib.prototype.get_group,MixpanelLib.prototype.set_group=MixpanelLib.prototype.set_group,MixpanelLib.prototype.add_group=MixpanelLib.prototype.add_group,MixpanelLib.prototype.remove_group=MixpanelLib.prototype.remove_group,MixpanelLib.prototype.track_with_groups=MixpanelLib.prototype.track_with_groups,MixpanelLib.prototype.start_batch_senders=MixpanelLib.prototype.start_batch_senders,MixpanelLib.prototype.stop_batch_senders=MixpanelLib.prototype.stop_batch_senders,MixpanelLib.prototype.start_session_recording=MixpanelLib.prototype.start_session_recording,MixpanelLib.prototype.stop_session_recording=MixpanelLib.prototype.stop_session_recording,MixpanelLib.prototype.pause_session_recording=MixpanelLib.prototype.pause_session_recording,MixpanelLib.prototype.resume_session_recording=MixpanelLib.prototype.resume_session_recording,MixpanelLib.prototype.get_session_recording_properties=MixpanelLib.prototype.get_session_recording_properties,MixpanelLib.prototype.get_session_replay_url=MixpanelLib.prototype.get_session_replay_url,MixpanelLib.prototype.get_tab_id=MixpanelLib.prototype.get_tab_id,MixpanelLib.prototype.DEFAULT_API_ROUTES=Xd,MixpanelLib.prototype.__get_recorder=MixpanelLib.prototype.__get_recorder,MixpanelPersistence.prototype.properties=MixpanelPersistence.prototype.properties,MixpanelPersistence.prototype.update_search_keyword=MixpanelPersistence.prototype.update_search_keyword,MixpanelPersistence.prototype.update_referrer_info=MixpanelPersistence.prototype.update_referrer_info,MixpanelPersistence.prototype.get_cross_subdomain=MixpanelPersistence.prototype.get_cross_subdomain,MixpanelPersistence.prototype.clear=MixpanelPersistence.prototype.clear;var ef={},extend_mp=function(){Y.each(ef,function(r,c){c!==Wd&&(Vd[c]=r)}),Vd._=Y},override_mp_init_func=function(){Vd.init=function(r,c,l){if(l)return Vd[l]||(Vd[l]=ef[l]=create_mplib(r,c,l),Vd[l]._loaded()),Vd[l];var u=Vd;ef[Wd]?u=ef[Wd]:r&&(u=create_mplib(r,c,Wd),u._loaded(),ef[Wd]=u),Vd=u,Bd===Ud&&(P[Wd]=Vd),extend_mp()}},add_dom_loaded_handler=function(){function dom_loaded_handler(){dom_loaded_handler.done||(dom_loaded_handler.done=!0,Qd=!0,Yd=!1,Y.each(ef,function(r){r._dom_loaded()}))}function do_scroll_check(){try{J.documentElement.doScroll(`left`)}catch(r){setTimeout(do_scroll_check,1);return}dom_loaded_handler()}if(J.addEventListener)J.readyState===`complete`?dom_loaded_handler():J.addEventListener(`DOMContentLoaded`,dom_loaded_handler,!1);else if(J.attachEvent){J.attachEvent(`onreadystatechange`,dom_loaded_handler);var r=!1;try{r=P.frameElement===null}catch(r){}J.documentElement.doScroll&&r&&do_scroll_check()}Y.register_event(P,`load`,dom_loaded_handler,!0)};function init_as_module(r){return load_extra_bundle=r,Bd=Hd,Vd=new MixpanelLib,override_mp_init_func(),Vd.init(),add_dom_loaded_handler(),Vd}function loadNoop(r,c){c()}var tf=init_as_module(loadNoop),nf=Object.freeze([`free`,`essential`,`essential-oct2023`,`advanced`,`expert`,`agency`]),rf=Object.freeze(nf.reduce(function(r,c){return r[c]=c,r},{}));T();function ownKeys(r,c){var l=Object.keys(r);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(r);c&&(u=u.filter(function(c){return Object.getOwnPropertyDescriptor(r,c).enumerable})),l.push.apply(l,u)}return l}function _objectSpread(r){for(var c=1;c<arguments.length;c++){var l=arguments[c]==null?{}:arguments[c];c%2?ownKeys(Object(l),!0).forEach(function(c){_defineProperty(r,c,l[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(l)):ownKeys(Object(l)).forEach(function(c){Object.defineProperty(r,c,Object.getOwnPropertyDescriptor(l,c))})}return r}function _callSuper$1(r,c,l){return c=_getPrototypeOf(c),_possibleConstructorReturn(r,_isNativeReflectConstruct$1()?Reflect.construct(c,l||[],_getPrototypeOf(r).constructor):c.apply(r,l))}__name(_callSuper$1,`_callSuper`);function _isNativeReflectConstruct$1(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(r){}return(_isNativeReflectConstruct$1=function _isNativeReflectConstruct(){return!!r})()}__name(_isNativeReflectConstruct$1,`_isNativeReflectConstruct`);var $=null,af=function(r){function _default(){var r;_classCallCheck(this,_default);for(var c=arguments.length,l=Array(c),u=0;u<c;u++)l[u]=arguments[u];return r=_callSuper$1(this,_default,[].concat(l)),_defineProperty(r,`trackingEnabled`,!1),_defineProperty(r,`availableExperiments`,[]),r}return _inherits$1(_default,r),_createClass(_default,[{key:`onInit`,value:function onInit(){var r=this;this.config=et,this.canSendEvents()&&this.initializeMixpanel(function(){return r.enableTracking()})}},{key:`initializeMixpanel`,value:function initializeMixpanel(r){if($&&$.isInitialized)r($);else{var c,l,u,p,m,h,g;$=tf.init((c=elementorCommon.config.editor_events)==null?void 0:c.token,{persistence:`localStorage`,persistence_name:`elementor-builder-editor`,debug:(l=(u=elementorCommon.config.editor_events)==null?void 0:u.debug)!=null&&l,autocapture:!1,flags:!0,api_host:(p=elementorCommon.config.editor_events)==null?void 0:p.proxy_api_host,lib_base_path:(m=elementorCommon.config.editor_events)==null?void 0:m.proxy_lib_base_path,loaded:r,record_sessions_percent:(h=(g=elementorCommon.config.editor_events)==null?void 0:g.session_recording_percent)==null?0:h,record_idle_timeout_ms:60*1e3,record_min_ms:5*1e3,record_mask_text_selector:``,remote_settings_mode:`strict`},`elementor-builder-editor`)}elementorCommon.config.editor_events.mixpanelInstance=$}},{key:`enableTracking`,value:function enableTracking(){var r;if(this.isMixpanelReady()){var c=(r=elementorCommon.config.editor_events)==null?void 0:r.user_id;if($.register({appType:`Editor`}),c){var l;$.identify(c),$.people.set_once({$user_id:c,$last_login:new Date().toISOString(),$plan_type:((l=elementorCommon.config.library_connect)==null?void 0:l.plan_type)||rf.free})}this.trackingEnabled=!0,this.availableExperiments=Object.keys(elementorCommon.config.experimentalFeatures||{})}}},{key:`dispatchEvent`,value:function dispatchEvent(r,c){var l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(this.canSendEvents())try{var u,p,m,h,g,v,y,b,x;this.trackingEnabled||this.enableTracking();var S=_objectSpread({user_id:((u=elementorCommon.config.editor_events)==null?void 0:u.user_id)||null,user_roles:((p=elementorCommon.config.library_connect)==null?void 0:p.user_roles)||[],subscription_id:((m=elementorCommon.config.editor_events)==null?void 0:m.subscription_id)||null,user_tier:((h=elementorCommon.config.library_connect)==null?void 0:h.current_access_tier)||null,url:(g=elementorCommon.config.editor_events)==null?void 0:g.site_url,wp_version:(v=elementorCommon.config.editor_events)==null?void 0:v.wp_version,client_id:(y=elementorCommon.config.editor_events)==null?void 0:y.site_key,app_version:(b=elementorCommon.config.editor_events)==null?void 0:b.elementor_version,site_language:(x=elementorCommon.config.editor_events)==null?void 0:x.site_language,experiments:this.availableExperiments},c);$.track(r,S,l)}catch(r){var C;(C=elementorCommon.config.editor_events)!=null&&C.debug&&console.error(`Events Manager dispatch failed:`,r)}}},{key:`featureFlagIsActive`,value:function(){var r=_asyncToGenerator(ze.default.mark(function _callee(r){var c,l;return ze.default.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(typeof((c=$)==null||(c=c.flags)==null?void 0:c.is_enabled)==`function`){u.next=1;break}return u.abrupt(`return`,!1);case 1:return u.next=2,$.flags.is_enabled(r,!1);case 2:return l=u.sent,u.abrupt(`return`,!0===l);case 3:case`end`:return u.stop()}},_callee)}));function featureFlagIsActive(c){return r.apply(this,arguments)}return featureFlagIsActive}()},{key:`getExperimentVariant`,value:function(){var r=_asyncToGenerator(ze.default.mark(function _callee2(r){var c,l,u,p,m,h=arguments;return ze.default.wrap(function(g){for(;;)switch(g.prev=g.next){case 0:if(c=h.length>1&&h[1]!==void 0?h[1]:`control`,g.prev=1,this.canSendEvents()){g.next=2;break}return g.abrupt(`return`,c);case 2:if(p=(l=(u=elementorCommon.config.editor_events)==null?void 0:u.flags_enabled)!=null&&l,p){g.next=3;break}return g.abrupt(`return`,c);case 3:if($){g.next=4;break}return g.abrupt(`return`,c);case 4:if(this.trackingEnabled||this.enableTracking(),$.flags){g.next=5;break}return g.abrupt(`return`,c);case 5:if(typeof $.flags.get_variant_value==`function`){g.next=6;break}return g.abrupt(`return`,c);case 6:return g.next=7,$.flags.get_variant_value(r,c);case 7:if(m=g.sent,m!=null){g.next=8;break}return g.abrupt(`return`,c);case 8:return g.abrupt(`return`,m);case 9:return g.prev=9,g.catch(1),g.abrupt(`return`,c);case 10:case`end`:return g.stop()}},_callee2,this,[[1,9]])}));function getExperimentVariant(c){return r.apply(this,arguments)}return getExperimentVariant}()},{key:`startExperiment`,value:function startExperiment(r,c){this.trackingEnabled&&$.track(`$experiment_started`,{"Experiment name":r,"Variant name":c})}},{key:`isMixpanelReady`,value:function isMixpanelReady(){if($===void 0||!$)return!1;try{return $.get_distinct_id()!=null}catch(r){return!1}}},{key:`canSendEvents`,value:function canSendEvents(){var r;return!!((r=elementorCommon)!=null&&(r=r.config)!=null&&(r=r.editor_events)!=null&&r.can_send_events)}},{key:`getMixpanelInstance`,value:function getMixpanelInstance(){return this.isMixpanelReady()?$:void 0}}])}(elementorModules.Module),of=__toESM(__commonJSMin(((r,c)=>{T();function ownKeys(r,c){var l=Object.keys(r);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(r);c&&(u=u.filter(function(c){return Object.getOwnPropertyDescriptor(r,c).enumerable})),l.push.apply(l,u)}return l}function _objectSpread(r){for(var c=1;c<arguments.length;c++){var l=arguments[c]==null?{}:arguments[c];c%2?ownKeys(Object(l),!0).forEach(function(c){_defineProperty(r,c,l[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(l)):ownKeys(Object(l)).forEach(function(c){Object.defineProperty(r,c,Object.getOwnPropertyDescriptor(l,c))})}return r}c.exports=elementorModules.Module.extend({initToast:function initToast(){var r=elementorCommon.dialogsManager.createWidget(`buttons`,{id:`elementor-toast`,position:{my:`center bottom`,at:`center bottom-10`,of:`#elementor-panel-inner`,autoRefresh:!0},hide:{onClick:!0,auto:!0,autoDelay:1e4},effects:{show:function show(){var c=r.getElements(`widget`);c.show(),r.refreshPosition();var l=parseInt(c.css(`top`),10);c.hide().css(`top`,l+100),c.animate({opacity:`show`,height:`show`,paddingBottom:`show`,paddingTop:`show`,top:l},{easing:`linear`,duration:300})},hide:function hide(){var c=r.getElements(`widget`),l=parseInt(c.css(`top`),10);c.animate({opacity:`hide`,height:`hide`,paddingBottom:`hide`,paddingTop:`hide`,top:l+100},{easing:`linear`,duration:300})}},button:{tag:`button`}});r.getElements(`widget`).attr({role:`status`,"aria-live":`polite`,"aria-atomic":`true`}),this.getToast=function(){return r}},showToast:function showToast(r){var c=this.getToast();c.setMessage(r.message),c.getElements(`buttonsWrapper`).empty(),c.focusedButton=null,c.buttons=[];var l=this.isPositionValid(r==null?void 0:r.position);return l||this.positionToWindow(),r!=null&&r.position&&l&&c.setSettings(`position`,r.position),r.buttons&&r.buttons.forEach(function(r){c.addButton(r)}),r.classes&&c.getElements(`widget`).addClass(r.classes),r.sticky&&c.setSettings({hide:{auto:!1,onClick:!1}}),c.show()},isPositionValid:function isPositionValid(r){var c,l=(c=r==null?void 0:r.of)==null?this.getToast().getSettings(`position`).of:c;return l?!!document.querySelector(l):!1},positionToWindow:function positionToWindow(){var r=this.getToast(),c=_objectSpread(_objectSpread({},r.getSettings(`position`)),{},{my:`right top`,at:`right-10 top+42`,of:``});r.setSettings(`position`,c),r.getElements(`widget`).addClass(`dialog-position-window`)},onInit:function onInit(){this.initToast()}})}))());function _callSuper(r,c,l){return c=_getPrototypeOf(c),_possibleConstructorReturn(r,_isNativeReflectConstruct()?Reflect.construct(c,l||[],_getPrototypeOf(r).constructor):c.apply(r,l))}function _isNativeReflectConstruct(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(r){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!r})()}function _superPropGet(r,c,l,u){var p=_get(_getPrototypeOf(1&u?r.prototype:r),c,l);return 2&u&&typeof p==`function`?function(r){return p.apply(l,r)}:p}var sf=function(r){function ElementorCommonApp(){return _classCallCheck(this,ElementorCommonApp),_callSuper(this,ElementorCommonApp,arguments)}return _inherits$1(ElementorCommonApp,r),_createClass(ElementorCommonApp,[{key:`setMarionetteTemplateCompiler`,value:function setMarionetteTemplateCompiler(){Marionette.TemplateCache.prototype.loadTemplate=function(r){var c=r.charAt(0)===`#`?Backbone.$(`script`+r):Backbone.$(r);if(!c.length)throw new Marionette.Error({name:`NoTemplateError`,message:`Could not find template: "`+r+`"`});return c.html()},Marionette.TemplateCache.prototype.compileTemplate=function(r,c){return c={evaluate:/<#([\s\S]+?)#>/g,interpolate:/{{{([\s\S]+?)}}}/g,escape:/{{([^}]+?)}}(?!})/g},_.template(r,c)}}},{key:`getDefaultElements`,value:function getDefaultElements(){return{$window:jQuery(window),$document:jQuery(document),$body:jQuery(document.body)}}},{key:`initComponents`,value:function initComponents(){this.events=new Qe,this.eventsManager=new af,this.debug=new C.default,this.helpers=new x,this.storage=new S,this.dialogsManager=new DialogsManager.Instance,this.notifications=new of.default,this.api=window.$e,$e.components.register(new Ze),elementorCommon.elements.$window.on(`elementor:init-components`,function(){$e.components.register(new Je)}),this.initModules()}},{key:`initModules`,value:function initModules(){var r=this,c=this.config.activeModules,l={ajax:w,finder:De,connect:Oe};c.forEach(function(c){l[c]&&(r[c]=new l[c](r.config[c]))})}},{key:`compileArrayTemplateArgs`,value:function compileArrayTemplateArgs(r,c){return r.replace(/%(?:(\d+)\$)?s/g,function(r,l){return l||(l=1),l--,c[l]===void 0?r:c[l]})}},{key:`compileObjectTemplateArgs`,value:function compileObjectTemplateArgs(r,c){return r.replace(/{{(?:([ \w]+))}}/g,function(r,l){return c[l]?c[l]:r})}},{key:`compileTemplate`,value:function compileTemplate(r,c){return jQuery.isPlainObject(c)?this.compileObjectTemplateArgs(r,c):this.compileArrayTemplateArgs(r,c)}},{key:`translate`,value:function translate(r,c,l,u){c&&(u=this.config[c].i18n),u||(u=this.config.i18n);var p=u[r];return p===void 0&&(p=r),l&&(p=this.compileTemplate(p,l)),p}},{key:`onInit`,value:function onInit(){_superPropGet(ElementorCommonApp,`onInit`,this,3)([]),this.config=elementorCommonConfig,this.setMarionetteTemplateCompiler()}}])}(elementorModules.ViewModule);window.elementorCommon=new sf,elementorCommon.initComponents()})(elementorVendors.reduxToolkit,wp.i18n); |